Search completed in 1.05 seconds.
2212 results for "open":
Your results are loading. Please wait...
Window.open() - Web APIs
Web › API › Window › open
the window interface's open() method loads the specified resource into the new or existing browsing context (window, <iframe> or tab) with the specified name. if the name doesn't exist, then a new browsing context is opened in a new tab or a new window, and the specified resource is loaded into it. syntax var window = window.open(url, windowname, [windowfeatures]); parameters url a domstring indicating the url of the resource to be loaded. this can be a path or url to an html page, image file, or any other resource that is supported by the browser. if the empty string ("") is specified as url, a blank page is opened into the targeted browsing context. windowname optional a domstring specifying the name of the browsing context (window, <iframe> or tab) into which to load the specified...
...lt size and position, whether or not to include toolbar, and so forth. there must be no whitespace in the string. see window features below for documentation of each of the features that can be specified. return value a windowproxy object, which is basically a thin wrapper for the window object representing the newly created window, and has all its features available. if the window couldn't be opened, the returned value is instead null. the returned reference can be used to access properties and methods of the new window as long as it complies with same-origin policy security requirements. description the open() method creates a new secondary browser window, similar to choosing new window from the file menu. the url parameter specifies the url to be fetched and loaded in the new window. i...
...nts. description the open() method creates a new secondary browser window, similar to choosing new window from the file menu. the url parameter specifies the url to be fetched and loaded in the new window. if url is an empty string, then a new blank, empty window (url about:blank) is created with the default toolbars of the main window. note that remote urls won't load immediately. when window.open() returns, the window always contains about:blank. the actual fetching of the url is deferred and starts after the current script block finishes executing. the window creation and the loading of the referenced resource are done asynchronously. ...
...And 44 more matches
OpenClose - Archive of obsolete content
opening and closing popups popups and menus may be opened and closed by a script. opening menus menus will display themselves automatically when needed without extra work. for instance, a menu's popup will open when the menu label is clicked, and a submenu will open when the mouse is hovered over the parent menu element. however, there may be situations when you wish to open a menu manually. the menu element has an open property which may be set to true to open the menu, or false to close the menu. a simple example: somemenu.open = true; this single line of code will open a menu referenced by the variable 'somemenu'. note that the open property applies to the menu or button, not to the menupopup. ...
...n you wish to open a menu manually. the menu element has an open property which may be set to true to open the menu, or false to close the menu. a simple example: somemenu.open = true; this single line of code will open a menu referenced by the variable 'somemenu'. note that the open property applies to the menu or button, not to the menupopup. here is a complete example which uses a button to open a menu: <button label="open menu" oncommand="document.getelementbyid('editmenu').open = true;"/> <menu id="editmenu" label="edit"> <menupopup> <menuitem label="cut"/> <menuitem label="copy"/> <menuitem label="paste"/> </menupopup> </menu> this technique may be used for both menupopups that use the menu tag, the button tag and the toolbarbutton tag. for menupopups attac...
...etelementbyid('editmenu').open = true;"/> <menu id="editmenu" label="edit"> <menupopup> <menuitem label="cut"/> <menuitem label="copy"/> <menuitem label="paste"/> </menupopup> </menu> this technique may be used for both menupopups that use the menu tag, the button tag and the toolbarbutton tag. for menupopups attached to other elements using the popup or context attributes, see opening a popup below. as with other ways of opening a menu, the popupshowing event will be fired to provide an opportunity to customize the commands that appear on the menu. there are several situations when opening a menu is not allowed. these are: if the menu is already open, or already in the process of being opened. ...
...And 31 more matches
Appendix: What you should know about open-source software licenses - Archive of obsolete content
appendix: what you should know about open-source software licenses draft this page is not complete. this document was authored by yutaka kachi and was originally published in japanese for the firefox developers conference summer 2007. any discussion of open-source software deserves an explanation of licensing-related issues. in this chapter, i’ll explain some of the basics: what open-source software (oss) licenses are, what types of licenses exist, and when they’re appropriate. ...
...sing-related issues. in this chapter, i’ll explain some of the basics: what open-source software (oss) licenses are, what types of licenses exist, and when they’re appropriate. what is an oss license? what are the different kinds of oss licenses and what are their key characteristics? applying an oss license oss licensing today and in the future references what is an oss license? an open-source software license is a statement that anyone is free to use your source code in whatever way they want. the open source definition states what conditions the oss license must satisfy. perhaps surprisingly, these licenses enforce their terms through the exercise of copyright. understanding copyright all software licenses, not just open source, enforce their terms based on copyright. it’s...
... any oss license will include these rights. the us...
...And 21 more matches
OpenSearch description format
the opensearch description format lets a website describe a search engine for itself, so that a browser or other client application can use that search engine. opensearch is supported by (at least) firefox, edge, internet explorer, safari, and chrome. (see reference material for links to other browsers' documentation.) firefox also supports additional features not in the opensearch standard, such as search suggestions and the <searchform> element. this article focuses on creating opensearch-compatible search plugins that support these additional firefox features. opensearch description files can be advertised as described in autodiscovery of search plugins, and can be installed programmatically as described in adding search engines from web pages. ...
...es not in the opensearch standard, such as search suggestions and the <searchform> element. this article focuses on creating opensearch-compatible search plugins that support these additional firefox features. opensearch description files can be advertised as described in autodiscovery of search plugins, and can be installed programmatically as described in adding search engines from web pages. opensearch description file the xml file that describes a search engine follows the basic template below. sections in [square brackets] should be customized for the specific plugin you're writing. ...
...features. opensearch description files can be advertised as described in autodiscovery of search plugins, and can be installed programmatically as described in adding search engines from web pages. opensearch description file the xml file that describes a search engine follows the basic template below. sections in [square brackets] should be customized for the specific plugin you're writing. ...
...And 12 more matches
IDBOpenDBRequest - Web APIs
note: this feature is available in web workers. ...
... note: this feature is available in web workers. ...
... note: this feature is available in web workers. ...
...And 10 more matches
IDBFactory.open() - Web APIs
Web › API › IDBFactory › open
the open() method of the idbfactory interface requests opening a connection to a database. the method returns an idbopendbrequest object immediately, and performs the open operation asynchronously. if the operation is successful, a success event is fired on the request object that is returned from this method, with its result attribute set to the new idbdatabase object for the connection. if an error occurs while the database connection is being opened, then an error event is fired on the request object returned from this method. may trigger upgradeneeded, blocked or versionchange events. note: this feature is available in web workers. ...
...ed from this method, with its result attribute set to the new idbdatabase object for the connection. if an error occurs while the database connection is being opened, then an error event is fired on the request object returned from this method. may trigger upgradeneeded, blocked or versionchange events. note: this feature is available in web workers. syntax for the current standard: var idbopendbrequest = indexeddb.open(name); var idbopendbrequest = indexeddb.open(name, version); parameters name the name of the database. version optional optional. the version to open the database with. if the version is not provided and the database exists, then a connection to the database will be opened without changing its version. if the version is not provided and the database does not exis...
... warning: the storage attribute is deprecated and will soon be removed from gecko. you should use storagemanager.persist() to get persistent storage instead. ...
...And 9 more matches
PR_Open
note: the constants pr_rdwr and friends are not in any interface (bug 433295). thus they cannot be used in javascript, you have to use the octal constants (see file i/o snippets). ...
... note: the constants pr_rdwr and friends are not in any interface (bug 433295). thus they cannot be used in javascript, you have to use the octal constants (see file i/o snippets). ...
...printn mode); parameters the function has the following parameters: name the pathname of the file to be opened. flags the file status flags define how the file is accessed. it is a bitwise or of the following bit flags. in most cases, only one of the first three flags may be used. if the flags parameter does not include any of the first three flags (pr_rdonly, pr_wronly, or pr_rdwr), the open file can't be read or written, which is not useful. note: the constants pr_rdwr and friends are not in any interface (bug 433295). thus they cannot be used in javascript, you have to use the octal constants (see file i/o snippets). ...
...And 6 more matches
IDBOpenDBRequest: upgradeneeded event - Web APIs
the upgradeneeded event is fired when an attempt was made to open a database with a version number higher than its current version. bubbles no cancelable no interface event event handler onupgradeneeded examples this example opens a database and handles the upgradeneeded event by making any necessary updates to the object store. ...
... the upgradeneeded event is fired when an attempt was made to open a database with a version number higher than its current version. bubbles no cancelable no interface event event handler onupgradeneeded examples this example opens a database and handles the upgradeneeded event by making any necessary updates to the object store. ...
...event is fired when an attempt was made to open a database with a version number higher than its current version. bubbles no cancelable no interface event event handler onupgradeneeded examples this example opens a database and handles the upgradeneeded event by making any necessary updates to the object store. ...
...And 6 more matches
OpenType font features guide - CSS: Cascading Style Sheets
font features or variants refer to different glyphs or character styles contained within an opentype font. these include things like ligatures (special glyphs that combine characters like 'fi' or 'ffl'), kerning (adjustments to the spacing between specific letterform pairings), fractions, numeral styles, and a number of others. these are all referred to as opentype features, and are made available to use on the web via specific properties and a low-level control property — font-feature-settings. this article provides you with all you need to know about using opentype font features in css. some fonts will have one or more of these features enabled by default (kerning and default ligatures are common examples), while others are left to the designer or developer to choose to enable in specifi...
...es such as stylistic sets (which might include several specific variants of glyphs meant to be used together), alternates (which might be one or more variants of the letter 'a'), or even language-specific alterations for east asian languages. in the latter case, these alterations are actually necessary to properly express the language, so they go beyond the more stylistic preference of most other opentype features. caution: there are many css attributes defined to leverage font features, but unfortunately many are not fully implemented. they are all defined and shown here, but many will only work using the lower-level font-feature-settings property. it's possible to write css to work both ways but this can become cumbersome. the issue with simply using font-feature-settings for everything is...
...ing them as 'tabular numbers' will make them line up better when setting a list of costs in a table say. 'lining' figures on the other hand sit more uniformly on their own or in front of capitalized words. while none of these features individually will render a site useless due to their absence, each of them in turn can make a site easier to use and more memorable for its attention to detail. opentype features are like secret compartments in fonts. unlock them and you'll find ways to make fonts look and behave differently in subtle and dramatic ways. not all opentype features are appropriate to use all of the time, but some features are critical for great typography. -- tim brown, head of typography at adobe. sometimes it's substance, not just style there are some cases — like with fo...
...And 6 more matches
IDBIndex.openKeyCursor() - Web APIs
the method sets the position of the cursor to the appropriate key, based on the specified direction. if the key range is not specified or is null, then the range includes all the keys. a success event is always fired on the result object. if at least one key matches the key range, then the result property of the event is set to the new idbcursor object; the key property of the cursor object is set to the found key and the primarykey property is set to the the corresponding primary key of the found record. ...
...f at least one key matches the key range, then the result property of the event is set to the new idbcursor object; the key property of the cursor object is set to the found key and the primarykey property is set to the the corresponding primary key of the found record. if no keys match the key range, then then the result property of the event is set to null. ...
...he event is set to the new idbcursor object; the key property of the cursor object is set to the found key and the primarykey property is set to the the corresponding primary key of the found record. if no keys match the key range, then then the result property of the event is set to null. note: cursors returned by openkeycursor() do not make the referenced value available as idbindex.opencursor does. this makes obtaining a list of keys much more efficient. note: this feature is available in web workers. syntax var request = myindex.openkeycursor(); var request = myindex.openkeycursor(range); var request = myindex.openkeycursor(range, direction); parameters range optional a key or idbkeyrange to use as the cursor's range. if nothing is passed, this will default to a key ra...
...And 5 more matches
IDBOpenDBRequest: blocked event - Web APIs
the blocked handler is executed when an open connection to a database is blocking a versionchange transaction on the same database. ...
... the blocked handler is executed when an open connection to a database is blocking a versionchange transaction on the same database. ...
... the blocked handler is executed when an open connection to a database is blocking a versionchange transaction on the same database. ...
...And 5 more matches
Window.openDialog() - Web APIs
Web › API › Window › openDialog
if you want the call to block until the user has closed the dialog, supply modal as a windowfeatures parameter. ...
...ted a little differently. the optional parameters, if present, are bundled up in a javascript array object and added to the newly created window as a property named window.arguments. they may be referenced in the javascript of the window at any time, including during the execution of a load handler. these parameters may be used, then, to pass arguments to and from the dialog window. ...
...vascript of the window at any time, including during the execution of a load handler. these parameters may be used, then, to pass arguments to and from the dialog window. the call to opendialog() returns immediately. if you want the call to block until the user has closed the dialog, supply modal as a windowfeatures parameter. note that this also means the user won't be able to interact with the opener window until he closes the modal dialog. syntax newwindow = opendialog(url, name, features, arg1, arg2, ...) newwindow the opened window url the url to be loaded in the newly opened window. name the window name (optional). see window.open() description for detailed information. features see window.open() for details. arg1, arg2, ... the arguments to be passed to the new window (o...
...And 5 more matches
AudioBufferSourceNode.loopEnd - Web APIs
this property is only used if the loop property is true. the default value is 0. ...
...this property is only used if the loop property is true. the default value is 0. ...
...this property is only used if the loop property is true. the default value is 0. ...
...And 4 more matches
IDBIndex.openCursor() - Web APIs
the method sets the position of the cursor to the appropriate record, based on the specified direction. if the key range is not specified or is null, then the range includes all the records. a success event is always fired on the result object. if at least one record matches the key range, then the result property of the event is set to the new idbcursorwithvalue object; the value of the cursor object is set to a structured clone of the referenced value. if no records match the key range then then the result property of the event is set to null. note: this feature is available in web workers. ...
... if at least one record matches the key range, then the result property of the event is set to the new idbcursorwithvalue object; the value of the cursor object is set to a structured clone of the referenced value. if no records match the key range then then the result property of the event is set to null. note: this feature is available in web workers. syntax var request = myindex.opencursor(); var request = myindex.opencursor(range); var request = myindex.opencursor(range, direction); parameters range optional a key or idbkeyrange to use as the cursor's range. if nothing is passed, this will default to a key range that selects all the records in this object store. direction optional the cursor's direction. see idbcursor constants for possible values. return value an ...
...g types: exception description transactioninactiveerror this idbindex's transaction is inactive. typeerror the value for the direction parameter is invalid. dataerror the key or key range provided contains an invalid key. invalidstateerror the idbindex has been deleted or removed. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. we then open a basic cursor on the index using opencursor() — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the index, not the primary key. finally, we iterate through each record, and insert the d...
...And 4 more matches
IDBKeyRange.lowerOpen - Web APIs
the loweropen read-only property of the idbkeyrange interface returns a boolean indicating whether the lower-bound value is included in the key range. note: this feature is available in web workers. syntax var loweropen = mykeyrange.loweropen value a boolean: value indication true the lower-bound value is not included in the key range. false the lower-bound value is included in the key range. example the following example illustrates how you'd use a key range. here we declare keyrangevalue = idbkeyrange.upperbound("f", "w", true, true); — a range that includes everything between "f" and "w" but not including them — since both the upper and lower bounds have been declared as open (true). ...
...y range. false the lower-bound value is included in the key range. example the following example illustrates how you'd use a key range. here we declare keyrangevalue = idbkeyrange.upperbound("f", "w", true, true); — a range that includes everything between "f" and "w" but not including them — since both the upper and lower bounds have been declared as open (true). we open a transaction (using idbtransaction) and an object store, and open a cursor with idbobjectstore.opencursor, declaring keyrangevalue as its optional key range value. after declaring the key range, we log its loweropen property value to the console, which should appear as "true": the lower bound is open, so won't be included in the range. note: for a more complete example allowing you to experim...
...en property value to the console, which should appear as "true": the lower bound is open, so won't be included in the range. ...
...And 4 more matches
IDBKeyRange.upperOpen - Web APIs
the upperopen read-only property of the idbkeyrange interface returns a boolean indicating whether the upper-bound value is included in the key range. note: this feature is available in web workers. syntax var upperopen = mykeyrange.upperopen value a boolean: value indication true the upper-bound value is not included in the key range. false the upper-bound value is included in the key range. example the following example illustrates how you'd use a key range. here we declare keyrangevalue = idbkeyrange.upperbound("f", "w", true, true); — a range that includes everything between "f" and "w" but not including them — since both the upper and lower bounds have been declared as open (true). ...
...y range. false the upper-bound value is included in the key range. example the following example illustrates how you'd use a key range. here we declare keyrangevalue = idbkeyrange.upperbound("f", "w", true, true); — a range that includes everything between "f" and "w" but not including them — since both the upper and lower bounds have been declared as open (true). we open a transaction (using idbtransaction) and an object store, and open a cursor with idbobjectstore.opencursor, declaring keyrangevalue as its optional key range value. after declaring the key range, we log its upperopen property value to the console, which should appear as "true": the upper bound is open, so won't be included in the range. note: for a more complete example allowing you to experim...
...en property value to the console, which should appear as "true": the upper bound is open, so won't be included in the range. ...
...And 4 more matches
IDBObjectStore.openCursor() - Web APIs
if a single valid key is passed, this will default to a range containing only that key. if nothing is passed, this will default to a key range that selects all the records in this object store. ...
...if a single valid key is passed, this will default to a range containing only that key. if nothing is passed, this will default to a key range that selects all the records in this object store. ...
...ore interface returns an idbrequest object, and, in a separate thread, returns a new idbcursorwithvalue object. used for iterating through an object store with a cursor. to determine if the add operation has completed successfully, listen for the results’s success event. note: this feature is available in web workers. syntax var request = objectstore.opencursor(); var request = objectstore.opencursor(query); var request = objectstore.opencursor(query, direction); parameters query optional a key or idbkeyrange to be queried. if a single valid key is passed, this will default to a range containing only that key. if nothing is passed, this will default to a key range that selects all the records in this object store. direction optional an idbcursordirection telling the cursor what ...
...And 4 more matches
IDBObjectStore.openKeyCursor() - Web APIs
if a single valid key is passed, this will default to a range containing only that key. if nothing is passed, this will default to a key range that selects all the records in this object store. ...
...if a single valid key is passed, this will default to a range containing only that key. if nothing is passed, this will default to a key range that selects all the records in this object store. ...
...objectstore interface returns an idbrequest object whose result will be set to an idbcursor that can be used to iterate through matching results. used for iterating through the keys of an object store with a cursor. to determine if the add operation has completed successfully, listen for the results’s success event. syntax var request = objectstore.openkeycursor(); var request = objectstore.openkeycursor(query); var request = objectstore.openkeycursor(query, direction); parameters query optional the key range to be queried. if a single valid key is passed, this will default to a range containing only that key. if nothing is passed, this will default to a key range that selects all the records in this object store. direction optional an idbcursordirection telling the cursor what d...
...And 4 more matches
Open and Save Dialogs - Archive of obsolete content
get folder - the user is asked to select a folder (directory). save - the user is asked to select the name to save a file to. ...
... get folder - the user is asked to select a folder (directory). save - the user is asked to select the name to save a file to. ...
... get folder - the user is asked to select a folder (directory). save - the user is asked to select the name to save a file to. the appearance of the dialog will be different for each type and will vary on each platform. ...
...And 3 more matches
PR_OpenDir
the prdir pointer should eventually be closed by a call to pr_closedir. ...
...the prdir pointer should eventually be closed by a call to pr_closedir. ...
...the prdir pointer should eventually be closed by a call to pr_closedir. ...
...And 3 more matches
Document.open() - Web APIs
Web › API › Document › open
the document.open() method opens a document for writing. this does come with some side effects. for example: all event listeners currently registered on the document, nodes inside the document, or the document's window are removed. all existing nodes are removed from the document. syntax document.open(); parameters none. return value a document object instance. examples the following simple code opens the document and replaces its content with a number of different html fragments, before closing it again. document.open(); document.write("<p>hello world!</p>"); document.write("<p>i am a fish</p>"); document.write("<p>the number is 42</p>"); document.close(); notes an automatic document.open() call happens when document.write() is called after the page has loaded. for years ...
....write("<p>i am a fish</p>"); document.write("<p>the number is 42</p>"); document.close(); notes an automatic document.open() call happens when document.write() is called after the page has loaded. for years firefox and internet explorer additionally erased all javascript variables, etc., in addition to removing all nodes. this is no longer the case.document non-spec'ed parameters to document.open gecko-specific notes starting with gecko 1.9, this method is subject to the same same-origin policy as other properties, and does not work if doing so would change the document's origin. starting with gecko 1.9.2, document.open() uses the principal of the document whose uri it uses, instead of fetching the principal off the stack. as a result, you can no longer call document.write() into an un...
... work if doing so would change the document's origin. starting with gecko 1.9.2, document.open() uses the principal of the document whose uri it uses, instead of fetching the principal off the stack. as a result, you can no longer call document.write() into an untrusted document from chrome, even using wrappedjsobject. see security check basics for more about principals. three-argument document.open() there is a lesser-known and little-used three-argument version of document.open() , which is an alias of window.open() (see its page for full details). ...
...And 3 more matches
Debugging OpenGL
for various reasons, debugging opengl related code can be tricky. this article provides suggestions for how to improve your efficiency while debugging opengl code in gecko. opengl debug mode when running a debug build, you can enable the opengl debug mode by defining the environment variable moz_gl_debug. if you start up firefox with this variable defined, the following behavior changes occur: each time you issue an opengl call, a check is performed to ensure that the gl context is current, using a thread-local static variable to keep track of this. if the context isn't current, the call aborts. every time an opengl call completes, glfinish() gets run automatically. this flushes out each call, essentially turning opengl into a synchronous api. this makes debugging crashes caused by an...
... note: you can download debug builds from mozilla taskcluster — click an appropriate platform's debug build on the left, e.g. ...
... note: you can download debug builds from mozilla taskcluster — click an appropriate platform's debug build on the left, e.g. ...
...And 2 more matches
mozbrowseropentab
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. ...
... non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. ...
... this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the mozbrowseropentab event is fired when a new tab is opened within a browser <iframe> as a result of the user issuing a command to open a link target in a new tab (for example ctrl/cmd + click.) general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles ...
...And 2 more matches
CacheStorage.open() - Web APIs
Web › API › CacheStorage › open
return value a promise that resolves to the requested cache object. examples this example is from the mdn sw-test example (see sw-test running live). here we wait for an installevent to fire, then runs waituntil() to handle the install process for the app. ...
... return value a promise that resolves to the requested cache object. examples this example is from the mdn sw-test example (see sw-test running live). here we wait for an installevent to fire, then runs waituntil() to handle the install process for the app. ...
...matching the cachename. you can access cachestorage through the global caches property. note: if the specified cache does not exist, a new cache is created with that cachename and a promise that resolves to this new cache object is returned. syntax caches.open(cachename).then(function(cache) { // do something with your cache }); parameters cachename the name of the cache you want to open. return value a promise that resolves to the requested cache object. examples this example is from the mdn sw-test example (see sw-test running live). here we wait for an installevent to fire, then runs waituntil() to handle the install process for the app. this consists of calling cachestorage.open() to create a new cache, then using cache.addall() to add a series of assets to it. self.add...
...And 2 more matches
PaymentRequestEvent.openWindow() - Web APIs
working draft initial definition. ...
... working draft initial definition. ...
... working draft initial definition. ...
...And 2 more matches
Cross-Origin-Opener-Policy - HTTP
the http cross-origin-opener-policy (coop) response header allows you to ensure a top-level document does not share a browsing context group with cross-origin documents. coop will process-isolate your document and potential attackers can't access to your global object if they were opening it in a popup, preventing a set of cross-origin attacks dubbed xs-leaks. if a cross-origin document with coop is opened in a new window, the opening document will not have a reference to it, and the window.opener property of the new window will be null. this allows you to have more control over references to a window than rel=noopener, which only affects outgoing navigations. ...
...rigin document with coop is opened in a new window, the opening document will not have a reference to it, and the window.opener property of the new window will be null. this allows you to have more control over references to a window than rel=noopener, which only affects outgoing navigations. header type response header forbidden header name no syntax cross-origin-opener-policy: unsafe-none | same-origin-allow-popups | same-origin directives unsafe-none this is the default value. allows the document to be added to its opener's browsing context group unless the opener itself has a coop of same-origin or same-origin-allow-popups. ...
... same-origin isolates the browsing context exclusively to same-origin documents. cross-origin documents are not loaded in the same browsing context. ...
...And 2 more matches
open - Archive of obsolete content
Archive › Mozilla › XUL › Property › open
« xul reference open type: boolean gets and sets the value of the open attribute. ...
... « xul reference open type: boolean gets and sets the value of the open attribute. ...
... « xul reference open type: boolean gets and sets the value of the open attribute. ...
... « xul reference open type: boolean gets and sets the value of the open attribute. ...
Opening a Link in the Default Browser - Archive of obsolete content
xulrunner applications may have situation where they wish to open a uri in the default browser. this will often be an http or https uri, but can use any scheme for which an external handler exists. ...
...e default browser. this will often be an http or https uri, but can use any scheme for which an external handler exists. this can be done using the nsiexternalprotocolservice interface: // first construct an nsiuri object using the ioservice var ioservice = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); var uritoopen = ioservice.newuri("http://www.example.com/", null, null); var extps = components.classes["@mozilla.org/uriloader/external-protocol-service;1"] .getservice(components.interfaces.nsiexternalprotocolservice); // now, open it! extps.loaduri(uritoopen, null); by default, the external protocol service will warn the user about opening the link in another application. to suppre...
...; var extps = components.classes["@mozilla.org/uriloader/external-protocol-service;1"] .getservice(components.interfaces.nsiexternalprotocolservice); // now, open it! extps.loaduri(uritoopen, null); by default, the external protocol service will warn the user about opening the link in another application. ...
...heme exists. this is how you do it: var extps = components.classes["@mozilla.org/uriloader/external-protocol-service;1"] .getservice(components.interfaces.nsiexternalprotocolservice); if (extps.externalprotocolhandlerexists("http")) { // handler for http:// urls exists } link within an iframe to enable a link inside an html document that is the "src" of an iframe to be opened in the default browser, setting the preference: pref("network.protocol-handler.expose-all", false); seems to work. ...
mozbrowseropenwindow
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the mozbrowseropenwindow event is fired when a new window is required — usually when the content of a browser <iframe> successfully calls the window.open() method, or the user clicks on a link with an unknown target. the embedder must use the <iframe> passed in the event.details.frameelement property as the new window content. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property ...
...erty returns an anonymous javascript object with the following properties: url a domstring representing the url of the document loaded within the frameelement property. name a domstring representing the name of the new browser window. features a domstring containing features represented by a list of names and values separated by commas. ...
...ting the name of the new browser window. features a domstring containing features represented by a list of names and values separated by commas. for a complete list of possible features, see window.open(). frameelement an object representing the new browser <iframe> that will embed the new content. ...
...ontaining features represented by a list of names and values separated by commas. for a complete list of possible features, see window.open(). frameelement an object representing the new browser <iframe> that will embed the new content. ...
openLocationLastURL.jsm
this component has been removed from the platform in firefox 29. (bug 953124) the openlocationlasturl.jsm javascript code module lets you set and retrieve the url most recently opened using the "open location" option in the file menu. to use this, you first need to import the code module into your javascript scope: components.utils.import("resource:///modules/openlocationlasturl.jsm"); once you've imported the module, you can then use the openlocationlasturl object it exports. this object lets you fetch and change the url that is placed in the "open location" dialog box when it opens. if the user is not in private browsing mode, this automatically updates the value of the general.open_location.last_url preference. note: this module automatically handles private browsing mode for you. th...
...fetch and change the url that is placed in the "open location" dialog box when it opens. if the user is not in private browsing mode, this automatically updates the value of the general.open_location.last_url preference. note: this module automatically handles private browsing mode for you. the value preserved across accesses is not preserved when the user exits private browsing mode. ...
...ion" dialog box when it opens. if the user is not in private browsing mode, this automatically updates the value of the general.open_location.last_url preference. note: this module automatically handles private browsing mode for you. the value preserved across accesses is not preserved when the user exits private browsing mode. ...
... this automatically updates the value of the general.open_location.last_url preference. note: this module automatically handles private browsing mode for you. the value preserved across accesses is not preserved when the user exits private browsing mode. using the openlocationlasturl object to get or set the value of the open location edit box, simply read the value of, or set the value of, the openlocationlasturl.value field: var url = openlocationlasturl.value; openlocationlasturl.value = "http://www.mozilla.org/"; to reset the value of the edit box to the default (which is an empty string), you can call the reset() method: method overview reset() methods reset the reset() method resets the saved url to the default, which is an empty string. reset(); parameters none. ...
PR_OpenSharedMemory
returns pointer to opaque structure prsharedmemory, or null if an error occurs. ...
... returns pointer to opaque structure prsharedmemory, or null if an error occurs. ...
... returns pointer to opaque structure prsharedmemory, or null if an error occurs. ...
...mode ); /* define values for pr_opensharememory(...,create) */ #define pr_shm_create 0x1 /* create if not exist */ #define pr_shm_excl 0x2 /* fail if already exists */ parameters the function has the following parameters: name the name of the shared memory segment. size the size of the shared memory segment. flags options for creating the shared memory. mode same as passed to pr_open. returns pointer to opaque structure prsharedmemory, or null if an error occurs. retrieve the reason for the failure by calling pr_geterror and pr_getoserror. description pr_opensharedmemory creates a new shared memory segment or associates a previously created memory segment with the specified name. when parameter create is (pr_shm_excl | pr_shm_create) and the shared memory already exists,...
IDBOpenDBRequest.onblocked - Web APIs
the onblocked event handler of the idbopendbrequest interface is the event handler for the blocked event. this event is triggered when the upgradeneeded should be triggered because of a version change but the database is still in use (that is, not closed) somewhere, even after the versionchange event was sent. note: this feature is available in web workers. syntax idbopendbrequest.onblocked = function(event) { ... ...
...nterface is the event handler for the blocked event. this event is triggered when the upgradeneeded should be triggered because of a version change but the database is still in use (that is, not closed) somewhere, even after the versionchange event was sent. note: this feature is available in web workers. syntax idbopendbrequest.onblocked = function(event) { ... }; example var db; // let us open our database var request = indexeddb.open("todolist", 4); // these two event handlers act on the database being opened // successfully, or not request.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
.... // this is used a lot below db = request.result; // run the displaydata() function to populate the task list with // all the to-do list data already in the idb displaydata(); }; // this event handles the event whereby a new version of the // database needs to be created. either one has not been created // before, or a new version number has been submitted via the // window.indexeddb.open line above //it is only implemented in recent browsers request.onupgradeneeded = function(event) { var db = event.target.result; db.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { keypath: "tasktitle" }); ... }; request.onblocked = function() { ...
...needed = function(event) { var db = event.target.result; db.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { keypath: "tasktitle" }); ... }; request.onblocked = function() { console.log("your database version can't be upgraded because the app is open somewhere else."); } specifications specification status comment indexed database api 2.0the definition of 'onblocked' in that specification. recommendation indexed database api draftthe definition of 'onblocked' in that specification. recommendation browser compatibility the compatibility table on this page is generated from structured...
List Open Tabs - Archive of obsolete content
you can download the icon here: . run the add-on, load a couple of tabs and click the button. ...
...you can download the icon here: . run the add-on, load a couple of tabs and click the button. ...
...con here: . run the add-on, load a couple of tabs and click the button. you'll see output in the command line console that looks something like this: info: http://www.mozilla.org/about/ info: http://www.bbc.co.uk/ you don't get direct access to any content hosted in the tab. to access tab content, you need to attach a script to the tab using tab.attach(). this add-on attaches a script to all open tabs. the script adds a red border to the tab's document: require("sdk/ui/button/action").actionbutton({ id: "list-tabs", label: "list tabs", icon: "./icon-16.png", onclick: listtabs }); function listtabs() { var tabs = require("sdk/tabs"); for (let tab of tabs) runscript(tab); } function runscript(tab) { tab.attach({ contentscript: "document.body.style.border = '5px sol...
open - Archive of obsolete content
warning: this section describes the file component of the spidermonkey javascript interpreter. file is non-standard, not generally compiled into distributions, is a potential source of huge security holes, and not well tested. summary opens the file, specifying file mode and type. syntax open(mode,type) parameters mode a comma-delimited list describing the method to use to open the file, described in detail here. type a string describing the type of file being opened. description this method opens the file, preparing its resources for use by subsequent methods to examine or modify the file. certain methods of file, such as read and write should not be used when the file is not open. other methods, such as remove may not be used when the file is open. valid file ...
...nd write should not be used when the file is not open. other methods, such as remove may not be used when the file is open. valid file types are text, binary and unicode. text indicates ascii text without nul characters. binary indicates utf-8 files. unicode indicates ucs-2 files. for all file types, carriage returns and linefeeds are treated in a platform-agnostic way. ...
...ods, such as remove may not be used when the file is open. valid file types are text, binary and unicode. text indicates ascii text without nul characters. binary indicates utf-8 files. unicode indicates ucs-2 files. for all file types, carriage returns and linefeeds are treated in a platform-agnostic way. ...
openPopup - Archive of obsolete content
to anchor a popup to a node, supply an anchor node and set the position to a string indicating the manner in which the popup should be anchored. the anchor node does not need to be in the same document as the popup. unanchored popups may be created by supplying null as the anchor node. the direction in which the popup is oriented depends on the direction of the anchor. ...
...nanchored popup appears at the position specified by x and y, relative to the viewport of the document containing the popup node. in this case, the position and attributesoverride arguments are ignored. iscontextmenu the iscontextmenu argument should be true for context menus and false for all other types of popups. it affects menu item highlighting; that is, while a context menu is open, menus opened earlier do not highlight or execute their items. attributesoverride if the attributesoverride argument is true, the position attribute on the popup node overrides the position value argument. if attributesoverride is false, the attribute is only used if the position argument is empty. triggerevent the event that triggered the popup (such as a mouse click,...
...light or execute their items. attributesoverride if the attributesoverride argument is true, the position attribute on the popup node overrides the position value argument. if attributesoverride is false, the attribute is only used if the position argument is empty. triggerevent the event that triggered the popup (such as a mouse click, if the user clicked something to open the popup). ...
mozbrowseropensearch
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the mozbrowseropensearch event is fired when a link to a search engine is found — i.e. when an instance of <link rel="search" type="application/opensearchdescription+xml"> is encountered. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of ...
...lable or not. details read only object a custom object. details the details property returns an anonymous javascript object with the following properties: title a domstring representing the title of the search engine. href a domstring representing url of the search engine. ...
...example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowseropensearch", function( event ) { console.log("new search engine encountered: " + event.details.title); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsertitlechange ...
PR_OpenAnonFileMap
a filename is generated for the name. on windows platforms, dirname is ignored. ...
...a filename is generated for the name. on windows platforms, dirname is ignored. ...
...t prot ); parameters the function has the following parameters: dirname a pointer to a directory name that will contain the anonymous file. size the size of the shared memory. prot how the shared memory is mapped. returns pointer to prfilemap or null on error. description if the shared memory already exists, a handle is returned to that shared memory object. on unix platforms, pr_openanonfilemap uses dirname as a directory name, without the trailing '/', to contain the anonymous file. a filename is generated for the name. on windows platforms, dirname is ignored. ...
PR_OpenSemaphore
mode unix style file mode to be used when creating the semaphore. value the initial value assigned to the semaphore. returns a pointer to a prsem structure or null/code> on error. description if the named semaphore doesn't exist and the pr_sem_create flag is specified, the named semaphore is created. ...
... mode unix style file mode to be used when creating the semaphore. value the initial value assigned to the semaphore. returns a pointer to a prsem structure or null/code> on error. ...
... structure or null/code> on error. description if the named semaphore doesn't exist and the pr_sem_create flag is specified, the named semaphore is created. the created semaphore needs to be removed from the system with a pr_deletesemaphore call. if pr_sem_create is specified, the third argument is the access permission bits of the new semaphore (same interpretation as the mode argument to pr_open) and the fourth argument is the initial value of the new semaphore. if pr_sem_create is not specified, the third and fourth arguments are ignored. ...
FC_OpenSession
name fc_opensession - open a session between an application and a token. syntax ck_rv fc_opensession( ck_slot_id slotid, ck_flags flags, ck_void_ptr papplication, ck_notify notify, ck_session_handle_ptr phsession ); parameters fc_opensession has the following parameters: slotid [in] the id of the token's slot. flags [in] papplication notify [in] pointer to a notification callback function. not currently supported. phsession [out] pointer to a session handle. description fc_opensession opens a session between an application and the token in the slot with the id slotid. the nss cryptographic module currently doesn't call the surrender callback function notify. ...
...lication notify [in] pointer to a notification callback function. not currently supported. phsession [out] pointer to a session handle. description fc_opensession opens a session between an application and the token in the slot with the id slotid. the nss cryptographic module currently doesn't call the surrender callback function notify. ...
.... description fc_opensession opens a session between an application and the token in the slot with the id slotid. the nss cryptographic module currently doesn't call the surrender callback function notify. (see pkcs #11 v2.20 section 11.17.1.) a user may call fc_opensession without logging into the token (to assume the nss user role). ...
ctypes.open
this must be called before any work can commence. there are two options: custom native file (dll, so, dylib, etc.) standard os libraries custom native file for this method, a native file must be created. a native file for use on unix systems is an so file, which is created and a c function called add() is written. int add(int a, int b) { return a + b; } to make this a shared library, a native file which can be loaded and used from js-ctypes, compile it with these commands: gcc -fpic -c mycfuntionsforunix.c gcc -shared -o mycfuntionsforunix.so mycfuntionsforunix.o a file named mycfuntionsforunix.so is successfully created. ...
...ata-folder it is important to note that custom native files cannot be loaded through chrome:// or resource:// uris. they must be accessed through a local file path (file://) or a jar path (jar:). if the addon is an unpacked addon, such as bootstrap or add-on sdk addons, the jar path must be used. therefore, the path has to be converted and then the converted path is used for loading with ctypes.open. if the native file is located at chrome://youraddon/content/mysubfolder/mycfunctionsforunix.so then it is converted to a file uri like this: components.utils.import("resource://gre/modules/services.jsm"); var cr = components.classes['@mozilla.org/chrome/chrome-registry;1'].getservice(components.interfaces.nsichromeregistry); var chromeuri_mylib = services.io.newuri('chrome://youraddon/content...
....installpath.path; // if unpacked is set to false in install.rdf this will look like: "c:\users\vayeate\appdata\roaming\mozilla\firefox\profiles\aksozfjt.unnamed profile 10\extensions\asynczip@jetpack" var filepath_mylib = os.path.join(filepath_folder, 'mysubfolder', 'mycfunctionsforunix.so'); var jarpath_mylib = jarpath_folder + 'mysubfolder/mycfunctionsforunix.so'; } this can then be opened and the c functions within can be used from js-ctypes. var lib = ctypes.open(filepath_mylib); var add_with_c = lib.declare("add", ctypes.default_abi, ctypes.int, // return type ctypes.int, // a ctypes.int // b ); var rez = add_with_c(2, 5); // rez is 7 lib.close(); references heather's paragraphs: playing around with js-ctypes on linux - credits for basis of this ...
Clients.openWindow() - Web APIs
the openwindow() method of the clients interface creates a new top level browsing context and loads a given url. if the calling script doesn't have permission to show popups, openwindow() will throw an invalidaccesserror. in firefox, the method is allowed to show popups only when called as the result of a notification click event. in chrome for android, the method may instead open the url in an existing browsing context provided by a standalone web app previously added to the user's home screen. as of recently, this also works on chrome for windows. syntax self.clients.openwindow(url).then(function(windowclient) { // do something with your windowclient }); parameters url a usvstring representing the url of the client you want to open in the window. generally this value must be a ur...
... working draft initial definition. ...
... e.waituntil(clients.matchall({ type: 'window' }).then(clientsarr => { // if a window tab matching the targeted url already exists, focus that; const hadwindowtofocus = clientsarr.some(windowclient => windowclient.url === e.notification.data.url ? (windowclient.focus(), true) : false); // otherwise, open a new tab to the applicable url and focus it. if (!hadwindowtofocus) clients.openwindow(e.notification.data.url).then(windowclient => windowclient ? windowclient.focus() : null); })); }); specifications specification status comment service workersthe definition of 'clients: openwindow' in that specification. working draft initial definition. ...
HTMLDialogElement.open - Web APIs
the open property of the htmldialogelement interface is a boolean reflecting the open html attribute, indicating whether the dialog is available for interaction. syntax dialoginstance.open = true; var myopenvalue = dialoginstance.open; value a boolean representing the state of the open html attribute. true means it is set, and therefore the dialog is shown. false means it not set, and therefore the dialog is not shown. the property is now read only — it is possible to set the value to programmatically show or hide the dialog. examples the following example shows a simple button that, when clicked, opens a <dialog> containing a form via the showmodal() method. from there you can click the cancel button to close the dialog (via the htmldialogelement.close() method), or su...
...confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var cancelbutton = document.getelementbyid('cancel'); var dialog = document.getelementbyid('favdialog'); dialog.returnvalue = 'favanimal'; function opencheck(dialog) { if(dialog.open) { console.log('dialog open'); } else { console.log('dialog closed'); } } // update button opens a modal dialog updatebutton.addeventlistener('click', function() { dialog.showmodal(); opencheck(dialog); }); // form cancel button closes the dialog box cancelbutton.addeven...
... } else { console.log('dialog closed'); } } // update button opens a modal dialog updatebutton.addeventlistener('click', function() { dialog.showmodal(); opencheck(dialog); }); // form cancel button closes the dialog box cancelbutton.addeventlistener('click', function() { dialog.close('animalnotchosen'); opencheck(dialog); }); })(); </script> note: you can find this example on github as htmldialogelement-basic (see it live also). specifications specification status comment html living standardthe definition of 'open' in that specification. living standard html 5.1the definition of 'open' in that specification. recommendation ...
IDBOpenDBRequest.onupgradeneeded - Web APIs
}; example in the following example you can see the onupgradeneeded handler being used to update the database structure if a database with a higher version number is loaded. ...
...face is the event handler for the upgradeneeded event, triggered when a database of a bigger version number than the existing stored database is loaded. the event passed to the listener is an idbversionchangeevent. inside the event handler function you can include code to upgrade the database structure, as shown in the example below. note: this feature is available in web workers. ...
...yntax idbopendbrequest.onupgradeneeded = function(event) { ... }; example in the following example you can see the onupgradeneeded handler being used to update the database structure if a database with a higher version number is loaded. for a full working example, see our to-do notifications app (view example live.) var db; // request version 3 of the database. var request = window.indexeddb.open("library", 3); // this event handles the event whereby a new version of the // database needs to be created. either one has not been created // before, or a new version number has been submitted via the // window.indexeddb.open line above. request.onupgradeneeded = function(event) { db = request.result; db.onerror = function(errorevent) { note.innerhtml += '<li>error loading database.</...
RTCDataChannel.onopen - Web APIs
the rtcdatachannel.onopen property is an eventhandler which specifies a function to be called when the open event is fired; this is a simple event which is sent when the data channel's underlying data transport—the link over which the rtcdatachannel's messages flow—is established or re-established. syntax rtcdatachannel.onopen = function; value a function which the browser will call to handle the open event. the function receives as its only input parameter the event itself, of type event. example this example adds a new data channel to an existing rtcpeerconnection, mypeerconnection. it then establishes an open event handler which updates some user interface elements to prepare them for being used to send messages over the data channel. let dc = mypeerconnection.createdatachanne...
...ion receives as its only input parameter the event itself, of type event. example this example adds a new data channel to an existing rtcpeerconnection, mypeerconnection. it then establishes an open event handler which updates some user interface elements to prepare them for being used to send messages over the data channel. ...
... candidate recommendation initial specification. ...
RTCDataChannel: open event - Web APIs
the webrtc open event is sent to an rtcdatachannel object's onopen event handler when the underlying transport used to send and receive the data channel's messages is opened or re-opened. bubbles no cancelable no interface rtcdatachannelevent event handler property onopen examples this example adds to the rtcdatachannel dc a handler for the open event that adjusts the user interface to indicate that a chat window is ready to be used after a connection has been established. it enables the message input box and send button as well as enabling the disconnect button and disabling the connect button. finally, the message input box is focused so the user can immediately begin to type. ...
...datachannel dc a handler for the open event that adjusts the user interface to indicate that a chat window is ready to be used after a connection has been established. it enables the message input box and send button as well as enabling the disconnect button and disabling the connect button. finally, the message input box is focused so the user can immediately begin to type. dc.addeventlistener("open", ev => { messageinputbox.disabled = false; sendmessagebutton.disabled = false; disconnectbutton.disabled = false; connectbutton.disabled = true; messageinputbox.focus(); }, false); this can also be done by directly setting the value of the channel's onopen event handler property. ...
...message input box is focused so the user can immediately begin to type. dc.addeventlistener("open", ev => { messageinputbox.disabled = false; sendmessagebutton.disabled = false; disconnectbutton.disabled = false; connectbutton.disabled = true; messageinputbox.focus(); }, false); this can also be done by directly setting the value of the channel's onopen event handler property. ...
USBDevice.open() - Web APIs
Web › API › USBDevice › open
draft initial definition. ...
... draft initial definition. ...
... draft initial definition. ...
Open a Web Page - Archive of obsolete content
to follow this tutorial you'll need to have learned the basics of jpm. to open a new web page, you can use the tabs module: var tabs = require("sdk/tabs"); tabs.open("http://www.example.com"); this function is asynchronous, so you don't immediately get back a tab object which you can examine. to do this, pass a callback function into open(). the callback is assigned to the onready property, and will be passed the tab as an argument: var tabs = require("sdk/tabs"); tabs.open({ url: "http://www.example.com", onready: function onready(tab) { console.log(tab.title); } }); even then, you don't get direct access to any content hosted in the tab. to access tab content you need to attach a script to the tab using tab.attach(). this add-on loads a page, then attaches a script to the ...
... to learn more about running scripts in tabs, see the tutorial on using tab.attach(). ...
openPopupAtScreen - Archive of obsolete content
this position may be adjusted if it would cause the popup to be off of the screen. ...
...this position may be adjusted if it would cause the popup to be off of the screen. ...
openSubDialog - Archive of obsolete content
the url should be a xul file. if the child dialog is also a prefwindow, set its type attribute to child so that preferences will be saved properly when the main dialog is closed. ...
...the url should be a xul file. if the child dialog is also a prefwindow, set its type attribute to child so that preferences will be saved properly when the main dialog is closed. ...
Archived open Web documentation - Archive of obsolete content
talk:background-size should not the "browser compatibility" table also list google chrome and konqueror? chome is not mentioned at all, but is becoming increasingly popular. konqueror is listed below the table, which seems inconsistent. znerd 04 august 2009 browser detection and cross browser support improper browser detection can lead to web maintenance nightmares. rethinking the basics of when and how to detect user agents is crucial to creating maintainable, cross browser web content. ...
...erator protocol. do not use this ancient feature. styling the amazing netscape fish cam page using javascript generators in firefox generators can be used to simplify asynchronous code in firefox by opting in to using javascript version 1.7 or later. you can opt in in html as follows: window.importdialog() because opening windows on mobile isn't necessarily appropriate, the firefox mobile team designed the importdialog() method to replace window.opendialog(). instead of opening a new window, it merges the specified xul dialog into the main window. writing javascript for xhtml technical review completed. editorial review completed. xforms ...
OpenGL - MDN Web Docs Glossary: Definitions of Web-related terms
opengl (open graphics library) is a cross-language, multi-platform application programming interface (api) for rendering 2d and 3d vector graphics. the api is typically used to interact with a graphics processing unit (gpu), to achieve hardware-accelerated rendering. ...
... opengl (open graphics library) is a cross-language, multi-platform application programming interface (api) for rendering 2d and 3d vector graphics. the api is typically used to interact with a graphics processing unit (gpu), to achieve hardware-accelerated rendering. ...
OpenSSL - MDN Web Docs Glossary: Definitions of Web-related terms
openssl is an open-source implementation of ssl and tls. ...
... openssl is an open-source implementation of ssl and tls. ...
PR_GetOpenFileInfo
gets an open file's information. file size is expressed as a 32-bit integer. syntax #include <prio.h> prstatus pr_getopenfileinfo( prfiledesc *fd, prfileinfo *info); parameters the function has the following parameters: fd a pointer to a prfiledesc object for an open file. info a pointer to a prfileinfo object. on output, information about the given file is written into the file information object. returns the function returns one of the following values: if file information is successfully obtained, pr_success. if file information is not successfully obtained, pr_failure. ...
...ters: fd a pointer to a prfiledesc object for an open file. info a pointer to a prfileinfo object. on output, information about the given file is written into the file information object. returns the function returns one of the following values: if file information is successfully obtained, pr_success. if file information is not successfully obtained, pr_failure. description pr_getopenfileinfo obtains the file type (normal file, directory, or other), file size (as a 32-bit integer), and the file creation and modification times of the open file represented by the file descriptor. see also for the 64-bit version of this function, see pr_getopenfileinfo64. to get equivalent information on a file that's not already open, use pr_getfileinfo. ...
PR_GetOpenFileInfo64
gets an open file's information. file size is expressed as a 64-bit integer. syntax #include <prio.h> prstatus pr_getopenfileinfo64( prfiledesc *fd, prfileinfo *info); parameters the function has the following parameters: fd a pointer to a prfiledesc object for an open file. info a pointer to a prfileinfo64 object. on output, information about the given file is written into the file information object. returns the function returns one of the following values: if file information is successfully obtained, pr_success. if file information is not successfully obtained, pr_failure. description pr_getopenfileinfo64 is the 64-bit version of pr_getopenfileinfo. it obtains the file type (normal file, directory, or other), file size (as a 64-bit integer), and the creation and ...
...ns the function returns one of the following values: if file information is successfully obtained, pr_success. if file information is not successfully obtained, pr_failure. description pr_getopenfileinfo64 is the 64-bit version of pr_getopenfileinfo. it obtains the file type (normal file, directory, or other), file size (as a 64-bit integer), and the creation and modification times of the open file represented by the file descriptor. see also for the 32-bit version of this function, see pr_getopenfileinfo. to get equivalent information on a file that's not already open, use pr_getfileinfo64. ...
PR OpenUDPSocket
creates a new udp socket of the specified address family. syntax #include <prio.h> prfiledesc* pr_openudpsocket(printn af); parameters the function has the following parameters: af the address family of the new udp socket. can be pr_af_inet (ipv4), pr_af_inet6 (ipv6), or pr_af_local (unix domain, supported on posix systems only). returns the function returns one of the following values: upon successful completion, a pointer to the prfiledesc object created for the newly opened udp socket. if the creation of a new udp socket failed, null. description udp (user datagram protocol) is a connectionless, unreliable datagram protocol of the tcp/ip protocol suite. ...
...the socket may be bound to a well-known port number with pr_bind. ...
msSaveOrOpenBlob - Web APIs
defaultname the file name to be used when saving file. return value true is returned as long as the download notification bar is displayed, or false if a failure occurred. ...
... defaultname the file name to be used when saving file. return value true is returned as long as the download notification bar is displayed, or false if a failure occurred. ...
USBDevice.opened - Web APIs
Web › API › USBDevice › opened
the opened read only property of the usbdevice interface indicates whether a session has been started with a paired usb device. a device must be opened before it can be controlled by a web page. syntax var serialnumber = usbdevice.opened value a boolean. example this example is for a hypothetical usb device with a multi-colored led. it shows how to test that a device is open before calling usbdevice.controltransferout to set a specified led color. what data can be passed to a usb device and how it is passed is particular and unique to each device. async setdevicecolor(usbdevice, r, g, b) { if (device.opened) { // this hypothetical usb device requires that the data passed to // it be in a uint8array. let payload = new uint8array([r, g, b]); await usbdevice.
... draft initial definition. ...
XMLHttpRequest.open() - Web APIs
ignored for non-http(s) urls. url a domstring representing the url to send the request to. async optional an optional boolean parameter, defaulting to true, indicating whether or not to perform the operation asynchronously. if this value is false, the send() method does not return until the response is received. ...
... thread entirely. synchronous requests are permitted in workers. user optional the optional user name to use for authentication purposes; by default, this is the null value. password optional the optional password to use for authentication purposes; by default, this is the null value. specifications specification status comment xmlhttprequestthe definition of 'open()' in that specification. living standard whatwg living standard ...
The Web Open Font Format (WOFF) - Developer guides
Web › Guide › WOFF
woff (the web open font format) is a web font format developed by mozilla in concert with type supply, letterror, and other organizations. it uses a compressed version of the same table-based sfnt structure used by truetype, opentype, and open font format, but adds metadata and private-use data structures, including predefined fields allowing foundries and vendors to provide license information if desired. there are three main benefits to using woff: the font data is compressed, so sites using woff will use less bandwidth and will load faster than if they used equivalent uncompressed truetype or opentype files. many font vendors that are unwilling to license their truetype or opentype format fonts for use on the web will license woff format fonts. this improves availability of fon...
..., interoperable font format for the web, unlike other current font formats. there are two versions of woff; woff and woff2, they mostly differ in regard to the compression algorithm used. in @font-face they are identified by the 'woff' and respectively 'woff2' format descriptor. using woff you can use the @font-face css property to use woff fonts for text in web content. it works exactly like opentype and truetype format fonts do, except it will likely let your content download more efficiently due to the addition of compression. tools for working with woff fonts tools for working with woff fonts are available. sfnt2woff and woff2sfnt convert between woff and opentype. specifications specification status comment woff file format 2.0 recommendation n...
Link types: noopener - HTML: Hypertext Markup Language
the noopener keyword for the rel attribute of the <a>, <area>, and <form> elements instructs the browser to navigate to the target resource without granting the new browsing context access to the document that opened it — by not setting the window.opener property on the opened window (it returns null). this is especially useful when opening untrusted links, in order to ensure they cannot tamper with the originating document via the window.opener property (see about rel=noopener for more details), while still providing the referer http header (unless noreferrer is used as well). note that when noopener is used, nonempty target names other than _top, _self, and _parent are all treated like _blank in terms of deciding whether to open a new window/tab. specifications specifi...
...oopener for more details), while still providing the referer http header (unless noreferrer is used as well). note that when noopener is used, nonempty target names other than _top, _self, and _parent are all treated like _blank in terms of deciding whether to open a new window/tab. specifications specification status comment html living standardthe definition of 'noopener' in that specification. living standard ...
alwaysopenpopup - Archive of obsolete content
if false, the default value, the popup will be hidden. ...
open - Archive of obsolete content
Archive › Mozilla › XUL › Attribute › open
« xul reference home open type: boolean for the menu type buttons, the open attribute is set to true when the menu is open. the open attribute is not present if the menu is closed. ...
open - Archive of obsolete content
Archive › Mozilla › XUL › Method › Open
if you don't pass a mode, the last-used mode for the same findbar is used. if the findbar hasn't been used before, find_normal is the default. ...
openWindow - Archive of obsolete content
« xul reference home openwindow( windowtype, url, features, params ) return type: window open a child window. the windowtype is a string specifying a window type. if a window with that type is already open, this method will just switch that window to the front and focus it instead of opening another window. if a window of the type is not open, a new one is opened displaying the supplied url. ...
alwaysOpenPopup - Archive of obsolete content
« xul reference alwaysopenpopup obsolete since gecko 1.9.1 type: boolean gets and sets the value of the alwaysopenpopup attribute. ...
colorpicker.open - Archive of obsolete content
« xul reference open type: boolean returns true if the popup for a button-type colorpicker is open. set this property to true to open the popup or false to close the popup. ...
datepicker.open - Archive of obsolete content
« xul reference open type: boolean for popup type datepickers, specifies whether the popup is open. set this property to open or close the popup. for non-popup datepickers, this property is always false. ...
menu.open - Archive of obsolete content
« xul reference open type: boolean this property will be set to true when the menu is open. the menu may be opened by setting the open property to true and closed by setting it to false. ...
popupOpen - Archive of obsolete content
« xul reference popupopen new in thunderbird 15 requires seamonkey 2.12 type: boolean indicates whether the popup is open or not. set this property to open or close the popup. ...
PR_OpenTCPSocket
creates a new tcp socket of the specified address family. syntax #include <prio.h> prfiledesc* pr_opentcpsocket(printn af); parameters the function has the following parameters: af the address family of the new tcp socket. can be pr_af_inet (ipv4), pr_af_inet6 (ipv6), or pr_af_local (unix domain, supported on posix systems only). returns the function returns one of the following values: upon successful completion, a pointer to the prfiledesc object created for the newly opened tcp socket. if the creation of a new tcp socket failed, null. description tcp (transmission control protocol) is a connection-oriented, reliable byte-stream protocol of the tcp/ip protocol suite. pr_opentcpsocket creates a new tcp socket of the address family af. a tcp connection is established by a ...
Detect Opening Folder
some actions require execution every time you open a folder (for example, registering a custom column handler. to do this you need to capture the select event of the folder [[xul:tree|tree]] whose id is (conveniently) foldertree like so: window.document.getelementbyid('foldertree').addeventlistener("select", testcolumns, false); ...
Open the debugger - Firefox Developer Tools
there are three ways to open the debugger: select "debugger" from the web developer submenu in the firefox menu (or tools menu if you display the menu bar or are on mac os x) press ctrl + shift + z on windows and linux, or cmd + opt + z on macos (starting in firefox 71; prior to firefox 66, the letter in this shortcut was s). press the menu button ( ), select "developer", then "debugger". ...
Open the Inspector - Firefox Developer Tools
right-click an element on a web page and select inspect element. ...
Element.openOrClosedShadowRoot - Web APIs
note: this api is available only to webextensions. the element.openorcloseshadowroot read-only property represents the shadow root hosted by the element, regardless if its mode is open or closed. use element.attachshadow() to add a shadow root to an existing element. syntax var shadowroot = element.shadowroot; value a shadowroot object instance, regardless if its mode is set to open or closed, or null if no shadow root is present. (see element.attachshadow() for further details). specifications this property is not part of any specification. ...
EventSource.onopen - Web APIs
the onopen property of the eventsource interface is an eventhandler called when an open event is received, that is when the connection was just opened. syntax eventsource.onopen = function examples evtsource.onopen = function() { console.log("connection to server opened."); }; note: you can find a full example on github — see simple sse demo using php. specifications specification status comment html living standardthe definition of 'onopen' in that specification. living standard initial definition ...
EventSource: open event - Web APIs
the open event of the eventsource api is fired when a connection with an event source is opened. bubbles no cancelable no interface event event handler property eventsource.onopen examples var evtsource = new eventsource('sse.php'); // addeventlistener version evtsource.addeventlistener('open', (e) => { console.log("the connection has been established."); }); // onopen version evtsource.onopen = (e) => { console.log("the connection has been established."); }; specifications specification status html living standardthe definition of 'open event' in that specification. living standard ...
FileHandle.open() - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. summary the open method returns a lockedfile object that allows to safely write in the file. syntax var myfile = instanceoffilehandle.open(mode); parameters mode a string that specifies the writing mode for the file. it can be readonly or readwrite. return a lockedfile object. specifications specification status comment filesystem api editor's draft draft proposal ...
WebSocket.onopen - Web APIs
Web › API › WebSocket › onopen
the websocket.onopen property is an eventhandler that is called when the websocket connection's readystate changes to 1; this indicates that the connection is ready to send and receive data. it is called with an event. syntax awebsocket.onopen = function(event) { console.log("websocket is open now."); }; value an eventlistener. specifications specification status comment html living standardthe definition of 'websocket: onopen' in that specification. living standard initial definition ...
WebSocket: open event - Web APIs
the open event is fired when a connection with a websocket is opened. bubbles no cancelable no interface event event handler property onopen examples // create websocket connection. const socket = new websocket('ws://localhost:8080'); // connection opened socket.addeventlistener('open', (event) => { socket.send('hello server!'); }); specifications specification status html living standardthe definition of 'websocket open' in that specification. living standard ...
Window.opener - Web APIs
Web › API › Window › opener
the window interface's opener property returns a reference to the window that opened the window using open(). in other words, if window a opens window b, b.opener returns a. syntax const openerwindow = window.opener value a window referring to the window that opened the current window (using window.open(), or by a link with target attribute set). if this window was not opened by being linked to or created by another, returns null. in modern browsers, a rel="noopener noreferrer" attribute on the originating <a> element will prevent the window.opener reference from being set, in which case this property will return null. specifications specification status comment html living standardthe definition of 'window.opener' in that specification. living standard...
XDomainRequest.open() - Web APIs
opens an xdomainrequest which is configured to use a given method (get/post) and url. syntax xdr.open(method, url); parameters method the http method to use for the request. (get or post) url the url to which to send the request. example var xdr = new xdomainrequest(); xdr.open("get", "http://example.com/api/method"); specification not part of any specification. ...
XMLHttpRequest.openRequest() - Web APIs
...
Demos of open web technologies
mozilla supports a wide variety of exciting open web technologies, and we encourage their use. this page offers links to interesting demonstrations of these technologies. if you know of a good demonstration or application of open web technology, please add a link to the appropriate section here. 2d graphics canvas blob sallad: an interactive blob using javascript and canvas (code demos) 3d raycaster processing.js p5js 3d on 2d canvas minipaint: image editor (source code) zen photon garden (source code) multi touch in canvas demo (source code) svg bubblemenu (visual effects and interaction) html transformations using foreignobject (visual effects and transforms) phonetics guide (interactive) 3d objects demo (interactive) blobular (interactive) video embedded in sv...
SVG-in-OpenType - Developer guides
once we're ready for wider adoption the information from wiki.mozilla.org will be moved here, updated and expanded. ...
Index - Web APIs
Web › API › Index
perty, reference, web audio api, detune the detune property of the audiobuffersourcenode interface is a k-rate audioparam representing detuning of oscillation in cents. 116 audiobuffersourcenode.loop api, audio, audiobuffersourcenode, loop, media, property, reference, web audio api, sound the loop property's default value is false. 117 audiobuffersourcenode.loopend api, audio, audiobuffersourcenode, media, property, reference, web audio api, loopend, sound a floating-point number indicating the offset, in seconds, into the audio buffer at which each loop will loop return to the beginning of the loop (that is, the current play time gets reset to audiobuffersourcenode.loopstart). this property is only used if the loop property is true. 118 ...
...chestorage.match() api, cachestorage, experimental, method, reference, service workers, service worker api, serviceworker, match the match() method of the cachestorage interface (available globally as caches) checks if a given request or url string is a key for a stored response. this method returns a promise for a response, or undefined if no match is found. 515 cachestorage.open() api, cachestorage, experimental, method, reference, service workers, service worker api, serviceworker, open the open() method of the cachestorage interface returns a promise that resolves to the cache object matching the cachename. 516 canvas api api, canvas, javascript, overview, reference the canvas api provides a means for drawing graphics via javascript and t...
...rviceworker the matchall() method of the clients interface returns a promise for a list of service worker client objects. include the options parameter to return all service worker clients whose origin is the same as the associated service worker's origin. if options are not included, the method returns only the service worker clients controlled by the service worker. 634 clients.openwindow() api, clients, experimental, method, reference, service workers, serviceworker, openwindow the openwindow() method of the clients interface creates a new top level browsing context and loads a given url. if the calling script doesn't have permission to show popups, openwindow() will throw an invalidaccesserror. 635 clipboard api, clip, clipboard, clipboard api, cut...
...And 77 more matches
Using IndexedDB - Web APIs
dexeddb, you should first read basic concepts about indexeddb. for the reference documentation on the indexeddb api, see the indexeddb article and its subpages. this article documents the types of objects used by indexeddb, as well as the methods of the asynchronous api (the synchronous api was removed from spec). basic pattern the basic pattern that indexeddb encourages is the following: open a database. create an object store in the database. start a transaction and make a request to do some database operation, like adding or retrieving data. wait for the operation to complete by listening to the right kind of dom event. do something with the results (which can be found on the request object). with these big concepts under our belts, we can get to more concrete stuff...
... that use a prefix may be buggy, or incomplete, or following an old version of the specification. therefore, it is not recommended to use it in production code. it may be preferable to not support a browser than to claim to support it and fail: if (!window.indexeddb) { console.log("your browser doesn't support a stable version of indexeddb. ...
...ersion of the specification. therefore, it is not recommended to use it in production code. it may be preferable to not support a browser than to claim to support it and fail: if (!window.indexeddb) { console.log("your browser doesn't support a stable version of indexeddb. such and such feature will not be available."); } opening a database we start the whole process like this: // let us open our database var request = window.indexeddb.open("mytestdatabase", 3); see that? opening a database is just like any other operation — you have to "request" it. the open request doesn't open the database or start the transaction right away. the call to the open() function returns an idbopendbrequest object with a result (success) or error value that you handle as an event. most other asynchr...
...And 43 more matches
Index - Archive of obsolete content
asons," your company is required to use very old software and you need to build web content that runs on that software. or perhaps you're just curious about the history of an obsolete feature or api, and how it worked. 2 .htaccess ( hypertext access ) 301 redirect, cache control, custom error pages, htaccess, permanent redirect, redirect file accessing : htaccess files can be opened using any text editor, like windows notepad, vin, sublime text editor or any other. syntax highliting support for .htaccess files less. 3 2015 mdn fellowship program 2015, archive, fellowship no summary! 4 api api, archive archived documentation about obsolete web standards apis. 5 navigator api, navigator features that used to hang...
...-on metadata. 58 simple-prefs add-on sdk store preferences across application restarts. 59 simple-storage add-on sdk, add-ons, reference lets an add-on store data so that it's retained across firefox restarts. 60 system add-on sdk query the add-on's environment and access arguments passed to it. 61 tabs add-on sdk open, manipulate, and access tabs, and receive tab events. 62 timers add-on sdk set one-off and periodic timers. 63 ui add-on sdk, add-ons, extensions, reference provides access to button, toolbar, and sidebar ui objects. 64 url add-on sdk construct, validate, and parse urls. 66 widget add-on sdk create a simple user i...
...periodic timers. 63 ui add-on sdk, add-ons, extensions, reference provides access to button, toolbar, and sidebar ui objects. 64 url add-on sdk construct, validate, and parse urls. 66 widget add-on sdk create a simple user interface for an add-on in firefox's add-on bar. 67 windows add-on sdk enumerate and examine open browser windows, open new windows, and listen for window events. 68 low-level apis no summary! 69 /loader create commonjs module loaders. 70 chrome the chrome module gives an add-on sdk add-on access to the components object, which in turn gives it access to a large set of privileged low-level firefox apis. 71 console/pl...
...And 38 more matches
Working with windows in chrome code
this article describes working with multiple windows in mozilla chrome code (xul applications and extensions). it contains tips and example code on opening new windows, finding an already opened window, and passing data between different windows. opening windows from a <script> in a window or an overlay to open a new window, we usually use a window.open or window.opendialog dom call, like this: var win = window.open("chrome://myextension/content/about.xul", "aboutmyextension", "chrome,centerscreen"); the first parameter to window.open is the uri of the xul file that describes the window and its contents. the second parameter is the window's name; the name can be used in links or forms as the target attribute. this is different from the user-visible window...
...st parameter to window.open is the uri of the xul file that describes the window and its contents. the second parameter is the window's name; the name can be used in links or forms as the target attribute. this is different from the user-visible window title, which is specified using xul. the third, and optional, parameter is a list of special window features the window should have. the window.opendialog function works similarly, but lets you specify optional arguments that can be referenced from the javascript code. it also handles window features a little differently, including always assuming the dialog feature is specified. ...
...a list of special window features the window should have. the window.opendialog function works similarly, but lets you specify optional arguments that can be referenced from the javascript code. it also handles window features a little differently, including always assuming the dialog feature is specified. from xpcom components and modules if the window object is unavailable (for example, when opening a window from xpcom component code), you might want to use nsiwindowwatcher interface. its parameters are similar to window.open; in fact, window.open's implementation calls nsiwindowwatcher's methods. ...
...And 32 more matches
HTTP Cache
are no longer accessible through the cache apis; the method is fast to execute and non-blocking in any way; the actual erase happens in background purgefrommemory – removes (schedules to remove) any intermediate cache data held in memory for faster access (more about the intermediate cache below) nsiloadcontextinfo distinguishes the scope of the storage demanded to open. mandatory argument to *storage methods of nsicachestorageservice. //github.com/realityripple/uxp/blob/master/netwerk/base/public/nsiloadcontextinfo.idl it is a helper interface wrapping following four arguments into a single one: private-browsing boolean flag anonymous load boolean flag app id number (0 for no app) is-in-browser b...
... storage area (or scope) to put and get cache entries mapped by urls into and from it. similarity with the old cache: this interface may be with some limitations considered as a mirror to nsicachesession, but less generic and not inclining to abuse. unimplemented or underimplemented functionality: asyncevictstorage (bug 977766), asyncvisitstorage (bug 916052) nsicacheentryopencallback //github.com/realityripple/uxp/blob/master/netwerk/cache2/nsicacheentryopencallback.idl the result of nsicachestorage.asyncopenuri is always and only sent to callbacks on this interface. these callbacks are ensured to be invoked when asyncopenuri returns ns_ok. important difference in behavior from the old cache: when the cache entry object is already present in...
...immediately); there is currently no way to opt out of this feature (watch bug 938186). ...
...And 30 more matches
OS.File for the main thread
hrome code, add the following line at the start of your script: components.utils.import("resource://gre/modules/osfile.jsm") promises before using os.file from the main thread, you need some understanding of the promise library. see the promise object documentation for details. also, os.file plays very nicely with task.jsm. 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). the content is read asynchronously. the result is a promise. let decoder = new textdecoder(); // this decoder can be reused for several reads let promise = os.file.read("file.txt"); // read the complete file as an array promise = promise.then( function onsuccess(array) { return decoder.decode(...
... ); }; r.readasarraybuffer(b); }, 'image/png'); }; //var path = os.path.tofileuri(os.path.join(os.contants.path.desktopdir, 'my.png')); //do it like this for images on disk var path = 'https://mozorg.cdn.mozilla.net/media/img/firefox/channel/toggler-beta.png?2013-06'; //do like this for images online img.src = path; example: append to file this example shows how to use open, write, and close to append to a file. if the file does not exist, it is created. at the time of this writing, write does not support encoding option so the text to be written has to be encoded with textencoder. this example also shows the resolve value of open (an instance of os.file, this is a file, so you can do any of the methods on it found here), write (a number indicating bytes written), a...
...ort encoding option so the text to be written has to be encoded with textencoder. this example also shows the resolve value of open (an instance of os.file, this is a file, so you can do any of the methods on it found here), write (a number indicating bytes written), and close (undefined, meaning there is no resolve value). ...
...And 30 more matches
Client-side storage - Learn web development
tail in this article, although we will show a simple example in the offline asset storage section below. storing simple data — web storage the web storage api is very easy to use — you store simple name/value pairs of data (limited to strings, numbers, etc.) and retrieve these values when needed. ...
...we will show a simple example in the offline asset storage section below. storing simple data — web storage the web storage api is very easy to use — you store simple name/value pairs of data (limited to strings, numbers, etc.) and retrieve these values when needed. basic syntax let's show you how: first, go to our web storage blank template on github (open this in a new tab). open the javascript console of your browser's developer tools. all of your web storage data is contained within two object-like structures inside the browser: sessionstorage and localstorage. the first one persists data for as long as the browser is open (the data is lost when the browser is closed) and the second one persists data even after the browser is closed and then opened again. we'll us...
...t console: localstorage.removeitem('name'); let myname = localstorage.getitem('name'); myname the third line should now return null — the name item no longer exists in the web storage. the data persists! one key feature of web storage is that the data persists between page loads (and even when the browser is shut down, in the case of localstorage). let's look at this in action. ...
...And 23 more matches
Eclipse CDT
system requirements eclipse will use a lot of memory to fully index the mozilla source tree to provide code assistance features (easily 4 gb of ram, although this will drop to just over 1 gb if you restart after indexing is complete). therefore, it is not recommended for use if your machine only has 4 gb of ram. installing eclipse regarding llvm4eclipsecdt, do not install or select this toolchain for mozilla development. ...
... etc. these can be found and processed by eclipse. note: your moz_objdir must be outside the mozilla source directory. once your build is complete, mach can then generate a useful eclipse project on your behalf. first, make sure that the directory of eclipse's eclipse binary (typically /applications/eclipse.app/contents/macos/ on macos) is in your path. then, to create the eclipse project and open it, run: ./mach ide eclipse or to create the eclipse project without opening it yet, run: ./mach build-backend -b cppeclipse building the eclipse project should only take a few seconds. in the case of the build-backend command, instructions on how to open the project will be displayed after the command completes. manual setup, and more more information can be found on the eclipse cdt manua...
..." step above doesn't need to be rerun all that often. rerun it (and then rebuild the index) once a week or so, or as necessary when you start to notice unusual code assistance issues that aren't fixed by rebuilding the index alone. rebuilding the index itself is required much more frequently since the source changes more frequently. in principle, you can set the index to rebuild automatically by opening the workspace preferences, selecting "c/c++ > indexer", and reenabling "automatically update the index". however, you may find this too disruptive, since re-indexing will then happen very frequently and code assistance can be broken while the index is rebuilding. the alternative is to leave that option disabled and update the index manually as necessary. to update the index manually, use the c...
...And 22 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
ue are used to make up the final color. to represent a color through which the background can be seen to some extent, a fourth channel is added to the color: the alpha channel. the alpha channel specifies how opaque the color is. 19 apple safari glossary, navigation, webmechanics safari is a web browser developed by apple and bundled with both macos and ios. it's based on the open source webkit engine. 20 application context codingscripting, glossary an application context is a top-level browsing context that has a manifest applied to it. 21 argument codingscripting, glossary, javascript an argument is a value (primitive or object) passed as input to a function. 22 arpanet glossary, infrastructure the arpanet (...
...t bigint, glossary, javascript, reference, arbitrary precision format in javascript, bigint is a numeric data type that can represent integers in the arbitrary precision format. in other programming languages different numeric types can exist, for examples: integers, floats, doubles, or bignums. 31 blink glossary, infrastructure, layout, rendering engine blink is an open-source browser layout engine developed by google as part of chromium (and therefore part of chrome as well). specifically, blink began as a fork of the webcore library in webkit, which handles layout, rendering, and dom, but now stands on its own as a separate rendering engine. 32 block disambiguation, glossary the term block can have several meanings depending on the context...
... boot2gecko boot2gecko, firefox os, glossary, infrastructure, intro boot2gecko (b2g) is the engineering codename for firefox os and refers to builds that haven't yet received official firefox os branding. (firefox os was also often called boot2gecko before the project had an official name.) 38 bootstrap bootstrap, css, glossary, intro, framework bootstrap is a free, open source html, css, and javascript framework for quickly building responsive websites. 39 bounding box bounding box, codingscripting, design, glossary the bounding box of an element is the smallest possible rectangle (aligned with the axes of that element's user coordinate system) that entirely encloses it and its descendants. 40 breadcrumb accessibility, glossar...
...And 21 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
pt.options.showinconsole (present in firefox 3.5+) outputs javascript errors to the error console. true javascript.options.strict (present in firefox 3.5+) enforces strict error output from javascript true table 1: preferences to set for developing extensions to make these changes, start your development profile, type about:config into firefox’s location bar and open the preferences window; find the preferences listed in table 1 and double-click on them to set them accordingly. some of these preferences do not exist—to create them, right-click, select “new>boolean”, and type in the name and set the value accordingly. install the dom inspector the dom inspector is an extension that lets you examine html and xul dom tree structures, javascript objects a...
...e cross-package overlay, overlaying the firefox browser window, at chrome://browser/content/browser.xul with chrome://helloworld/content/overlay.xul. finding overlay merge points the next step is to find the “merge points” where the overlay document will insert its content into the base document. there are a number of ways to go about this; here, we’ll use the dom inspector (figure 5). open the dom inspector by selecting the tools > dom inspector menu item. firefox 31 open the dom inspector by open menu>developer>dom inspector menu item. type chrome://browser/content/browser.xul into the url input field at the top, then click the inspect button. a browser pane will appear in the lower part of the window. click the spots numbered 1 and 2 in figure 5, in that order; the menu eleme...
... the element gets added. test install and operational check this brings us to the point where we finally install our hello world extension. using the normal xpi-style installer would just be added trouble in this case, so we won’t use it. for source files under development, we do test installs. placing pointer files first, navigate to the profile folder of the currently active profile4, and open the extensions folder within it. create a new file there with the name you used as the hello world extension id in the install manifest, helloworld@xuldev.org. set the contents of that file to be the full path to the work folder for your extension source files, c:\extensions\helloworld. listing 3: additional content for overlay.xul <?xml version="1.0"?> <overlay id="helloworldoverlay" xmlns="ht...
...And 19 more matches
Tabbed browser - Archive of obsolete content
using the global variable gbrowser. // gbrowser is only accessible from the scope of // the browser window (browser.xul) gbrowser.addtab(...); if gbrowser isn't defined your code is either not running in the scope of the browser window or running too early. you can access gbrowser only after the browser window is fully loaded. if you need to do something with gbrowser right after the window is opened, listen for the load event and use gbrowser in the event listener. if your code does not have access to the main window because it is run in a sidebar or dialog, you first need to get access to the browser window you need before you can use gbrowser. you can find more information on getting access to the browser window in working with windows in chrome code. from a sidebar basically, if your...
...onents.interfaces.nsiwebnavigation) .queryinterface(components.interfaces.nsidocshelltreeitem) .roottreeitem .queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsidomwindow); mainwindow.gbrowser.addtab(...); from a dialog if your code is running in a dialog opened directly by a browser window, you can use: window.opener.gbrowser.addtab(...); if window.opener doesn't work, you can get the most recent browser window using this code: var wm = components.classes["@mozilla.org/appshell/window-mediator;1"] .getservice(components.interfaces.nsiwindowmediator); var mainwindow = wm.getmostrecentwindow("navigator:browser"); mainwindow.gbrows...
...rowser window, you can use: window.opener.gbrowser.addtab(...); if window.opener doesn't work, you can get the most recent browser window using this code: var wm = components.classes["@mozilla.org/appshell/window-mediator;1"] .getservice(components.interfaces.nsiwindowmediator); var mainwindow = wm.getmostrecentwindow("navigator:browser"); mainwindow.gbrowser.addtab(...); opening a url in a new tab // add tab gbrowser.addtab("http://www.google.com/"); // add tab, then make active gbrowser.selectedtab = gbrowser.addtab("http://www.google.com/"); manipulating content of a new tab if you want to work on the content of the newly opened tab, you'll need to wait until the content has finished loading. // wrong way (the page hasn't finished loading yet) var newtabbrowse...
...And 19 more matches
nsIWindowWatcher
inherits from: nsisupports last changed in gecko 0.9.6 usage notes: this component has an activewindow property. clients may expect this property to be always current, so to properly integrate this component the application will need to keep it current by setting the property as the active window changes. this component should not keep a (xpcom) reference to any windows; the implementation will claim no ownership. ...
...creator(). ...
...and returning it on demand. users must keep this attribute current, including after the topmost window is closed. this attribute will be null if the active window is not an nsidomwindow; for example, if the active window is an alert. methods getchromeforwindow() retrieve the chrome window mapped to the given dom window. nsiwindowwatcher keeps a list of all top-level dom windows currently open, along with their corresponding chrome interfaces. since dom windows lack a (public) means of retrieving their corresponding chrome, this method will do that. nsiwebbrowserchrome getchromeforwindow( in nsidomwindow awindow ); parameters awindow the nsidomwindow whose chrome window the caller needs. return value an nsiwebbrowserchrome object for the corresponding chrome window getnewa...
...And 18 more matches
PopupEvents - Archive of obsolete content
this event will be fired even for elements that don't have a context menu associated with them. for more information about how to use this event, see context menu events. popupshowing this event is fired on a menupopup, panel or tooltip just before it is made visible. ...
...en because the user selected an item from the menu, or it may be because the popup was closed by clicking elsewhere. popuphidden this event is fired on a menupopup, panel or tooltip once it has been hidden. the popupshowing event just before a popup is about to be displayed, a popupshowing event will fired on the popup. this will occur regardless of how the popup is opened, either from user interaction or from a script calling the openpopup or openpopupatscreen methods. the typical usage of a listener of the popupshowing event is to adjust the content of the popup based on context. for instance, right clicking on an image might display items on a context menu pertaining to images, whereas clicking on a link would display only those items pertaining to links. with...
...alue="time:"/> <label id="time"/> </panel> <toolbarbutton label="show time" popup="time-panel"/> you can prevent a menu or popup from appearing by calling the preventdefault method of the event from within a popupshowing listener. the default operation of the popupshowing event is to continue showing the popup. ...
...And 17 more matches
windows - Archive of obsolete content
to learn more about private windows, how to opt into private browsing, and how to support private browsing, refer to the documentation for the private-browsing module. ...
... to learn more about private windows, how to opt into private browsing, and how to support private browsing, refer to the documentation for the private-browsing module. ...
... to learn more about private windows, how to opt into private browsing, and how to support private browsing, refer to the documentation for the private-browsing module. ...
...And 16 more matches
Tree View Details - Archive of obsolete content
hierarchical custom view in the last section, we created a simple tree view that implemented only a minimum amount of functionality. next, let's look at some additional functions that views may implement. here, we will examine how to create a hierarchical set of items using the view. this is a fairly tricky process as it involves keeping track of which items have children and also which rows are open and closed. nesting level every row in the tree has a nesting level. the topmost rows are at level 0, the children of those rows are at level 1, their children at level 2 and so on. the tree will query the view for each row by calling its getlevel method to find out the level of that row. the view will need to return 0 for the outermost rows and higher values for inner rows. the tree will use t...
...unction is used, specifically, to draw the nesting lines along the side of the tree. the getparentindex method is expected to return the parent row of a given row, that is, the row before it with a lower nesting value. all of these methods must be implemented by the view for children to be handled properly. containers there are also three functions, iscontainer, iscontainerempty and iscontaineropen that are used to handle a parent item in the tree. the iscontainer method should return true if a row is a container and might contain children. the iscontainerempty method should return true if a row is an empty container, for instance, a directory with no files in it. the iscontaineropen method is used to determine which items are opened and closed. the view is required to keep track of th...
...r method should return true if a row is a container and might contain children. the iscontainerempty method should return true if a row is an empty container, for instance, a directory with no files in it. the iscontaineropen method is used to determine which items are opened and closed. the view is required to keep track of this. the tree will call this method to determine which containers are open and which are closed. note that the tree will call neither iscontainerempty nor iscontaineropen for rows that are not containers as indicated by the return value of the iscontainer method. a container may be rendered differently than a non-container. for instance, a container may have a folder icon beside it. a style sheet may be used to style items based on various properties such as whether ...
...And 16 more matches
Command line options
syntax rules but first, let's describe the syntax rules that apply for all options. ...
... syntax rules but first, let's describe the syntax rules that apply for all options. ...
... syntax rules but first, let's describe the syntax rules that apply for all options. ...
...And 16 more matches
Encrypt Decrypt_MAC_Using Token
ader file. ...
... secitem *item, prbool ishexdata) { secstatus rv; prfiledesc* file; secitem filedata; secitem outbuf; unsigned char *nonbody; unsigned char *body; char header[40]; char trailer[40]; outbuf.type = sibuffer; file = pr_open(filename, pr_rdonly, 0); if (!file) { pr_fprintf(pr_stderr, "failed to open %s\n", filename); return secfailure; } switch (type) { case symkey: strcpy(header, enckey_header); strcpy(trailer, enckey_trailer); break; case mackey: strcpy(header, mackey_header); strcpy(trailer, mackey_trailer); break; case iv: strcpy(header, iv_header); strcpy(trailer, iv_trailer); break; ...
...; unsigned int filelength; unsigned int paddinglength; int j; memcpy(iv, ivitem->data, ivitem->len); paddinglength = (unsigned int)paditem->data[0]; ctxmac = pk11_createcontextbysymkey(ckm_md5_hmac, cka_sign, mk, &noparams); if (ctxmac == null) { pr_fprintf(pr_stderr, "can't create mac context\n"); rv = secfailure; goto cleanup; } /* open the input file. */ infile = pr_open(encryptedfilename, pr_rdonly , 0); if (!infile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for writing.\n", encryptedfilename); return secfailure; } /* open the output file. */ outfile = pr_open(outfilename, pr_create_file | pr_truncate | pr_rdwr , 00660); ...
...And 16 more matches
nsIZipWriter
exceptions thrown ns_er...
... file nsifile the zip file being written to. read only. inqueue boolean true if operations are being performed in the background queue, or false if background operations are not in progress. read only. ...
... file nsifile the zip file being written to. read only. ...
...And 16 more matches
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
: although there is a specification document, its markup is based on implementations and markup as of 2001, and current xul differs from it in many aspects. for the latest xul specifications, please see the xul reference on mdc and the xul page in the mozilla wiki. for each element that i explain in this chapter, i will illustrate it with a source code example. you can type these examples up and open them in firefox to see how they behave and appear. you can download a file with all the source code examples from: fixme: attache the translated tarball - paul task !. xul display methods xul is used almost exclusively in mozilla applications like firefox and thunderbird, and extensions for them, but other web browsers based on firefox or the gecko engine, and even web-based content also used x...
...in this chapter, save them as text files with .xul extensions and drag and drop them into the firefox browser window. fixme: explain how setting this option and use next listings if we want to run firefox displaying none of its gui and only the contents of a certain xul file, we can launch firefox and set the option: -chrome file_url.xul another way, as shown in listing 1, is to use the window.opendialog() method, which can be used only within a xul window. this is used by extensions to open a separate window. window.opendialog('another.xul', '_blank','chrome,all,dialog=no'); listing 1: opening a window without the firefox gui xul as an xml application listing 2 shows an example of a gui definition file marked up in xul (a "xul document"). the root element in xul is generally the "wind...
...ently selected theme in firefox. we can also read in a stylesheet that we had set up ourselves. the xul box model in principle, xul lays out all ui components using combinations of two kinds of boxes: horizontal and vertical. as shown in listing 3, elements can be laid out horizontally using the hbox (horizontal box) element or vertically using the vbox (vertical box) element. when this file is opened in firefox, it is displayed as shown in figure 1. <label value="horizontal layout"/> <hbox> <button label="horizontal1"/> <button label="horizontal2"/> </hbox> <label value="vertical layout"/> <vbox> <button label="vertical1"/> <button label="vertical2"/> </vbox> <label value="mixed"/> <hbox> <button label="mixed1"/> <vbox> <button label="mixed2"/> <button label="mixed3"/> ...
...And 15 more matches
tabs - Archive of obsolete content
open, manipulate, and access tabs, and receive tab events. usage open a tab you can open a new tab, specifying various properties including location: var tabs = require("sdk/tabs"); tabs.open("http://www.example.com"); track tabs you can register event listeners to be notified when tabs open, close, finish loading dom content, or are made active or inactive: var tabs = require("sdk/tabs"); // listen for tab openings. tabs.on('open', function onopen(tab) { myopentabs.push(tab); }); // listen for tab content loads. tabs.on('ready', function(tab) { console.log('tab is loaded', tab.title, tab.url); }); access tabs the module itself can be used as a list of all opened tabs across all windows. in particular, you can enumerate it: var tabs = require('sdk/tabs'); for (let tab of tab...
...y active tab: var tabs = require('sdk/tabs'); tabs.on('activate', function () { console.log('active: ' + tabs.activetab.url); }); track a single tab given a tab, you can register event listeners to be notified when the tab is closed, activated or deactivated, or when the page hosted by the tab is loaded or retrieved from the "back-forward cache": var tabs = require("sdk/tabs"); function onopen(tab) { console.log(tab.url + " is open"); tab.on("pageshow", logshow); tab.on("activate", logactivate); tab.on("deactivate", logdeactivate); tab.on("close", logclose); } function logshow(tab) { console.log(tab.url + " is loaded"); } function logactivate(tab) { console.log(tab.url + " is activated"); } function logdeactivate(tab) { console.log(tab.url + " is deactivated"); } fu...
...by setting the url property you can load a new page in the tab: var tabs = require("sdk/tabs"); tabs.on('activate', function(tab) { tab.url = "http://www.example.com"; }); ...
...And 14 more matches
Index - Archive of obsolete content
Archive › Mozilla › XUL › Index
xul attributes, xul reference no summary! 13 align reference, référence(2), xul no summary! 14 allowevents xul attributes, xul reference no summary! 15 allownegativeassertions xul attributes, xul reference no summary! 16 alternatingbackground xul attributes, xul reference no summary! 17 alwaysopenpopup xul attributes, xul reference no summary! 18 attribute xul attributes, xul reference no summary! 19 autofillaftermatch xul attributes, xul reference no summary! 20 autocheck xul attributes, xul reference no summary! 21 autocompleteenabled xul attributes, xul reference no summary! 22 autoc...
...onunload xul attributes, xul reference no summary! 253 onwizardback xul attributes, xul reference no summary! 254 onwizardcancel xul attributes, xul reference no summary! 255 onwizardfinish xul attributes, xul reference no summary! 256 onwizardnext xul attributes, xul reference no summary! 257 open needshelp, xul attributes, xul reference, needsattention no summary! 258 ordinal xul attributes, xul reference no summary! 259 orient xul attributes, xul reference no summary! 260 pack xul attributes, xul reference no summary! 261 page no summary! 262 pageid xul attributes, xul reference ...
...osition xul methods, xul reference no summary! 539 onfindagaincommand no summary! 540 onsearchcomplete needshelp, xul methods, xul reference no summary! 541 ontextentered needshelp, xul methods, xul reference no summary! 542 ontextreverted needshelp, xul methods, xul reference no summary! 543 open no summary! 544 openpopup xul methods, xul reference opens the popup relative to a specified node at a specific location. 545 openpopupatscreen xul methods, xul reference no summary! 546 opensubdialog xul methods, xul reference no summary! 547 openwindow xul methods, xul reference no summary! 548...
...And 14 more matches
Accessing the Windows Registry Using XPCOM
low-level details taken care of for you. if you are writing an extension that only needs to support firefox 1.5 or newer, then you only need to read this section. ...
...owsregkey); wrk.open(wrk.root_key_local_machine, "software\\microsoft\\windows\\currentversion", wrk.access_read); var id = wrk.readstringvalue("productid"); wrk.close(); this example, while simple, shows several important things about using the interface. first, you must use createinstance() to get an object implementing this interface, not getservice(). second, you must call open() on the key before attempting to read a value. notice in the open() call that the root key to use is specified using the named constants available on the nsiwindowsregkey interface, in this case root_key_local_machine, which corresponds to hkey_local_machine in the windows registry. also notice that the path to the key has backslashes escaped, a necessity in javascript and c++ string constants.
...ng a named constant from the interface, in this example access_read. this can be very important when dealing with non-administrator accounts with restricted privileges. the value is read using readstringvalue(). you have to specify what type of data you expect to read, which we will expand on later. finally, note that you should close the key when you are done to avoid wasting system resources. opening registry keys before doing anything with a registry key you must first open the key you are interested in. the example above demonstates this using the open() method. if you want to create a new key, you can use the create() method, which takes the same parameters as open(). note that it is not an error to call create() on an existing key, and doing so has the same result as calling open(). ...
...And 14 more matches
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
mozilla also supports internet explorer's innerhtml method, which it can call on almost any node. it does not, however, support outerhtml (which adds markup around an element, and has no standard equivalent) and innertext (which sets the text value of the node, and which you can achieve in mozilla by using textcontent). internet explorer has several content manipulation metho...
...ou should use the onload event handler on the <body> tag: <body onload="dofinish();"> <div id="foo">loading...</div> <script> function dofinish() { var element = document.getelementbyid("foo"); element.innerhtml = "done."; } </script> ... such timing-related issues are also hardware-related -- slower systems can reveal bugs that faster systems hide. ...
...e the onload event handler on the <body> tag: <body onload="dofinish();"> <div id="foo">loading...</div> <script> function dofinish() { var element = document.getelementbyid("foo"); element.innerhtml = "done."; } </script> ... such timing-related issues are also hardware-related -- slower systems can reveal bugs that faster systems hide. ...
...And 13 more matches
nsILocalFile
de only! void appendrelativepath(in astring relativefilepath); acstring getrelativedescriptor(in nsilocalfile fromfile); void initwithfile(in nsilocalfile afile); void initwithnativepath(in acstring filepath); native code only! void initwithpath(in astring filepath); void launch(); prlibrarystar load(); native code only! file openansifiledesc(in string mode); native code only! prfiledescstar opennsprfiledesc(in long flags, in long mode); native code only! void reveal(); void setrelativedescriptor(in nsilocalfile fromfile, in acstring relativedesc); attributes attribute type description diskspaceavailable print64 the number of bytes available to non-superuser ...
... persistent descriptor is intended to be used whenever a nsilocalfile needs to be serialized to disk and later recovered. this string is not intended for display to users. note: the value of the followlinks attribute is not encoded in the persistent descriptor. constants constant value description delete_on_close 0x80000000 optional parameter used by opennsprfiledesc(). methods native code only! appendrelativenativepath appends a relative, native character encoding, path to the current path of the nsilocalfile object. void appendrelativenativepath( in acstring relativefilepath ); parameters relativefilepath a native relative path. for security reasons, this cannot contain '..' or cannot start with a directory separator '/'.
...will be reset. void initwithpath( in astring filepath ); parameters filepath a string that specifies a platform-specific, full path to a file or directory. exceptions thrown ns_error_file_unrecognized_path indicates that filepath is not an absolute file path or that it contains characters that are invalid for the filesystem. launch() requests that the operating system attempt to open this file. void launch(); parameters none. native code only! load returns the result of pr_loadlibrary() on the file. the caller is responsible for calling pr_unloadlibrary() on the result. prlibrarystar load(); parameters none. return value a pointer to a prlibrary. example #include "prlink.h" #include "nserror.h" #include "nsilocalfile.h" // load the dll corresponding to th...
...And 13 more matches
menupopup - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container used to display the contents of a popup menu. when a menupopup is open, it floats above the window and may extend outside the window border. there are several ways in which a menupopup may be used: it may be placed inside a menu, menulist, toolbarbutton, or a button with the type attribute set to "menu" to create a popup that will open when the menu or button is pressed. it may be attached to any element using the popup attribute. ...
... more information is available in the xul tutorial and popup guide. ...
... type attribute set to "menu" to create a popup that will open when the menu or button is pressed. it may be attached to any element using the popup attribute. when the element is clicked with the left mouse button, the menupopup will be displayed. it may be attached to any element using the context attribute. when a context menu is opened, the menupopup will be displayed. a context menu may be opened by right-clicking the element, or by pressing the menu key on the keyboard. more information is available in the xul tutorial and popup guide. ...
...And 12 more matches
Encrypt Decrypt MAC Keys As Session Objects
eader file */ secstatus readfromheaderfile(const char *filename, headertype type, secitem *item, prbool ishexdata) { secstatus rv; prfiledesc* file; secitem filedata; secitem outbuf; unsigned char *nonbody; unsigned char *body; char header[40]; char trailer[40]; outbuf.type = sibuffer; file = pr_open(filename, pr_rdonly, 0); if (!file) { pr_fprintf(pr_stderr, "failed to open %s\n", filename); return secfailure; } switch (type) { case symkey: strcpy(header, enckey_header); strcpy(trailer, enckey_trailer); break; case mackey: strcpy(header, mackey_header); strcpy(trailer, mackey_trailer); break; case iv: ...
...; unsigned int filelength; unsigned int paddinglength; int j; memcpy(iv, ivitem->data, ivitem->len); paddinglength = (unsigned int)paditem->data[0]; ctxmac = pk11_createcontextbysymkey(ckm_md5_hmac, cka_sign, mk, &noparams); if (ctxmac == null) { pr_fprintf(pr_stderr, "can't create mac context\n"); rv = secfailure; goto cleanup; } /* open the input file. */ infile = pr_open(encryptedfilename, pr_rdonly , 0); if (!infile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for writing.\n", encryptedfilename); return secfailure; } /* open the output file. */ outfile = pr_open(outfilename, pr_create_file | pr_truncate | pr_rdwr , 00660); ...
... if (!infile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for writing.\n", encryptedfilename); return secfailure; } /* open the output file. ...
...And 12 more matches
Encrypt and decrypt MAC using token
eader file */ secstatus readfromheaderfile(const char *filename, headertype type, secitem *item, prbool ishexdata) { secstatus rv; prfiledesc* file; secitem filedata; secitem outbuf; unsigned char *nonbody; unsigned char *body; char header[40]; char trailer[40]; outbuf.type = sibuffer; file = pr_open(filename, pr_rdonly, 0); if (!file) { pr_fprintf(pr_stderr, "failed to open %s\n", filename); return secfailure; } switch (type) { case symkey: strcpy(header, enckey_header); strcpy(trailer, enckey_trailer); break; case mackey: strcpy(header, mackey_header); strcpy(trailer, mackey_trailer); break; case iv: ...
...; unsigned int filelength; unsigned int paddinglength; int j; memcpy(iv, ivitem->data, ivitem->len); paddinglength = (unsigned int)paditem->data[0]; ctxmac = pk11_createcontextbysymkey(ckm_md5_hmac, cka_sign, mk, &noparams); if (ctxmac == null) { pr_fprintf(pr_stderr, "can't create mac context\n"); rv = secfailure; goto cleanup; } /* open the input file. */ infile = pr_open(encryptedfilename, pr_rdonly , 0); if (!infile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for writing.\n", encryptedfilename); return secfailure; } /* open the output file. */ outfile = pr_open(outfilename, pr_create_file | pr_truncate | pr_rdwr , 00660); ...
... if (!infile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for writing.\n", encryptedfilename); return secfailure; } /* open the output file. ...
...And 12 more matches
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
e>\n"); exit(-1); } } /* * sign the contents of input file using private key and * return result as secitem */ secstatus signdata(const char *infilename, seckeyprivatekey *pk, secitem *res) { secstatus rv = secfailure; unsigned int nb; unsigned char ibuf[4096]; prfiledesc *infile = null; sgncontext *sgn = null; /* open the input file for reading */ infile = pr_open(infilename, pr_rdonly, 0); if (!infile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for reading.\n", infilename); rv = secfailure; goto cleanup; } /* sign using private key */ sgn = sgn_newcontext(sec_oid_pkcs1_md5_with_rsa_encryption, pk); if (!sgn) { pr_fprintf...
..._destroycontext(sgn, pr_true); } return rv; } /* * verify the signature using public key */ secstatus verifydata(const char *infilename, seckeypublickey *pk, secitem *sigitem, secupwdata *pwdata) { unsigned int nb; unsigned char ibuf[4096]; secstatus rv = secfailure; vfycontext *vfy = null; prfiledesc *infile = null; /* open the input file for reading */ infile = pr_open(infilename, pr_rdonly, 0); if (!infile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for reading.\n", infilename); rv = secfailure; goto cleanup; } vfy = vfy_createcontext(pk, sigitem, sec_oid_pkcs1_md5_with_rsa_encryption, ...
... readfromheaderfile(const char *filename, headertype type, secitem *item, prbool ishexdata) { secstatus rv = secsuccess; prfiledesc* file = null; secitem filedata; secitem outbuf; unsigned char *nonbody; unsigned char *body; char *header; char *trailer; outbuf.type = sibuffer; file = pr_open(filename, pr_rdonly, 0); if (!file) { pr_fprintf(pr_stderr, "failed to open %s\n", filename); rv = secfailure; goto cleanup; } switch (type) { case pubkey: header = pubkey_header; trailer = pubkey_trailer; break; case symkey: header = enckey_header; trailer = enckey_trailer; break; case ...
...And 12 more matches
NSS Sample Code Sample_3_Basic Encryption and MACing
eader file */ secstatus readfromheaderfile(const char *filename, headertype type, secitem *item, prbool ishexdata) { secstatus rv; prfiledesc* file; secitem filedata; secitem outbuf; unsigned char *nonbody; unsigned char *body; char header[40]; char trailer[40]; outbuf.type = sibuffer; file = pr_open(filename, pr_rdonly, 0); if (!file) { pr_fprintf(pr_stderr, "failed to open %s\n", filename); return secfailure; } switch (type) { case symkey: strcpy(header, enckey_header); strcpy(trailer, enckey_trailer); break; case mackey: strcpy(header, mackey_header); strcpy(trailer, mackey_trailer); break; case iv: ...
...; unsigned int filelength; unsigned int paddinglength; int j; memcpy(iv, ivitem->data, ivitem->len); paddinglength = (unsigned int)paditem->data[0]; ctxmac = pk11_createcontextbysymkey(ckm_md5_hmac, cka_sign, mk, &noparams); if (ctxmac == null) { pr_fprintf(pr_stderr, "can't create mac context\n"); rv = secfailure; goto cleanup; } /* open the input file. */ infile = pr_open(encryptedfilename, pr_rdonly , 0); if (!infile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for writing.\n", encryptedfilename); return secfailure; } /* open the output file. */ outfile = pr_open(outfilename, pr_create_file | pr_truncate | pr_rdwr , 00660); ...
... if (!infile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for writing.\n", encryptedfilename); return secfailure; } /* open the output file. ...
...And 12 more matches
All keyboard shortcuts - Firefox Developer Tools
this page lists all keyboard shortcuts used by the developer tools built into firefox. the first section lists the shortcut for opening each tool and the second section lists shortcuts that are applicable to the toolbox itself. after that there's one section for each tool, which lists the shortcuts that you can use within that tool. because access keys are locale-dependent, they're not documented in this page. opening and closing tools these shortcuts work in the main browser window to open the specified tool. the same shortcuts will work to close tools hosted in the toolbox, if the tool is active. ...
...e section for each tool, which lists the shortcuts that you can use within that tool. because access keys are locale-dependent, they're not documented in this page. opening and closing tools these shortcuts work in the main browser window to open the specified tool. the same shortcuts will work to close tools hosted in the toolbox, if the tool is active. for tools like the browser console that open in a new window, you have to close the window to close the tool. ...
...t, they're not documented in this page. opening and closing tools these shortcuts work in the main browser window to open the specified tool. the same shortcuts will work to close tools hosted in the toolbox, if the tool is active. for tools like the browser console that open in a new window, you have to close the window to close the tool. ...
...And 12 more matches
Using XMLHttpRequest - Web APIs
in this guide, we'll take a look at how to use xmlhttprequest to issue http requests in order to exchange data between the web site and a server. examples of both common and more obscure use cases for xmlhttprequest are included. to send an http request, create an xmlhttprequest object, open a url, and send the request. after the transaction completes, the object will contain useful information such as the response body and the http status of the result. function reqlistener () { console.log(this.responsetext); } var oreq = new xmlhttprequest(); oreq.addeventlistener("load", reqlistener); oreq.open("get", "http://www.example.org/example.txt"); oreq.send(); types of requests a request made via xmlhttprequest can fetch the data in one of two ways, asynchronously or synchronously. the typ...
...if this argument is true or not specified, the xmlhttprequest is processed asynchronously, otherwise the process is handled synchronously. a detailed discussion and demonstrations of these two types of requests can be found on the synchronous and asynchronous requests page. ...
...y data although xmlhttprequest is most commonly used to send and receive textual data, it can be used to send and receive binary content. there are several well tested methods for coercing the response of an xmlhttprequest into sending binary data. these involve utilizing the overridemimetype() method on the xmlhttprequest object and is a workable solution. var oreq = new xmlhttprequest(); oreq.open("get", url); // retrieve data unprocessed as a binary string oreq.overridemimetype("text/plain; charset=x-user-defined"); /* ... */ however, more modern techniques are available, since the responsetype attribute now supports a number of additional content types, which makes sending and receiving binary data much easier. for example, consider this snippet, which uses the responsetype of "arrayb...
...And 12 more matches
Menus - Archive of obsolete content
menus a menu provides a list of commands that the user can carry out. menu types a menu is created using the menupopup tag. it is normally attached to a menubar or to a button. when the menu or button is clicked the menu is opened, listing the commands that are available. the user may select a command to invoke it, or may cancel the operation by pressing escape or clicking outside the menu. xul provides a number of tags for creating menus. these tags can be used to create menus which sit on a menubar or are attached to buttons. submenus may be created by nesting one menu inside of another. no special code needs to be written to open or close a menu or submenu, and, in addition, the menus are placed on screen in the appropriate locations automatically. there are four elements that ...
... also see a popup tag used in place of the menupopup tag. the popup tag is deprecated but is equivalent to the menupopup tag. menu tag overview the following shows a simple menu example, containing a menubar with a single menu labeled 'file'. <menubar id="sample-menubar"> <menu id="file-menu" label="file"> <menupopup id="file-popup"> <menuitem label="new"/> <menuitem label="open"/> <menuitem label="save"/> <menuseparator/> <menuitem label="exit"/> </menupopup> </menu> </menubar> there are five tags used in this example, described briefly here: menubar a row of menus that appears along the top of the window or screen. it should contain menu elements. menu a label of a menu on a menubar, for instance 'file' or 'tools'. a menu can also be ...
...s used for the labels on a menubar and for the labels of submenus. for information about submenus, see submenus below. the label for the menu element is specified using the label attribute. in the example below, the menu has the label 'view'. <menu label="view"> <menupopup> <menuitem label="toolbar"/> <menuitem label="status bar"/> </menupopup> </menu> when the menu is clicked, it opens the menupopup contained within it. for this reason, a menupopup should be placed as a direct child of the menu. the menu can also be opened by using the keyboard. the user can press a key to highlight the menu labels and navigate with the cursor keys. the key is different for each platform; on windows f10 can be used. another way is to add shortcut keys called access keys for each menu element ...
...And 11 more matches
Sqlite.jsm
using sqlite.jsm. note: the sqlite.jsm javascript code module can only be used from chrome -- that is, from within the application itself or an add-on. before you can use this module, you need to import it into your scope: components.utils.import("resource://gre/modules/sqlite.jsm") obtaining a connection sqlite.jsm exports the sqlite symbol. this symbol is an object with a single function: openconnection. this function takes an object defining connection options: path (required) the database file to open. this can be an absolute or relative path. if a relative path is given, it is interpreted as relative to the current profile's directory. if the path does not exist, a new sqlite database will be created. the value typically ends with .sqlite. sharedmemorycache (optional) boolean ...
...nconnectionidlems (optional) if defined, the connection will attempt to minimize its memory usage after this many milliseconds of connection idle. the connection is idle when no statements are executing. there is no default value which means no automatic memory minimization will occur. please note that this is not a timer on the idle service and this could fire while the application is active. ...
...attempt to minimize its memory usage after this many milliseconds of connection idle. the connection is idle when no statements are executing. there is no default value which means no automatic memory minimization will occur. please note that this is not a timer on the idle service and this could fire while the application is active. openconnection(options) returns a promise that resolves to an opened connection instance or is rejected if an error occurred while opening the database. here is an example: components.utils.import("resource://gre/modules/sqlite.jsm"); try { const conn = await sqlite.openconnection({ path: "mydatabase.sqlite", sharedmemorycache: false }); // connection is the opened sqlite connection (see below for api). } catch (error) { // the connection could not be o...
...And 11 more matches
EncDecMAC using token object - sample 3
) { return cryptinit(dk, iv, ivlen, type, cka_decrypt); } /* * read cryptographic parameters from the header file */ secstatus readfromheaderfile(const char *filename, headertype type, secitem *item, prbool ishexdata) { secstatus rv; prfiledesc* file; secitem filedata; secitem outbuf; unsigned char *nonbody; unsigned char *body; char header[40]; char trailer[40]; outbuf.type = sibuffer; file = pr_open(filename, pr_rdonly, 0); if (!file) { pr_fprintf(pr_stderr, "failed to open %s\n", filename); return secfailure; } switch (type) { case symkey: strcpy(header, enckey_header); strcpy(trailer, enckey_trailer); break; case mackey: strcpy(header, mackey_header); strcpy(trailer, mackey_trailer); break; case iv: strcpy(header, iv_header); strcpy(trailer, iv_trailer); break; case mac: strcpy(header, mac...
...l; unsigned char iv[blocksize]; unsigned int ivlen = ivitem->len; unsigned int filelength; unsigned int paddinglength; int j; memcpy(iv, ivitem->data, ivitem->len); paddinglength = (unsigned int)paditem->data[0]; ctxmac = pk11_createcontextbysymkey(ckm_md5_hmac, cka_sign, mk, &noparams); if (ctxmac == null) { pr_fprintf(pr_stderr, "can't create mac context\n"); rv = secfailure; goto cleanup; } /* open the input file. */ infile = pr_open(encryptedfilename, pr_rdonly , 0); if (!infile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for writing.\n", encryptedfilename); return secfailure; } /* open the output file. */ outfile = pr_open(outfilename, pr_create_file | pr_truncate | pr_rdwr , 00660); if (!outfile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for writing.\n", outfilename); return sec...
...r_stderr, newmac, newmaclen); rv = secfailure; } cleanup: if (ctxmac) { pk11_destroycontext(ctxmac, pr_true); } if (ctxenc) { pk11_destroycontext(ctxenc, pr_true); } if (outfile) { pr_close(outfile); } return rv; } /* * gets iv and ckaids from header file */ secstatus getivandckaidsfromheader(const char *cipherfilename, secitem *ivitem, secitem *enckeyitem, secitem *mackeyitem) { secstatus rv; /* open intermediate file, read in header, get iv and cka_ids of two keys * from it */ rv = readfromheaderfile(cipherfilename, iv, ivitem, pr_true); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not retrieve iv from cipher file\n"); goto cleanup; } rv = readfromheaderfile(cipherfilename, symkey, enckeyitem, pr_true); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not retrieve aes cka_id from...
...And 11 more matches
mozIStorageService
storage/public/mozistorageservice.idlscriptable this interface lets you open a mozistorageconnection to a database file, as well as create backups of an unopened database file. this is the only way to open a database connection. ...
...e file. this is the only way to open a database connection. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) see mozistorageconnection method overview nsifile backupdatabasefile(in nsifile adbfile, in astring abackupfilename, [optional] in nsifile abackupparentdirectory); mozistorageconnection opendatabase(in nsifile adatabasefile); mozistorageconnection openspecialdatabase(in string astoragekey); mozistorageconnection openunshareddatabase(in nsifile adatabasefile); methods backupdatabasefile() this method makes a backup of the specified file. ...
...the filename provided is only used as a suggestion. if the filename is already taken, attempts will be made to ensure that it is unique. the actual backup file is returned, and the resulting filename can be obtained from that. ...
...And 11 more matches
Add to iPhoto
d we'll be making use of them. the core foundation api is implemented by the corefoundation object, which consists of two methods to initialize and shut down the library, a reference to the library, and all the types and methods declared to support core foundation. ...
.... initializing core foundation the init() method, which sets everything up, looks like this: init: function() { this.lib = ctypes.open("/system/library/frameworks/corefoundation.framework/corefoundation"); // declaring all the apis goes here } shutting down core foundation while the core foundation system framework itself doesn't need to be shut down, we do need to close the library we opened using the js-ctypes api; that's where the shutdown() method comes in: shutdown: function() { this.lib.close(); } select api declarations let's take a look at a few of the key apis we declare for core foundation, to see how it's done. cfrange cfrange is a structure that identifies a range; that is, it identifies an offset to an item in a list and a number of items. in c, the declaration ...
...: ctypes.char.array(80)}]); the carbon library init() and shutdown() routines are otherwise similar to how we do things for core foundation. application services the application services framework consists of a number of different apis that provide special services to applications. ...
...And 11 more matches
A simple RTCDataChannel sample - Web APIs
while that's obviously a contrived scenario, it's useful for demonstrating the flow of connecting two peers. we'll cover the mechanics of accomplishing the connection and transmitting and receiving data, but we will save the bits about locating and linking to a remote computer for another example. ...
...while that's obviously a contrived scenario, it's useful for demonstrating the flow of connecting two peers. we'll cover the mechanics of accomplishing the connection and transmitting and receiving data, but we will save the bits about locating and linking to a remote computer for another example. ...
...to break this up and look at it a bit at a time, for clarity. note: even though both ends of our connection will be on the same page, we're going to refer to the one that starts the connection as the "local" one, and to the other as the "remote" end. ...
...And 11 more matches
<details>: The Details disclosure element - HTML: Hypertext Markup Language
Web › HTML › Element › details
if the first child of the <details> element is a <summary>, the contents of the <summary> element are used as the label for the disclosure widget. the source for this interactive example is stored in a github repository. ...
...if the first child of the <details> element is a <summary>, the contents of the <summary> element are used as the label for the disclosure widget. the source for this interactive example is stored in a github repository. ...
...ry>, the contents of the <summary> element are used as the label for the disclosure widget. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: the common use of a triangle which rotates or twists around to represent opening or closing the widget is why these are sometimes called "twisties." a <details> widget can be in one of two states. the default closed state displays only the triangle and the label inside <summary> (or a user agent-defined default string if no <summary>). this might look like the following: here we see a standard disclosure widget with the label "system requirements", in its default clos...
...And 11 more matches
HTTP Public Key Pinning (HPKP) - HTTP
place the pin on the intermediate certificate of the ca that issued the server certificate, to ease certificates renewals and rotations. first you need to extract the public key information from your certificate or key file and encode them using base64. the following commands will help you extract the base64 encoded information from a key file, a certificate signing request, or a certificate. ...
...t issued the server certificate, to ease certificates renewals and rotations. first you need to extract the public key information from your certificate or key file and encode them using base64. the following commands will help you extract the base64 encoded information from a key file, a certificate signing request, or a certificate. ...
..., to ease certificates renewals and rotations. first you need to extract the public key information from your certificate or key file and encode them using base64. the following commands will help you extract the base64 encoded information from a key file, a certificate signing request, or a certificate. ...
...And 11 more matches
Document Loading - From Load Start to Finding a Handler - Archive of obsolete content
t are initiated via the docshell. nsdocshell implements too many interfaces to count; the ones that matter to us most are nsiwebnavigation and nsilinkhandler. nsuriloader this is a service implementing nsiuriloader. it keeps track of currently pending loads and registered content listeners. some facilities are provided for starting loads, canceling loads, and other such micromanagement. nsdocumentopeninfo this class encapsulates all the information related to a particular load. there is basically one of these per load (though see the section on stream converters). nsdocumentopeninfo implements nsistreamlistener and proxies the nsistreamlistener calls over to the "real" stream listener once one is chosen. this is the class that handles deciding where the data from the load should go. supportin...
...()" coords="534,239,715,300" href="#nsiexternalhelperappservice::docontent"> <area alt="(10) getcategoryentry()" coords="575,418,821,418,821,455,629,455,629,484,575,484" href="#categorymanager" shape="poly"> <area alt="(12)" coords="539,133,583,163" href="#stream-converter"> <area alt="(11)" coords="485,133,537,163" href="#contenthandler"> <area alt="(9)" coords="445,132,484,165" href="#nsdocumentopeninfo::dispatchcontent"> <area alt="(8)" coords="405,133,439,162" href="#onstartrequest-innards"> <area alt="(7) onstartrequest()" coords="639,129,703,129,703,165,833,165,833,204,639,204" href="#onstartrequest" shape="poly"> <area alt="(6) asyncopen()" coords="637,121,709,121,709,96,783,96,783,58,637,58" href="#asyncopen" shape="poly"> <area alt="(5) open()" coords="311,306,432,371" href="#open"> <...
...="405,133,439,162" href="#onstartrequest-innards"> <area alt="(7) onstartrequest()" coords="639,129,703,129,703,165,833,165,833,204,639,204" href="#onstartrequest" shape="poly"> <area alt="(6) asyncopen()" coords="637,121,709,121,709,96,783,96,783,58,637,58" href="#asyncopen" shape="poly"> <area alt="(5) open()" coords="311,306,432,371" href="#open"> <area alt="(4)" coords="90,384,127,417" href="#openuri-innards"> <area alt="(0) registercontentlistener()" coords="37,474,346,474,346,505,88,505,88,535,37,535" href="#registercontentlistener" shape="poly"> <area alt="(3) openuri() (nsuriloader)" coords="5,207,312,269" href="#openuri"> <area alt="(2)" coords="102,114,139,148" href="#internalload"> <area alt="(1) loaduri/onlinkclick" coords="77,5,449,59" href="#loaduri"> <area alt="nsiexternalhelper...
...And 10 more matches
Monitoring downloads - Archive of obsolete content
s of firefox, it was previously only possible for one observer to do so at a time. firefox 3 introduces new api that allows any number of listeners to observe downloads. this article demonstrates how to monitor downloads in firefox 3, using the download manager. as a nice bonus, it also demonstrates how to use the storage api to issue sqlite commands on a database. the result is a window you can open by choosing "download log" in the tools menu, which lists all downloads that have been started since you installed the extension. in the list is the name of the file, the start and end times of the download, the download speed, and the status of the download. a tooltip is included that displays the full source url of the file. download the full sample. setting up when the extension loads, it w...
...e the database into which its data will be stored. ...
...listener(downloadlogger); // open the database, placing its file in the profile directory this.dbfile = components.classes["@mozilla.org/file/directory_service;1"] .getservice(components.interfaces.nsiproperties) .get("profd", components.interfaces.nsifile); this.dbfile.append("downloadlogger.sqlite"); // get access to the storage service and open the database this.storageservice = components.classes["@mozilla.org/storage/service;1"] .getservice(components.interfaces.mozistorageservice); var dbconn = this.storageservice.opendatabase(this.dbfile); // now create the table; if it already exists, this fails, but we don't care! dbconn.executesimplesql("create table items (source text, size integer," + ...
...And 10 more matches
Mozilla Crypto FAQ - Archive of obsolete content
legal advice. if you wish to develop and distribute cryptographic software, particularly for commercial sale or distribution, then you should consult an attorney with expertise in the particular laws and regulations that apply in your jurisdiction. i've updated this version of the mozilla crypto faq to discuss the situation now that the rsa public key algorithm is in the public domain and a full open source crypto implementation is being added to the mozilla code base. information in the faq also reflects the new u.s. encryption export regulations published on january 14, 2000, the release on february 11, 2000, of source code for ssl, s/mime, and general pki functionality for use in the mozilla project, and the "bernstein advisory" issued by the bureau of export administration on february 17,...
...to encryption functionality in mozilla, and general questions on u.s. regulation of encryption technology. cryptographic functionality in mozilla have all the issues with mozilla and crypto now been resolved? almost. now that the rsa patent is in the public domain, mozilla crypto development can proceed with minimal restrictions. in the near future the mozilla code base will include a complete open source cryptographic library, and mozilla will include ssl support as a standard feature. after the u.s. government relaxed u.s. export regulations in january 2000 to allow export of source code for open source software implementing encryption, the major remaining legal obstacle to mozilla crypto development was the fact that rsa security, inc., held a u.s. patent on the rsa public key algorithm...
...his source code included support for the ssl protocol, but due to the rsa patent and related legal issues it did not originally contain code for rsa or other cryptographic algorithms. on september 6, 2000, rsa security released the rsa patent into the public domain, two weeks before the patent was scheduled to expire (on september 20, 2000). shortly thereafter the nss developers began work on an open source implementation of the rsa algorithm; that code, together with code previously developed for other cryptographic algorithms, will be included in a new version 3.1 of the nss open source cryptographic and pki library. this new rsa-capable version of nss will then be included in a future version of the open source psm software, which will provide ssl support for mozilla. at that point both n...
...And 10 more matches
Textbox (XPFE autocomplete) - Archive of obsolete content
xtbox with a popup containing a list of possible completions for what the user has started to type. the autocomplete functionality is handled through one of more session objects, each of which can return a set of results given the current value of the textbox. the sessions can be set using the searchsessions attribute or by calling the addsession method. ...
...sableautocomplete, disableautocomplete, disabled, disablehistory, enablehistory, focused, forcecomplete, forcecomplete, highlightnonmatches, ignoreblurwhilesearching, ignoreblurwhilesearching, inputtooltiptext, label, maxlength, maxrows, minresultsforpopup, minresultsforpopup, nomatch, onchange, onerrorcommand, oninput, onsearchcomplete, ontextcommand, ontextentered, ontextrevert, ontextreverted, open, readonly, searchsessions, showcommentcolumn, showcommentcolumn, showpopup, size, tabindex, tabscrolling, tabscrolling, timeout, type, useraction, value properties accessible, alwaysopenpopup, autofill, autofillaftermatch, completedefaultindex, crop, disableautocomplete, disabled, editable, focused, forcecomplete, highlightnonmatches, ignoreblurwhilesearching, inputfield, issearch...
...pup, size, tabindex, tabscrolling, tabscrolling, timeout, type, useraction, value properties accessible, alwaysopenpopup, autofill, autofillaftermatch, completedefaultindex, crop, disableautocomplete, disabled, editable, focused, forcecomplete, highlightnonmatches, ignoreblurwhilesearching, inputfield, issearching, iswaiting, label, maxlength, maxrows, minresultsforpopup, nomatch, open, popup, popupopen, resultspopup, searchcount, searchparam, searchsessions, selectionend, selectionstart, sessioncount, showcommentcolumn, showpopup, size, tabindex, tabscrolling, textlength, textvalue, timeout, type, useraction, value methods addsession, clearresults, getdefaultsession, getresultat, getresultcount, getresultvalueat, getsession, getsessionbyname, getsessionresultat...
...And 10 more matches
prefwindow - Archive of obsolete content
alog, one for each prefpane. each pane will usually group together a set of related preferences. if there is only one prefpane, the navigation area will be hidden. on platforms where the convention is to apply changes immediately, the preferences are adjusted as soon as the user interface element is changed. on other platforms, the preferences are not applied until the dialog is closed. you can open a preference window using a window's opendialog method as with other dialogs. you can pass the id of a particular pane as the fourth argument to opendialog to open a specific pane by default. you can also set the lastselected attribute on the prefwindow tag to the id of the pane to start with. normally, you would not set this attribute as it will be set automatically such that the default pane is...
...g to close with ok. the second preference is browser.preferences.animatefadein, again a boolean preference. this one can be safely omitted in xulrunner-based applications but you can override the default behavior (true for mac os x and false for other platforms) setting it. for animatefadein to work properly, contents of prefpanes should be put into overlays. note for mac os x: a common way of opening modal windows on mac os x that are not attached as a sheet to the main window is to use nsiwindowwatcher.openwindow() with a null parentwindow. this does not work with prefwindows, breaking the general behavior of the window and in particular the list of prefpanes. prefer the classical window.opendialog() with the following window features: "chrome,titlebar,toolbar,centerscreen,dialog=yes". ...
...dialog=yes". ...
...And 10 more matches
How to build custom form controls - Learn web development
f your control. to do this, it's good to start with an existing control whose states and behavior are well known, so that you can simply mimic those as much as possible. in our example, we will rebuild the <select> element. here is the result we want to achieve: this screenshot shows the three main states of our control: the normal state (on the left); the active state (in the middle) and the open state (on the right). in terms of behavior, we are recreating a native html element. therefore it should have the same behaviors and semantics as the native html element. we require our control to be usable with a mouse as well as with a keyboard, and comprehensible to a screen reader, just like any native control. let's start by defining how the control reaches each state: the control is in ...
... normal state when: the page loads. the control was active and the user clicks anywhere outside it. the control was active and the user moves the focus to another control using the keyboard (e.g. the tab key). the control is in its active state when: the user clicks on it or touches it on a touch screen. the user hits the tab key and it gains focus. the control was in its open state and the user clicks on it. the control is in its open state when: the control is in any other state than open and the user clicks on it. once we know how to change states, it is important to define how to change the control's value: the value changes when: the user clicks on an option when the control is in the open state. the user hits the up or down arrow keys ...
...an option when the control is in the open state. the user hits the up or down arrow keys when the control is in its active state. the value does not change when: the user hits the up arrow key when the first option is selected. the user hits the down arrow key when the last option is selected. finally, let's define how the control's options will behave: when the control is opened, the selected option is highlighted when the mouse is over an option, the option is highlighted and the previously highlighted option is returned to its normal state for the purposes of our example, we'll stop with that; however, if you're a careful reader, you'll notice that some behaviors are missing. for example, what do you think will happen if the user hits the tab key while the control...
...And 10 more matches
Standard OS Libraries
listener. so i went to the msdn winapi index page and then went to the "cursors" category and came across getcursorpos. i then searched it on msdn and saw that it needed the user32.dll. (msdn - getcursorpos) this example was created on windows xp sp2. it is a full working example; just copy & paste it to try it out. ...
...(ret); components.utils.reporterror(point); lib.close(); resources for winapi githubgists :: noitidart / search · winapi - winapi js-ctypes snippets that can be copied and pasted to scratchpad com see using com from js-ctypes. unix unix based operating systems are linux, *bsd, solaris, etc. there is a star/asterik ("*") before "bsd" because this means the bsd family such as freebsd, openbsd (who by the way made ssh), netbsd, etc. gtk+ and qt are graphic frameworks, the graphic stack under unix is xorg (x11/x). gtk+ builds over x11. xorg is being re-written at the moment, it is known as wayland. wayland is not considered stable, but it's supposed to replace xorg in the long term. gtk+ and qt have begun porting their code to wayland. as wayland is not out yet in the wild this arti...
...and qt have begun porting their code to wayland. as wayland is not out yet in the wild this article does not focus on wayland, it will focus on gtk+ and xorg(x11/x). gdk is a stack under gtk+. gtk+ is the toolkit to build apps, gdk is more low-level. to be precise, x is "just" like a display machine. on top of which everybody uses "window managers" (known as "wm"s) such as fluxbox, i3, awesome, openbox, mutter (used by gnome 3), plasma (used by kde) etc. gnome and kde are "desktop environments" (known as "de"s). wms on ubuntu work a little differently but we'll revisit this topic later in this article (did you know they have a *special* firefox build for ubuntu?). so des are a stack over wms. there is also a layer known as shell, gnomeshell is the shell used in gnome 3, it is the outter she...
...And 10 more matches
IDBObjectStore - Web APIs
etall() returns an idbrequest object retrieves all objects in the object store matching the specified parameter or all objects in the store if no parameters are given. idbobjectstore.getallkeys() returns an idbrequest object retrieves record keys for all objects in the object store matching the specified parameter or all objects in the store if no parameters are given. ...
...ven. idbobjectstore.getallkeys() returns an idbrequest object retrieves record keys for all objects in the object store matching the specified parameter or all objects in the store if no parameters are given. idbobjectstore.index() opens an index from this object store after which it can, for example, be used to return a sequence of records sorted by that index using a cursor. idbobjectstore.opencursor() returns an idbrequest object, and, in a separate thread, returns a new idbcursorwithvalue object. used for iterating through an object store by primary key with a cursor. idbobjectstore.openkeycursor() returns an idbrequest object, and, in a separate thread, returns a new idbcursor. used for iterating through an object store with a key. idbobjectstore.put() returns an idbrequest obj...
... an object store when the transaction's mode is readwrite. example this example shows a variety of different uses of object stores, from updating the data structure with idbobjectstore.createindex inside an onupgradeneeded function, to adding a new item to our object store with idbobjectstore.add. ...
...And 10 more matches
Event reference
focus events event name fired when focus an element has received focus (does not bubble). blur an element has lost focus (does not bubble). focusin an element is about to receive focus (does bubble). focusout an element is about to lose focus (does bubble). websocket events event name fired when open a websocket connection has been established. message a message is received through a websocket. error a websocket connection has been closed with prejudice (some data couldn't be sent for example). close a websocket connection has been closed. session history events event name fired when pagehide a session history entr...
...nend a css transition has completed. transitionrun a css transition has begun running (fired before any delay starts). form events event name fired when reset the reset button is pressed submit the submit button is pressed printing events event name fired when beforeprint the print dialog is opened afterprint the print dialog is closed text composition events event name fired when compositionstart the composition of a passage of text is prepared (similar to keydown for a keyboard input, but works with other inputs such as speech recognition). compositionupdate a character is added to a passage of text being composed. ...
... progress in progress. timeout progression is terminated due to preset time expiring. storage events change (see non-standard events) storage update events checking downloading error noupdate obsolete updateready value change events broadcast checkboxstatechange hashchange input radiostatechange readystatechange valuechange uncategorized events invalid message message open show less common and non-standard events abortable fetch events event name fired when abort a dom request is aborted, i.e. using abortcontroller.abort(). svg events svgabort svgerror svgload svgresize svgscroll svgunload svgzoom database events abort blocked complete error success upgradeneeded versionchange script events afterscriptexecute beforescripte...
...And 10 more matches
<a>: The Anchor element - HTML: Hypertext Markup Language
Web › HTML › Element › a
ssible values and their effects. rel the relationship of the linked url as space-separated link types. target where to display the linked url, as the name for a browsing context (a tab, window, or <iframe>). the following keywords have special meanings for where to load the url: _self: the current browsing context. ...
... type hints at the linked url’s format with a mime type. no built-in functionality. ...
... type hints at the linked url’s format with a mime type. no built-in functionality. ...
...And 10 more matches
Web video codec guide - Web media technologies
but close enough) and high definition television is between 24 and 60 frames per second. anything from 24 fps upward will generally be seen as satisfactorily smooth; 30 or 60 fps is an ideal target, depending on your needs. in the end, the decisions about what sacrifices you're able to make are entirely up to you and/or your design team. codec details av1 the aomedia video 1 (av1) codec is an open format designed by the alliance for open media specifically for internet video. it achieves higher data compression rates than vp9 and h.265/hevc, and as much as 50% higher rates than avc. av1 is fully royalty-free and is designed for use by both the <video> element and by webrtc. av1 currently offers three profiles: main, high, and professional with increasing support for color depths and chrom...
... avc (h.264) the mpeg-4 specification suite's advanced video coding (avc) standard is specified by the identic...
... avc (h.264) the mpeg-4 specification suite's advanced video coding (avc) standard is specified by the identical itu h.264 specification and the mpeg-4 part 10 specification. it's a motion compensation based codec that is widely used to...
...And 10 more matches
Gecko FAQ - Gecko Redirect 1
gecko is used in multiple browsers, including mozilla firefox, seamonkey, and others. gecko is continuously under development at mozilla.org. gecko has been known previously by the code names "raptor" and "nglayout"; the new name was chosen following a trademark infringement dispute. for more information see the wikipedia article on gecko. ...
...leased as navigator 1.0, was developed rapidly by a small team that was passionate about creating the next killer app, and they succeeded. now that the web has evolved, a new generation layout engine was needed upon which future products could be built. gecko enables a pioneering new class of dynamic content that is more interactive and offers greater presentation control to web developers, using open and recommended internet standards instead of proprietary apis. you are encouraged to join this team by getting involved. how does mozilla use gecko? gecko lies at the heart of mozilla and firefox browsers, as well as others, powering all of the individual components. gecko technologies will also power the display of the mozilla.com portal site, speedily delivering more exciting content and ser...
...he display of the mozilla.com portal site, speedily delivering more exciting content and services. gecko's architecture will serve mozilla well into the future, enabling faster time to market, more innovation, less costly development, easier distribution and updating, and better cross platform support. how can other companies and organizations use gecko? because gecko is small, lightweight, and open source, other companies and organizations can easily reuse it. many hardware vendors are creating devices with network access and wish to include web browsing functionality. likewise, many software developers want to include web browsing capability in their applications, but don't want to independently develop browser software. these developers can pick and choose the browser components they want...
...And 9 more matches
Beginner's guide to media queries - Learn web development
e or below a certain width — or an exact width — using the min-width, max-width, and width media features. these features are used to create layouts that respond to different screen sizes. for example, to change the body text color to red if the viewport is exactly 600 pixels, you would use the following media query. ...
... in practice, using minimum or maximum values is much more useful for responsive design so you will rarely see width or height used alone. there are a number of other media features that you can test for, although some of the newer features introduced in level 4 and 5 of the media queries specification have limited browser support. ...
...r support information, and you can find a full list at using media queries: media features. orientation one well-supported media feature is orientation, which allows us to test for portrait or landscape mode. to change the body text color if the device is in landscape orientation, use the following media query. @media (orientation: landscape) { body { color: rebeccapurple; } } open this example in the browser, or view the source. a standard desktop view has a landscape orientation, and a design that works well in this orientation may not work as well when viewed on a phone or tablet in portrait mode. testing for orientation can help you to create a layout which is optimised for devices in portrait mode. use of pointing devices as part of the level 4 specification, the ho...
...And 9 more matches
Index
nss, tools a high-level overview to the internals of network security services (nss) software developed by the mozilla.org projects traditionally used its own implementation of security protocols and cryptographic algorithms, originally called netscape security services, nowadays called network security services (nss). nss is a library written in the c programming language. it's free and open source software, and many other software projects have decided to use it. in order to support multiple operating systems (os), it is based on a cross platform portability layer, called the netscape portable runtime (nspr), which provides cross platform application programming interfaces (apis) for os specific apis like file system access, memory management, network communication, and multithreade...
...u can easily look them up and use them again. because of nss's expectation to operate with an nss database, it's mandatory that you perform an initialization call, where you tell nss which database you will be using. in the most simple scenario, the programmer will provide a directory on your filesystem as a parameter to the init function, and nss is designed to do the rest. it will detect and open an existing database, or it can create a new one. alternatively, should you decide that you don't want to work with any persistent recording of certificates, you may initialize nss in a no-database mode. usually, nss will flush all data to disk as soon as new data has been added to permanent storage. storage consists of multiple files: a key database file, which contains your secret keys, and a c...
...e interesting to mention a property of the nspr file descriptors, which are stacked in layers. this means you can define multiple layers that are involved in data processing. a file descriptor has a pointer to the first layer handling the data. that layer has a pointer to a potential second layer, which might have another pointer to a third layer, etc. each layer defines its own functions for the open/close/read/write/poll/select (etc.) functions. when using an ssl network connection, you'll already have two layers, the basic nspr layer and an ssl library layer. the mozilla applications define a third layer where application specific processing is performed. you can find more details in the nspr reference documents. nss occassionally has to create outbound network connections, in addition t...
...And 9 more matches
Enc Dec MAC Output Public Key as CSR
header file */ secstatus readfromheaderfile(const char *filename, headertype type, secitem *item, prbool ishexdata) { secstatus rv; secitem filedata; secitem outbuf; unsigned char *nonbody; unsigned char *body; char *header; char *trailer; prfiledesc *file = null; outbuf.type = sibuffer; file = pr_open(filename, pr_rdonly, 0); if (!file) { pr_fprintf(pr_stderr, "failed to open %s\n", filename); return secfailure; } switch (type) { case pubkey: header = pubkey_header; trailer = pubkey_trailer; break; case symkey: header = enckey_header; trailer = enckey_trailer; break; case mackey: header = mackey_hea...
... = 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 */ 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", certreqfilename, pr_geterror(), pr_getoserror()); goto cleanup; } /* create info about public key */ spki = seck...
...rintf(pr_stderr, "extracted : "); printasascii(pr_stderr, macitem->data, macitem->len); pr_fprintf(pr_stderr, "computed : "); printasascii(pr_stderr, newmac, newmaclen); rv = secfailure; } cleanup: if (ctxmac) { pk11_destroycontext(ctxmac, pr_true); } if (ctxenc) { pk11_destroycontext(ctxenc, pr_true); } return rv; } /* * open intermediate file, read in iv, wrapped encryption key, * wrapped mac key, mac, pad and public key from header file */ secstatus getdatafromheader(const char *headerfilename, secitem *ivitem, secitem *wrappedenckeyitem, secitem *wrappedmackeyitem, secitem *macitem, secitem *paditem, seckey...
...And 9 more matches
sample2
progname, "-d -d <dbdirpath> -b <headerfilename> -e <encryptfilename> -o <opfilename>\n"); exit(-1); } } /* * sign the contents of input file using private key and * return result as secitem */ secstatus signdata(const char *infilename, seckeyprivatekey *pk, secitem *res) { secstatus rv = secfailure; unsigned int nb; unsigned char ibuf[4096]; prfiledesc *infile = null; sgncontext *sgn = null; /* open the input file for reading */ infile = pr_open(infilename, pr_rdonly, 0); if (!infile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for reading.\n", infilename); rv = secfailure; goto cleanup; } /* sign using private key */ sgn = sgn_newcontext(sec_oid_pkcs1_md5_with_rsa_encryption, pk); if (!sgn) { pr_fprintf(pr_stderr, "unable to create context for signing\n"); rv = secfailure; goto cleanup; ...
...n"); goto cleanup; } cleanup: if (infile) { pr_close(infile); } if (sgn) { sgn_destroycontext(sgn, pr_true); } return rv; } /* * verify the signature using public key */ secstatus verifydata(const char *infilename, seckeypublickey *pk, secitem *sigitem, secupwdata *pwdata) { unsigned int nb; unsigned char ibuf[4096]; secstatus rv = secfailure; vfycontext *vfy = null; prfiledesc *infile = null; /* open the input file for reading */ infile = pr_open(infilename, pr_rdonly, 0); if (!infile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for reading.\n", infilename); rv = secfailure; goto cleanup; } vfy = vfy_createcontext(pk, sigitem, sec_oid_pkcs1_md5_with_rsa_encryption, pwdata); if (!vfy) { pr_fprintf(pr_stderr, "unable to create context for verifying signature\n"); rv = secfailure; goto cleanu...
...e, "%s\n\n", trailer); return secsuccess; } /* * read cryptographic parameters from the header file */ secstatus readfromheaderfile(const char *filename, headertype type, secitem *item, prbool ishexdata) { secstatus rv = secsuccess; prfiledesc* file = null; secitem filedata; secitem outbuf; unsigned char *nonbody; unsigned char *body; char *header; char *trailer; outbuf.type = sibuffer; file = pr_open(filename, pr_rdonly, 0); if (!file) { pr_fprintf(pr_stderr, "failed to open %s\n", filename); rv = secfailure; goto cleanup; } switch (type) { case pubkey: header = pubkey_header; trailer = pubkey_trailer; break; case symkey: header = enckey_header; trailer = enckey_trailer; break; case mackey: header = mackey_header; trailer = mackey_trailer; break; case iv: header = iv_header; trailer = iv_trai...
...And 9 more matches
sslfnc.html
nitialization. nss_init nss_initreadwrite nss_nodb_init ssl_optionsetdefault ssl_optiongetdefault ssl_cipherprefsetdefault ssl_cipherprefgetdefault ssl_clearsessioncache ssl_configserversessionidcache ssl_configmpserversidcache ssl_inheritmpserversidcache nss_init sets up configuration files and performs other tasks required to run network security services. database files are opened read-only. syntax #include "nss.h" secstatus nss_init(char *configdir); parameter this function has the following parameter: configdir a pointer to a string containing the pathname of the directory where the certificate, key, and security module databases reside. returns the function returns one of these values: if successful, secsuc...
...on has the following parameter: configdir a pointer to a string containing the pathname of the directory where the certificate, key, and security module databases reside. returns the function returns one of these values: if successful, secsuccess. if unsuccessful, secfailure. use pr_geterror to retrieve the error code. description nss_init opens the certn.db, keyn.db, and secmod.db files (wheren is a numeric digit) in the specified directory. nss_init isnot idempotent, so call it only once. nss_init opens the database files read-only. if you are performing operations that require write permission, for example s/mime operations such as adding a certificate, use nss_initreadwrite instead. before calling nss_init, your program must ca...
...e following parameter: configdir a pointer to a string containing the pathname of the directory where the certificate, key, and security module databases reside. returns the function returns one of these values: if successful, secsuccess. if unsuccessful, secfailure. use pr_geterror to retrieve the error code. description nss_initreadwrite opens the certn.db, keyn.db, and secmod.db files (wheren is a numeric digit) with both read and write permission in the specified directory. nss_initreadwrite isnot idempotent, so call it only once. use nss_initreadwrite rather than nss_init if you are performing operations that require write permission, such as some s/mime operations. before calling nss_initreadwrite, your program must call pr_in...
...And 9 more matches
A Web PKI x509 certificate primer
on access this extension is primarily used to to describe the ocsp location for revocation checking. it is mandatory for certificates that chain up to a root in the mozilla ca program. self-signed certificates these are the steps to generate a certificate for www.example.com. replace this value with the actual server name in the steps below. 1. generate the key using the following command: openssl genpkey -algorithm rsa -out key.pem -pkeyopt rsa_keygen_bits:2048 2048 is considered secure for the next 4 years. 2. generate csr using this command: openssl req -new -key key.pem -days 1096 -extensions v3_ca -batch -out example.csr -utf8 -subj '/cn=www.example.com' this creates a new certificate signing request (csr) that will be valid for 3 years. 3. write extensions file by c...
...ut key.pem -pkeyopt rsa_keygen_bits:2048 2048 is considered secure for the next 4 years. 2. generate csr using this command: openssl req -new -key key.pem -days 1096 -extensions v3_ca -batch -out example.csr -utf8 -subj '/cn=www.example.com' this creates a new certificate signing request (csr) that will be valid for 3 years. 3. write extensions file by creating a new file with name openssl.ss.cnf with the following contents: basicconstraints = ca:false subjectaltname =dns:www.example.com extendedkeyusage =serverauth 4. ...
...cn=www.example.com' this creates a new certificate signing request (csr) that will be valid for 3 years. 3. write extensions file by creating a new file with name openssl.ss.cnf with the following contents: basicconstraints = ca:false subjectaltname =dns:www.example.com extendedkeyusage =serverauth 4. ...
...And 9 more matches
Index
Mozilla › Tech › XPCOM › Index
ozipersonaldictionary interfaces, interfaces:scriptable, xpcom, xpcom interface reference implemented by: @mozilla.org/spellchecker/personaldictionary;1. to access this service, use 198 moziplaceinfo no summary! 199 moziplacesautocomplete interfaces, interfaces:scriptable, places, xpcom, xpcom interface reference mark a page as being currently open. 200 moziregistry outdated_articles clients will rely on nsrepository to create instances of a given class. clients requiring dynamic "binding" of clsids will be required to use some higher-level services (tbd) to figure out the clsids they should use. the intent is that such services themselves be built on top of the new moziregistry interface. 201 mozirepresentat...
...accessible as well as atk's generic accessibility objects. 250 attributes attributes of accessible. 251 childcount number of accessible children. 252 children array of all this node's children. 253 defaultkeybinding provides localized string of global keyboard accelerator for default action, such as ctrl+o for open file (ctrl + o). 254 description accessible description -- long text associated with this node. 255 doaction this method performs the accessible action at the given zero-based index. action number 0 is the default action. 256 extendselection this method extends the current selection from its current accessible anchor node to this a...
...tup_mozilla_2_0 interfaces, interfaces:scriptable, xpcom, xpcom api reference, xpcom interface reference in gecko 4.0 this interface was merged into the nsiappstartup interface. 330 nsiapplicationcache dom, interfaces, interfaces:scriptable, offline_resources, xpcom, xpcom interface reference each application cache has a unique client id for use with nsicacheservice.opensession() method, to access the cache's entries. 331 nsiapplicationcachechannel dom, interfaces, interfaces:scriptable, offline_resources, xpcom, xpcom interface reference a shortcut method to mark the cache item of this channel as 'foreign'. see the 'cache selection algorithm' and cache_selection_reload action handling in nscontentsink. 332 nsiapplicationcacheconta...
...And 9 more matches
IDBDatabase - Web APIs
the idbdatabase interface of the indexeddb api provides a connection to a database; you can use an idbdatabase object to open a transaction on your database then create, manipulate, and delete objects (data) in that database. the interface provides the only way to get and manage versions of the database. note: this feature is available in web workers. note: everything you do in indexeddb always happens in the context of a transaction, representing interactions with data in the database. all objects in indexeddb — including object stores, indexes, and cursors — are tied to a particular transaction. thus, you cannot execute commands, access data, or open anything outside of a transaction. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padd...
...red when the database connection is unexpectedly closed. also available via the onclose property. error fired when a request returns an error and the event bubbles up to the connection object. also available via the onerror property. versionchange fired when a database structure change was requested. also available via the onversionchange property. ...
...d when a database structure change was requested. also available via the onversionchange property. example in the following code snippet, we open a database asynchronously (idbfactory), handle success and error cases, and create a new object store in the case that an upgrade is needed (idbdatabase). ...
...And 9 more matches
Panels - Archive of obsolete content
href="chrome://global/skin" type="text/css"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <button label="details" type="panel"> <panel id="search-panel"> <label control="name" value="name:"/> <textbox id="name"/> </panel> </button> </window> many panels will be associated with a button, as in this example. when the button is pressed, the panel is opened. clicking outside the panel or pressing escape will close the panel. you can also place a close button in the panel which will close the panel with a script if desired. when you want to associate a panel with a button, place the <panel> element directly inside the button element. you also need to set the type attribute on the button to the value panel, or the button will look and behave like a ...
...ton to the value panel, or the button will look and behave like a regular button. the popup panel will, by default, appear with its topleft corner just underneath the bottom edge of the button, much as a menu does. the position can, however, be changed. for more information about positioning the popup, see positioning popups. ...
...the popup attribute should be set to the id of a panel within the same document. when the left mouse button is pressed on the element with the popup attribute, the corresponding panel will be displayed. ...
...And 8 more matches
tooltip - Archive of obsolete content
ips, this element doesn't need to be used; instead you may just add a tooltiptext attribute to an element. more information is available in the xul tutorial. ...
...lement doesn't need to be used; instead you may just add a tooltiptext attribute to an element. more information is available in the xul tutorial. ...
... if this attribute is set to false or omitted, the tooltip will automatically disappear after a few seconds. if this attribute is set to true, this will not happen and the tooltip will only hide when the user moves the mouse to another element. onpopuphidden type: script code this event is sent to a popup after it has been hidden. this event may also be received while the popup is still open, but when sub-menus contained within this popup are hidden. example: <menupopup id="top" onpopuphidden="console.log('the onpopuphidden method of id=top was called.');"> <menuitem label="item 1"/> <menuitem label="item 2"/> <menu id="submenu1" label="submenu 1"> <menupopup id="submenu1-popup"> <menuitem label="submenu1 item 1"/> <menuitem label="s...
...And 8 more matches
Getting started with HTML - Learn web development
can be written in uppercase or lowercase. for example, a <title> tag could be written as <title>, <title>, <title>, <title>, etc., and it will work. however, it is best practice to write all tags in lowercase for consistency, readability, and other reasons. anatomy of an html element let's further explore our paragraph element from the previous section: the anatomy of our element is: the opening tag: this consists of the name of the element (in this example, p for paragraph), wrapped in opening and closing angle brackets. this opening tag marks where the element begins or starts to take effect. in this example, it precedes the start of the paragraph text. the content: this is the content of the element. in this example, it is the paragraph text. the closing tag: this is the same as ...
...tag: this consists of the name of the element (in this example, p for paragraph), wrapped in opening and closing angle brackets. this opening tag marks where the element begins or starts to take effect. in this example, it precedes the start of the paragraph text. the content: this is the content of the element. in this example, it is the paragraph text. the closing tag: this is the same as the opening tag, except that it includes a forward slash before the element name. this marks where the element ends. failing to include a closing tag is a common beginner error that can produce peculiar results. the element is the opening tag, followed by content, followed by the closing tag. active learning: creating your first html element edit the line below in the input area by wrapping it with th...
...to close the element, put the closing tag </em> at the end of the line. ...
...And 8 more matches
Key Values - Web APIs
tton. historically, the escape character was used to signal the start of a special control sequence of characters called an "escape sequence." vk_escape (0x1b) kvk_escape (0x35) gdk_key_escape (0xff1b) qt::key_escape (0x01000000) keycode_escape (111) "execute" the execute key. vk_execute (0x2b) qt::key_execute (0x01020003) "find" the find key. opens an interface (typically a dialog box) for performing a find/search operation. appcommand_find gdk_key_find (0xff68) "finish" [5] the finish key. vk_oem_finish (0xf1) "help" the help key. opens or toggles the display of help information. vk_help (0x2f) appcommand_help kvk_help (0x72) gdk_key_help (0xff6a) qt::key_help (0x010000...
...) qt::key_monbrightnessdown (0x010000b3) keycode_brightness_down (220) "brightnessup" the brightness up key. typically increases the brightness of the display. gdk_key_monbrightnessup (0x1008ff02) qt::key_monbrightnessup (0x010000b2) keycode_brightness_up (221) "eject" the eject key. ejects removable media (or toggles an optical storage device tray open and closed). gdk_key_eject (0x1008ff2c) qt::key_eject (0x010000b9) keycode_media_eject (129) "logoff" [2] the logoff key. gdk_key_logoff (0x1008ff61) qt::key_logoff (0x010000d9) "power" the power button or key, to toggle power on and off. note: not all systems pass this key through to to the user agent. keycode_po...
...dia controller keys because modern remote controls for media devices often include buttons beyond the basic controls covered elsewhere in this document, key values are defined for a broad array of these additional buttons. the values below are derived in part form a number of consumer electronics technical specifications: dtv application software environment (part of the atsc specification) open cable application platform 1.1.3 ansi/cea-2014-b: web-based protocol and framework for remote user interface on upnp™ networks and the internet android keyevent key code values note: remote controls typically include keys whose values are already defined elsewhere, such as under multimedia keys or audio control keys. those keys' values will match what's documented in those tables. ...
...And 8 more matches
Web audio codec guide - Web media technologies
roid 20 linux (depends on gstreamer) 26 macos 35 [2] chrome supports aac only in mp4 containers, and only supports aac's main profile. in addition, aac is not available in chromium builds. alac (apple lossless audio codec) the apple lossless audio codec (alac or apple lossless) is a lossless codec developed by apple. after initially being a closed format, apple opened it up under an apache license. cross-platform and browser support for alac is not very strong, making it a less than ideal choice for general usage. however, if your target is primarily macos and ios users, it may be worth considering, as the operating systems have integrated support for alac. otherwise, flac is likely a better choice, if you must use a lossless codec. keep in mind, however, ...
...it was standardized in 1999 as part of the 3gpp audio standard used for both gsm and umts cellular telephony, and uses a multi-rate narrowband algorithm to encode audio frequencies at a telephony-grade quality level...
...the audio is encoded using pulse code modulation (pcm) with either µ-law or a-law encodin...
...And 8 more matches
List of Mozilla-Based Applications - Archive of obsolete content
cyclone3 content management system danger mobile platform uses gecko on the server side -- no longer active? desktop 2 internal browser and portal client expeditors international of washington, inc. dogtag certificate system uses nss dojo javascript toolkit uses mozilla rhino in shrinksafe eclipse platform open development platform the ajax toolkit framework, standard widget toolkit and eclipsemozilla projects make use of mozilla elixon wcms/xul web content management system fully remote xul wcms (no need to install extensions). entelechy chat bot uses xulrunner epic browser web browser based on chromium uses mozilla nss and npapi libraries emusi...
... font management tool firecast digital signage and interactive kiosk tools also used in firecast easystart mozilla firefox ...
... font management tool firecast digital signage and interactive kiosk tools also used in firecast easystart mozilla firefox web browser web brows...
...And 7 more matches
Positioning - Archive of obsolete content
down to fit. for popups attached using the popup or context attributes, the default position to appear is with the upper left corner (or upper right corner in right to left locales) at the position where the mouse was clicked. context menus will appear offset down and to the right a couple of pixels so that the menu can be dismissed again just by clicking in the same place. if a context menu was opened via the keyboard only, the menu will appear at the top left corner of the document, or underneath the currently selected item if a list is focused. context menus will always appear in this location, and not respect any position attribute value. tooltips will always appear near the current mouse position, offset vertically by a small amount. the position attribute the position of all types o...
... the currently selected item if a list is focused. context menus will always appear in this location, and not respect any position attribute value. tooltips will always appear near the current mouse position, offset vertically by a small amount. the position attribute the position of all types of popups can be controlled in two ways. first, the position can be specified when using the popup's openpopup method. this is used when a popup is opened by a script. second, the position can be specified using several attributes placed on the menupopup, panel or tooltip element. these attributes are described below and function the same for all three elements. the position attribute specifies the alignment of the popup with respect to the element that the popup is attached to. for a menupopup p...
...nu, button or toolbarbutton, the position attribute controls how the menupopup is anchored to the parent menu, button or toolbarbutton. for a menupopup or panel attached using the popup attribute, the position attribute controls how the popup is anchored to the element with the popup attribute. for a context menu, that is, a menu that is attached to an an element using the context attribute and opened via context-clicking the mouse, the position attribute is ignored. the menu appears at the mouse position offset by a couple of pixels so that the user can close the context menu just by clicking in the same location. for a tooltip, the position attribute controls how the tooltip is anchored to the element with the tooltip attribute. you wouldn't normally use the position attribute on a toolti...
...And 7 more matches
panel - Archive of obsolete content
Archive › Mozilla › XUL › panel
« xul reference home [ examples | attributes | properties | methods | related ] a panel is a used as a temporary floating popup window that may contain any type of content. it does not have any window decorations. when open, it floats above the window and may extend outside the border of the main window. typically, it will be attached to a button using the button's type attribute so that when the button is pressed, the panel will be displayed. a panel may also be opened via a script using the openpopup method. the panel is closed when the user clicks outside the panel, presses escape or when the panel's hidepopup method is called. warning: for firefox versions between 3.6 and 4.0, placing an iframe, browser or editor inside a panel is not supported. some features may work, but ...
...a panel, if possible. this limitation was resolved as of firefox 4.0. attributes backdrag, close, consumeoutsideclicks, fade, flip, ignorekeys, label, left, level, noautofocus, noautohide, norestorefocus, onpopuphidden, onpopuphiding, onpopupshowing, onpopupshown, position, titlebar, top, type properties accessibletype, label, popupboxobject, popup, state methods hidepopup, moveto, openpopup, openpopupatscreen, sizeto examples the following example shows how a panel may be attached to a label. <panel id="thepanel"> <hbox align="start"> <image src="warning.png"/> <vbox> <description value="you have 6 new messages."/> <hbox> <button label="read mail"/> <button label="new message"/> </hbox> </vbox> </hbox> </panel> <description ...
...the values belowthe fade attribute, which may only be used with arrow panels, lets you set up a panel that will automatically fade away after a short time. the default is none. nonethe panels doesn't automatically fade away.slowthe panels slowly fades away after a short time.fastthe panels quickly fades away after a short time. flip type: string normally, when a popup opens near the edge of the screen, it flips over to open on the opposite side of the anchor, so that it doesn't extend off the screen. for example, if the menu doesn't have room to open downward, it flips to open upward instead; this is a vertical flip. horizontal flipping doesn't normally happen, since this would cause menus to open in strange places. for arrow popups, however, being able to flip hor...
...And 7 more matches
Mozilla’s UAAG evaluation report
2.1 render content according to specification. (p1) vg renders html, css, and a number of graphic image formats. does not contradict current specifications for html and css rendering. 2.2 provide text view. (p1) c also known as view source. 2.3 render conditional content. (p1) vg alt for img: rendered when images turned off. see meta bug 41924 for open issues with the alt attribute. title for *any* element: rendered as tooltip longdesc for img element: in context menu - properties content of object element: ? alt for area element: ? alt for input element: ? acronym element: supported abbr element: supported abbr attribute for td/th: not supported summary for table: supported title for frame: ? longdes...
... when toggled off, we don't notify the user when a page is loaded with scripts 3.5 toggle content refresh. (p1) ni mozilla has no features for toggling refreshes 3.6 toggle redirects. (p2) ni mozilla has no features for toggling redirects 3.7 toggle images. (p2) p our interface for image toggling needs redesign unfortunately, there are quite a few open bugs on image toggling guideline 4. ensure user control of rendering. checkpoint title status notes/plans checkpoint title status notes/plans 4.1 configure text size. (p1) c can be changed through preferences, zooming or user style sheet. zooming is really the best solution, because the document retains its look - all font sizes are i...
...(p2) na 4.17 choose style sheets. (p1) c under view menu, use style sheet -- allows one user style sheet to be applied at a time guideline 5. ensure user control of user interface behavior. checkpoint title status notes/plans 5.1 no automatic content focus change. ...
...And 7 more matches
FileUtils.jsm
file constructor if you have a path to a file (or directory) you want to obtain an nsifile for, you can do so using the file constructor, like this: var f = new fileutils.file(mypath); method overview nsifile getfile(string key, array patharray, bool followlinks); nsifile getdir(string key, array patharray, bool shouldcreate, bool followlinks); nsifileoutputstream openfileoutputstream(nsifile file, int modeflags); nsifileoutputstream openatomicfileoutputstream(nsifile file, int modeflags); nsifileoutputstream opensafefileoutputstream(nsifile file, int modeflags); void closeatomicfileoutputstream(nsifileoutputstream stream); void closesafefileoutputstream(nsifileoutputstream stream); constants constant valu...
...utstream(nsifile file, int modeflags); nsifileoutputstream opensafefileoutputstream(nsifile file, int modeflags); void closeatomicfileoutputstream(nsifileoutputstream stream); void closesafefileoutputstream(nsifileoutputstream stream); constants constant value description mode_rdonly 0x01 corresponds to the pr_rdonly parameter to pr_open mode_wronly 0x02 corresponds to the pr_wronly parameter to pr_open mode_create 0x08 corresponds to the pr_create_file parameter to pr_open mode_append 0x10 corresponds to the pr_append parameter to pr_open mode_truncate 0x20 corresponds to the pr_truncate parameter to pr_open perms_file 0644 default permissions when creati...
...turns a nsifile object for the location specified. if the directory requested does not exist, it is created, along with any parent directories that need to be created. note: if you want to use the full path to get to the directory you cannot use getdir. ...
...And 7 more matches
nsIChannel
in a uniform way. inherits from: nsirequest last changed in gecko 19.0 (firefox 19.0 / thunderbird 19.0 / seamonkey 2.16) once a channel is created (via nsiioservice.newchannel()), parameters for that request may be set by using the channel attributes, or by calling queryinterface() to retrieve a subclass of nsichannel for protocol-specific parameters. then, the uri can be fetched by calling open() or asyncopen(). after a request has been completed, the channel is still valid for accessing protocol-specific results. for example, queryinterfacing to nsihttpchannel allows response headers to be retrieved for the corresponding http transaction. this interface must be used only from the xpcom main thread. implemented by netwerk/base/src/nsbasechannel.cpp and netwerk/protocol/http/src/nshttp...
...ted, the channel is still valid for accessing protocol-specific results. for example, queryinterfacing to nsihttpchannel allows response headers to be retrieved for the corresponding http transaction. this interface must be used only from the xpcom main thread. implemented by netwerk/base/src/nsbasechannel.cpp and netwerk/protocol/http/src/nshttpchannel.cpp. ...
...ueryinterfacing to nsihttpchannel allows response headers to be retrieved for the corresponding http transaction. this interface must be used only from the xpcom main thread. implemented by netwerk/base/src/nsbasechannel.cpp and netwerk/protocol/http/src/nshttpchannel.cpp. method overview void asyncopen(in nsistreamlistener alistener, in nsisupports acontext); nsiinputstream open(); attributes attribute type description contentcharset acstring the character set of the channel's content if available and if applicable. this attribute only applies to textual data. setting contentcharset before the channel has been opened provides a hint to the channel on what the charset should be. the behavior is similar to contenttype. th...
...And 7 more matches
nsITransport
netwerk/base/public/nsitransport.idlscriptable this interface provides a common way of accessing i/o streams connected to some resource. this interface does not in any way specify the resource. inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) this interface provides methods to open blocking or non-blocking, buffered or unbuffered streams to the resource. the name "transport" is meant to connote the inherent data transfer implied by this interface (that is, data is being transfered in some fashion via the streams exposed by this interface). a transport can have an event sink associated with it. the event sink receives transport-specific events as the transfer is occurring. for a socket transport, these events can include status ...
...on via the streams exposed by this interface). a transport can have an event sink associated with it. the event sink receives transport-specific events as the transfer is occurring. for a socket transport, these events can include status about the connection. see nsisockettransport for more info about socket transport specifics. method overview void close(in nsresult areason); nsiinputstream openinputstream(in unsigned long aflags, in unsigned long asegmentsize, in unsigned long asegmentcount); nsioutputstream openoutputstream(in unsigned long aflags, in unsigned long asegmentsize, in unsigned long asegmentcount); void seteventsink(in nsitransporteventsink asink, in nsieventtarget aeventtarget); constants open flags. constant value description open_blocking 1<<0 open flags. ...
...inputstream(in unsigned long aflags, in unsigned long asegmentsize, in unsigned long asegmentcount); nsioutputstream openoutputstream(in unsigned long aflags, in unsigned long asegmentsize, in unsigned long asegmentcount); void seteventsink(in nsitransporteventsink asink, in nsieventtarget aeventtarget); constants open flags. constant value description open_blocking 1<<0 open flags. open_unbuffered 1<<1 generic nsitransporteventsink status codes. nsitransport implementations may override these status codes with their own more specific status codes (for example, see nsisockettransport). constant value description status_reading 0x804b0008 status_writing 0x804b0009 methods close() close the transport and any open streams. void close( in nsresult areason ); par...
...And 7 more matches
Index - Firefox Developer Tools
current page. it works like a magnifying glass over the page, enabling you to select with pixel precision. underneath the magnifying glass it shows the color value for the current pixel using whichever scheme you've selected in settings > inspector > default color unit: 34 index tools found 158 pages: 35 json viewer firefox includes a json viewer. if you open a json file in the browser, or view a remote url with the content-type set to application/json, it is parsed and given syntax highlighting. arrays and objects are shown collapsed, and you can expand them using the "+" icons. 36 measure a portion of the page design, devtools, developer, firefox, layout, measure, measuring, measuring tool, tools using the measuring tool you can...
...re in your code you are allocating memory. 38 aggregate view before firefox 48, this was the default view of a heap snapshot. after firefox 48, the default view is the tree map view, and you can switch to the aggregate view using the dropdown labeled "view:": 39 basic operations before firefox 50, the memory tool is not enabled by default. to enable it, open the developer tool settings, and check the "memory" box under "default firefox developer tools": 40 dom allocation example this article describes a very simple web page that we'll use to illustrate some features of the memory tool. 41 dominators with a garbage-collected language, like javascript, the programmer doesn't generally have to worry about deal...
... 68 select an element guide, inspector, tools the selected element is the element in the page that the inspector is currently ...
...And 7 more matches
File I/O - Archive of obsolete content
it returns the user-specified file as nsifile. nsifile and path strings you can use nsifile.path to get a platform-specific path string, for example "c:\windows\system32" or "/usr/share". to get a url of a file, use nsiioservice.newfileuri(): // file is nsifile components.utils.import("resource://gre/modules/services.jsm"); var url = services.io.newfileuri(file);...
...it returns the user-specified file as nsifile. nsifile and path strings you can use nsifile.path to get a platform-specific path string, for example "c:\windows\system32" or "/usr/share". to get a url of a file, use nsiioservice.newfileuri(): // file is nsifile components.utils.import("resource://gre/modules/services.jsm"); var url = services.io.newfileuri(file); // url is a n...
...ar entries = file.directoryentries; var array = []; while(entries.hasmoreelements()) { var entry = entries.getnext(); entry.queryinterface(components.interfaces.nsifile); array.push(entry); } reading from a file read into a stream or a string this will allow you to read a file without locking up the ui thread while reading. please note that some i/o, such as getting file information and opening the file can still happen on the main thread and therefore block the ui for periods of time. this sample code uses netutil.jsm. so therefore for the first parameter, file, you can pass an nsifile object or a string (such as a jar path) see: netutil.asyncfetch: components.utils.import("resource://gre/modules/netutil.jsm"); netutil.asyncfetch(file, function(inputstream, status) { if (!compon...
...And 6 more matches
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
ate your own component' c++/js this document was authored by hiroshi shimoda of clear code inc. and was originally published in japanese for the firefox developers conference summer 2007. mr. shimoda is a co-author of firefox 3 hacks (o'reilly japan, 2008). this chapter explains how to use xpcom to implement advanced processes using only javascript. introduction javascript lacks functions for opening files and character-code conversion, among other things. a different mechanism is needed to perform these functions. internet explorer handles this using activex; in firefox, we use the cross-platform component object model, or xpcom. due to deprecation of enableprivilege this functionality can not be used in web pages. enableprivilege is disabled in firefox 15 and will be removed in firefox ...
...you'll note that even though the file includes an alert method, nothing happens. this is a by-product of the fact that test.xul currently doesn’t have privileges. in order to use xpconnect, the file needs special universalxpconnect privileges. because ordinary web pages and local files don't have privileges, it's impossible to actually try out the sample code in this chapter. in order to ...
... privileges, you need to run the code in listing 2. listing 2: setting privileges netscape.security.privilegemanager.enableprivilege('universalxpconnect'); note: this is unneeded when the code is part of an extension, and will result in rejection if submitted to addons.mozilla.org. permit by dialog try adding the contents of listing 2 to test.xul, before the line var ioservice = …, and re-open it in firefox. you should now see the confirmation dialog shown in figure 1. pressing the "permit" button grants universalxpconnect permission in this execution context, making it possible to run xpconnect temporarily. an xpconnect-wrapped nsiioservice message should appear. if you check “apply these privileges in the future”, all local files will be able to run xpconnect without confirmatio...
...And 6 more matches
Tamarin build documentation - Archive of obsolete content
droid sdk/avd manager at /android-public/android-sdk-mac_86/tools/android and add android sdk platform-tools (to get adb), sdk platform android 2.3.3, and api 10 (samples and docs are optional). if you have trouble starting the app try this: $ export android_swt=$android_build_top/android-sdk-mac_86/tools/lib/x86_64 where $android_build_top is the full path to your sdk/ndk top folder - get the openssl-0.9.8r.tar (openssl-1.0.0c.tar.gz won't work) openssl files from http://www.openssl.org (use the source link on the left). unzip the file and put the /openssl main folder under your sdk/ndk top folder. make sure its name is just "openssl". then build as follows: - replace the makefile in the main folder with the one attached to this page. - change the variable android_device in the makefile...
...lder. make sure its name is just "openssl". then build as follows: - replace the makefile in the main folder with the one attached to this page. - change the variable android_device in the makefile (near line 65) to point to your sdk/ndk top folder. - find the two instances of "android-ndk" and make sure they match your ndk's name (they should already). - in a terminal window change to your /openssl folder and run make build_libs to create the necessary 'libcrypto.a' and 'libssl.a' static libraries. alternatively, run make, in which case the process will complete with errors when it tries to create the shared lib crt0.o: $ /android-public/android-ndk/toolchains/arm-eabi-4.4.0/prebuilt/darwin-x86/bin/../lib/gcc/arm-eabi/4.4.0/../../../../arm-eabi/bin/ld: crt0.o: no such file: no such fil...
...raries. alternatively, run make, in which case the process will complete with errors when it tries to create the shared lib crt0.o: $ /android-public/android-ndk/toolchains/arm-eabi-4.4.0/prebuilt/darwin-x86/bin/../lib/gcc/arm-eabi/4.4.0/../../../../arm-eabi/bin/ld: crt0.o: no such file: no such file or directory collect2: ld returned 1 exit status make[2]: *** [link_app.] error 1 make[1]: *** [openssl] error 2 make: *** [build_apps] error 1 you can ignore these errors. the necessary static files 'libcrypto.a' and 'libssl.a' are made correctly and are present in the /openssl folder. more information on why this happens on mac os is here: http://developer.apple.com/library/mac/#qa/qa2001/qa1118.html - create a /frameworks/base/opengl/include/egl folder under your sdk/ndk top folder. get the...
...And 6 more matches
Creating a Window - Archive of obsolete content
xul. note that this url is never actually downloaded. mozilla will recognize this url internally. <!-- other elements go here --> replace this comment block with other elements (the buttons, menus and other user interface components) to appear in the window. we'll add some of these in the next set of sections. </window> and finally, we need to close the window tag at the end of the file. opening a window in order to open a xul window, there are several methods that can be used. if you are only in the development stage, you can just type the url (whether a chrome:, file: or other url type) into the location bar in a mozilla browser window. you should also be able to double-click the file in your file manager, assuming that xul files are associated with mozilla. the xul window will app...
...ether a chrome:, file: or other url type) into the location bar in a mozilla browser window. you should also be able to double-click the file in your file manager, assuming that xul files are associated with mozilla. the xul window will appear in the browser window as opposed to a new window, but this is often sufficient during the early stages of development. note: the local xul document can be opened in the browser as mentioned above only if |dom.allow_xul_xbl_for_file| preference in "about:config" has been set to |true| . if it does not exist, then it needs to be created and set to |true|. the correct way, of course, is to open the window using javascript. no new syntax is necessary as you can use the window.open() function as one can do for html documents. however, one additional flag, c...
...about:config" has been set to |true| . if it does not exist, then it needs to be created and set to |true|. the correct way, of course, is to open the window using javascript. no new syntax is necessary as you can use the window.open() function as one can do for html documents. however, one additional flag, called 'chrome' is necessary to indicate to the browser that this is a chrome document to open. this will open the window without the toolbars and menus and so forth that a normal browser window has. ...
...And 6 more matches
Features of a Window - Archive of obsolete content
« previousnext » we've already seen some features of windows. we'll look at some more in this section. creating another window you can create a second window for your application in the same manner as you would create the first one. just create a second xul file with the window code in it. ...
...ting another window you can create a second window for your application in the same manner as you would create the first one. just create a second xul file with the window code in it. as in html, you can use the window interface's open() method loads the specified resource into the browsing context (window, <iframe> or tab) with the specified name. if the name doesn't exist, then a new window is opened and the specified resource is loaded into its browsing context.">window.open() function to open the second window. this function will return a reference to the newly opened window. you can use this reference to call functions of the other window. the open function takes three arguments. the first is the url of the file you wish to open. the second is an internal name of the window. the third i...
...text.">window.open() function to open the second window. this function will return a reference to the newly opened window. you can use this reference to call functions of the other window. the open function takes three arguments. the first is the url of the file you wish to open. the second is an internal name of the window. the third is a list of display flags. the flag 'chrome' is important to open the window as a chrome file. if you do not add the 'chrome' flag, the file will open up as the content in a browser window. for example: var mywin = window.open("chrome://findfile/content/findfile.xul", "findfile", "chrome"); specifying the width and height you should have noticed that whenever elements were added to a window, the window's width expanded to fit the new elements. the window is...
...And 6 more matches
Fonts for Mozilla's MathML engine
fonts with appropriate unicode coverage and open font format features are required for good math rendering. this wiki page describes how users can install and use such math fonts with mozilla's mathml engine. note that most of these instructions may as well apply to other web rendering engines. installation instructions windows install the latin modern math and stix fonts as follows: download latinmodern-math-1959.zip. open the zip archive, move inside the latinmodern-math-1959 directory and then inside the otf directory. you will find a latinmodern-math font file. open the latinmodern-math font file and click the install button. download stixv2.0.2.zip. open the zip archive, move inside the /stixv2.0.0/fonts/otf/ directory. you will find the stixmath-regular, stix-regular, s...
...if desired, you may also do the same for the other font files. note:cambria math is installed by default on windows 7 and later versions and should ensure relatively good mathml rendering. ...
...l latin modern math and stix by default. os x install the latin modern math and stix fonts as follows: download latinmodern-math-1959.zip. extract the zip archive, move inside the latinmodern-math-1959 directory and then inside the otf directory. you will find a latinmodern-math font file. double-click the latinmodern-math font file click the "install the font" button from the window that opens. download stixv2.0.2.zip. open the zip archive, move inside the /stixv2.0.0/fonts/otf/ directory. you will find the stixmath-regular, stix-regular, stix-bold, stix-italic, stix-bolditalic font files. open the stixmath-regular font file and click the "install the font" button from the window that opens. if desired, you may also do the same for the other font files. note: a deprecated versio...
...And 6 more matches
nsICacheSession
netwerk/cache/public/nsicachesession.idlscriptable handles open synchronous and asynchronous cache entry operations along with evicting cache entries and checking for cache devices instantiation according to the session storage policies. ...
... netwerk/cache/public/nsicachesession.idlscriptable handles open synchronous and asynchronous cache entry operations along with evicting cache entries and checking for cache devices instantiation according to the session storage policies. ...
...s instantiation according to the session storage policies. inherits from: nsisupports last changed in gecko 14 (firefox 14 / thunderbird 14 / seamonkey 2.11) method overview void asyncopencacheentry(in acstring key, in nscacheaccessmode accessrequested, in nsicachelistener listener, [optional] in boolean nowait); void evictentries(); prbool isstorageenabled(); nsicacheentrydescriptor opencacheentry(in acstring key, in nscacheaccessmode accessrequested, in boolean blockingmode); void doomentry(in acstring key, in nsicachelistener listener); attributes attribute type description doomentriesifexpired prbool expired entries will be doomed or evicted if this attribute is set to true. if false, expired entries will be returned (useful for offline mode and clients, such as htt...
...And 6 more matches
nsIHttpChannel
the channel to indicate whether or not the underlying http transaction should be allowed to be pipelined with other transactions. this should be set to false, for example, if the application knows that the corresponding document is likely to be very large. this attribute is true by default, though other factors may prevent pipelining. this attribute may only be set before the channel is opened. exceptions thrown ns_error_failure if set after the channel has been opened. redirectionlimit unsigned long this attribute specifies the number of redirects this channel is allowed to make. if zero, the channel will fail to redirect and will generate a ns_error_redirect_loop failure status. note: an http redirect results in a new chan...
...s redirectionlimit attribute. the initial value for this attribute may be a configurable preference (depending on the implementation). referrer nsiuri get or set the uri of the http referer: header. this is the address (uri) of the resource from which this channel's uri was obtained (see rfc2616 section 14.36). this attribute may only be set before the channel is opened. note: the channel may silently refuse to set the referer: header if the uri does not pass certain security checks (e.g., a "https://" url will never be sent as the referrer for a plaintext http request). the implementation is not required to throw an exception when the referrer uri is rejected. exceptions thrown ns_error_in_progress if set after the channel ...
... note: the channel may silently refuse to set the referer: header if the uri does not pass certain security checks (e.g., a "https://" url will never be sent as the referrer for a plaintext http request). the implementation is not required to throw an exception when the referrer uri is rejected. exceptions thrown ns_error_in_progress if set after the channel has been opened. ns_error_failure if used for setting referrer during visitrequestheaders(). getting the value will not throw. requestmethod acstring set or get the http request method (default is "get"). setter is case insensitive; getter returns an uppercase string. this attribute may only be set before the channel is opened. note: the data for a "post" ...
...And 6 more matches
nsINavHistoryContainerResultNode
read only. childrenreadonly boolean false if the node's list of children can be modified (by adding or removing children, or rearranging them), or true if the user interface should not allow the list of children to be altered. read-only. this is false for bookmark folder nodes unless the setfolderreadonly() method has been called to specifically make the folder read-only. it's true fo...
...ging them), or true if the user interface should not allow the list of children to be altered. read-only. this is false for bookmark folder nodes unless the setfolderreadonly() method has been called to specifically make the folder read-only. it's true for non-folder nodes. if this container is a remote container, this flag may be redefined by the remote container provider. read-only. ...
... dynamiccontainertype autf8string a string representing the dynamic container api service responsible for this container. accessing this throws an exception if the node isn't a dynamic container. read only. ...
...And 6 more matches
nsITextInputProcessor
see the document of nsitextinputprocessorcallback for the detail. next, you can set the composition string or dispatch keyboard events. the following example sets "foo-bar-buzz", "bar" is selected clause to convert, and caret position is the end of the selected clause: // first, sets composition string. tip.setpendingcompositionstring("foo-bar-buzz"); // next, append clauses. ...
... set the composition string or dispatch keyboard events. the following example sets "foo-bar-buzz", "bar" is selected clause to convert, and caret position is the end of the selected clause: // first, sets composition string. tip.setpendingcompositionstring("foo-bar-buzz"); // next, append clauses. ...
...sets "foo-bar-buzz", "bar" is selected clause to convert, and caret position is the end of the selected clause: // first, sets composition string. tip.setpendingcompositionstring("foo-bar-buzz"); // next, append clauses. ...
...And 6 more matches
nsITreeView
getparentindex(in long rowindex); long getprogressmode(in long row, in nsitreecolumn col); astring getrowproperties(in long index, in nsisupportsarray properties obsolete since gecko 22); boolean hasnextsibling(in long rowindex, in long afterindex); boolean iscontainer(in long index); boolean iscontainerempty(in long index); boolean iscontaineropen(in long index); boolean iseditable(in long row, in nsitreecolumn col); boolean isselectable(in long row, in nsitreecolumn col); boolean isseparator(in long index); boolean issorted(); void performaction(in wstring action); void performactiononcell(in wstring action, in long row, in nsitreecolumn col); void performactiononrow(in wstri...
...read only. selection nsitreeselection the selection for this view. constants constant value description progress_normal 1 note: renamed from progressnormal in ge...
...w which is an empty container (i.e., a row with the potential to hold children but that currently has none), and a non-empty container (i.e., a row that positively does currently have children). the tree frame code that handles drag and drop, for example, uses this method to determine how to interpret the drop position. note: nsitreeview implementations must be prepared to handle a call to toggleopenstate for any row index which returns true for a call to iscontainer, even if iscontainerempty returns true. boolean iscontainer( in long index ); parameters index the index of the row being asked about. return value true if the row is a container. otherwise false. iscontainerempty() one of the methods that can be used to test whether or not a twisty should be drawn, and if so, wheth...
...And 6 more matches
nsIWindowsRegKey
siwindowsregkey createchild(in astring relpath, in unsigned long mode); astring getchildname(in unsigned long index); astring getvaluename(in unsigned long index); unsigned long getvaluetype(in astring name); boolean haschanged(); boolean haschild(in astring name); boolean hasvalue(in astring name); boolean iswatching(); void open(in unsigned long rootkey, in astring relpath, in unsigned long mode); nsiwindowsregkey openchild(in astring relpath, in unsigned long mode); acstring readbinaryvalue(in astring name); unsigned long long readint64value(in astring name); unsigned long readintvalue(in astring name); astring readstringvalue(in astring name); void removechild(in as...
...he root_key_ prefix corresponds to the hkey_ prefix in the ms platform sdk. this interface is not restricted to using only these root keys. constant value description root_key_classes_root 0x80000000 root_key_current_user 0x80000001 root_key_local_machine 0x80000002 access constants values for the mode parameter passed to the open() and create() methods. the values defined here correspond to the regsam values defined in winnt.h in the ms platform sdk, where access_ is replaced with key_. this interface is not restricted to using only these access types. constant value description access_basic 0x00020000 access_query_value 0x00000001 access_set_value 0x00000002 ...
...elow). constant value description type_none 0 reg_none type_string 1 reg_sz type_binary 3 reg_binary type_int 4 reg_dword type_int64 11 reg_qword methods close() this method closes the key. if the key is already closed, then this method does nothing. void close(); parameters none. create() this method opens an existing key or creates a new key. note: on 32-bit windows, it is valid to pass any hkey as the rootkey parameter of this function. however, for compatibility with 64-bit windows, that usage should probably be avoided in favor of createchild(). void create( in unsigned long rootkey, in astring relpath, in unsigned long mode ); parameters rootkey a root key defined above or any...
...And 6 more matches
nsIZipReader
nputstream(in string zipentry); obsolete since gecko 10 nsiinputstream getinputstreamwithspec(in autf8string ajarspec, in autf8string zipentry); nsiinputstream getinputstreamwithspec(in autf8string ajarspec, in string zipentry); obsolete since gecko 10 boolean hasentry(in autf8string zipentry); void init(in nsifile zipfile); obsolete since gecko 1.9 void open(in nsifile zipfile); void openinner(in nsizipreader zipreader, in autf8string zipentry); void openinner(in nsizipreader zipreader, in string zipentry); obsolete since gecko 10 void test(in autf8string aentryname); void test(in string aentryname); obsolete since gecko 10 attributes attribute type description file nsifile the file t...
...ipentry ); parameters zipentry the zip entry. return value the nsizipentry for the given zip entry. example demonstrating this function: list contents of xpi and read file contents getinputstream() returns an input stream containing the contents of the specified zip entry. ...
...y the name of the entry to open() the stream from. return value the nsiinputstream containing the contents of the specified zip entry. example demonstrating this function: list contents of xpi and read file contents getinputstreamwithspec() returns an input stream containing the contents of the specified zip entry. if the entry refers to a directory (ends with '/'), a directory stream is opened, otherwise the contents of the file entry is returned. nsiinputstream getinputstreamwithspec( in autf8string ajarspec, in autf8string zipentry ); parameters ajarspec the spec of the uri for the jar (only used for directory streams). zipentry the name of the entry to open() the stream from. return value the nsiinputstream containing the contents of the specified zip entry. hasen...
...And 6 more matches
Using js-ctypes
before you can use js-ctypes, you need to import the ctypes.jsm code module. this is as simple as including the following line of code in the desired javascript scope: components.utils.import("resource://gre/modules/ctypes.jsm") loading a native library once you've imported the code module, you can call the ctypes.open() method to load each native library you wish to use. ...
...le. this is as simple as including the following line of code in the desired javascript scope: components.utils.import("resource://gre/modules/ctypes.jsm") loading a native library once you've imported the code module, you can call the ctypes.open() method to load each native library you wish to use. on windows, for example, you might load the system user32 library like this: var lib = ctypes.open("user32.dll"); on mac os x, you can load the core foundation library from the core foundation framework like this: var corefoundation = ctypes.open("/system/library/frameworks/corefoundation.framework/corefoundation"); the returned object is a library object that you use to declare functions and data types for use with the loaded library. note: js-ctypes only works with c libraries; you can't...
... them is covered in the article working with data. memory management moved to memory management page. examples these examples offer a quick look at how js-ctypes is used. see js-ctypes examples for more intricate examples. calling windows routines this example demonstrates how to use ctypes to call a win32 api. ...
...And 6 more matches
Examine and edit HTML - Firefox Developer Tools
node. if you hold the alt key while clicking the arrow, it expands the node and all the nodes underneath it. moving the mouse over a node in the tree highlights that element in the page. nodes that are not visible are shown faded/desaturated. this can happen for different reasons such as using display: none or that the element doesn't have any dimensions. ...
... scroll the element is a scroll container, i.e. it has overflow: scroll or overflow: auto applied to it, and it has scrollable overflow. grid the element is a grid container, i.e. ...
...is a custom element. clicking the marker switches to the line of javascript code in the debugger where the custom element got defined. note: there are some useful keyboard shortcuts that can be used in the html tree — see the html pane keyboard shortcuts list. ::before and ::after you can inspect pseudo-elements added using ::before and ::after: custom element definition when you open the inspector on a page that includes custom elements, you can view the class definition for the custom element in the debugger: inspect the element click on the word custom the source for the element's class will be displayed in the debugger. whitespace-only text nodes web developers don’t write all their code in just one line of text. they use white space such as spaces, returns, ...
...And 6 more matches
CacheStorage - Web APIs
other type of worker or window scope (you’re not limited to only using it with service workers, even though the service workers spec defines it). note: chrome and safari only expose `cachestorage` to the windowed context over https. window.caches will be undefined unless an ssl certificate is configured. maintains a mapping of string names to corresponding cache objects. use cachestorage.open() to obtain a cache instance. use cachestorage.match() to check if a given request is a key in any of the cache objects that the cachestorage object tracks. you can access cachestorage through the global caches property. note: cachestorage always rejects with a securityerror on untrusted origins (i.e. those that aren't using https, although this definition will likely become more complex in th...
...jects that the cachestorage object tracks. you can access cachestorage through the global caches property. note: cachestorage always rejects with a securityerror on untrusted origins (i.e. those that aren't using https, although this definition will likely become more complex in the future.) when testing, you can get around this by checking the "enable service workers over http (when toolbox is open)" option in the firefox devtools options/gear menu. note: cachestorage.match() is a convenience method. equivalent functionality to match a cache entry can be implemented by returning an array of cache names from cachestorage.keys(), opening each cache with cachestorage.open(), and matching the one you want with cache.match(). methods cachestorage.match() checks if a given request is a key ...
...if no cache object is found, it resolves to false. ...
...And 6 more matches
EventSource - Web APIs
if there is an event field in the incoming message, the triggered event is the same as the event field value. if no event field is present, then a generic message event is fired. ...
...if there is an event field in the incoming message, the triggered event is the same as the event field value. if no event field is present, then a generic message event is fired. ...
...if there is an event field in the incoming message, the triggered event is the same as the event field value. if no event field is present, then a generic message event is fired. ...
...And 6 more matches
IDBFactory - Web APIs
idbfactory.deletedatabase a method to request the deletion of a database. idbfactory.cmp a method that compares two keys and returns a result indicating which one is greater in value. ...
... idbfactory.deletedatabase a method to request the deletion of a database. idbfactory.cmp a method that compares two keys and returns a result indicating which one is greater in value. ...
... idbfactory.deletedatabase a method to request the deletion of a database. idbfactory.cmp a method that compares two keys and returns a result indicating which one is greater in value. ...
...And 6 more matches
IDBObjectStore.get() - Web APIs
re selected by the specified key. this is for retrieving specific records from an object store. if a value is successfully found, then a structured clone of it is created and set as the result of the request object. note: this method produces the same result for: a) a record that doesn't exist in the database and b) a record that has an undefined value. to tell these situations apart, call the opencursor() method with the same key. that method provides a cursor if the record exists, and no cursor if it does not. note: this feature is available in web workers. syntax var request = objectstore.get(key); parameters key the key or key range that identifies the record to be retrieved. return value an idbrequest object on which subsequent events related to this operation are fired. ex...
... may raise a domexception of one of the following types: exception description transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror the key or key range provided contains an invalid key. invalidstateerror the idbobjectstore has been deleted or removed. example in the following code snippet, we open a read/write transaction on our database and get one specific record from object store using get() — a sample record with the key "walk dog". once this data object is retrieved, you could then update it using normal javascript, then put it back into the database using a idbobjectstore.put operation. for a full working example, see our to-do notifications app (view example live.) // let us ope...
...tion on our database and get one specific record from object store using get() — a sample record with the key "walk dog". once this data object is retrieved, you could then update it using normal javascript, then put it back into the database using a idbobjectstore.put operation. ...
...And 6 more matches
IDBRequest - Web APIs
us methods return a request object. if the request has been completed successfully, the result is made available through the result property and an event indicating success is fired at the request (idbrequest.onsuccess). if an error occurs while performing the operation, the exception is made available through the result property and an error event is fired (idbrequest.onerror). the interface idbopendbrequest is derived from idbrequest. note: this feature is available in web workers. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xli...
...eption in the event of an unsuccessful request, indicating what went wrong. idbrequest.result read only returns the result of the request. if the the request failed and the result is not available, an invalidstateerror exception is thrown. idbrequest.source read only the source of the request, such as an idbindex or an idbobjectstore. ...
...(you're just connecting to a database, so there is no transaction to return). methods no methods, but inherits methods from eventtarget. events listen to these events using addeventlistener() or by assigning an event listener to the oneventname property of this interface. error fired when an error caused a request to fail. ...
...And 6 more matches
IDBTransaction: abort event - Web APIs
of the following reasons: bad requests, (for example, trying to add the same key twice, or put the same index key when the key has a uniqueness constraint), an explicit abort() call an uncaught exception in the request's success/error handler, an i/o error (an actual failure to write to disk, for example disk detached, or other os/hardware failure) quota exceeded. ...
...add the same key twice, or put the same index key when the key has a uniqueness constraint), an explicit abort() call an uncaught exception in the request's success/error handler, an i/o error (an actual failure to write to disk, for example disk detached, or other os/hardware failure) quota exceeded. ...
...() call an uncaught exception in the request's success/error handler, an i/o error (an actual failure to write to disk, for example disk detached, or other os/hardware failure) quota exceeded. examples this example opens a database (creating the database if it does not exist), then opens a transaction, adds a listener to the abort event, then aborts the transaction to trigger the event. ...
...And 6 more matches
Signaling and video calling - Web APIs
s process is called signaling and involves both devices connecting to a third, mutually agreed-upon server. through this third server, the two devices can locate one another, and exchange negotiation messages. in this article, we will further enhance the websocket chat first created as part of our websocket documentation (this article link is forthcoming; it isn't actually online yet) to support opening a two-way video call between users. you can try out this example on glitch, and you can remix the example to experiment with it as well. you can also look at the full project on github. note: if you try out the example on glitch, please note that any changes made to the code will immediately reset any connections. in addition, there is a short timeout period; the glitch instance is for quick...
...r they're discovered, and keeps sending candidates until it runs out of suggestions, even if media has already started streaming. an icecandidate event is sent to the rtcpeerconnection to complete the process of adding a local description using pc.setlocaldescription(offer). once the two peers agree upon a mutually-compatible candidate, that candidate's sdp is used by each peer to construct and open a connection, through which media then begins to flow. if they later agree on a better (usually higher-performance) candidate, the stream may change formats as needed. though not currently supported, a candidate received after media is already flowing could theoretically also be used to downgrade to a lower-bandwidth connection if needed. each ice candidate is sent to the other peer by sending ...
...here's the expected sequence of events: we'll see this detailed more over the course of this article. ice candidate exchange process when each peer's ice layer begins to send candidates, it enters into an exchange among the various points in the chain that looks like this: each side sends candidates to the other as it receives them from their local ice layer;...
...And 6 more matches
Link types - HTML: Hypertext Markup Language
, <area>, <form>, <link> none. nofollow indicates that the linked document is not endorsed by the author of this one, for example if it has no control over it, if it is a bad example or if there is commercial relationship between the two (sold link). this link type may be used by some search engines that use popularity ranking techniques. ...
... nofollow indicates that the linked document is not endorsed by the author of this one, for example if it has no control over it, if it is a bad example or if there is commercial relationship between the two (sold link). this link type may be used by some search engines that use popularity ranking techniques. ...
...his one, for example if it has no control over it, if it is a bad example or if there is commercial relationship between the two (sold link). this link type may be used by some search engines that use popularity ranking techniques. <a>, <area>, <form> <link> noopener instructs the browser to open the link without granting the new browsing context access to the document that opened it — by not setting the window.opener property on the opened window (it returns null). this is especially useful when opening untrusted links, in order to ensure they cannot tamper with the originating document via the window.opener property (see about rel=noopener for more details), while still providing the referer http header (unless noreferrer is used as well). note that w...
...And 6 more matches
Working with Events - Archive of obsolete content
by registering a listener function to an event emitter an add-on can receive notifications of these events. we talk about content scripts in more detail in the working with content scripts guide. additionally, if you're using content scripts to interact with web content, you can define your own events and use them to communicate between the main add-on code and the content scripts. ...
...ipts to interact with web content, you can define your own events and use them to communicate between the main add-on code and the content scripts. in this case one end of the conversation emits the events, and the other end listens to them. so there are two main ways you will interact with the eventemitter framework: listening to built-in events emitted by objects in the sdk, such as tabs opening, pages loading, mouse clicks sending and receiving user-defined events between content scripts and add-on code this guide only covers the first of these; the second is explained in the working with content scripts guide. adding listeners you can add a listener to an event emitter by calling its on(type, listener) method. it takes two parameters: type: the type of event we ar...
...rs the first of these; the second is explained in the working with content scripts guide. adding listeners you can add a listener to an event emitter by calling its on(type, listener) method. it takes two parameters: type: the type of event we are interested in, identified by a string. many event emitters may emit more than one type of event: for example, a browser window might emit both open and close events. the list of valid event types is specific to an event emitter and is included with its documentation. listener: the listener itself. this is a function which will be called whenever the event occurs. the arguments that will be passed to the listener are specific to an event type and are documented with the event emitter. for example, the following add-on registers a li...
...And 5 more matches
indexed-db - Archive of obsolete content
experimental exposes the indexeddb api to add-ons. usage scripts running in web pages can access indexeddb via the window object. for example: window.indexeddb = window.indexeddb || window.webkitindexeddb || window.mozindexeddb || window.msindexeddb; var request = window.indexeddb.open("mydatabase"); request.onerror = function(event) { console.log("failure"); }; request.onsuccess = function(event) { console.log("success"); }; because your main add-on code can't access the dom, you can't do this. ...
...ndexeddb; var request = window.indexeddb.open("mydatabase"); request.onerror = function(event) { console.log("failure"); }; request.onsuccess = function(event) { console.log("success"); }; because your main add-on code can't access the dom, you can't do this. so you can use the indexed-db module to access the same api: var { indexeddb } = require('sdk/indexed-db'); var request = indexeddb.open('mydatabase'); request.onerror = function(event) { console.log("failure"); }; request.onsuccess = function(event) { console.log("success"); }; most of the objects that implement the indexeddb api, such as idbtransaction, idbopendbrequest, and idbobjectstore, are accessible through the indexeddb object itself. the api exposed by indexed-db is almost identical to the dom indexeddb api, so we ...
... website database. see bug 778197 and bug 786688. example this example uses the action button api, which is only available from firefox 29 onwards. here's a complete add-on that adds two buttons to the browser: the button labeled "add" adds the title of the current tab to a database, while the button labeled "list" lists all the titles in the database. ...
...And 5 more matches
widget - Archive of obsolete content
or replacements. in particular, for a simple button, try the action button or toggle button apis, and for a more complex widget try the toolbar or sidebar apis. create a simple user interface for an add-on in firefox's add-on bar. usage "widgets" are small pieces of content that live in the firefox 4 add-on bar. they can be simple icons or complex web pages. you can attach panels to them that open when they're clicked, or you can define a custom click handler to perform some other action, like opening a web page in a tab. there are a few advantages to using widgets over an ad hoc user interface. first, your users will be accustomed to interacting with add-ons via widgets and the add-on bar. second, it allows firefox to treat your interface as a first-class citizen. for example, in the fut...
...unction() { console.log("stopping"); }); attaching panels to widgets you can supply a panel to the widget's constructor: if you do this, the panel is automatically displayed when the user clicks the widget. data = require("sdk/self").data var clockpanel = require("sdk/panel").panel({ width:215, height:160, contenturl: data.url("clock.html") }); require("sdk/widget").widget({ id: "open-clock-btn", label: "clock", contenturl: data.url("history.png"), panel: clockpanel }); note that this is, at the moment, the only way you can attach a panel to a widget. you must supply the panel in the widget's constructor for it to work. if you assign the panel to the widget after construction, the panel can still be shown but will not be anchored to the widget: data = require("sdk/sel...
...dget. you must supply the panel in the widget's constructor for it to work. ...
...And 5 more matches
ui/button/action - Archive of obsolete content
events programmatically with the button's click() method. disabling buttons you can disable a button by setting its disabled property to true. a disabled button will not generate click events and its icon will appear disabled: updating state you can update all the button's properties except for its id. by default, the button has global state: that is, its properties are the same across all open windows and tabs, and updating them updates the button's state across all open windows and tabs. you can set state to be specific to a window or tab using the button's state() method. to set state like this, call state() with 2 parameters: the first parameter is a window or tab object or as a shorthand, the string "window" for the currently active window, or the string "tab" for the currently...
...actionbutton({ id: "my-button", label: "my button", icon: { "16": "./firefox-16.png", "32": "./firefox-32.png" }, onclick: function(state) { console.log("you clicked '" + state.label + "'"); } }); button.click(); state() get or set the button's state for a specific window or tab. by default, a button's properties are global, meaning that they are the same across all open windows and tabs, and that if you update these properties, then they are updated across all windows and tabs. but sometimes you want a button attached to one window (or tab) to have a different state to a button attached to a different window (or tab). that's what state() is for. to set a button's properties for a specific window or tab, call state(), passing it the window or tab you want the pr...
...el" : "tab-specific label" }); to fetch the button state for a specific window or tab, call state(), passing it the window or tab you're interested in, and it will return a state object containing all the properties for the button associated with that window or tab. again. you can use the strings "window" or "tab" as shortcuts. ...
...And 5 more matches
Finding window handles - Archive of obsolete content
rface(ci.nsiwebnavigation) .queryinterface(ci.nsidocshelltreeitem) .treeowner .queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsibasewindow); var hwndstring = basewindow.nativehandle; components.utils.import('resource://gre/modules/ctypes.jsm'); var user32 = ctypes.open('user32.dll'); /* http://msdn.microsoft.com/en-us/library/ms633539%28v=vs.85%29.aspx * bool winapi setforegroundwindow( * __in_ hwnd hwnd * ); */ var setforegroundwindow = user32.declare('setforegroundwindow', ctypes.winapi_abi, ctypes.bool, // return bool ctypes.voidptr_t // hwnd ); var hwnd = ctypes.voidptr_t(ctypes.uint64(hwndstring)); var rez_setforegroundwindow = setforegroun...
...ace(ci.nsiwebnavigation) .queryinterface(ci.nsidocshelltreeitem) .treeowner .queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsibasewindow); var nswindowstring = basewindow.nativehandle; components.utils.import('resource://gre/modules/ctypes.jsm'); var objc = ctypes.open(ctypes.libraryname('objc')); // types let id = ctypes.voidptr_t; let sel = ctypes.voidptr_t; // constants let nil = ctypes.voidptr_t(0); //common functions let sel_registername = objc.declare('sel_registername', ctypes.default_abi, sel, ctypes.char.ptr); let objc_msgsend = objc.declare('objc_msgsend', ctypes.default_abi, id, id, sel, '...'); /* https://developer.apple.com/library/mac/document...
...window.nativehandle; var gdkwinptr = gdkwindow.ptr(ctypes.uint64(gdkwindowptrstring)); working with gdkwindow* gdkwindow* to xid var gdkwindow = ctypes.structtype('gdkwindow'); var gdkdrawable = ctypes.structtype('gdkdrawable'); var card32 = /^(alpha|hppa|ia64|ppc64|s390|x86_64)-/.test(services.appinfo.xpcomabi) ? ...
...And 5 more matches
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
ite and the current version of seamonkey, but it needs to be installed as an extension in firefox. see https://addons.mozilla.org/firefox/216/. install the extension in firefox directly from the above url and relaunch firefox. starting up select “javascript debugger” from the tools menu. targeting javascript for debugging. when venkman first launches, it can only debug the file currently open in your web browser. this is because a lot of javascript files can slow down the browser down if they’re opened for debugging, but you’ll need to lift this restriction in order to develop extensions. uncheck the “exclude browser files” menu item under the debug menu (figure 1). fixme: figure 1: uncheck “exclude browser files.” set up quicknote for the purposes of this explanation, ...
... purposes of this explanation, we’re going to use the file-storage mechanism in quicknote1 for our debugger. install quicknote from the following url and relaunch firefox. https://addons.mozilla.org/firefox/46/. after relaunching firefox, activate quicknote. then select tools:quicknote:float to display it in its own window. using venkman read in source code activate venkman, and then select open windows:quicknote.xul:files on the top-left of the screen. double-click on quicknote.js to open it in source-code view (figure 2). fixme: figure 2: selecting source code inserting breakpoints now you’ll want to set some breakpoints. try inserting one within the quicknote_savenote function, around line 345 (figure 3). fixme: figure 3: inserting a breakpoint start debugger type in some text...
...vascript that assists with unit testing. it provides an ui similar to that of eclipse’s junit test runner. it should be very easy for java programmers to get up to speed on it quickly. installing mozunit is a feature of mozlab. install mozlab from the following url and relaunch firefox. http://hyperstruct.net/projects/mozunit after relaunching, set up the editor you’ll use to write tests. open the about:config screen and edit the extensions.mozlab.mozunit.editor property. parameters are as shown in table 1. if you want to use terapad2, for example, insert the following: c:\app\tpad090\terapad.exe /jl=%l %f table 1: parameters used in mozunit parameter description %f filename %l line number ...
...And 5 more matches
Adding windows and dialogs - Archive of obsolete content
« previousnext » opening windows and dialogs to open a new window, use the javascript window.open function just like with html windows. window.open( "chrome://xulschoolhello/content/somewindow.xul", "xulschoolhello-some-window", "chrome,centerscreen"); the first argument is the url to open, the second is an id to identify the window, and the last is an optional comma-separated list of features, which describe the behavior and appearance of the window. if this value is null or empty, the default toolbars of the main window will be added to the new one, which is rarely what you want. the window.open page has a detailed description of the features you can use and their values. the following features are very important and you should always keep them in mind: chrome. this c...
... modal. modal windows block their parent window until action is taken on them. an alert window is an example of this. ...
...eatures you can use and their values. the following features are very important and you should always keep them in mind: chrome. this can only be used from the chrome, not from regular html javascript. it indicates that a chrome document is being opened, not a web page. this means that the document defines the whole window, and not only the inner content area. you should always include it when opening a xul window or dialog. modal. modal windows block their parent window until action is taken on them. an alert window is an example of this. ...
...And 5 more matches
Intercepting Page Loads - Archive of obsolete content
ener("load", this._loadhandler, true); gbrowser is a global object that corresponds to the tabbrowser element in the main browser window. it is full of useful functions, so you should always keep it in mind when you want to handle tabs and web content windows. attaching the load event handler to gbrowser allows us to listen to these events for all tabs, without having to worry how many tabs are open. gbrowser exists in every browser window. we store the handler function in a private variable because later we want to remove it when we do not need it anymore. gbrowser.removeeventlistener("load", this._loadhandler, true); finally, the actual code for the handler, which is very simple: _onpageload : function(event) { // this is the content document of the loaded page. let doc = event.ori...
...ntercepting loads is using http observer topics. this is how the tamper data extension and others do it. http notifications are fired for all http requests originating from firefox. they are window-independent, so it is better to keep your observer code in non-chrome objects (your xpcom service or jsm module). otherwise you have to make sure to avoid duplicated work if you have 2 or more windows open. there are 2 http topics you can listen to, as specified in the observer notifications page: topic description http-on-modify-request called as an http request is made. the channel is available to allow you to modify headers and such. http-on-examine-response called after a response has been received from the webserver. headers are available on the channel. ...
...tion http-on-modify-request called as an http request is made. the channel is available to allow you to modify headers and such. http-on-examine-response called after a response has been received from the webserver. headers are available on the channel. the subject argument on the observe method is the nsihttpchannel object that corresponds to the http channel being opened or already opened, depending on the topic. observe : function(asubject, atopic, adata) { if (topic_modify_request == atopic) { let url; asubject.queryinterface(components.interfaces.nsihttpchannel); url = asubject.uri.spec; if (re_url_to_modify.test(url)) { // re_url_to_modify is a regular expression. asubject.setrequestheader("referer", "http://example.com", false); ...
...And 5 more matches
Setting Up a Development Environment - Archive of obsolete content
em. in regards to code editing, there's no official mozilla ide. on the other hand, extensions use the same (or similar) languages that are used for web development, so most text editors and ides are up to the task. most xul tools and plugins you'll find online are merely templates that generate the folder structure for the project, and that's not much help. we recommend komodo edit. it's free, open source, and cross-platform. it's based on the mozilla xulrunner platform, so it has support for some of the particularities in firefox extension development. komodo edit has automatic completion for xul tags and attributes, and it supports mozilla's css extensions (css values and properties beginning with "-moz"). it has an add-on system similar to the one in firefox, and there are some komodo ex...
...systems. make is a default tool in most unix-based systems. it can be installed on mac os x as part of the xcode tools package, and on windows with cygwin. in cygwin installations you'll have to explicitly check the make and zip utilities from the long list of packages to download and install. also make sure that make is in the executable system path. after setting up make, you should be able to open a command line window, run "make -ver", and get the installed version of make as output. we recommend you set up make in your system, since our examples come with all the necessary files to build and install the resulting xpi using this tool. it will save you some packaging time. or you can create an equivalent system using batch, ant or whatever you prefer. ultimately you can just compress the ...
...e project used to build the second version of hello world, from the exercise in the last section. hello world 2 project. unzip the file anywhere you want. inside the helloworld2 directory, you'll see two directories: bin and src. the bin directory should be empty. this is where all the resulting build files will be created, and where you'll find the extension xpi file once you get it to build. open the project file (helloworld2.komodoproject) from the src directory in komodo edit. in the projects tab you should be able to see the directory structure inside the src directory. this structure should be familiar, as it is almost identical to the unpacked xpi from the previous section. the only notable additions is a file named makefile under src. this is the file that make uses to build the xp...
...And 5 more matches
Debugging a XULRunner Application - Archive of obsolete content
r debugger to debug your xulrunner apps. add the following code to your xul app: components.utils.import('resource://gre/modules/devtools/dbg-server.jsm'); if (!debuggerserver.initialized) { debuggerserver.init(); // don't specify a window type parameter below if "navigator:browser" // is suitable for your app. ...
...and you should be able to point the debugger to your app. happy debugging :) venkman follow these instructions to install venkman into your xulrunner application (xulrunner 1.9 and later): get venkman from...
...ication (xulrunner 1.9 and later): get venkman from addons.mozilla.org (v0.9.87 at the time of writing). to download the package, right-click the install link and save the package locally. create a directory <application>/distribution/bundles/venkman. unzip the package into that directory. add <script src="chrome://venkman/content/venkman-overlay.js" /> to one of your xul windows. add ui to open venkman to your window (it could be a menu item or a toolbar button). make it call start_venkman() when activated. troubleshooting x-jsd is not a registered protocol if the message "x-jsd is not a registered protocol" appears when trying to open *.js files in venkman, then add an empty file called .autoreg in the same directory as your xulrunner binary. if .autoreg already exists, then edit i...
...And 5 more matches
Dialogs in XULRunner - Archive of obsolete content
« previous the last article in this series covered some simple xul for creating windows, menus, and toolbars. this time i'll look at dialogs, including both custom dialogs and standard operating system dialogs. dialogs are pretty fundamental to a desktop application. certain types of dialogs are used so frequently that the os can provide a default implementation. file open and save dialogs are good examples of these. whenever possible, it is a good idea to reuse these "native" dialogs so users get a consistent experience across applications. custom dialogs building dialogs in xul is very similar to creating windows. each dialog is described in its own xul file. xul provides a dialog element to act as the container for the dialog. dialog xul files can have dtd, css, and javasc...
...in an e...
...<groupbox flex="1"> <caption label="select favorite fruit"/> <radiogroup> <radio id="1" label="oranges because they are fruity"/> <radio id="2" selected="true" label="strawberries because of color"/> <radio id="3" label="bananna because it pre packaged"/> </radiogroup> </groupbox> </dialog> xul window elements have a special method to open dialogs, called window.opendialog(). here is the code needed to open a dialog: function opendialog() { window.opendialog("chrome://basicapp/content/dialog.xul", "newdlg", "modal"); } the resulting dialog looks like this on windows 2000, and will look similar on other operating systems: the first thing that caught my eye about dialog is the button-related attributes on the element. in an effort to make things easier ...
...And 5 more matches
Building a Theme - Archive of obsolete content
es will be extracted from the default theme. first, you'll want to create a directory somewhere. copy your firefox installation's omni.ja into this directory. the location differs by operating system: linux: /usr/lib/mozillafirefox/chrome/classic.ja or /usr/lib/firefox-*.*.*/omni.ja windows: \program files\mozilla firefox\omni.ja mac os x: /applications/firefox.app/contents/macos/omni.ja now, open (or unzip) this file into the directory you created. it contains several folders, modules, jssubloader and others. the files we will be needing are located under the chrome\toolkit\skin\classic folder. create a folder called chrome in your theme's folder. next, the contents of the following directories to their respective folders into the folder. global to chrome/global mozapps to chrome/moz...
...me.manifest /chrome/ browser/ communicator/ global/ mozapps/ after this, it would be a good idea to read the article setting up extension development environment and follow the directions there. it's especially important to install the dom inspector, which we'll be using in later steps. ...
...ension will work with. set this to be no newer than the newest currently available version! in this case, "39.*" indicates that the extension works with firefox 39 and any subsequent 39.x release. themes are compatible by default, unless you set strict compatibility mode for your theme. if you get a message that the install.rdf is malformed, it is helpful to load it into firefox using the file->open file command and it will report xml errors to you. see install manifests for a complete listing of the required and optional properties. save the file. styling the browser's ui with css firefox's user interface is written in xul and javascript. xul is an xml grammar that provides user interface widgets like buttons, menus, toolbars, trees, etc. user actions are bound to functionality using ...
...And 5 more matches
Scratchpad - Archive of obsolete content
ith the web page. unlike the web console, which is designed for interpreting a single line of code at a time, scratchpad lets you edit larger chunks of javascript code, then execute it in various ways depending on how you want to use the output. the featured video tutorial shows a case of using scratchpad with a page run by a local web server. ...
...th a page run by a local web server. it is also possible to use scratchpad over pages opened from a local file system, if permission policies allow that. but even with possible limitations present, the html code can be either manually entered or copied from the source and pasted into the "about:blank" page (a new empty tab) with the use page inspector's edit as html context menu command. ...
... over pages opened from a local file system, if permission policies allow that. but even with possible limitations present, the html code can be either manually entered or copied from the source and pasted into the "about:blank" page (a new empty tab) with the use page inspector's edit as html context menu command. usage opening scratchpad in its own window there are several different ways to open scratchpad in its own window: press shift + f4, or go to the web developer menu (which is a submenu in the tools menu on macos and linux), then select scratchpad click the wrench icon (), which is in the main toolbar or under the hamburger menu (), then select "scratchpad". this will open up scratchpad in its own window. opening scratchpad in the toolbox new in firefox 47. from firefox 4...
...And 5 more matches
Popup Window Controls - Archive of obsolete content
mozilla and firefox allow users to control most unsolicited attempts to open new windows such as popup and popunder windows. learn how to detect popup controls, how to ask your readers to enable popups for your site and how to get the benefits of popup windows without using popup windows. ...
...low users to control most unsolicited attempts to open new windows such as popup and popunder windows. learn how to detect popup controls, how to ask your readers to enable popups for your site and how to get the benefits of popup windows without using popup windows. ...
...opups for your site and how to get the benefits of popup windows without using popup windows. ...
...And 5 more matches
TypeScript support in Svelte - Learn web development
e useful for allowing you to learn what it has to offer and help you make your own decision. if you are not interested at all in typescript, you can skip to the next chapter, where we will look at different options for deploying our svelte applications, further resources, and more. code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app state, run cd mdn-svelte-tutorial/07-typescript-support or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/07-typescript-support remember to run npm install && npm run dev to start your app in development mode. repl unfortunately, typescript support is not yet available in the repl. typescript: optiona...
...pt support to an existing svelte project you can follow these instructions. alternatively, you can download the setuptypescript.js file to a scripts folder inside your project's root folder, and then run node scripts/setuptypescript.js. you can even use degit to download the script. that's what we will do to start porting our application to typescript. note: remember that you can run npx degit opensas/mdn-svelte-tutorial/07-typescript-support svelte-todo-typescript to get the complete to-do list application in javascript before you start porting it to typescript. go to the root directory of the project and enter these commands: npx degit sveltejs/template/scripts scripts # download script file to a scripts folder node scripts/setuptypescript.js # run it converted...
...script in your projects. note: make sure you are using svelte for vs code and not the old "svelte" by james birtles, which has been discontinued. in case you have it installed, you should uninstall it and install the official svelte extension instead. anyway, assuming you are inside the vs code application, from the root of your project's folder, type code . (the trailing dot tells vs code to open the current folder) to open the code editor. vs code will tell you that there are recommended extensions to install. clicking install all will install svelte for vs code. we can also see that the setuptypescript.js file made a couple of changes to our project. the main.js file has been renamed to main.ts, which means that vs code can provide hover-information on our svelte components: we...
...And 5 more matches
Debugging on Mac OS X
understood before taking this step. creating an xcode project if you try to create a new xcode project in an existing directory then xcode will delete its existing contents (xcode will warn you beforehand). to work around that, the steps below have you initialize the project outside the mozilla source tree, close the project, copy the .xcodeproj project "file" into the source tree, and then reopen the project to finish setting it up. note also that since xcode 7.3.1 it doesn't seem to be possible to have the xcode project live outside the source tree. if you try to do that then xcode will simply copy the source files under the project directory rather than link to them (still the case in xcode 10?) which breaks debugging and the possibility to modify-rebuild-relaunch from inside xcode. ...
...that since xcode 7.3.1 it doesn't seem to be possible to have the xcode project live outside the source tree. if you try to do that then xcode will simply copy the source files under the project directory rather than link to them (still the case in xcode 10?) which breaks debugging and the possibility to modify-rebuild-relaunch from inside xcode. these steps were last updated for xcode 10.3: open xcode, and create a new project with file > new project. select the "cross-platform" tab then under the "other" template group select the "empty" project type. the click next. name the project and click next. create/select a temporary directory to contain the project and then click create. before going any further, close the project (file > close project) and open finder. find the *.xcodejproj d...
... in the left-hand pane in xcode you should see a tree item where the root item has the project name. ...
...And 5 more matches
Debugging on Windows
allows automatically attaching to child processes, such as web content process, gpu process, etc. enable it by going its configuration menu in "debug > other debugging targets > child process debugging settings", and ticking the box. if you have followed the steps in building firefox for windows and have a local debug build, you can execute ./mach run --debug from the same command line. it would open visual studio with firefox's run options configured. you can click "start" button to run firefox then, already attached in the debugger. alternatively, if you have generated the visual studio solution, via ./mach build-backend -b visualstudio, opening this solution allows you to run firefox.exe directly in the debugger. making it the startup project, by right clicking on it (it appears bold when...
...where the assertion happened. this will also create a visual c++ mozilla project in the directory of the executable by default. attach the debugger to an existing mozilla process. in the visual studio, select debug > attach to process. if you want to debug a content process, you can hover on the tab of page you want to debug, which would show the pid. you can then select the process from dialog opened from "attach to process". for more information, see attach to running processes with the visual studio debugger. debugging release and nightly builds refer to the steps to use the mozilla symbol server and source server. creating a visual c++ project for firefox please refer to the documentation on firefox-source-docs. changing/setting the executable to debug vc++ 6.0: to change or set ...
... is empty or incorrect, use the arrow button and select browse... to locate the executable. command line parameters and environment variables vc++ 6.0: to change or set the command line options, go to project > settings..., debug tab and select general from the drop down list. "program arguments:" should show the options. some common options would be the url of the file you want the browser to open as soon as it starts, starting the profile manager, or selecting a profile. you can also redirect the console output to a file (by adding "> filename.txt" for example, without the quotes). in vc 7 and 8 this option is called project > properties > debugging > command arguments. vc 8 also allows you to set environment variables there. setting breakpoints in dlls which are not yet loaded in memor...
...And 5 more matches
Eclipse CDT Manual Setup
improved code assistance. see the building from eclipse section below if you're interested in what you lose. if you're interested in future improvements to eclipse that would allow parallel builds to be run from inside eclipse while still allowing it to obtain the compiler options, see the faq isn't there a better method of build option discovery? below.) initial workspace preferences when you open eclipse, it will ask you to "select a workspace" (a directory where eclipse will store files that it generates during indexing, and so on.) it's recommended that you have a separate workspace containing only a single project for each mozilla source tree [rational], and that you choose a directory outside the mozilla source. something like $home/eclipse-workspaces/mozilla-tree-1, for example. afte...
...rates during indexing, and so on.) it's recommended that you have a separate workspace containing only a single project for each mozilla source tree [rational], and that you choose a directory outside the mozilla source. something like $home/eclipse-workspaces/mozilla-tree-1, for example. after selecting an appropriate directory, click ok, then close the "welcome" tab when the main eclipse window opens. before you proceed any further, check that your changes to eclipse's memory limits have taken effect and are present in eclipse/help > about eclipse > installation details > configuration. to avoid confusion in this and the following sections, note that "workspace preferences" and "project properties" are different things (we'll get to the details below). whenever you create a new workspace ...
...her external activity. select "c/c++ > build > console" and set "limit console output (number of lines)" to something large, like "1000000". eclipse cdt will try to format c/c++ code that you add as you type. however, its default formats are not a good match to mozilla's style rules. 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. the "active profile" field should then automatically change to "mozilla". depending on the area of the code that you work on, you may need to tweak this configuration using the "edit" button. (note that the format settings under "general > editors > text editors" have ...
...And 5 more matches
Localizing with Koala
"koala" in the templates list. choose a name for your project (e.g. l10n.kpf). choose the directory in which the project will live in (e.g. c:\mozilla\l10n on windows, /home/user/mozilla/l10n on linux or /users/user/mozilla/l10n on mac os x). due to a bug in koala (bug 21930), it is recommended that you don't choose a path that contains spaces (like c:\documents and settings\user\...). click "open" to create the project. koala will check for mercurial. make sure that your mercurial installation is in your system's $path. setup wizard will open. configure the application choose "firefox" as the application. version: 3.6. appname: browser. included locale: en-us (this is the original locale you're translating from). leave location empty for now. check the "mercurial" checkbox. note tha...
...ox\3.6". url: http://hg.mozilla.org/releases/mozilla-1.9.2. branch: default. revision: leave empty. click "ok". koala will now try to clone the en-us source repository from http://hg.mozilla.org/releases/mozilla-1.9.2. it's almost 1 gb worth of download, so it may take a while. click "ok". on windows, if koala doesn't clone the repositories, you'll need to do it manually. ...
...fills in when you check the "mercurial" checkbox (e.g. "c:\mozilla\l10n\locale\x-testing\3.6" if you enabled mercurial (recommended), koala will ask you if you wish to clone the remote repository. click "ok" (even if you're creating a new localization and there is no remote repository). existing localizations: if koala fails to clone the remote repository, you will need to do it manually. just open the console and issue the following commands: c:\users\stas> cd c:\mozilla\l10n\locale\x-testing c:\mozilla\l10n\locale\x-testing> rmdir 3.6 c:\mozilla\l10n\locale\x-testing> hg clone http://hg.mozilla.org/releases/l10n-mozilla-1.9.2/x-testing 3.6 new localizations: if you have the bitbucket repository already set up by l10n-drivers, the steps are the same as above. just hg clone from the right...
...And 5 more matches
Places utilities for JavaScript
orbookmark(int aboomarkid); array string geturlandpostdataforkeyword(string akeyword); string getitemdescription(int aitemid); nsinavhistoryresultnode getmostrecentbookmarkforuri(nsiuri auri); nsinavhistoryresultnode getmostrecentfolderforfeeduri(nsiuri auri); nsinavhistoryresultnode geturlsforcontainernode(nsinavhistoryresultnode anode); void opencontainernodeintabs(nsinavhistoryresultnode anode, nsidomevent aevent); void openurinodesintabs(array nsinavhistoryresultnode anodes, nsidomevent aevent); void createmenuitemfornode(nsinavhistoryresultnode anode, acontainersmap); constants mimetypes type_x_moz_place_container type_x_moz_place_separator: "text/x-moz-place-separator", type_x_moz_place: "text/x-moz-plac...
...ed or pasted at copy the drag action was copy, so don't move folders or links. return type returns an object implementing nsitransaction that can perform the move/insert. getfoldercontents() getfoldercontents(afolderid, aexcludeitems, aexpandqueries) generates a nsinavhistoryresult for the contents of a folder. parameters folderid the folder to open [optional] excludeitems true to hide all items (individual bookmarks). this is used on the left places pane so you just get a folder hierarchy. [optional] expandqueries true to make query items expand as new containers. for managing,you want this to be false, for menus and such, you want this to be true. return type returns a nsinavhistoryresult containing the contents of the folder. the r...
... to hide all items (individual bookmarks). this is used on the left places pane so you just get a folder hierarchy. [optional] expandqueries true to make query items expand as new containers. for managing,you want this to be false, for menus and such, you want this to be true. return type returns a nsinavhistoryresult containing the contents of the folder. the result.root is guaranteed to be open. bookmark dialog methods to show the bookmarkproperties dialog in its various modes. the showminimaladd methods open the dialog by its alternative uri. thus they persist the dialog dimensions separately from the showadd methods. note these variants also do not return the dialog "performed" state since they may not open the dialog modally. showaddbookmarkui() shows the "add bookmark" dialog. ...
...And 5 more matches
Observer Notifications
tegorymanager to receive this notification. prior to firefox 3.5, this was available to observers observing the app-startup/xpcom-startup notification. final-ui-startup triggered just before the first window for the application is displayed. sessionstore-windows-restored sent by the session restore process to indicate that all initial browser windows have opened. note that while the window are open and the chrome loaded the tabs in the windows may still be being restored after this notification. note: this notification is specific to firefox and seamonkey 2.0 applications application shutdown these are the topics that you can observe on shutdown, in order of appearance. topic description quit-application-requested...
... topic description browser:purge-session-history sent when the sanitizer runs to purge all history and other information. browser:purge-domain-data sent after domain-specific history and other information have been purged. the data value is a string form of the domain. browser-lastwindow-close-requested sent when the browser wishes to close the last open browser window. when this is sent, it is possible that other windows may still be open, such as the download manager or preferences. the data value is an nsisupportsprbool. recipients may set this to true to abort the close. browser-lastwindow-close-granted sent when all interested parties have responded to the browser-lastwindow-close-requested notification and none of them requested...
...ows for details about how the window hierarchy works. extensions that cache information about windows may wish to observe this so they can release information when the window is destroyed. the window id can be obtained from subject.queryinterface(components.interfaces.nsisupportspruint64).data toplevel-window-ready nsiwindowwatcher called just after a new top level window has been opened and is ready, but has not yet loaded a document. xul-window-destroyed called just before a xul window is destroyed. xul-window-registered nsiappwindow called just after a top level xul window is registered with the window mediator service. xul-window-visible nsiappwindow called just after a xul window is made visible. browsing-context-disca...
...And 5 more matches
nsIMessenger
nents.classes["@mozilla.org/messenger;1"] .createinstance(components.interfaces.nsimessenger); in thunderbird, a global nsimessenger object is defined as messenger via the createmessenger function in mailwindow.js. ...
... getredotransactiontype(); void undo(in nsimsgwindow msgwindow); void redo(in nsimsgwindow msgwindow); void sendunsentmessages(in nsimsgidentity aidentity, in nsimsgwindow amsgwindow); void setdocumentcharset(in acstring characterset); void saveas(in acstring auri, in boolean aasfile, in nsimsgidentity aidentity, in astring amsgfilename); void openattachment(in acstring contenttpe, in acstring url, in acstring displayname, in acstring messageuri, in boolean isexternalattachment); void saveattachment(in acstring contenttpe, in acstring url, in acstring displayname, in acstring messageuri, in boolean isexternalattachment); void saveallattachments(in unsigned long count, [array, size_is(count)] in string contenttypearray, [ar...
... in nsimsgwindow amsgwindow); parameters awin the window to set as the window for the messaging session. if this window contains a messagepane element (i think this may mean a xul:browser element with its id set to "messagepane"?), then the nsidocshell will be used for future nsimessenger operations. if there is no messagepane element, then the root xul nsidocshell will be used (so that openurl() will still work). if null is passed in then observers are removed in preparation for shutdown. amsgwindow the nsimsgwindow with the transation manager to be used. openurl() opens a url in the current window (set by setwindow()) and adds it to the current history. void openurl(in acstring aurl); parameters aurl the url to open. loadurl() load a custom message by url. similar t...
...And 5 more matches
nsIWindowMediator
inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) the two most common uses of nsiwindowmediator are, enumerating all windows of a given type and getting the most recent / any window of a given type. ...
...ndow to bottom. zlevelbelow 3 place window below some window. methods addlistener() register a listener for window status changes. void addlistener( in nsiwindowmediatorlistener alistener ); parameters alistener the listener to register. example: of window listener object and how to register then unregister. ...
...ow 3 place window below some window. methods addlistener() register a listener for window status changes. void addlistener( in nsiwindowmediatorlistener alistener ); parameters alistener the listener to register. example: of window listener object and how to register then unregister. this example below waits for listens to when a window opens, and then after that window opens it adds event listener to listen to when the window completes loading, after that it fires a function. important: this will attach the functionality to future opened windows, so if you copy paste this code to scratchpad, then after running this script, you need to open a new window by pressing ctrl + n and then in the new window, selecting tabs will fire the alert. var {cc: classes, ci: interfa...
...And 5 more matches
IDBDatabase: abort event - Web APIs
the abort event is fired on idbdatabase when a transaction is aborted and bubbles up to the connection object. bubbles yes cancelable no interface event event handler property onabort examples this example opens a database (creating the database if it does not exist), then opens a transaction, adds a listener to the abort event, then aborts the transaction to trigger the event. ...
...en a transaction is aborted and bubbles up to the connection object. bubbles yes cancelable no interface event event handler property onabort examples this example opens a database (creating the database if it does not exist), then opens a transaction, adds a listener to the abort event, then aborts the transaction to trigger the event. ...
...d and bubbles up to the connection object. bubbles yes cancelable no interface event event handler property onabort examples this example opens a database (creating the database if it does not exist), then opens a transaction, adds a listener to the abort event, then aborts the transaction to trigger the event. ...
...And 5 more matches
IDBDatabase: error event - Web APIs
the error event is fired on idbdatabase when a request returns an error and the event bubbles up to the connection object. ...
... an error and the event bubbles up to the connection object. ...
...bbles up to the connection object. ...
...And 5 more matches
IDBDatabase.transaction() - Web APIs
transaction(['my-store-name']); var transaction = db.transaction('my-store-name'); if you need to access all object stores in the database, you can use the property idbdatabase.objectstorenames: var transaction = db.transaction(db.objectstorenames); passing an empty array will throw an exception. mode optional the types of access that can be performed in the transaction. ...
...; passing an empty array will throw an exception. mode optional the types of access that can be performed in the transaction. transactions are opened in one of three modes: readonly, readwrite and readwriteflush (non-standard, firefox-only.) versionchange mode can't be specified here. if you don't provide the parameter, the default access mode is readonly. to avoid slowing things down, don't open a readwrite transaction unless you actually need to write into the database. ...
...be performed in the transaction. transactions are opened in one of three modes: readonly, readwrite and readwriteflush (non-standard, firefox-only.) versionchange mode can't be specified here. if you don't provide the parameter, the default access mode is readonly. to avoid slowing things down, don't open a readwrite transaction unless you actually need to write into the database. if you need to open the object store in readwrite mode to change data, you would use the following: var transaction = db.transaction('my-store-name', "readwrite"); as of firefox 40, indexeddb transactions have relaxed durability guarantees to increase performance (see bug 1112702), which is the same behaviour as other indexeddb-supporting browsers. previously in a readwrite transaction idbtransaction.oncomplete w...
...And 5 more matches
IDBDatabase: versionchange event - Web APIs
the versionchange event is fired when a database structure change (idbopendbrequest.onupgradeneeded event or idbfactory.deletedatabase) was requested. ...
... the versionchange event is fired when a database structure change (idbopendbrequest.onupgradeneeded event or idbfactory.deletedatabase) was requested. ...
... the versionchange event is fired when a database structure change (idbopendbrequest.onupgradeneeded event or idbfactory.deletedatabase) was requested. ...
...And 5 more matches
IDBRequest: error event - Web APIs
the error handler is executed when an error caused a request to fail. ...
... handler is executed when an error caused a request to fail. ...
...an error caused a request to fail. ...
...And 5 more matches
IDBRequest.transaction - Web APIs
the transaction read-only property of the idbrequest interface returns the transaction for the request, that is, the transaction the request is being made inside. this property can be null for requests not made within transactions, such as for requests returned from idbfactory.open — in this case you're just connecting to a database, so there is no transaction to return. if a version upgrade is needed when opening a database then during the upgradeneeded event handler the transaction property will be an idbtransaction with mode equal to "versionchange", and can be used to access existing object stores and indexes, or abort the the upgrade. following the upgrade, the transaction ​property will again be null. note: this feature is available in web workers. syntax var mytransaction = r...
...dbobjectstore (made available as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store in another request. the source of the requests is logged to the developer console — both originate from the same transaction. ...
... db.createobjectstore('books'); } if (event.oldversion < 2) { ...
...And 5 more matches
IDBTransaction: error event - Web APIs
the error event is fired on idbtransaction when a request returns an error and the event bubbles up to the transaction object. ...
...an error and the event bubbles up to the transaction object. ...
...bles up to the transaction object. ...
...And 5 more matches
Using Service Workers - Web APIs
p — making everything available for use offline. when the oninstall handler completes, the service worker is considered installed. next is activation. when the service worker is installed, it then receives an activate event. the primary use of onactivate is for cleanup of resources used in previous versions of a service worker script. the service worker will now control pages, but only those opened after the register() is successful. i.e. a document starts life with or without a service worker and maintains that for its lifetime. so documents will have to be reloaded to actually be controlled. the below graphic shows a summary of the available service worker events: promises promises are a great mechanism for running async operations, with success dependant on one another. this is...
...e. (see our promises test example for the source code, or look at it running live.) note: a real service worker implementation would use caching and onfetch rather than the xmlhttprequest api. those features are not used here so that you can focus on understanding promises. ...
...compatibility section for more information.) if you want to use this now, you could consider using a polyfill like the one available in google's topeka demo, or perhaps store your assets in indexeddb. ...
...And 5 more matches
window.postMessage() - Web APIs
lly, scripts on different pages are allowed to access each other if and only if the pages they originate from share the same protocol, port number, and host (also known as the "same-origin policy"). window.postmessage() provides a controlled mechanism to securely circumvent this restriction (if used properly). broadly, one window may obtain a reference to another (e.g., via targetwindow = window.opener), and then dispatch a messageevent on it with targetwindow.postmessage(). the receiving window is then free to handle this event as needed. the arguments passed to window.postmessage() (i.e., the “message”) are exposed to the receiving window through the event object. syntax targetwindow.postmessage(message, targetorigin, [transfer]); targetwindow a reference to the window that will r...
...e receiving window is then free to handle this event as needed. the arguments passed to window.postmessage() (i.e., the “message”) are exposed to the receiving window through the event object. syntax targetwindow.postmessage(message, targetorigin, [transfer]); targetwindow a reference to the window that will receive the message. methods for obtaining such a reference include: window.open (to spawn a new window and then reference it), window.opener (to reference the window that spawned this one), htmliframeelement.contentwindow (to reference an embedded <iframe> from its parent window), window.parent (to reference the parent window from within an embedded <iframe>), or window.frames + an index value (named or numeric). message data to be sent to the other window. the...
...y source properties. any window (including, for example, http://evil.example.com) can send a message to any other window, and you have no guarantees that an unknown sender will not send malicious messages. having verified identity, however, you still should always verify the syntax of the received message. otherwise, a security hole in the site you trusted to send only trusted messages could then open a cross-site scripting hole in your site. always specify an exact target origin, not *, when you use postmessage to send data to other windows. a malicious site can change the location of the window without your knowledge, and therefore it can intercept the data sent using postmessage. secure shared memory messaging if postmessage() throws when used with sharedarraybuffer objects, you might ne...
...And 5 more matches
ARIA Test Cases - Accessibility
or copy-paste: http://oaa-accessibility.org/examples/ for each example we test the "expected" results with assistive technologies, for each browser that at supports wai-aria in. where a failure occurs we will test the browser for api incorrectness, using tools such as msaa inspect. ...
... the database so that its status can be reviewed. widget test cases alert simple alert complex alert real alert example with aria-required and aria-invalid -- type in a email address without an at sign to test the alert expected at behavior: a screen reader or screen magnifier must speak an alert when it becomes visible. a screen magnifier should move the current view to the alert or open a new panel with the alert information optional, but desired: if there are widgets within the alert, their role and any keyboard mnemonic (accesskey) should be spoken. for example, "options, button, alt+shift+t" should be spoken if there is an options button in the alert with alt+shift+t as an accesskey. markup used: role="alert" notes: results: at firefox ie opera ...
...u button dojo nightly build expected at behavior: screen readers should indicate that this button has an associated menu. screen magnifiers should give indication (if this is not done visually anyway). when the button is pressed, the menu should be tracked like any other menu. when closing the menu, this should be indicated, and focus should be repeated for the menu button the menu was opened from, or the new focus location if the activated menu item results in that. markup used: notes: results: at firefox ie opera safari jaws 9 - - n/a n/a jaws 10 pass in non-v-pc-mode. buttons are indicated as menu buttons. menus are tracked, closing menus also results in correct focus tracking. partial fail in v-pc-mode. the fact that a b...
...And 5 more matches
content - CSS: Cascading Style Sheets
Web › CSS › content
normal computes to none for the ::before and ::after pseudo-elements.
... normal computes to none for the ::before and ::after pseudo-elements. <string> specifies the "alt text" for the e...
...r> values */ content: counter(chapter_counter); content: counters(section_counter, "."); /* attr() value linked to the html attribute value */ content: attr(value string); /* language- and position-dependent keywords */ content: open-quote; content: close-quote; content: no-open-quote; content: no-close-quote; /* except for normal and none, several values can be used simultaneously */ content: open-quote chapter_counter; /* global values */ content: inherit; content: initial; content: unset; syntax values none the pseudo-element is not generated. normal computes to none for the ::before and ::after pseudo-elements. <string> specifies the "alt text" for the element. this value can be any number of text characters. non-latin characters must be encoded using their unicode escape se...
...And 5 more matches
ui/button/toggle - Archive of obsolete content
togglebutton({ id: "my-button", label: "my button", icon: { "16": "./firefox-16.png", "32": "./firefox-32.png" }, onclick: function(state) { console.log("you clicked '" + state.label + "'"); } }); button.click(); state() get or set the button's state for a specific window or tab. by default, a button's properties are global, meaning that they are the same across all open windows and tabs, and that if you update these properties, then they are updated across all windows and tabs. but sometimes you want a button attached to one window (or tab) to have a different state to a button attached to a different window (or tab). that's what state() is for. to set a button's properties for a specific window or tab, call state(), passing it the window or tab you want the pr...
... }); to fetch the button state for a specific window or tab, call state(), passing it the window or tab you're interested in, and it will return a state object containing the id, label, icon, and disabled properties for the button associated with that window or tab. again. you can use the strings "window" or "tab" as shortcuts. ...
...a button with a default label opens a new tab sets a new label only for the new tab logs the result of accessing the global label, the window-specific label, and each of the 2 tab-specific labels var { togglebutton } = require('sdk/ui/button/toggle'); var tabs = require("sdk/tabs"); var button = togglebutton({ id: "my-button", label: "default label", icon: "./firefox-16.png" }); tabs.open({ url: "https://mozilla.org/", onopen: onnewtab }); function onnewtab(tab) { // modify the label only for the new tab button.state(tab, { "label" : "tab-specific label" }); // access the global label -> "default label" console.log(button.label); // access the window's label -> "default label" console.log(button.state("window").label); // access the first tab's label ->...
...And 4 more matches
Sidebar - Archive of obsolete content
this page provides several snippets demonstrating how to work with the firefox sidebar. see the creating a firefox sidebar tutorial for step-by-step instructions on creating a firefox sidebar extension. opening and closing the sidebar firefox provides a built-in sidebarui object function defined in browser-sidebar.js. this means that the function is available in all browser windows. you can use this function to show, hide, or toggle sidebars. // toggle the bookmarks sidebar (close it if it's open or // open it if it's currently closed) sidebarui.toggle("viewbookmarkssidebar"); // show the history sidebar, whether it's hidden or already showing sidebarui.show("viewhistorysidebar"); // hide the sidebar, if one is showing sidebarui.hide(); avoid opening the sidebar on startup. users hav...
...se it if it's open or // open it if it's currently closed) sidebarui.toggle("viewbookmarkssidebar"); // show the history sidebar, whether it's hidden or already showing sidebarui.show("viewhistorysidebar"); // hide the sidebar, if one is showing sidebarui.hide(); avoid opening the sidebar on startup. users have been known to complain about this "feature", and if two or more extensions try to open their sidebars on startup, the user will see a flurry of sidebars opening and closing with which ever extension going last "winning". web panels sidebar content such as web pages can be safely loaded as sidebar in the "viewwebpanelssidebar". bookmarks with "load this bookmark in sidebar" checked in the properties open in the "viewwebpanelssidebar". a web page can use window.sidebar to create ...
...user will see a flurry of sidebars opening and closing with which ever extension going last "winning". web panels sidebar content such as web pages can be safely loaded as sidebar in the "viewwebpanelssidebar". bookmarks with "load this bookmark in sidebar" checked in the properties open in the "viewwebpanelssidebar". a web page can use window.sidebar to create bookmark with that property. to open a page in the "viewwebpanelssidebar" from chrome code (browser/addon/extension) such as from menuitem, it can call: openwebpanel(atitle, auri); accessing the sidebar from a browser.xul script the sidebar content is always in a document separate from the main browser document (the sidebar is actually implemented as a xul browser element). this means you can't directly access the sidebar content...
...And 4 more matches
Mozilla Application Framework in Detail - Archive of obsolete content
han ever before. gecko is the first browser engine ever to deliver the full web standards support that developers have been calling for. this robust standards support for the first time makes it possible to implement powerful web applications with rich user interfaces without using proprietary or platform dependent code. because gecko has a cross-platform architecture, is easily embeddable and is open source, it and the rich web applications it supports will be usable on any supported platform or device. this will dramatically reduce the cost and complexity of developing and distributing rich web applications and full-functionality browsing devices that run them. by meeting the needs of developers and companies who are working to provide consumers with new interactive applications, solutions a...
.... as the heart of a browser, the browser engine software component is responsible for interpreting and rendering the graphics, text and script on the web. with gecko, mozilla has cleanly separated the browser engine component from the rest of the client software so it can be embedded and used to interpret, display and run web content, applications and services on any computing platform or device. open source and freely available, gecko is small in size and modular and achieves rendering speed superior to all other browser engines - which makes it perfect for embedding into both desktop applications such as browsers and new devices such as browsing appliances and set top boxes. supporting gecko technologies provide a complete set of resources for efficient development, including full support of...
...a major advance for developers. with gecko, developers seeking a streamlined way to create and distribute web-based services across multiple platforms and devices can write once to w3c standards and their content and web applications will be accessible from across computing platforms and devices. gecko is based on contributions from mozilla.org, the organization chartered with managing netscape's open source initiative among thousands of internet developers and participating vendors such as netscape. the gecko browser engine offers several key benefits including: size: gecko has been designed to be lean and modular, bringing full-functionality browsing to a variety of new consumer devices. because it is small, gecko can be embedded on devices with limited footprints and it minimizes downloa...
...And 4 more matches
Reading from Files - Archive of obsolete content
the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes). there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. reading data from a file involves getting a reference to a file and then creating an input stream to read from it. an input stream provides a means of reading bytes, strings or other values from the file. while there is only one method to create an input stream, it provides a number of options to contr...
...ile. using the former will cause characters in the stream to be interpreted with a particular character encoding. in addition, lines may be read by reading the file up until a linefeed character is detected. a binary stream would be used to read bytes or numbers encoded within the file. to create an input stream, first get a reference to a nsifile, and then use nsiscriptableio.newinputstream() to open a stream for reading from it. to learn more about file objects, see files and streams. var file = io.getfile("home", "sample.txt"); var stream = io.newinputstream(file, "text"); this example first retrieves a file object using nsiscriptableio.getfile(). in this case, the file 'sample.txt' within the user's home directory is retrieved. next, nsiscriptableio.newinputstream() is called to create a ...
...ts, see files and streams. var file = io.getfile("home", "sample.txt"); var stream = io.newinputstream(file, "text"); this example first retrieves a file object using nsiscriptableio.getfile(). in this case, the file 'sample.txt' within the user's home directory is retrieved. next, nsiscriptableio.newinputstream() is called to create a new input stream for reading from the file. this method will open the file and return a stream. naturally, if the file does not exist, an error will occur. you may wish to use nsifile.exists() to check if the file exists before opening it. in fact, it is a good idea to enclose file reading and writing operations within a try-catch block to capture any errors that might occur during the process. see file errors for a list of errors that might occur. the newinput...
...And 4 more matches
ContextMenus - Archive of obsolete content
context menus a context menu is a menu where the items on the menu are specific to the context in which the menu was opened. a typical usage is for the user to right-click on an element to display a menu of commands pertaining to what was clicked on. context menu events there are various ways in which a context menu can be opened. the most common is by clicking on an element with the right mouse button. on macintosh systems with only one mouse button, a context menu may be opened by either holding down the mouse button or by pressing the control key and clicking the mouse button. on windows, the context menu can also be opened by pressing the menu key on the keyboard (the key on many keyboards next to control with a menu image) or by pressing shift+f10. you should not assume that a ...
...systems with only one mouse button, a context menu may be opened by either holding down the mouse button or by pressing the control key and clicking the mouse button. on windows, the context menu can also be opened by pressing the menu key on the keyboard (the key on many keyboards next to control with a menu image) or by pressing shift+f10. you should not assume that a user has used the mouse to open a context menu. when using the mouse to open a context menu, the context is the element that was clicked. when using the keyboard, the context is the element in the window that is currently focused. although there are several ways to open a context menu, a single event may be used to listen for any of these situations; the 'contextmenu' event is fired in any case. <hbox id="container" align="c...
...g the keyboard, the context is the element in the window that is currently focused. although there are several ways to open a context menu, a single event may be used to listen for any of these situations; the 'contextmenu' event is fired in any case. <hbox id="container" align="center" oncontextmenu="..."> <label value="name:"/> <textbox id="name"/> </hbox> in this example, an attempt to open a context menu anywhere inside the hbox will call the event listener attached using the oncontextmenu attribute. as textboxes have a context menu built in, the event will fire before an attempt to open the context menu. however, the event will also fire when the label is right-clicked for instance, so the event handler should check to make sure that the target of the contextmenu event is what is ...
...And 4 more matches
Popup Guide - Archive of obsolete content
ted. a popup is a menu or floating window without a title bar, borders or other window decorations that may extend outside of the edge of the main window. popup types xul provides a number of different types of elements which may be used to create popup menus or other types of popup widgets, which vary based on the manner in which they are attached to an element and the manner in which they are opened. a brief overview of each type is listed here; more details for each type can be found by following the corresponding links. a popup is not created as a separate window or file, instead it is included inside another window or dialog. in this guide, the term 'popup' refers to all types of popups, whereas the term 'menu' refers to a specific type of popup. specifically, the first two types in th...
...ands. the user may select a command and the menu disappears again. a menu is created using the menupopup element. it displays items in a list, can display submenus, and provides keyboard navigation between the items. a menu should only contain menu related elements. context menus a context menu is like a regular menu except that the commands it contains apply to what the user had clicked on to open the context menu. often, depending on what was clicked on, certain commands may be hidden if not applicable to that element. panels a panel can contain any type of content. it is useful when you wish to display some controls temporarily over the existing ui. for example, a popup search field could be used to allow searching and will disappear when a search term has been entered. a panel is cre...
...over a ui control, a tooltip provides a small box with descriptive help about that control. when the mouse is moved away from the control, the tooltip automatically disappears. a tooltip can be created by setting the tooltiptext attribute on an element or by using the tooltip element. working with popups the following additional information is available about manipulating menus and popups. opening a menu or popup most menus and popups are opened automatically when they are associated with an element. to open a popup using script use the openpopup method or the openpopupatscreen method. for detailed information about how to open a popup see opening a popup or opening a menu. closing a menu or popup for information about closing a popup, see closing a popup or closing a menu. ho...
...And 4 more matches
textbox (Toolkit autocomplete) - Archive of obsolete content
key, autocompletepopup, autocompletesearch, autocompletesearchparam, completedefaultindex, completeselectedindex,crop, disableautocomplete, disabled, disablekeynavigation, enablehistory, focused, forcecomplete, highlightnonmatches, ignoreblurwhilesearching, inputtooltiptext, label, maxlength, maxrows, minresultsforpopup, nomatch, onchange, oninput, onsearchcomplete, ontextentered, ontextreverted, open, readonly,showcommentcolumn, showimagecolumn, size, tabindex, tabscrolling, timeout, type, value properties accessibletype, completedefaultindex, controller, crop, disableautocomplete, disablekeynavigation, disabled, editable, focused, forcecomplete, highlightnonmatches, ignoreblurwhilesearching, inputfield, label, maxlength, maxrows, minresultsforpopup, open, popup, popupopen, searchco...
...lect more specific items. this feature may be disabled by setting this attribute to true. note: for seamonkey 2.0 and all versions of thunderbird prior to 3.0 you also need to provide the disablehistory attribute. enablehistory new in thunderbird 1requires seamonkey 2.0 type: boolean if true, an arrow button will appear on the end of the textbox which, when pressed, will open a dropdown menu of all available results. focused type: boolean this attribute is true if the element is focused. forcecomplete new in thunderbird 3requires seamonkey 2.0 type: boolean if true, the textbox will be filled in with the best match when it loses the focus. if false, it will only be filled in when the user selects an item. highlightnonmatches ...
...of rows to show in the results list at a time. a scrollbar will appear so the user can scroll through the remaining items. minresultsforpopup new in thunderbird 3requires seamonkey 2.0 type: integer the minimum number of results that must be returned for the popup to be displayed. the default value is 1. new in thunderbird 3requires seamonkey 2.0 a zero value will always open the popup. this can be used to display additional items that are not autocomplete results. nomatch type: boolean this attribute will be set to true if the last search resulted in no matches. overview an onchange attribute is an event listener to the object for the event change. a change event is fired in different ways for different xul input elements as listed below: onchange ...
...And 4 more matches
Code Samples - Archive of obsolete content
stom toolbar button tutorial. the samples here are designed to work in firefox, thunderbird, sunbird and seamonkey, except where the text says otherwise. launch a file on your computer to launch a file on your computer, use code like this. change the first line to specify the file that you want to launch. you can launch an executable file or some other file that your operating system knows how to open. ...
...knows how to open. note: on operating systems that use backslash characters, double each backslash character. on operating systems that use forward-slash characters, specify the file in the normal way. const path = "c:\\windows\\charmap.exe" var file = components .classes["@mozilla.org/file/local;1"] .createinstance(components.interfaces.nsilocalfile) file.initwithpath(path) file.launch() open a web page if your button is in firefox or seamonkey, use code like this to open a web page. change the first line to specify the page that you want to open: const url = "http://www.mozilla.org/" document .getelementbyid("content") .webnavigation .loaduri(url, 0, null, null, null) if your button is in thunderbird or sunbird, use code like this to open a web page. change the first line to ...
...irefox or seamonkey, use code like this to open a web page. change the first line to specify the page that you want to open: const url = "http://www.mozilla.org/" document .getelementbyid("content") .webnavigation .loaduri(url, 0, null, null, null) if your button is in thunderbird or sunbird, use code like this to open a web page. ...
...And 4 more matches
Windows and menus in XULRunner - Archive of obsolete content
ystem "chrome://basicapp/locale/main.dtd"> <window id="main" title="&title;" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script src="main.js"/> <toolbox> <menubar id="menubar"> <menu id="file-menu" label="&file;"> <menupopup id="file-popup"> <menuitem label="&file.new;" oncommand="dofilenew();"/> <menuitem label="&file.open;" oncommand="dofileopen();"/> <menuitem label="&file.save;" oncommand="dofilesave();"/> <menuseparator/> <menuitem label="&file.exit;" oncommand="dofileexit();"/> </menupopup> </menu> <menu id="edit-menu" label="&edit;"> <menupopup id="edit-popup"> <menuitem label="&edit.undo;" oncommand="doeditundo();"/> <menuitem labe...
...</window> notice that i used entity-references for the menu and toolbar labels. the oncommand event is hooked up to javascript, just like an onclick in html. the javascript is contained in the main.js file. xul has a way to centralize co...
...</window> notice that i used entity-references for the menu and toolbar labels. the oncommand event is hooked up to javascript, just like an onclick in html. the javascript is contained in the main.js file. xul has a way to centralize commands and event ha...
...And 4 more matches
What’s in the head? Metadata in HTML - Learn web development
r title-example.html page. to do this, either copy and paste the code out of the page and into a new text file in your code editor, then save it in a sensible place. press the "raw" button on the github page, which causes the raw code to appear (possibly in a new browser tab). next, choose your browser's file > save page as... menu and choose a sensible place to save the file. now open the file in your browser. you should see something like this: it should now be completely obvious where the <h1> content appears, and where the <title> content appears! you should also try opening the code up in your code editor, editing the contents of these elements, then refreshing the page in your browser. have some fun with it. the <title> element contents are also used in other ways.
...es. let's go through an exercise to explore this go to the front page of the mozilla developer network. view the page's source (right/ctrl + click on the page, choose view page source from the context menu.) find the description meta tag. ...
... because spammers were just filling the keyword list with hundreds of keywords, biasing results. other types of metadata as you travel around the web, you'll find other types of metadata, too. a lot of the features you'll see on websites are proprietary creations, designed to provide certain sites (such as social networking sites) with specific pieces of information they can use. ...
...And 4 more matches
Deployment and next steps - Learn web development
e useful for allowing you to learn what it has to offer and help you make your own decision. if you are not interested at all in typescript, you can skip to the next chapter, where we will look at different options for deploying our svelte applications, further resources, and more. code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app state, run cd mdn-svelte-tutorial/08-next-steps or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/08-next-steps remember to run npm install && npm run dev to start your app in development mode. compiling our app so far we've been running our app in development mode with npm run dev. as we saw earlier, ...
...ur app and run npx vercel; the first time you do it, you'll be prompted to enter your email address, and follow the steps in the email sent to that address, for security purposes. ...
...you want to deploy to? opensas ? link to existing project? [y/n] n ? what’s your project’s name? mdn-svelte-tutorial ? in which directory is your code located? ./ auto-detected project settings (svelte): - build command: `npm run build` or `rollup -c` - output directory: public - development command: sirv public --single --dev --port $port ? want to override the settings? ...
...And 4 more matches
Working with Svelte stores - Learn web development
independent from the rest — it is not a parent or child of any other — so the messages don't fit into the component hierarchy. we will also see how to develop our own custom store to persist the todo information to web storage, allowing our todos to persist over page reloads. code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app state, run cd mdn-svelte-tutorial/06-stores or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/06-stores remember to run npm install && npm run dev to start your app in development mode. repl to code along with us using the repl, start at https://svelte.dev/repl/d1fa84a5a4494366b179c87395940039?version...
...us manage our todos quite easily, but is rather useless if we always get the same list of hardcoded todos when we reload it. to make it truly useful, we have to find out how to persist our todos. first we need some way for our todos component to give back the updated todos to its parent. we could emit an updated event with the list of todos, but it's easier just to bind the todos variable. let's open app.svelte and try it. first of all, add the following line below your todos array: $: console.log('todos', todos) next, update your todos component call as follows: <todos bind:todos /> remember: <todos bind:todos /> is just a shortcut for <todos bind:todos={todos} />. go back to your app, try adding some todos, then go your developer tools web console. you'll se...
...allow us to use it just like any other store, and abstract away the persistence mechanism. we could create a store that syncs its content to web storage, and later develop another one that syncs against a web service. switching between them would be trivial and we wouldn't have to touch app.svelte at all. saving our todos so let's start by using a regular writable store to save our todos. open the file stores.js and add the following store below the existing one: export const todos = writable([]) that was easy. now we need to import the store and use it in app.svelte. just remember that to access the todos now we have to use the $todos reactive $store syntax. update your app.svelte file like this: <script> import todos from './components/todos.svelte' import alert fr...
...And 4 more matches
Extending a Protocol
l. simple message passing. working with mozpromises and js promises. managing child actors with reference counting. visually, it's going to look something like this (except for the operating system bit, which we are not actually going to do - just to illustrate what we could do): let's start by implementing the webidl above. ...
...ch we are not actually going to do - just to illustrate what we could do): let's start by implementing the webidl above. implementing the navigator.echo() in your favorite editor, open dom/webidl/navigator.webidl at the end of the file, add: partial interface navigator { [throws] promise<domstring> echo(domstring astring); }; now we need to implement the echo() method in c++, so open up ./dom/base/navigator.h and let's add the method definition, so under public:: already_addrefed<promise> echo(const nsastring& astring, errorresult& arv); we use nsastring& as the domstring comes in from js as utf-16. this will matter later, as we will need to convert it to utf-8 (using nscstring) to send it to the parent process. now let's implement the method in ./dom/base/navigator.
... this is called when an instance is deleted. it lets you do cleanup if needed. ok, if we now try to compile this (./mach build), it will say: |manager| declaration in protocol `pecho' does not match any |manages| declaration in protocol `pwindowglobal' that's good! it means the syntax is correct, and now we need to pwindowglobal.ipdl to manage our pecho protocol. updating pwindowglobal.ipdl open up ./dom/ipc/pwindowglobal.ipdl. we need to add the following things: at the top of the file: include protocol pecho; after "manager pbrowser or pinprocess;", add: manages pecho; finally, under parent: add async pecho(); - this is the "constructor" part we talked about before, which will allow us to eventually send messages. so roughly, it looks like this (things in bold is what we ...
...And 4 more matches
CustomizableUI.jsm
m node is unregistered. aarea is the area for which a node was unregistered, anode the dom node which was unregistered, and areason indicates whether the area as a whole was unregistered (reason_area_unregistered), or whether a window closed (reason_window_closed). onareanoderegistered(aarea, anode) fired after an area node is first built when it is registered. this is often when the window has opened, but in the case of add-ons, could fire when the node has just been registered with customizableui after an add-on update or disable/enable sequence. onwidgetcreated(awidgetid) fired when a widget with id awidgetid has been created, but before it is added to any placements or any dom nodes have been constructed. only fired for api-based widgets. onwidgetaftercreation(awidgetid, aarea) fired...
...pi-based widgets. onwidgetdrag(awidgetid, aarea) fired both when and after customize mode drag handling system tries to determine the width and height of widget awidgetid when dragged to a different area. aarea will be the area the item is dragged to, or undefined after the measurements have been done and the node has been moved back to its 'regular' area. ...
... onwindowclosed(awindow) fired when a customizable (ie browser) window is closed. ...
...And 4 more matches
Application Translation with Mercurial
g) from https://ftp.mozilla.org/pub/mozilla.org/firefox/bundles/ the file is not small, but after initially downloading it, you only need to download the latest changes in the future. thunderbird, lightning or seamonkey: download the comm-<branch>.hg file (e.g. comm-aurora.hg) from https://ftp.mozilla.org/pub/mozilla.org/thunderbird/bundles/ in the next step, we will unpack the source code: open an input shell, e.g. by pressing the windows key and r on the keyboard or by calling the "run..." command from the windows "start" button, and then typing cmd and pressing the enter key. launch the installed mozillabuild toolset by launching it with its path, e.g. c:\mozilla\coding\buildtools\mozillabuild\start-shell-msvc2010.bat you can autocomplete the file path after typing a few characters ...
...he file system, e.g. for a windows user, it looks like c:\users\myname , depending on your windows version: cd /c/users/myname now list all the files here: ls -a if there is no file called .hgrc , create it with > .hgrc this file stores your general mercurial settings (mercurial is the tool which manages the source code and its history of changes). now go in the file system to the file and open it in your favorite text editor. windows users can use e.g. notepad++. paste the following content into the file: [ui] username = firstname lastname <mynick@example.com> merge = internal:merge [alias] qexport = export -g -r qtip qexportall = diff -r qparent [defaults] commit = -v diff = -p -u 8 qdiff = -p -u 8 qnew = -u [diff] git = 1 showfunc = 1 unified = 8 [extensions] hgext.mq = progres...
... searching for texts and text ids ("entities" or "keys"), allowing to quickly find translations for already translated texts. microsoft's terminology search allows fast lookups of localized technical terms. choosing what to translate go to the localization status page and click on the '<number> missing' label of the firefox branch on which you want to translate, e.g. fx_aurora. the page which opens has a bar holding information about how many texts (strings) have already been translated, how many there are in english and your locale and have the same text, and how many are missing in your local. the interesting part follows below as list of missing texts. the first line shows the locale for which the texts are being translated (in this example: de - german). with the second line start t...
...And 4 more matches
NSS PKCS11 Functions
pkcs #11 functions this chapter describes the core pkcs #11 functions that an application needs for communicating with cryptographic modules. in particular, these functions are used for obtaining certificates, keys, and passwords. this was converted from "chapter 7: pkcs #11 functions". back to the nss reference main page. secmod_loadusermodule secmod_unloadusermodule secmod_openuserdb secmod_closeuserdb pk11_findcertfromnickname pk11_findkeybyanycert pk11_getslotname pk11_gettokenname pk11_ishw pk11_ispresent pk11_isreadonly pk11_setpasswordfunc secmod_loadusermodule load a new pkcs #11 module based on a modulespec. syntax #include "secmod.h" extern secmodmodule *secmod_loadusermodule(char *modulespec, secmodmodule *parent, prbool recurse); parameters this function has the foll...
...meters this function has the following parameters: module is the module to be unloaded. returns the function returns one of these values: if successful, secsuccess. if unsuccessful, secfailure. description secmod_unloadusermodule detaches a module from the nss trust domain and unloads it. the module should have previously been loaded by secmod_loadusermodule. secmod_closeuserdb close an already opened user database. note: the database must be in the internal token, and must be one created with secmod_openuserdb(). once the database is closed, the slot will remain as an empty slot until it's used again with secmod_openuserdb(). syntax #include <pk11pub.h> secstatus secmod_closeuserdb(pk11slotinfo *slot) parameters this function has the following parameter: slot a pointer to a slot info st...
... internal token, and must be one created with secmod_openuserdb(). once the database is closed, the slot will remain as an empty slot until it's used again with secmod_openuserdb(). syntax #include <pk11pub.h> secstatus secmod_closeuserdb(pk11slotinfo *slot) parameters this function has the following parameter: slot a pointer to a slot info structure. this slot must a a slot created by secmod_openuserdb() at some point in the past. returns the function returns one of these values: if successful, secsuccess). if unsuccessful, secfailure. secmod_openuserdb open a new database using the softoken. ...
...And 4 more matches
Necko walkthrough
nsdocshell as an example client of the nsihttpchannel api nsdocshell::loaduri(string) create nsiuri from string nsdocshell::loaduri(nsiuri) creates 2 nsiinputstream for read response from; passes them with uri to ... ...
...he nsihttpchannel api nsdocshell::loaduri(string) create nsiuri from string nsdocshell::loaduri(nsiuri) creates 2 nsiinputstream for read response from; passes them with uri to ... ...
... string nsdocshell::loaduri(nsiuri) creates 2 nsiinputstream for read response from; passes them with uri to ... nsdocshell::internalload nsdocshell::douriload opens the nsichannel for the uri (ns_newchannel) if "http:", it will be an nsihttpchannel nsdocshell::dochannelload nsuriloader::openuri passes an nsistreamlistener pointer, 'loader' to nsuriloader::openchannel - it creates an nsdocumentopeninfo object, which implements nsistreamlistener, i.e. has onstartrequest, onstoprequest, ondataavailable, the three functions in which channel responses are received asynchronously. nshttpchannel::asyncopen called from openuri; openchannel isn't named the best, since the opening happens in the context of openuri, its calling function. this is...
...And 4 more matches
Places Developer Guide
of the items themselves. var history = cc["@mozilla.org/browser/nav-history-service;1"] .getservice(ci.nsinavhistoryservice); var query = history.getnewquery(); query.setfolders([myfolderid], 1); var result = history.executequery(query, history.getnewqueryoptions()); // the root property of a query result is an object representing the folder you specified above. var foldernode = result.root; // open the folder, and iterate over its contents. foldernode.containeropen = true; for (var i=0; i < foldernode.childcount; ++i) { var childnode = foldernode.getchild(i); // some item properties. var title = childnode.title; var id = childnode.itemid; var type = childnode.type; // some type-specific actions. if (type == ci.nsinavhistoryresultnode.result_type_uri) { var uri = childnode.uri; }...
...etchild(i); // some item properties. var title = childnode.title; var id = childnode.itemid; var type = childnode.type; // some type-specific actions. if (type == ci.nsinavhistoryresultnode.result_type_uri) { var uri = childnode.uri; } else if (type == ci.nsinavhistoryresultnode.result_type_folder) { childnode.queryinterface(ci.nsinavhistorycontainerresultnode); childnode.containeropen = true; // now you can iterate over a subfolder's children } } ther available node types are documented in the idl. searching bookmarks queries are executed through the history service. the example below shows how to search through all bookmarks, and to iterate over the results. var bookmarks = cc["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(ci.nsinavbookmarksse...
...rs.length); // specify terms to search for, matches against title, url and tags query.searchterms = "firefox"; var options = history.getnewqueryoptions(); options.querytype = options.query_type_bookmarks; var result = history.executequery(query, options); // the root property of a query result is an object representing the folder you specified above. ...
...And 4 more matches
nsIFileInputStream
in gecko 1.7 method overview void init(in nsifile file, in long ioflags, in long perm, in long behaviorflags); constants constant value description delete_on_close 1<<1 if this is set, the file will be deleted by the time the stream is closed. it may be removed before the stream is closed if it is possible to delete it and still read from it. ...
...y the time the stream is closed. it may be removed before the stream is closed if it is possible to delete it and still read from it. if open_on_read is defined, and the file was recreated after the first delete, the file will be deleted again when it is closed again. close_on_eof 1<<2 if this is set, the file will close automatically when the end of the file is reached. reopen_on_rewind 1<<3 if this is set, the file will be reopened whenever seek(0) occurs. if the file is already open and the seek occurs, it will happen naturally. ...
...r the first delete, the file will be deleted again when it is closed again. close_on_eof 1<<2 if this is set, the file will close automatically when the end of the file is reached. reopen_on_rewind 1<<3 if this is set, the file will be reopened whenever seek(0) occurs. if the file is already open and the seek occurs, it will happen naturally. ...
...And 4 more matches
nsIFilePicker
epicker;1. to create an instance, use: var filepicker = components.classes["@mozilla.org/filepicker;1"] .createinstance(components.interfaces.nsifilepicker); method overview void appendfilter(in astring title, in astring filter); void appendfilters(in long filtermask); void init(in nsidomwindow parent, in astring title, in short mode); void open(in nsifilepickershowncallback afilepickershowncallback); short show(); obsolete since gecko 57.0 attributes attribute type description addtorecentdocs boolean if true, the file is added to the operating system's "recent documents" list (if the operating system has one; nothing happens if there is no such concept on the user's platform). this attrib...
... defaultextension astring the extension for the type of files you want to work with. on some platforms, this is automatically appended to filenames the user enters, if required. specify it without a leading dot, for example "jpg". defaultstring astring the filename, including extension, that should be suggested to the user as a default. this should be set before calling open() or show(). exceptions thrown ns_error_failure if you try to read this attribute. displaydirectory nsilocalfile the directory that the file picker dialog should initially display. this should be set this before calling open() or show() to specify a starting point. file nsilocalfile the currently selected file or directory. read only. ...
... fileurl nsiuri the uri of the currently selected file or directory. read only. filterindex long the (0-based) index of the filter which is currently selected in the file picker dialog. ...
...And 4 more matches
nsIResumableChannel
netwerk/base/public/nsiresumablechannel.idlscriptable this interface is meant to be implemented by the channels that support resuming broken downloads (for example necko's html and ftp channels). ...
...ctxt, in unsigned long startpos, in nsiresumableentityid entityid); obsolete since gecko 1.8 void resumeat(in unsigned long long startpos, in acstring entityid); attributes attribute type description entityid acstring the entity id for this uri. available after onstartrequest. read only. exceptions thrown ns_error_not_resumable if this load is not resumable. ...
... resumeat(in unsigned long long startpos, in acstring entityid); attributes attribute type description entityid acstring the entity id for this uri. available after onstartrequest. read only. exceptions thrown ns_error_not_resumable if this load is not resumable. methods asyncopenat() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) open this channel, and read starting at the specified offset. the request given to the nsistreamlistener will be qiable to nsiresumableinfo. void asyncopenat( in nsistreamlistener listener, in nsisupports ctxt, in unsigned long startpos, in nsiresumableentityid entityid ); parameters listener as for asyncopen. ctxt as for asyncopen. startpos the starting offset, in bytes, to use to download.
...And 4 more matches
Address Book examples
s.interfaces.nsiabmanager); abmanager.deleteaddressbook(maillist.uri); how do i display properties dialogs to the user? in the following examples: selectedab is the uri of an address book to default the dialog to saving the card in. this may be blank if not required. aburi and card are the uri of the address book and the card contained within that address book. ...
... this may be blank if not required. aburi and card are the uri of the address book and the card contained within that address book. ...
... "", "chrome,resizable=no,titlebar,modal,centerscreen", {selectedab:selectedab}); edit contact dialog window.opendialog("chrome://messenger/content/addressbook/abeditcarddialog.xul", "", "chrome,resizable=no,modal,titlebar,centerscreen", {aburi:aburi, card:card}); new list dialog window.opendialog("chrome://messenger/content/addressbook/abmaillistdialog.xul", "", "chrome,resizable=no,titlebar,modal,centerscreen", {selectedab:selectedab}); edit list dialog window.opendialog("chrome://messenger/content/addressbook/abeditlistdialog.xul", "", "chrome,resizable=no,titlebar,modal,centerscreen", ...
...And 4 more matches
Plug-in Basics - Plugins
of a plug-in, unlike that of an application, is completely controlled by the web page that calls it. this section gives you an overview of the way that plug-ins operate in the browser. when gecko starts, it looks for plugin modules in particular places on the system. for more information about where gecko looks for plugin modules on different systems, see how gecko finds plug-ins. ...
...if you are browsing a page that has several embedded realaudio clips, for example, the browser will create as many instances of the realplayer plug-in as are needed (though of course playing several realaudio files at the same time would seldom be a good idea). when the user leaves the page or closes the window, the plug-in instance is deleted. ...
...means that they are not related to any particular plug-in instance. again, see initialization and destruction for more information about initializing and destructing. the browser calls the plug-in api function npp_new when the instance is created. multiple instances of the same plug-in can exist (a) if there are multiple embedded objects on a single page, or (b) if several browser windows are open and each displays the same data type. a plug-in instance is deleted when a user leaves the instance's page or closes its window; gecko calls the function npp_destroy to inform the plug-in that the instance is being deleted. when the last instance of a plug-in is deleted, the plug-in code is unloaded from memory. gecko calls the function np_shutdown. plug-ins consume no resources (other than dis...
...And 4 more matches
DevTools API - Firefox Developer Tools
t object that exposes different information about the tool (like its name and its icon), and a build method that will be used later-on to start an instance of this tool. the gdevtools global object provides methods to register a tool definition and to access tool instances. an instance of a tool is called a toolpanel. the toolpanel is built only when the tool is selected (not when the toolbox is opened). there is no way to "close/destroy" a toolpanel. the only way to close a toolpanel is to close its containing toolbox. all these objects implement the eventemitter interface. api gdevtools the gdevtools api can be used to register new tools, themes and handle toolboxes for different tabs and windows. to use the gdevtools api from an add-on, it can be imported with following snippet const {...
...nregister. registertheme(themedefinition) registers a new theme. parameters: themedefinition {themedefinition} - an object that contains information about the theme. unregistertheme(theme) unregisters the given theme. parameters: theme {themedefinition|string} - the theme definition object or the theme identifier. showtoolbox(target [, toolid [, hosttype [, hostoptions]]]) opens a toolbox for given target either by creating a new one or activating an existing one. parameters: target {target} - the target the toolbox will debug. toolid {string} - the tool that should be activated. if unspecified the previously active tool is shown. hosttype {string} - the position the toolbox will be placed. one of bottom, side, window, custom. see hosttype for details. hostoptions ...
...() selects the previous tool in the toolbox. return value: a promise that is fulfilled with the toolpanel object of the selected panel. highlighttool(toolid) highlights the tab for the given tool. parameters: toolid {string} - the tool to highlight. unhighlighttool(toolid) unhighlights the tab for the given tool. parameters: toolid {string} - the tool to unhighlight. opensplitconsole() opens the split console to the bottom of the toolbox. return value: a promise that is fulfilled once the console has loaded. closesplitconsole() closes the split console. togglesplitconsole() toggles the state of the split console. return value: a promise that is fulfilled once the operation has finished. switchhost(hosttype) switches the location of the...
...And 4 more matches
about:debugging - Firefox Developer Tools
the about:debugging page provides a single place from which you can attach the firefox developer tools to a number of debugging targets. at the moment it supports three main sorts of targets: restartless add-ons, tabs, and workers. opening the about:debugging page there are two ways to open about:debugging: type about:debugging in the firefox url bar. in the tools > web developer menu, click remote debugging. when about:debugging opens, on the left-hand side, you'll see a sidebar with two options and information about your remote debugging setup: setup use the setup tab to configure the connection to your remote device. this firefox provides information about temporary extensions you have loaded for debugging, extensions that are installed in firefox, the tabs that you currently...
... if your about:debugging page is different from the one displayed here, go to about:config, find and set the option devtools.aboutdebugging.new-enabled to true. setup tab connecting to a remote device firefox supports debugging over usb with android devices, using the about:debugging page. ...
...to your device. next, disable every debugging setting already activated and repeat the steps described before. your device should show a popup to authorize your computer to connect to it — accept this and then click the refresh devices button again. the device should appear. note: you do not need to install the full android studio sdk. only adb is needed. to start a debugging session, first open the page that you wish to debug and then click connect next to the device name to open a connection to it. if the connection was successful, you can now click the name of the device to switch to a tab with information about the device. the information on this page is the same as the information on the this firefox tab, but instead of displaying information for your computer, it displays the in...
...And 4 more matches
Event.composed - Web APIs
Web › API › Event › composed
capturing only composed events are also handled at host as if they were in at_target phase. you can determine the path the event will follow through the shadow root to the dom root by calling composedpath(). if this value is false, the shadow root will be the last node to be offered the event. ...
...be offered the event. examples in our composed-composed-path example (see it live), we define two trivial custom elements, <open-shadow> and <closed-shadow>, both of which take the contents of their text attribute and insert them into the element's shadow dom as the text content of a <p> element. the only difference between the two is that their shadow roots are attached with their modes set to open and closed respectively. ...
...l custom elements, <open-shadow> and <closed-shadow>, both of which take the contents of their text attribute and insert them into the element's shadow dom as the text content of a <p> element. the only difference between the two is that their shadow roots are attached with their modes set to open and closed respectively. ...
...And 4 more matches
Event.composedPath() - Web APIs
voked. this does not include nodes in shadow trees if the shadow root was created with its shadowroot.mode closed. syntax var composed = event.composedpath(); parameters none. return value an array of eventtarget objects representing the objects on which an event listener will be invoked. ...
...ener will be invoked. examples in our composed-composed-path example (see it live), we define two trivial custom elements, <open-shadow> and <closed-shadow>, both of which take the contents of their text attribute and insert them into the element's shadow dom as the text content of a <p> element. the only difference between the two is that their shadow roots are attached with their modes set to open and closed respectively. ...
...l custom elements, <open-shadow> and <closed-shadow>, both of which take the contents of their text attribute and insert them into the element's shadow dom as the text content of a <p> element. the only difference between the two is that their shadow roots are attached with their modes set to open and closed respectively. ...
...And 4 more matches
FileHandle API - Web APIs
was called idbdatabase.mozcreatefilehandle.) idbmutablefile (was previously filehandle.) lockedfile filerequest it also has connections with the file api, especially the file and blob interfaces. basic operations create a filehandle because the intent is to allow the storage of files through indexeddb, creating a filehandle instance requires an indexeddb database. var idbreq = indexeddb.open("myfilestoragedatabase"); idbreq.onsuccess = function(){ var db = this.result; var buildhandle = db.mozcreatefilehandle("test.txt", "plain/text"); buildhandle.onsuccess = function(){ var myfilehandle = this.result; console.log('handle', myfilehandle); }; }; mozcreatefilehandle() takes two arguments: a name and an optional type. both of these are just descriptive and are not u...
...es a "temporary file" that exists only while you hold the filehandle instance. if you want a file to survive a page refresh/app relaunch, you need to store the handle in a more permanent location, like the database itself. see file storage below to learn more about this. perform read and write operations to read or write within a handled file, it is required to get a lockedfile. the filehandle.open() method provides such an object which can be readonly or readwrite. any attempt to perform a write action on a readonly lockedfile object will fail. writing there are three possible writing operations on a locked file: write : it's an arbitrary writing method which starts writing in the file at the lockedfile.location byte. append : this operation always writes content at the end of the fi...
...here are three possible writing operations on a locked file: write : it's an arbitrary writing method which starts writing in the file at the lockedfile.location byte. append : this operation always writes content at the end of the file. truncate : this operation keeps the nth-first bytes of the file and removes the rest. ...
...And 4 more matches
IDBDatabase: close event - Web APIs
losed. this could happen, for example, if the underlying storage is removed or if the user clears the database in the browser's history preferences. note that it is not fired if the database connection is closed normally using idbdatabase.close(). ...
...ng storage is removed or if the user clears the database in the browser's history preferences. note that it is not fired if the database connection is closed normally using idbdatabase.close(). ...
...f the user clears the database in the browser's history preferences. note that it is not fired if the database connection is closed normally using idbdatabase.close(). ...
...And 4 more matches
IDBKeyRange - Web APIs
cts using keys or a range of keys. you can limit the range using lower and upper bounds. for example, you can iterate over all values of a key in the value range a–z. a key range can be a single value or a range with upper and lower bounds or endpoints. if the key range has both upper and lower bounds, then it is bounded; if it has no bounds, it is unbounded. a bounded key range can either be open (the endpoints are excluded) or closed (the endpoints are included). to retrieve all keys within a certain range, you can use the following code constructs: range code all keys ≥ x idbkeyrange.lowerbound(x) all keys > x idbkeyrange.lowerbound(x, true) all keys ≤ y idbkeyrange.upperbound(y) all keys < y idbkeyrange.upperbound(y, tru...
... y, true, true) all keys > x && ≤ y idbkeyrange.bound(x, y, true, false) all keys ≥ x &&< y idbkeyrange.bound(x, y, false, true) the key = z idbkeyrange.only(z) a key is in a key range if the following conditions are true: the lower value of the key range is one of the following: undefined less than key value equal to key value if loweropen is false. the upper value of the key range is one of the following: undefined greater than key value equal to key value if upperopen is false. note: this feature is available in web workers. properties idbkeyrange.lower read only lower bound of the key range. idbkeyrange.upper read only upper bound of the key range. idbkeyrange.loweropen read only returns fals...
... methods static methods idbkeyrange.bound() creates a new key range with upper and lower bounds. idbkeyrange.only() creates a new key range containing a single value. ...
...And 4 more matches
IDBRequest: success event - Web APIs
the success event is fired when an idbrequest succeeds. ...
... the success event is fired when an idbrequest succeeds. ...
... the success event is fired when an idbrequest succeeds. ...
...And 4 more matches
IDBTransaction.abort() - Web APIs
this transaction have their idbrequest.error attribute set to aborterror. note: this feature is available in web workers. syntax transaction.abort(); exceptions this method may raise a domexception of the following type: exception description invalidstateerror the transaction has already been committed or aborted. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. at the end, we simply abort any activity done under the current transaction using abort(). for a full working example, see our to-do notifications app (view example live...
...transaction on our database and add some data to an object store. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. at the end, we simply abort any activity done under the current transaction using abort(). ...
...ase and add some data to an object store. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. at the end, we simply abort any activity done under the current transaction using abort(). for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...And 4 more matches
IDBTransaction: complete event - Web APIs
the complete handler is executed when a transaction successfully completed. ...
... the complete handler is executed when a transaction successfully completed. ...
... the complete handler is executed when a transaction successfully completed. ...
...And 4 more matches
IDBTransaction.db - Web APIs
Web › API › IDBTransaction › db
the db read-only property of the idbtransaction interface returns the database connection with which this transaction is associated. note: this feature is available in web workers. syntax var mydatabase = transaction.db; value an idbdatabase object. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store. ...
...ith which this transaction is associated. note: this feature is available in web workers. syntax var mydatabase = transaction.db; value an idbdatabase object. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. at the end, we return the associated database connection using db. ...
...t, we open a read/write transaction on our database and add some data to an object store. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. at the end, we return the associated database connection using db. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...And 4 more matches
IDBTransaction.mode - Web APIs
lows any operation to be performed, including ones that delete and create object stores and indexes. this mode is for updating the version number of transactions that were started using idbdatabase.setversion(). transactions of this mode cannot run concurrently with other transactions. transactions in this mode are known as "upgrade transactions." example in the following code snippet, we open a read/write transaction on our database and add some data to an object store. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. at the end, we simply log the mode of the current transaction using mode. for a full working example, see our to-do notifications app (view example live.) // let us ope...
...tion on our database and add some data to an object store. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. at the end, we simply log the mode of the current transaction using mode. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...nt transaction using mode. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...And 4 more matches
WebGLRenderingContext.pixelStorei() - Web APIs
. see below for possible values. param a glint specifying a value to set the pname parameter to. see below for possible values. return value none. pixel storage parameters parameter name (for pname) description type default value allowed values (for param) specified in gl.pack_alignment packing of pixel data into memory glint 4 1, 2, 4, 8 opengl es 2.0 gl.unpack_alignment unpacking of pixel data from memory. glint 4 1, 2, 4, 8 opengl es 2.0 gl.unpack_flip_y_webgl flips the source data along its vertical axis if true. glboolean false true, false webgl gl.unpack_premultiply_alpha_webgl multiplies the alpha channel into the other color channels glboolean false true, fals...
...r no color space conversion. glenum gl.browser_default_webgl gl.browser_default_webgl, gl.none webgl when using a webgl 2 context, the following values are available additionally: constant description type default value allowed values (for param) specified in gl.pack_row_length number of pixels in a row. glint 0 0 to infinity opengl es 3.0 gl.pack_skip_pixels number of pixel locations skipped before the first pixel is written into memory. glint 0 0 to infinity opengl es 3.0 gl.pack_skip_rows number of rows of pixel locations skipped before the first pixel is written into memory glint 0 0 to infinity opengl es 3.0 gl.unpack_row_length number of pixels in a row. ...
..._pixels number of pixel locations skipped before the first pixel is written into memory. glint 0 0 to infinity opengl es 3.0 gl.pack_skip_rows number of rows of pixel locations skipped before the first pixel is written into memory glint 0 0 to infinity opengl es 3.0 gl.unpack_row_length number of pixels in a row. ...
...And 4 more matches
Sending and Receiving Binary Data - Web APIs
rding to responsetype, as an arraybuffer, blob, document, json, or string. this is null if the request is not complete or was not successful. this example reads an image as a binary file and creates an 8-bit unsigned integer array from the raw bytes. note that this will not decode the image and read the pixels. you will need a png decoding library for that. ...
...r = oreq.response; // note: not oreq.responsetext if (arraybuffer) { var bytearray = new uint8array(arraybuffer); for (var i = 0; i < bytearray.bytelength; i++) { // do something with each byte in the array } } }; oreq.send(null); you can also read a binary file as a blob by setting the string "blob" to the responsetype property. ...
...est(); oreq.open("get", "/myfile.png", true); oreq.responsetype = "blob"; oreq.onload = function(oevent) { var blob = oreq.response; // ... }; oreq.send(); receiving binary data in older browsers the load_binary_resource() function shown below loads binary data from the specified url, returning it to the caller. function load_binary_resource(url) { var req = new xmlhttprequest(); req.open('get', url, false); //xhr binary charset opt by marcus granado 2006 [http://mgran.blogspot.com] req.overridemimetype('text\/plain; charset=x-user-defined'); req.send(null); if (req.status != 200) return ''; return req.responsetext; } the magic happens in line 5, which overrides the mime type, forcing the browser to treat it as plain text, using a user-defined character set. this tells...
...And 4 more matches
font-variant-alternates - CSS: Cascading Style Sheets
this property allows those human-readable names (defined in @font-feature-values) in the stylesheet. syntax this property may take one of two forms: either the keyword normal or one or more of the other keywords and functions listed below, space-separated, in any order. values normal this keyword deactivates alternate glyphs. historical-forms this keyword enables his...
...values) in the stylesheet. syntax this property may take one of two forms: either the keyword normal or one or more of the other keywords and functions listed below, space-separated, in any order. values normal this keyword deactivates alternate glyphs. historical-forms this keyword enables historical forms — glyphs that were common in the past but not today. ...
...ed, in any order. values normal this keyword deactivates alternate glyphs. historical-forms this keyword enables historical forms — glyphs that were common in the past but not today. it corresponds to the opentype value hist. stylistic() this function enables stylistic alternates for individual characters. the parameter is a font-specific name mapped to a number. it corresponds to the opentype value salt, like salt 2. styleset() this function enables stylistic alternatives for sets of characters. the parameter is a font-specific name mapped to a number. it corresponds to the opentype value ssxy, like ss02. character-variant() this function enables specific stylistic alternatives for characters. it is similar to styleset(), but doesn't create coherent glyphs for a set of charact...
...And 4 more matches
Audio and Video Delivery - Developer guides
e('video/webm')) { myvideo.setattribute('src','videofile.webm'); } myvideo.width = 480; myvideo.height = 320; we set the source of the video depending on the type of video file the browser supports we then set the width and height of the video. ...
...pe audio/ogg ogg addtype audio/ogg oga addtype video/mp4 mp4 addtype video/mp4 m4v addtype video/ogg ogv addtype video/webm webm addtype video/webm webmv 2. ...
...deo/mp4 mp4 addtype video/mp4 m4v addtype video/ogg ogv addtype video/webm webm addtype video/webm webmv 2. ...
...And 4 more matches
<input type="time"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › time
lly identical to the old one, but has a similar ui to edge. 24-hour firefox firefox's time control is very similar to chrome's, except that it doesn't have the up and down arrows. it also uses a 12- or 24-hour format for inputting times, based on system locale. an "x" button is provided to clear the control's value. 12-hour 24-hour edge the edge time control is somewhat more elaborate, opening up an hour and minute picker with sliding reels. it, like chrome, uses a 12- or 24-hour format for inputting times, based on system locale: 12-hour 24-hour value a domstring representing a time, or empty. events change and input supported common attributes autocomplete, list, readonly, and step idl attributes value, valueasdate, valueasnumbe...
...allowed. it's also possible for the value to look roughly like a valid time but not be correct, such as 25:05. setting maximum and minimum times you can use the min and max attributes to restrict the valid times that can be chosen by the user. in the following example we are setting a minimum time of 12:00 and a maximum time of 18:00: <form> <label for="appt-time">choose an appointment time (opening hours 12:00 to 18:00): </label> <input id="appt-time" type="time" name="appt-time" min="12:00" max="18:00"> <span class="validity"></span> </form> here's the css used in the above example. here we make use of the :valid and :invalid css properties to style the input based on whether or not the current value is valid. we had to put the icons on a <span> next to the input, not on...
...in addition, you can use the required attribute to make filling in the time mandatory. as a result, supporting browsers will display an error if you try to submit a time that is outside the set bounds, or an empty time field. let's look at an example; here we've set minimum and maximum times, and also made the field required: <form> <div> <label for="appt-time">choose an appointment time (opening hours 12:00 to 18:00): </label> <input id="appt-time" type="time" name="appt-time" min="12:00" max="18:00" required> <span class="validity"></span> </div> <div> <input type="submit" value="submit form"> </div> </form> if you try to submit the form with an incomplete time (or with a time outside the set bounds), the browser displays an error. try playing with the...
...And 4 more matches
Media container formats (file types) - Web media technologies
de details about the profile, level, and/or other codec configuration specifics. video codecs supported by 3gp codec browser support chrome edge firefox safari avc (h.264) yes1,2 h.263 yes1 mpeg-4 part 2 (mp4v-es) yes1 vp8 yes1 [1] firefox only supports 3gp on openmax-based devices, which currently means the boot to gecko (b2g) platform. [2] firefox support for h.264 relies upon the operating system's media infrastructure, so it is available as long as the os supports it. audio codecs supported by 3gp codec browser support chrome edge firefox safari amr-nb yes1 amr-wb yes1 ...
... [2] firefox support for aac relies upon the operating system's media infrastructure, so it is available as long as the os supports it. adts audio data transport stream (adts) is a container format specified by mpeg-4 part 3 for audio data, intended to be used for streamed audio, such as for internet radio. it is, essenti...
...pport chrome edge firefox safari aac yes1 flac yes mpeg-1 audio layer iii (mp3) yes opus yes [1] firefox support for h.264 relies upon the operating system's media infrastructure, so it is available as long as the os supports it. ogg the ogg container format is a free and open format maintained by the xiph.org foundation. the ogg framework also defines patent unencumbered media data formats, such as the theora video codec and the vorbis and opus audio codecs. xiph.org documents about the ogg format are available on their web site. while ogg has been around for a long time, it has never gained the wide support needed to make it a good first choice for a media container...
...And 4 more matches
Caching compiled WebAssembly modules - WebAssembly
o instantiatecachedurl() will then clear out the entire cache, allowing you to avoid using out-of-date modules. ...
...l(dbversion, url, importobject) { const dbname = 'wasm-cache'; const storename = 'wasm-cache'; setting up the database the first helper function contained inside instantiatecachedurl() — opendatabase() — creates an object store for storing wasm modules, and also handles clearing out the database if the dbversion is updated; it returns a promise resolving to the new database. ...
...che'; setting up the database the first helper function contained inside instantiatecachedurl() — opendatabase() — creates an object store for storing wasm modules, and also handles clearing out the database if the dbversion is updated; it returns a promise resolving to the new database. ...
...And 4 more matches
Interacting with page scripts - Archive of obsolete content
any of them, even setters and getters, could have been redefined by a page script. don't use it unless you trust the page, and even then be careful. also, unsafewindow isn't a supported api, so it could be removed or changed in a future version of the sdk. expose ob...
...ve values, but can no longer do it for objects. instead, you need to use the global cloneinto() function to clone the object into the page script's scope. cloneinto() creates a structured clone of the object in the target context, and returns a reference to the clone. you can then assign that to a property of the target window, and the page script can access it. here's an example. ...
.... cloneinto() creates a structured clone of the object in the target context, and returns a reference to the clone. you can then assign that to a property of the target window, and the page script can access it. here's an example. ...
...And 3 more matches
context-menu - Archive of obsolete content
rrence of specific contexts. contexts can be related to page content or the page itself, but they should never be external to the page. for example, a good use of the menu would be to show an "edit image" item when the user right-clicks an image in the page. a bad use would be to show a submenu that listed all the user's tabs, since tabs aren't related to the page or the node the user clicked to open the menu. the page context first of all, you may not need to specify a context at all. when a top-level item does not specify a context, the page context applies. an item that is in a submenu is visible unless you specify a context. the page context occurs when the user invokes the context menu on a non-interactive portion of the page. try right-clicking a blank spot in this page, or on text. ...
...elf object, passing it some json-able data. the menu item's "message" event listener will be called with that data. var cm = require("sdk/context-menu"); cm.item({ label: "edit image", context: cm.selectorcontext("img"), contentscript: 'self.on("click", function (node, data) {' + ' self.postmessage(node.src);' + '});', onmessage: function (imgsrc) { openimageeditor(imgsrc); } }); updating a menu item's label each menu item must be created with a label, but you can change its label later using a couple of methods. the simplest method is to set the menu item's label property. this example updates the item's label based on the number of times it's been clicked: var numclicks = 0; var myitem = require("sdk/context-menu").item({ label: "click ...
...ction (pageurl) { editsource(pageurl); } }); show an "edit image" item when the menu is invoked on an image: var cm = require("sdk/context-menu"); cm.item({ label: "edit image", context: cm.selectorcontext("img"), contentscript: 'self.on("click", function (node, data) {' + ' self.postmessage(node.src);' + '});', onmessage: function (imgsrc) { openimageeditor(imgsrc); } }); show an "edit mozilla image" item when the menu is invoked on an image in a mozilla.org or mozilla.com page: var cm = require("sdk/context-menu"); cm.item({ label: "edit mozilla image", context: [ cm.urlcontext(["*.mozilla.org", "*.mozilla.com"]), cm.selectorcontext("img") ], contentscript: 'self.on("click", function (node, data) {' + ...
...And 3 more matches
page-mod - Archive of obsolete content
nstructor takes a number of other options to control its behavior: contentstyle lists stylesheets to attach, supplied as strings. contentstylefile lists stylesheets to attach, supplied in separate files. contentscriptoptions defines read-only values accessible to content scripts. attachto controls whether to attach scripts to tabs that were already open when the page-mod was created, and whether to attach scripts to iframes as well as the topmost document. contentscriptwhen controls the point during document load at which content scripts are attached. exclude has the same syntax as include, but specifies the urls to which content scripts should not be attached, even if they match include: so it's a way of excluding a...
...sdk/page-mod"); pagemod.pagemod({ include: "*.org", contentstyle: [ "div { padding: 10px; color: red }", "img { display: none }" ] }); content styles specified by this option are loaded after those specified by the contentstylefile option. name: attachto type: string,array if this option is not specified, content scripts: are not attached to any tabs that are already open when the page-mod is created. are attached to all documents whose url matches the rule: so if your rule matches a specific hostname and path, and the topmost document that satisfies the rule includes ten iframes using a relative url, then your page-mod is applied eleven times. you can modify this behavior using the attachto option. it accepts the following values: "existing": the page-mod ...
...hed to all documents whose url matches the rule: so if your rule matches a specific hostname and path, and the topmost document that satisfies the rule includes ten iframes using a relative url, then your page-mod is applied eleven times. you can modify this behavior using the attachto option. ...
...And 3 more matches
ui/sidebar - Archive of obsolete content
side of the browser window. you specify its content using html, css, and javascript, and the user can show or hide it in the same way they can show or hide the built-in sidebars. usage creating, showing, and hiding sidebars you construct a sidebar object using the sidebar() constructor. once you've done that, you can show the sidebar by calling the sidebar's show() method. if a new window is opened from a window that has a sidebar visible, the new window gets a sidebar, too. you can hide the sidebar by calling its hide() method. called with no arguments, show() and hide() will operate on the currently active window. from firefox 33 onwards you can pass a browserwindow into these methods, and they will then operate on the specified window. alternatively, the view->sidebar submenu in fir...
... onhide: function () { console.log("hiding"); }, ondetach: function () { console.log("detaching"); } }); parameters options : object required options: name type title string a title for the sidebar. this will be used for the label for your sidebar in the "sidebar" submenu in firefox, and will be shown at the top of your sidebar when it is open. url string the url of the content to load in the sidebar. this must be a local url (typically, loaded from the "data" folder using self.data.url()). from firefox 34, you can use "./myfile.html" as an alias for self.data.url("myfile.html"). optional options: name type id string the id of the sidebar. this ...
...f event for which listener was registered. listener : function the listener function that was registered. properties id the id of the sidebar. this used to identify this sidebar in its chrome window. it must be unique. title the title of the sidebar. this will be used for the label for your sidebar in the "sidebar" submenu in firefox, and will be shown at the top of your sidebar when it is open. url the url of the content to load in the sidebar. this must be a local url (typically, loaded from the "data" folder using self.data.url()). events attach this event is emitted when a worker is attached to a sidebar, as a result of any of the following: calling the sidebar's show() method, when the sidebar is not shown in the currently active window changing the sidebar's url property ...
...And 3 more matches
Creating Reusable Modules - Archive of obsolete content
note that you usually won't // need to work with the string paths. var path = fp.file.path; // work with returned nsilocalfile... } return path; } hash fun...
...; // return the two-digit hexadecimal code for a byte function tohexstring(charcode) { return ("0" + charcode.tostring(16)).slice(-2); } function md5file(path) { var f = cc["@mozilla.org/file/local;1"] .createinstance(ci.nsilocalfile); f.initwithpath(path); var istream = cc["@mozilla.org/network/file-input-stream;1"] .createinstance(ci.nsifileinputstream); // open for reading istream.init(f, 0x01, 0444, 0); var ch = cc["@mozilla.org/security/hash;1"] .createinstance(ci.nsicryptohash); // we want to use the md5 algorithm ch.init(ch.md5); // this tells updatefromstream to read the entire file const pr_uint32_max = 0xffffffff; ch.updatefromstream(istream, pr_uint32_max); // pass false here to get binary data back var hash = ch.fin...
...; // return the two-digit hexadecimal code for a byte function tohexstring(charcode) { return ("0" + charcode.tostring(16)).slice(-2); } function md5file(path) { var f = cc["@mozilla.org/file/local;1"] .createinstance(ci.nsilocalfile); f.initwithpath(path); var istream = cc["@mozilla.org/network/file-input-stream;1"] .createinstance(ci.nsifileinputstream); // open for reading istream.init(f, 0x01, 0444, 0); var ch = cc["@mozilla.org/security/hash;1"] .createinstance(ci.nsicryptohash); // we want to use the md5 algorithm ch.init(ch.md5); // this tells updatefromstream to read the entire file const pr_uint32_max = 0xffffffff; ch.updatefromstream(istream, pr_uint32_max); // pass false here to get binary data back var hash = ch.fin...
...And 3 more matches
Getting Started (jpm) - Archive of obsolete content
ce you've supplied a value or accepted the default for these properties, you'll be shown the complete contents of "package.json" and asked to accept it. implementing the add-on now you can write the add-on's code. unless you've changed the value of "entry point" ("main" in package.json), this goes in "index.js" file in the root of your add-on. this file was created for you in the previous step. ...
... in cfx, the entry point defaults to "main.js", and is located in the "lib" directory under the add-on's root. save the file. ...
... command to run a new instance of firefox with your add-on installed. if firefox can not be located, or you have installed firefox developer as an alternate browser, you may need to provide the path to it. for example, in ubuntu: jpm run -b /usr/bin/firefox when firefox launches, in the top-right corner of the browser you'll see an icon with the firefox logo. click the icon, and a new tab will open with http://www.mozilla.org/ loaded into it. that's all this add-on does. it uses two sdk modules: the action button module, which enables you to add buttons to the browser, and the tabs module, which enables you to perform basic operations with tabs. in this case, we've created a button whose icon is the firefox icon, and added a click handler that loads the mozilla home page in a new tab. try...
...And 3 more matches
Handling Preferences - Archive of obsolete content
if you need to refer to the term "preference" in any of your locale files, you must change the string depending on the operating system. ...
...yinterface(ci.nsiprefbranch2); this._prefservice.removeobserver(prefname, this); preference windows it's very common for extensions to have a few settings that their users can change to tailor them to their needs. since there are some subtleties related to preference management, there are some facilities provided in xul and firefox that make this much easier to deal with. ...
...._prefservice.removeobserver(prefname, this); preference windows it's very common for extensions to have a few settings that their users can change to tailor them to their needs. since there are some subtleties related to preference management, there are some facilities provided in xul and firefox that make this much easier to deal with. ...
...And 3 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
ailed. please contact your system administrator. error: getldapattibutes failed: [exception... "component returned failure code: 0xc1f30001 (ns_error_not_initialized) [nsildapurl.spec]" nsresult: "0xc1f30001 (ns_error_not_initialized)" location: "js frame :: file:////usr/lib/thunderbird-3.0b2/defaults/autoconfig/prefcalls.js :: getldapattributes :: line 174" data: no] bug 295329 had been re-opened . autoconfig option and ldap support in thunderbird 1.5.x fortunately, autoconfig is now part of thunderbird default packages. moz_ldap_xpcom=1 and moz_extensions_default="wallet spellcheck xmlextras pref webservices universalcharset auth" are now present in the default configure script. see bug 295329 for details. add the autoconfig option for old thunderbird 1.0.x by default, autoconfig...
...x 1.5 a least from firefox 1.5, autoconfig is compiled by default (cf. browser, moz_extensions_default="pref...") but not ldap (moz_ldap_xpcom=1). you need to recompile the package to get it, cf. bug 295329. add autoconfig and ldap support in firefox 1.0.x add pref extension (--enable-extensions=pref) and remove --disable-ldap from mozconfig file. ...
...bug=1) or in the command.com environment in windows (set mozilla_debug=1). blank space bug i noticed a problem which is due to be corrected in mozilla 1.8 i think... here's the report and workaround: bug 229271. to fix, add the following: start_pos += search_key.length; //start start_pos +=1; //end to function getldapvalue() in autoconfig/preffcalls.js. ...
...And 3 more matches
Creating a Firefox sidebar extension - Archive of obsolete content
ptysidebar \- chrome |- content |- locale | \- en-us \- skin create all folders, except for skin. it is not used for this tutorial. the locale holds the locale, only the en-us locale is created. it is listed in example 2. the locale includes the name and shortcut keys for the sidebar. example 2. chrome/locale/emptysidebar.dtd <!entity emptysidebar.title "emptysidebar"> <!entity openemptysidebar.commandkey "e"> <!entity openemptysidebar.modifierskey "shift accel"> the content folder includes our sidebar, the emptysidebar.xul is shown in example 3. it creates a page holding one label. other elements can be included, please read the xul tutorials for more information. example 3. chrome/content/emptysidebar.xul <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/s...
...ere is added to the view | sidebar menu. the overlay file is listed in example 4. example 4. ...
...firefoxoverlay.xul <?xml version="1.0"?> <!doctype overlay system "chrome://emptysidebar/locale/emptysidebar.dtd"> <overlay id="emptysidebaroverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <menupopup id="viewsidebarmenu"> <menuitem key="key_openemptysidebar" observes="viewemptysidebar" /> </menupopup> <keyset id="mainkeyset"> <key id="key_openemptysidebar" command="viewemptysidebar" key="&openemptysidebar.commandkey;" modifiers="&openemptysidebar.modifierskey;" /> </keyset> <broadcasterset id="mainbroadcasterset"> <broadcaster id="viewemptysidebar" label="&emptysidebar.title;" autocheck="false" type="checkbox" group="sidebar" ...
...And 3 more matches
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
ing. 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. to check your text editor, create a plain text file named test.txt. in the file, type some of the special characters that your language uses. save the file. open the file in seamonkey (for example, by dragging it and dropping it in the navigator window, or by choosing file – open file... from seamonkey's menu bar). from seamonkey's menu bar, choose view – character encoding – unicode (utf-8). check that the text you typed looks ok with this setting. if your text editor does not support utf-8, search the internet for a better one that you can downloa...
...o the files. after you get the button working, customize the files carefully. to see the effect of any change that you make, restart seamonkey. advanced troubleshooting if you have some technical knowledge, then you can use the seamonkey's javascript console to see error messages. however, you might see messages that are unhelpful or confusing, or that come from other parts of the application. to open the javascript console, choose tools – web development – javascript console. messages in the javascript console can provide information about javascript, xul or css files. note: the preference setting javascript.options.strict imposes restrictions that are not appropriate for the simple scripts in this tutorial. if you choose to use this setting, either ignore the warnings that it generate...
...e a jar tool or zip tool to package everything in your working directory. name the package file with the .xpi extension. (some zip tools require you to use the .zip extension first, then rename the file to change the extension.) ensure that the package does not contain your working directory itself, but only install.js, content and all the files in content. ...
...And 3 more matches
Commands - Archive of obsolete content
es the convention that command id's start with 'cmd_'. you will probably want to use the same id if a command is already being used, however, for your own commands, you can use any command id you wish. to avoid conflicts, you may wish to include the application name in the command id. a simple way of using commands is as follows: example: simple command example 1 : source view <command id="cmd_openhelp" oncommand="alert('help!');"/> <button label="help" command="cmd_openhelp"/> in this example, instead of placing the oncommand attribute on the button, we instead place it on a command element. the two are then linked using the command attribute, which has the value of the command's id. the result is that when the button is pressed, the command 'cmd_openhelp' is invoked. there are two adva...
...ok up elements that would send a command event. additionally, if you set the disabled attribute on the command, the command will be disabled and it will not be invoked. any buttons and menu items hooked up to it will be disabled automatically. if you re-enable the command, the buttons will become enabled again. ...
... set the disabled attribute on the command, the command will be disabled and it will not be invoked. any buttons and menu items hooked up to it will be disabled automatically. if you re-enable the command, the buttons will become enabled again. example: toggling command disabled example 2 : source view <command id="cmd_openhelp" oncommand="alert('help');"/> <button label="help" command="cmd_openhelp"/> <button label="more help" command="cmd_openhelp"/> <button label="disable" oncommand="document.getelementbyid('cmd_openhelp').setattribute('disabled','true');"/> <button label="enable" oncommand="document.getelementbyid('cmd_openhelp').removeattribute('disabled');"/> in this example, both buttons use the same command. when the disable button is pressed, the command is di...
...And 3 more matches
Keyboard Shortcuts - Archive of obsolete content
xul provides methods in which you can define keyboard shortcuts. we've already seen in the section on menus that we can define an attribute called accesskey which specifies the key which a user can press to activate the menu or menu item. in the example below, the file menu can be selected by pressing alt + f together (or some other key combination for a specific platform). once the file menu is open, the close menu item can be selected by pressing c. example 1 : source view <menubar id="sample-menubar"> <menu id="file-menu" label="file" accesskey="f"> <menupopup id="file-popup"> <menuitem id="close-command" label="close" accesskey="c"/> </menupopup> </menu> </menubar> you can also use the accesskey attribute on buttons. when the key is pressed in this case, the button i...
...skey="c"/> </menupopup> </menu> </menubar> you can also use the accesskey attribute on buttons. when the key is pressed in this case, the button is selected. you might want to set up more general keyboard shortcuts however. for example, pressing ctrl + c to copy text to the clipboard. although shortcuts such as this might not always be valid, they will usually work any time the window is open. usually, a keyboard shortcut will be allowed at any time and you can check to see whether it should do something using a script. for example, copying text to the clipboard should only work when some text is selected. key element xul provides an element, key, which lets you define a keyboard shortcut for a window. it has attributes to specify the key that should be pressed and what modifier key...
... vk_decimal vk_divide vk_f1 vk_f2 vk_f3 vk_f4 vk_f5 vk_f6 vk_f7 vk_f8 vk_f9 vk_f10 vk_f11 vk_f12 vk_f13 vk_f14 vk_f15 vk_f16 vk_f17 vk_f18 vk_f19 vk_f20 vk_f21 vk_f22 vk_f23 vk_f24 vk_num_lock vk_scroll_lock vk_comma vk_period vk_slash vk_back_quote vk_open_bracket vk_back_slash vk_close_bracket vk_quote vk_help for example, to create a shortcut that is activated when the user presses alt and f5, do the following: <keyset> <key id="test-key" modifiers="alt" keycode="vk_f5"/> </keyset> the example below demonstrates some more keyboard shortcuts: <keyset> <key id="copy-key" modifiers="accel" key="c"/> ...
...And 3 more matches
Localization - Archive of obsolete content
key="&copycmd.commandkey;"/> <key id="paste_cmd" modifiers="accel" key="&pastecmd.commandkey;"/> <key id="close_cmd" keycode="vk_escape" oncommand="window.close();"/> </keyset> <vbox flex="1"> <toolbox> <menubar id="findfiles-menubar"> <menu id="file-menu" label="&filemenu.label;" accesskey="&filemenu.accesskey;"> <menupopup id="file-popup"> <menuitem label="&opencmd.label;" accesskey="&opencmd.accesskey;"/> <menuitem label="&savecmd.label;" accesskey="&savecmd.accesskey;"/> <menuseparator/> <menuitem label="&closecmd.label;" accesskey="&closecmd.accesskey;" key="close_cmd" oncommand="window.close();"/> </menupopup> </menu> <menu id="edit-menu" label="&editmenu.labe...
... accesskey="&cutcmd.accesskey;" key="cut_cmd"/> <menuitem label="&copycmd.label;" accesskey="&copycmd.accesskey;" key="copy_cmd"/> <menuitem label="&pastecmd.label;" accesskey="&pastecmd.accesskey;" key="paste_cmd" disabled="true"/> </menupopup> </menu> </menubar> <toolbar id="findfiles-toolbar"> <toolbarbutton id="opensearch" label="&opencmdtoolbar.label;"/> <toolbarbutton id="savesearch" label="&savecmdtoolbar.label;"/> </toolbar> </toolbox> <tabbox> <tabs> <tab label="&searchtab;" selected="true"/> <tab label="&optionstab;"/> </tabs> <tabpanels> <tabpanel id="searchpanel" orient="vertical" context="editpopup"> <description> &finddescription; </description> <spacer c...
...ed in order to display kb or mb as needed. the access keys and keyboard shortcuts have also been translated into entities because they will likely be different in a different locale. ...
...And 3 more matches
Building XULRunner with Python - Archive of obsolete content
o .net 2003 (msvc71) which is not longer officially available. the issue is that xulrunner must be built with the same version of c as python and with python 2.5 that is msvc71. both must use the same version of the c runtime library msvcrt?.dll or crashes will ensue. the alternative is to build python with msvc8 as well asmozilla, but that may be problematic. it might also be possible to use the open source mingw compiler with the correct msvc run time but that is apparently not recommended. apply any service packs and for msvc71 sp 1 is available. the matching platform sdk is also needed and for msvc71 that is .net framework sdk 1.1. the latest mozilla build system is easy to use. install the included python distro usingpython25\python-2.5.msi. it doesn't need to be installed for the build...
...possible gotcha is that the default python path used to find modules that areimported explicitly includes the xulrunner executable directory and the directory that is current when xulrunner launches. however it does not include any path related to the xul application being run. some work around will need to be found. ...
...oes not include any path related to the xul application being run. some work around will need to be found. unhandled exceptions are displayed in the javascript error console which can be opened usingxulrunner -jsconsole. one solution is to puttry .... except: print_exc() round any event handler to print tracebacks to stdout and use a python console to catch that output. ...
...And 3 more matches
XULRunner tips - Archive of obsolete content
there is a working stub. any better suggestion? venkman uses "chrome://communicator/skin/" as an alias for "chrome://global/skin/" and this alias was maintained in the xulrunner toolkit until xulrunner 1.9 was released. when using xulrunner 1.9 or greater, you can create your own alias in your chrome manifest add a "skin" line: skin communicator class...
...tead of clicking the "add to..." button, right-click and select "save link as..."). ...
...erlay chrome://inspector/content/keysetoverlay.xul chrome://inspector/content/viewers/dom/keysetoverlay.xul overlay chrome://inspector/content/popupoverlay.xul chrome://inspector/content/viewers/stylerules/popupoverlay.xul overlay chrome://inspector/content/commandoverlay.xul chrome://inspector/content/viewers/dom/commandoverlay.xul to launch dom inspector in your application, you need to open its main window, with a command like this: window.open("chrome://inspector/content/inspector.xul", "", "chrome"); alternatively, the dom inspector may also be added as an extension: (if you already have inspector installed for another application you can skip to the next step) follow the instructions above through "unzip the package." create a file in the extensions directory of your app...
...And 3 more matches
Theme changes in Firefox 2 - Archive of obsolete content
e future. ...
... #copy-button:active toolbar[iconsize="small"] #cut-button:active toolbar[iconsize="small"] #downloads-button:active toolbar[iconsize="small"] #history-button:active toolbar[iconsize="small"] #home-button:active toolbar[iconsize="small"] #mail-button toolbar[iconsize="small"] #mail-button:active toolbar[iconsize="small"] #mail-button[disabled="true"] toolbar[iconsize="small"] #mail-button[open="true"] toolbar[iconsize="small"] #new-tab-button:active toolbar[iconsize="small"] #new-window-button:active toolbar[iconsize="small"] #paste-button:active toolbar[iconsize="small"] #print-button:active toolbar[iconsize="small"] #reload-button:active toolbar[iconsize="small"] #stop-button:active toolbar[mode="icons"] .toolbarbutton-text toolbar[mode="text"] .toolbarbutton-1 > .toolbarbutt...
...button:hover .toolbarbutton-menubutton-dropmarker #back-button:hover:active #back-button:hover:active .toolbarbutton-menubutton-dropmarker #back-button[buttondown="true"] > .toolbarbutton-menubutton-dropmarker #back-button[buttonover="true"] #back-button[buttonover="true"] > .toolbarbutton-menubutton-dropmarker #back-button[disabled="true"] .toolbarbutton-menubutton-dropmarker #back-button[open="true"] #bookmarks-button:hover #bookmarks-button:hover:active #bookmarks-button[checked="true"] #copy-button:hover #copy-button:hover:active #cut-button:hover #cut-button:hover:active #downloads-button:hover #downloads-button:hover:active #feed-button[chromedir="rtl"][feeds]:active #feed-button[chromedir="rtl"][feeds]:hover #feed-button[feeds]:active #feed-button[feeds]:hover #forw...
...And 3 more matches
Choosing Standards Compliance Over Proprietary Practices - Archive of obsolete content
ds so they are able to operate efficiently. they may also incorporate external procedural and/or technical standards. technical standards have traditionally been pioneered through consortiums or standards bodies. the technical standards can be either public, standards-based or a proprietary de facto standard. the purpose of this document is to discuss and emphasize the importance of conforming to open technology standards that are external to the organization. let’s begin the discussion, however, by looking inward to internal procedures, processes and standards. why should organizations have standard procedures at every level? following standards is certainly not a new organizational phenomenon; organizations require their employees to follow common rules, or a common set of standards all t...
...by following the guidelines that have been put into p...
... easily debug issues. however, what xerox neglected to understand was that regardless of how powerful pilot and co-pilot was, the star workstation could not evolve with the times because it was proprietary. xerox was bound to a unique hardware platform and to a closed development operating system. and xerox chose to bypass multiple opportunities to port the code to other platforms, and to provide open-source code. consequently, xerox eventually had to shut down the production of their workstation development because of escalating manufacturing and developing costs and slowed sales. xerox’s biggest asset in the beginning became its weapon of destruction. they settled on a proprietary environment, and missed the opportunity to make their environment the benchmark – and set the standard. fo...
...And 3 more matches
HTML: A good basis for accessibility - Learn web development
look at the basic accessibility concerns to be aware of when creating such controls. later articles on wai-aria and multimedia will look at other aspects of ui accessibility. one key aspect of the accessibility of ui controls is that by default, browsers allow them to be manipulated by the keyboard. you can try this out using our native-keyboard-accessibility.html example (see the source code). open this in a new tab, and try pressing the tab key; after a few presses, you should see the tab focus start to move through the different focusable elements. the focused elements are given a highlighted default style in every browser (it differs slightly between different browsers) so that you can tell what element is focused. you can then press enter/return to follow a focused link or press a bu...
...nd surrounding text and between default, visited, and focus/active states and a 4:5 contrast between all those state colors and the background color. onclick events anchor tags are often abused with the onclick event to create pseudo-buttons by setting href to "#" or "javascript:void(0)" to prevent the page from refreshing. these values cause unexpected behavior when copying or dragging links, opening links in a new tab or window, bookmarking, and when javascript is still downloading, errors out, or is disabled. this also conveys incorrect semantics to assistive technologies (e.g., screen readers). in these cases, it is recommended to use a <button> instead. in general you should only use an anchor for navigation using a proper url. external links and linking to non-html resources links t...
...links in a new tab or window, bookmarking, and when javascript is still downloading, errors out, or is disabled. this also conveys incorrect semantics to assistive technologies (e.g., screen readers). in these cases, it is recommended to use a <button> instead. in general you should only use an anchor for navigation using a proper url. external links and linking to non-html resources links that open in a new tab or window via the target="_blank" declaration and links to whose href value points to a file resource should include an indicator about the behavior that will occur when the link is activated. people experiencing low vision conditions, who are navigating with the aid of screen reading technology, or who have cognitive concerns may become confused when the new tab, window, or applica...
...And 3 more matches
HTML: A good basis for accessibility - Learn web development
look at the basic accessibility concerns to be aware of when creating such controls. later articles on wai-aria and multimedia will look at other aspects of ui accessibility. one key aspect of the accessibility of ui controls is that by default, browsers allow them to be manipulated by the keyboard. you can try this out using our native-keyboard-accessibility.html example (see the source code). open this in a new tab, and try pressing the tab key; after a few presses, you should see the tab focus start to move through the different focusable elements. the focused elements are given a highlighted default style in every browser (it differs slightly between different browsers) so that you can tell what element is focused. you can then press enter/return to follow a focused link or press a bu...
...nd surrounding text and between default, visited, and focus/active states and a 4:5 contrast between all those state colors and the background color. onclick events anchor tags are often abused with the onclick event to create pseudo-buttons by setting href to "#" or "javascript:void(0)" to prevent the page from refreshing. these values cause unexpected behavior when copying or dragging links, opening links in a new tab or window, bookmarking, and when javascript is still downloading, errors out, or is disabled. this also conveys incorrect semantics to assistive technologies (e.g., screen readers). in these cases, it is recommended to use a <button> instead. in general you should only use an anchor for navigation using a proper url. external links and linking to non-html resources links t...
...links in a new tab or window, bookmarking, and when javascript is still downloading, errors out, or is disabled. this also conveys incorrect semantics to assistive technologies (e.g., screen readers). in these cases, it is recommended to use a <button> instead. in general you should only use an anchor for navigation using a proper url. external links and linking to non-html resources links that open in a new tab or window via the target="_blank" declaration and links to whose href value points to a file resource should include an indicator about the behavior that will occur when the link is activated. people experiencing low vision conditions, who are navigating with the aid of screen reading technology, or who have cognitive concerns may become confused when the new tab, window, or applica...
...And 3 more matches
What are browser developer tools? - Learn web development
every modern web browser includes a powerful suite of developer tools. these tools do a range of things, from inspecting currently-loaded html, css and javascript to showing which assets the page has requested and how long they took to load. this article explains how to use the basic functions of your browser's devtools. ...
...ings, from inspecting currently-loaded html, css and javascript to showing which assets the page has requested and how long they took to load. this article explains how to use the basic functions of your browser's devtools. note: before you run through the examples below, open the beginner's example site that we built during the getting started with the web article series. you should have this open as you follow the steps below. ...
...css and javascript to showing which assets the page has requested and how long they took to load. this article explains how to use the basic functions of your browser's devtools. note: before you run through the examples below, open the beginner's example site that we built during the getting started with the web article series. you should have this open as you follow the steps below. ...
...And 3 more matches
Debugging HTML - Learn web development
as popular as it is today, if it had been more strict from the very beginning. active learning: studying permissive code it's time to study the permissive nature of html code. first, download our debug-example demo and save it locally. this demo is deliberately written with some built-in errors for us to explore (the html markup is said to be badly-formed, as opposed to well-formed). next, open it in a browser. you will see something like this: this immediately doesn't look great; let's look at the source code to see if we can work out why (only the body contents are shown): <h1>html debugging examples</h1> <p>what causes errors in html? <ul> <li>unclosed elements: if an element is <strong>not closed properly, then its effect can spread to areas you didn't intend <li>bad...
... document as an input, goes through it, and gives you a report to tell you what is wrong with your html. to specify the html to validate, you can provide a web address, upload an html file, or directly input some html code. active learning: validating an html document let's try this with our sample document. first, load the markup validation service in one browser tab, if it isn't already open. switch to the validate by direct input tab. copy all of the sample document's code (not just the body) and paste it into the large text area shown in the markup validation service. press the check button. this should give you a list of errors and other information. interpreting the error messages the error messages are usually helpful, but sometimes they are not so helpful; with a bit o...
...ges and see what they mean. you'll see that each message comes with a line and column number to help you to locate the error easily. "consider adding a lang attribute to the html start tag to declare the language of this document.": this is not an error but a warning. the recommendation is to always define a language, and this warning explains how to do it. "end tag li implied, but there were open elements" (2 instances): these messages indicate that an element is open that should be closed. the ending tag is implied, but not actually there. the line/column information points to the first line after the line where the closing tag should really be, but this is a good enough clue to see what is wrong. "unclosed element strong": this is really easy to understand — a <strong> element is unc...
...And 3 more matches
Drawing graphics - Learn web development
the canvas content. for example, if you were rendering a constantly updating graph of stock prices, the fallback content could be a static image of the latest stock graph, with alt text saying what the prices are in text. creating and sizing our canvas let's start by creating our own canvas that we draw future experiments on to. ...
... of stock prices, the fallback content could be a static image of the latest stock graph, with alt text saying what the prices are in text. creating and sizing our canvas let's start by creating our own canvas that we draw future experiments on to. first make a local copy of our 0_canvas_start.html file, and open it in your text editor. add the following code into it, just below the opening <body> tag: <canvas class="mycanvas"> <p>add suitable fallback here.</p> </canvas> we have added a class to the <canvas> element so it will be easier to select if we have multiple canvases on the page, but we have removed the width and height attributes for now (you could add them back in if you wanted, but we will set them using javascript in a below section). canvases with no explici...
...! if you aren't going to change anything, then you might as well just use static images and save yourself all the work. creating a loop playing with loops in canvas is rather fun — you can run canvas commands inside a for (or other type of) loop just like any other javascript code. let's build a simple example. make another fresh copy of our canvas template (1_canvas_template.html) and open it in your code editor. add the following line to the bottom of your javascript. this contains a new method, translate(), which moves the origin point of the canvas: ctx.translate(width/2, height/2); this causes the coordinate origin (0, 0) to be moved to the center of the canvas, rather than being at the top left corner. this is very useful in many situations, like this one, where we...
...And 3 more matches
Getting started with React - Learn web development
use-npm create-react-app will display a number of messages in your terminal while it works; this is normal! this might take a few minutes, so now might be a good time to go make a cup of tea. when the process is complete, cd into the moz-todo-react directory and run the command npm start. the scripts installed by create-react-app will start being served at a local server at localhost:3000, and open the app in a new browser tab. your browser will display something like this: application structure create-react-app gives us everything we need to develop a react application. its initial file structure looks like this: moz-todo-react ├── readme.md ├── node_modules ├── package.json ├── package-lock.json ├── .gitignore ├── public │ ├── favicon.ico...
...ou'd like to learn more about it, you can read what is the file `package.json`? on nodejs.org; we also talk about it in our package management basics tutorial. exploring our first react component — <app/> in react, a component is a reusable module that renders a part of our app. these parts can be big or small, but they are usually clearly defined: they serve a single, obvious purpose. let's open src/app.js, since our browser is prompting us to edit it. this file contains our first component, app, and a few other lines of code: import react from 'react'; import logo from './logo.svg'; import './app.css'; function app() { return ( <div classname="app"> <header classname="app-header"> <img src={logo} classname="app-logo" alt="logo" /> <p> edit <code>s...
...go from './logo.svg'; import './app.css'; function app() { return ( <div classname="app"> <header classname="app-header"> <img src={logo} classname="app-logo" alt="logo" /> <p> edit <code>src/app.js</code> and save to reload. </p> <a classname="app-link" href="https://reactjs.org" target="_blank" rel="noopener noreferrer" > learn react </a> </header> </div> ); } export default app; the app.js file consists of three main parts: some import statements at the top, the app component in the middle, and an export statement at the bottom. most react components follow this pattern. import statements the import statements at the top of the file allow app.js to use code...
...And 3 more matches
Getting started with Svelte - Learn web development
-width: 640px) { main { max-width: none; } } </style> we are applying a style to our <h1> element. what will happen other components with <h1> elements in them? in svelte, css inside a component's <style> block will be scoped only to that component. this works by adding a class to selected elements, which is based on a hash of the component styles. you can see this in action by opening localhost:5000 in a new browser tab, right/ctrl-clicking on the hello world! label, and choosing inspect: when compiling the app, svelte changes our h1 styles definition to h1.svelte-1tky8bj, and then modifies every <h1> element in our component to <h1 class="svelte-1tky8bj">, so that it picks up the styles as required. note: you can override this behavior and apply styles to a selector g...
...iable. as you can see, the <h1> label is automatically updated. behind the scenes, svelte created the javascript code to update the dom whenever the value of the name variable changes, without using any virtual dom or other complex reconciliation mechanism. note the use of : in on:click. that's svelte's syntax for listening to dom events. inspecting main.js: the entry point of our app let’s open src/main.js, which is where the app component is being imported and used. this file is the entry point for our app, and it initially looks like this: import app from './app.svelte'; const app = new app({ target: document.body, props: { name: 'world' } }); export default app; main.js starts by importing the svelte component that we are going to use. then in line 3 it instantiates it,...
...th github, a site that provides hosting for your repositories and several tools for working with them. we'll be using github so that you can easily download the source code for each article. you will also be able to get the code as it should be after completing the article, just in case you get lost. after installing git, to clone the repository you should execute: git clone https://github.com/opensas/mdn-svelte-tutorial.git then at the beginning of each article, you can just cd into the corresponding folder and start the app in dev mode to see what its current state should be, like this: cd 02-starting-our-todo-app npm install npm run dev if you want lo learn more about git and github, we've compiled a list of links to useful guides — see git and github. note: if you just want to do...
...And 3 more matches
CSUN Firefox Materials
. basic screen reader accessibility is available via gnopernicus or the fire vox extension. keyboard support "mozilla firefox is a web-browser with superior keyboard support. " - alan cantor, cantor access consulting (http://www.cantoraccess.com) firefox includes keyboard access to all of its amazing features: find as you type allows for quick navigation to links and text searching without opening a separate dialog -- this allows more convenient use by screen magnification users because there is a single point of regard for the search. it also assists users of input aids because there are far fewer keys to type to get the desired location. for example, it is possible to navigate to the desired link by pressing 2 letter keys rather than tabbing through many links to get there. browse w...
... user scripts let you easily control any aspect of a web page's design or interaction. we expect enterprising script writers will eventually fix annoying accessibility issues in popular web pages, and (hopefully) share their tricks with everyone! ie tab allows you to embed internet explorer into firefox tabs. ...
...tter in ie, open directly in firefox, while using the internet explorer engine tab mix plus completely enhances firefox's tab browsing capabilities. it includes such features as duplicating tabs, controlling tab focus, tab clicking options, undo closed tabs and windows, plus much more. it also includes a full-featured session manager with crash recovery that can save and restore combinations of opened tabs and windows. fire vox is a screen reader extension built just for firefox which can read mathml the accessibility extension, from the university of illinois, provides new menus and keyboard shortcuts for accessing every feature of a web page community contributions the real reason behind firefox's success is the great community of volunteers and organizations that realize they have so...
...And 3 more matches
How to get a stacktrace with WinDbg
nightly or release you need a firefox version for which symbols are availables from the mozilla symbol server to use with windbg. you can use any official nightly build or released version of firefox from mozilla. you can find the latest trunk nightly builds under http://ftp.mozilla.org/pub/mozilla.o.../latest-trunk/. debugging to begin debugging, ensure that firefox is not already running and open windbg from the start menu. (start->all programs->debugging tools for windows->windbg) next, open the "file" menu and choose "open executable...". in the file chooser window that appears, open the firefox.exe executable in your firefox program folder (c:\program files\mozilla firefox). you should now see a "command" text window with debug output at the top and an input box at the bottom. before ...
... bottom of the command box. copying and pasting each line is the easiest method to avoid mistakes some commands start with a period (.) or a pipe character (|), which is required. (the keystroke for a pipe character on us keyboards is shift+\) submit the log file on a bug or via the support site, even if nothing seems to happen during the debug process start debugging now that firefox is opened in the debugger, you need to configure your windbg to download symbols from the mozilla symbol server. to load the symbols, enter the three commands below, pressing enter after each one. (more details are available at using the mozilla symbol server.) .sympath srv*c:\symbols*http://symbols.mozilla.org/firefox;srv*c:\symbols*http://msdl.microsoft.com/download/symbols .symfix+ c:\symbols .reload...
...ding on your connection speed; the total size of the mozilla and microsoft symbols download is around 1.4gb. windbg will show "busy" at the bottom of the application window until the download is complete. once the download is complete, you need to configure windbg to examine child processes, ignore a specific event caused by flash player, and record a log of loaded modules. ...
...And 3 more matches
JavaScript OS.Constants
resource temporarily unavailable ebadf bad file descriptor eexist file exists efault bad address efbig file too large einval invalid argument eio input/output error eisdir is a directory eloop (not always available under windows) too many levels of symbolic links. ...
...ile exists efault bad address efbig file too large einval invalid argument eio input/output error eisdir is a directory eloop (not always available under windows) too many levels of symbolic links. emfile too many open files in the process enametoolong name too long enfile too many open files on the system enoent no such file or directory enomem cannot allocate memory enospc no space on device enotdir is not a directory enxio device no configured or does not support operation eopnotsupp (not always available under windows) operation not supported. eoverflow (not always available under windows) va...
...ot supported. eoverflow (not always available under windows) value too large to be stored in datatype. eperm operation not permitted erange result too large etimedout (not always available under windows) operation timed out. ewouldblock (not always available under windows) operation would block. exdev cross-device link opening files unix access rights defined on all platforms but meaningful only on unix. s_irwxu current user can read, write, execute the file. equivalent to s_irusr | s_iwusr | s_ixusr. s_irusr current user can read the file. s_iwusr current user can write (modify) the file. s_ixusr current user can execute the file. s_irwxg current gro...
...And 3 more matches
Localizing with Pontoon
and make your l10n contributions easier. are you a developer? read about implementing pontoon in your project or learn how to get involved on github. first steps pontoon's home page is very easy to use. to begin localizing the project, click on the persona icon and sign in. next, simply select the project you want to work on and your locale from the dropdown menus. pontoon will automatically open that locale's project for you to get started. note that for our purposes here, we'll be using firefox affiliates website to demo pontoon's functionality and workflow. and there it is, opened inside pontoon: main toolbar as you can see, most of the interface is taken by the website being translated. only the toolbar on top belongs to pontoon, containing the following items (from left to right)...
... for you to get started. note that for our purposes here, we'll be using firefox affiliates website to demo pontoon's functionality and workflow. and there it is, opened inside pontoon: main toolbar as you can see, most of the interface is taken by the website being translated. only the toolbar on top belongs to pontoon, containing the following items (from left to right): list of strings opens a sidebar with a list of all strings to localize. project selector (affiliates) switches between projects to localize. ...
... progress indicator displays your progress on the resource being localized. more details are available in the popup. user menu allows for user-specific tasks, like commiting to repository, downloading files and signing out. ...
...And 3 more matches
Localizing without a specialized tool
s the en-us source files concerning localization. you will use a tool called compare-locales to do the comparison between your locale's files and the en-us reference. first, install compare-locales. you can follow more detailed guidelines on compare-locale's page, but running the following command from the command line should be enough: $ sudo easy_install -u compare-locales to start, be sure to open your command line interface and change your directory to where you are keeping your localization files, the en-us sources $ cd /path/to/your/working/directory now, you will need run compare locales. to do this, enter the following commands, keeping sure to change "x-testing" to the actual locale code of your locale. $ compare-locales mozilla-1.9.2/browser/locales/l10n.ini l10n-mozilla-1.9.2 x-t...
...ping sure to change "x-testing" to the actual locale code of your locale. $ compare-locales mozilla-1.9.2/browser/locales/l10n.ini l10n-mozilla-1.9.2 x-testing for convenience, try saving the output of this command to a text file on your desktop so you can review it as you go. run: $ compare-locales mozilla-1.9.2/browser/locales/l10n.ini l10n-mozilla-1.9.2 x-testing > ~/desktop/x-testing.compare open the x-testing.compare file that is on your desktop. you should see something like this: x-testing browser chrome browser aboutcerterror.dtd // add and localize this file aboutdialog.dtd +aboutlink +aboutlink.accesskey +aboutversion +closecmdgnome.accesskey +closecmdgnome.label +copyrig...
...ng: cd ../../ where each ".." represents the prior sub directory before the main directory where you want to be. you can always check the path by typing pwd once you are in the root working directory with both en-us source and the l10n base, copy the searchbar.dtd file by typing cp mozilla-1.9.2/browser/locales/chrome/browser/searchbar.dtd l10n-mozilla-1.9.2/x-testing/browser/chrome/browser/ open the file in your x-testing directory and translate the words inside the quotation marks. be sure to only translate what is in the quotation marks. for the purposes of this tutorial, we will just convert all letters to uppercase, so that the change is visible in the ui. <!entity cmd_enginemanager.label "manage search engines..."> <!entity searchendcap.label "search"> save the ...
...And 3 more matches
MathML Accessibility in Mozilla
y end crossout __________ not supported. see webkit's bug 146543. x plus y enclosed by: a horizontal strike x + y horizontal strike enclosed x+y __________ x plus y __________ not supported. see webkit's bug 146543. x plus y enclosed by: an arabic factorial symbol x + y up madruwb enclosed abcd e __________ open a comma b comma c comma d comma e close __________ not supported. see bug 1176970 ; safari+voiceover reads "(, abcde, )". left paren. a comma. b comma. comma. d comma. e. right paren not supported. abcd e __________ the set a ; b ; c ; d ; e end set ____...
...tor a base 3 subscript scripted + 1 numerator a base 4 subscript scripted denominator fraction denominator fraction denominator fraction denominator fraction torture test 8: ( n k / 2 ) no output ( fraction start, n over k / 2, end of fraction, ) see webkit's bug 146454 left paren fraction without bar, start. n over k slash 2. fraction end. ...
...ction end. fraction start. 1 over 1 minus x. superscript 2. fraction end. torture test 10: ∑ 0 ≤ i ≤ m 0 < j < n p ( i , j ) __________ sum over fraction 0 is less than or equal to i is less than or equal to m over 0 is less than j is less than n end fraction of cap pee of open i comma j close __________ ∑ p (i, j) see webkit's bug 146407 sum. underscript fraction without bar, start. 0 less than or equal to i less than or equal to m over 0 less than j less than n. fraction end. p left paren i comma j right paren torture test 11: x 2 y __________ x raised to the 2 y power ____...
...And 3 more matches
Overview of NSS
server products from red hat: red hat directory server, red hat certificate system, and the mod_nss ssl module for the apache web server. ...
... server products from red hat: red hat directory server, red hat certificate system, and the mod_nss ssl module for the apache web server. ...
... server products from red hat: red hat directory server, red hat certificate system, and the mod_nss ssl module for the apache web server. ...
...And 3 more matches
Web Replay
behaviors that occurred while recording. devtools' debugger and console can be used to inspect and control the replay. getting started to enable web replay (macos and firefox nightly only), go to devtools settings and select "enable webreplay". web replay's features can only be used in a tab that is recording or replaying. there are a few ways to start recording a tab: record current tab open the developer tools and click the button indicated below. this will refresh the tab and start recording. the button will be colored blue when the tab is being recorded. it can be clicked again to stop recording. open a new tab in recording mode click the 'tools -> web developer -> web replay -> reload and record tab' menu item. this has the same effect as above but can be used when the ...
... click the button indicated below. this will refresh the tab and start recording. the button will be colored blue when the tab is being recorded. it can be clicked again to stop recording. open a new tab in recording mode click the 'tools -> web developer -> web replay -> reload and record tab' menu item. this has the same effect as above but can be used when the developer tools are not open. open a saved recording in a new tab click the 'tools -> web developer -> web replay -> open new recording tab' menu item to open a new blank tab that is recorded. ...
... while replaying old behavior, the tab can't be interacted with. ...
...And 3 more matches
Querying Places
section query.setparents([placesutils.bookmarks.toolbarguid], 1); let result = placesutils.history.executequery(query, options); serializing queries query and options objects can be serialized into a string starting with "place:" using queriestoquerystring. the resulting string can be stored or bookmarked. when a "place:" uri is bookmarked, it will expand to the results of the query when it is opened by the user. the original objects can be deserialized from the string using querystringtoqueries. be careful, querystringtoqueries may not return any query objects if the string was empty. your code should handle this case. there will always be an options structure returned. if no options were specified, it will have the default values. if there were no query parameters specified but the input...
...lt nodes. each result has a container representing the root of the query. it can be retrieved using the root attribute of the result. for general queries, this root container is a nsinavhistoryqueryresultnode with the query parameters and options that you supplied in the original query. for queries mapping to one bookmark folder, this will be a nsinavhistorycontainerresultnode. ...
...presenting the root of the query. it can be retrieved using the root attribute of the result. for general queries, this root container is a nsinavhistoryqueryresultnode with the query parameters and options that you supplied in the original query. for queries mapping to one bookmark folder, this will be a nsinavhistorycontainerresultnode. containers can be open or closed. ...
...And 3 more matches
Starting WebLock
was successful. this is why append is considered a string operation. the weblock component manipulates a file named weblock.txt. the following snippet adjusts the thefile object representing that file: nsembedcstring filename("weblock.txt"); appdir->appendnative(filename); manipulating files with nsifile once you have an nsifile object pointing to the file that you're interested in, you can open it and read its contents into memory. there are many ways to do this: you can use standard ansi file i/o, or nspr (see the netscape portable runtime library below for a brief description of nspr), or you can use the networking apis that gecko provides. the netscape portable runtime library thenetscape portable runtime library (nspr) is a platform-independent library that sits below xpcom. as a...
... // ... } if (buf) free(buf); the first line of the code calls queryinterface on thefile, and if that succeeds ass...
... // ... } if (buf) free(buf); the first line of the code calls queryinterface on thefile, and if that succeeds assigns the new interface point...
...And 3 more matches
mozIPlacesAutoComplete
toolkit/components/places/public/moziplacesautocomplete.idlscriptable this interface provides some constants used by the places autocomplete search provider as well as methods to track opened pages for autocomplete purposes. 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void registeropenpage(in nsiuri auri); void unregisteropenpage(in nsiuri auri); constants constant value description match_anywhere 0 match anywhere in each searchable term. match_boundary_anywhere 1 match first on word boundaries, and if we do not get enough results, then match anywhere in each searchable term. match_boundary 2 match on word boundaries in each searchable ...
...tch only the beginning of each search term. behavior_history 1 << 0 search through history. behavior_bookmark 1 << 1 search though bookmarks. behavior_tag 1 << 2 search through tags. behavior_title 1 << 3 search the title of pages. behavior_url 1 << 4 search the url of pages. behavior_typed 1 << 5 search for typed pages. behavior_javascript 1 << 6 search javascript: urls. ...
... << 0 search through history. behavior_bookmark 1 << 1 search though bookmarks. behavior_tag 1 << 2 search through tags. behavior_title 1 << 3 search the title of pages. behavior_url 1 << 4 search the url of pages. behavior_typed 1 << 5 search for typed pages. behavior_javascript 1 << 6 search javascript: urls. behavior_openpage 1 << 7 search for pages that have been marked as being opened, such as a tab in a tabbrowser. ...
...And 3 more matches
mozIStorageConnection
read only. databasefile nsifile the current database nsifile. null if the database connection refers to an in-memory database. read only. lasterror long the last sqlite error code that occurred. read only. note: this is not reliable if you are using asynchronous statement...
...read only. ...
...in mozistoragecompletioncallback acallback optional ); parameters acallback optional an optional callback handler to be executed when the connection is successfully closed. that object's mozistoragecompletioncallback.complete() routine will be called once the connection is closed. exceptions thrown ns_error_unexpected thrown if the method was called on a thread other than the one that opened the connection. begintransaction() starts a new transaction deferred transaction. this is the same as calling mozistorageconnection with mozistorageconnection.transaction_deferred. void begintransaction(); parameters none. begintransactionas() this method starts a new transaction of the given transaction type. see the sqlite documentation on transactions for more details. in javascri...
...And 3 more matches
nsICacheEntryDescriptor
netwerk/cache/nsicacheentrydescriptor.idlscriptable this interface provides a cache entry descriptor. ...
...s interface provides a cache entry descriptor. inherits from: nsicacheentryinfo last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void close(); void doom(); void doomandfailpendingrequests(in nsresult status); string getmetadataelement(in string key); void markvalid(); nsiinputstream openinputstream(in unsigned long offset); nsioutputstream openoutputstream(in unsigned long offset); void setdatasize(in unsigned long size); void setexpirationtime(in pruint32 expirationtime); void setmetadataelement(in string key, in string value); void visitmetadata(in nsicachemetadatavisitor visitor); attributes attribute type description accessgranted nscacheaccessmode get the access granted to this descriptor. see nsicache for the defin...
... charset, but they must be null terminated. string getmetadataelement( in string key ); parameters key the key for retrieving the meta data. return value returns the string value containing the meta data for the provided key. markvalid() this method means that a writer must validate this cache object before any readers are given a descriptor to the object. void markvalid(); parameters none. ...
...And 3 more matches
nsIDynamicContainer
toolkit/components/places/public/nsidynamiccontainer.idlscriptable this interface provides a base class for services that want to provide containers for temporary contents. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) the service can fill result nodes directly into the container when it is opened. ...
...property bag on every result node to store data associated with each item, such as a full path on disk. it can also create additional containers for each container, registered to its service. method overview void oncontainermoved(in long long aitemid, in long long anewparent, in long anewindex); void oncontainernodeclosed(in nsinavhistorycontainerresultnode acontainer); void oncontainernodeopening(in nsinavhistorycontainerresultnode acontainer, in nsinavhistoryqueryoptions aoptions); void oncontainerremoving(in long long aitemid); methods oncontainermoved() this method is called when the given container has just been moved, in case the service needs to do any bookkeeping. it is called after the container has been moved. void oncontainermoved( in long long aitemid, in long long ...
...ex at which the container will be inserted, or "-1" to append to the end of the list. oncontainernodeclosed() this method is called when the given container has just been collapsed so that the service can do any necessary cleanup. this is not guaranteed to get called. in particular, if the query just goes away, you will not get this call. this only happens when the container itself goes from the open state to the closed state. a service with large numbers of dynamically populated items might use this to do some cleanup so those items don't hang around. void oncontainernodeclosed( in nsinavhistorycontainerresultnode acontainer ); parameters acontainer the container node of the container being closed. the service need not worry about removing any created nodes, they will be automatically re...
...And 3 more matches
nsIMsgDBView
omponents.interfaces.nsimsgdbview); where type designates different types of view's available. available in the mozilla codebase are types "quicksearch", "threadswithunread", "watchedthreadswithunread", "xfvf" (virtual folders), "search", "group", and "threaded" each with their own implementation of nsimsgdbview that provides a different sorting/view of the data. ...
...ad", "watchedthreadswithunread", "xfvf" (virtual folders), "search", "group", and "threaded" each with their own implementation of nsimsgdbview that provides a different sorting/view of the data. ...
...db nsimsgdatabase readonly: the current database of messages. supportsthreading boolean readonly: does the current database support threading? searchsession nsimsgsearchsession the current search session. removerowonmoveordelete boolean readonly: usinglines boolean readonly: use lines for size. if false kb are used. methods open() opens a folder in the database. void open(in nsimsgfolder folder, in nsmsgviewsorttypevalue sorttype, in nsmsgviewsortordervalue sortorder, in nsmsgviewflagstypevalue viewflags, out long count); parameters folder the nsimsgfolder to open. sorttype a nsmsgviewsorttypevalue designating the sort type used for the folder. defined in the interfa...
...And 3 more matches
Storage
this document covers the storage api and some peculiarities of sqlite. it does not cover sql or "regular" sqlite. you can find some very useful links in the see also section however. for storage api help, you can post to mozilla.dev.apps.platform on the news server news.mozilla.org. to report bugs, use bugzilla. the overall procedure for use is: get the storage service - mozistorageservice. ...
... server news.mozilla.org. to report bugs, use bugzilla. the overall procedure for use is: get the storage service - mozistorageservice. open a connection to the database of your choice - mozistorageconnection. create statements to execute on the connection - mozistoragestatement. bind parameters to a statement as necessary. execute the statement. check for errors. reset the statement. ...
...e bugzilla. the overall procedure for use is: get the storage service - mozistorageservice. open a connection to the database of your choice - mozistorageconnection. create statements to execute on the connection - mozistoragestatement. bind parameters to a statement as necessary. execute the statement. check for errors. reset the statement. ...
...And 3 more matches
Index
d to create a new compose window on every new mail message or reply. but we noticed that the common usage pattern is to compose, send, compose, send, compose send. we decided it would be worth the trouble to cache the compose window. if the user has this usage pattern, we wouldn't have to create a new window. we could just hide it on send, and then show it on the next compose. if the user opens (but never sends or closes compose windows), this trick will not apply to them. but this is not a common usage model. how do i test it? on window and mac, the cached compose window is on by default. to test it 17 content tabs thunderbird content tabs enable thunderbird to display remote content in a tab, which users can browse in (mostly) the same way as with a browser...
...pply to them. but this is not a common usage model. how do i test it? on window and mac, the cached compose window is on by default. to test it 17 content tabs thunderbird content tabs enable thunderbird to display remote content in a tab, which users can browse in (mostly) the same way as with a browser. for example, invoking thunderbird's help | what's new menu option opens a tab that displays web content. the thunderbird team can update this content via the website at any time. 18 cookies in thunderbird cookies, guide, thunderbird in versions of thunderbird prior to 3 the cookie policy was very restrictive (to rss only). thunderbird 3 uses the gecko cookie policy with some changes. 19 creating a gloda message query thunderbird 3...
...hunderbird components thunderbird the thunderbird mail application is a group of components built on a set of technologies that can seem daunting to new developers. however, in many cases you only need to learn a few concepts to write an extension. 74 building a thunderbird extension 1: introduction add-ons, extensions, thunderbird thunderbird is a community managed open-source email application. it shares many of the technologies used by mozilla firefox, including javascript, the gecko layout engine, the xul xml user interface language and the xpcom cross-platform component object model. similar to firefox, thunderbird functionality can be enhanced and customized via extensions. 75 building a thunderbird extension 2: extension file layout extensio...
...And 3 more matches
Zombie compartments
ent(about:blank) compartment([system principal], resource://gre/modules/addons/xpiprovider.jsm) when looking at user compartments there are a couple of things to be aware of. first, many sites utilize scripts from other sites to provide advertisements, "like" and "+1" buttons, twitter feeds, etc. so it's common for multiple compartments to be created for a single web page. for example, if i open www.techcrunch.com the following compartments are created. compartment(http://techcrunch.com/) compartment(http://www.facebook.com/plugins/like.php?...) compartment(https://plusone.google.com/_/+1/fastbutton?...) compartment(http://platform.twitter.com/widgets/...utton.html?...) compartment(http://cdn.at.atwola.com/_media/uac/tcode3.html) compartment(https://s-static.ak.fbcdn.net/connec..
...m/adserving/getads.jsp?...) (some of those compartment urls are long and have been truncated.) another thing to beware is each compartment is created for an origin (e.g. https://www.facebook.com/), but the name of the compartment includes all the trailing gunk (e.g. "plugins/like.php?..."). this trailing gunk can be misleading and you shouldn't pay too much attention to it. ...
.../www.facebook.com/), but the name of the compartment includes all the trailing gunk (e.g. "plugins/like.php?..."). this trailing gunk can be misleading and you shouldn't pay too much attention to it. for example, if i open https://bugzilla.mozilla.org/show_bug.cgi?id=668871 in one tab, then compartment(https://bugzilla.mozilla.org/show_bug.cgi?id=668871) will show up in about:memory. if i then open https://bugzilla.mozilla.org/show_bug.cgi?id=700547 and close the first tab, the same compartment will continue to be used. so i'll end up with a compartment whose name doesn't match the only page open from that origin. this can be confusing at first, so be ready for it. when are compartments destroyed? compartments are destroyed when they are garbage collected. this happens some time after ...
...And 3 more matches
Working with ArrayBuffers
nter to buffer (based on //github.com/realityripple/uxp/blob/master/js/src/ctypes/ctypes.cpp#3080). further, it returns datapointer, and there is no extra allocation (based on //github.com/realityripple/uxp/blob/master/js/src/vm/arraybufferobject.cpp#1301). ...
...pes/ctypes.cpp#3080). further, it returns datapointer, and there is no extra allocation (based on //github.com/realityripple/uxp/blob/master/js/src/vm/arraybufferobject.cpp#1301). ...
... allocation (based on //github.com/realityripple/uxp/blob/master/js/src/vm/arraybufferobject.cpp#1301). ...
...And 3 more matches
Mozilla
r exploring the various parts of the codebase. android-specific test suites there are several android-specific test suites that run on the firefox for android codebase: api change rules until further notice, the following rules govern api changes: application cache implementation overview this happens in nshttpchannel::opencacheentry(). all top level document loading (navigation) channels are set chooseapplicationcache flag, which happens in nsdocshell::douriload(). channels having that flag set are searching for nsiapplicationcache object prior inspecting normal http cache. nsiapplicationcacheservice::chooseapplicationcache is given the url the channel is about to load. it synchronously returns an nsiap...
...e the window's content area. toolbars, menu bars, progress bars, and window title bars are all examples of elements that are typically part of the chrome. command line options command line options are used to specify various startup options for mozilla applications.this page describes the commonly used options and how to use them. you can open the command line interface by pressing shift + f2. continuous integration when you push a commit to mozilla-central or a related repository, it initiates a large chain of builds and tests across multiple types of infrastructure. this document will help you understand all the pieces that comprise mozilla's continuous integration systems. ...
...ace which is implemented by some external code and this implementation is passed to the component. the component can then call methods on the observer interface to signal the external code when predefined events occur. here is a very simple example of the observer pattern: creating mozsearch plugins firefox 2 uses a simplified form of the opensearch format for storing search plugins. a mozsearch search plugin is an xml file that describes the search engine, its url, and the parameters that need to be passed to that url. creating reftest-based unit tests the reftest harness compares the display of two web pages. if the bitmaps resulting from displaying the two files in an 800x10...
...And 3 more matches
Introduction to DOM Inspector - Firefox Developer Tools
e mozilla add-ons web site. (note: this is now a dead link.) when you first start the dom inspector, you are presented with a two-pane application window that looks a little like the main mozilla browser. like the browser, the dom inspector includes an address bar, and some of the same menus. in seamonkey additional global menus will be available. inspecting a document when the dom inspector opens, it may or may not load an associated document, depending on the host application. if the dom inspector doesn't automatically load a document or loads a document other than the one you'd like to inspect, you can select the desired document a few different ways. inspecting content documents the inspect content document menupopup can be accessed from the file menu, and it will list currently loa...
...om inspector doesn't automatically load a document or loads a document other than the one you'd like to inspect, you can select the desired document a few different ways. inspecting content documents the inspect content document menupopup can be accessed from the file menu, and it will list currently loaded content documents. in firefox and seamonkey browser, these will be the webpages you have opened in tabs. for thunderbird and seamonkey mail and news, any messages you're viewing will be listed here. inspecting chrome documents the inspect chrome document menupopup can be accessed from the file menu , and it will contain the list of currently loaded chrome windows and subdocuments. a browser window and the dom inspector are likely be already open and displayed in this list. the dom inspe...
...l and news, any messages you're viewing will be listed here. inspecting chrome documents the inspect chrome document menupopup can be accessed from the file menu , and it will contain the list of currently loaded chrome windows and subdocuments. a browser window and the dom inspector are likely be already open and displayed in this list. the dom inspector keeps track of all the windows that are open, so to inspect the dom of a particular window in the dom inspector, simply access that window as you would normally and then choose its title from this dynamically updated menulist. inspecting arbitrary urls you may also inspect the dom of arbitrary urls by using the inspect a url menuitem in the file menu, or by just entering a url into the dom inspector's address bar and clicking inspect or...
...And 3 more matches
Using files from web applications - Web APIs
you can do this by styling the input element with display:none and calling the click() method on the <input> element. consider this html: <input type="file" id="fileelem" multiple accept="image/*" style="display:none"> <button id="fileselect">select some files</button> the code that handles the click event can look li...
...note that in this case the input element must not be hidden using display: none (nor visibility: hidden), otherwise the label would not be keyboard-accessible. use the visually-hidden technique...
...es the click event can look like this: const fileselect = document.getelementbyid("fileselect"), fileelem = document.getelementbyid("fileelem"); fileselect.addeventlistener("click", function (e) { if (fileelem) { fileelem.click(); } }, false); you can style the new button for opening the file picker as you wish. using a label element to trigger a hidden file input element to allow opening the file picker without using javascript (the click() method), a <label> element can be used. note that in this case the input element must not be hidden using display: none (nor visibility: hidden), otherwise the label would not be keyboard-accessible. use the visually-hidden technique instead. consider this html: <input type="file" id="fileelem" multiple accept="image/*" class="visually-hi...
...And 3 more matches
Using FormData Objects - Web APIs
er 123456 is immediately converted to a string "123456" // html file input, chosen by user formdata.append("userfile", fileinputelement.files[0]); // javascript file-like object var content = '<a id="a"><b id="b">hey!</b></a>'; // the body of the new file... var blob = new blob([content], { type: "text/xml"}); formdata.append("webmasterfile", blob); var request = new xmlhttprequest(); request.open("post", "http://foo.com/submitform.php"); request.send(formdata); note: the fields "userfile" and "webmasterfile" both contain a file. the number assigned to the field "accountnum" is immediately converted into a string by the formdata.append() method (the field's value can be a blob, file, or a string: if the value is neither a blob nor a file, the value is converted to a string). this exampl...
...ta object from an html form to construct a formdata object that contains the data from an existing <form>, specify that form element when creating the formdata object: note: formdata will only use input fields that use the name attribute. ...
... sending files using a formdata object you can also send files using formdata. ...
...And 3 more matches
IDBIndex - Web APIs
Web › API › IDBIndex
turns an idbrequest object, in a separate thread, finds all matching values in the referenced object store that correspond to the given key or are in range, if key is an idbkeyrange. idbindex.getallkeys() returns an idbrequest object, in a separate thread, finds all matching keys in the referenced object store that correspond to the given key or are in range, if key is an idbkeyrange. ...
...e given key or are in range, if key is an idbkeyrange. idbindex.getallkeys() returns an idbrequest object, in a separate thread, finds all matching keys in the referenced object store that correspond to the given key or are in range, if key is an idbkeyrange. idbindex.opencursor() returns an idbrequest object, and, in a separate thread, creates a cursor over the specified key range. ...
...hat correspond to the given key or are in range, if key is an idbkeyrange. idbindex.opencursor() returns an idbrequest object, and, in a separate thread, creates a cursor over the specified key range. idbindex.openkeycursor() returns an idbrequest object, and, in a separate thread, creates a cursor over the specified key range, as arranged by this index. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. we then open a basic cursor on the index using idbindex.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the index, not the primary key. finally, we iterate through each record, and inser...
...And 3 more matches
IDBKeyRange.bound() - Web APIs
Web › API › IDBKeyRange › bound
the bound() method of the idbkeyrange interface creates a new key range with the specified upper and lower bounds. the bounds can be open (that is, the bounds exclude the endpoint values) or closed (that is, the bounds include the endpoint values). by default, the bounds are closed. note: this feature is available in web workers. syntax var myidbkeyrange = idbkeyrange.bound(lower, upper); var myidbkeyrange = idbkeyrange.bound(lower, upper, loweropen); var myidbkeyrange = idbkeyrange.bound(lower, upper, loweropen, upperopen); parameters lower specifies the lower bound of the new key range. upper specifies the upper bound of the new key range. ...
...the default is false. ...
...the default is false. return value idbkeyrange: the newly created key range. ...
...And 3 more matches
IDBObjectStore.clear() - Web APIs
events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description readonlyerror the transaction associated with this operation is in read-only mode. transactioninactiveerror this idbobjectstore's transaction is inactive. ...
...ssociated with this operation is in read-only mode. transactioninactiveerror this idbobjectstore's transaction is inactive. example in the following code snippet, we open a read/write transaction on our database and clear all the current data out of the object store using clear(). ...
...ation is in read-only mode. transactioninactiveerror this idbobjectstore's transaction is inactive. example in the following code snippet, we open a read/write transaction on our database and clear all the current data out of the object store using clear(). for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...And 3 more matches
IDBTransaction.objectStore() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description notfounderror the requested object store is not in this transaction's scope. invalidstateerror the request was made on a source object that has been deleted or removed, or if the transaction has finished. ...
...ansaction's scope. invalidstateerror the request was made on a source object that has been deleted or removed, or if the transaction has finished. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot be...
...ent of success or failure. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...And 3 more matches
IDBTransaction.onabort - Web APIs
the onabort event handler of the idbtransaction interface handles the abort event, fired, when the current transaction is aborted via the idbtransaction.abort method. note: this feature is available in web workers. syntax transaction.onabort = function(event) { ... }; example in the following code snippet, we open a read/write transaction on our database and add some data to an object store. ...
...ransaction is aborted via the idbtransaction.abort method. note: this feature is available in web workers. syntax transaction.onabort = function(event) { ... }; example in the following code snippet, we open a read/write transaction on our database and add some data to an object store. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. note the transaction.onabort = function(event) { }; block, reporting when the transaction has been aborted. ...
...r database and add some data to an object store. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. note the transaction.onabort = function(event) { }; block, reporting when the transaction has been aborted. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...And 3 more matches
IDBTransaction - Web APIs
ons." even if these constants are now deprecated, you can still use them to provide backward compatibility if required (in chrome the change was made in version 21). ...
...fensively in case the object is not available anymore: var myidbtransaction = window.idbtransaction || window.webkitidbtransaction || { read_write: "readwrite" }; examples in the following code snippet, we open a read/write transaction on our database and add some data to an object store. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db // variable. this is used a lot be...
...ent of success or failure. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db // variable. ...
...And 3 more matches
IDBVersionChangeEvent - Web APIs
note: this feature is available in web workers. properties also inherits properties from its parent, method. idbversionchangeevent.oldversion read only returns the old version of the database. idbversionchangeevent.newversion read only returns the new version of the database. deprecated properties idbversionchangeevent.version read only the new version of the database in a versionchange transaction. ...
... in a versionchange transaction. warning: while this property is still implemented in older browsers, the latest specification replaces it with the oldversion and newversion attributes. see the compatibility table to know what browsers support them. methods no specific method, but inherits properties from its parent, method. example in the following code snippet, we make a request to open a database, and include handlers for the success and error cases. upon a version change (after an upgradedneeded event), the success event will implement the idbversionchangeevent interface. for a full working example, see our to-do notifications app (view example live.) var note = document.queryselector("ul"); // in the following line, you should include the prefixes of implementations you wan...
...indexeddb = ..." if you're not in a function. ...
...And 3 more matches
WebRTC API - Web APIs
ntity management, and interfacing with legacy telephone systems including support for sending dtmf (touch-tone dialing) signals. connections between peers can be made without requiring any special drivers or plug-ins, and can often be made without any intermediary servers. connections between two peers are represented by the rtcpeerconnection interface. once a connection has been established and opened using rtcpeerconnection, media streams (mediastreams) and/or data channels (rtcdatachannels) can be added to the connection. media streams can consist of any number of tracks of media information; tracks, which are represented by objects based on the mediastreamtrack interface, may contain one of a number of types of media data, including audio, video, and text (such as subtitles or even chapt...
... a primary channel for data transfer. more details and links to relevant guides and tutorials needed webrtc reference because webrtc provides interfaces that work together to accomplish a variety of tasks, we have divided up the reference by category. please see the sidebar for an alphabetical list. connection setup and management these interfaces, dictionaries, and types are used to set up, open, and manage webrtc connections. included are interfaces representing peer media connections, data channels, and interfaces used when exchanging information on the capabilities of each peer in order to select the best possible configuration for a two-way media connection. interfaces rtcpeerconnection represents a webrtc connection between the local computer and a remote peer. it is used to ha...
...r the closing event instead. closing the rtcdatachannel has transitioned to the closing state, indicating that it will be closed soon. you can detect the completion of the closing process by watching for the close event. connectionstatechange the connection's state, which can be accessed in connectionstate, has changed. datachannel a new rtcdatachannel is available following the remote peer opening a new data channel. this event's type is rtcdatachannelevent. error an rtcerrorevent indicating that an error occurred on the data channel. error an rtcerrorevent indicating that an error occurred on the rtcdtlstransport. this error will be either dtls-failure or fingerprint-failure. gatheringstatechange the rtcicetransport's gathering state has changed. icecandidate an rtcpeerconnecti...
...And 3 more matches
Writing WebSocket client applications - Web APIs
servers using the websocket protocol. note: this feature is available in web workers. note: the example snippets in this article are taken from our websocket chat client/server sample. see the code, then try out the example for yourself. creating a websocket object in order to communicate using the websocket protocol, you need to create a websocket object; this will automatically attempt to open the connection to the server. the websocket constructor accepts one required and one optional parameter: websocket = new websocket(url, protocols); url the url to which to connect; this should be the url to which the websocket server will respond. this should use the url scheme wss://, although some software may allow you to use the insecure ws:// for local connections. protocols optional...
...s this simple example creates a new websocket, connecting to the server at wss://www.example.com/socketserver. a custom protocol of "protocolone" is named in the request for the socket in this example, though this can be omitted. var examplesocket = new websocket("wss://www.example.com/socketserver", "protocolone"); on return, examplesocket.readystate is connecting. ...
...rver at wss://www.example.com/socketserver. a custom protocol of "protocolone" is named in the request for the socket in this example, though this can be omitted. var examplesocket = new websocket("wss://www.example.com/socketserver", "protocolone"); on return, examplesocket.readystate is connecting. the readystate will become open once the connection is ready to transfer data. if you want to open a connection and are flexible about the protocols you support, you can specify an array of protocols: var examplesocket = new websocket("wss://www.example.com/socketserver", ["protocolone", "protocoltwo"]); once the connection is established (that is, readystate is open), examplesocket.protocol will tell you which protocol the server selected. establishing a websocket relies on the http upgra...
...And 3 more matches
Window.close() - Web APIs
Web › API › Window › close
the window.close() method closes the current window, or the window on which it was called. this method can only be called on windows that were opened by a script using the window.open() method. if the window was not opened by a script, an error similar to this one appears in the console: scripts may not close windows that were not opened by script. note also that close() has no effect when called on window objects returned by htmliframe​element​.content​window. ...
...indows that were opened by a script using the window.open() method. if the window was not opened by a script, an error similar to this one appears in the console: scripts may not close windows that were not opened by script. note also that close() has no effect when called on window objects returned by htmliframe​element​.content​window. syntax window.close(); examples closing a window opened with window.open() this example shows a method which opens a window and a second one which closes the window; this demonstrates how to use window.close() to close a window opened by calling window.open(). ...
... effect when called on window objects returned by htmliframe​element​.content​window. syntax window.close(); examples closing a window opened with window.open() this example shows a method which opens a window and a second one which closes the window; this demonstrates how to use window.close() to close a window opened by calling window.open(). ...
...And 3 more matches
HTML in XMLHttpRequest - Web APIs
r http error pages (which often have a text/html response body). usage retrieving an html resource as a dom using xmlhttprequest works just like retrieving an xml resource as a dom using xmlhttprequest, except you can't use the synchronous mode and you have to explicitly request a document by assigning the string "document" to the responsetype property of the xmlhttprequest object after calling open() but before calling send(). var xhr = new xmlhttprequest(); xhr.onload = function() { console.log(this.responsexml.title); } xhr.open("get", "file.html"); xhr.responsetype = "document"; xhr.send(); feature detection method 1 this method relies on the "force async" nature of the feature. when you try to set responsetype of an xmlhttprequest object after it is opened as "sync". this throws ...
...r.send(); feature detection method 1 this method relies on the "force async" nature of the feature. when you try to set responsetype of an xmlhttprequest object after it is opened as "sync". this throws an error in the browsers that implement the feature and works on others. function htmlinxhr() { if (!window.xmlhttprequest) return false; var req = new window.xmlhttprequest(); req.open('get', window.location.href, false); try { req.responsetype = 'document'; } catch(e) { return true; } return false; } view on jsfiddle this method is synchronous, does not rely on external assets though it may not be as reliable as method 2 described below since it does not check the actual feature but an indication of that feature. method 2 there are two challenges to detec...
...} var done = false; var xhr = new window.xmlhttprequest(); xhr.onreadystatechange = function() { if (this.readystate == 4 && !done) { done = true; callback(!!(this.responsexml && this.responsexml.title && this.responsexml.title == "&&<")); } } xhr.onabort = xhr.onerror = function() { if (!done) { done = true; callback(false); } } try { xhr.open("get", "detect.html"); xhr.responsetype = "document"; xhr.send(); } catch (e) { window.settimeout(function() { if (!done) { done = true; callback(false); } }, 0); } } the argument callback is a function that will be called asynchronously with true as the only argument if html parsing is supported and false as the only argument if html parsing is n...
...And 3 more matches
Synchronous and asynchronous requests - Web APIs
g" on the screen and an unresponsive user experience. asynchronous request if you use an asynchronous xmlhttprequest, you receive a callback when the data has been received. this lets the browser continue to work as normal while your request is being handled. example: send a file to the console log this is the simplest usage of asynchronous xmlhttprequest. ...
...ener. function xhrsuccess() { this.callback.apply(this, this.arguments); } function xhrerror() { console.error(this.statustext); } function loadfile(url, callback /*, opt_arg1, opt_arg2, ... ...
... usage: function showmessage (message) { console.log(message + this.responsetext); } loadfile("message.txt", 2000, showmessage, "new message!\n"); here, we're specifying a timeout of 2000 ms. note: support for timeout was added ...
...And 3 more matches
@font-face - CSS: Cascading Style Sheets
the @font-face css at-rule specifies a custom font with which to display text; the font can be loaded from either a remote server or a locally-installed font on the user's own computer. syntax @font-face { font-family: "open sans"; src: url("/fonts/opensans-regular-webfont.woff2") format("woff2"), url("/fonts/opensans-regular-webfont.woff") format("woff"); } descriptors font-display determines how a font face is displayed based on whether and when it is downloaded and ready to use. font-family specifies a name that will be used as the font face value for font properties. font-stretch a font-stretch value. since firefox 61 (and in other modern browsers) this also accepts two values to specify a range that is supported by a font-face, for example font-stretch: 50% 200%; f...
...a range that is supported by a font-face, for example font-style: oblique 20deg 50deg; font-weight a font-weight value. since firefox 61 (and in other modern browsers) this also accepts two values to specify a range that is supported by a font-face, for example font-weight: 100 400; font-variant a font-variant value. font-feature-settings allows control over advanced typographic features in opentype fonts. font-variation-settings allows low-level control over opentype or truetype font variations, by specifying the four letter axis names of the features to vary, along with their variation values. src specifies the resource containing the font data. this can be a url to a remote font file location or the name of a font on the user's computer. to provide the browser with a hint as t...
...file location or the name of a font on the user's computer. to provide the browser with a hint as to what format a font resource is — so it can select a suitable one — it is possible to include a format type inside a format() function: src: url(ideal-sans-serif.woff) format("woff"), url(basic-sans-serif.ttf) format("truetype"); the available types are: "woff", "woff2", "truetype", "opentype", "embedded-opentype", and "svg". unicode-range the range of unicode code points to be used from the font. description if the local() function is provided, specifying a font name to look for on the user's computer, and the user agent finds a match, that local font is used. otherwise, the font resource specified using the url() function is downloaded and used. by allowing authors to pr...
...And 3 more matches
Getting Started - Developer guides
ving a function name, you can use the javascript technique of defining functions on the fly (called "anonymous functions") to define the actions that will process the response, like this: httprequest.onreadystatechange = function(){ // process the server response here. }; next, after declaring what happens when you receive the response, you need to actually make the request, by calling the open() and send() methods of the http request object, like this: httprequest.open('get', 'http://www.example.org/some.file', true); httprequest.send(); the first parameter of the call to open() is the http request method – get, post, head, or another method supported by your server. keep the method all-capitals as per the http standard, otherwise some browsers (like firefox) might not process t...
...se some browsers (like firefox) might not process the request. for more information on the possible http request methods, check the w3c specs. the second parameter is the url you're sending the request to. as a security feature, you cannot call urls on 3rd-party domains by default. be sure to use the exact domain name on all of your pages or you will get a "permission denied" error when you call open(). a common pitfall is accessing your site by domain.tld, but attempting to call pages with www.domain.tld. if you really need to send a request to another domain, see http access control (cors). the optional third parameter sets whether the request is asynchronous. if true (the default), javascript execution will continue and the user can interact with the page while the server response has yet...
... do whatever you want with the data the server sent. you have two options to access that data: httprequest.responsetext – returns the server response as a string of text httprequest.responsexml – returns the response as an xmldocument object you can traverse with javascript dom functions note that the steps above are valid only if you used an asynchronous request (the third parameter of open() was unspecified or set to true). if you used a synchronous request you don't need to specify a function, but this is highly discouraged as it makes for an awful user experience. step 3 – a simple example let's put it all together with a simple http request. our javascript will request an html document, test.html, which contains the text "i'm a test." then we'll alert() the contents of the r...
...And 3 more matches
Large-Allocation - HTTP
not currently be redirected into a new process. this error is displayed when loading a document with a large-allocation header with a non-get http method. this could be caused due to the document being loaded by a form submission, for example. a large-allocation header was ignored due to the presence of windows which have a reference to this browsing context through the frame hierarchy or window.opener. this error means that the document was not loaded at the top level of an user-opened or noopener-opened tab or window. it can occur in these situations: the document with the large-allocation header was loaded in an <iframe>. firefox cannot move an iframe into a new process currently, so the document must load in the current process. the document with the large-allocation header was ...
...the document was not loaded at the top level of an user-opened or noopener-opened tab or window. it can occur in these situations: the document with the large-allocation header was loaded in an <iframe>. firefox cannot move an iframe into a new process currently, so the document must load in the current process. the document with the large-allocation header was loaded in a window which was opened by window.open(), <a target="_blank"> or other similar methods without rel="noopener" or the "noopener" feature being set. these windows must remain in the same process as their opener, as they can communicate, meaning that we cannot allow them to switch processes. ...
...this is for the same reason as above, namely that they can communicate and thus we cannot allow them to switch processes. ...
...And 3 more matches
HTTP Index - HTTP
Web › HTTP › Index
1 http http, hypertext, reference, tcp/ip, web, web development, l10n:priority hypertext transfer protocol (http) is an application-layer protocol for transmitting hypermedia documents, such as html. it was designed for communication between web browsers and web servers, but it can also be used for other purposes. http follows a classical client-server model, with a client opening a connection to make a request, then waiting until it receives a response. http is a stateless protocol, meaning that the server does not keep any data (state) between two requests. though often based on a tcp/ip layer, it can be used on any reliable transport layer, that is, a protocol that doesn't lose messages silently like udp does. rudp — the reliable update of udp — is a suitable alt...
.... 14 configuring servers for ogg media audio, http, media, ogg, video this guide covers a few server configuration changes that may be necessary for your web server to correctly serve ogg media files. 15 connection management in http/1.x connection management, guide, http, networking, performance, webmechanics connection management is a key topic in http: opening and maintaining connections largely impacts the performance of web sites and web applications. in http/1.x, there are several models: short-lived connections, persistent connections, and http pipelining. 16 content security policy (csp) csp, content security policy, reference, security content security policy (csp) is an added layer of security that helps to detect and mi...
...eader, reference, header the clear-site-data header clears browsing data (cookies, storage, cache) associated with the requesting website. it allows web developers to have more control over the data stored locally by a browser for their origins. 69 connection http, headers, reference, web the connection general header controls whether or not the network connection stays open after the current transaction finishes. if the value sent is keep-alive, the connection is persistent and not closed, allowing for subsequent requests to the same server to be done. 70 content-disposition http, reference, header in a multipart/form-data body, the http content-disposition general header is a header that can be used on the subpart of a multipart body to give in...
...And 3 more matches
Image file type and format guide - Web media technologies
by two d-bit values: the intensity of the greyscale pixel and an alpha sample, indicating how opaque the pixel is. true color with alpha 8 and 16 each pixel is comprised of four d-pixel color components: red, green, blue, and the alpha sample indicating how opaque the pixel is. compression lossless licensing free and open under the creative commons attribution-sharealike license (cc-by-sa) version 3.0 or later. bmp (bitmap file) the bmp (bitmap image) file type is most prevalent on windows computers, and is generally used only for special cases in web apps and content. note: you should typically avoid using bmp for web site content, as it's not a generally-accepted use of the format. bmp theoretically ...
... bmp has no distinct grayscale format. true color with alpha 8 and 16 each pixel is represented by four values representing the red, green, blue, and alpha color components; each is d bits. compression several compression methods are supported, including lossy or lossless algorithms licensing covered by the microsoft open specification promise; while microsoft holds patents against bmp, they have published a promise not to assert its patent rights as long as specific conditions are met. this is not the same as a license, however. bmp is included under the windows metafile format (.wmf). gif (graphics interchange format) in 1987, the compuserve online service provider introduced the gif (graphics interchang...
...defined as 8 bits each of red, green, and blue (24 total bits per pixel). greyscale with alpha n/a gif does not provide a dedicated greyscale format. true color with alpha n/a gif does not support true color pixels. compression lossless (lzw) licensing while the gif format itself is open, the lzw compression algorithm was covered by patents until the early 2000s. as of july 7, 2004, all relevant patents have expired and the gif format may be used freely ico (microsoft windows icon) the ico (microsoft windows icon) file format was designed by microsoft for desktop icons of windows systems. however, early versions of internet explorer introduced the ability for a web site t...
...And 3 more matches
2015 MDN Fellowship Program - Archive of obsolete content
developerfellowship wiki page. announcing the mdn fellows! blog post, may 14 2015. mdn fellows successfully oriented blog post, july 6 2015. mdn fellows: what they did & what’s next blog post, september 23, 2015. 2015 mdn fellowship program launching in q1 2015, the mozilla developer fellowship intends to accelerate the involvement of highly-skilled and experienced web developers with the open web. who web and mobile developers with an established track record of contributions and expertise in a specific web technology, function or domain who wish to increase the effectiveness of their teaching and communications. what seven weeks of partnering closely with mozilla to (1) build curriculum, code, or likely both; and (2) receive coaching, training and best practices for effectively c...
...uild curriculum, code, or likely both; and (2) receive coaching, training and best practices for effectively communicating and educating with technical information. we expect this to be between 5-10 hours of your time per week. specific projects (we encourage you to target one of these in your application): testthewebforward brief project description mozilla participates in an important w3c open testing initiative, testthewebforward.com. to support our efforts, the fellow will review various technical specifications to identify gaps between the documentation and current situation and refine existing tests to adapt to this cross-browser test harness. activities and deliverables identify gaps between existing documentation and current development environments. the work would entail refin...
...red skills and experience experienced web developer with expertise in javascript, css, html as well as with efficient network interaction (queuing resource fetching, etc.). self-starter and autonomous worker mentor information brittany storoz, mozilla apps engineering. github: brittanystoroz twitter: @brittanystoroz webgl brief project description webgl is the latest incarnation of the opengl family of real time rendering immediate mode graphics apis. webgl is getting some cool new features in 2015 with the standardization efforts around the webgl 2.0 spec being published. activities and deliverables help us develop a curriculum on mdn for teaching developers new to graphics programming the webgl apis. required skills and experience computer graphics experience with programmable...
...And 2 more matches
io/file - Archive of obsolete content
n array of file names in the given directory. parameters path : string the path of the directory. returns array : an array of file names. each is a basename, not a full path. mkpath(path) makes a new directory named by the given path. any subdirectories that do not exist are also created. mkpath can be called multiple times on the same path. parameters path : string the path to create. open(path, mode) returns a stream providing access to the contents of a file. parameters path : string the path of the file to open. mode : string an optional string, each character of which describes a characteristic of the returned stream. if the string contains "r", the file is opened in read-only mode. "w" opens the file in write-only mode. "b" opens the file in binary mode. if "b" is n...
...stream providing access to the contents of a file. parameters path : string the path of the file to open. mode : string an optional string, each character of which describes a characteristic of the returned stream. if the string contains "r", the file is opened in read-only mode. "w" opens the file in write-only mode. "b" opens the file in binary mode. if "b" is not present, the file is opened in text mode, and its contents are assumed to be utf-8. if mode is not given, "r" is assumed, and the file is opened in read-only text mode. apart from these options, this api always passes the following options: create_file, truncate (see //github.com/realityripple/uxp/blob/master/nsprpub/pr/include/prio.h#550). this means that: if the file does not exist it is created if the file exis...
... if mode is not given, "r" is assumed, and the file is opened in read-only text mode. apart from these options, this api always passes the following options: create_file, truncate (see //github.com/realityripple/uxp/blob/master/nsprpub/pr/include/prio.h#550). this means that: if the file does not exist it is created if the file exists, its length is truncated to zero it is not possible to open the file in append mode. returns stream : if the file is opened in text read-only mode, a textreader is returned, and if text write-only mode, a textwriter is returned. see text-streams for information on these text stream objects. if the file is opened in binary read-only mode, a bytereader is returned, and if binary write-only mode, a bytewriter is returned. see byte-streams for more informa...
...And 2 more matches
window/utils - Archive of obsolete content
functions for working with browser windows. usage private windows with this module your add-on will see private browser windows even if it has not explicitly opted into private browsing, so you need to take care not to store any user data derived from private browser windows. the exception is the windows() function which returns an array of currently opened windows. private windows will not be included in this list if your add-on has not opted into private browsing. to learn more about private windows, how to opt into private browsing, and how to support private browsing, refer to the documentation for the private-browsing module. globals functions getmostrecentbrowserwindow() get the topmost browser window, as an nsidomwindow instance. returns nsidomwindow: the topmost brows...
...r the current webpage utils.gettoplevelwindow(window) == browserwindow // => true parameters window : nsidomwindow returns nsidomwindow getwindowdocshell(window) returns the nsidocshell for the tabbrowser element. parameters window : nsidomwindow returns nsidocshell getwindowloadingcontext(window) returns the nsiloadcontext. parameters window : nsidomwindow returns nsiloadcontext open(uri, options) this function is used to open top level (application) windows. it takes the uri of the window document as its first argument and an optional hash of options as its second argument. var { open } = require('sdk/window/utils'); var window = open('data:text/html,hello window'); this function wraps nsiwindowwatcher.openwindow. parameters uri : string uri of the document to be loade...
...with the following properties: name type parent nsidomwindow parent for the new window. optional, defaults to null. name string name that is assigned to the window. optional, defaults to null. features object map of features to set for the window, defined like this: { width: 10, height: 15, chrome: true }. see the window.open features documentation for more details. optional, defaults to an empty map: {}. var { open } = require('sdk/window/utils'); var window = open('data:text/html,hello window', { name: 'jetpack window', features: { width: 200, height: 50, popup: true } }); args object extra argument(s) to be attached to the new window as the window.arguments property. ...
...And 2 more matches
Getting started (cfx) - Archive of obsolete content
c directory created * readme.md written * package.json written * test/test-main.js written * lib/main.js written * doc/main.md written your sample add-on is now ready for testing: try "cfx test" and then "cfx run". have fun!" implementing the add-on now you can write the add-on's code, which goes in the "main.js" file in your "lib" directory. this file was created for you in the previous step. ...
... next, save these three icon files to the "data" directory: icon-16.png icon-32.png icon-64.png back at the command prompt, type: cfx run this is the sdk command to run a new instance of firefox with your add-on installed. ...
...these three icon files to the "data" directory: icon-16.png icon-32.png icon-64.png back at the command prompt, type: cfx run this is the sdk command to run a new instance of firefox with your add-on installed. when firefox launches, in the top-right corner of the browser you'll see an icon with the firefox logo. click the icon, and a new tab will open with https://www.mozilla.org/ loaded into it. that's all this add-on does. it uses two sdk modules: the action button module, which enables you to add buttons to the browser, and the tabs module, which enables you to perform basic operations with tabs. in this case, we've created a button whose icon is the firefox icon, and added a click handler that loads the mozilla home page in a new tab. tr...
...And 2 more matches
Windows - Archive of obsolete content
this article offers code snippets demonstrating common tasks you may wish to perform. opening new browser windows to open a new browser window, you can simply use window.open(). however, window.open() returns a window object for content, not for the browser window itself, so you should get the chrome window first. the simplest way to do that is to use nsiwindowmediator. ...
... this article offers code snippets demonstrating common tasks you may wish to perform. opening new browser windows to open a new browser window, you can simply use window.open(). however, window.open() returns a window object for content, not for the browser window itself, so you should get the chrome window first. the simplest way to do that is to use nsiwindowmediator. ...
...ticle offers code snippets demonstrating common tasks you may wish to perform. opening new browser windows to open a new browser window, you can simply use window.open(). however, window.open() returns a window object for content, not for the browser window itself, so you should get the chrome window first. the simplest way to do that is to use nsiwindowmediator. ...
...And 2 more matches
How to convert an overlay extension to restartless - Archive of obsolete content
egers, or fun stuff like 48-bit integers). not ideal, but it works and performs more than sufficiently well. all of that code above is no longer viable if you also go extractionless (which you should). step 3a: option 1: use nsizipreader let zipreader = components.classes["@mozilla.org/libjar/zip-reader;1"] .createinstance(components.interfaces.nsizipreader); zipreader.open(addondata.installpath); ... from there you can open nsiinputstreams, extract files, or perform some other functions. worst case would be that you extract a file to a temporary location and then use nsifile operations upon the extracted file. step 3b: option 2: use xmlhttprequest now, how do we replace that? the answer to that question is to load your file from a chrome:// uri using xmlhttpreq...
... do things. ...
...e the heart of your restartless add-on. think of it as main.c, but for javascript based firefox restartless add-ons. ...
...And 2 more matches
The Essentials of an Extension - Archive of obsolete content
the file is formatted in a special flavor of xml called rdf. rdf used to be the central storage mechanism for firefox, but it is now being replaced for a simpler database system. we'll discuss both of these storage systems further ahead in the tutorial. now let's look at the important parts of the file. ...
...a content area, like the one that displays web pages in a firefox tab. windows like the downloads window are pure chrome. most of the code for an extension resides in the chrome folder, just like in the hello world example. as we saw in the directory structure of the unpacked extension, the chrome is composed of 3 sections: content, locale and skin. the 3 are necessary for most extensions. if we open the chrome.manifest file (again, any text editor will do), we see that the same 3 sections are mentioned: content xulschoolhello content/ skin xulschoolhello classic/1.0 skin/ locale xulschoolhello en-us locale/ the chrome.manifest file tells firefox where to look for chrome files. the text is spaced to look like a table, but that is not necessary. the parser...
...d to change in chrome.manifest, all you need is to add the right path after content in the uri. skin and locale files work in the same way, and you don't need to specify skin names or locale names. so, to access the dtd file in the hello world extension, the chrome path is chrome://xulschoolhello/locale/browseroverlay.dtd. firefox knows what locale to look for. here's an interesting experiment. ...
...And 2 more matches
Updating addons broken by private browsing changes - Archive of obsolete content
ces: ff 15: nsidomstoragemanager ff 16: nsitransferable ff 18: imgicache moziasyncfavicons nsifaviconservice nsiwebbrowserpersist ff 19: nsicontentprefservice nsidownloadmanager nsidownload nsihttpauthmanager nsistricttransportsecurityservice ff 20: nsiprivatebrowsingservice nsirecentbadcertservice furthermore, if your code uses any of these common chrome apis: ff 19: saveurl saveinternal openlinkin ff 20: openbrowserwindow gprivatebrowsingui finally, if your code watches for any of these observer notifications: private-browsing private-browsing-cancel-vote private-browsing-change-granted private-browsing-transition-complete then your addon will require updating to correctly support the new per-window private browser feature in firefox 20 (and will require updating to work co...
... certificates or public ones are desired. observer notifications none of the ones listed above will be sent as of firefox 20. the supporting per-window private browsing article explains further about the equivalent notifications, which are all backwards compatible through to firefox 12 (and are sent side-by-side with the global private browsing notifications in older versions). ...
...indow private browsing article explains further about the equivalent notifications, which are all backwards compatible through to firefox 12 (and are sent side-by-side with the global private browsing notifications in older versions). chrome apis openbrowserwindow: takes an optional parameter to indicate desired properties of the window. passing {private: true} will cause a private window to open, otherwise the window will always be non-private. use {private: privatebrowsingutils.iswindowprivate(window)} to open a window that matches the current window's privacy status. openlinkin: can receive an extra private boolean property in the parameter object. internalsave: takes a new required document argument (prior to the optional boolean and string arguments) indicating the document tha...
...And 2 more matches
Index of archived content - Archive of obsolete content
implementing the widget overview storing annotations chrome authority creating event targets creating reusable modules developing for firefox mobile display a popup getting started (jpm) getting started (cfx) list open tabs listen for page load listening for load and unload localization logging modifying web pages based on url modifying the page hosted by a tab open a web page troubleshooting unit testing using xpcom without chrome using third-party modules (j...
... in firefox extensions migrating from internal linkage to frozen linkage migrating raw components to add-ons multiple item extension packaging offering a context menu for form controls overlay extensions firefox addons developer guide appendix: what you should know about open-source software licenses chapter 1: introduction to extensions chapter 2: technologies used in developing extensions chapter 3: introduction to xul—how to build a more intuitive ui chapter 4: using xpcom—implementing advanced processes chapter 5: let's build a firefox extension chapter 6: firefox extensions an...
... bookmarks.import() adding preferences to an extension an interview with douglas bowman of wired news archived mozilla and build documentation activex control for hosting netscape plug-ins in ie archived spidermonkey docs file object open 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 thunderb...
...And 2 more matches
Getting Started - Archive of obsolete content
seamonkey is called folder_with_seamonkey in this manual. extract theme while you can hypothetically begin with any theme already designed for seamonkey 2, for the sake of consistency we'll speak as though everyone is editing classic (default seamonkey theme). this is located in the file classic.jar found in the seamonkey 2 installation directory. a .jar file is in reality a renamed zip archive. opening the .jar files in your archive manager of choice should result in the file being automatically detected as being a zip archive. however, if your application doesn't detect classic.jar as a standard zip archive, rename the file classic.zip and continue extraction. classic.jar locations linux: folder_with_seamonkey/chrome/classic.jar windows: folder_with_seamonkey\chrome\classic.jar for mac os x...
...mmunicator, editor, help, messenger, messenger-newsblog and mozapps directories from above. (yes, this means that the structure of your new directory and classic.jar will be slightly different.) creating the install files icon.png and preview.png these are some png images containing the icon and the preview of the theme. chrome.manifest make a copy of chrome.manifest and place it in \my_theme and open it up in your text editor. this file is a small manifest file which is used to describe the skin. in the code search for all instances of "my_theme" and replace them with the name of your theme. the packages section lists which components of the browser you're modifying. if we also had skins for chatzilla, we would need to add another line resembling the other ones and change it to point to chatz...
...jar:chrome/my_theme.jar!/messenger-newsblog/ skin communicator my_theme jar:chrome/my_theme.jar!/communicator/ skin help my_theme jar:chrome/my_theme.jar!/help/ skin navigator my_theme jar:chrome/my_theme.jar!/navigator/ skin editor my_theme jar:chrome/my_theme.jar!/editor/ save the file and exit the text editor. install.rdf make a copy of install.rdf and place it in the my_theme directory, then open it up in your text editor. this file is a small xml database that describes the skin. <description about="urn:mozilla:install-manifest"> <em:id>{themes_uuid}</em:id> <em:version>themes_version</em:version> the first section requires that you establish a uuid for your theme and that you give your theme a version number. once you've done this, insert the information as above, and scroll down...
...And 2 more matches
Getting Started - Archive of obsolete content
to access your browser without uninstalling and reinstalling mozilla. for this reason we suggest that you install a second copy into a second directory (make sure that you use a different profile as stated in the release notes) extract the chrome the chrome is stored in \mozilla\chrome and the individual modules are stored in jar files. jar files are zip files with a different extension. you can open them up in your zip program the same way you open up zip files. mozilla currently comes with two skins, classic and modern. looking in the directory you'll also notice that there are classic.jar and modern.jar files. for this tutorial we are going to use the classic skin as a base. extract classic.jar into \classic (\mozilla\chrome\classic), but make sure to keep the directory structure. remember...
... to keep the directory structure. remember if at any point you wish to revert back to the original code again, just extract this jar over top of what you've modified. now all of the css and images are extracted, but if you make some changes and run mozilla as it is, you will not see them because it's still set to look at the files in the jar files. to point mozilla at the correct files we need to open up \mozilla\chrome\installed-chrome.txt in a text editor. you should probably make a backup of this file now, just in case you make a mistake. in the file you'll see a list. do a search for classic.jar</cde>. on every line that references <code>classic.jar we need to make some changes (there are about 5 lines). delete the bolded text: original skin,install,url,jar:resource:/chrome/classic.j...
...tty self-explanatory. they contain the images/styles for the browser, email client, or html editor. css files the css files in these directories tell the browser how to display the buttons and other controls, where to put the images, what border and padding it should put around them, etc. for this next part, let's modify the standard button. ...
...And 2 more matches
In-Depth - Archive of obsolete content
faults. button, checkbox-container, checkbox, dialog, dualbutton, dualbutton-dropdown, listbox, menu, menulist-textfield, menulist-button, menulist, menulist-text, progressbar, progresschunk, radio-container, radio, resizer, resizerpanel, separator, scrollbar, statusbar, statusbarpanel, toolbarbutton, toolbox, toolbar, treeheadercell, treeheadersortarrow, treeview, treeitem, treetwisty, treetwistyopen, tooltip, textfield, tabpanels, tab, tab-left-edge, tab-right-edge, scrollbartrack-horizontal, scrollbartrack-vertical, scrollbarthumb-vertical, scrollbarthumb-horizontal, scrollbarbutton-right, scrollbarbutton-down, scrollbarbutton-left, scrollbarbutton-up, scrollbargripper-vertical, scrollbargripper-horizontal -moz-border-bottom-colors defines a series of colours. each colour is one pixel in th...
... and 1.00 is totally visible. how do i know what to modify? now that you've got everything extracted and you know how to modify items, you might be wondering, how do i know where everything is? well there is an easy way to find out - using the dom inspector. if you didn't install it when you first installed mozilla you may have to run the installer again. load mozilla and one browser window. then open the dom inspector (tools->web development->dom inspector). click file->inspect and select the browser window. what appears in a tree view below is the actual code for the interface. using this, we can figure out what objects are where, what classes/id's they have applied to them, and most importantly, which file the style is located in. click on the inspect icon and then click on the back button...
...r/skin/icons/btn1.gif) is actually a bunch of images grouped together in one file, so somewhere one of the css attributes is telling it what portion of the larger image to cut out and display. if you go back into the dom inspector and look at the rule column again, you'll see the #back-button id. select that one and it lists a bunch of -x-image-region-left type styles in chrome://navigator/skin/. open up navigator.css, again (if you closed it), and look for the #back-button section. it has a -moz-image-region style in there which you can change. if you look through the rest of this file, you'll also notice that there are regions for the different states of #back-button. change those to match your new image as well. just continue this process for everything that you wish to change and you'll ha...
...And 2 more matches
Creating a Skin for Firefox/Getting Started - Archive of obsolete content
and install it. be sure to install the dom inspector extension as well. extract theme while you can hypothetically begin with any theme already designed for firefox, for the sake of consistency we'll speak as though everyone is editing the default firefox theme. this is located in the file classic.jar found in the firefox installation directory. a .jar file is in reality a renamed zip archive. opening the .jar files in your archive manager of choice should result in the file being automatically detected as being a zip archive. however, if your application doesn't detect classic.jar as a standard zip archive, rename the file classic.zip and continue extraction. note: starting in gecko 2.0, the new omni.jar file contains the skin, among other resources. see theme changes in firefox 4 for de...
...ucture. so create a new directory called my_theme. into this directory put the browser, global, communicator, help, and mozapps directories from above, as well as the icon.png and preview.png files. (yes, this means that the structure of your new directory and classic.jar will be slightly different.) creating the install files contents.rdf make a copy of contents.rdf, place it in \my_theme and open it up in your text editor. this file is a small xml database which is used to describe the skin. in the code, search for all instances of "my_theme" and replace them with the name of your theme. the packages section lists which components of the browser you're modifying. if we also had skins for chatzilla, we would need to add another line resembling the other ones and change it to point to cha...
...source="urn:mozilla:skin:my_theme:communicator"/> <rdf:li resource="urn:mozilla:skin:my_theme:editor"/> <rdf:li resource="urn:mozilla:skin:my_theme:global"/> <rdf:li resource="urn:mozilla:skin:my_theme:messenger"/> <rdf:li resource="urn:mozilla:skin:my_theme:navigator"/> save the file and exit the text editor. install.rdf make a copy of install.rdf and place it in the my_theme directory, then open it up in your text editor. this file is a small xml database that describes the skin. <description about="urn:mozilla:install-manifest"> <em:id>{themes_uuid}</em:id> <em:version>themes_version</em:version> the first section requires that you establish a uuid for your theme and that you give your theme a version number. once you've done this, insert the information as above, and scroll do...
...And 2 more matches
Creating a Help Content Pack - Archive of obsolete content
e file won't be loaded correctly. however, while it may seem like this is a disadvantage, it's actually an advantage - if you make an error you'll know immediately, and you should be able to easily figure out what the problem is by directly loading the file in firefox. later, when we get to actually writing content, you'll need to know xhtml, but for now knowledge of the syntax should be enough. open up your favorite text editor and create the file content-pack.rdf. insert into it the following text: <?xml version="1.0"?> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:nc="http://home.netscape.com/nc-rdf#"> </rdf:rdf> if you're familiar with html or xml, you might recognize this as the container element for the whole document. it serves as a wrapper around ...
...ch database is exactly like defining a table of contents file (and therefore exactly like creating an index file), so follow the instructions there to create additional data sources as you need them. viewing your content pack in the help viewer to launch the help viewer with your content pack, you need to have chrome://help/content/contexthelp.js loaded into the xul file that provides the ui to open the help viewer: <script type="application/javascript" src="chrome://help/content/contexthelp.js"/> this will allow you to access all of the viewer functions. to open the help viewer, run the openhelp() function. it's exactly the same as any javascript command, you you can insert it in command elements, oncommand attributes, and other such places. the parameters are described below...
...e help viewer: <script type="application/javascript" src="chrome://help/content/contexthelp.js"/> this will allow you to access all of the viewer functions. to open the help viewer, run the openhelp() function. it's exactly the same as any javascript command, you you can insert it in command elements, oncommand attributes, and other such places. the parameters are described below: openhelp(atopic, acontentpackspec); atopic: the rdf:id of the topic you want to load as the home page in the help viewer. acontentpackspec: the path to the content pack you want to load. ...
...And 2 more matches
Tabs - Archive of obsolete content
Archive › Mozilla › Jetpack › UI › Tabs
for what we learned from it and the blog post announcing the first sdk release for what we're up to next! in this class you can find information about the tabs in your firefox window. the namespace for this class is jetpack.tabs. ...
...ingshiftstringsortstringsplicestringunshiftstring)this is some default text lengththe number of open tabsstring focusedthe current tab in your browserstring tostringstuffstring popstuffstring pushstuffstring reversestuffstring shiftstuffstring sortstuffstring splicestuffstring unshiftstuffstring onready()when the inherited document is fully loaded. onfocus()changing the focus of a tab. methods open(urlstring)opens a new tab in your browser with a defined url. ...
...ththe number of open tabsstring focusedthe current tab in your browserstring tostringstuffstring popstuffstring pushstuffstring reversestuffstring shiftstuffstring sortstuffstring splicestuffstring unshiftstuffstring onready()when the inherited document is fully loaded. onfocus()changing the focus of a tab. methods open(urlstring)opens a new tab in your browser with a defined url. ...
...And 2 more matches
File object - Archive of obsolete content
tories on the local filesystem, and create os pipelines. creating a pipeline involves spawning arbitrary processes; this means that giving a script access to the file object is exactly equivalent to giving the script access to the unix shell or dos command interpreter. filesystem access is implemented with nspr i/o functions, and as such shares many semantics. pipelines are implemented with the popen() system call. there is currently no support for p2open()-like semantics. here is the original proposal for this object, and a status update from december 1998: http://www.mozilla.org/js/js-file-object.html created by the file constructor: new file(); new file(filename); parameters filename name of the file we want to work with. directories and pipelines are considered special files. pip...
...ical path to the file. file.name the name of the file. file.isdirectory true if the file is a directory. file.isfile true if the file is a file. file.exists true if the file exists. file.canread true if the file can be read. file.canwrite true if the file can be written. file.canappend true if the file is in append mode. file.canreplace true if the file is in replace mode. file.isopen true if the file is open. file.type a string specifying the type of data or encoding contained in the file. currently "ascii" (ascii), "binary" (utf-8) or "unicode" (ucs-2). (xxx note -- ascii might imply asciiz) file.mode a string describing the mode used to open the file. file.creationtime a date object representing the time when the file was created. file.lastmodified a date object re...
...or this file. binary (utf-8) files and pipelines (including file.intput) do not support random access. file.hasautoflush force a flush on each line break? (readonly) file.position the file position. writing to the property moves the file pointer. file.isnative true if the file is backed by a native stdio file stream. (i.e. file.input, file.output, file.error or a pipeline) methods file.open() opens the file, specifying file mode and type. file.close() closes the file. file.remove() removes the file, provided it is not open. file.copyto() creates a verbatim copy of the file at a new location. file.renameto() removes the file. file.flush() flushes the operating system's write buffers for the file and blocks until any pending data has been committed to disk. file.seek() mo...
...And 2 more matches
Writing to Files - Archive of obsolete content
the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes). there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. to write to a file, an output stream is used. an output stream is an object which can be used to write bytes, strings and other values to a file. to create an output stream, use nsiscriptableio.newoutputstream(). this method has a number of options to specify text or binary writing, the character set,...
...ch can be used to write bytes, strings and other values to a file. to create an output stream, use nsiscriptableio.newoutputstream(). this method has a number of options to specify text or binary writing, the character set, and whether to append to an existing file or create a new one. to create an input stream, first get a reference to a nsifile, and then use nsiscriptableio.newoutputstream() to open a stream for writing to it. to learn more about file objects, see files and streams. try { var file = io.getfile("desktop", "myinfo.txt"); var stream = io.newoutputstream(file, "text"); } catch (ex) { alert(ex); } this example retrieves a file object on the desktop called 'myinfo.txt' using nsiscriptableio.getfile(). it doesn't matter whether the file exists or not. nsiscriptableio.newoutput...
... is already there. nocreate if used, don't create a new file if it does not already exist. in this case, an error will occur if the file does not exist, which you can capture using a try-catch block. if this flag is not used, a new file will be created. in either case, if the file already exists, it will be truncated to zero length. notruncate if used, don't truncate an existing file when opening it for writing. instead, just overwrite the existing content. if the new data being written is shorter than the existing data, the existing data will remain in the areas where no new data was written. if this flag is not used, the file is truncated before being written to. the flags are designed such that the most common case that is needed is with no flags set, so usually you will not set th...
...And 2 more matches
Building Hierarchical Trees - Archive of obsolete content
« previousnext » a template may be used to generate hierarchical trees. this works just like with recursive generation using the content builder. each level of the tree is created using a successive iteration of the template build process. if the items are containers, the tree builder will mark the right rows as containers, so that they can be opened and closed with the small icon twisties on the left of the column. remember to make the left column the primary column for these to appear. to be able to do this, the tree builder must know that an item is a container. with an rdf datasource, this would usually be an rdf container such as a seq and the tree would display its children. for an xml datasource, the tree might display a node's children as the children in the tree, mak...
...d display its children. for an xml datasource, the tree might display a node's children as the children in the tree, making the tree display a hierarchy similar to that in the xml document. or, with more complex xpath expressions, a template could display a tree where the hierarchy wasn't directly like the xml document. if a node is a container, the tree item becomes a container, and the user may open the row by double-clicking it. note that this test is done on the member value not the reference value. for instance, in the photo example, we have a container 'http://www.xulplanet.com/rdf/myphotos' with three photos. three results will be generated from a simple rule with no extra conditions. it is the result, or the photo, that will be checked, not the container of photos. since a photo isn't ...
...t the reference value. for instance, in the photo example, we have a container 'http://www.xulplanet.com/rdf/myphotos' with three photos. three results will be generated from a simple rule with no extra conditions. it is the result, or the photo, that will be checked, not the container of photos. since a photo isn't a container, the tree rows will not become containers, so you will not be able to open them. as the rows are not containers, the tree builder does not recurse to find additional data. the tree builder creates rows lazily, so a closed container will not have any data generated inside in it until the row is opened. when the user opens the tree row, the next level of rows are generated from the template and displayed in the tree. similarly, when the user closes a tree row, the rows in...
...And 2 more matches
Creating Dialogs - Archive of obsolete content
« previousnext » a xul application will often require dialogs to be displayed. this section describes how one might construct them. creating a dialog the opendialog() function is used to open a dialog, and is related to open(). this function differs from open() in several ways. it displays a dialog instead of a window, which implies that it is asking something of the user. it also has subtle differences in the way it works and appears to the user. these differences will vary depending on the platform the application is running on. in addition, the opendialog() function can take additional arguments beyond the first three. these arguments are passed to the new dialog and placed in an array stored in the new window's arguments property. you can pass as many arguments as you ...
...it's passed one argument, somefile, which was taken from the value of an element with the id enterfile. in a script used by the dialog, we can then refer to the argument using the window's arguments property. ...
...ed. it's passed one argument, somefile, which was taken from the value of an element with the id enterfile. in a script used by the dialog, we can then refer to the argument using the window's arguments property. for example: var fl = window.arguments[0]; document.getelementbyid('thefile').value = fl; this is an effective way to pass values to the new window. you can pass values back from the opened window to the original window in one of two ways. first, you could use the window.opener property which holds the window that opened the dialog. second, you could pass a function or object as one of the arguments when creating the dialog, then call that function or modify the object in the opened dialog. note: opendialog() requires universalbrowserwrite privilege. this means it will not work ...
...And 2 more matches
Manifest Files - Archive of obsolete content
testfiles create a new ascii1 file called test.manifest in the chrome directory. it doesn't actually matter what the file is called as long as it has the .manifest extension. ( 1. doesn't work with utf-8 with bom.) add the following line to it: content tests file:///c:/testfiles/ the file path in that line should point to the directory created above. if you aren't sure what the file path is, open that directory in a browser and copy the url from the address field. that's it! now, all you need to do is add some xul files into that new directory, and you will be able to load them by typing in a chrome url of the form chrome://tests/content/<filename>. of course, you will need to restart the browser for the changes to take effect. if the file doesn't load, make sure that the file path is cor...
...ically, the id is similar to your application's name. replace the blue highlighted text above with your application's title and author. if the 'chrome:extension' field is true, the application is a mozilla firefox extension and it will show up in the extensions window of the browser. if false, it will not appear. save the contents.rdf and make sure it is in the directory you created in step 1. open the file <mozilla-directory>/chrome/installed-chrome.txt, where <mozilla-directory> is the directory where mozilla is installed. exit mozilla before you do this. next, you are going to register the new application with mozilla so it will know where to find it. add a line at the end of installed-chrome.txt pointing to the new directory you created in step 1. change the highlighted text to the fil...
...o this. next, you are going to register the new application with mozilla so it will know where to find it. add a line at the end of installed-chrome.txt pointing to the new directory you created in step 1. change the highlighted text to the file url below of the directory. make sure that it url ends with a slash and that you press enter at the end of the line. if you aren't sure what the url is, open the directory created in step 1 into a mozilla browser and copy the url from the location field. note that the reference should always be a directory, not a file. delete the file <mozilla-directory>/chrome/chrome.rdf. start mozilla. you should be able to view any xul files you put into the directory using a url of the form: chrome://applicationid/content/file.xul where file.xul is the filename.
...And 2 more matches
XPCOM Examples - Archive of obsolete content
« previousnext » this section provides some examples of using xpcom along with some additional interfaces. window management this example contains rdf datasource that will be seen in the later section. you might skip this example for the time being, except when you have already had that knowledge. creating a window menu the list of currently open mozilla windows can be used as an rdf datasource. this allows you to create a window menu with a list of the currently open windows in the application. the datasource for this is rdf:window-mediator. we can use this as in the following example: example 1 : source <toolbox> <menubar id="windowlist-menubar"> <menu label="window"> <menupopup id="window-menu" datasources="rdf:window-mediator" ref="nc:windowmediatorroot"> <te...
...this is accomplished by using the window mediator component. it implements the interface nsiwindowdatasourc...
...menubar"> <menu label="window"> <menupopup id="window-menu" datasources="rdf:window-mediator" ref="nc:windowmediatorroot"> <template> <rule> <menuitem uri="rdf:*" label="rdf:http://home.netscape.com/nc-rdf#name"/> </rule> </template> </menupopup> </menu> </menubar> </toolbox> a window menu will be created with a list of all the open windows. try this example by opening a number of browser windows and you'll see that they are all listed on the menu. window mediator component this is fine for displaying a list of open windows, but we would like to enhance this so that clicking on the menu item will switch to that window. this is accomplished by using the window mediator component. it implements the interface nsiwindowdatasource. the code below shows how to get...
...And 2 more matches
XUL Questions and Answers - Archive of obsolete content
on search plugins is available in the search plugins category. is localizing remote xul possible? loading remote dtds for xml documents is currenty not supported in xul. the following bugs were reported on this issue: bug 22942, bug 133698. is there an editor widget in xul that supports syntax highlighting? daniel glazman has been working on this for his projects. he said the code will be open-source, but it is not released yet (as of oct 2006). some teasers are on his blog. overlaying elements without ids the original developers only tend to put ids where they need them. as an extension author, you have at least two options: use dom methods to dynamically create or rearrange elements file an enhancement request in bugzilla to have extra ids added. displaying graphics and a...
...ed (bug 321170): xml datasources (bug 321171) storage (sqlite) datasources (bug 321172) when loading an xslt stylesheet into an xml i get the error: "error loading stylesheet: an xslt stylesheet load was blocked for security reasons." that error is from a security check that has been put up to safeguard against cross-site-scripting attacks. a scheme is in development to allow servers to open up their site for cross-site access, but that's not yet done. hidechrome="true" doesn’t work on a mac? unfortunately, no simple solution to this was posted. a workaround is to open the content in a new window using "window.open" and send titlebar=”no” as one of the flags in the 3rd argument. is it possible to have checkbox support for multi column lists? the current issue is a perso...
...roperties will eventually be fixed to return the value with the correct type. using the "icon" attribute on a button from xulplanet.com reference: this attribute should be used to set the usage for common buttons. some platforms display these buttons with a small icon indicating their usage. this should be used in place of the image attribute. possible values include: accept, cancel, help, open, save, find, clear, yes, no, apply, close, print, add, remove, refresh, go-forward, go-back, properties, select-font, select-color, network. if you are using a button that matches one of these common usages, use the icon attribute to indicate this. how to use dynamic objects in toolbar there may be a few ways to implement this: by building your menupopup from an rdf datasource, which coul...
...And 2 more matches
button - Archive of obsolete content
handlers can be used to trap mouse, keyboard and other events. it is typically rendered as a grey outset rectangle. you can specify the label of the button using the label attribute or by placing content inside the button. more information is available in the xul tutorial. attributes accesskey, autocheck, checkstate, checked, command, crop, dir, disabled, dlgtype, group, icon, image, label, open, orient, tabindex, type properties accesskey, accessibletype, autocheck, checkstate, checked, command, crop, dir, disabled, dlgtype, group, image, label, open, orient, tabindex, type examples <button label="press me" oncommand="alert('you pressed me!');"/> attributes accesskey type: character this should be set to a character that is used as a shortcut key. this sho...
... each group can be checked at a time. if the user selects one the buttons, the others in the group are unchecked. icon mozilla 1.8 type: string this attribute should be used to set the usage for common buttons. some platforms display these buttons with a small icon indicating their usage. this should be used in place of the image attribute. possible values include: accept, cancel, help, open, save, find, clear, yes, no, apply, close, print, add, remove, refresh, go-forward, go-back, properties, select-font, select-color, network. if you are using a button that matches one of these common usages, use the icon attribute to indicate this. see the appearance of the different icons on some available platforms. image type: uri the uri of the image to appear on the element. if th...
...lement. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. open type: boolean for the menu type buttons, the open attribute is set to true when the menu is open. the open attribute is not present if the menu is closed. orient type: one of the values below used to specify whether the children of the element are oriented horizontally or vertically. the default value depends on the element. you can also use the -moz-box-orient style property. hori...
...And 2 more matches
menu - Archive of obsolete content
Archive › Mozilla › XUL › menu
ttributes | properties | methods | related ] an element, much like a button, that is placed on a menubar. when the user clicks the menu element, the child menupopup of the menu will be displayed. this element is also used to create submenus. more information is available in the xul tutorial. ...
...nupopup of the menu will be displayed. this element is also used to create submenus. more information is available in the xul tutorial. ...
... control, crop, disabled, image, itemcount, label, labelelement, menupopup, open, parentcontainer, selected, tabindex, value methods appenditem, getindexofitem, getitematindex, insertitemat, removeitemat style classes menu-iconic example <menubar id="sample-menubar"> <menu id="file-menu" label="file"> <menupopup id="file-popup"> <menuitem label="new"/> <menuitem label="open"/> <menuitem label="save"/> <menuseparator/> <menuitem label="exit"/> </menupopup> </menu> <menu id="edit-menu" label="edit"> <menupopup id="edit-popup"> <menuitem label="undo"/> <menuitem label="redo"/> </menupopup> </menu> </menubar> attributes acceltext type: string text that appears beside the menu label to indicate th...
...And 2 more matches
toolbarbutton - Archive of obsolete content
ication where possible, provide keyboard alternatives. where possible, duplicate functionality in a menu item or context menu. where not possible, make all toolbarbuttons focusable by -moz-user-focus: normal. ...
...oolbarbuttons focusable by -moz-user-focus: normal. ...
... on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. oncommand type: script code this event handler is called when the command is activated. this occurs when a user selects a menu item or presses a keyboard shortcut attached to the command. open type: boolean for the menu type buttons, the open attribute is set to true when the menu is open. the open attribute is not present if the menu is closed. orient type: one of the values below used to specify whether the children of the element are oriented horizontally or vertically. the default value depends on the element. you can also use the -moz-box-orient style property. horiz...
...And 2 more matches
Mozilla release FAQ - Archive of obsolete content
le may be out of date. it was last updated in 2005. this document may be distributed and modified freely. no guarantee of factuality in this faq is made, and it is maintained by pat gunn, who is not affiliated with netscape. various other people have contributed to this faq. general questions about the mozilla project what is mozilla? mozilla is a project to continue netscape communicator as an open project. the project is maintained by employees of netscape (now a division of aol), red hat, some other companies, as well as contributors from the community. on what is mozilla based? the mozilla project started near the end of life of the 4.x line of netscape communicator. originally, the plan was just to re-stabilize the code and release 5.0, but it was decided within the community that the m...
...ances if compiled with optimization on. what platforms have had successful builds so far? this list will be updated with time, but (according to netscape.public.mozilla.general) the following platforms have been built successfully: solaris 2.4, 2.5, 2.6 freebsd 2.2, 3.0 linux/intel and alpha 2.0, 2.1 macos winnt 4.0 irix 5.3, 6.2, 6.3, 6.4 win95, win98 digital unix 4.0 netbsd openbsd bsdi hp/ux 9.05, 10.20, 11.0 (see 2.7) hurd .03 dg/ux mac os x i'm *still* having problems getting mozilla to build on my platform! if it's nspr that's failing to build, take a look at config/your_platform.mk, as nspr still uses the classic build system. if it's in mozilla and you're checking out from cvs, check tinderbox to see if the tree is on fire. if it is, do another cvs pull ...
...ord processor or a mp3 player into one. beyond technical reasons, the operating system market is currently glutted, and a new entry would be unlikely to attract enough users to ensure the writing of drivers for a new system, a critical mass point. people who want to work on an operating system no doubt would be welcomed by the bsd teams, the linux team, the freedows team, or any of the many other open source operating system groups out there. how about a netscape release of linux? this isn't quite so far fetched, but it has the problem of possibly doing a great deal of harm to the relations between netscape and several unix vendors who bundle netscape's servers. it is unlikely that netscape would do anything that would endanger its revenue stream. as another point, there are already plenty of ...
...And 2 more matches
XForms Select1 Element - Archive of obsolete content
ote, some representations of the select1 element do not support visual grouping. attributes ui common appearance - the value of this attribute gives a hint to the xforms processor as to which type of widget(s) to use to represent this control. accesskey - used to specify the keyboard shortcut for focusing this control. single-node binding special selection - this attribute, when set to 'open', allows the user to provide free entry to the list. possible values are open and closed, default is closed (see #representations section to refer if the attribute is supported for every representation). incremental - supported, default value is true properties selection - see corresponding attribute incremental - see corresponding attribute type restrictions the select1 element can be ...
...fied appearance attribute values: combobox - default representation (xhtml/xul) listbox - used when appearance = 'compact' (xhtml/xul) radio group - used when appearance = 'full' (xhtml/xul) combobox displaying a combobox is the default representation (xhtml/xul). ...
...loses focus), otherwise it is updated upon item selection listbox the select1 is represented as listbox (xhtml/xul). ...
...And 2 more matches
Practical positioning examples - Learn web development
and dynamically changing the information shown using a javascript feature such as xmlhttprequest. at this point in your learning however we want to keep things as simple as possible. there is some javascript later on, but only a tiny bit. to start with, we'd like you to make a local copy of the starting html file — info-box-start.html. save this somewhere sensible on your local computer, and open it up in your text editor. let's look at the html contained within the body: <section class="info-box"> <ul> <li><a href="#" class="active">tab 1</a></li> <li><a href="#">tab 2</a></li> <li><a href="#">tab 3</a></li> </ul> <div class="panels"> <article class="active-panel"> <h2>the first tab</h2> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. pelle...
...el when a tab is pressed, and style the tab itself. you won't need to understand the javascript itself at this stage, but you should think about learning some basic javascript as soon as possible — the more complex your ui features become, the more likely it is that you'll need some javascript to implement your desired functionality. general setup to begin with, add the following between your opening and closing <style> tags: html { font-family: sans-serif; } * { box-sizing: border-box; } body { margin: 0; } this is just some general setup to set a sans-serif font on our page, use the border-box box-sizing model, and get rid of the default <body> margin. next, add the following just below your previous css: .info-box { width: 450px; height: 400px; margin: 0 auto; } this ...
...ass using javascript at the appropriate time. .info-box article { position: absolute; top: 0; left: 0; height: 352px; padding: 10px; color: white; background-color: #a60000; } .info-box .active-panel { z-index: 1; } adding our javascript the final step to getting this feature working is to add some javascript. ...
...And 2 more matches
What text editors are available? - Learn web development
your computer may already ...
...your computer may already be installed with one of the editors suggested above (e.g. gedit if you use gnome desktop, kate if you use kde etc.
...u software center. in general, of course, the linux/unix world is a pretty diverse place where different distros work with different, incompatible packaging systems. that means, if you've set your heart on an obscure text editor, you may have to compile it from source yourself (not for the faint-hearted). what kind of technologies do i want to manipulate? generally speaking, any text editor can open any text file. that works great for writing notes to yourself, but when you're doing web development and writing in html, css, and javascript, you can produce some pretty large, complex files. make it easier on yourself by choosing a text editor that understands the technologies you're working with. many text editors help you out with features like: syntax highlighting. make your file more leg...
...And 2 more matches
Creating hyperlinks - Learn web development
at a web address. almost any web content can be converted to a link so that when clicked or otherwise activated the web browser goes to another web address (url). note: a url can point to html files, text files, images, text documents, video and audio files, or anything else that lives on the web. if the web browser doesn't know how to display or handle the file, it will ask you if you want to open the file (in which case the duty of opening or handling the file is passed to a suitable native app on the device) or download the file (in which case you can try to deal with it later on). for example, the bbc homepage contains a many links that point not only to multiple news stories, but also different areas of the site (navigation functionality), login/registration pages (user tools), and m...
...ested on the same server. if you use absolute urls where relative urls would do, you're constantly making your browser do extra work, meaning that it will perform less efficiently. linking to non-html resources — leave clear signposts when linking to a resource that will be downloaded (like a pdf or word document), streamed (like video or audio), or has another potentially unexpected effect (opens a popup window, or loads a flash movie), you should add clear wording to reduce any confusion. for example: if you're on a low bandwidth connection, click a link, and then a multiple megabyte download starts unexpectedly. if you don't have the flash player installed, click a link, and then suddenly get taken to a page that requires flash. let's look at some examples, to see what kind of t...
...ctedly. if you don't have the flash player installed, click a link, and then suddenly get taken to a page that requires flash. let's look at some examples, to see what kind of text can be used here: <p><a href="http://www.example.com/large-report.pdf"> download the sales report (pdf, 10mb) </a></p> <p><a href="http://www.example.com/video-stream/" target="_blank"> watch the video (stream opens in separate tab, hd quality) </a></p> <p><a href="http://www.example.com/car-game"> play the car game (requires flash) </a></p> use the download attribute when linking to a download when you are linking to a resource that's to be downloaded rather than opened in the browser, you can use the download attribute to provide a default save filename. here's an example with a download link to the ...
...And 2 more matches
Server-side web frameworks - Learn web development
many questions have been posted in the last few days how many have responses? do they have an active community? a few good web frameworks? let's now move on, and discuss a few specific server-side web frameworks. the server-side frameworks below represent a few of the most popular available at the time of writing. all of them have everything you need to be productive — they are open source, are under active development, have enthusiastic communities creating documentation and helping users on discussion boards, and are used in large numbers of high-profile websites. there are many other great server-side frameworks that you can discover using a basic internet search. note: descriptions come (partially) from the framework websites! django (python) django is a high-level...
...a basic internet search. note: descriptions come (partially) from the framework websites! django (python) django is a high-level python web framework that encourages rapid development and clean, pragmatic design. built by experienced developers, it takes care of much of the hassle of web development, so you can focus on writing your app without needing to reinvent the wheel. it’s free and open source. django follows the "batteries included" philosophy and provides almost everything most developers might want to do "out of the box". because everything is included, it all works together, follows consistent design principles, and has extensive and up-to-date documentation. it is also fast, secure, and very scalable. being based on python, django code is easy to read and to maintain. pop...
...use everything is included, it all works together, follows consistent design principles, and has extensive and up-to-date documentation. it is also fast, secure, and very scalable. being based on python, django code is easy to read and to maintain. popular sites using django (from django home page) include: disqus, instagram, knight foundation, macarthur foundation, mozilla, national geographic, open knowledge foundation, pinterest, open stack. flask (python) flask is a microframework for python. while minimalist, flask can create serious websites out of the box. it contains a development server and debugger, and includes support for jinja2 templating, secure cookies, unit testing, and restful request dispatching. it has good documentation and an active community. flask has become extre...
...And 2 more matches
Error codes returned by Mozilla APIs
dy_exists (0x80520008) an attempt was made to create a file that already exists. ns_error_file_invalid_path (0x80520009) this error occurs when an attempt is made to use a path that isn't valid for the platform. ns_error_file_disk_full (0x8052000a) this error will occur if attempting to write to a disk that is full. ns_error_file_corrupted (0x8052000b) indicates that an attempt was made to open or access a file that has been corrupted, or that the format of a file is unknown. this error might occur if a previous attempt to write to the file had failed. this error may be returned by various components that use files to indicate that necessary files are not in an expected format. ns_error_file_not_directory (0x8052000c) this error will occur if an attempt was made to perform an operatio...
...s already established. xxx currently unused - consider removing. ns_error_not_connected (0x804b000c) the connection does not exist. xxx currently unused - consider removing. ns_error_connection_refused (0x804b000d) ns_error_net_timeout (0x804b000e) ns_error_in_progress (0x804b000f) the requested action could not be completed while the object is busy. implementations of nsichannel.asyncopen() will commonly return this error if the channel has already been opened (and has not yet been closed). ns_error_offline (0x804b0010) ns_error_no_content (0x804b0011) returned from nsichannel.asyncopen() to indicate that ondataavailable will not be called because there is no content available. this is used by helper app style protocols (for example, mailto). ns_error_unknown_protocol (0x80...
... ns_error_first_header_field_component_empty (0x804b0022) while parsing for the first component of a header field using syntax such as that for content-disposition or content-type, the first component was found to be empty. javascript errors these errors typically occur wh...
...And 2 more matches
Message manager overview
fundamentally, frame message managers enable chrome code to: load a script into a frame (essentially, a single browser tab) in the content process. these scripts are called "frame scripts". communicate with frame scripts using message-passing apis there are various types of frame message managers, as depicted in this diagram: this diagram shows the setup when there are 2 browser windows open, one with 2 tabs open and one with 1 tab open. chrome process in the chrome process, there's a hierarchy of frame message managers: the global frame message manager, window message managers, and browser message managers. global frame message manager description there's a single global frame message manager in the chrome process. this operates on all frames, in all conten...
...sage managers: the global frame message manager, window message managers, and browser message managers. global frame message manager description there's a single global frame message manager in the chrome process. this operates on all frames, in all content tabs. if you load a frame script using the global frame message manager, the script gets loaded separately into every open tab: three times, in the diagram above. similarly, if you send a message using the global frame message manager, it's received by all content tabs, and is then delivered to any frame scripts that are listening for it. its most important functions and attributes are: childcount : contains the number of children (typically, browser windows) getchildat() : get the child at the given i...
... you can also access it as the mm property of services.jsm, if you are in the parent process. window message manager description there's a window message manager for every browser window: two, in the diagram above. it operates on all content tabs in a given window. if you load a frame script using the window message manager it gets loaded separately into each tab open in that particular window. if you send a message using the window message manager, it gets sent to all content tabs in that window. its most important functions and attributes are: childcount : contains the number of children (typically, browser tabs) getchildat() : get the child at the given index loadframescript() : load a frame script into every tab in this window broa...
...And 2 more matches
PKCS11 FAQ
Mozilla › Projects › NSS › PKCS11 › FAQ
ificates simply appear in the list of certificates displayed in the certificate window. what version of pkcs #11 does nss support? nss requires at least pkcs #11 version 2.0, but can support some features of later versions of nss, including nss 2.20. nss does not use all the features of later versions of pkcs #11. what are the expectations in terms of session manipulation? will nss potentially open more than one session at a time? read-only sessions, read/write sessions, serial, parallel? nss typically holds one session read-only session per slot, in which some of the non-multipart functions are handled. multipart functions, such as bulk encryption, hashing, and mac functions (for example, c_digest and c_sign) and those that require overlapped operation (c_unwrap, c_decrypt) are handled by...
...s are handled. multipart functions, such as bulk encryption, hashing, and mac functions (for example, c_digest and c_sign) and those that require overlapped operation (c_unwrap, c_decrypt) are handled by creating new sessions. if no new sessions are available, the one read-only session is used, and the state is saved and restored after each multipart operation. nss never uses parallel mode. nss opens new read/write sessions for key generation, some password management, and storage of new certificates. if your token is read/write and has only one session, nss will open that one initial session read/write. what permanent pkcs #11 objects are used by nss or read from the token? example: rsa private key, ca certificate, user's own certificate, user's name. private keys (rsa and dsa) and the c...
...tures to nss. if multiple pkcs #11 modules are loaded, how does nss determine which ones to use for the mechanisms required by ssl? nss uses the first slot it finds that can perform all the required operations. on servers, it's almost always the slot that contains the server's private key. does nss support the use of pkcs #11 callbacks specified in the pnotify and papplication parameters for c_opensession? nss does not currently use any of the callbacks. nss applications detect card insertion and deletion by means of polling to determine whether the card is still in the slot and whether the open session associated with that card is still valid, or by waiting on the c_waitforslotevent call. what must an x.509 certificate include to allow it to be recognized as an email certificate for use...
...And 2 more matches
Python binding for NSS
nss is fips-140 certified. nss is built upon nspr because nspr provides an abstraction of common operating system services, particularly in the areas of networking and process management. ...
...cated elements will persist for a least two releases before being removed from the api entirely. project history red hat utilizes both nss and python in many of it's projects, however it was not previously possible to call nss directly from python. to solve this problem red hat generously funded the initial development of python-nss as well as it's continued maintenance. red hat following it's open source philosophy has contributed the source to the mozilla security project. red hat welcomes all interested contributors who would like to contribute the the python-nss project as part of an open source community. the initial release of python-nss occurred in september 2008 with it's inclusion in the fedora distribution. the source code to python-nss was first imported into the mozilla cvs repo...
... pynss_release_1_0_0 source download https://ftp.mozilla.org/pub/mozilla.org/security/python-nss/releases/pynss_release_1_0_0/src/ change log official 1.0.0 release, only minor tweaks from the 1.0.0beta1 release. allow custom include root in setup.py as command line arg. add tls chacha20 poly1305 constants. remove checks for whether a socket is open for reading. it's not possible for the binding to know in all cases, especially if the socket is created from an xternal socket passed in. the following module functions were added: nss.get_all_tokens the following constants were added: ssl.tls_ecdhe_rsa_with_chacha20_poly1305_sha256 ssl.tls_ecdhe_ecdsa_with_chacha20_poly1305_sha256 ...
...And 2 more matches
Embedded Dialog API
s problem statement an application embedding gecko cannot tightly control its own windows and still allow gecko to be a fully functional web browser. in any single window, gecko can be expected to play nicely within its given boundaries. but it must be allowed to create additional windows at times perhaps unexpected by the containing appliction. these new windows can be entire new browser windows opened in response to web page script, or dialogs or alerts which may arise from script or merely during normal operation of the browser. part of gecko's embedding api is callbacks into the embedding application for creating new windows. the complete windowing portion of the api is large and complex, but it need not be entirely implemented. its simplest requirements are that the app must allow gecko t...
...lf, independently of gecko. applications which implement merely the simplest, base gecko windowing api will then have a mixture of xul and native windows. applications concerned with presenting a consistent dialog appearance have the option of implementing the complete dialog posing api. responsibilities of the embedding application basic windowing api to be able to respond to script requests to open new windows, an embedded gecko browser must have a way of opening new windows. this is accomplished using a callback into the embedding application. this basic api will by itself provide the minimal functionality gecko needs to create new windows, and an embedding application must implement at least this much. applications concerned with a consistent overall dialog appearance will probably choose...
..., and for browser windows in general. the precise appearance and contents of the new window are defined by the application, though the app should conform to the chromeflags parameter of nsiwindowcreator::createchromewindow. this flag requests the presence or absence of particular features in the window surrounding the browser; features such as a toolbar or menubar. the nsiwebbrowserchrome::chrome_openas_chrome flag deserves special mention. a content window (the chrome flag is 0) is a browser window. the application should respond with whatever kind of window it normally uses to contain an embedded instance of gecko. a chrome window (the chrome flag is 1) should contain only an embedded instance of gecko. this is the kind of window used by gecko to display xul dialogs. advanced windowing api e...
...And 2 more matches
Feed content access API
however, you could also parse it from a f...
...sing parsefromstream(), or directly from an url using parseasync(). the actual processing of the parsed feed is done by a method called handleresult() on the feedtestresultlistener object. ...
...url using parseasync(). the actual processing of the parsed feed is done by a method called handleresult() on the feedtestresultlistener object. ...
...And 2 more matches
Retrieving part of the bookmarks tree
results when you are querying for exactly one folder grouped by folder with no fancy query parameters such as keywords or date ranges (as in this example), the root of the result will be an nsinavhistorycontainerresultnode corresponding to your folder. if you have a complex query the root will be a nsinavhistoryqueryresultnode. ...
...no fancy query parameters such as keywords or date ranges (as in this example), the root of the result will be an nsinavhistorycontainerresultnode corresponding to your folder. if you have a complex query the root will be a nsinavhistoryqueryresultnode. before accessing the children of any result container, you must first open it, and then you can iterate the children. ...
...t open it, and then you can iterate the children. as long as the container is open, it will listen for notifications from the bookmarks system to keep itself up-to-date. when you're done, be sure to close the container to free up the resources. otherwise, it will continue to get observer notifications and update itself, slowing down the whole browser. ...
...And 2 more matches
nsIBrowserHistory
ice;1"] .getservice(components.interfaces.nsibrowserhistory); method overview void addpagewithdetails(in nsiuri auri, in wstring atitle, in long long alastvisited); obsolete since gecko 15.0 void markpageasfollowedlink(in nsiuri auri); obsolete since gecko 22.0 void markpageastyped(in nsiuri auri); obsolete since gecko 22.0 void registeropenpage(in nsiuri auri); obsolete since gecko 9.0 void removeallpages(); void removepage(in nsiuri auri); void removepages([array, size_is(alength)] in nsiuri auris, in unsigned long alength, in boolean adobatchnotify); void removepagesbytimeframe(in long long abegintime, in long long aendtime); void removepagesfromhost(in autf8string ahost, in boolean ...
... attributes attribute type description count obsolete since gecko 15.0 pruint32 indicates if there are entries in global history. for perform...
... be and is called before the page is actually added to history, since the page isn't added until it actually starts loading. the typed flag affects the url bar autocomplete. this will cause the transition type of the next visit of the url to be marked as "typed." void markpageastyped( in nsiuri auri ); parameters auri the page that is to be marked as typed by the user. registeropenpage() obsolete since gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) mark a page as being currently open. note: this method was an alias for moziplacesautocomplete.registeropenpage(), which still exists and can be used instead. void registeropenpage( in nsiuri auri ); parameters auri the page that is to be marked as currently open. removeallpages() this me...
...And 2 more matches
nsICache
s streams of data or as objects. this constant specify that cache session is not a stream based entry when calling nsicacheservice.createsession() method. stream_based 1 all entries for a cache session are stored as streams of data or as objects. this constant specify that cache session is a stream based entry when calling nsicacheservice.createsession() method. non_blocking 0 the synchronous opencacheentry() may be blocking or non-blocking. if a cache entry is waiting to be validated by another cache descriptor (so no new cache descriptors for that key can be created), opencacheentry() will return ns_error_cache_wait_for_validation in non-blocking mode. if the cache entry is validated, then a descriptor for that entry will be created and returned. if the cache entry was doomed, then a des...
...in blocking mode, it will wait until the cache entry for the key has been validated or doomed. if the cache entry is validated, then a descriptor for that entry will be created and returned. ...
...or non-blocking. in blocking mode, it will wait until the cache entry for the key has been validated or doomed. if the cache entry is validated, then a descriptor for that entry will be created and returned. if the cache entry was doomed, then a descriptor will be created for a new cache entry for the key. note: if you think that you might need to modify cached data or meta data, then you must open a cache entry requesting write access. only one cache entry descriptor, per cache entry, will be granted write access. usually, you will request read_write access in order to first test the meta data and informational fields to determine if a write, that is going to the net, may actually be necessary. if you determine that it is not, then you would mark the cache entry as valid (using markvalid) ...
...And 2 more matches
nsIFile
boolean ishidden(); boolean isreadable(); boolean isspecial(); boolean issymlink(); boolean iswritable(); void launch(); prlibrarystar load(); void moveto(in nsifile newparentdir, in astring newname); void movetonative(in nsifile newparentdir, in acstring newname); native code only! ...
... boolean isspecial(); boolean issymlink(); boolean iswritable(); void launch(); prlibrarystar load(); void moveto(in nsifile newparentdir, in astring newname); void movetonative(in nsifile newparentdir, in acstring newname); native code only! ...
...ith nspr or stdlib! read only. exceptions thrown ns_error_file_invalid_path indicates that this nsifile does not reference a symbolic link. constants constant value description normal_file_type 0 a normal file. directory_type 1 a directory/folder. delete_on_close 0x80000000 optional parameter used by opennsprfiledesc methods append() this function is used for constructing a descendant of the current nsifile. note: this method does not return a new nsifile; it modifies the object it was called on. if the old nsifile should be retained, use clone(). void append( in astring node ); parameters node a string which is intended to be a child node of the nsifile. this string must not ...
...And 2 more matches
nsINavHistoryResultObserver
/ seamonkey 2.8) note: in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1), this interface replaced the older nsinavhistoryresultviewer interface, which only allowed one client at a time. ...
...s, which may result in performance degradation (for example, if updating a view for each update). void batching( in boolean atogglemode ); parameters atogglemode specify true to start batch mode or false to finish the batch. ...
...n a container node's state changes from opened to closed. note: this method was deprecated in gecko 2.0 and removed in gecko 11.0 (firefox 11.0 / thunderbird 11.0 / seamonkey 2.8). implement the containerstatechanged() method instead. void containerclosed( in nsinavhistorycontainerresultnode acontainernode ); parameters acontainernode the container node which was closed. containeropened() obsolete since gecko 11.0 (firefox 11.0 / thunderbird 11.0 / seamonkey 2.8) called when a container node's state changes from closed to opened. note: this method was deprecated in gecko 2.0 and removed in gecko 11.0 (firefox 11.0 / thunderbird 11.0 / seamonkey 2.8). implement the containerstatechanged() method instead. ...
...And 2 more matches
Browser Console - Firefox Developer Tools
the gbrowser global, and even with the xul used to specify the browser's user interface. nb: the browser console command line (to execute javascript expressions) is disabled by default. to enable it set the devtools.chrome.enabled preference to true in about:config, or set the "enable browser chrome and add-on debugging toolboxes" (firefox 40 and later) option in the developer tool settings. opening the browser console you can open the browser console in one of two ways: from the menu: select "browser console" from the web developer submenu in the firefox menu (or tools menu if you display the menu bar or are on macos). from the keyboard: press ctrl+shift+j (or cmd+shift+j on a mac). you can also start the browser console by launching firefox from the command line and passing the -...
... the web console: most of the window is occupied by a pane that display messages. at the top, a toolbar enables you to filter the messages that appear. at the bottom, a command line interpreter enables you to evaluate javascript expressions. beginning with firefox 68, the browser console allows you to show or hide messages from the content process (i.e. the messages from scripts in all the opened pages) by setting or clearing the checkbox labeled show content messages. the following image shows the browser console focused on the same page as above after clicking on the show content messages checkbox. browser console logging the browser console logs the same sorts of messages as the web console: http requests warnings and errors (including javascript, css, security warnings and e...
...for add-on sdk add-ons, the console api is available automatically. here's an example add-on that just logs an error when the user clicks a widget: widget = require("sdk/widget").widget({ id: "an-error-happened", label: "error!", width: 40, content: "error!", onclick: logerror }); function logerror() { console.error("something went wrong!"); } if you build this as an xpi file, then open the browser console, then open the xpi file in firefox and install it, you'll see a widget labeled "error!" in the add-on bar: click the icon. you'll see output like this in the browser console: for add-on sdk-based add-ons only, the message is prefixed with the name of the add-on ("log-error"), making it easy to find all messages from this add-on using the "filter output" search box. by defa...
...And 2 more matches
Document.hasFocus() - Web APIs
Web › API › Document › hasFocus
e element within a popup window that is not the foreground doesn't have focus. syntax var focused = document.hasfocus(); return value false if the active element in the document has no focus; true if the active element in the document has focus. example this example checks whether the document has focus every 300 milliseconds. ...
...; return value false if the active element in the document has no focus; true if the active element in the document has focus. example this example checks whether the document has focus every 300 milliseconds. to test the functionality of hasfocus(), click on the button to open a new window, and try switching between the two pages. ...
...e false if the active element in the document has no focus; true if the active element in the document has focus. example this example checks whether the document has focus every 300 milliseconds. to test the functionality of hasfocus(), click on the button to open a new window, and try switching between the two pages. ...
...And 2 more matches
IDBCursor.direction - Web APIs
the direction read-only property of the idbcursor interface is a domstring that returns the direction of traversal of the cursor (set using idbobjectstore.opencursor for example). see the values section below for possible values. note: this feature is available in web workers. syntax var direction = cursor.direction; value a string (defined by the idbcursordirection enum) indicating the direction in which the cursor is traversing the data. possible values are: value description next this direction causes the cursor to be opened at the start of the source. nextunique this direction causes the cursor to be opened at the start of the source. for every key with duplicate values, only the first record is yielded. prev this direction cause...
...for every key with duplicate values, only the first record is yielded. ...
...for every key with duplicate values, only the first record is yielded. example in this simple fragment we create a transaction, retrieve an object store, then use a cursor to iterate through all the records in the object store. ...
...And 2 more matches
IDBDatabase.name - Web APIs
Web › API › IDBDatabase › name
the name read-only property of the idbdatabase interface is a domstring that contains the name of the connected database. note: this feature is available in web workers. syntax var dbname = idbdatabase.name; value a domstring containing the name of the connected database. example this example shows a database connection being opened, the resulting idbdatabase object being stored in a db variable, and the name property then being logged. ...
... feature is available in web workers. syntax var dbname = idbdatabase.name; value a domstring containing the name of the connected database. example this example shows a database connection being opened, the resulting idbdatabase object being stored in a db variable, and the name property then being logged. for a full example, see our to-do notifications app (view example live). ...
... web workers. syntax var dbname = idbdatabase.name; value a domstring containing the name of the connected database. example this example shows a database connection being opened, the resulting idbdatabase object being stored in a db variable, and the name property then being logged. for a full example, see our to-do notifications app (view example live). ...
...And 2 more matches
IDBIndexSync - Web APIs
ure if there is enough demand from web developers. the idbindexsync interface of the indexeddb api provides synchronous access to an index in a database. ...
...ss to an index in a database. method overview any add (in any value, in optional any key) raises (idbdatabaseexception); any get (in any key) raises (idbdatabaseexception); any getobject (in any key) raises (idbdatabaseexception); void opencursor (in optional idbkeyrange range, in optional unsigned short direction) raises (idbdatabaseexception); void openobjectcursor (in optional idbkeyrange range, in optional unsigned short direction) raises (idbdatabaseexception); any put (in any value, in optional any key) raises (idbdatabaseexception); void remove (in any key) raises (idbdatabaseexception); attributes attribute type description keypath readonly domstring the key path of this index. if...
...that corresponds to the given key. any getobject ( in any key ) raises (idbdatabaseexception); parameters key the key that identifies the record to be retrieved. returns any the retrieved value from the referenced object store. exceptions this method can raise a idbdatabaseexception with the following code: not_found_err if no record exists in this index for the given key. opencursor() creates a cursor over the records of this index. the range of the new cursor matches the specified key range; if the key range is not specified or is null, then the range includes all the records. void opencursor ( in optional idbkeyrange range, in optional unsigned short direction ) raises (idbdatabaseexception); parameters range the key range to use as the cursor's range. d...
...And 2 more matches
IDBObjectStore.add() - Web APIs
error the idbobjectstore has been deleted or removed. datacloneerror the data being stored could not be cloned by the internal structured cloning algorithm. constrainterror an insert operation failed because the primary key constraint was violated (due to an already existing record with the same primary key value). ...
... an insert operation failed because the primary key constraint was violated (due to an already existing record with the same primary key value). example in the following code snippet, we open a read/write transaction on our database and add some data to an object store using add(). note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot be...
...ent of success or failure. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...And 2 more matches
IDBObjectStore.autoIncrement - Web APIs
note that every object store has its own separate auto increment counter. note: this feature is available in web workers. syntax var myautoincrement = objectstore.autoincrement; value a boolean: value meaning true the object store auto increments. false the object store does not auto increment. ...
...ents. false the object store does not auto increment. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store using add(). after the object store has been created, we log objectstore.autoincrement to the console. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...oincrement to the console. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...And 2 more matches
IDBObjectStore.createIndex() - Web APIs
curs if an index with the same name already exists in the database. index names are case-sensitive. invalidaccesserror occurs if the provided key path is a sequence, and multientry is set to true in the objectparameters object. invalidstateerror occurs if either: the method was not called from a versionchange transaction mode callback, i.e. from inside a idbopendbrequest.onupgradeneeded handler. the object store has been deleted. syntaxerror occurs if the provided keypath is not a valid key path. transactioninactiveerror occurs if the transaction this idbobjectstore belongs to is not active (e.g. has been deleted or removed.) in firefox previous to version 41, an invalidstateerror was raised in this case as well, whi...
...provided keypath is not a valid key path. transactioninactiveerror occurs if the transaction this idbobjectstore belongs to is not active (e.g. ...
...as now been fixed (see bug 1176165.) example in the following example you can see the idbopendbrequest.onupgradeneeded handler being used to update the database structure if a database with a higher version number is loaded. createindex() is used to create new indexes on the object store. for a full working example, see our to-do notifications app (view example live.) var db; // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); // two event handlers for opening the database. dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is...
...And 2 more matches
IDBObjectStore.delete() - Web APIs
lowing types: exception description transactioninactiveerror this object store's transaction is inactive. readonlyerror the object store's transaction mode is read-only. invalidstateerror the object store has been deleted. dataerror the key is not a valid key or a key range. ...
...tore has been deleted. dataerror the key is not a valid key or a key range. example in the following code snippet, we open a read/write transaction on our database and delete one specific record out of our object store using delete() — a sample record with the key "walk dog". for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...record with the key "walk dog". for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...And 2 more matches
IDBObjectStore.deleteIndex() - Web APIs
bjectstore belongs to is not active (e.g. has been deleted or removed.) in firefox previous to version 41, an invalidstateerror was raised in this case as well, which was misleading; this has now been fixed (see bug 1176165.) notfounderror occurs if there is no index with the given name (case-sensitive) in the database. ...
...u can see the idbopendbrequest.onupgradeneeded handler being used to update the database structure if a database with a higher version number is loaded. idbobjectstore.createindex is used to create new indexes on the object store, after which we delete the unneeded old indexes with deleteindex(). ...
...equest.onupgradeneeded handler being used to update the database structure if a database with a higher version number is loaded. idbobjectstore.createindex is used to create new indexes on the object store, after which we delete the unneeded old indexes with deleteindex(). for a full working example, see our to-do notifications app (view example live.) var db; // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. th...
...And 2 more matches
IDBObjectStore.keyPath - Web APIs
the keypath read-only property of the idbobjectstore interface returns the key path of this object store. if this property is null, the application must provide a key for each modification operation. note: this feature is available in web workers. syntax var mykeypath = objectstore.keypath; value any value type. ...
... web workers. syntax var mykeypath = objectstore.keypath; value any value type. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store using add(). after the object store has been created, we log objectstore.keypath to the console. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...re.keypath to the console. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...And 2 more matches
IDBObjectStore.name - Web APIs
invalidstateerror either the object store has been deleted or the current transaction is not an upgrade transaction; you can only rename indexes during upgrade transactions; that is, when the mode is "versionchange". transactioninactiveerror the current transaction is not active. constrainterror an object store is already using the specified name. ...
...is not active. constrainterror an object store is already using the specified name. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store using add(). after the object store has been created, we log objectstore.name to the console. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...store.name to the console. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...And 2 more matches
IDBObjectStore.transaction - Web APIs
the transaction read-only property of the idbobjectstore interface returns the transaction object to which this object store belongs. note: this feature is available in web workers. syntax var mytransaction = objectstore.transaction; value an idbtransaction object. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store using add(). ...
... var mytransaction = objectstore.transaction; value an idbtransaction object. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store using add(). after the object store has been created, we log objectstore.transaction to the console. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...ransaction to the console. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...And 2 more matches
IDBObjectStoreSync - Web APIs
of the indexeddb api provides synchronous access to an object store of a database. ...
...in optional any key) raises (idbdatabaseexception); idbindexsync createindex (in domstring name, in domstring storename, in domstring keypath, in optional boolean unique); any get (in any key) raises (idbdatabaseexception); idbcursorsync opencursor (in optional idbkeyrange range, in optional unsigned short direction) raises (idbdatabaseexception); idbindexsync openindex (in domstring name) raises (idbdatabaseexception); any put (in any value, in optional any key) raises (idbdatabaseexception); void remove (in any key) raises (idbdatabaseexception); void removeindex (in domstring indexname) raises (idbdatabaseexception); attributes attribute type description indexnames readonly domstringlist...
...parameters key the key that identifies the record to be retrieved. returns any the value retrieved from the object store. exceptions this method can raise a idbdatabaseexception with the following codes: serial_err if the data being stored could not be deserialized by the internal structured cloning algorithm. not_found_err if no record exists in this index for the given key. ...
...And 2 more matches
IDBTransaction.error - Web APIs
the exact error is one of serveral possibilities. it can be a reference to the same error as the request object that raised it, or a transaction failure (for example quotaexceedederror or unknownerror). this property is null if the transaction is not finished, is finished and successfully committed, or was aborted with the idbtransaction.abort method. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. note the transaction.onerror = function(event) { }; block, making use of transaction.error to help in reporting what went wrong when the transaction was unsuccessful. fo...
...the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. note the transaction.onerror = function(event) { }; block, making use of transaction.error to help in reporting what went wrong when the transaction was unsuccessful. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...nsaction was unsuccessful. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...And 2 more matches
IDBTransaction.oncomplete - Web APIs
on to flush to disk before delivering the complete event by creating a transaction using the experimental (non-standard) readwriteflush mode (see idbdatabase.transaction.) this is currently experimental, and can only be used if the dom.indexeddb.experimental pref is set to true in about:config. syntax transaction.oncomplete = function(event) { ... }; example in the following code snippet, we open a read/write transaction on our database and add some data to an object store. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. note the transaction.oncomplete = function(event) { }; block, which reports back when the transaction was successful. for a full working example, see our to-do notificat...
... and add some data to an object store. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. note the transaction.oncomplete = function(event) { }; block, which reports back when the transaction was successful. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...ransaction was successful. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...And 2 more matches
IDBTransaction.onerror - Web APIs
r of the idbtransaction interface handles the error event, fired when a request returns an error and bubbles up to the transaction object. note: consider using idbtransaction.onabort instead to handle non- successful completion of the transaction. note: this feature is available in web workers. syntax transaction.onerror = function(event) { ... }; example in the following code snippet, we open a read/write transaction on our database and add some data to an object store. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. note the transaction.onerror = function(event) { }; block, making use of transaction.error to help in reporting what went wrong when the transaction was unsuccessful. fo...
...the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. note the transaction.onerror = function(event) { }; block, making use of transaction.error to help in reporting what went wrong when the transaction was unsuccessful. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...nsaction was unsuccessful. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...And 2 more matches
IDBVersionChangeEvent.newVersion - Web APIs
these events are fired via the custom idbversionchangeevent interface. ...
...xeddb = ..." if you're not in a function. ...
...ion. // moreover, you may need references to some window.idb* objects: window.idbtransaction = window.idbtransaction || window.webkitidbtransaction || window.msidbtransaction; window.idbkeyrange = window.idbkeyrange || window.webkitidbkeyrange || window.msidbkeyrange; // (mozilla has never prefixed these objects, // so we don't need window.mozidb*) // let us open version 4 of our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being opened dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used ...
...And 2 more matches
Checking when a deadline is due - Web APIs
don't support html form validation (i have used the required attribute in my html to force validation, in those that do.) else { var newitem = [ { tasktitle: title.value, hours : hours.value, minutes : minutes.value, day : day.value, month : month.value, year : year.value, notified : "no" } ]; // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction opened for task addition.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not open...
.... duplicate items not allowed.</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todolist"); // add our newitem object to the object store var request = objectstore.add(newitem[0]); in this section we create an object called newitem that stores the data in the format required to insert it into the database. the next few lines open the database transaction and provide messages to notify the user if this was successful or failed.then an objectstore is created into which the new item is added. the notified property of the data object indicates that the to-do list item's deadline has not yet come up and been notified - more on this later! note: the db variable stores a reference to the indexeddb database instance; we can the...
...we then loop through all the items in the cursor for as long as there is a valid item left in the cursor. switch(cur...
...And 2 more matches
IndexedDB API - Web APIs
ncepts and usage indexeddb is a transactional database system, like an sql-based rdbms. however, unlike sql-based rdbmses, which use fixed-column tables, indexeddb is a javascript-based object-oriented database. indexeddb lets you store and retrieve objects that are indexed with a key; any objects supported by the structured clone algorithm can be stored. you need to specify the database schema, open a connection to your database, and then retrieve and update data within a series of transactions. read more about the concepts behind indexeddb. learn to use indexeddb asynchronously from first principles with our using indexeddb guide. combine indexeddb for storing data offline with service workers for storing assets offline, as outlined in making pwas work offline with service workers. ...
...our local disk). indexeddb is most commonly talked about. the process by which the browser works out how much space to allocate to web data storage and what to delete when that limit is reached is not simple, and differs between browsers. browser storage limits and eviction criteria attempts to explain how this works, at least in the case of firefox. interfaces to get access to a database, call open() on the indexeddb attribute of a window object. this method returns an idbrequest object; asynchronous operations communicate to the calling application by firing events on idbrequest objects. connecting to a database idbenvironment provides access to indexeddb functionality. it is implemented by the window and worker objects. this interface isn't part of the 2.0 specification. idbfactory ...
...ication by firing events on idbrequest objects. connecting to a database idbenvironment provides access to indexeddb functionality. it is implemented by the window and worker objects. this interface isn't part of the 2.0 specification. idbfactory provides access to a database. this is the interface implemented by the global object indexeddb and is therefore the entry point for the api. idbopendbrequest represents a request to open a database. idbdatabase represents a connection to a database. it's the only way to get a transaction on the database. retrieving and modifying data idbtransaction represents a transaction. you create a transaction on a database, specify the scope (such as which object stores you want to access), and determine the kind of access (read only or readwri...
...And 2 more matches
MediaSource - Web APIs
e sourcebuffer objects contained within mediasource.sourcebuffers — the list of objects providing the selected video track, enabled audio tracks, and shown/hidden text tracks. ...
... methods inherits methods from its parent interface, eventtarget. mediasource.addsourcebuffer() creates a new sourcebuffer of the given mime type and adds it to the mediasource.sourcebuffers list. ...
... methods inherits methods from its parent interface, eventtarget. mediasource.addsourcebuffer() creates a new sourcebuffer of the given mime type and adds it to the mediasource.sourcebuffers list. mediasource.clearliveseekablerange() clears a seekable range previously set with a call to setliveseekablerange(). mediasource.endofstream() signals the end of the stream. ...
...And 2 more matches
WebGL: 2D and 3D graphics for the web - Web APIs
Web › API › WebGL API
webgl (web graphics library) is a javascript api for rendering high-performance interactive 3d and 2d graphics within any compatible web browser without the use of plug-ins. webgl does so by introducing an api that closely conforms to opengl es 2.0 that can be used in html5 <canvas> elements. this conformance makes it possible for the api to take advantage of hardware graphics acceleration provided by the user's device. support for webgl is present in firefox 4+, google chrome 9+, opera 12+, safari 5.1+, internet explorer 11+, and microsoft edge build 10240+; however, the user's device must also have hardware that supports these features. the webgl 2 api introduces support for much of the opengl es 3.0 feature set; it's provided through the webgl2renderingcontext interface. the <canvas> ...
...bgl_compressed_texture_s3tc_srgb webgl_debug_renderer_info webgl_debug_shaders webgl_depth_texture webgl_draw_buffers webgl_lose_context events webglcontextlost webglcontextrestored webglcontextcreationerror constants and types webgl constants webgl types webgl 2 webgl 2 is a major update to webgl which is provided through the webgl2renderingcontext interface. it is based on opengl es 3.0 and new features include: 3d textures, sampler objects, uniform buffer objects, sync objects, query objects, transform feedback objects, promoted extensions that are now core to webgl 2: vertex array objects, instancing, multiple render targets, fragment depth. see also the blog post "webgl 2 lands in firefox" and webglsamples.org/webgl2samples for a few demos. guides and tut...
...bgl academy an html/javascript editor with tutorials to learn basics of webgl programming. webgl stats a site with statistics about webgl capabilities in browsers on different platforms. libraries glmatrix is a javascript matrix and vector library for high-performance webgl apps. philogl is a webgl framework for data visualization, creative coding, and game development. pixi.js is a fast, open-source 2d webgl renderer. playcanvas is an open-source game engine. sylvester is an open-source library for manipulating vectors and matrices. not optimized for webgl but extremely robust. three.js is an open-source, fully featured 3d webgl library. phaser is a fast, free and fun open source framework for canvas and webgl powered browser games. redgl is an open-source 3d webgl library. vtk.
...And 2 more matches
WebSocket - Web APIs
Web › API › WebSocket
e websocket object provides the api for creating and managing a websocket connection to a server, as well as for sending and receiving data on the connection. to construct a websocket, use the websocket() constructor. constructor websocket(url[, protocols]) returns a newly created websocket object. constants constant value websocket.connecting 0 websocket.open 1 websocket.closing 2 websocket.closed 3 properties websocket.binarytype the binary data type used by the connection. websocket.bufferedamount read only the number of bytes of queued data. websocket.extensions read only the extensions selected by the server. websocket.onclose an event listener to be called when the connection is closed. websocket.one...
...ufferedamount read only the number of bytes of queued data. websocket.extensions read only the extensions selected by the server. websocket.onclose an event listener to be called when the connection is closed. websocket.onerror an event listener to be called when an error occurs. websocket.onmessage an event listener to be called when a message is received from the server. websocket.onopen an event listener to be called when the connection is opened. websocket.protocol read only the sub-protocol selected by the server. websocket.readystate read only the current state of the connection. websocket.url read only the absolute url of the websocket. methods websocket.close([code[, reason]]) closes the connection. websocket.send(data) enqueues data to be transmitted. e...
...erty of this interface. close fired when a connection with a websocket is closed. also available via the onclose property error fired when a connection with a websocket has been closed because of an error, such as when some data couldn't be sent. also available via the onerror property. message fired when data is received through a websocket. also available via the onmessage property. ...
...And 2 more matches
Window.closed - Web APIs
Web › API › Window › closed
the window.closed read-only property indicates whether the referenced window is closed or not. syntax const isclosed = windowref.closed; value a boolean. possible values: true: the window has been closed. false: the window is open. examples change the url of a window from a popup the following example demonstrates how a popup window can change the url of the window that opened it. ...
...w is closed or not. syntax const isclosed = windowref.closed; value a boolean. possible values: true: the window has been closed. false: the window is open. examples change the url of a window from a popup the following example demonstrates how a popup window can change the url of the window that opened it. ...
...tax const isclosed = windowref.closed; value a boolean. possible values: true: the window has been closed. false: the window is open. examples change the url of a window from a popup the following example demonstrates how a popup window can change the url of the window that opened it. before attempting to change the url, it checks that the current window has an opener using the window.opener property and that the opener isn't closed: // check that an opener exists and is not closed if (window.opener && !window.opener.closed) { window.opener.location.href = 'http://www.mozilla.org'; } note that popups can only access the window that opened them. ...
...And 2 more matches
font-variant-numeric - CSS: Cascading Style Sheets
ty can take one of two forms: either the keyword value normal or one or more of the other values listed below, space-separated, in any order. values normal this keyword leads to the deactivation of the use of such alternate glyphs. ordinal this keyword forces the use of special glyphs for the ordinal markers, like 1st, 2nd, 3rd, 4th in english or a 1a in italian. it corresponds to the opentype values ordn. slashed-zero this keyword forces the use of a 0 with a slash; this is useful when a clear distinction between o and 0 is needed. it corresponds to the opentype values zero. <numeric-figure-values> these values control the figures used for numbers. two values are possible: lining-nums activating the set of figures where numbers are all lying on the baseline. it corresponds...
...ues ordn. slashed-zero this keyword forces the use of a 0 with a slash; this is useful when a clear distinction between o and 0 is needed. it corresponds to the opentype values zero. <numeric-figure-values> these values control the figures used for numbers. two values are possible: lining-nums activating the set of figures where numbers are all lying on the baseline. it corresponds to the opentype values lnum. oldstyle-nums activating the set of figures where some numbers, like 3, 4, 7, 9 have descenders. it corresponds to the opentype values onum. <numeric-spacing-values> these values controls the sizing of figures used for numbers. two values are possible: proportional-nums activating the set of figures where numbers are not all of the same size. it corresponds to the ope...
...acing-values> these values controls the sizing of figures used for numbers. two values are possible: proportional-nums activating the set of figures where numbers are not all of the same size. it corresponds to the opentype values pnum. tabular-nums activating the set of figures where numbers are all of the same size, allowing them to be easily aligned like in tables. it corresponds to the opentype values tnum. <numeric-fraction-values> these values controls the glyphs used to display fractions. two values are possible: diagonal-fractions activating the set of figures where the numerator and denominator are made smaller and separated by a slash. it corresponds to the opentype values frac. stacked-fractions activating the set of figures where the numerator and denominator are...
...And 2 more matches
text-emphasis - CSS: Cascading Style Sheets
g css properties: text-emphasis-color text-emphasis-style syntax /* initial value */ text-emphasis: none; /* no emphasis marks */ /* <string> value */ text-emphasis: 'x'; text-emphasis: '点'; text-emphasis: '\25b2'; text-emphasis: '*' #555; text-emphasis: 'foo'; /* should not use. ...
...asis-style syntax /* initial value */ text-emphasis: none; /* no emphasis marks */ /* <string> value */ text-emphasis: 'x'; text-emphasis: '点'; text-emphasis: '\25b2'; text-emphasis: '*' #555; text-emphasis: 'foo'; /* should not use. it may be computed to or rendered as 'f' only */ /* keywords value */ text-emphasis: filled; text-emphasis: open; text-emphasis: filled sesame; text-emphasis: open sesame; /* keywords value combined with a color */ text-emphasis: filled sesame #555; /* global values */ text-emphasis: inherit; text-emphasis: initial; text-emphasis: unset; values none no emphasis marks. filled the shape is filled with solid color. if neither filled nor open is present, this is the default. open the shape is hollow. dot display small circles as marks. the filled ...
...bined with a color */ text-emphasis: filled sesame #555; /* global values */ text-emphasis: inherit; text-emphasis: initial; text-emphasis: unset; values none no emphasis marks. filled the shape is filled with solid color. if neither filled nor open is present, this is the default. open the shape is hollow. dot display small circles as marks. the filled dot is '•' (u+2022), and the open dot is '◦' (u+25e6). circle display large circles as marks. the filled circle is '●' (u+25cf), and the open circle is '○' (u+25cb). this is the default shape in horizontal writing modes when no other shape is given. double-circle display double circles as marks. the filled double-circle is '◉' (u+25c9), and the open double-circle is '◎' (u+25ce). triangle display triangles as mark...
...And 2 more matches
<summary>: The Disclosure Summary element - HTML: Hypertext Markup Language
Web › HTML › Element › summary
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...ed dom interface htmlelement attributes this element only includes the global attributes. usage notes the <summary> element's contents can be any heading content, plain text, or html that can be used within a paragraph. a <summary> element may only be used as the first child of a <details> element. when the user clicks on the summary, the parent <details> element is toggled open or closed, and then a toggle event is sent to the <details> element, which can be used to let you know when this state change occurs. default label text if a <details> element's first child is not a <summary> element, the user agent will use a default string (typically "details") as the label for the disclosure box. default style per the html specification, the default style for <summary> ele...
...splay: block to remove the disclosure triangle. see the browser compatibility section for details, as not all browsers support full functionality of this element yet. examples below are some examples showing <summary> in use. you can find more examples in the documentation for the <details> element. ...
...And 2 more matches
Connection management in HTTP/1.x - HTTP
connection management is a key topic in http: opening and maintaining connections largely impacts the performance of web sites and web applications. in http/1.x, there are several models: short-lived connections, persistent connections, and http pipelining. http mostly relies on tcp for its transport protocol, providing a connection between the client and the server. in its infancy, http used a single model to handle such connections. these connections were short-lived: a new one created each time a request needed sending, and closed once the answer had been received. this simple model held an innate limitation on performance: opening each tcp connection is a resource-consuming operation. several messages must be exchanged between the client and the server. network latency and bandwidth af...
...uming operation. several messages must be exchanged between the client and the server. network latency and bandwidth affect performance when a request needs sending. modern web pages require many requests (a dozen or more) to serve the amount of information needed, proving this earlier model inefficient. two newer models were created in http/1.1. the persistent-connection model keeps connections opened between successive requests, reducing the time needed to open new connections. the http pipelining model goes one step further, by sending several successive requests without even waiting for an answer, reducing much of the latency in the network. http/2 adds additional models for connection management. it's important point to note that connection management in http applies to the connect...
...e taken to establish a new connection is significant, and performance of the underlying tcp connection gets better only when this connection has been in use for some time (warm connection). to ease these problems, the concept of a persistent connection has been designed, even prior to http/1.1. alternatively this may be called a keep-alive connection. a persistent connection is one which remains open for a period of time, and can be reused for several requests, saving the need for a new tcp handshake, and utilizing tcp's performance enhancing capabilities. this connection will not stay open forever: idle connections are closed after some time (a server may use the keep-alive header to specify a minimum time the connection should be kept open). persistent connections also have drawbacks; even...
...And 2 more matches
Protocol upgrade mechanism - HTTP
. this means that a typical request that includes upgrade would look something like: get /index.html http/1.1 host: www.example.com connection: upgrade upgrade: example/1, foo/2 other headers may be required depending on the requested protocol; for example, websocket upgrades allow additional headers to configure details about the websocket connection as well as to offer a degree of security in opening the connection. see upgrading to a websocket connection for more details. if the server decides to upgrade the connection, it sends back a 101 switching protocols response status with an upgrade header that specifies the protocol(s) being switched to. if it does not (or cannot) upgrade the connection, it ignores the upgrade header and sends back a regular response (for example, a 200 ok). ri...
... request that initiated the upgrade can be completed over the new protocol. common uses for this mechanism here we look at the most common use cases for the upgrade header. upgrading to a websocket connection by far, the most common use case for upgrading an http connection is to use websockets, which are always implemented by upgrading an http or https connection. ...
...mon use cases for the upgrade header. upgrading to a websocket connection by far, the most common use case for upgrading an http connection is to use websockets, which are always implemented by upgrading an http or https connection. keep in mind that if you're opening a new connection using the websocket api, or any library that does websockets, most or all of this is done for you. for example, opening a websocket connection is as simple as: websocket = new websocket("ws://destination.server.ext", "optionalprotocol"); the websocket() constructor does all the work of creating an initial http/1.1 connection then handling the handshaking and upgrade process for you. you can also use the "wss://" url scheme to open a secure websocket connection. if you need to create a websocket connection...
...And 2 more matches
Using shadow DOM - Web Components
but it contains a series of buttons and other controls inside its shadow dom. the shadow dom spec has made it so that you are allowed to actually manipulate the shadow dom of your own custom elements. basic usage you can attach a shadow root to any element using the element.attachshadow() method. ...
...its shadow dom. the shadow dom spec has made it so that you are allowed to actually manipulate the shadow dom of your own custom elements. basic usage you can attach a shadow root to any element using the element.attachshadow() method. ...
...lowed to actually manipulate the shadow dom of your own custom elements. basic usage you can attach a shadow root to any element using the element.attachshadow() method. this takes as its parameter an options object that contains one option — mode — with a value of open or closed: let shadow = elementref.attachshadow({mode: 'open'}); let shadow = elementref.attachshadow({mode: 'closed'}); open means that you can access the shadow dom using javascript written in the main page context, for example using the element.shadowroot property: let myshadowdom = mycustomelem.shadowroot; if you attach a shadow root to a custom element with mode: closed set, you won't be able to access the shadow dom from the outside — mycustomelem.shadowroot returns null. this is the case with built in element...
...And 2 more matches
Using templates and slots - Web Components
ith web components. let's define a web component that uses our template as the content of its shadow dom. we'll call it <my-paragraph>: customelements.define('my-paragraph', class extends htmlelement { constructor() { super(); let template = document.getelementbyid('my-paragraph'); let templatecontent = template.content; const shadowroot = this.attachshadow({mode: 'open'}) .appendchild(templatecontent.clonenode(true)); } } ); the key point to note here is that we append a clone of the template content to the shadow root, created using the node.clonenode() method. and because we are appending its contents to a shadow dom, we can include some styling information inside the template in a <style> element, which is then encapsulated inside the custom ...
...ld disappear when added to a <div>. note: you can find this complete example at element-details (see it running live also). ...
...ocument fragment we created with our <template> element above. this uses exactly the same pattern as we saw in our earlier trivial example. ...
...And 2 more matches
panel - Archive of obsolete content
user interface. usage this module exports a single constructor function panel() which constructs a new panel. a panel is a dialog. its content is specified as html and you can execute scripts in it, so the appearance and behavior of the panel is limited only by what you can do using html, css, and javascript. the screenshot below shows a panel whose content is built from the list of currently open tabs: panels are useful for presenting temporary interfaces to users in a way that is easier for users to ignore and dismiss than a modal dialog, since panels are hidden the moment users interact with parts of the application interface outside them. a panel's content is loaded as soon as it is created, before the panel is shown, and the content remains loaded when a panel is hidden, so it is ...
... them. a panel's content is loaded as soon as it is created, before the panel is shown, and the content remains loaded when a panel is hidden, so it is possible to keep a panel around in the background, updating its content as appropriate in preparation for the next time it is shown. your add-on can receive notifications when a panel is shown or hidden by listening to its show and hide events. opening a panel will close any panel created by the panel() constructor that is already open, even if that panel was opened by a different add-on sdk based extension. if you want to close an existing panel without opening a new one, you can call the hide() or the destroy() method. panel content the panel's content is specified as html, which is loaded from the url supplied in the contenturl option ...
...esn't work. the html <datalist> element doesn't give you autocomplete suggestions (bug 918600). you can't embed flash (bug 952578). you can't provide tooltips using title attributes (bug 918600). security warning pages (the "this connection is untrusted" warning) does not work, so panels which trigger it will be broken (bug 1031554). mouse button shortcuts, such as using the middle button to open a link in a new page, don't work. scrolling using keyboard doesn't work properly (bug 1001914) globals constructors panel(options) creates a panel. parameters options : object optional options: name type width number the width of the panel in pixels. optional. height number the height of the panel in pixels. optional. ...
...tructors panel(options) creates a panel. parameters options : object optional options: name type width number the width of the panel in pixels. optional. height number the height of the panel in pixels. optional. position object, button, widget the position of the panel. ignored if the panel is opened by a widget. this may be one of three things: a toggle button. if this is supplied the panel will be shown attached to the button. see the section on attaching panels to buttons. a widget object. if this is supplied the panel will be shown attached to the widget. an object which specifies where in the window the panel should be shown. the rest of this section describes...
private-browsing - Archive of obsolete content
check whether a given object is private, so an add-on can respect private browsing usage per-window private browsing private browsing status is a property of an individual browser window. the user enters private browsing by opening a new private browser window. when they do this, any existing non-private windows are kept open, so the user will typically have both private and non-private windows open at the same time. opting into private browsing add-ons built using the sdk must opt into private browsing by setting the following key in their package.json file: "permissions": {"private-browsing": true} if an add-on has not opted in, then the high-level sdk modules will not expose private windows, or objects (such as tabs) that are associated with private windows: the windows mod...
...by setting the following key in their package.json file: "permissions": {"private-browsing": true} if an add-on has not opted in, then the high-level sdk modules will not expose private windows, or objects (such as tabs) that are associated with private windows: the windows module will not list any private browser windows, generate any events for private browser windows, or let the add-on open any private browser windows the tabs module will not list any tabs that belong to private browser windows, and the add-on won't receive any events for such tabs any ui components will not be displayed in private browser windows any menus or menu items created using the context-menu will not be shown in context menus that belong to private browser windows the page-mod modul...
... to do this with the sdk, you can listen to the system event named "last-pb-context-exited": var events = require("sdk/...
...clude: "*", contentscript: loggingscript, onattach: logpublicpagecontent }); tracking private-browsing exit sometimes it can be useful to cache some data from private windows while they are open, as long as you don't store it after the private browsing windows have been closed. for example, the "downloads" window might want to display all downloads while there are still some private windows open, then clean out all the private data when all private windows have closed. to do this with the sdk, you can listen to the system event named "last-pb-context-exited": var events = require("sdk/system/events"); function listener(event) { console.log("last private window closed"); } events.on("last-pb-context-exited", listener); globals functions isprivate(object) function to check whethe...
tabs/utils - Archive of obsolete content
window : nsiwindow optional. returns array : an array of tab elements. getactivetab(window) given a browser window, get the active, or selected, tab. parameters window : window a browser window. returns tab : the currently selected tab. getownerwindow(tab) get the browser window that owns the specified tab. parameters tab : tab a browser tab. returns window : a browser window. opentab(window, url, options) open a new tab in the specified browser window. parameters window : window the browser window in which to open the tab. url : string url for the document to load. options : object optional options: name type inbackground boolean if true, open the new tab, but keep the currently selected tab selected. if false, make the new...
... closetab(tab) close the specified tab. parameters tab : tab a xul tab element. ...
... closetab(tab) close the specified tab. parameters tab : tab a xul tab element. geturi(tab) get the specified tab's uri. parameters tab : tab a xul tab element. ...
... closetab(tab) close the specified tab. parameters tab : tab a xul tab element. geturi(tab) get the specified tab's uri. parameters tab : tab a xul tab element. returns string : the current uri. gettabbrowserfortab(tab) get the specified tab's tabbrowser. parameters tab : tab a xul tab element. ...
Storing annotations - Archive of obsolete content
nnotationhtml.find('.selection-text') .text(storedannotation.anchortext); annotationhtml.find('.annotation-text') .text(storedannotation.annotationtext); annotationlist.append(annotationhtml); }); }); it builds the dom for the panel from the array of annotations it is given. the user will be able to click links in the panel, but we want to open them in the main browser window rather than the panel. so the content script binds a click handler to the links which will send the url to the add-on. save this file in data/list as annotation-list.js. annotation list html and css here's the html for the annotation list: <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>saved annotations</title> ...
... finally we need to connect this to the widget's right-click message: var widget =...
...ge(simplestorage.storage.annotations); }, onmessage: function(message) { require('sdk/tabs').open(message); } }); since this panel's content script uses jquery we will pass that in too: again, make sure the name of it matches the version of jquery you downloaded. when the panel is shown we send it the array of stored annotations. when the panel sends us a url we use the tabs module to open it in a new tab. finally we need to connect this to the widget's right-click message: var widget = widgets.widget({ id: 'toggle-switch', label: 'annotator', contenturl: data.url('widget/pencil-off.png'), contentscriptwhen: 'ready', contentscriptfile: data.url('widget/widget.js') }); widget.port.on('left-click', function() { console.log('activate/deactivate'); widget.contenturl = ...
... very simple way to do this: do nothing. by omitting the "private-browsing" key from the annotator's "package.json" file, the annotator opts out of private browsing altogether. this means that its widget will not appear on any private windows and its selector and matcher content scripts won't run, so the user won't be able to enter any annotations in private windows. try it: execute cfx run and open a new private window: you should no longer see the annotator's widget. now we can create and store annotations, the last piece is to display them when the user loads the page. ...
Bootstrapped extensions - Archive of obsolete content
downgraded. void install( data, reason ); parameters data a bootstrap data structure. reason one of the reason constants, indicating why the extension is being installed. this will be one of addon_install, addon_upgrade, or addon_downgrade. uninstall this function is called after the last call to shutdown() before a particular version of an extension is uninstalled. note: if you open the add-on manager and then click "remove" on an add-on, it will not call uninstall function right away. this is a soft uninstall because of the available "undo" option. if the add-on manager is closed or another event takes place such that the "undo" option becomes unavailable, then the hard uninstall takes place and the uninstall function is called. note: the uninstall function fires on downgr...
... further reading how to convert an over...
...contain: locale name_of_your_addon en-us locale/ here is an example add-on that opens an html page and a xul page on install: github :: l10n-xhtml-xul. here is an example showing how to use a localized html page as an options page: github :: l10n-html-options. you can go to about:config and change the value of the preference general.useragent.locale to en-us and then to en-gb and then reload the open pages to see the localization change. further reading how to convert an overlay extension to restartless a step by step guide. some code samples are provided. the page is based on and expanded from dave garrett's step-by-step guide to convert an old overlay based extension into a restartless addon. ...
... mark finkle provides some simple example code for restartless add-ons in mobile firefox, adding resources (like the options window) to bootstrapped extensions and using default preferences without a default/preferences/prefs.js file. ...
Dialogs and Prompts - Archive of obsolete content
g> default button since firefox 1.5, there are defaultbutton attributes and properties on the <dialog> element bug 284776. the possible values for the attribute are the names of buttons listed above, and the default is "accept", for compatibility with previous versions. using <dialogheader> you can use the dialogheader element to add "headers" to windows. to get an idea of what it looks like, open options (or preferences) dialog in firefox or thunderbird (v1.0 and earlier only). the header to the right of the sections buttons is made with <dialogheader>: <dialogheader title="general" description="whatever"/> note, that you should only use this element in a <dialog>, because otherwise it may be not styled properly. (although it seems to work in <window> as well). programmatic button acce...
...tton("cancel").disabled = true; links dialog.xml — xbl bindings for <dialog> and <dialogheader> elements. passing parameter to a dialog and getting return values from it. passing arguments and displaying a dialog the following code demonstrates how to pass custom arguments to a dialog, process those arguments in the dialog, and return user-modified arguments to the caller. the code to open a dialog named mydialog.xul and pass it arguments: var params = {inn:{name:"foo", description:"bar", enabled:true}, out:null}; window.opendialog("chrome://myext/content/mydialog.xul", "", "chrome, dialog, modal, resizable=yes", params).focus(); if (params.out) { // user clicked ok. process changed arguments; e.g. write them to disk or whatever } else { // user clicked cance...
...ndow.arguments[0].out remains null // because this function is never called window.arguments[0].out = {name:document.getelementbyid("name").value, description:document.getelementbyid("description").value, enabled:document.getelementbyid("enabled").checked}; return true; } see also passing parameter to a dialog and getting return values from it. displaying the standard "open file"/"save file"/"select folder" dialogs nsifilepicker prompts and the prompt service now that you understand dialogs, let's examine prompts. prompts differ from dialogs in that they don't require custom xul. because of this, however, they are less customizable. most web developers are familiar with the alert() function: this is a prime example of a prompt. nsipromptservice is an xpcom in...
... xpcom interface available to c++ and chrome javascript code (not to web pages' js), that provides methods for displaying a few simple types of dialogs. refer to the interface documentation for documentation and sample code. for file/folder picker dialogs, see nsifilepicker. original version the original version of this tutorial was written by "ihoss" (it was here). links nsipromptservice open and save dialogs see also alerts and notifications ...
Adding sidebars - Archive of obsolete content
« previousnext » the sidebar in firefox is a relatively large and flexible space to add rich interfaces without requiring new windows or complicated overlays. sidebars take as much space as the user wants them to, and provide a frame where you can add elaborate data and controls. you're probably familiar with the bookmarks and history sidebars. if not, you can open either one from the view > sidebar menu. they also have shortcuts to open or close them using the keyboard. the code required to add a sidebar is very simple, as explained in creating a firefox sidebar. it's even simpler than that. all you need is to overlay the view sidebar menu. <menupopup id="viewsidebarmenu"> <menuitem id="xulschoolhello-sidebar" label="&xulschoolhello.sidebar.title;" accesskey="&xulschoolh...
...bination as well. shortcut keys can be very valuable for advanced users, but don't rely on them. the xul page for the sidebar can hold any content you want and it's no different from other xul windows or overlays. one minor difference is that the xul sidebar should be defined using the « xul reference « root element instead of window or dialog. the load event is fired every time the sidebar is opened, and unload every time it's closed, so you can use those for initialization and clean up . another, more important difference to take into account is that users can resize the sidebar to their liking, and in most cases, the sidebar is going to be fairly narrow. you should design the content of your sidebar carefully, so that it is usable and appealing regardless of width. there are ways to lim...
...eed to organize it in a way that doesn't take too much space. for this purpose we'll also look at some handy xul elements in this section. they allow you to stack content on top of other content and switch between different sections easily. the tabbox element the « xul reference « element creates a tabbed view of one or more tabpanel elements. you can see an example of a tabbox element if you open the firefox preferences window and select the advanced section. the tabs are styled to match the operating system you're using, so you should avoid changing the css in tab boxes. on the other hand, if you need ui that behaves like a tabbox but doesn't look like one, you should still favor using a tabbox and use css to change its look. using custom-made elements are likely to cause accessibility a...
...abel="&xulschoolhello.namecolumn.label;" flex="1" /> <treecol label="&xulschoolhello.greetingcolumn.label;" flex="3" /> </treecols> <treechildren> <treeitem> <treerow> <treecell label="peter" /> <treecell label="hey, what's up?" /> </treerow> </treeitem> <!-- notice that you need to specify the container attribute. ...
Connecting to Remote Content - Archive of obsolete content
sms. let url = "http://www.example.com/"; let request = components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"] .createinstance(components.interfaces.nsixmlhttprequest); request.onload = function(aevent) { window.alert("response text: " + aevent.target.responsetext); }; request.onerror = function(aevent) { window.alert("error status: " + aevent.target.status); }; request.open("get", url, true); request.send(null); in this example we demonstrate how to make a xmlhttprequest call in asynchronous mode. you can see that an instance of the xmlhttprequest class is created and it holds all functionality for making a request. we create this instance using xpcom instead of the usual way (new xmlhttprequest()) because this way works both in chrome and non-chrome code. follow...
... xml document, the responsexml property will hold an xmldocument object that can be manipulated using dom methods. sometimes the server doesn't specify an xml content-type header, which is necessary for the xml parsing to happen automatically. you can use overridemimetype to force the response to be parsed as xml. ...
...o be parsed as xml. request.overridemimetype("text/xml"); // do this before sending the request! the open method takes two required parameters: the http request method and the url to send the request. the http request method can be "get", "post" or "put". sending a post request requires you to set the content type of the request and to pass the post data to the send() method as below. request.open("post", url, true); request.setrequestheader("content-type", "application/x-www-form-urlencoded"); request.send("data=hello&version=2"); the third parameter for the open method specifies whether the request should be handled asynchronously or not. in asynchronous mode code execution continues immediately after the send call. in synchronous mode the code and user interface are blocked while wait...
... when you start debugging http requests, you may find it hard to know exactly what data was sent, especially with post data. we recommend you to use extensions like tamper data. they help you to track http/https requests and responses occurring in firefox. after installation, you can find a tamper data menu item in the menu bar: tools > tamper data or view > sidebar > tamper data once you open the tamper data view, all requests and responses will begin to appear in it. you can discover some interesting things about firefox like this, such as the automatic update urls for extensions, and the behavior of web applications such as gmail. if you click on the "start tamper" button, for every request made you will get a popup dialog for tampering with it before it is sent. you can use it to ...
JavaScript Object Management - Archive of obsolete content
it : function(aevent) { this._stringbundle = document.getelementbyid("xulschoolhello-string-bundle"); // you can make changes to the window dom here. } // more stuff }; window.addeventlistener( "load", function() { 〈namespace〉.browseroverlay.init(); }, false); there are some things you can't (or shouldn't) do inside load handlers, such as closing the window being loaded, or opening new windows, alerts or dialogs. the window has to finish loading before it can do any of these things. they are bad ui practices anyway and you should avoid them. if you really need to do something like this anyway, one way to do it is to have a timeout execute the code after a delay: init : function(aevent) { let that = this; this._stringbundle = document.getelementbyid("xs-hw-string-...
... to test a particular aspect of the chrome. modify the hello world extension so that the message says how many times it has been displayed. the message could say something like "hello! this message has been shown 5 times." keep the counter as a variable in the browseroverlay object, and increment it every time the message is going to be shown. once you have this working right, try the following: open the message a few times, so that the number increments. now open a new window and display the message from the new window. what do you think will happen? what will the count be this time? you probably didn't expect this, but the count was reset in the new window. each window keeps its own counter, and now the extension is not behaving as expected. this is a fundamental lesson: the chrome is not ...
... window. each window keeps its own counter, and now the extension is not behaving as expected. this is a fundamental lesson: the chrome is not global, it's window-specific. all of your scripts and objects are replicated for each window, and they work independently from each other. this is an issue that is very easy to overlook, since most firefox users, specially power users, have a single window open at all times. you have to make sure you test your extension with multiple windows open; never assume everything will work the same as with a single window. now, in most cases you'll need to coordinate data in a way that it is consistent for all open firefox windows. there are several ways in which you can do this. preferences is one of them, and they are covered in another section of this tutori...
...l xul windows that are not overlays, all jsm files, and all xpcom components (see further ahead). do this even if you don't need them now. it's better to just make a habit out of it. this is a point that is worth highlighting: modules work outside of the window scope. unlike scripts in the chrome, modules don't have access to objects such as window, document, or other global functions, such as openuilink. these are all ui components and ui operations anyway, so they are better done in the chrome. as a general guideline, we keep all of our business logic in jsm, available through service objects, and chrome scripts are limited to handle presentation logic. we handle most of our code through static objects, singleton objects that don't require instantiation. but it is sometimes necessar...
Setting up an extension development environment - Archive of obsolete content
larly comes in handy for the use of all currently available firefox versions. it even allows the running of simultaneous versions, at the same time. to quickly achieve our task of creating just a developer profile, we will start the application with the parameters: /path/to/firefox -no-remote -p profilename without these parameters, the default behavior of your mozilla applications is to only open the everyday user profile: named default. as we are specifically defining the user profile dev, if you don't have the dev profile already created, the profile selection window opens, where you can create it. in the following example, the described command starts a new instance of firefox, with a profile called dev; even if an instance of firefox is already running. on ubuntu (and many other lin...
...t enjoy the benefits of isolated resources, which we discussed earlier. the parameter -p profilename doesn't imply -no-remote, therefore use them together. if you are already running a firefox instance without -no-remote, and you attempt to start another instance with -p profilename (but without the -no-remote parameter), that second invocation would ignore its -p profilename parameter, instead opening a new window for the already running instance; sharing all its profile, sessions etc. download firefox download your desired version of firefox. unpack them in your user home directory, and name folders for easy navigation to firenightly and firedevedition or similar. you do not have to install these unstable versions, if you do not wish. make a symbolic link (also referred to as a shortcu...
...rate development profile when you enable these preferences. accessing firefox development preferences to change preference settings in firefox or seamonkey, type about:config in the location bar. you can also use the extension developer's extension, which provides a menu interface for firefox settings. accessing thunderbird development preferences to change preference settings in thunderbird, open the "preferences" (unix) or "options" (windows) interface. on the "advanced" page, select the "general" tab then click the "config editor" button. recommended development preferences not all preferences are defined by default, and are therefore not listed by default. you will have to create new (boolean) entries for them. for more information about mozilla preferences, refer to the mozillazine ...
... chrome list navigate and view files in chrome:// (firefox version, thunderbird version) chrome edit plus a user file editor (firefox and thunderbird) firebug a variety of development tools (firefox) pentadactyl, a general purpose extension with builtin tools for extension development, including a command line with chrome javascript eval...
Promises - Archive of obsolete content
is very easy to adapt to a promise-based approach. moreover, many third-party wrappers for the xmlhttprequest api now support promises out of the box. example direct usage task.spawn(function* () { // make the initial request. let resp = yield new promise((resolve, reject) => { let xhr = new xmlhttprequest; xhr.onload = resolve; xhr.onerror = reject; xhr.open("get", dataurl); xhr.responsetype = "json"; xhr.send(); }); let data = resp.target.response; // use the response to construct form data object for the // second request. let form = new formdata; form.append("id", data.id); form.append("content", data.content); // make the second request. resp = yield new promise((resolve, reject) => { ...
...arget.response; // use the response to construct form data object for the // second request. let form = new formdata; form.append("id", data.id); form.append("content", data.content); // make the second request. resp = yield new promise((resolve, reject) => { let xhr = new xmlhttprequest; xhr.onload = resolve; xhr.onerror = reject; xhr.open("post", updateurl); xhr.send(form); }); // use the response of the second request. notifyuser(resp.target.responsetext); }); example using promise-based helper the following example relies on the helper function defined below. task.spawn(function* () { // make the initial request. let xhr = yield request(dataurl, { responsetype: "json" }); let data = xhr.respo...
...ghs the cost of dealing with flat files directly. for use cases which are not easily served by other options, or for legacy code which cannot easily be upgraded to non-relational models, the sqlite.jsm module provides a clean, promise-based interface to sqlite databases. representative example usage components.utils.import("resource://gre/modules/sqlite.jsm"); task.spawn(function* () { // open the connection. let db = yield sqlite.openconnection({ path: database_path }); try { // start a transaction to insert the data. yield db.executetransaction(function* () { for (let node of nodes) // insert the node's data, using an automatically-cached, // pre-compiled statement, and parameter placeholders. yield ...
...n.getdatadirectory(accept)); xmlhttprequest function request(url, options) { return new promise((resolve, reject) => { let xhr = new xmlhttprequest; xhr.onload = event => resolve(event.target); xhr.onerror = reject; let defaultmethod = options.data ? ...
Creating a dynamic status bar extension - Archive of obsolete content
e javascript code in the file stockwatcher.js. unlike our previous sample, this one is implemented as an object. we do this because in future samples in this series, we're going to be doing things that are easier to do if our extension is implemented that way. we use the window.addeventlistener() dom function to tell firefox to call the stockwatcher.startup() function when a new browser window is opened: window.addeventlistener("load", function(e) { stockwatcher.startup(); }, false); our new extension has two primary functions: startup() and refreshinformation(). the refreshinformation() function contains another function, called inforeceived(). the following sections will examine these one by one. startup() the startup() function is called when a new browser window is opened. we end up reloa...
...formation. it's called whenever the user clicks on the status bar panel, when our extension is first added to a browser window, and by the interval handler to periodically update the display. refreshinformation: function() { var httprequest = null; var fullurl = 'http://quote.yahoo.com/d/quotes.csv?f=sl1d1t1c1ohgv&e=.csv&s=goog'; // ... httprequest = new xmlhttprequest(); httprequest.open('get', fullurl, true); httprequest.onload = inforeceived; httprequest.send(null); } the httprequest variable will contain an xmlhttprequest object. this object is used to configure and run an http request on a web server, which we'll use to fetch the stock quote data. the fullurl variable is the complete url to use when requesting a stock quote. in this case, we're using yahoo's comma-separa...
...able is the complete url to use when requesting a stock quote. in this case, we're using yahoo's comma-separated values return to fetch easily-parsed stock quote data for google (ticker symbol goog). refreshinformation() embeds another function, inforeceived(), which we'll look at separately shortly. the first thing we do is create a new xmlhttprequest object to use for processing our request. we open the request, specifying that we wish to perform an http "get" command with the url fullurl. the true boolean value in the third parameter indicates that we want to process the request asynchronously. setting the httprequest.onload property to our inforeceived() function configures the request to call inforeceived() when the response is received from the server. finally, we send the request to the...
...we need this so that we can make changes to the status bar panel itself. we then fetch the result retu...
Localizing an extension - Archive of obsolete content
well. we can do this by moving the strings into a string bundle. string bundles are created by establishing a property file that maps keys to string values. for a detailed explanation of how this works, see xul tutorial:property files. create a properties file the first thing we do is create a property file for the literal strings used by the javascript code in stockwatcher2.js: changestring=chg: openstring=open: lowstring=low: highstring=high: volumestring=vol: the stockwatcher2.properties file shown above maps five keys (changestring, openstring, lowstring, highstring, and volumestring) to the corresponding text in english. create the string bundle the next step is to modify the stockwatcher2.xul file to reference this property file. we do this by creating a string bundle, using the followi...
...d of using literal strings. this involves rewriting the refreshinformation() function to load the strings, and its enclosed inforeceived() function to use the loaded, localized, strings instead of string literals. ...
...ves rewriting the refreshinformation() function to load the strings, and its enclosed inforeceived() function to use the loaded, localized, strings instead of string literals. we add to refreshinformation() the following code: var stringsbundle = document.getelementbyid("string-bundle"); var changestring = stringsbundle.getstring('changestring') + " "; var openstring = stringsbundle.getstring('openstring') + " "; var lowstring = stringsbundle.getstring('lowstring') + " "; var highstring = stringsbundle.getstring('highstring') + " "; var volumestring = stringsbundle.getstring('volumestring') + " "; this code gets a reference to the string bundle element we added to stockwatcher2.xul by calling document.getelementbyid(), specifying the id "string-bundle". then it fetches all the strings w...
...he string bundle's getstring() method, passing the appropriate key for each string. in this case, we're also appending a space to the end of each string. that's just how this particular program works, and isn't something that you have to do. then we replace any occurrences of the literal strings with the appropriate variables: samplepanel.tooltiptext = changestring + fieldarray[4] + " | " + openstring + fieldarray[5] + " | " + lowstring + fieldarray[6] + " | " + highstring + fieldarray[7] + " | " + volumestring + fieldarray[8]; localizing the description in install.rdf see localizing extension descriptions. adding more localizations to add another localization for a new language, all you need to do is add another line to the chrome manifest referencing the new locale. for...
Basics - Archive of obsolete content
etpack.notifications.show({title: "my first message on jetpack", body: mybody, icon: myicon}); class tabs in this class you can find information about the tabs in your firefox window. the namespace for this class is jetpack.tabs. ...
...ingshiftstringsortstringsplicestringunshiftstring)this is some default text lengththe number of open tabsstring focusedthe current tab in your browserstring tostringstuffstring popstuffstring pushstuffstring reversestuffstring shiftstuffstring sortstuffstring splicestuffstring unshiftstuffstring onready()when the inherited document is fully loaded. onfocus()changing the focus of a tab. methods open(urlstring)opens a new tab in your browser with a defined url. ...
...ththe number of open tabsstring focusedthe current tab in your browserstring tostringstuffstring popstuffstring pushstuffstring reversestuffstring shiftstuffstring sortstuffstring splicestuffstring unshiftstuffstring onready()when the inherited document is fully loaded. onfocus()changing the focus of a tab. methods open(urlstring)opens a new tab in your browser with a defined url. ...
...ing focusedthe current tab in your browserstring tostringstuffstring popstuffstring pushstuffstring reversestuffstring shiftstuffstring sortstuffstring splicestuffstring unshiftstuffstring onready()when the inherited document is fully loaded. onfocus()changing the focus of a tab. methods open(urlstring)opens a new tab in your browser with a defined url. urlurl to be openedstring jetpack.tabs.open("http://www.example.com/"); ...
Menu - Archive of obsolete content
Archive › Mozilla › Jetpack › UI › Menu
e menuitem. note that some environments, notably gnome 2.28, do not support menuitem icons either by default or at all. label string the label of the menuitem. menu jetpack.menu if defined, the menuitem expands into a submenu. mnemonic string a character that is used as the item's shortcut key while the menu is open. it should be one of the characters that appears in the item's label. on some platforms this character is underlined in the label. type string currently only "separator" is supported. if this property is undefined, the item is a normal menuitem. note that when type == "separator", any other properties (such as label) may be specified. fancy separators may behave diffe...
...ject. context objects some callbacks passed into the api are called with a context object, such as contextmenuset.beforeshow(). context objects are objects that describe the context in which a context menu is shown. they have the following properties: property description node the dom node on which the menu is shown. this is the node the user clicked to open the menu. be careful when dealing with nested nodes. for example, if the user clicks on an image inside a link, this property will be set to the image, not the link. similarly, if the user clicks a node within a div, this property will be the node, not the div. document the content document in which the menu is shown. window the content window in whic...
...t, but action is only ever taken on the first matching item. ...
..."a link or image"); add an item to the image context menu, but only for images contained in hyperlinks: jetpack.menu.context.page.on("a > img").set("an image inside a link"); add a "recent tweets" submenu to the jetpack menu. (assume we've defined a getrecenttweets(), which invokes a callback with an array of strings.) when the menu is shown, it displays a "loading..." item. if the menu remains open when getrecenttweets() receives data from the network and calls done(), the "loading..." item is replaced with the tweets, one item per tweet: this example will not work on os x due to a platform bug in firefox. replace jetpack.menu with jetpack.menu.context.page to see the effect on the content context menu. see bug 526382 for more information. jetpack.menu.add({ label: "recent tweets", ...
Venkman Introduction - Archive of obsolete content
by selecting "find constructor" from the property's context menu. you can find the place where the object was instantiated with the "find creator" command. by default, properties of type function are not displayed, in order to conserve space in the view. if you would like to have functions displayed, check the "include functions" menu item in the view's context menu. you may need to close and re-open any objects you had open to see the change. properties that show up in a bold grey font are defined on an object from the prototype chain, and not on the actual object you are inspecting. if you would like to inspect the object's prototype and parent chains, check the "include ecma properties" menu item in the view's context menu. if a property shows up in a bold red font, an exception occurred ...
...ication framework that allows you to drag and drop, resize, and toggle all the available views, and even to create new views or modules for the debugger if you choose—though this latter is an advanced topic and a subject for a future article. to remove a view from venkman, simply click the close button at the top right of that view. when the view again becomes necessary—for example, when you open a source file from the loaded scripts view and want to view the source—the view reappears where it was last positioned. to make a view reappear explicitly, select it from the view->show/hide menu of the debugger. you can also make views float in their own separate windows. to make a view float, click the float button in the upper left of that view. you can access any of the basic views from th...
...cript engine begins to keep track of and compile all the scripts that are loaded in web pages and in the various mozilla user interfaces themselves. the engine tells venkman about the scripts it knows about, and those scripts are loaded into the "loaded scripts" view in the debugger. if you want to load new scripts in—say from a web page you are trying to troubleshoot—you can do so by simply opening that web page in the regular browser window, at which point the compiler gets the javascript source and populates the loaded scripts window with the new entry. using file->open from venkman will open a local file in the debugger, and using file->open web location will open and display the entire html contents of the requested page. probably, neither of these is what you really want. since the...
... debugging basics this section provides a brief example of a debugging session in order to familiarize you with some of the basic commands and operations of the debugger. ...
A XUL Bestiary - Archive of obsolete content
g instruction: <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> specifies a chrome to be loaded by the gecko rendering engine. in the example above, the chrome is simply a skin file to be loaded into the xul file, but the chrome can also be used to load whole chromes, as when a <menuitem> in one window brings up a new chrome: <menuitem value="mozilla help" oncommand="window.opendialog('chrome://help/content/help.xul', '_blank', 'chrome,all,dialog=no')" /> in this example, the chrome url is being used to point to a chrome within the package hierarchy of the mozilla application. a help chrome defined in mozilla/bin/chrome/help/ is being invoked from the help menu. note that when no file name is specified after...
...s reflected in the dom as nodes like link, layer, and img, xul is reflected in the application object model in the hierarchy of xul widgets: browser, menu, menuitem, and so on. the dom and the aom form a kind of continuum, the whole of which is manipulable from the standards upon which xul is based. near synonyms for xul there is much confusion about the words that begin with "x" in the mozilla open source project. the mozilla xparchitecture section below describes xpcom, xpidl, and xpconnect, three somewhat related technologies for getting access to application code from the interface. this section describes xul, xptoolkit, and xpfe, which are in some respects synonymous and in others quite different. in briefest terms, xul is the xml-based language used for creating interfaces, xptoolkit ...
...d an html web page are to one another, respectively. xul parts people sometimes get confused about the syntax for describing the parts of a widget. for a widget like the menu that appears in the following example, menu is the element and both value and the id are attributes. <menu id="file" label="file"> <menupopup> <menuitem label="new" oncommand="createnewdoc()" /> <menuitem label="open" oncommand="opendoc()" /> <menuitem label="close" oncommand="closedoc()" /> </menupopup> </menu> element names the item, the widget, while attributes describes features of that element, such as its name, its style, and so on. in object-oriented parlance, the element is analogous to the object itself while the attribute is like a property. the attribute has a value associated with it (such...
...nt names the item, the widget, while attributes describes features of that element, such as its name, its style, and so on. in object-oriented parlance, the element is analogous to the object itself while the attribute is like a property. the attribute has a value associated with it (such as the string "file" for the id attribute in the example above). note that the menu element includes both the opening tag at the top and the closing tag at the bottom of the example. in a way, the menu element comprises the menu element itself and its children, the popup and menuitems. events events are also a source of confusion for many less-hardened developers. in fact, i'm not sure i understand them adequately myself, but here goes a simple explanation of events and of how they are used, basically, in a...
panel.flip - Archive of obsolete content
for arrow popups, however, being able to flip horizontally makes sense. this attribute, set to both, permits that behavior. you will not normally have to use this attribute, since it's automatically applied to arrow panels. ...
...for arrow popups, however, being able to flip horizontally makes sense. this attribute, set to both, permits that behavior. you will not normally have to use this attribute, since it's automatically applied to arrow panels. ...
...for arrow popups, however, being able to flip horizontally makes sense. this attribute, set to both, permits that behavior. you will not normally have to use this attribute, since it's automatically applied to arrow panels. ...
...for arrow popups, however, being able to flip horizontally makes sense. this attribute, set to both, permits that behavior. you will not normally have to use this attribute, since it's automatically applied to arrow panels. ...
XUL Events - Archive of obsolete content
commandupdate this event occurs when a command update occurs on a <commandset> element. you would use this to update the disabled status of its commands. attribute: oncommandupdate contextmenu this event is sent to an element when the user requests to open the context menu for the element. the action to do this varies by platform, but it will typically be a right click. this handler is usually used to dynamically set the commands on a menu when the user requests to display it, or you can use popupshowing event. returning false from this event handler prevents the popup from appearing. attribute: oncontextmenu ...
...been hidden. attribute: onpopuphidden popuphiding this event is sent to a popup when it is about to be hidden. attribute: onpopuphiding popupshowing this event is sent to a popup just before it is popped open. ...
... attribute: onpopupshown syncfrompreference this event is sent when the element is being changed because a preference changed, or when an element is initialized from a preference. ...
... used to dynamically set the contents when the user requests to display it. returning false from this event handler prevents the popup from appearing. attribute: onpopupshowing popupshown this event is sent to a popup after it has been opened, much like the onload event is sent to a window when it is opened. attribute: onpopupshown syncfrompreference this event is sent when the element is being changed because a preference changed, or when an element is initialized from a preference. this event will only be sent to elements connected to a preference and in a prefwindow. this is not a real event inste...
Menus - Archive of obsolete content
loper' submenu on the 'tools' menu. firefox context menu element id description relevant context contentareacontextmenu the popup for the context menu when a web page is displayed in the browser area. spell-no-suggestions the no spelling suggestions item - notable as it is the first item on the context menu. ...
...nu on the 'tools' menu. firefox context menu element id description relevant context contentareacontextmenu the popup for the context menu when a web page is displayed in the browser area. spell-no-suggestions the no spelling suggestions item - notable as it is the first item on the context menu. ...
... element id description relevant context contentareacontextmenu the popup for the context menu when a web page is displayed in the browser area. spell-no-suggestions the no spelling suggestions item - notable as it is the first item on the context menu. ...
... description relevant context contentareacontextmenu the popup for the context menu when a web page is displayed in the browser area. spell-no-suggestions the no spelling suggestions item - notable as it is the first item on the context menu. ...
Extensions - Archive of obsolete content
n the order in which the overlays are applied. as you cannot predict this order, you should not rely on any menuitems being in particular positions in the presence of other extensions. modifying the context menu an extension may wish to modify the context menu associated with the browser area. normally, this menu displays menu items specific to what was context clicked or focused. for instance, opening a context menu for a link displays items to open the link in a new window or tab and to save or bookmark the link. an extension may modify the context menu to show additional items that either appear always, or appear only when certain content is selected. in firefox, the browser area that displays web pages has only one context menu. instead of having separate context menus depending on what...
...in this example, the thumbnailsshowhideitems function will be called when the popup is about to be shown. this function retrieves the menuitem with the id 'thumbnail-show' that was added by the extension and hides it if an image was not the target of the context menu. the popupnode property of the document holds the target of the context menu. for more details about hiding and sho...
...ent was context clicked for general information about how to determine which element was the target of the context menu, that is, the element that was context clicked, see determining what was context clicked firefox uses its own popupshowing event listener to adjust the items on the context menu. this allows the menu to have different commands for different types of targets. while the popup is open, the gcontextmenu global variable is set to an object which handles all of the functionality specific to the firefox context menu. specifically, this object is initialized with a set of properties that indiciate the type of object that was the target of the context menu. for instance, the 'onlink' property is set to true when a link was context-clicked. you may wish to use these properties inste...
... when a link was context-clicked. you may wish to use these properties instead of determining the type yourself, as the code already handles various special and complex cases that would take a lot of code to deal with manually. the following are the most common properties that you can check. an example follows. target the element that was context clicked. if the keyboard was used to open a context menu, this will be the focused element. ontextinput true if the target is a plain or password type input, a textarea, or an editable area. this would be used to enable or disable commands related to text editing. onimage true if the target is an image. hasbgimage true if the target or an ancestor has a background image. onmathml true if th...
MenuButtons - Archive of obsolete content
menu buttons menus may be attached to buttons in several ways. both the button and the toolbar button elements support two special types used for creating menu buttons. a button or toolbarbutton with a type attribute set to 'menu' creates a button that will open a menu when pressed. an arrow appears on the button next to the label or image indicating to the user that a menu is present. a button or toolbarbutton with a type attribute set to 'menu-button' creates a button that can be pressed normally. ...
... or toolbarbutton with a type attribute set to 'menu' creates a button that will open a menu when pressed. an arrow appears on the button next to the label or image indicating to the user that a menu is present. a button or toolbarbutton with a type attribute set to 'menu-button' creates a button that can be pressed normally. however a segment of the button displays an arrow which, when pressed, opens a menu. in either case, a menupopup element should be placed as a direct child of the button. the 'menu' button the 'menu' type of button is used when pressing the button alone should just open the menu and not execute a command directly. this works similarly to the menu tag, and would be used to present a set of commands to execute. to create a button of this type, set the type attribute of...
.... the 'menu' button the 'menu' type of button is used when pressing the button alone should just open the menu and not execute a command directly. this works similarly to the menu tag, and would be used to present a set of commands to execute. to create a button of this type, set the type attribute of the button to 'menu'. for instance, in the following example, pressing the 'view' button will open a menu which allows the user to select from a set of radio menuitems. presumably, when one is selected, the application view would be changed accordingly. when using the keyboard, pressing the down key will open the menu while the button is focused. <button type="menu" label="view"> <menupopup> <menuitem label="icons" type="radio" name="view"/> <menuitem label="list" type="radio" nam...
...attribute of the button to 'menu-button'. <toolbarbutton type="menu-button" label="save" oncommand="alert('save');"> <menupopup> <menuitem label="save this document"/> <menuitem label="save all" oncommand="alert('save all'); event.stoppropagation();"/> </menupopup> </toolbarbutton> here, the 'save' button has a type of 'menu-button', so a small arrow button will appear which will open the menu when pressed. pressing the label part of the button will invoke the command event on the button, so the 'save' alert will appear. however, we can associate a different command with the items on the submenu. when the command is fired, it bubbles up through the chain of elements to the top of the document. when the first item on the menu ('save this document') is activated, it will also d...
MenuItems - Archive of obsolete content
features of the menuitem element the menuitem element has a number of features beyond just being a label for a menu command. adding shortcut keys to menu items a shortcut key may be associated with a menu item. unlike the access key, which only functions while the menu is open, a shortcut key works at any time. a shortcut key can be created using the key element. in reality, the keyboard shortcut is handled by the key element, however, the menu item will display the shortcut next to its label. ...
...unlike the access key, which only functions while the menu is open, a shortcut key works at any time. a shortcut key can be created using the key element. in reality, the keyboard shortcut is handled by the key element, however, the menu item will display the shortcut next to its label. this allows the user to discover what shortcut keys are available by looking at the menus. <keyset> <key id="open-key" modifiers="accel" key="o"/> <key id="close-key" modifiers="accel" key="c"/> </keyset> <menubar> <menu label="view"> <menupopup> <menuitem label="open" key="open-key"/> <menuitem label="close" key="close-key"/> </menupopup> </menu> </menubar> the two menuitems are associated with a key using the key attribute. it should be set to the id of a key element within th...
...the "accel" modifier key varies on each platform, but is the key typically used for shortcut keys. for instance, if the "accel" key is control, the menu might display "ctrl + o". ...
...odifier key varies on each platform, but is the key typically used for shortcut keys. for instance, if the "accel" key is control, the menu might display "ctrl + o". although there isn't usually a need to do so, you can also set a custom label for the keyboard shortcut on the menu using the acceltext attribute. you might do this if the key associated with the item changes, for instance a list of open windows displayed on a window menu. <menuitem label="first window" acceltext="1"/> here the keyboard shortcut label will be '1', however you will need to write code to handle the key as well. adding icons to menu items an icon may be added to a menu item using the image attribute. the icon will appear to the left of the menuitem label. in addition to the image, a special class "menuitem-icon...
Special per-platform menu considerations - Archive of obsolete content
windows, the menu item which exits the application is labeled "exit" and is normally placed at the end of the file menu. the mac application menu on the macintosh, an extra menu exists beside the file menu; its name is the same as the name of the application. this menu contains a number of items that pertain to the application. for instance, this is the proper place to put the menu items which open the application preferences and which quit the application. this can be accomplished by ensuring that certain common ids are set for the menu items that need to be placed on the application menu. on the mac, these menu items will be moved onto the application menu, but on other platforms, they will be left in their original locations. this makes it easier to write the same xul code for all platf...
...er to write the same xul code for all platforms. here is a list of the menu item ids which are automatically handled. menu_filequitseparator the separator just before the quit/exit item. menu_filequititem the item which exits the application. menu_prefsseparator the separator just before the preferences/options item. menu_preferences the item which opens the application preferences. aboutseparator the separator just before the about item. aboutname the item which opens the about dialog for the application. menu_mac_services a menu which provides system services. menu_mac_hide_app selecting this item will hide the application. menu_mac_hide_others selecting this item will hide all other ...
...e application. menu_mac_services a menu which provides system services. menu_mac_hide_app selecting this item will hide the application. menu_mac_hide_others selecting this item will hide all other applications except this one. menu_mac_show_all selecting this item will show the windows for all applications. checkforupdates the item that opens the update dialog for the application, for applications that have one (such as seamonkey; firefox does not have this item). the last five items aren't normally used but are listed for completeness. here is an example: <menubar> <menu label="tools"> <menupopup> <menuitem label="spell check"/> <menuitem id="menu_preferences" label="preferences" oncommand=...
...date dialog for the application, for applications that have one (such as seamonkey; firefox does not have this item). the last five items aren't normally used but are listed for completeness. here is an example: <menubar> <menu label="tools"> <menupopup> <menuitem label="spell check"/> <menuitem id="menu_preferences" label="preferences" oncommand="window.opendialog('options.xul', '_new', 'chrome');"/> </menupopup> </menu> </menubar> this menu item will be placed on the application menu on the macintosh but left in the tools menu on other platforms. when moved to the application menu, the label and shortcut keys are overridden by platform conventions. however, regardless of the platform, the command event will be fired on the menu item when i...
state - Archive of obsolete content
Archive › Mozilla › XUL › Property › state
this state will occur during the popupshowing event. ...
...this state will occur during the popupshowing event. ...
...this state will occur during the popupshowing event. ...
...this state will occur during the popupshowing event. ...
Providing Command-Line Options - Archive of obsolete content
ng it in a category. see also: xulrunner:commandline overview the code below is an example of writing a javascript xpcom component to handle command line parameters. you can learn more about how the command line is interpreted by looking at the documentation for the nsicommandline interface. example the below example component implements two command line parameters: firefox.exe -myapp opens a chrome window for my application. firefox.exe -viewapp url opens a chrome window for my application and passes it an nsiuri object. using the example to use this sample code, save the commandline.js file into the components directory and add the following lines to your chrome.manifest file: component {2991c315-b871-42cd-b33f-bfee4fcbf682} components/commandline.js contract @mozilla.org...
...er/general-startup;1?type=myapp the javascript code const cc = components.classes; const ci = components.interfaces; components.utils.import("resource://gre/modules/xpcomutils.jsm"); components.utils.import("resource://gre/modules/services.jsm"); // changeme: to the chrome uri of your extension or application const chrome_uri = "chrome://myapp/content/"; /** * utility functions */ /** * opens a chrome window. * @param achromeurispec a string specifying the uri of the window to open. * @param aargument an argument to pass to the window (may be null) */ function openwindow(achromeurispec, aargument) { services.ww.openwindow(null, achromeurispec, "_blank", "chrome,menubar,toolbar,status,resizable,dialog=no", aargument); } // command line handler fun...
...ls.generateqi([ ci.nsicommandlinehandler ]), /* nsicommandlinehandler */ handle : function clh_handle(cmdline) { try { // changeme: change "viewapp" to your command line flag that takes an argument var uristr = cmdline.handleflagwithparam("viewapp", false); if (uristr) { // convert uristr to an nsiuri var uri = cmdline.resolveuri(uristr); openwindow(chrome_uri, uri); cmdline.preventdefault = true; } } catch (e) { components.utils.reporterror("incorrect parameter passed to -viewapp on the command line."); } // changeme: change "myapp" to your command line flag (no argument) if (cmdline.handleflag("myapp", false)) { openwindow(chrome_uri, null); cmdline.preventdefault = true; } }...
... cmdline.preventdefault = true; } }, // changeme: change the help info as appropriate, but // follow the guidelines in nsicommandlinehandler.idl // specifically, flag descriptions should start at // character 24, and lines should be wrapped at // 72 characters with embedded newlines, // and finally, the string should end with a newline helpinfo : " -myapp open my application\n" + " -viewapp <uri> view and edit the uri in my application,\n" + " wrapping this description\n" }; var nsgetfactory = xpcomutils.generatensgetfactory([commandlinehandler]); ...
Building Menus With Templates - Archive of obsolete content
this applies to menus on menubars, submenus, as well as menu-type buttons such as those with a type attribute set to menu. ...
...this applies to menus on menubars, submenus, as well as menu-type buttons such as those with a type attribute set to menu. ...
...this applies to menus on menubars, submenus, as well as menu-type buttons such as those with a type attribute set to menu. ...
... placed on the menuitem element. this causes the menupopup to only be created once. the menuitem elements however will be repeated for each result from the query. this makes sense, as we only want one menupopup to be created but multiple menuitem elements. the second button in the example displays an alert with the number of children the template-driven button has. if you press this button before opening the menu, there will be one child (the template itself). however, after the menu has been opened, there will be two children, one is the template and the other is the generated menupopup. note that the generated content does not get removed again when the menu is closed again; this extra feature of menus is only intended to be a performance enhancement to speed up the time it takes to display ...
Rule Compilation - Archive of obsolete content
done, the correct length can be returned. all of this is transparent to the xul developer. when the template builder decides to start generation is determined automatically, and you don't need to do anything special to get this to happen. however, there are two cases where content is not generated automatically: menus and child tree items. content inside a menu is not generated until the menu is opened. this makes sense since the user can't see the contents of the menu until it is open. however, it also means that the dom api usage, such as an attempt to get the number of child nodes as above, will also not include generated items until the menu is opened. this is an important distinction. that means that you will not be able to rely on being able to retrieve the generated menu items until th...
...lazy generation comes in handy for menus and trees especially when dealing with recursive items. ...
...lazy generation comes in handy for menus and trees especially when dealing with recursive items. ...
...lazy generation comes in handy for menus and trees especially when dealing with recursive items. it would be rather time consuming to generate output for every item in a tree, even for those not displayed, so the template builder doesn't do so. the template builder is even lazier. ...
Document Object Model - Archive of obsolete content
he window is the global object, and the same is also true for xul. naturally, this global object will be different for each window. each frame will also have a separate window object. the window is often referred to using the window property, although this is optional. sometimes, this is done just to clarify the scope of the method you are referring to. for example, the following two lines which open a new window are functionally equivalent: window.open("test.xul","_new"); open("test.xul","_new"); when you declare a function or a variable at the top level of a script, that is outside another function, you are actually declaring a property of the global object. in xul, each function you declare will be set as a property of the window object. for example, the following code will display the ...
...thus, if you want to access variables or call a function declared in a script used by another window, you just need to access it using the other window's window object. for example, if we combined the last two examples into a single file, we might want to call the gettext() function from within the other window (for example, the test.xul window). ...
... call a function declared in a script used by another window, you just need to access it using the other window's window object. for example, if we combined the last two examples into a single file, we might want to call the gettext() function from within the other window (for example, the test.xul window). to do this, we can do the following: alert(window.opener.gettext()); each window has an opener property which holds the window object that opened this one. in this example, we retrieve the opener window and call the gettext() function declared in a script used there. note that we qualified the property with the 'window' identifier just to be clearer. the window's open() method also returns a reference to the new window so you can call functions of the new window from the opener. it is i...
... the window object isn't defined by any dom specification, but in mozilla is sometimes considered part of dom level 0, a name used by some developers to refer to the dom-like functions before they were added to specifications. ...
More Tree Features - Archive of obsolete content
functions which specify the hierarchy of the items in a tree. each item in the tree has a level starting at 0. the topmost items in the tree will have a level of 0, the children of those items will have a level of 1, the children below that will have a level of 2, and so on. the tree will query the view for the level of each item in order to determine how to draw the rows. the tree will draw the open and close icons to open and close a parent item as well as lines connecting the children to their parents. the tree will also handle drawing the rows with the right level of indenting. however, the view will need to make sure it keeps track of the level of the rows as necessary. this can sometimes be quite tricky, but fortunately, the built-in content tree view does all of the hard work for us. t...
...d to do to make sure the hierarchy works properly. first, you need to mark the treeitem element that has children as a container. you do this by adding the container attribute to it as follows: <treeitem container="true" /> this allows the user to click on the row that corresponds to the treeitem to expand and collapse the inner rows. you can have the child rows initially displayed by adding the open attribute. when the user expands and collapses the parent, the view's toggleopenstate function will be called to toggle the item between open and closed. for a content tree view, this will set the open attribute to reflect the current state. the second change is that you must put the primary attribute on the first column. this causes a small triangle or plus sign to appear before the cells in tha...
...ser cannot hide the primary column using the drop down to the right of the columns. ...
...<treecell label="jerry" /> <treecell label="hodge" /> </treerow> </treeitem> </treechildren> </treeitem> </treechildren> </tree> this has created a hierarchical tree. as can be seen in the image, a small plus or minus sign (often called a twisty) has appeared next to the first row, indicating that it contains child rows. by clicking the row, the user can open and close the list. the child rows are indented. notice how the guys row only needs one column as it is a placeholder item for its children. the outer treeitem element contains a single treerow element and a treechildren element. the former creates the data for the parent row and the latter contains the child items. you can nest rows deeper as well. remember that you must use the container attrib...
XUL Structure - Archive of obsolete content
files with the content type of application/vnd.mozilla.xul+xml (eg with php header('content-type: application/vnd.mozilla.xul+xml');). this content type is how mozilla knows the difference between html and xul. mozilla does not use the file extension, unless reading files from the file system, but you should use the .xul extension for all xul files. you can load xul files from your own machine by opening them in the browser, or by double-clicking the file in your file manager. remember that remote xul will have significant restrictions on what it can do, and does not work with current firefox versions! document types: html xml xul css mozilla uses a distinctly different kind of document object (dom) for html and xul, although they share much of the same functionality. there are three main t...
...ype to function. to summarize the points made above: mozilla renders both html and xul using the same underlying engine and uses css to specify their presentation. xul may be loaded from a remote site, from the local file system, or installed as a package and accessed using a chrome url. this last option is what browser extensions do. chrome urls may be used to access installed packages and open them with enhanced privileges. html, xml, and xul each have a different document type. some features may be used in any document type whereas some features are specific to one kind of document. the next few sections describe the basic structure of a chrome package which can be installed into mozilla. however, if you just want to get started building a simple application, you may skip ahead to ...
...rl is by creating a package as described in the next few sections. this directory is called 'chrome' probably because it seemed like a convenient name to use in keeping with the chrome packages that are included with mozilla. to further the confusion, there are two other places where the word "chrome" might appear. these are the -chrome command line argument and the chrome modifier to the window.open() function. neither of these features grant extra privileges; instead they are used to open a new top-level window without the browser ui such as the menu and toolbar. you will commonly use this feature in more complex xul applications since you wouldn't want the browser ui to exist around your dialog boxes. the files for a package are usually combined into a single jar file. a jar file may be c...
...although it's normal to combine the files into a jar file, packages may also be accessed in expanded form into a directory. ...
XUL Event Propagation - Archive of obsolete content
/www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" oncommand="alert('window handler')"> <vbox> <vbox style="background-color: lightgrey;" oncommand="alert('box handler')"> <menu class="menu" label="file" oncommand="alert('menu handler')"> <menupopup> <menuitem oncommand="alert('new item alert')" label="new" /> <menuitem label="open" /> <menuitem oncommand="alert('close handler')" label="close" /> </menupopup> </menu> <menu class="menu" label="edit"> <menupopup> <menuitem oncommand="alert('edit source handler')" label="edit source" /> <menuitem label="reload" /> <menuitem label="view source" /> </menupopup> </menu> </vbox> <spring flex="1" /> </vbox> </window> in this f...
... the event handler in the menu finds out whic...
... the event handler in the menu finds out which menuitem was...
... the event handler in the menu finds out which menuitem was actually clicked and takes different actions accordingly. ...
menulist - Archive of obsolete content
selected choice is displayed on the menulist element. to create the drop-down, put a menupopup inside the menulist containing the choices as menuitem elements. the command event may be used to execute code when the menulist selection changes. more information is available in the xul tutorial. ...
...ulist selection changes. more information is available in the xul tutorial. ...
... on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. oncommand type: script code this event handler is called when the command is activated. this occurs when a user selects a menu item or presses a keyboard shortcut attached to the command. open type: boolean for the menu type buttons, the open attribute is set to true when the menu is open. the open attribute is not present if the menu is closed. preference type: id connects the element to a corresponding preference. this attribute only has any effect when used inside a prefwindow. more information is available in the preferences system article. readonly type: boolean ...
...: integer read only property holding the number of child items. label type: string gets and sets the value of the label attribute. menuboxobject type: nsimenuboxobject a reference to the nsimenuboxobject which implements the menu. menupopup type: menupopup element a reference to the menupopup used by the menu or menulist. this property is read-only. open type: boolean gets and sets the value of the open attribute. selectedindex type: integer returns the index of the currently selected item. you may select an item by assigning its index to this property. by assigning -1 to this property, all items will be deselected. returns -1 if no items are selected selecteditem type: element holds th...
prefpane - Archive of obsolete content
load="ongeneralpaneload(event);"> <preferences> <preference id="pref_one" name="extensions.myextension.one" type="bool"/> ... more preferences ... </preferences> <checkbox label="number one?" preference="pref_one"/> ... more ui elements ... </prefpane> attributes helpuri type: uri the uri of the help page associated with a preference panel. the uri will be opened using the help viewer when the help button is pressed. image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem e...
...n the following example for preference dialogs to work correctly: <prefwindow> <prefpane id="panegeneral" label="general"> ... </prefpane> <prefpane id="panesecurity" label="security"> ... ...
...e id="panegeneral" label="general"> ... </prefpane> <prefpane id="panesecurity" label="security"> ... ...
...l"> ... </prefpane> <prefpane id="panesecurity" label="security"> ... ...
Getting started with XULRunner - Archive of obsolete content
.framework. copy this to the /library/frameworks directory, or another location of your choice. on linux, you only need to unpack the archive if you are using a pre-release xulrunner. in all systems you should unzip the omni.ja file into some example directory and take a look at all the awesome! first change the file extension to zip and then use your normal filesystem's decompression tool to open it up. the contents of omni.ja are available to xulrunner applications and are what make it possible to build amazing applications easily! step 3: create the application folder structure time to start a simple, bare bones application shell. call it a xul “hello world” if you want. all of what you see below can be found in the xulrunner documentation here on mdn in much more detail. hint:...
... toolkit.singletonwindowtype allows configuring the application to allow only one instance at a time. the toolkit preferences are described in further detail in xulrunner:specifying startup chrome window. the debugging preferences are di...
...ef("javascript.options.showinconsole", true); pref("javascript.options.strict", true); pref("nglayout.debug.disable_xul_cache", true); pref("nglayout.debug.disable_xul_fastload", true); xulrunner specific preferences include: toolkit.defaultchromeuri specifies the default window to open when the application is launched. toolkit.defaultchromefeatures specifies the features passed to window.open() when the main application window is opened. toolkit.singletonwindowtype allows configuring the application to allow only one instance at a time. the toolkit preferences are described in further detail in xulrunner:specifying startup chrome window. the debugging preferences are discussed in debugging a xulrunner application step 7: create some xul finally, we need to create a simple xul...
...ude it into the xul file. main.js: function showmore() { document.getelementbyid("more-text").hidden = false; } for more information about xul see: xul. for information about mixing html elements into your xul read adding html elements. step 8: run the application the moment of truth. we need to get xulrunner to launch the bare-bones application. windows from a windows command prompt opened to the myapp folder, we should be able to execute this: c:\path\to\xulrunner.exe application.ini of course, if you opted to install xulrunner then you could simply do ​%programfiles%\xulrunner.exe application.ini or on 64 bit systems ​%programfiles(x86)%\xulrunner.exe application.ini note: you can also install your application when you're finished debugging it. see xul application ...
XULRunner Hall of Fame - Archive of obsolete content
runner 30 with i18n support. mathml support is significant. includes smil audio overlays and idpf fixed layout. celtx all-in-one media pre-production software. source chatzilla a standalone version of the chatzilla irc client. conkeror a highly programmable web browser with a leopard-oriented design inspired by emacs. source evergreen - staff client evergreen is an open source library system. source ieditweb a client/server based content manager and internet application suite. ieditweb users can add pages, images, forms, ecommerce many special effects and much more using the xulrunner based client. it will comunicate dyamically with the ieditweb server to maintain a fully configured web site with embedded web applications. it also contains a built in ema...
...ght integration is that the form in a web site can collect payment and set up a login for a members only section. a newsletter can be sent to members who sign up on a regular bases. instantbird multi-protocol im client. build instructions komodo edit a multi-language code development tool. build instructions pencil the pencil project's unique mission is to build a free and opensource tool for making diagrams and gui prototyping that everyone can use. source qiqqa research manager, reference manager, and pdf manager. xulrunner is embedded to provide automatic search against journal archives, automatic acquisition of bibtex information, and automatic downloading of pdfs. slimerjs slimerjs is a xulrunner application that can be launched with firefox, allow...
... of firefox. build instructions convertigo enterprise mashup server a web integrator and web clipper tool to build enterprise mashups nightingale nightingale is a communtiy fork of the songbird media player, bringing back linux support and much more. build instructions kirix strata a new specialty browser for accessing and manipulating data from the web telekast an open source teleprompter and script editor. source tomtom home 2 pc application to manage tomtom gps devices understanding faith (desktop version) a multimedia religious education resource for catholic secondary schools in australia. vivipos integrated point-of-sales software-hardware solution with customized xul application as the device front-end. english site. inactive proj...
...ybrowser is a very simple example browser", xulmine. an updated version of "mybrowser" that works with firefox 25.0.1+ is available in matthew kastor's xulrunner examples at https://github.com/matthewkastor/xulrunner-examples/ exch a currency conversion tool using updated data from http://finance.yahoo.com/currency. you can use the firefox extension or the stand-alone xul application. opendocument viewer cross-platform viewer for opendocument files. taskpool taskpool is a little application to help keep track of time. you can add tasks to a pool, turn them on and off, and it will tick off seconds. svgclock an svg-based clock. crowbar a web scraping environment based on the use of a server-side headless mozilla-based browser. 30b a xulrunner-based...
3D games on the Web - Game development
you can generate and render dynamic 3d graphics with javascript that is hardware accelerated. documentation and browser support the webgl project documentation and specification is maintained by the khronos group, not the w3c as with most of the web apis. support on modern browsers is very good, even on mobile, so you don't have to worry about that too much. ...
...ocumentation and specification is maintained by the khronos group, not the w3c as with most of the web apis. support on modern browsers is very good, even on mobile, so you don't have to worry about that too much. the main browsers are all supporting webgl and all you need to focus on is optimizing the performance on the devices you use. there's an ongoing effort on releasing webgl 2.0 (based on opengl es 3.0) in the near future, which will bring many improvements and will help developers build games for the modern web using current, powerful hardware. explaining the basic 3d theory the basics of 3d theory centers around shapes represented in a 3d space, with a coordinate system being used to calculate their positions. see our explaining basic 3d theory article for all the information you n...
...ning basic 3d theory article for all the information you need. advanced concepts you can do a lot more with webgl. there are some advanced concepts which you should dive into and learn more about — like shaders, collision detection, or the latest hot topic: virtual reality on the web. shaders it's worth mentioning shaders, which are a separate story on their own. shaders use glsl, a special opengl shading language, with syntax similar to c, that is executed directly by the graphics pipeline. they can be split into vertex shaders and fragment shaders (or pixel shaders) — the former transforms shape positions to real 3d drawing coordinates, while the latter computes rendering colors and other attributes. you should definitely check out glsl shaders article to learn more about them. coll...
...er 3d library, it provides built-in functions to help you implement common 3d functionality more quickly. see the building up a basic demo with babylon.js subpage for the basics of using babylon.js, including setting up a development environment, structuring the necessary html, and writing the javascript code. building up a basic demo with playcanvas playcanvas is a popular 3d webgl game engine open-sourced on github, with an editor available online and good documentation. see the building up a basic demo with playcanvas subpage for higher-level details, and further articles showing how to create demos using the playcanvas library, and the online editor. building up a basic demo with three.js three.js, like any other library, gives you a huge advantage: instead of writing hundreds of lines...
Visual-js game engine - Game development
( + server engine tools + server part of web apps ) -3d part : webgl based on three.js engine -3d part : webgl2 based on glmatrix 2.0 -2d part (new): this is typescript based game engine (client part ts). with strong connection with webpack physics done with (matter.js) matter ts this part is removed from this project. ...
...) important : you will need net 4.5.2 minimum also redistribution pack for c++ how to start project ? 1) click create application 2) enter new application name in input prompt 3) select folder for server part of application (important : www is not secure place) 4) select folder for client part of application ( any path in www) 5) new app name will appear in project list , select and click open application 6) open your server folder : install node.js modules one way - use windows bat-s file (in server root folder with prefix install_ ) second way - open cmd terminal and enter next command : npm install mysql npm install delivery npm install express npm install mkdirp npm install socket.io npm install nodemailer@0.7.0 very easy installation and project files generator . ...
...t command : npm install mysql npm install delivery npm install express npm install mkdirp npm install socket.io npm install nodemailer@0.7.0 very easy installation and project files generator . now you can use on-page-editor (nice for visual setup , checking positions and dimensions - not for logic ) . manual start from cmd : server_folder/node editor.js after starting on-page-editor open browser icon to open internet browser in editor mode . see video explanation : if you use editor.js to visual create game object method , you must start ***node build_from_editor_to_visual_js_file.js*** on the end of work. this tool will create visual.js in folder starter/ with all your game object was created in editor style . or you can use visual-js source editor. visual-js sourc...
...ources - explorer view for images and audios , you can drag or edit also need to execute node build_resources for creating resources object for engine. inserting new code will be always at current line selected intro editor . save on drop menu or better with ctrl+s before testing in browsers. adding new script explanation : after adding new script and save script if you have extra changes , open starter/run.js and you will found line : sys.script.load("scripts/new_script.js") ctrl+s use from menu run->choose browser for testing . - important safari not working at the moment chrome , firefox , opera tutorial - pencil (animation path) : how to use pencil tool to create path object . path object can be saved intro localhost , you can collect object and put it direct source co...
Mobile accessibility - Learn web development
screen prompts that you are presented with. when talkback is turned on, your android device's basic controls will be a bit different. for example: single-tapping an app will select it, and the device will read out what the app is. swiping left and right will move between apps, or buttons/controls if you are in a control bar. the device will read out each option. double-tapping anywhere will open the app/select the option. you can also "explore by touch" — hold your finger down on the screen and drag it around, and your device will read out the different apps/items you move across. if you want to turn talkback off: navigate back to the talkback menu screen (using the different gestures that are currently enabled.) navigate to the slider switch and activate it to turn it off. n...
...ouble-click to choose that option. for details on all the options available under the global and local context menus, see use global and local context menus. browsing web pages you can use the local context menu while in a web browser to find options to navigate web pages using just the headings, form controls, or links, or navigate line by line, etc. for example, with talkback turned on: open your web browser. activate the url bar. enter a web page that has a bunch of headings on it, such as the front page of bbc.co.uk. to enter the text of the url: select the url bar by swiping left/right till you get to it, and then double-tapping. hold your finger down on the virtual keyboard until you get the character you want, and then release your finger to type it. repeat for each c...
... a single tap will cause the item you tap on to be selected; your device will speak the item you've tapped on. you can also navigate the items on the screen by swiping left and right to move between them, or by sliding your finger around on the screen to move between different items (when you find the item you want, you can remove your finger to select it). to activate the selected item (e.g., open a selected app), double-tap anywhere on the screen. swipe with three fingers to scroll through a page. tap with two fingers to perform a context-relevant action — for example, taking a photo while in the camera app. to turn it off again, navigate back to settings > general > accessibility > voiceover using the above gestures, and toggle the voiceover slider back to off. unlock phone to un...
... if it is an option you can iterate the value of (such as volume or speaking rate), you can do a swipe up or down to increase or decrease the value of the selected item. the options available under the rotor are context-sensitive — they will differ depending on what app or view you are in (see below for an example). browsing web pages let's have a go at web browsing with voiceover: open your web browser. activate the url bar. enter a web page that has a bunch of headings on it, such as the front page of bbc.co.uk. to enter the text of the url: select the url bar by swiping left/right until you get to it, and then double-tapping. for each character, hold your finger down on the virtual keyboard until you get the character you want, and then release your finger to selec...
Web fonts - Learn web development
as normal: html { font-family: "myfont", "bitstream vera serif", serif; } the syntax does get a bit more complex than this; we'll go into more detail below. there are two important things to bear in mind about web fonts: browsers support different font formats, so you'll need multiple font formats for decent cross-browser support. for example, most modern browsers support woff/woff2 (web open font format versions 1 and 2), the most efficient format around, but older versions of ie only support eot (embedded open type) fonts, and you might need to include an svg version of the font to support older versions of iphone and android browsers. we'll show you below how to generate the required code. fonts generally aren't free to use. you have to pay for them, and/or follow other license co...
...font squirrel and choose two fonts — a nice interesting font for the headings (maybe a nice display or slab serif font), and slightly less flashy and more readable font for the paragraphs. when you find each font, press on the download button, and save the file inside the same directory as the html and css files you saved earlier. it doesn't matter whether they are ttf (true type fonts) or otf (open type fonts). in each case, unzip the font package (web fonts are usually distributed in zip files containing the font file(s) and licensing information). you may find multiple font files in the package — some fonts are distributed as a family with different variants available, for example thin, medium, bold, italic, thin italic, etc. for this example, we just want you to concern yourself with ...
...s way of making sure you've got everything you need. a demo html file for each font — load these in your browser to see what the font will look like in different usage contexts. a stylesheet.css file, which contains the generated @font-face code you'll need. to implement these fonts in your demo, follow these steps: rename the unzipped directory to something easy and simple, like fonts. open up the stylesheet.css file and copy both the @font-face blocks contained inside into your web-font-start.css file — you need to put them at the very top, before any of your css, as the fonts need to be imported before you can use them on your site. each of the url() functions points to a font file that we want to import into our css — we need to make sure the paths to the files are correct, ...
...on at google-font.html and google-font.css, if you need to check your work against ours (see it live). @font-face in more detail let's explore that @font-face syntax generated for you by fontsquirrel. ...
Sending forms through JavaScript - Learn web development
xhr.send( urlencodeddata ); } btn.addeventlistener( 'click', function() { senddata( {test:'ok'} ); } ) here's the live result: note: this use of xmlhttprequest is subject to...
...this creates a formdata object that represents the data contained i...
... const form = document.getelementbyid( "myform" ); // ...and take over its submit event. form.addeventlistener( "submit", function ( event ) { event.preventdefault(); senddata(); } ); } ); here's the live result: you c...
... xhr.send( data ); } // access our form... const form = document.getelementbyid( "theform" ); // ...to take over the submit event form.
HTML basics - Learn web development
ke the font bigger or smaller, and so on. for example, take the following line of content: my cat is very grumpy if we wanted the line to stand by itself, we could specify that it is a paragraph by enclosing it in paragraph tags: <p>my cat is very grumpy</p> anatomy of an html element let's explore this paragraph element a bit further. the main parts of our element are as follows: the opening tag: this consists of the name of the element (in this case, p), wrapped in opening and closing angle brackets. this states where the element begins or starts to take effect — in this case where the paragraph begins. the closing tag: this is the same as the opening tag, except that it includes a forward slash before the element name. this states where the element ends — in this case where...
... elements can also have attributes that look like the following: attributes contain extra information about the element that you don't want to appear in the actual content. here, class is the attribute name and editor-note is the attribute value. ...
...ent a non-unique identifier that can be used to target it (and any other elements with the same class value) with style information and other things. an attribute should always have the following: a space between it and the element name (or the previous attribute, if the element already has one or more attributes). the attribute name followed by an equal sign. the attribute value wrapped by opening and closing quotation marks. note: simple attribute values that don't contain ascii whitespace (or any of the characters " ' ` = < > ) can remain unquoted, but it is recommended that you quote all attribute values, as it makes the code more consistent and understandable. nesting elements you can put elements inside other elements too — this is called nesting. if we wanted to state tha...
...nesting elements you can put elements inside other elements too — this is called nesting. if we wanted to state that our cat is very grumpy, we could wrap the word "very" in a <strong> element, which means that the word is to be strongly emphasized: <p>my cat is <strong>very</strong> grumpy.</p> you do however need to make sure that your elements are properly nested. in the example above, we opened the <p> element first, then the <strong> element; therefore, we have to close the <strong> element first, then the <p> element. the following is incorrect: <p>my cat is <strong>very grumpy.</p></strong> the elements have to open and close correctly so that they are clearly inside or outside one another. if they overlap as shown above, then your web browser will try to make the best guess at w...
Test your skills: Links - Learn web development
ask we want you to help fill in the links on our whales information page: the first link should be linked to a page called whales.html, which is in the same directory as the current page. we'd also like you to give it a tooltip when moused over that tells the user that the page includes information on blue whales and sperm whales. the second link should be turned into a link you can click to open up an email in the user's default mail application, with the recipient set as "whales@example.com". you'll get a bonus point if you also set it so that the subject line of the email is automatically filled in as "question about whales". note: the first link in the example has the target="_blank" attribute set on it, so that when you click on it, it opens the page in a new tab. this is not str...
...nt set as "whales@example.com". you'll get a bonus point if you also set it so that the subject line of the email is automatically filled in as "question about whales". note: the first link in the example has the target="_blank" attribute set on it, so that when you click on it, it opens the page in a new tab. this is not strictly best practice, but we've done it here so that the page doesn't open in the embedded <iframe>, getting rid of your example code in the process! try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. links 2 in this task we want you to fill in the four links so that they link to the appropriate places: the first link should link to an image called bl...
...hird link should link to the uk google image search. the base url is https://www.google.co.uk, and the image search is located in a subdirectory called imghp. the fourth link should link to the paragraph at the very bottom of the current page. it has an id of bottom. note: the first three links in the example have the target="_blank" attribute set on them, so that when you click on them, they open the linked page in a new tab. this is not strictly best practice, but we've done it here so that the pages don't open in the embedded <iframe>, getting rid of your example code in the process! try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. links 3 the following links link to a...
..., a support email address, and a pdf factfile that is 4mb in size. in this task we want you to: take the existing paragraphs with poorly-written link text, and rewrite them so that they have good link text. add a warning to any links that need a warning added. note: the first and third links in the example have the target="_blank" attribute set on them, so that when you click on them, they open the linked page in a new tab. this is not strictly best practice, but we've done it here so that the pages don't open in the embedded <iframe>, getting rid of your example code in the process! try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. assessment or further help you can pr...
HTML table advanced features and accessibility - Learn web development
ired users. prerequisites: the basics of html (see introduction to html). objective: to learn about more advanced html table features, and the accessibility of tables. adding a caption to your table with <caption> you can give your table a caption by putting it inside a <caption> element and nesting that inside the <table> element. you should put it just below the opening <table> tag. <table> <caption>dinosaurs in the jurassic period</caption> ... </table> as you can infer from the brief example above, the caption is meant to contain a description of the table contents. this is useful for all readers wishing to get a quick idea of whether the table is useful to them as they scan the page, but particularly for blind users. rather than have a screenreader ...
...n also be used on the <table> element to provide a description — this is also read out by screenreaders. we'd recommend using the <caption> element instead, however, as summary is deprecated by the html5 spec, and can't be read by sighted users (it doesn't appear on the page.) active learning: adding a caption let's try this out, revisiting an example we first met in the previous article. open up your language teacher's school timetable from the end of html table basics, or make a local copy of our timetable-fixed.html file. add a suitable caption for the table. save your code and open it in a browser to see what it looks like. note: you can find our version on github — see timetable-caption.html (see it live also). adding structure with <thead>, <tfoot>, and <tbody> as your ...
... (the browser will still render it at the bottom of the table). the <tbody> element needs to wrap the other parts of the table content that aren't in the table header or footer. it will appear below the table header or sometimes footer, depending on how you decided to structure it. note: <tbody> is always included in every table, implicitly if you don't specify it in your code. to check this, open up one of your previous examples that doesn't include <tbody> and look at the html code in your browser developer tools — you will see that the browser has added this tag for you. you might wonder why you ought to bother including it at all — you should, because it gives you more control over your table structure and styling. active learning: adding table structure let's put these new elem...
...— you will see that the browser has added this tag for you. you might wonder why you ought to bother including it at all — you should, because it gives you more control over your table structure and styling. active learning: adding table structure let's put these new elements into action. first of all, make a local copy of spending-record.html and minimal-table.css in a new folder. try opening it in a browser — you'll see that it looks ok, but it could stand to be improved. the "sum" row that contains a summation of the spent amounts seems to be in the wrong place, and there are some details missing from the code. put the obvious headers row inside a <thead> element, the "sum" row inside a <tfoot> element, and the rest of the content inside a <tbody> element. save and refresh, a...
Index - Learn web development
s obvious, but too many projects fail not from a lack of technical know-how, but from lack of goals and vision. 17 how do i use github pages? beginner, github, guide, web, gh-pages, git, publish github is a "social coding" site. it allows you to upload code repositories for storage in the git version control system. you can then collaborate on code projects, and the system is open-source by default, meaning that anyone in the world can find your github code, use it, learn from it, and improve on it. you can do that with other people's code too! this article provides a basic guide to publishing content using github's gh-pages feature. 18 how do you host your website on google app engine? beginner, google app engine, google cloud platform, guide, host, learn, ...
...and navigating to the html file. there are many ways to achieve this. 21 how do you upload your files to a web server? beginner, ftp, github, uploading, webmechanics, hosting, rsync, sftp if you have built a si...
...and navigating to the html file. there are many ways to achieve this. ...
...ary or glossary. dictionaries and glossaries formally associate keywords with one or more descriptions, as in this case: 255 tips for authoring fast-loading html pages advanced, guide, html, needsupdate, performance, web, web performance these tips are based on common knowledge and experimentation. 256 use javascript within a webpage beginner, html, javascript, openpractices javascript is a programming language mostly used client-side to make webpages interactive. you can create amazing webpages without javascript, but javascript opens up a whole new level of possibilities. 257 using data attributes custom data attributes, example, guide, html, html5, web html5 is designed with extensibility in mind for data that should be associat...
Fetching data from the server - Learn web development
case(); let url = verse + '.txt'; to begin creating an xhr request, you need to create a new request object using the xmlhttprequest() constructor. you can call this object anything you like, but we'll call it request to keep things simple. add the following below your previous lines inside your updatedisplay() function: let request = new xmlhttprequest(); next, you need to use the open() method to specify what http request method to use to request the resource from the network, and what its url is. we'll just use the get method here and set the url as our url variable. add this below your previous line: request.open('get', url); next, we'll set the type of response we are expecting — which is defined by the request's responsetype property — as text. this isn't stri...
...xample to use fetch instead. make a copy of your previous finished example directory. ...
... { poemdisplay.textcontent = text; }); }); load the example in your browser (running it through a web server) and it should work just the same as the xhr version, provided you are running a modern browser. so what is going on in the fetch code? first of all, we invoke the fetch() method, passing it the url of the resource we want to fetch. this is the modern equivalent of request.open() in xhr, plus you don't need any equivalent to .send(). after that, you can see the .then() method chained onto the end of fetch() — this method is a part of promises, a modern javascript feature for performing asynchronous operations. fetch() returns a promise, which resolves to the response sent back from the server — we use .then() to run some follow-up code after the promise resolves, w...
... abbreviation of "binary large object" and can basically be used to represent large file-like objects, such as images or video files). once we've successfully received our blob, we create an object url out of it using createobjecturl(). this returns a temporary internal url that points to an object referenced inside the browser. these are not very readable, but you can see what one looks like by opening up the can store app, ctrl-/right-clicking on an image, and selecting the "view image" option (which might vary slightly depending on what browser you are using). the object url will be visible inside the address bar, and should be something like this: blob:http://localhost:7800/9b75250e-5279-e249-884f-d03eb1fd84f4 challenge: an xhr version of the can store we'd like you to try converting t...
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
tions: displays the check all and remove completed buttons, and emits the corresponding events required to handle their functionality. newtodo: displays the <input> field and add button for adding a new todo. todosstatus: displays the "x out of y items completed" status heading. code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app state, run cd mdn-svelte-tutorial/05-advanced-concepts or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/05-advanced-concepts remember to run npm install && npm run dev to start your app in development mode. repl to code along with us using the repl, start at https://svelte.dev/repl/76cc90c43a37452e8c...
...per into svelte reactivity. reactivity gotchas: updating objects and arrays to see what's happening we can log the todos array from the checkalltodos() function to the console. update your existing checkalltodos() function to the following: const checkalltodos = (completed) => { todos.foreach(t => t.completed = completed) console.log('todos', todos) } go back to your browser, open your devtools console, and click check all/uncheck all a few times. you'll notice that the array is successfully updated every time you press the button (the todo objects' completed properties are toggled between true and false), but svelte is not aware of that. this also means that in this case, a reactive statement like $: console.log('todos', todos) won't be very useful. to find out why t...
... be updated with the tick() function now we will take care of the todo component's focus management details. first of all, we want a todo component's edit <input> to receive focus when we enter editing mode by pressing its edit button. in the same fashion as we saw earlier, we'll create a nameel variable inside todo.svelte and call nameel.focus() after setting the editing variable to true. ...
... multiple todosstatus instances active, so you need a way to reference each particular instance. that's why you have to specify a variable to bind each specific instance to. the code so far git to see the state of the code as it should be at the end of this article, access your copy of our repo like this: cd mdn-svelte-tutorial/06-stores or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/06-stores remember to run npm install && npm run dev to start your app in development mode. repl to see the current state of the code in a repl, visit: https://svelte.dev/repl/d1fa84a5a4494366b179c87395940039?version=3.23.2 summary in this article we have finished adding all the required functionality to our app, plus we've taken care of a number of accessibility and ...
Dynamic behavior in Svelte: working with variables and props - Learn web development
installed to compile and build your app. objective: learn and put into practice some basic svelte concepts, like creating components, passing data using props, render javascript expressions into our markup, modify the components state and iterating over lists. code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app state, run cd mdn-svelte-tutorial/03-adding-dynamic-behavior or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/03-adding-dynamic-behavior remember to run npm install && npm run dev to start your app in development mode. repl to code along with us using the repl, start at https://svelte.dev/repl/c862d9...
... is to add a reactive statement to log the contents of newtodoname. add this snippet at the end of the <script> section: $: console.log('newtodoname: ', newtodoname) note: as you may have noticed, reactive statements aren't limited to variable declarations. you can put any javascript expression after the $: sign. now try going back to localhost:5000, pressing ctrl + shift + k to open your browser console and typing something into the input field. you should see your entries logged. at this point, you can delete the reactive console.log() if you wish. next up we'll create a function to add the new todo — addtodo() — which will push a new todo object onto the todos array. add this to the bottom of your <script> block inside src/components/todo.svelte: function addt...
...r <script> block inside src/components/todo.svelte: function addtodo() { todos.push({ id: 999, name: newtodoname, completed: false }) newtodoname = '' } note: for the moment we are just assigning the same id to every todo, but don't worry, we will fix that soon. now we want to update our html so that we call addtodo() whenever the form is submitted. update the newtodo form's opening tag like so: <form on:submit|preventdefault={addtodo}> the on:eventname directive supports adding modifiers to the dom event with the | character. in this case, the preventdefault modifier tells svelte to generate the code to call event.preventdefault() before running the handler. explore the previous link to see what other modifiers are available. if you try adding new todos at th...
... and not rely on the visibility of top-level variables. besides, it's a good practice to make our code clear and explicit about what information it is using. the code so far git to see the state of the code as it should be at the end of this article, access your copy of our repo like this: cd mdn-svelte-tutorial/04-componentizing-our-app or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/04-componentizing-our-app remember to run npm install && npm run dev to start your app in development mode. repl to see the current state of the code in a repl, visit: https://svelte.dev/repl/99b9eb228b404a2f8c8959b22c0a40d3?version=3.23.2 summary that will do for now! in this article we already implemented most of our desired functionality. our app can display, add, ...
Getting started with Vue - Learn web development
rkup. like most frameworks, vue lets you create reusable blocks of markup via components. most of the time, vue components are written using a special html template syntax. when you need more control than the html syntax allows, you can write jsx or plain javascript functions to define your components. as you work through this tutorial, you might want to keep the vue guide and api documentation open in other tabs, so you can refer to them if you want more information on any sub topic. for a good (but potentially biased) comparison between vue and many of the other frameworks, see vue docs: comparison with other frameworks. installation to use vue in an existing site, you can drop one of the following <script> elements onto a page. this allows you to start using vue on existing sites, whic...
...e the npm package & the cli you will need: node.js 8.11+ installed. npm or yarn. note: if you don't have the above installed, find out more about installing npm and node.js here. to install the cli, run the following command in your terminal: npm install --global @vue/cli or if you'd prefer to use yarn: yarn global add @vue/cli once installed, to initialize a new project you can then open a terminal in the directory you want to create the project in, and run vue create <project-name>. the cli will then give you a list of project configurations you can use. there are a few preset ones, and you can make your own. these options let you configure things like typescript, linting, vue-router, testing, and more. we’ll look at using this below. initializing a new project to explore v...
...oling in your project. this allows you to use tools like babel, typescript, scss and more to create more sophisticated components. as a bonus, projects created with the vue cli are configured to use .vue files with webpack out of the box. in fact, if you look inside the src folder in the project we created with the cli, you'll see your first .vue file: app.vue. let's explore this now. app.vue open your app.vue file — you’ll see that it has three parts: <template>, <script>, and <style>, which contain the component’s template, scripting, and styling information. all single file components share this same basic structure. <template> contains all the markup structure and display logic of your component. your template can contain any valid html, as well as some vue-specific syntax that ...
...as stated above, but may vary based on your setup), you should see your app. right now, it should contain a welcome message, a link to the vue documentation, links to the plugins you added when you initialized the app with your cli, and some other useful links to the vue community and ecosystem. making a couple of changes let's make our first change to the app — we’ll delete the vue logo. open the app.vue file, and delete the <img> element from the template section: <img alt="vue logo" src="./assets/logo.png"> if your server is still running, you should see the logo removed from the rendered site almost instantly. let’s also remove the helloworld component from our template. first of all delete this line: <helloworld msg="welcome to your vue.js app"/> if you save your app.vue fi...
Handling common HTML and CSS problems - Learn web development
just use the code as normal, but older ie versions will be able to style these elements too. note: see ie conditional comments for the best way to do this. more complex elements like html <video>, <audio>, and <canvas> (and other features besides) have natural mechanisms for fallbacks to be added, which work on the same principle as described above. you can add fallback content in between the opening and closing tags, and non-supporting browsers will effectively ignore the outer element and run the nested content. for example: <video id="video" controls preload="metadata" poster="img/poster.jpg"> <source src="video/tears-of-steel-battle-clip-medium.mp4" type="video/mp4"> <source src="video/tears-of-steel-battle-clip-medium.webm" type="video/webm"> <!-- offer download --> <p>your ...
...of selectivizr-example-start.html. if you look at this running live, you'll see that it contains two paragraphs, one of which is styled. we've selected the paragraph with p:first-child, which won't work in old versions of ie. now download mootools and selectivizr, and save them in the same directory as your sample html. put the following code into the head of your html document, just before the opening <style> tag: <script type="text/javascript" src="mootools-core-1.6.0.js"></script> <!--[if (gte ie 6)&(lte ie 8)]> <script type="text/javascript" src="selectivizr-min.js"></script> <![endif]--> if you try running this in an old version of ie, it should work fine. handling css prefixes another set of problems comes with css prefixes — these are a mechanism originally u...
...declined recently precisely because of these types of problems, but there are still some that need attention. if you insist on using prefixed features, make sure you use the right ones. you can look up what browsers require prefixes on mdn reference pages, and sites like caniuse.com. if you are unsure, you can also find out by doing some testing directly in browsers. try this simple example: open up google.com, or another site that has a prominent heading or other block-level element. right/cmd + click on the element in question and choose inspect/inspect element (or whatever the option is in your browser) — this should open up the dev tools in your browser, with the element highlighted in the dom inspector. look for a feature you can use to select that element. for example, at the ti...
...a text editor such as atom or sublime text. for example, in atom: you can install it by going to preferences > install, searching for autoprefixer, then hitting install. you can set a browser query by pressing the autoprefixer settings button and entering the query in the text field in the settings section on the page. in your code, you can select sections of css you want to add prefixes to, open the command pallette (cmd/ctrl + shift + p), then type in autoprefixer and select the autoprefixer result that autocompletes. as an example, we entered the following code: body { display: flex; } we highlighted it and ran the autoprefixer command, and it replaced it with this: body { display: -webkit-box; display: -ms-flexbox; display: flex; } layout issues another problem that mig...
Strategies for carrying out testing - Learn web development
on you already having a site to use it on, so it isn't much good for completely new sites. but an analytics history can be useful for finding support stats to influence say a new version of a company's site, or new features you are adding to an existing site. if you have these available, they are far more accurate than global browser stats like those mentioned above. you may also consider using open source and privacy focussed analytics platforms like open web analytics and matomo. they expect you to self-host the analytics platform. setting up google analytics first of all, you'll need a google account. use this account to sign into google analytics. choose the google analytics (web) option, and click the sign up button. enter your web site/app details into the signup page. this is f...
...developers to hunt down bugs on very specific browser/device combinations. smaller companies and individuals are generally not able to afford such a sophisticated lab, so tend to make do with smaller labs, emulators, virtual machines, and commercial testing apps. we will cover each of the other options below. note: some efforts have been made to create publically accessible device labs — see open device labs. note: we also need to consider accessibility — there are a number of useful tools you can install on your machine to facilitate accessibility testing, but we'll cover those in the handling common accessibility problems article, later in the course. emulators emulators are basically programs that run inside your computer and emulate a device or particular device conditions of ...
...ed hard drive that grows and shrinks as the need arises. to use a virtual box, you need to: get hold of an installer disk or image (e.g. iso file) for the operating system you want to emulate. virtual box is unable to provide these; most, like windows oses, are commercial products that can't be freely distributed. download the appropriate installer for your operating system and install it. open the app; you'll be presented with a view like the following: to create a new virtual machine, press the new button in the top left hand corner. follow the instructions and fill in the following dialog boxes as appropriate. you'll: provide a name for the new virtual machine choose which operating system and version you are installing on it set how much ram should be allocated (we'd ...
...w, vdi (virtual disk image), and dynamically allocated). choose the file location and size for the virtual hard disk (choose a sensible name and location to keep it, and for the size specify around 50gb, or as much as you are comfortable with specifying). now the new virtual box should appear in the left hand menu of the main virtual box ui window. at this point, you can double-click to open it — it will start to boot up the virtual machine, but it won't yet have the operating system (os) installed. at this point you need to point the dialog box at the installer image/disk, and it will run through the steps to install the os just like on a physical machine. important: you need to make sure you have the operating system image you want to install on the virtual machine available ...
Setting up your own test automation environment - Learn web development
m testing environment locally and run tests with it, and how to integrate it with tools like lambdatest, sauce labs, and browserstack. selenium selenium is the most popular browser automation tool. there are other ways, but the best way to use selenium is via webdriver, a powerful api that builds on top of selenium and makes calls to a browser to automate it, carrying out actions such as "open this web page", "move over this element on the page", "click this link", "see whether the link opens this url", etc. this is ideal for running automated tests. how you install and use webdriver depends on what programming environment you want to use to write and run your tests. most popular environments have available a package or framework that will install webdriver and the bindings required t...
... example, if we were using a mac os x machine, our user name was bob, and we put our drivers in the root of our home folder, the path would be /users/bob. note: just to reiterate, the path you add to path needs to be the path to the directory containing the drivers, not the paths to the drivers themselves! this is a common mistake. to set your path variable on mac os x/most linux systems: open your .bash_profile (or .bashrc) file (if you can't see hidden files, you'll need to display them, see show/hide hidden files in mac os x or show hidden folders in ubuntu). paste the following into the bottom of your file (updating the path as it actually is on your machine): #add webdriver browser drivers to path export path=$path:/users/bob save and close this file, then restart your term...
...webdriver will then wait for 2 seconds; the document title is then accessed, and if it is "webdriver - google search", we will return a message to claim the test is passed. webdriver will then close down the firefox instance and stop. testing in multiple bro...
...console if it is not empty. note: there is also a method called wait(), which repeatedly tests a condition for a certain length of time, and then carries on executing the code. this also makes use of the util library, which defines common conditions to use along with wait(). shutting down drivers after use after you've finished running a test, you should shut down any driver instances you've opened, to make sure that you don't end up with loads of rogue browser instances open on your machine! this is done using the quit() method. simply call this on your driver instance when you are finished with it. add this line to the bottom of your quick_test.js test now: driver.quit(); when you run it, you should now see the test execute and the browser instance shut down again after the test is co...
Command line crash course - Learn web development
re html, css, and javascript languages. objective: to understand what the terminal/command line is, what basic commands you should learn, and how to install new command line tools. welcome to the terminal the terminal is a text interface for executing text-based programs. if you're running any tooling for web development there's a near-guaranteed chance that you'll have to pop open the command line and run some commands to use your chosen tools (you'll often see such tools referred to as cli tools — command line interface tools). a large number of tools can be used by typing commands into the command line; many come pre-installed on your system, and a huge number of others are installable from package registries. package registries are like app stores, but (mostly) for c...
...s, cat manipulate and transform streams of text (for example changing all the instances of <div>s in an html file to <article>): awk, tr, sed note: there are a number of good tutorials on the web that go much deeper into the command line on the web — this is only a brief introduction! let's move forward and look at using a few of these tools on the command line. before you go any further, open your terminal program! navigation on the command line when you visit the command line you will inevitably need to navigate to a particular directory to "do something". all the operating systems (assuming a default setup) will launch their terminal program in your "home" directory, and from there you’re likely to want to move to a different place. the cd command lets you change directory. tec...
......
...ormat their code in best-practice fashion. be installed on any operating system and even as a direct part of project tooling, ensuring that colleagues and friends who work on your code use the code style you’re using. be configured to run upon save, as you type, or even before publishing your code (with additional tooling that we’ll see later on in the module). once you've installed node, open up the terminal and run the following command to install prettier: npm install --global prettier once the command has finished running, the prettier tool is now available in your terminal, at any location in your file system. running the command without any arguments, as with many other commands, will offer up usage and help information. try this now: prettier your output should look somethi...
Accessibility Features in Firefox
user can switch between them by choosing from a drop down available via the standard alt+down arrow key combination. the built-in text zoom feature can be accessed with the ctrl+plus and ctrl+minus hotkeys. the accessibility extension may be installed on top of firefox, allowing keyboard access to document structure. the find bar allows for quick navigation to links and text searching without opening a separate dialog -- this allows more convenient use by screen magnification users because there is a single point of regard for the search. it also assists users of input aids because there are far fewer keys to type to get the desired location. for example, it is possible to navigate to the desired link by pressing 2 letter keys rather than tabbing through many links to get there. caret brow...
...ix annoying accessibility issues in popular web pages, and (hopefully) share their tricks with everyone! fire vox extension by charles l. chen is a screen reader extension built just for firefox which can read mathml community contributions the real reason behind firefox's success is the great community of volunteers and organizations that realize they have something to benefit from a browser open to utilizing their ideas and hard work. contributions come in many forms. the mozilla firefox community welcomes bug reports, ideas, documentation, answering questions in the support forums -- and nearly any kind of community involvement resulting in a browser built for a broader audience of users and developers. here are a couple of success stories from businesses who contributed accessibility ...
...sses who contributed accessibility code because they needed an accessible web browser which supported their software: contributes accessible web applications (dhtml and ajax) ibm realized it needed a way to enable accessibility for ever more powerful web applications, beyond what you see on typical web pages today. rather than go and write their own new web browser, ibm decided to trust in the openness of the mozilla community, which accepted ibm's significant contributions. for example, ibm has delivered over 50,000 lines of code to enable accessibility in firefox on windows and especially for this new powerful world of "web applications". a web application may be an easier-to-use online tax assistant, a web calendar or a live sports statistics page, which is familiar in that it acts much ...
...s we already have excellent support for the gnome onscreen keyboard (gok). meanwhile, ibm has joined sun's effort to make firefox as screen reader accessible on unix as it is on windows, because the same core accessibility work applies to linux. the two companies anticipate that in 2007, firefox will support topnotch screen reader accessibility on unix and linux. that's the great thing about the open firefox community model and source code license -- anyone can contribute, and everyone benefits. downloads, support and more information firefox information and downloads general online support and community forums accessibility newsgroup for users. can also be accessed as a mailing list. accessibility compliance statement (section 508): http://www.mozilla.com/firefox/vpat.html ...
Links and Resources
guidelines & standards information and resources on section 508 - legal policy for us government purchases requiring software accessibility. wai - web accessibility initiative web content accessibility guidelines (wcag) 1.0 the first set of official guidelines from the w3c web accessibility initiative (wai). the european union is looking to base their upcoming accessibility regulations on these guidelines. wai interest group - discussion list for standards in web accessibility. web accessibility checklist from ibm. ...
...iversity institute on disabilities wave 3.0 is another powerful, mature, free online webpage accessibility validation service that identifies accessibility errors and reports accessibility warnings about webpage related to section 508 standards and/or the wcag guidelines. html advanced validator (firefox extension) by marc gueury this advanced html validator (based on w3c tidy and on opensp for sgml validation - just like w3c html validator) is a free, powerful, versatile, extended html validator. it can work offline. it can also report accessibility errors and warnings according to selectable accessibility guidelines (section 508, wcag priorities 1, 2 or 3). its accessibility report is viewable in the view source window. this html advanced validator may also be downloaded fro...
...html validator) is a free, powerful, versatile, extended html validator. it can work offline. it can also report accessibility errors and warnings according to selectable accessibility guidelines (section 508, wcag priorities 1, 2 or 3). its accessibility report is viewable in the view source window. this html advanced validator may also be downloaded from firefox add-ons: html validator. ...
...r. it can work offline. it can also report accessibility errors and warnings according to selectable accessibility guidelines (section 508, wcag priorities 1, 2 or 3). its accessibility report is viewable in the view source window. this html advanced validator may also be downloaded from firefox add-ons: html validator. open source assistive technology projects nonvisual desktop access open source screen reader for windows, written in python. lsr open source screen reader for linux, written in python orca open source screen reader for linux, written in python accessibility for desktop environments gnome accessibility - gnome accessibility project kde accessibility project - an equally important toolkit on linux apple accessibility - moving forward with os x. other resou...
Software accessibility: Where are we today?
ognition software, microsoft active accessibility defines a windows-based standard by which applications can communicate context and other pertanent information to accessibility aids. this solution has seen only partial success, largely due to the fact that it requires significant changes to applications which are made accessible. ...
... applications are not open source, this forced disabled people to rely on the companies which produce this software to make it accessible. these companies were often reluctant for various reasons including the large amount of time required to do so. on a positive note, recent federal purchasing rules such as section 508 have caused many companies to pay attention and implement msaa support. enter open source software microsoft was on the right track with microsoft active accessibility, but because the source code to most popular desktop applications which are used in large corporations is not publicly available, they were never made fully accessible. in open source, however, making the necessary modifications to make them accessible is very possible. ...
...it also gives disabled programmers a chance to control their own destiny, by giving them the opportunity and the right to directly fix the innaccessible software themselves. ...
... that said, there is still an important role for adaptive technology vendors in creating special services and hardware, or even proprietary software on platforms where that is appropriate. . the ideal situation would be for adaptive technology professionals to make money on rehab, trainingand support - something there is currently not enough of. each end user has a unique set problems, and in the open source world, providing highly customized solutions can be a business in itself. right now, gui's on linux are mostly not accessible. microsoft windows is still far more accesible. gnome, kde, staroffice, koffice, mozilla and all other gui software packages in linux are unuseable by large numbers of disabled users. there has been some progress with the support of gnome's atk apis in many of these...
What to do and what not to do in Bugzilla
ou are presented with first (either the guided or advanced forms). confirming unconfirmed bugs a useful general guide for confirming unconfirmed bugs. a guide for confirming layout bugs (bugs in web page rendering) reporting new bugs you should report a bug in the new state after going through the triaging process as described in the two above-mentioned guides. you should look at all the open bugs you've reported (see the "my bugs" link at the bottom of every bugzilla page) at least every two months and test whether they still exist. editbugs privilege the more powerful editbugs privilege gives you the privileges of canconfirm and also the ability to edit most aspects of a bug. therefore, don't abuse your privileges. resolving bugs some general rules: when you resolve a bug, cc...
...d by some people but can't be reproduced by other people. in general you can resolve a bug as wfm if: three or more people with a similar/the same setup can't reproduce the bug and the bug is only seen by the bug reporter. in this case you shouldn't just mark it wfm instantly, but ask the reporter for more details first. when marking it wfm you should tell the bug reporter that they should reopen the bug if they can still see it with a recent build. the build the bug is reported against is more than one stable release old and the bug can't be reproduced with a current build. the bug reporter has not responded to questions for one month and the bug can't be reproduced with a current build. the bug reporter reports that they can no longer see the bug and no other people report that they ...
...build. the bug reporter reports that they can no longer see the bug and no other people report that they are still seeing the bug. resolving bugs as incomplete the problem is vaguely described with no steps to reproduce, or is a support request. the reporter should be directed to the product's support page for help diagnosing the issue. if there are only a few comments in the bug, it may be reopened only if the original reporter provides more info, or confirms someone else's steps to reproduce. if the bug is long, when enough info is provided a new bug should be filed and the original bug marked as a duplicate of it. resolving bugs as invalid you should resolve a bug as invalid if the issue described in the bug is clearly not a mozilla bug or if the issue is intended behavior. the except...
...event accidental filing of duplicates of a bug that's already been fixed. changing the bug information fields summary you should change the summary if the current one is unclear or does not correctly describe the issue covered by the bug. you should not change the summary in order to morph the bug to describe a different issue. in this case the bug should be resolved and another bug should be opened. os/hardware make sure that the os or hardware fields correctly display the systems that are affected. if a bug is windows-only, change the field to the oldest affected operating system. if the bug is present on linux and windows, change the fields to hardware = pc and os = all. if another hardware platform like mac or dec is also affected, change hardware to all. severity this field descri...
Creating reftest-based unit tests
running ipc reftests reftests can also be run in a separate process, which can differ from same-process rendering in significant ways. currently, ipc reftests are only being run on linux. to run: moz_layers_force_shmem_surfaces=1 make -c $(objdir) reftest-ipc note: rig...
... pass the path as an argument: ./mach reftest path/from/sourcedir/reftest.list and to run a single reftest just pass the path to the test file (not the reference file): ./mach reftest path/from/sourcedir/reftest-name.html there is no reftest equivalent to mach mochitest --keep-open, but temporarily adding the reftest-wait class to a test (or disabling the script that removes it) will keep it open longer. running ipc reftests reftests can also be run in a separate process, which can differ from same-process rendering in significant ways. currently, ipc reftests are only being run on linux. to run: moz_layers_force_shmem_surfaces=1 make -c $(objdir) reftest-ipc note: right now, automation currently only runs layout/reftests/reftest-sanity/reftest.list! if you try to run the full suite,...
...rst reftest it is a silly example, but this will step you through creating your first reftest. step 1 for now you must check out and build the browser in order to run the tests. see the build documentation for details on doing that. sorry about this, but the released builds and the nightly builds are built with the "--disable-tests" option and reftest will not work - see bug 369809. step 2 open a terminal window. create a directory (inside firefox's source code tree) and make that your current directory (i.e. move to that directory). step 3 create a file named foo.html with the following: <html><head><title>reftest0001</title> <body><strong>hello!</strong></body> </html> step 4 create a file named bar.html with the following: <html><head><title>reftest0001</title> <body><b>he...
...uld be displayed and then the reference page would include that graphic in an <img> element. more investigation into whether this will work is definitely warranted. experiments with this have shown it to be not as easy as one would hope. we'll see. here is a list of reftest opportunities files in the source. these are files that have been checked in to be tested. presumably, one was supposed to open the pages with a browser and look at them and see if they look right. it is hard to tell how many of these will be usable as reftests. if the file is associated with a bug, the bug should be examined. i have seen a case where the html file in the bug had a problem, but the checked-in version was "cleaned up" and not valid for testing. mozilla has used html generation tools in the past. the html...
Creating Sandboxed HTTP Connections
onstartrequest - gets called when a new request is initiated. ondataavailable - new data is av...
...wuri(myurlstring, null, null); once the nsiuri has been created, a nsichannel can be generated from it using nsiioservice's newchannelfromuri method: // get a channel for that nsiuri var channel = ioservice.newchannelfromuri(uri); to initiate the connection, the asyncopen method is called. it takes two arguments: a listener and a context that is passed to the listener's methods. channel.asyncopen(listener, null); http notifications the above mentioned listener is a nsistreamlistener, which gets notified about events such as http redirects and data availability. onstartrequest - gets called when a new request is initiated. ondataavailable - new data is available. since this is a stream, it could be called multiple times (depending on the size of the returned data, networking condi...
...classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); // create an nsiuri var uri = ioservice.newuri(myurlstring, null, null); // get a channel for that nsiuri gchannel = ioservice.newchannelfromuri(uri); // get an listener var listener = new streamlistener(callbackfunc); gchannel.notificationcallbacks = listener; gchannel.asyncopen(listener, null); function streamlistener(acallbackfunc) { this.mcallbackfunc = acallbackfunc; } streamlistener.prototype = { mdata: "", // nsistreamlistener onstartrequest: function (arequest, acontext) { this.mdata = ""; }, ondataavailable: function (arequest, acontext, astream, asourceoffset, alength) { var scriptableinputstream = components.classes["@mozilla.org/s...
...w value is appened, otherwise the old value is overwritten. these methods provide all the required functionality needed to modify cookies before they are processed/sent, allowing for sandboxed cookie connections that don't affect the user's cookies. http referrer if the http request needs to have a referrer set, two additional steps are needed after the nsichannel is created, but before it is opened. first, a nsiuri needs to be generated for the referrer url. like before, the nsiioservice is used: var referreruri = ioservice.newuri(referrerurl, null, null); next, the nsichannel is qied to nsihttpchannel and the referrer property is set to the generated nsiuri: var httpchannel = channel.queryinterface(components.interfaces.nsihttpchannel); httpchannel.referrer = referreruri; creating ...
Debugging a hang on OS X (Archived)
out older versions of os x. see how to report a hung firefox instead. if you find a hang in an application, it is very useful for the developer to know where in the code this hang happens, especially if he or she can't reproduce it. below are steps you can use to attach so-called "samples" to bug reports. creating the sample on mac os x 10.5 (xcode < 4.2) when the application is still hung, open up spin control.app (it’s in your <tt>/developer/applications/performance tools/</tt> folder; if it is missing, install the latest computer hardware understanding development (chud) tools from apple). by default, sampling of any hanging application will begin automatically. after about 3-4 seconds, select the hanging application in the “detected hangs” window and click the “interrupt sa...
...y default, sampling of any hanging application will begin automatically. after about 3-4 seconds, select the hanging application in the “detected hangs” window and click the “interrupt sampling” button. ...
... choose file > attach... select "firefox-bin" or the hung application you want a sample from. ...
...ion. if you need to upload the sample to bugzilla, select all the sample text, copy it into your favorite text editor, and save as a plain-text file. for a more detailed view of the sample data, make sure the sample you just recorded is selected in the “detected hangs” window and click on the “open…” button. creating the sample on mac os x 10.4 when the application is still hung, open up sampler.app (it’s in your <tt>/developer/applications/performance tools/</tt> folder; if it is missing, install the latest computer hardware understanding development (chud) tools from apple.). choose file > attach... select "firefox-bin" or the hung application you want a sample from. now, click "start recording". note that only 3-4 seconds usually suffice, note that this will quickly ho...
HTTP logging
this is the best and easiest way to do http logging. at any point during while your browser is running, you can turn logging on and off. this allows you to capture only the "interesting" part of the browser's behavior (i.e. your bug), which makes the http log much smaller and easier to analyze. launch the browser and get it into whatever state you need to be in just before your bug occurs. open a new tab and type in "about:networking" into the url bar. go to the "logging section" adjust the location of the log file if you don't like the default adjust the list of modules that you want to log: this list has the exact same format as the moz_log environment variable (see below). generally the default list is ok, unless a mozilla developer has told you to modify it. click on start logg...
...at case you can set environment variables *before* you launch firefox. note that this approach winds up logging the whole browser history, so files can get rather large (they compress well :) setting environment variables differs by operating system. don't let the scary-looking command line stuff frighten you off; it's not hard at all! windows if firefox is already running, exit out of it. open a command prompt. on windows xp, you can find the "run..." command in the start menu's "all programs" submenu. on all newer versions of windows, you can hold down the windows key and press "r". type cmd and press enter, a new command prompt window with a black background will appear. copy and paste the following lines one at a time into the command prompt window. press the enter key after each ...
...eproduce whatever problem it is that you're having. once you've reproduced the problem, exit firefox and look for the generated log files in your temporary directory. you can type "%temp%" directly into the windows explorer location bar to get there quickly. linux this section offers information on how to capture http logs for firefox running on linux. quit out of firefox if it's running. open a new shell. the commands listed here assume a bash-compatible shell. copy and paste the following commands into the shell one at a time. make sure to hit enter after each line. export moz_log=timestamp,rotate:200,nshttp:5,cache2:5,nssockettransport:5,nshostresolver:5,cookie:5 export moz_log_file=/tmp/log.txt cd /path/to/firefox ./firefox reproduce the problem you're debugging. when the p...
... x application to view the log, you won't have any problems. start logging using command line arguments since firefox 61 it's possible to start logging in a bit simpler way than setting environment variables: using command line arguments. here is an example for the windows platform, on other platforms we accept the same form of the arguments: if firefox is already running, exit out of it. open a command prompt. on windows xp, you can find the "run..." command in the start menu's "all programs" submenu. on all newer versions of windows, you can hold down the windows key and press "r". copy and paste the following line into the "run" command window and then press enter: for 32-bit windows: "c:\program files (x86)\mozilla firefox\firefox.exe" -moz_log=timestamp,rotate:200,nshttp:5,ca...
Simple SeaMonkey build
urial source repository and enough free disk space to compile. a fast ssd is recommended; the firefox build process is i/o-intensive. high speed internet installing build tools if your system is not listed below, see the build prerequisites page. ...
...ibgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libpulse-dev ubuntu linux # for ubuntu 12.04 lts (precise pangolin), replace the following line with: sudo apt-get build-dep thunderbird sudo apt-get build-dep seamonkey sudo apt-get install zip unzip mercurial g++ make autoconf2.13 yasm libgtk2.0-dev libglib2.0-dev libdbus-1-dev libdbus-glib-1-dev libasound2-dev libcurl4-openssl-dev libnotify-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libiw-dev libxt-dev mesa-common-dev libpulse-dev fedora linux centos rhel: sudo yum groupinstall 'development tools' 'development libraries' 'gnome software development' sudo yum install mercurial autoconf213 glibc-static libstdc++-static yasm wireless-tools-devel mesa-libgl-devel alsa-lib-devel...
...s-tools-devel mesa-libgl-devel alsa-lib-devel libxt-devel gstreamer-devel gstreamer-plugins-base-devel pulseaudio-libs-devel # 'development tools' is defunct in fedora 19 and above use the following sudo yum groupinstall 'c development tools and libraries' sudo yum group mark install "x software development" mac: install xcode tools. insert "mac os x install disc 2", then open xcodetools.mpkg. (for some mac os x versions, you will find it in a directory called "optional installs".) install macports. run these commands to install the other build tools: sudo port sync sudo port install mercurial libidl autoconf213 yasm problems? see mac os x build prerequisites. windows: install visual c++ 2013. both the professional edi...
...ns for a quick guide. if you decided on the windows 8 sdk, you also need the outlook 2010 mapi header files from microsoft. install mozillabuild, a package of additional build tools. (if you get a message saying this application did not install properly then you should see a windows dialog giving you the option to re-install with the 'correct settings'. after that all should be well.) open a shell window by running: c:\mozilla-build\start-msvc2013.bat. even if you're on 64-bit windows, do not use the files ending in -x64.bat. by default you will arrive in your windows user home directory which is likely to contain spaces in its path (e.g. c:\users\myaccount). this can lead to problems later in the building stage. to avoid that, create a directory without spaces in its path (e.g...
Linux compatibility matrix
10.0 3.8 apr 2020 ? ...
...a nov 2010 nov 2020 rhel 7 3.10 2.17 2.42 2.24 3.14 0.32 4.8.5 4.8 3.4 n/a jun 2014 jun 2024 rhel 8 4.18 2.28 2.56 2.24 3.22.30 0.36 8.3.1 8.3.1 8.0 3.6 may 2019 may 2031 opensuse 11.4 2.6.37 2.11 2.28 2.22 3.0 0.20 4.5 4.5 n/a n/a mar 2011 jul 2015 opensuse 12.1 3.1 2.14 2.30 2.24 3.2 0.22 4.6 4.6 2.9 n/a nov 2011 may 2013 opensuse 12.2 3.4 2.15 2.32 2.24 3.4 0.24 4.7 4.7 3.1 n/a jul 2012 jan 2014 opensuse 12.3 3.7 2.17 2.34 2.24 3.6 0.28 4.7 4.7 3.2 n/a mar 2013 sep 2014 opensuse 13.1 3.11 2.18 2.38 ...
... nov 2011 may 2013 opensuse 12.2 3.4 2.15 2.32 2.24 3.4 0.24 4.7 4.7 3.1 n/a jul 2012 jan 2014 opensuse 12.3 3.7 2.17 2.34 2.24 3.6 0.28 4.7 4.7 3.2 n/a mar 2013 sep 2014 opensuse 13.1 3.11 2.18 2.38 2.24 3.10 0.30 4.8.1 4.8 3.3 n/a nov 2013 jan 2016 opensuse 13.2 3.16 2.19 2.42 2.24 3.14 0.32 4.8.3 4.8, 4.9 3.5 n/a nov 2014 jan 2017 opensuse leap 15.0 4.12 2.26 2.54 2.24 3.22 0.34 7.3 7.3 5.0 3.6 may 2018 nov 2019 opensuse leap 15.1 4.12 2.26 2.54 2.24 3.22 0.34 8.2 7.4, 8.2 5.0, 7.0 3.6 may 2019 nov 2020 opensuse...
... opensuse leap 15.0 4.12 2.26 2.54 2.24 3.22 0.34 7.3 7.3 5.0 3.6 may 2018 nov 2019 opensuse leap 15.1 4.12 2.26 2.54 2.24 3.22 0.34 8.2 7.4, 8.2 5.0, 7.0 3.6 may 2019 nov 2020 opensuse leap 42.1 4.1 2.19 2.44 2.24 3.16 0.32 5.2 4.8, 5.2 3.7 3.4 nov 2015 may 2017 opensuse leap 42.2 4.4 2.22 2.48 2.24 3.20 0.34 5.3 4.8, 5.3, 6.1 3.8 3.4 nov 2016 jan 2018 opensuse leap 42.3 4.4 2.22 2.48 2.24 3.20 0.34 7.1 4.8, 5.3, 6.2, 7.1 3.8 3.4 jul 2017 jun 2019 debian 10 4.19 2.28 2.58 2.24 3.24 0.36 8.3 8.3 6.0, 7.0 3.7 jul 2019 jun 2023 / jun 2025...
Browser API
mozbrowserscroll. note that this is obsolete. mozbrowseraudioplaybackchange sent when audio starts or stops playing within the browser <iframe> content. mozbrowsercaretstatechanged sent when the text selected inside the browser <iframe> content changes. mozbrowserclose sent when window.close() is called within a browser <iframe>. mozbrowsercontextmenu sent when a browser <iframe> tries to open a context menu. this allows handling of the <menuitem> element available within the browser <iframe>'s content. mozbrowserdocumentfirstpaint sent when a new paint occurs on any document in the browser <iframe>. mozbrowsererror sent when an error occurs while trying to load content within a browser <iframe>. mozbrowserfindchange sent when a search operation is performed on the browser <ifra...
...e in the browser <iframe>'s content. mozbrowserloadend sent when the browser <iframe> has finished loading all its assets. mozbrowserloadstart sent when the browser <iframe> starts to load a new page. mozbrowserlocationchange sent when a browser <iframe>'s location changes. ...
...owser <iframe> starts to load a new page. mozbrowserlocationchange sent when a browser <iframe>'s location changes. mozbrowsermanifestchange sent when a the path to the app manifest changes, in the case of a browser <iframe> with an open web app embedded in it. mozbrowsermetachange sent when a <meta> elelment is added to, removed from or changed in the browser <iframe>'s content. mozbrowseropenwindow sent when window.open() is called within a browser <iframe>. mozbrowseropentab sent when a new tab is opened within a browser <iframe> as a result of the user issuing a command to open a link target in a new tab (for example ctrl/cmd + click.) mozbrowserresize sent when the browser <iframe>'s window size has changed. mozbrowserscroll sent when the browser <iframe> content scrolls. m...
...changes. note that this is obsolete, and newer implementations use mozbrowsercaretstatechanged instead. mozbrowsershowmodalprompt sent when alert(), confirm(), or prompt() are called within a browser <iframe>. mozbrowsertitlechange sent when the document title changes within a browser <iframe>. mozbrowserusernameandpasswordrequired sent when an http authentification is requested. mozbrowseropensearch sent when a link to a search engine is found. mozbrowservisibilitychange sent when the visibility state of the current browser iframe <iframe> changes, for example due to a call to setvisible(). specifications this api isn't part of any official specification. ...
Hacking with Bonsai
lve these problems. the process everyone who checks into the tree, joins a group called "the hook" at 8:00 am pst every weekday morning, the source tree is closed. the build team will then pull the 8:00 am tree, and build it on a subset of the platforms, linux, win32 & macppc. ...
...he tree, joins a group called "the hook" at 8:00 am pst every weekday morning, the source tree is closed. the build team will then pull the 8:00 am tree, and build it on a subset of the platforms, linux, win32 & macppc. at 10:00 am, everyone who is on the hook is available in case the build breaks eventually, the tree builds, and it is re-opened. ...
...hen pull the 8:00 am tree, and build it on a subset of the platforms, linux, win32 & macppc. at 10:00 am, everyone who is on the hook is available in case the build breaks eventually, the tree builds, and it is re-opened. there is a web page, which records if the tree is open or closed what the date stamp of the last known good tree is who is on the hook for the current tree before the tree is opened, the list of checkins that happened when the tree was closed is reviewed to insure that only build related checkins took place. before the tree is opened, there is a car pool lane where people who have been off on a branch and need a stable tip to merge in can pull the tip for their merge. these people, when they check in, will be "on the hook" for the next day's build. the car pool lane is onl...
...use the bonsai query tool to see what's been checked in to the tree lately and to look at differences between versions. read the introduction to bonsai for more information about queries. ...
IME handling guide
ly, ime may be used for handwriting systems or speech input systems on some platforms. if ime is available on focused elements, we call that state "enabled". if ime is not fully available(i.e., user cannot enable ime), we call this state "disabled". if ime is enabled but users use direct input mode (e.g., for inputting latin characters), we call it "ime is closed". otherwise, we call it "ime is open". (fyi: "open" is also called "active" or "turned on". "closed" is also called "inactive" or "turned off") so, this document is useful when you're try to fix a bug for text input in gecko. composition string and clauses typical japanese ime can input two or more words into a composition string. when a user converts from hiragana characters to chinese characters the composition string, japanese...
...ssword"> (ime-mode: auto;), <input type="text" style="ime-mode: disabled;"> or <textarea style="ime-mode: disabled;">. plugin this is set only when a windowless plugin has focus. be careful, even if a password field has focus, mimestate may be enabled. when you need to check if a password field has focus for security reasons, you should use inputcontext::ispasswordeditor(). the other is ime open state: dont_change_open_state the open state of ime shouldn't be changed. i.e., gecko should keep the last ime open state. open open ime. this is specified only when ime-mode of the new focused element is active. close close ime. this is specified only when ime-mode of the new focused element is inactive. e.g., on linux, applications cannot manage ime open state. on such platforms, this i...
...the reason why nsiwidget::setinputcontext() is called is stored in inputcontextaction::mcause. how does gecko disable ime in imm mode on windows every window on windows is associated an imcontext. ...
...the reason why nsiwidget::setinputcontext() is called is stored in inputcontextaction::mcause. ...
Download
hasprogress read only boolean indicates whether this download's progress property is able to report partial progress while the download proceeds, and whether the value in totalbytes is relevant. this depends on the saver and the download source. launchwhensucceeded boolean if this property is true when the download finishes successfully, the target file will be opened or executed automatically. launcherpath string local file path of the application to be used to launch the target file, or null if the file should be launched with the default application associated with the contenttype property or the extension of the target file. onchange function this can be set to a function that is called after other properties change. ...
...new download from the same source, rather than restarting a failed or canceled one, you should create a separate download object with the same source as the current one. promise start(); parameters none. promise resolves to undefined when the download has finished successfully and you can access the target file. promise can be rejected with downloaderror if the download failed. ...
...d object with the same source as the current one. promise start(); parameters none. promise resolves to undefined when the download has finished successfully and you can access the target file. promise can be rejected with downloaderror if the download failed. launch() opens or executes the target file after download has completed. if the launcherpath property is null, the file will be opened with the default application for the mime type specified in the contenttype property. if the content type is not available, an attempt will be made to obtain it from the extension of the target file. if the launcherpath property is set, the file will be opened with the specified custom application. promise launch(); parameters none. promise resolves to undefined when the instruction to l...
...ystem. note that the os might still take a while until the file is actually launched. showcontainingdirectory() shows the folder containing the target file, or where the target file will be saved. this may be called at any time, even if the download failed or is currently in progress. promise showcontainingdirectory(); parameters none. promise resolves to undefined when the instruction to open the containing folder has been successfully given to the operating system. note that the os might still take a while until the folder is actually opened. cancel() cancels the download. the cancellation request is asynchronous. until the cancellation process finishes, temporary files or part files may still exist even if they are expected to be deleted. in case the download completes successfu...
Bootstrapping a new locale
directories to localize if you're starting from scratch, you should have just downloaded: mozilla-1.9.x/browser/locales/ mozilla-1.9.x/dom/locales/ mozilla-1.9.x/netwerk/locale...
... directories to localize if you're starting from scratch, you should have just downloaded: mozilla-1.9.x/browser/locales/ mozilla-1.9.x/dom/locales/ mozilla-1.9.x/netwerk/locales/ mozilla-1.9.x/other-licenses/branding/firefox/...
...tity> strings like the following: <!entity certerror.pagetitle "untrusted connection"> you should go through each entity, translating the value in the parameters (e.g. untrusted connection in the example above), like so (example for polish): <!entity certerror.pagetitle "niezaufane połączenie"> once you have translated all the <!entity> strings in this file, you should save your work and open the next .dtd or .property file. you will need to go through each and every file to in every directory in ab-cd. recommended order of localization for recommended order of localization, refer to the localization "phase list" which provides a very rough guide on where to start and in what order to proceed through translation. the localization phase lists (firefox 3.5: ff35.phaselist, firefox...
...ication=browser whenever you need a build directory, these are the steps that you need to do to initialize it. if you're downloading a new release of firefox from cvs, you might want to run configure again, too. now we can actually create the language pack, make -c browser/locales langpack-en-x-dude you should find your newly created language pack in dist/install. ls dist/install you can open that file in firefox and check it out. you have to set your selected language still. you can either use the locale switcher extension, or set it in about:config. set the general.useragent.locale to your language code, in this case, en-x-dude, and restart firefox once more. ...
Localizing with Mercurial
rial, we'll walk through the steps to configure it. mercurial on linux you can easily install mercurial from the command line by issuing one of the following commands. choose the appropriate command for your distribution and make sure to run as root. # debian/ubuntu $ apt-get install mercurial # fedora $ yum install mercurial # gentoo $ emerge mercurial # arch linux $ pacman -s mercurial # opensolaris $ pkg install sunwmercurial if you prefer a graphical interface, you can download and install mercurialeclipse here. did it work? open a terminal window and enter hg --version. if you see a message about the version of mercurial (e.g. mercurial distributed scm (version 1.3.1)), you have installed mercurial successfully! more details for more details on installing hg on linux systems,...
...xecutable is in the system's %path% variable (tortoisehg doesn't need this step). use the add_path.exe utility found in c:\mozilla-build\hg to do this. ps c:\users\your_id> cd c:\mozilla-build\hg ps c:\mozilla-build\hg> .\add_path.exe /result . note the dot (".") at the end of the second command, which means the current directory. if the utility modified your %path% successfully, a dialog will open saying, "%path% has been updated correctly." alternatively, you can edit the %path% variable manually. in order to do so, right-click on your computer icon, choose properties > advanced > environmental variables, select path and click edit. if you don't see path among the options, you'll have to click add and edit it within the add dialog. see the screenshot for an example. did it work? go t...
... osx installing hg on mac osx is super easy. you can install mercurial via macports through the terminal, like so: $ sudo port install mercurial you can also install it by downloading the dmg package from the hg download page. it has an install dialog that will walk you through the process. if you prefer a graphical interface, you can download and install mercurialeclipse here. did it work? open a terminal window and type hg --version. if you see a message about the version of mercurial (e.g. mercurial distributed scm (version 1.3.1)), you have installed mercurial successfully! more details for more details on installing hg on mac osx, refer to the instructions on mercurial's download page. configuring mercurial once you've installed mercurial, you'll need to configure it before you ...
...our work for someone else to commit to your remote l10n repo on the mozilla servers. doing this ensures that your dashboards are always accurate, as they look at your remote repo. here's how to create a l10n patch with hg and the mq extension: enable mq by adding hg.ext = to your mercurial config file (~/.hgrc on unix-like systems or mercurial.ini on windows) under the [extensions] section. open your command line tool and navigate to your l10n directory. inside your l10n directory, init your repo with mq by running hg init --mq. to create a new patch, run hg qnew -m "your commit message" patch-name.patch. the commit message should take the form of "bug 123456 - change this thing to work better by doing something; r=reviewers" if you are to fix a bug. make your change. once you finish...
Activity Monitor, Battery Status Menu and top
on mac os 10.9 it is computed via a simpler machine model-independent formula that only factors in cpu usage and wakeup frequency. in both cases "energy impact" often correlates poorly with actual power consumption and should be avoided in favour of direct measurements that have clear physical meanings. ...
...ysical meanings. what does "average energy impact" measure? when the energy tab of activity monitor is first opened, the "average energy impact" column is empty and the title bar says "activity monitor (processing...)". after 5–10 seconds, the "average energy impact" column is populated with values and the title bar changes to "activity monitor (applications in last 8 hours)". if you have top open during those 5–10 seconds you'll see that systemstats is running and using a lot of cpu, and so presumably the measurements are obtained from it. systemstats is a program that runs continuously and periodically measures, among other things, cpu usage and idle wakeups for each running process. tests indicate that it is almost certainly using the same "energy impact" formula to compute the "aver...
...obtained from it. systemstats is a program that runs continuously and periodically measures, among other things, cpu usage and idle wakeups for each running process. tests indicate that it is almost certainly using the same "energy impact" formula to compute the "average energy impact", using measurements from the past 8 hours of wake time (i.e. ...
...p is closed for several hours and then reopened, those hours are not included in the calculation.) battery status menu when you click on the battery icon in the os x menu bar you get a drop-down menu that includes a list of “apps using significant energy”. this is crude but prominent, and therefore worth understanding — even though it's not much use for profiling applications. when you open this menu for the first time in a while it says “collecting power usage information” for a few seconds, and if you have top open during that time you'll see that, once again, systemstats is running and using a lot of cpu. furthermore, if you click on an application name in the menu activity monitor will be opened and that application’s entry will be highlighted. based on these facts it seem...
about:memory
any preparation to be used. how to generate memory reports let's assume that you want to measure firefox's memory usage. perhaps you want to investigate it yourself, or perhaps someone has asked you to use about:memory to generate "memory reports" so they can investigate a problem you are having. follow these steps. at the moment of interest (e.g. once firefox's memory usage has gotten high) open a new tab and type "about:memory" into the address bar and hit "enter". if you are using a communication channel where files can be sent, such as bugzilla or email, click on the "measure and save..." button. this will open a file dialog that lets you save the memory reports to a file of your choosing. (the filename will have a .json.gz suffix.) you can then attach or upload the file appropriatel...
...s fewer measurements than a memory reports file, but is often good enough to diagnose problems. don't click "measure..." repeatedly, because that will cause the memory usage of about:memory itself to rise, due to it discarding and regenerating large numbers of dom nodes. note that in both cases the generated data contains privacy-sensitive details such as the full list of the web pages you have open in other tabs. if you do not wish to share this information, you can select the "anonymize" checkbox before clicking on "measure and save..." or "measure...". this will cause the privacy-sensitive data to be stripped out, but it may also make it harder for others to investigate the memory usage. loading memory reports from file the easiest way to load memory reports from file is to use the "loa...
...ction. within each process's measurements, there are the following subsections. explicit allocations this section contains a single tree, called "explicit", that measures all the memory allocated via explicit calls to heap allocation functions (such as malloc and new) and to non-heap allocations functions (such as mmap and virtualalloc). here is an example for a browser session where tabs were open to cnn.com, techcrunch.com, and arstechnica.com. various sub-trees have been expanded and others collapsed for the sake of presentation. 191.89 mb (100.0%) -- explicit ├───63.15 mb (32.91%) -- window-objects │ ├──24.57 mb (12.80%) -- top(http://edition.cnn.com/, id=8) │ │ ├──20.18 mb (10.52%) -- active │ │ │ ├──10.57 mb (05.51%) -- window(http://edi...
...full details here, but there are various things worth pointing out. this "explicit" value at the root of the tree represents all the memory allocated via explicit calls to allocation functions. the "window-objects" sub-tree represents all javascript window objects, which includes the browser tabs and ui windows. for example, the "top(http://edition.cnn.com/, id=8)" sub-tree represents the tab open to cnn.com, and "top(chrome://browser/content/browser.xul, id=3)" represents the main browser ui window. within each window's measurements are sub-trees for javascript ("js-compartment(...)" and "js-zone(...)"), layout, style-sheets, the dom, and other things. it's clear that the cnn.com tab is using more memory than the techcrunch.com tab, which is using more than the arstechnica.com tab. sub...
Preferences system
nd use the xul preprocessor if necessary to set different window titles as appropriate. you should also be careful to specify the width of the window (in em) as appropriate using the preprocessor for each targeted platform, as well as the height (in em) for platforms where the window size does not change as the selected panel is changed (e.g. windows). ...
...reprocessor if necessary to set different window titles as appropriate. you should also be careful to specify the width of the window (in em) as appropriate using the preprocessor for each targeted platform, as well as the height (in em) for platforms where the window size does not change as the selected panel is changed (e.g. windows). ...
...ms where the window size does not change as the selected panel is changed (e.g. windows). usage in xulrunner applications when calling opendialog() to open a preferences dialog, "toolbar" should be included in the features string. not using "toolbar" will cause the preferences dialog to only display one preference pane. ...
... should be included in the features string. not using "toolbar" will cause the preferences dialog to only display one preference pane. ...
Anonymous Shared Memory
the file-mapped shared memory may be backed by a file. ... surprise! ... on some platforms, no real file backs the shared memory. on platforms where the shared memory is backed by a file, the file's name in the filesystem is visible to other processes for only the duration of the creation of the file, hopefully a very short time. this restricts processes that do not inherit the shared memory from opening the file and reading or writing its contents. further, when all processes using an anonymous shared memory terminate, the backing file is deleted. ... if you are not paranoid, you're not paying attention. the file-mapped shared memory requires a protocol for the parent process and child process to share the memory. nspr provides two protocols. use one or the other; don't mix and match. in th...
...ovides helper functions for extracting data from the prfilemap object. ... see the examples below. both sides should adhere strictly to the protocol for proper operation. the pseudo-code below shows the use of a file-mapped shared memory by a parent and child processes. in the examples, the server creates the file-mapped shared memory, the client attaches to it. first protocol server: fm = pr_openanonfilemap(dirname, size, filemapprot); addr = pr_memmap(fm); attr = pr_newprocessattr(); pr_processattrsetinheritablefilemap( attr, fm, shmname ); pr_createprocess(client); pr_destroyprocessattr(attr); ... yadda ... pr_memunmap( addr ); pr_closefilemap(fm); client: ... started by server via pr_createprocess() fm = pr_getinheritedfilemap( shmname ); addr = pr_memmap(fm); ... yadda ... pr_memun...
...= pr_newprocessattr(); pr_processattrsetinheritablefilemap( attr, fm, shmname ); pr_createprocess(client); pr_destroyprocessattr(attr); ... yadda ... pr_memunmap( addr ); pr_closefilemap(fm); client: ... started by server via pr_createprocess() fm = pr_getinheritedfilemap( shmname ); addr = pr_memmap(fm); ... yadda ... pr_memunmap(addr); pr_closefilemap(fm); second protocol server: fm = pr_openanonfilemap(dirname, size, filemapprot); fmstring = pr_exportfilemapasstring( fm ); addr = pr_memmap(fm); ... application specific technique to pass fmstring to child ... yadda ... server uses his own magic to create child pr_memunmap( addr ); pr_closefilemap(fm); client: ... started by server via his own magic ... application specific technique to find fmstring from parent fm = pr_importfilema...
...o pass fmstring to child ... yadda ... server uses his own magic to create child pr_memunmap( addr ); pr_closefilemap(fm); client: ... ...
I/O Functions
e null-terminated character strings. only the ascii character set is supported. the forward slash (/) separates the directories in a pathname. nspr converts the slashes in a pathname to the directory separator of the native os--for example, backslash (\) on windows and colon (:) on mac os--before passing it to the native system calls. some file systems also differentiate drives or volumes. ...
...directory separator of the native os--for example, backslash (\) on windows and colon (:) on mac os--before passing it to the native system calls. some file systems also differentiate drives or volumes. pr_open pr_delete pr_getfileinfo pr_getfileinfo64 pr_rename pr_access type praccesshow functions that act on file descriptors pr_close pr_read pr_write pr_writev pr_getopenfileinfo pr_getopenfileinfo64 pr_seek pr_seek64 pr_available pr_available64 pr_sync pr_getdesctype pr_getspecialfd pr_createpipe directory i/o functions pr_opendir pr_readdir pr_closedir pr_mkdir pr_rmdir socket manipulation functions the network programming interface presented here is a socket api modeled after the popular berkeley sockets. differences include the following...
...manipulation functions the network programming interface presented here is a socket api modeled after the popular berkeley sockets. differences include the following: the blocking socket functions in nspr take a timeout parameter. two new functions, pr_transmitfile and pr_acceptread, can exploit the new system calls of some operating systems for higher performance. ...
...rogramming interface presented here is a socket api modeled after the popular berkeley sockets. differences include the following: the blocking socket functions in nspr take a timeout parameter. two new functions, pr_transmitfile and pr_acceptread, can exploit the new system calls of some operating systems for higher performance. ...
Named Shared Memory
processes to access one or more common shared memory regions, using it as an interprocess communication channel. the nspr shared memory api provides a cross-platform named shared-memory interface that is modeled on similar constructs in the unix and windows operating systems. shared memory protocol named shared memory functions shared memory protocol using named shared memory functions pr_opensharedmemory creates the shared memory segment, if it does not already exist, or opens a connection with the existing shared memory segment if it already exists. pr_attachsharedmemory should be called following pr_opensharedmemory to map the memory segment to an address in the application's address space. pr_attachsharedmemory may also be called to remap a shared memory segment after detaching th...
... use of the prsharedmemory object is required within a process. following a call to pr_closesharedmemory, the prsharedmemory object is invalid and cannot be reused. pr_deletesharedmemory should be called before process termination. after you call pr_deletesharedmemory, any further use of the shared memory associated with the name may cause unpredictable results. filenames the name passed to pr_opensharedmemory should be a valid filename for a unix platform. pr_opensharedmemory creates file using the name passed in. some platforms may mangle the name before creating the file and the shared memory. the unix implementation may use sysv ipc shared memory, posix shared memory, or memory mapped files; the filename may be used to define the namespace. on windows, the name is significant, but there...
...shared memory, or memory mapped files; the filename may be used to define the namespace. on windows, the name is significant, but there is no file associated with the name. no assumptions about the persistence of data in the named file should be made. depending on platform, the shared memory may be mapped onto system paging space and be discarded at process termination. all names provided to pr_opensharedmemory should be valid filename syntax or name syntax for shared memory for the target platform. referenced directories should have permissions appropriate for writing. limits on shared memory resources different platforms have limits on both the number and size of shared memory resources. the default system limits on some platforms may be smaller than your requirements. these limits may b...
...ger shared memory segment(s). ...
An overview of NSS Internals
a high-level overview to the internals of network security services (nss) software developed by the mozilla.org projects traditionally used its own implementation of security protocols and cryptographic algorithms, originally called netscape security services, nowadays called network security services (nss). nss is a library written in the c programming language. it's free and open source software, and many other software projects have decided to use it. in order to support multiple operating systems (os), it is based on a cross platform portability layer, called the netscape portable runtime (nspr), which provides cross platform application programming interfaces (apis) for os specific apis like file system access, memory management, network communication, and multithreaded program...
...u can easily look them up and use them again. because of nss's expectation to operate with an nss database, it's mandatory that you perform an initialization call, where you tell nss which database you will be using. in the most simple scenario, the programmer will provide a directory on your filesystem as a parameter to the init function, and nss is designed to do the rest. it will detect and open an existing database, or it can create a new one. alternatively, should you decide that you don't want to work with any persistent recording of certificates, you may initialize nss in a no-database mode. usually, nss will flush all data to disk as soon as new data has been added to permanent storage. storage consists of multiple files: a key database file, which contains your secret keys, and a c...
...e interesting to mention a property of the nspr file descriptors, which are stacked in layers. this means you can define multiple layers that are involved in data processing. a file descriptor has a pointer to the first layer handling the data. that layer has a pointer to a potential second layer, which might have another pointer to a third layer, etc. each layer defines its own functions for the open/close/read/write/poll/select (etc.) functions. when using an ssl network connection, you'll already have two layers, the basic nspr layer and an ssl library layer. the mozilla applications define a third layer where application specific processing is performed. you can find more details in the nspr reference documents. nss occassionally has to create outbound network connections, in addition t...
...the other software is executing. at the time of writing nss and the mozilla applications still use the older database file format by default, where each application has its own nss database. if you require a copy of a certificate stored in an nss database, including its private key, you can use pk12util to export it to the pkcs#12 file format. if you require it in pem format, you could use the openssl pkcs12 command (that's not nss) to convert the pkcs#12 file to pem. this line is a placeholder for how to prepare a database, how to dump a cert, and how to convert data. you might have been motivated to work with nss because it is used by the mozilla applications such as firefox, thunderbird, etc. if you build the mozilla application, it will automatically build the nss library, too. ho...
NSS 3.12.4 release notes
rator is required. more are permitted. expressions inside unions may not include unions or exclusions. inside a union, to be matched and not treated as a special character, these characters must be escaped: \ ( | ) [ ~ except when they occur inside a bracketed expression, where only \ and ] require escaping. new functions in the nss shared library: pk11_isinternalkeyslot (see pk11pub.h) secmod_opennewslot (see pk11pub.h) new error codes (see secerr.h): sec_error_bad_info_access_method sec_error_crl_import_failed new oids (see secoidt.h) sec_oid_x509_any_policy the nssckbi pkcs #11 module's version changed to 1.75. obsolete code for win16 has been removed. support for openvms has been removed. bugs fixed the following bugs have been fixed in nss 3.12.4. bug 321755: implement ...
...library upon error bug 488067: pk11_importcrl reports sec_error_crl_not_found when it fails to import a crl bug 488350: nspr-free freebl interface need to do post tests only in fips mode. bug 488396: dbm needs to be fips certifiable. ...
...g cert with empty subject name bug 488992: fix lib/freebl/win_rand.c warnings bug 489010: stop exporting mktemp and dbopen (again) bug 489287: resolve a few remaining issues with nss's new revocation flags bug 489710: byteswap optimize for msvc++ bug 490154: cryptokey framework requires module to implement generatekey when they support keypairgeneration bug 491044: remove support for vms (a.k.a., openvms) from nss bug 491174: cert_pkixverifycert reports wrong error code when ee cert is expired bug 491919: cert.h doesn't have valid functions prototypes bug 492131: a failure to import a cert from a p12 file leaves error code set to zero bug 492385: crash freeing named crl entry on shutdown bug 493135: bltest crashes if it can't open the input file bug 493364: can't build with --disable-dbm optio...
...ls bug 504405: pkix_pl_crldp_create will fail on alloc success because of a missing ! bug 504408: pkix_pl_crldp_create will always fail if dp->distpointtype != generalname bug 504456: exploitable heap overflow in nss shell expression (filename globbing) parsing bug 505559: need function to identify the one and only default internal private key slot. bug 505561: need a generic function a la secmod_openuserdb() that can be used on non-softoken modules. bug 505858: nss_registershutdown can return without unlocking nssshutdownlist.lock bug 507041: invalid build options for vc6 bug 507228: coreconf.dep doesn't need to contain the nss version number bug 507422: crash [[@ port_freearena - lg_mksecretkeyrep] when port_newarena fails bug 507482: nss 3.12.3 (and later) doesn't build on aix 5.1 bug 50793...
NSS Sample Code Utilities_1
instring++; continue; } outbuf->data[truelen++] = *instring++; } outbuf->data[truelen] = '\0'; truelen = truelen-1; } outbuf->len = truelen; return 0; } /* * filetoitem */ secstatus filetoitem(secitem *dst, prfiledesc *src) { prfileinfo info; print32 numbytes; prstatus prstatus; prstatus = pr_getopenfileinfo(src, &info); if (prstatus != pr_success) { return secfailure; } dst->data = 0; if (secitem_allocitem(null, dst, info.size)) { numbytes = pr_read(src, dst->data, info.size); if (numbytes == info.size) { return secsuccess; } } secitem_freeitem(dst, pr_false); dst->data = null; return secfailure; } /* * echooff ...
... print32 nb; char *pwfile = arg; int i; const long maxpwdfilesize = 4096; char* tokenname = null; int tokenlen = 0; if (!pwfile) return 0; if (retry) { return 0; /* no good retrying - the file contents will be the same */ } phrases = port_zalloc(maxpwdfilesize); if (!phrases) { return 0; /* out of memory */ } fd = pr_open(pwfile, pr_rdonly, 0); if (!fd) { fprintf(stderr, "no password file \"%s\" exists.\n", pwfile); port_free(phrases); return null; } nb = pr_read(fd, phrases, maxpwdfilesize); pr_close(fd); if (nb == 0) { fprintf(stderr,"password file contains no data\n"); port_free(phrases); return null; } if (slot) { tokenname...
... rv = secfailure; fprintf(stderr, "\n"); /* set back termio the way it was */ tio.c_lflag = orig_lflag; tio.c_cc[vmin] = orig_cc_min; tio.c_cc[vtime] = orig_cc_time; tcsetattr(fd, tcsaflush, &tio); return rv; } /* * seedfromnoisefile */ secstatus seedfromnoisefile(const char *noisefilename) { char buf[2048]; prfiledesc *fd; print32 count; fd = pr_open(noisefilename, pr_rdonly, 0); if (!fd) { fprintf(stderr, "failed to open noise file."); return secfailure; } do { count = pr_read(fd,buf,sizeof(buf)); if (count > 0) { pk11_randomupdate(buf,count); } } while (count > 0); pr_close(fd); return secsuccess; } /* * filesize */ long filesize(const char* filename) { str...
... } while (count > 0); pr_close(fd); return secsuccess; } /* * filesize */ long filesize(const char* filename) { struct stat stbuf; stat(filename, &stbuf); return stbuf.st_size; } /* * readderfromfile */ secstatus readderfromfile(secitem *der, const char *infilename, prbool ascii) { secstatus rv = secsuccess; prfiledesc *infile = null; infile = pr_open(infilename, pr_rdonly, 0); if (!infile) { pr_fprintf(pr_stderr, "failed to open file \"%s\" (%ld, %ld).\n", infilename, pr_geterror(), pr_getoserror()); rv = secfailure; goto cleanup; } if (ascii) { /* first convert ascii to binary */ secitem filedata; char *asc, *body; /* read in ascii data */ rv = f...
Utilities for nss samples
instring++; continue; } outbuf->data[truelen++] = *instring++; } outbuf->data[truelen] = '\0'; truelen = truelen-1; } outbuf->len = truelen; return 0; } /* * filetoitem */ secstatus filetoitem(secitem *dst, prfiledesc *src) { prfileinfo info; print32 numbytes; prstatus prstatus; prstatus = pr_getopenfileinfo(src, &info); if (prstatus != pr_success) { return secfailure; } dst->data = 0; if (secitem_allocitem(null, dst, info.size)) { numbytes = pr_read(src, dst->data, info.size); if (numbytes == info.size) { return secsuccess; } } secitem_freeitem(dst, pr_false); dst->data = null; return secfailure; } /* * echooff ...
... print32 nb; char *pwfile = arg; int i; const long maxpwdfilesize = 4096; char* tokenname = null; int tokenlen = 0; if (!pwfile) return 0; if (retry) { return 0; /* no good retrying - the files contents will be the same */ } phrases = port_zalloc(maxpwdfilesize); if (!phrases) { return 0; /* out of memory */ } fd = pr_open(pwfile, pr_rdonly, 0); if (!fd) { fprintf(stderr, "no password file \"%s\" exists.\n", pwfile); port_free(phrases); return null; } nb = pr_read(fd, phrases, maxpwdfilesize); pr_close(fd); if (nb == 0) { fprintf(stderr,"password file contains no data\n"); port_free(phrases); return null; } if (slot) { tokenname...
... rv = secfailure; fprintf(stderr, "\n"); /* set back termio the way it was */ tio.c_lflag = orig_lflag; tio.c_cc[vmin] = orig_cc_min; tio.c_cc[vtime] = orig_cc_time; tcsetattr(fd, tcsaflush, &tio); return rv; } /* * seedfromnoisefile */ secstatus seedfromnoisefile(const char *noisefilename) { char buf[2048]; prfiledesc *fd; print32 count; fd = pr_open(noisefilename, pr_rdonly, 0); if (!fd) { fprintf(stderr, "failed to open noise file."); return secfailure; } do { count = pr_read(fd,buf,sizeof(buf)); if (count > 0) { pk11_randomupdate(buf,count); } } while (count > 0); pr_close(fd); return secsuccess; } /* * filesize */ long filesize(const char* filename) { str...
... } while (count > 0); pr_close(fd); return secsuccess; } /* * filesize */ long filesize(const char* filename) { struct stat stbuf; stat(filename, &stbuf); return stbuf.st_size; } /* * readderfromfile */ secstatus readderfromfile(secitem *der, const char *infilename, prbool ascii) { secstatus rv = secsuccess; prfiledesc *infile = null; infile = pr_open(infilename, pr_rdonly, 0); if (!infile) { pr_fprintf(pr_stderr, "failed to open file \"%s\" (%ld, %ld).\n", infilename, pr_geterror(), pr_getoserror()); rv = secfailure; goto cleanup; } if (ascii) { /* first convert ascii to binary */ secitem filedata; char *asc, *body; /* read in ascii data */ rv = f...
Necko Interfaces Overview
rs for various uri parts (eg. scheme, host, path, ...) per protocol implementation necko provides uri impl's for common uri formats (see nsstandardurl, nssimpleuri) nsichannel : nsirequest represents a logical connection to the resource identified by a nsiuri per protocol implementation single use (ie. channel is used to download the resource once) download initiated via nsichannel::asyncopen method can be canceled via nsirequest::cancel method at anytime after invocation of asyncopen method nsiprotocolhandler a service that manages a protocol, identified by it's uri scheme (eg. http) maps uri string to nsiuri instance via newuri method creates nsichannel instance from nsiuri instance via newchannel method nsistreamlistener : nsirequestobserver implemented by the consumer o...
...od at anytime after invocation of asyncopen method nsiprotocolhandler a service that manages a protocol, identified by it's uri scheme (eg. ...
...d to nsichannel::asyncopen method nsirequestobserver::onstartrequest - notifies start of async download nsistreamlistener::ondataavailable - notifies presence of downloaded data nsirequestobserver::onstoprequest - notifies completion of async download, possibly w/ error nsiloadgroup : nsirequest attribute of a nsirequest channel impl adds itself to its load group during invocation of asyncopen channel impl removes itself from its load group when download completes load groups in gecko own all channels used to load a particular page (until the channels complete) all channels owned by a load group can be canceled at once via the load group's nsirequest::cancel method nsitransport represents a physical connection, such as a file descriptor or a socket used directly by protocol han...
... in gecko own all channels used to load a particular page (until the channels complete) all channels owned by a load group can be canceled at once via the load group's nsirequest::cancel method nsitransport represents a physical connection, such as a file descriptor or a socket used directly by protocol handler implementations (as well as by mailnews and chatzilla) synchronous i/o methods: openinputstream, openoutputstream asynchronous i/o methods: asyncread, asyncwrite nsitransport::asyncread takes a nsistreamlistener parameter original document information author(s): darin fisher last updated date: december 10, 2001 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | ...
Mozilla Projects
irefox, but may be used by other projects as well. here you'll find links to documentation about these projects. compare-locales compare-locales is a python script that helps localizers to check their work without running firefox or another application. crash reporting firefox ships with an open-source crash reporting system. this system is combination of projects: emscripten emscripten is an llvm to javascript compiler. it takes llvm bytecode (e.g. generated from c/c++ using clang, or from another language) and compiles that into javascript, which can be run on the web. firefox sync firefox sync synchronizes state and configuration data used b...
...s for the start and end of every ast node, as well as the set of macro expansions that contain any location. this information allows c++ to be automatically rewritten in a precise way. the inputs driving the rewriting would normally be provided by a program-analysis system outside of pork. (see dehydra, treehydra). ...
... spidermonkey: the mozilla javascript runtime standalone source code releases can be found on the releases page. ...
... mozilla security team and is intended to be used in web oriented security tools. the language is written in json, but we do not expect people to write zest in this format - it is designed to be a visual language. the core language does not define any graphical representation - that is expected to be defined by the tools that integrate zest. it is completely free, open source and can be included in any tool whether open or closed, free or commercial. zest is still at a very early stage of development, but is has been made available so that anyone can play around with it. all constructive feedback is very welcome. anyone can contribute to the onward development of zest, and teams or individuals who develop security to...
Secure Development Guidelines
on initialize the data members of an object in the constructor writing secure code: miscellaneous file i/o a lot can go wrong because a lot can be done with file input and output filenames permissions file handles and descriptors file i/o: filename divided in directories, subdirectories, and the file itself ‘/’ is separator; in windows ‘\’ would work too int openfile(char *file) { handle fh; if (strstr(file, “\”)) return -1; fh = createfilea(file, ...); writefile(fh, data, sizeofdata, null, null); } could be a normal file, directory, device, or link directory traversal (../../../../) file i/o: file permissions should be set correctly be sure not to make world-writable files sensitive files shouldn’t be wo...
... traversal (../../../../) file i/o: file permissions should be set correctly be sure not to make world-writable files sensitive files shouldn’t be world readable file i/o: file descriptors and handles could be a race if instances of fh are shared between threads fh inheritence: default in unix, needs to be set in windows int main(int argc, char **argv, char **envp) { int fd = open("/etc/shadow", o_rdwr); setreuid(getuid(), getuid()); excve("/bin/sh", argv, envp); } suid root applications file i/o: file descriptors and handles potential overflows when using select fd_set struct, static length, holds a bitmask of fds manipulated with fd_set, fd_isset, fd_clr and fd_zero macros fd_set’s size depends on the operating system if the os allows opening mo...
...bitmask of fds manipulated with fd_set, fd_isset, fd_clr and fd_zero macros fd_set’s size depends on the operating system if the os allows opening more fds, then fd_set can hold could overflow fd_set file i/o: file descriptors and handles good solution: dynamically allocate fd_set structs int main(void) { int i, fd; fd_set fdset; for( i = 0; i < 2000; i++) { fd = open("/dev/null", o_rdwr); } fd_set(fd, &fdset); } file i/o: race conditions operating on files can often lead to race conditions since the file system is shared with other processes you check the state of a file at one point in time and immediately after the state might have changed most file name operations suffer from these race conditions, but not when performed on file descriptor...
... on file descriptors file i/o: race conditions consider the following example int main(int argc, char **argv) { char *file = argv[1]; int fd; struct stat statbuf; stat(file, &statbuf); if (s_islink(statbuf.st_mode)) { bailout(“symbolic link”); } else if (statbuf.st_uid != getuid) { bailout(“you don’t own the file”); } fd = open(file, o_rdwr); write(fd, argv[2], strlen(argv[2])); } file i/o: race conditions previous example contains a race condition the file may change between the call top stat() and open() this opens the possibility of writing arbitrary content to any file race conditions occur when two separate execution flows share a resource and its access is not synchronized properly race condition...
XPCOM Stream Guide
Mozilla › Tech › XPCOM › Guide › Streams
rk/safe-file-output-stream;1 nsisafefileoutputstream, nsifileoutputstream stream.init(file, ioflags, perm, behaviorflags); channels have streams too any implementation of nsichannel will have an input stream as well, but unless you own the channel, you shouldn't try to read from the input stream. there are two ways of getting the input stream: by calling the channel's .open() method for a synchronous read, or by calling the channel's .asyncopen() method with an nsistreamlistener object. you can get an nsichannel object from the io service's newchannel(spec, charset, baseuri) method or its .newchannelfromuri(uri) method. the "safe file output stream" mozilla provides a "safe file output stream" implementation. this implementation actually writes the contents of th...
...al. for streams, the most obvious are netutil.jsm and fileutils.jsm. netutil.jsm provides apis for copying an input stream to an output stream (the asynccopy() method), getting an input stream from another source (the asyncfetch() method), and reading an input stream into a string (the readinputstreamtostring() method). fileutils.jsm provides apis for getting output streams for files, with the .openfileoutputstream(file, modeflags) and .opensafefileoutputstream(file, modeflags) methods, and for closing those output streams with the .closesafefileoutputstream(inputstream) method. as we mentioned earlier, you can use the io service to get any channel, and from there an input stream. the io service is available through the services.jsm module as the .io property. stream listeners a stream li...
...ets: reading from a file. for file output, see code snippets: writing to a file. ...
...h/to/zipped/file"); // process the stream // when we don't need the zipreader anymore zipreader.close(); for writing from an input stream to a zip archive, see the nsizipwriter interface: // file is an nsifile object mapping to a zip archive var zipwriter = components.classes["@mozilla.org/zipwriter;1"] .createinstance(components.interfaces.nsizipwriter); zipwriter.open(file, ioflags); // stream is the output stream zipwriter.addentrystream("/path/to/zipped/file", modtime, compression, stream, queueforlater); // if queued for later operations, and all operations are queued zipwriter.processqueue(); // when we don't need the zipwriter anymore zipwriter.close(); concatenating input streams var stringstream = components.constructor("@mozilla.org/io/string-i...
nsIMsgMessageService
es(in nsmsgkeyarrayptr keys, in nsimsgfolder srcfolder, in nsistreamlistener acopylistener, in boolean amovemessage, in nsiurllistener aurllistener, in nsimsgwindow amsgwindow, out nsiuri aurl); void displaymessage(in string amessageuri, in nsisupports adisplayconsumer, in nsimsgwindow amsgwindow, in nsiurllistener aurllistener, in string acharsetoverride, out nsiuri aurl); void openattachment(in string acontenttype, in string afilename, in string aurl, in string amessageuri, in nsisupports adisplayconsumer, in nsimsgwindow amsgwindow, in nsiurllistener aurllistener); void savemessagetodisk(in string amessageuri, in nsifilespec afile, in boolean ageneratedummyenvelope, in nsiurllistener aurllistener, out nsiuri aurl, in boolean canonicallineending, in nsimsgwindow am...
...nsiuri aurl); parameters amessageuri a uri representing the message to display. adisplayconsumer is (for now) an nsidocshell which the message is loaded into. amsgwindow nsimsgwindow for progress and status feedback aurllistener an nsiurllistener acharsetoverride (optional) character set over ride to force the message to use. return values aurl the new nsiuri of the message. ...
...essageuri a uri representing the message to display. adisplayconsumer is (for now) an nsidocshell which the message is loaded into. amsgwindow nsimsgwindow for progress and status feedback aurllistener an nsiurllistener acharsetoverride (optional) character set over ride to force the message to use. return values aurl the new nsiuri of the message. openattachment() downloads and opens an attachment. ...
...g the message to display. adisplayconsumer is (for now) an nsidocshell which the message is loaded into. amsgwindow nsimsgwindow for progress and status feedback aurllistener an nsiurllistener acharsetoverride (optional) character set over ride to force the message to use. return values aurl the new nsiuri of the message. openattachment() downloads and opens an attachment. ...
nsIPrintingPrompt
void showpagesetup( in nsiprintsettings printsettings, in nsiobserver aobs ); parameters printsettings printsettings for page setup. aobs optional an observ...
...iobserver aobs); void showprintdialog(in nsiwebbrowserprint webbrowserprint, in nsiprintsettings printsettings); void showprogress(in nsiwebbrowserprint webbrowserprint, in nsiprintsettings printsettings, in nsiobserver opendialogobserver, in boolean isforprinting, out nsiwebprogresslistener webprogresslistener, out nsiprintprogressparams printprogressparams, out boolean notifyonopen); methods showpagesetup() shows the print progress dialog. void showpagesetup( in nsiprintsettings printsettings, in nsiobserver aobs ); parameters printsettings printsettings for page setup. aobs optional an observer to know if the contents of the print settings object has changed while the dialog is being shown. for example, some platforms may implement an "apply" button. ...
...int dialog. void showprintdialog( in nsiwebbrowserprint webbrowserprint, in nsiprintsettings printsettings ); parameters webbrowserprint represents the document to be printed. printsettings printsettings for print "job". showprogress() shows the print progress dialog. void showprogress( in nsiwebbrowserprint webbrowserprint, in nsiprintsettings printsettings, in nsiobserver opendialogobserver, in boolean isforprinting, out nsiwebprogresslistener webprogresslistener, out nsiprintprogressparams printprogressparams, out boolean notifyonopen ); parameters webbrowserprint represents the document to be printed. printsettings printsettings for print "job" opendialogobserver an observer that will be notifed when the dialog is opened. isforprinting true - for ...
...rprint represents the document to be printed. printsettings printsettings for print "job" opendialogobserver an observer that will be notifed when the dialog is opened. isforprinting true - for printing, false for print preview. webprogresslistener additional listener can be registered for progress notifications. printprogressparams parameter object for passing progress state. notifyonopen this indicates that the observer will be notified when the progress dialog has been opened. if false is returned it means the observer (usually the caller) shouldn't wait for print preview progress there is intermediate progress. ...
nsIScriptableIO
the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes). there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. nsiscriptableio provides a convenient api for creating files and streams, as well as for reading and writing data to them. for your convenience, this api is published through a global io object. for more details about how to use this object, see the file and stream guide. network/base/public/nsiscr...
...ng areplacechar, [optional] in unsigned long abuffersize, [optional] in unsigned long apermissions); nsiuri newuri(in nsivariant auri); methods getfile() retrieves a reference to a file or directory on disk. the file does not have to exist already; this method simply creates the file reference which may then be passed to the newinputstream() or newoutputstream() method to open the file for reading or writing. files are located by starting at a known directory, specified using a location key string. for example, if the location key is specified as "desk" and the file name is specified as "foo.txt", the file reference generated will refer to a file named "foo.txt" on the user's desktop. note: the filename may only be the name of a file. if you need to select a file in a ...
...ng from a transport such as a socket when no data is available will block until data is available before returning. if this mode isn't specified, an exception is thrown if no data is available. deleteonclose: the file is automatically deleted when the stream is closed. this can be useful for temporary files. closeoneof: the file is automatically closed when the end of the file is reached. reopenonrewind: used in conjunction with the seek mode, the file will be reopened when a seek to the beginning of the file is done. multi: the resulting stream is one which is used to concatenate the input from multiple streams as if they were one long, continuous stream. the returned stream implements the nsimultiplexinputstream interface. this mode may not be used in conjunction with the text or buf...
...specifying the abuffersize parameter. if the text mode is specified, a buffer is always used, regardless of whether or not it is specifically requested. append: when writing to files, indicates to append to the file rather than overwrite the existing file. the write position will be set to the end of the file before each write. if used in conjuction with the create mode, an existing file may be opened for appending, or a new file created. block: when this mode is specified, writing to a transport such as a socket doesn't return until all data has been written. this may cause a delay if the socket's underlying buffer is full. if you don't specify this mode, an exception is thrown if the buffer is full. nocreate: if the file doesn't already exist, don't create a new file. notruncate: if ...
nsISessionStore
g aname ); parameters aname the name of the attribute to be saved and restored for all tabs. restorelastsession() restore the previous session if possible. this will not overwrite the current session. instead the previous session will be merged into the current session. current windows will be reused if they were windows that pinned tabs were previously restored into. new windows will be opened as needed. note: this will throw if there is no previous state to restore. check with canrestorelastsession first to avoid thrown errors. void restorelastsession(); parameters none. setbrowserstate() sets the current browsing state. note: calling setbrowserstate immediately replaces the current session, restoring the state of the entire application to the state passed in the astate para...
...fied window. void setwindowvalue( in nsidomwindow awindow, in astring akey, in astring astringvalue ); parameters awindow the browser window for which the value is to be set. akey the key whose value is to be set. astringvalue a string to set as the value for the key akey. to assign more complex data (ie javascript objects) serialize them using json.stringify. undoclosetab() reopens a closed tab in a specified window. nsidomnode undoclosetab( in nsidomwindow awindow, in unsigned long aindex ); parameters awindow the browser window in which to reopen a closed tab. aindex the index number of the closed tab to restore. this should be a value from 0 to one less than the value returned by getclosedtabcount(). the list of closed tabs is stored in last in/first out (l...
...dex the index number of the closed tab to restore. this should be a value from 0 to one less than the value returned by getclosedtabcount(). the list of closed tabs is stored in last in/first out (lifo) order, so the tab at index 0 is the last one that was closed. return value prior to gecko 1.9.1, this method did not return anything. starting with gecko 1.9.1, it returns a reference to the reopened tab as an nsidomnode object. undoclosewindow() reopens a closed window. nsidomwindow undoclosewindow( in unsigned long aindex ); parameters aindex the index of the window to be restored. this should be a value from 0 to one less than that returned by getclosedwindowcount(). the list of closed windows is stored in last in/first out (lifo) order, so the window at index 0 is the last on...
...osed window. nsidomwindow undoclosewindow( in unsigned long aindex ); parameters aindex the index of the window to be restored. this should be a value from 0 to one less than that returned by getclosedwindowcount(). the list of closed windows is stored in last in/first out (lifo) order, so the window at index 0 is the last one that was closed. return value returns a reference to the reopened window as an nsidomwindow object. note on windows the nsisessionstore api stores state information for certain windows inside the web brower. these windows are nsidomwindow objects that contain the tabbrowser that users see as tabs; the document in these windows is browser.xul. for many extensions, those that overlay browser.xul, the appropriate window object for nsisessionstore is the globa...
nsISocketTransport
completion of the connection setup is indicated by a status_connected_to notification to the event sink (if set). ...
...completion of the connection setup is indicated by a status_connected_to notification to the event sink (if set). ...
...ction. read only. securitycallbacks nsiinterfacerequestor security notification callbacks passed to the secure socket provider via nsisslsocketcontrol at socket creation time. this object supports nsibadcertlistener2 and nsisslerrorlistener for ssl connections, and possibly other interfaces. note: this attribute cannot be changed once a stream has been opened. securityinfo nsisupports security info object returned from the secure socket provider. this object supports nsisslsocketcontrol, nsitransportsecurityinfo, and possibly other interfaces. this attribute is only available once the socket is connected. read only. constants timeout type this constants are used by gettransport() and settransport...
... anonymous_connect 1 when this flag is set, the socket will not apply any credentials when establishing a connection. for example, an ssl connection would not send any client-certificates if this flag is set. disable_ipv6 2 when this flag is set, the socket will ignore any ipv6 addresses the host may offer and will only a...
nsIWebSocketChannel
8.0 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) implemented by: ?????????????????????????????????????. ...
...tted status codes. status code name description 0-999 reserved and not used. 1000 close_normal normal closure; the connection successfully completed whatever purpose for which it was created. 1001 close_going_away the endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection. 1002 close_protocol_error the endpoint is terminating the connection due to a protocol error. 1003 close_unsupported the connection is being terminated because the endpoint received data of a type it cannot accept (for example, a text-only endpoint received binary data). 1004 close_too_large the endpoint is terminating the connection ...
... with no close frame being sent) when a status code is expected. 1007-1999 reserved for future use by the websocket standard. 2000-2999 reserved for use by websocket extensions. 3000-3999 available for use by libraries and frameworks. may not be used by applications. 4000-4999 available for use by applications. methods asyncopen() asynchronously opens the websocket connection. received messages are fed to the socket listener as they arrive. the socket listener's methods are called on the thread that calls asyncopen() and are not called until after asyncopen() returns. if asyncopen() returns successfully, the protocol implementation promises to call at least onstart and onstop of the listener. note: implementations should...
...the websocket connection. received messages are fed to the socket listener as they arrive. the socket listener's methods are called on the thread that calls asyncopen() and are not called until after asyncopen() returns. if asyncopen() returns successfully, the protocol implementation promises to call at least onstart and onstop of the listener. note: implementations should throw ns_error_already_opened if the websocket connection is reopened. void asyncopen( in nsiuri auri, in acstring aorigin, in nsiwebsocketlistener alistener, in nsisupports acontext ); parameters auri the uri of the websocket protocol; this may be redirected. aorigin the uri of the originating resource. alistener the nsiwebsocketlistener implementation. acontext an opaque parameter...
Adding items to the Folder Pane
der-tree-items the folder pane stores its current display data in a property called _rowmap. this property is an array of folder-tree-items. each item in this array satisfies the following interface: id (attribute) a unique string for this object. ...
...ay data in a property called _rowmap. this property is an array of folder-tree-items. each item in this array satisfies the following interface: id (attribute) a unique string for this object. must persist over sessions text (attribute) the text to display in the tree level (attribute) the level in the tree to display the item at open (rw, attribute) whether or not this container is open children (attribute) an array of child items also conforming to this spec getproperties (function) a call from getrowproperties or getcellproperties for this item will be passed into this function command (function) this function will be called when the item is double-clicked for our example extension, two different types of folder-tree-items will be defined. first, our "numbers" conta...
...perties for this item will be passed into this function command (function) this function will be called when the item is double-clicked for our example extension, two different types of folder-tree-items will be defined. ...
...ipromptservice) .alert(window, null, this.text); } }; second, our child items (the numbers 1, 2, and 3) are copies of the following prototype: function numberrow(anumber) { this._number = anumber; } numberrow.prototype = { get id() { return "numbers-child-row-" + this._number; }, get text() { return this._number; }, level: 1, open: false, children: [], getproperties: function gne_kid_getprops() {}, // no-op command: function gne_kid_command() { // just going to alert, to do something here components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getservice(components.interfaces.nsipromptservice) .alert(window, null, this.text); } }; putti...
ctypes
the ctypes object contains methods and predefined data types used to create and manage a library. method overview ctype arraytype(type[, length]); cdata cast(data, type); ctype functiontype(abi, returntype[, argtype1, ...]); cdata int64(n); string libraryname(name); library open(libspec); ctype pointertype(typespec); ctype structtype(name[, fields]); cdata uint64(n); properties property type description errno number the value of the latest system error. similar to errno in libc, available on all platforms. cannot be set. winlasterror number|undefined the value of the latest windows error. similar to getlasterror under windows, available only for windows. ca...
... user-defined types. return value a new cdata object representing the same data, but with the specified type. libraryname() returns the correct platform-specific filename for a given library name (e.g. libnss3.dylib for nss3 on os x.) string libraryname( name ); parameters name the name of the library. return value string containing the platform-specific filename of the library. open() opens a library, specified by a pathname. the library is loaded from the specified full path, or, if a partial path is specified, from the appropriate library directory based on the platform on which the application is running. see library search paths for more details. library open( libspec ); parameters libspec the native library to open, specified as a pathname string. return val...
... examples example of structtype() on windows let's say we need tb_button, this type needs to be created. ...
...button.size); // 20 on 32-bit, 32 on 64-bit if i'm not mistaken there is another way to do this, we can use arraytype, but example for this i don't know at this time. ...
Preferences System
nd use the xul preprocessor if necessary to set different window titles as appropriate. you should also be careful to specify the width of the window (in em) as appropriate using the preprocessor for each targeted platform, as well as the height (in em) for platforms where the window size does not change as the selected panel is changed (e.g. windows). ...
...reprocessor if necessary to set different window titles as appropriate. you should also be careful to specify the width of the window (in em) as appropriate using the preprocessor for each targeted platform, as well as the height (in em) for platforms where the window size does not change as the selected panel is changed (e.g. windows). ...
...ms where the window size does not change as the selected panel is changed (e.g. windows). usage in xulrunner applications when calling opendialog() to open a preferences dialog, "toolbar" should be included in the features string. not using "toolbar" will cause the preferences dialog to only display one preference pane. ...
... should be included in the features string. not using "toolbar" will cause the preferences dialog to only display one preference pane. ...
Browser Toolbox - Firefox Developer Tools
ingle page on a single tab. note: if you want to debug a specific add-on that is restartless or sdk-based then try the add-on debugger. use the browser toolbox for add-ons that are neither. enabling the browser toolbox the browser toolbox is not enabled by default. to enable it you need to check the settings "enable chrome and addon debugging" and "enable remote debugging". ...
...ither. enabling the browser toolbox the browser toolbox is not enabled by default. to enable it you need to check the settings "enable chrome and addon debugging" and "enable remote debugging". to do this, open the developer tools settings, go to the section "advanced settings", and check the settings "enable browser chrome and add-on debugging toolboxes" and "enable remote debugging". opening the browser toolbox open the browser toolbox through the menu button and the menu items "developer" then "browser toolbox". you can also open it with the ctrl + alt +shift + i key combination ( cmd + opt +shift + i on a mac). you will be presented with a dialog like this (it can be removed by setting the devtools.debugger.prompt-connection property to false): click ok, and the browser t...
...ser toolbox open the browser toolbox through the menu button and the menu items "developer" then "browser toolbox". you can also open it with the ctrl + alt +shift + i key combination ( cmd + opt +shift + i on a mac). you will be presented with a dialog like this (it can be removed by setting the devtools.debugger.prompt-connection property to false): click ok, and the browser toolbox will open in its own window: you'll be able to inspect the browser's chrome windows and see, and be able to debug, all the javascript files loaded by the browser itself and by any add-ons that are running. altogether you will have access to the following developer tools: debugger (note: if you want to debug a specific add-on that is restartless or sdk-based then try the add-on debugger.) console st...
...nabling you to target specific iframes in the document. the same button appears in the browser toolbox where it lists all the top-level chrome and content windows as well as any iframes they contain. this enables you to inspect documents in individual chrome windows and popups, as well as in content tabs. for example, here's what the frame selection popup lists when there are two browser windows open, one with one content tab, and one with two: debugging popups it's hard to debug popups, because the browser hides them as soon as you click outside them. there is a way to disable this behavior. click the toolbox menu and select disable popup auto-hide. now when you open any popup, it will stay open until you press the esc key. you can use the inspector's node picker to select that pane...
Network request list - Firefox Developer Tools
point at which the page's domcontentloaded event is triggered. the red line marks the point at which the page's load event is triggered. blocking specific urls if you want to view your page as it would look without a resource (e.g., if it were blocked by the browser or an extension), you can block requests matching patterns you specify. click the request blocking icon in the toolbar. this opens the blocking sidebar. (click the icon again when you want to close the sidebar.) enter a string in the field with the placeholder text block resource when url contains. reload the page to test it with the specified url blocked. other actions you can take with request blocking: to turn all request blocking off or on: toggle the checkbox next to enable request blocking. to turn a specif...
...hat matches the given regular expression. regexp:\d{5} regexp:mdn|mozilla for example, to find all 404, not found, errors, you can type "404" into the search and auto-complete suggests "status-code:404" so you'll end up with something like this: search in requests use the search panel to run a full-text search on headers and content. click the search icon in the toolbar. this opens the search sidebar. enter a string in the search field of the sidebar, and press enter or return. the search results area below the search field displays the requests that contain that string in the request or response headers or in the content of the response. you can expand each item to show the specific item that matches the string. clicking an item in the search results highlights that i...
... > copy response headers copies the headers of the response for this request, to the clipboard. copy > copy response copies the entire response that was sent for this request. copy > copy all as har creates an http archive (har) for all requests listed, and copies it to the clipboard. save all as har creates an http archive (har) for all requests listed, and opens a file dialog, so you can save it to a file. resend resends the request as it was originally sent with no changes made. edit and resend opens an editor enabling you to edit the request's method, url, parameters, and headers, and resend the request. block url blocks the selected url for future requests. see blocking a specific url from the request list. ...
...a file dialog, so you can save it to a file. resend resends the request as it was originally sent with no changes made. edit and resend opens an editor enabling you to edit the request's method, url, parameters, and headers, and resend the request. block url blocks the selected url for future requests. see blocking a specific url from the request list. open in new tab resends the request in a new tab — very useful for debugging asynchronous requests. open in style editor for a css resource, opens it in the style editor. start performance analysis use as fetch in console submits the request as a call to the fetch() method in the console. copy as curl the command may include the following options: ...
Settings - Firefox Developer Tools
opening settings beginning with firefox 62, the icon to open developer tools settings has been moved into a menu accessed by clicking/touching ... (the elipsis) on the right of the tab. the menu includes settings to control the location of the developer tools. you can choose between the default setting at the bottom of the windows, or move the tools to the left or right side of the screen. these settings are particularly useful if you have a widescreen monitor. you can also choose to open the tools in a separate window. show split console adds a section at the bottom of the tools showing the console. it makes visible the command line and one or two lines of the console output. the rest of the settings are on the developer tools settings pane. ...
...of the screen. these settings are particularly useful if you have a widescreen monitor. you can also choose to open the tools in a separate window. show split console adds a section at the bottom of the tools showing the console. it makes visible the command line and one or two lines of the console output. the rest of the settings are on the developer tools settings pane. to see the settings, open any of the developer tools, and then: click the "settings" command in the menu: or press f1 to toggle between the active tool and the settings pane the settings pane looks something like this: categories default firefox developer tools this group of checkboxes determines which tools are enabled in the toolbox. new tools are often included in firefox but not enabled by default. availab...
...nd when you click the icon for the screenshot tool, play a shutter sound. new in firefox 53. editor preferences preferences for the codemirror source editor, which is included in firefox and used by several developer tools, including scratchpad and the style editor. detect indentation auto-indent new lines based on the current indentation. autoclose brackets determines whether typing an opening character like [ or { will cause the editor to insert the matching closing character ] or } for you. indent using spaces when checked, indentation will be performed using spaces, when off, the editor will use tabs instead. tab size the frequency of tab stops in the editor. select 2, 4, or 8. keybindings choose the default codemirror keybindings or keybindings from one of several popular ...
... keybindings choose the default codemirror keybindings or keybindings from one of several popular editors: vim emacs sublime text advanced settings show gecko platform data a setting to control whether or not profiles should include gecko platform symbols. disable http cache disable the browser http cache to simulate first-load performance in all tabs that have the toolbox open. this setting persists, meaning that if it is set, caching will be disabled whenever you reopen the devtools. caching is re-enabled when the devtools are closed. note that service workers are not affected by this option. note that this option was called "disable cache" in firefox versions previous to 49, but it was renamed to make it clearer that this affects the http cache, and not service work...
Console messages - Firefox Developer Tools
are available on all message categories. additional context menu options are described in the subsection for the message category they apply to. copy message copies the selected message to the clipboard. select all selects all messages available in the message display pane. export visible messages to clipboard copies all messages available in the display pane to the clipboard. file opens a file dialog box so you can save an export of all messages available in the display pane. message categories network network log messages are not shown by default. use the filtering feature to show them. network requests are logged with a line that looks like this: time the time the message was recorded. method the specific http request method. i...
...tails. uri the target uri. summary the http version, response code, and time taken to complete. clicking the response code takes you to the reference page for that code. the context menu for network messages includes a few extra items in addition the globally-available ones: copy link location acts as you would expect, copying the url into the clipboard open in network panel switches context to the network tab, selects the request and shows you the details resend request sends the network request again. open url in new tab opens the url in a new browser tab. if the resource is an image, the image will be opened in a new tab. if the resource is a stylesheet, you will see the css rules, etc. js javascript errors contain a "learn more" link th...
...ges, as distinct from css errors or warnings. by default, they are disabled. you can enable them by clicking the "css" button in the toolbar and selecting "reflows". each message is labeled "reflow" and shows the time taken to execute the reflow. if the reflow is a synchronous reflow triggered from javascript, it also shows a link to the line of code that triggered the reflow. click the link to open the file in the debugger. synchronous and asynchronous reflows if a change is made that invalidates the current layout — for example, the browser window is resized or some javascript modifies an element's css — the layout is not recalculated immediately. instead, the reflow happens asynchronously, the next time the browser decides it needs to be done (generally, the next time the browser re...
... ...
about:debugging (before Firefox 68) - Firefox Developer Tools
the about:debugging page provides a single place from which you can attach the firefox developer tools to a number of debugging targets. at the moment it supports three main sorts of targets: restartless add-ons, tabs, and workers. opening the about:debugging page there are several different ways to open about:debugging: type "about:debugging" in the firefox url bar. in the tools > web developer menu, click "service workers". select the web developer menu under the hamburger menu (), then select "service workers". when about:debugging opens, on the left-hand side, you'll see a sidebar enabling you to switch between the two main views: one for add-ons and one for workers. whether or not system add-ons appear in the list on this page depends on the setting of the devtools.aboutdebuggi...
...he manifest.json file again, so changes to permissions, content_scripts, browser_action or any other keys will take effect. note that in firefox 49 onwards, the reload button is only enabled for temporary add-ons. it will be disabled for all other add-ons. ...
...e effect. note that in firefox 49 onwards, the reload button is only enabled for temporary add-ons. it will be disabled for all other add-ons. tabs in firefox 49 onwards, a tabs page is available in about:debugging — this provides a complete list of all the debuggable tabs open in the current firefox instance. each tab entry has a debug button next to it — when clicked, this will open up a toolbox specific to that tab, allowing you to debug that tab's contents. ...
...s, a tabs page is available in about:debugging — this provides a complete list of all the debuggable tabs open in the current firefox instance. each tab entry has a debug button next to it — when clicked, this will open up a toolbox specific to that tab, allowing you to debug that tab's contents. note that this feature isn't that immediately useful to debugging desktop tabs — you can open up a toolbox to debug a tab easily enough already — but this will become far more useful when about:debugging starts to support remote debugging, and this page can begin to list tabs available for debugging on mobile device browsers, simulators, etc. see bug 1212802 for the latest on this work. workers the workers page shows your workers, categorised as follows: all registered service wor...
AudioBufferSourceNode.loopStart - Web APIs
he audio buffer at which each loop should begin during playback. this value is only used when the loop parameter is true. example in this example, the audiocontext.decodeaudiodata() function is used to decode an audio track and put it into an audiobuffersourcenode. buttons are provided to play and stop the audio playback, and slider controls are used to change the playbackrate, loopstart, and loopend properties on the fly. when the audio is played to the end, it loops, but you can control how long the loops last by altering loopstart and loopend. for example, if you set their values to 20 and 25, respectively, the audio will start to loop between 20 and 25 seconds in to the track. for a full working example, see this code running live, or view the source. function getdata() { source =...
...you can control how long the loops last by altering loopstart and loopend. for example, if you set their values to 20 and 25, respectively, the audio will start to loop between 20 and 25 seconds in to the track. for a full working example, see this code running live, or view the source. ...
...iodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = 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(); } ... loopstartcontrol.oninput = function() { source.loopstart = loopstartcontrol.value; loopstartvalue.innerhtml = loopstartcontrol.value; } loopendcontrol.oninput = function() { source.loopend = loopendcontrol.value; loopendvalue.inner...
...setattribute('max', math.floor(songlength)); }, function(e){"error with decoding audio data" + e.err}); } request.send(); } ... loopstartcontrol.oninput = function() { source.loopstart = loopstartcontrol.value; loopstartvalue.innerhtml = loopstartcontrol.value; } loopendcontrol.oninput = function() { source.loopend = loopendcontrol.value; loopendvalue.innerhtml = loopendcontrol.value; } specifications specification status comment web audio apithe definition of 'loopstart' in that specification. working draft ...
Clients - Web APIs
Web › API › Clients
the clients interface provides access to client objects. access it via self.clients within a service worker. methods clients.get() returns a promise for a client matching a given id. clients.matchall() returns a promise for an array of client objects. an options argument allows you to control the types of clients returned. clients.openwindow() opens a new browser window for a given url and returns a promise for the new windowclient. clients.claim() allows an active service worker to set itself as the controller for all clients within its scope. examples the following example shows an existing chat window or creates a new one when the user clicks a notification. addeventlistener('notificationclick', event => { event.waituntil(async function() { const allclients = await c...
...all clients within its scope. examples the following example shows an existing chat window or creates a new one when the user clicks a notification. ...
... working draft initial definition ...
...e already have a chat window open: for (const client of allclients) { const url = new url(client.url); if (url.pathname == '/chat/') { // excellent, let's use it! client.focus(); chatclient = client; break; } } // if we didn't find an existing chat window, // open a new one: if (!chatclient) { chatclient = await clients.openwindow('/chat/'); } // message the client: chatclient.postmessage("new chat messages!"); }()); }); specifications specification status comment service workersthe definition of 'clients' in that specification. working draft initial definition ...
Document.write() - Web APIs
Web › API › Document › write
the document.write() method writes a string of text to a document stream opened by document.open(). note: because document.write() writes to the document stream, calling document.write() on a closed (loaded) document automatically calls document.open(), which will clear the document. syntax document.write(markup); parameters markup a string containing the text to be written to the document. ...
...document.write() writes to the document stream, calling document.write() on a closed (loaded) document automatically calls document.open(), which will clear the document. syntax document.write(markup); parameters markup a string containing the text to be written to the document. example <html> <head> <title>write example</title> <script> function newcontent() { document.open(); document.write("<h1>out with the old, in with the new!</h1>"); document.close(); } </script> </head> <body onload="newcontent();"> <p>some original document content.</p> </body> </html> notes the text you write is parsed into the document's structure model. in the example above, the h1 element becomes a node in the document. writing to a document that has already lo...
...out with the old, in with the new!</h1>"); document.close(); } </script> </head> <body onload="newcontent();"> <p>some original document content.</p> </body> </html> notes the text you write is parsed into the document's structure model. in the example above, the h1 element becomes a node in the document. writing to a document that has already loaded without calling document.open() will automatically call document.open(). after writing, call document.close() to tell the browser to finish loading the page. if the document.write() call is embedded within an inline html <script> tag, then it will not call document.open(). for example: <script> document.write("<h1>main title</h1>") </script> note: document.write() and document.writeln do not work in xhtml documents (you...
...more information is available in the w3c xhtml faq. ...
HTMLDialogElement: cancel event - Web APIs
the cancel event fires on a <dialog> when the user instructs the browser that they wish to dismiss the current open dialog. for example, the browser might fire this event when the user presses the esc key or clicks a "close dialog" button which is part of the browser's ui. ...
...the browser might fire this event when the user presses the esc key or clicks a "close dialog" button which is part of the browser's ui. ...
...ight fire this event when the user presses the esc key or clicks a "close dialog" button which is part of the browser's ui. ...
...button class="close" type="reset">close</button> </dialog> <button class="open-dialog">open dialog</button> <div class="result"></div> css button, div { margin: .5rem; } js const result = document.queryselector('.result'); const dialog = document.queryselector('.example-dialog'); dialog.addeventlistener('cancel', (event) => { result.textcontent = 'dialog was canceled'; }); const opendialog = document.queryselector('.open-dialog'); opendialog.addeventlistener('click', () => { if (typeof dialog.showmodal === 'function') { dialog.showmodal(); result.textcontent = ''; } else { result.textcontent = 'the dialog api is not supported by this browser'; } }); const closebutton = document.queryselector('.close'); closebutton.addeventlistener('click', () => { ...
HTMLDialogElement.returnValue - Web APIs
the returnvalue property of the htmldialogelement interface gets or sets the return value for the <dialog>, usually to indicate which button the user pressed to close it. syntax dialoginstance.returnvalue = 'myreturnvalue'; var myreturnvalue = dialoginstance.returnvalue; value a domstring representing the returnvalue of the dialog. examples the following example displays a button to open a <dialog> containing a form via the showmodal() method. from there, either button will close the dialog. <!-- simple pop-up dialog box containing a form --> <dialog id="favdialog"> <form method="dialog"> <p><label>favorite animal: <select name="favanimal" required> <option></option> <option>brine shrimp</option> <option>red panda</option> ...
... <menu> <button>cancel</button> <button>confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var dialog = document.getelementbyid('favdialog'); dialog.returnvalue = 'favanimal'; function opencheck(dialog) { if (dialog.open) { console.log('dialog open'); } else { console.log('dialog closed'); } } function handleuserinput(returnvalue) { if (returnvalue === 'cancel' || returnvalue == null) { // user canceled the dialog, do nothing } else if (returnvalue === 'confirm') { // user chose a favorite a...
... specifications specification status comment html living standardt...
... specifications specification status comment html living standardthe definition of 'returnvalue' in that specification. living standard html 5.1the definition of 'returnv...
HTMLDialogElement - Web APIs
t="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="86" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmldialogelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmldialogelement.open a boolean reflecting the open html attribute, indicating whether the dialog is available for interaction. htmldialogelement.returnvalue a domstring that sets or returns the return value for the dialog. methods inherits methods from its parent, htmlelement. htmldialogelement.close() closes the dialog. an optional domstring may be passed as an argument, updating the returnvalue of the the...
...e. still allowing interaction with content outside of the dialog. htmldialogelement.showmodal() displays the dialog as a modal, over the top of any other dialogs that might be present. interaction outside the dialog is blocked. events close fired when the dialog is closed. also available via the onclose property. examples the following example shows a simple button that, when clicked, opens a <dialog> containing a form via the htmldialogelement.showmodal() function. from there you can click the cancel button to close the dialog (via the htmldialogelement.close() function), or submit the form via the submit button. <!-- simple pop-up dialog box, containing a form --> <dialog id="favdialog"> <form method="dialog"> <section> <p><label for="favanimal">favorite an...
...confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var cancelbutton = document.getelementbyid('cancel'); var dialog = document.getelementbyid('favdialog'); dialog.returnvalue = 'favanimal'; function opencheck(dialog) { if(dialog.open) { console.log('dialog open'); } else { console.log('dialog closed'); } } // update button opens a modal dialog updatebutton.addeventlistener('click', function() { dialog.showmodal(); opencheck(dialog); }); // form cancel button closes the dialog box cancelbutton.addeven...
... specifications specification status comment html living standardthe definition of 'htmldialogelement' in that specification. ...
IDBDatabase.onabort - Web APIs
the onabort event handler of the idbdatabase interface handles the abort event, fired when a transaction is aborted and bubbles up to the connection object. note: this feature is available in web workers. syntax idbdatabase.onabort = function(event) { ... }; example this example shows an idbopendbrequest.onupgradeneeded block that creates a new object store; it also includes onerror and onabort functions to handle non-success cases. ...
...interface handles the abort event, fired when a transaction is aborted and bubbles up to the connection object. note: this feature is available in web workers. syntax idbdatabase.onabort = function(event) { ... }; example this example shows an idbopendbrequest.onupgradeneeded block that creates a new object store; it also includes onerror and onabort functions to handle non-success cases. ...
...le in web workers. syntax idbdatabase.onabort = function(event) { ... }; example this example shows an idbopendbrequest.onupgradeneeded block that creates a new object store; it also includes onerror and onabort functions to handle non-success cases. ...
...le shows an idbopendbrequest.onupgradeneeded block that creates a new object store; it also includes onerror and onabort functions to handle non-success cases. ...
IDBDatabase.onerror - Web APIs
the onerror event handler of the idbdatabase interface handles the error event, fired when a request returns an error and bubbles up to the connection object. note: consider using idbopendbrequest.onsuccess instead (see idbrequest.onsuccess, where it is inherited from). note: this feature is available in web workers. syntax idbdatabase.onerror = function(event) { ... } example this example shows an idbopendbrequest.onupgradeneeded block that creates a new object store; it also includes onerror and onabort functions to handle non-success cases. ...
...note: consider using idbopendbrequest.onsuccess instead (see idbrequest.onsuccess, where it is inherited from). note: this feature is available in web workers. syntax idbdatabase.onerror = function(event) { ... } example this example shows an idbopendbrequest.onupgradeneeded block that creates a new object store; it also includes onerror and onabort functions to handle non-success cases. ...
...ilable in web workers. syntax idbdatabase.onerror = function(event) { ... } example this example shows an idbopendbrequest.onupgradeneeded block that creates a new object store; it also includes onerror and onabort functions to handle non-success cases. ...
... shows an idbopendbrequest.onupgradeneeded block that creates a new object store; it also includes onerror and onabort functions to handle non-success cases. ...
IDBDatabase.onversionchange - Web APIs
the onversionchange event handler of the idbdatabase interface handles the versionchange event, fired when a database structure change (idbopendbrequest.onupgradeneeded event or idbfactory.deletedatabase) was requested elsewhere (most probably in another window/tab on the same computer). this is different from the versionchange transaction (but it is related). note: this feature is available in web workers. syntax idbdatabase.onversionchange = function(event) { ... } example this example shows an idbopendbrequest.onupgradeneeded block that creates a new object store; it also includes onerror and onabort functions to handle non-success cases, and an onversionchange function to notify when a database structure change has occurred. request.onupgradeneeded = function(event) { var db = ...
...s example shows an idbopendbrequest.onupgradeneeded block that creates a new object store; it also includes onerror and onabort functions to handle non-success cases, and an onversionchange function to notify when a database structure change has occurred. ...
...ncludes onerror and onabort functions to handle non-success cases, and an onversionchange function to notify when a database structure change has occurred. ...
... recommendation indexed database api draftthe definition of 'onversionchange' in that specification. recommendation browser comp...
IDBDatabase.version - Web APIs
the version property of the idbdatabase interface is a 64-bit integer that contains the version of the connected database. when a database is first created, this attribute is an empty string. note: this feature is available in web workers. syntax var myinteger = idbdatabase.version; value an integer containing the version of the connected database. ...
...he version property of the idbdatabase interface is a 64-bit integer that contains the version of the connected database. when a database is first created, this attribute is an empty string. note: this feature is available in web workers. syntax var myinteger = idbdatabase.version; value an integer containing the version of the connected database. ...
...atabase interface is a 64-bit integer that contains the version of the connected database. when a database is first created, this attribute is an empty string. note: this feature is available in web workers. syntax var myinteger = idbdatabase.version; value an integer containing the version of the connected database. example // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database // being opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. this is used a lot below db ...
...dolist", 4); // these two event handlers act on the database // being opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. this is used a lot below db = dbopenrequest.result; // this line will log the version of the connected database, which should be "4" console.log(db.version); }; specifications specification status comment indexed database api 2.0the definition of 'version' in that specification. recommendation indexed database api draftthe definition of 'version' in that specification. recommendatio...
IDBKeyRange.upperBound() - Web APIs
the default is false. optional return value idbkeyrange: the newly created key range. ...
...the default is false. optional return value idbkeyrange: the newly created key range. ...
... this method may raise a domexception of the following type: exception description dataerror the value parameter passed was not a valid key. example the following example illustrates how you'd use an upper bound key range. here we declare keyrangevalue = idbkeyrange.upperbound("f"); — a range that includes the value "f" and everything before it. we open a transaction (using idbtransaction) and an object store, and open a cursor with idbobjectstore.opencursor, declaring keyrangevalue as its optional key range value. if we used idbkeyrange.upperbound("f", true);, then the range excludes "f"; and instead only includes the values before it. note: for a more complete example allowing you to experiment with key range, have a look at our idbkeyrang...
... only includes the values before it. ...
IDBObjectStore.index() - Web APIs
return value an idbindex object for accessing the index. exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror the source object store has been deleted, or the transaction for the object store has finished. ...
... return value an idbindex object for accessing the index. exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror the source object store has been deleted, or the transaction for the object store has finished. ...
...ndex. exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror the source object store has been deleted, or the transaction for the object store has finished. notfounderror there is no index with the given name (case-sensitive) in the database. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. we then open a basic cursor on the index using idbindex.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the index, not the primary key. finally, we iterate through each record, and inser...
...te through each record, and insert the data into an html table. ...
IDBObjectStore.indexNames - Web APIs
the indexnames read-only property of the idbobjectstore interface returns a list of the names of indexes on objects in this object store. note: this feature is available in web workers. syntax var myindexnames = objectstore.indexnames; value a domstringlist. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store using add(). after the object store has been created, we log objectstore.indexnames to the console. ...
...s. syntax var myindexnames = objectstore.indexnames; value a domstringlist. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store using add(). after the object store has been created, we log objectstore.indexnames to the console. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = this.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // crea...
...tore the result of opening the database in the db variable. ...
.../ open a read/write db transaction, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of the transaction completing, when everything is done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. duplicate items not allowed.</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todolist"); console.log(objectstore.indexnames); // make a request to add our newitem object to the object store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the succe...
RTCDataChannel - Web APIs
ta channel, the function receives as input an errorevent object describing the error which occurred.onmessage the rtcdatachannel.onmessage property stores an eventhandler which specifies a function to be called when the message event is fired on the channel. this event is represented by the messageevent interface. ...
...ceives as input an errorevent object describing the error which occurred.onmessage the rtcdatachannel.onmessage property stores an eventhandler which specifies a function to be called when the message event is fired on the channel. this event is represented by the messageevent interface. this event is sent to the channel when a message is received from the other peer.onopen the rtcdatachannel.onopen property is an eventhandler which specifies a function to be called when the open event is fired; this is a simple event which is sent when the data channel's underlying data transport—the link over which the rtcdatachannel's messages flow—is established or re-established.methodsalso inherits methods from: eventtargetclose()the rtcdatachannel.close() method closes the rtcdatachannel. either p...
...r falls below the value specified by bufferedamountlowthreshold. close sent to the onclose event handler when the underlying data transport closes. error sent to the onerror event handler when an error occurs on the data channel. message sent to the onmessage event handler when a message has been received from the remote peer. the message contents can be found in the event's data property. open sent to the onopen event handler when the data channel is first opened, or when an existing data channel's underlying connection re-opens. data format the underlying data format is defined by the ieee draft specification draft-ietf-mmusic-sctp-sdp. the current format specifies its protocol as either "udp/dtls/sctp" (udp carrying dtls carrying sctp) or "tcp/dtls/sctp" (tcp carrying dtls carryi...
...t-ietf-mmusic-sctp-sdp. the current format specifies its protocol as either "udp/dtls/sctp" (udp carrying dtls carrying sctp) or "tcp/dtls/sctp" (tcp carrying dtls carrying sctp). older browsers may only specify "dtls/sctp". example var pc = new rtcpeerconnection(); var dc = pc.createdatachannel("my channel"); dc.onmessage = function (event) { console.log("received: " + event.data); }; dc.onopen = function () { console.log("datachannel open"); }; dc.onclose = function () { console.log("datachannel close"); }; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdatachannel' in that specification. candidate recommendation initial specification. ...
RTCPeerConnection.createDataChannel() - Web APIs
cify a non-null value for one of these. resourceinuse an id was specified, but another rtcdatachannel is already using the same value. operationerror either the specified id is already in use or, if no id was specified, the webrtc layer was unable to automatically generate an id because all ids are in use. ...
...r was unable to automatically generate an id because all ids are in use. examples this example shows how to create a data channel and set up handlers for the open and message events to send and receive messages on it (for brievity, the example assumes onnegotiationneeded is set up). ...
...tionneeded is set up). ...
...channel;  channel.onopen = function(event) { channel.send('hi back!'); } channel.onmessage = function(event) { console.log(event.data); } } alternatively, more symmetrical out-of-band negotiation can be used, using an agreed-upon id (0 here): // both sides var pc = new rtcpeerconnection(options); var channel = pc.createdatachannel("chat", {negotiated: true, id: 0}); channel.onopen = function(event) { channel.send('hi!'); } channel.onmessage = function(event) { console.log(event.data); } for a more thorough example showing how the connection and channel are established, see a simple rtcdatachannel sample. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'createdatachannel()' in t...
Using WebGL extensions - Web APIs
a complete list of extensions is available in the khronos webgl extension registry. note: in webgl, unlike in other gl apis, extensions are only available if explicitly requested. canonical extension names, vendor prefixes and preferences extensions may be supported by browser vendors before being officially ratified (but only when they are in draft stage). in that case, their name can be prefixed by the vendor prefix (moz_, webkit_, etc.) or the extension is only available once a browser preference has been toggled. ...
...are: webgl.enable-draft-extensions in firefox chrome://flags/#enable-webgl-draft-extensions in chromium based browsers (chrome, opera). naming conventions webgl extensions are prefixed with "angle", "oes", "ext" or "webgl". these prefixes reflect origin and intent: angle_: extensions that are written by the angle library authors. ...
...e-draft-extensions in firefox chrome://flags/#enable-webgl-draft-extensions in chromium based browsers (chrome, opera). naming conventions webgl extensions are prefixed with "angle", "oes", "ext" or "webgl". these prefixes reflect origin and intent: angle_: extensions that are written by the angle library authors. ...
...h "angle", "oes", "ext" or "webgl". these prefixes reflect origin and intent: angle_: extensions that are written by the angle library authors. oes_ and khr_: extensions that mirror functionality from opengl es (oes) or opengl api extensions approved by the respective architecture review boards (khronos). ovr_: extensions that optimize for virtual reality. ext_: extensions that mirror other opengl es or opengl api extensions. webgl_: extensions that are webgl-specific and intended to be compatible with multiple web browsers. it should also be used for extensions which originated with the opengl es or opengl apis, but whose behavior has been significantly altered. querying available extensions the webgl context supports querying what extensions are available. var available_extensions...
WebGL best practices - Web APIs
frame boundary, an explicit webgl.flush() isn't really needed with raf. avoid blocking api calls in production (e.g. geterror, getparameter) certain webgl entry points cause synchronous stalls on the calling thread. even basic requests can take as long as 1ms, but they can take even longer if they need to wait for all graphics work to be completed (with an effect similar to glfinish() in native opengl). in production code, avoid such entry points, especially on the browser main thread where they can cause the entire page to jank (often including scrolling or even the whole browser). geterror(): causes a flush + round-trip to fetch errors from the gpu process). for example, within firefox, the only time glgeterror is checked is after allocations (bufferdata, *teximage*, texstorage*)...
... in conjunction with fences - see async data readback below.) readpixels() to the cpu (i.e. without an unpack buffer bound): finish + round-trip. instead, use gpu-gpu readpixels in conjunction with async data readback. always keep vertex attrib 0 array-enabled if you draw with vertex attrib 0 array disabled, you will force the browser to do complicated emulation when running on desktop opengl (such as on macos). this is because in desktop opengl, nothing gets drawn if vertex attrib 0 is not array-enabled. you can use bindattriblocation to force a vertex attribute to use location 0, and use enablevertexattribarray(0) to make it array-enabled. estimate a per-pixel vram budget webgl doesn't offer apis to query the maximum amount of video memory on the system because such queries are ...
...age of depth and stencil formats is rounded up to the nearest four bytes. teximage/texsubimage uploads (particularly with videos) can cause pipeline flushes most texture uploads from dom elements will incur a processing pass that will temporarily switch gl progams internally, causing a pipeline flush. (pipelines are formalized explicitly in vulkan[1] et al, but are implicit behind-the-scenes in opengl and webgl. pipelines are more or less the tuple of shader program, depth/stencil/multisample/blend/rasterization state) in webgl: ... useprogram(prog1) <pipeline flush> bindframebuffer(target) drawarrays() bindtexture(webgl_texture) teximage2d(htmlvideoelement) drawarrays() ... behind the scenes in the browser: ... useprogram(prog1) <pipeline flush> ...
...ile. when you're done with the contents of a framebuffer attachment, use invalidateframebuffer to discard the data, instead of leaving the driver to waste time storing the data for later use. depth/stencil and/or multisampled attachments in particular are great candidates for invalidateframebuffer. ...
WebGL model view projection - Web APIs
iddle see that small dark blue triangle? that's an additional face added to our object because the rotation of our shape has caused that corner to extend outside clip space, thus causing the corner to be clipped away. see perspective projection matrix below for an introduction to how to use more complex matrices to help control and prevent clipping. exercise if that sounds a little abstract, open up the vertex shader and play around with the scale factor and watch how it shrinks vertices more towards the surface. completely change the w component values for really trippy representations of space. in the next section we'll take this step of copying z into the w slot and turn it into a matrix. simple projection the last step of filling in the w component can actually be accomplished with...
...of projection matrix that accomplishes all of these requirements. the math also starts to get a bit more involved and won't be fully explained in these examples. in short, it combines dividing by w (as done with the previous examples) with some ingenious manipulations based on similar triangles. if you want to read a full explanation of the math behind it check out some of the following links: opengl projection matrix perspective projection trying to understand the math behind the perspective projection matrix in webgl one important thing to note about the perspective projection matrix used below is that it flips the z axis. in clip space the z+ goes away from the viewer, while with this matrix it comes towards the viewer. the reason to flip the z axis is that the clip space coordinate...
...the z axis. in clip space the z+ goes away from the viewer, while with this matrix it comes towards the viewer. the reason to flip the z axis is that the clip space coordinate system is a left-handed coordinate system (wherein the z-axis points away from the viewer and into the screen), while the convention in mathematics, physics and 3d modeling, as well as for the view/eye coordinate system in opengl, is to use a right-handed coordinate system (z-axis points out of the screen towards the viewer) . more on that in the relevant wikipedia articles: cartesian coordinate system, right-hand rule. let's take a look at a perspectivematrix() function, which computes the perspective projection matrix. mdn.perspectivematrix = function(fieldofviewinradians, aspectratio, near, far) { var f = 1.0 / m...
...and the model matrix. swap out the perspective projection matrix to use orthographic projection. in the mdn webgl shared code you'll find the mdn.orthographicmatrix(). this can replace the mdn.perspectivematrix() function in cubedemo.prototype.computeperspectivematrix(). view matrix while some graphics libraries have a virtual camera that can be positioned and pointed while composing a scene, opengl (and by extension webgl) does not. this is where the view matrix comes in. its job is to translate, rotate, and scale the objects in the scene so that they are located in the right place relative to the viewer given the viewer's position and orientation. simulating a camera this makes use of one of the fundamental facets of einstein's special relativity theory: the principle of reference fram...
Privileged features - Web APIs
this is not for web content. the following features require the chrome-privilege. centerscreen centers the window in relation to its parent's size and position. minimizable this setting can only apply to dialog windows; minimizable requires dialog=yes. if minimizable is on, the new dialog window will have a minimize system command icon in the titlebar and it will be minimizable. any non-dialog window is always minimizable and minimizable=no will be ignored. dependent if on, the new window is said to be dependent of its parent window. a dependent window closes when its parent window closes. ...
...4867) in msie 6, the nearest equivalent to this feature is the showmodelessdialog() method. chrome if on, the page is loaded as window's only content, without any of the browser's interface elements. there will be no context menu defined by default and none of the standard keyboard shortcuts will work. the page is supposed to provide a user interface of its own, usually this feature is used to open xul documents (standard dialogs like the javascript console are opened this way). dialog the dialog feature removes all icons (restore, minimize, maximize) from the window's titlebar, leaving only the close button. mozilla 1.2+ and netscape 7.1 will render the other menu system commands (in ff 1.0 and in ns 7.0x, the command system menu is not identified with the firefox/ns 7.0x icon on the l...
...ported in firefox. note also that starting in gecko 2.0, you can use window.showmodaldialog() without universalbrowserwrite privileges. titlebar by default, all new secondary windows have a titlebar. if set to no or 0, this feature removes the titlebar from the new secondary window. mozilla and firefox users can force new windows to always render the titlebar by setting dom.disable_window_open_feature.titlebar to true in about:config or in their user.js file. alwaysraised if on, the new window will always be displayed on top of other browser windows, regardless of whether it is active or not. alwayslowered if on, the new created window floats below, under its own parent when the parent window is not minimized. alwayslowered windows are often referred as pop-under windows. the alwa...
...t. this was added in firefox 66 (see bug 1519893). z-lock same as alwayslowered. close when set to no or 0, this feature removes the system close command icon and system close menu item. it will only work for dialog windows (dialog feature set). close=no will override minimizable=yes. mozilla and firefox users can force new windows to always have a close button by setting dom.disable_window_open_feature.close to true in about:config or in their user.js file. ...
Window.resizeBy() - Web APIs
Web › API › Window › resizeBy
xample // shrink the window window.resizeby(-200, -200); notes this method resizes the window relative to its current size. to resize the window in absolute terms, use window.resizeto(). ...
...resize the window in absolute terms, use window.resizeto(). creating and resizing an external window for security reasons, it's no longer possible in firefox for a website to change the default size of a window in a browser if the window wasn’t created by window.open(), or contains more than one tab. see the compatability table for details on the change. even if you create window by window.open() it is not resizable by default. to make the window resizable, you must open it with the "resizable" feature. ...
...ite to change the default size of a window in a browser if the window wasn’t created by window.open(), or contains more than one tab. see the compatability table for details on the change. even if you create window by window.open() it is not resizable by default. to make the window resizable, you must open it with the "resizable" feature. // create resizable window myexternalwindow = window.open("http://myurl.domain", "mywindowname", "resizable"); // resize window to 500x500 myexternalwindow.resizeto(500, 500); // make window relatively smaller to 400x400 myexternalwindow.resizeby(-100, -100); the window you create must respect the same origin policy. ...
... specifications specification status comment css object model (cssom) view modulethe definition of 'window.resizeby()' in that specification. ...
Window - Web APIs
Web › API › Window
.mozinnerscreeny read only returns the vertical (y) coordinate of the top-left corner of the window's viewport, in screen coordinates. this value is reported in css pixels. see mozscreenpixelspercsspixel for a conversion factor to adapt to screen pixels if needed. window.name gets/sets the name of the window. window.navigator read only returns a reference to the navigator object. window.opener returns a reference to the window that opened this current window. window.outerheight read only gets the height of the outside of the browser window. window.outerwidth read only gets the width of the outside of the browser window. window.pagexoffset read only an alias for window.scrollx. window.pageyoffset read only an alias for window.scrolly window.parent read only returns a r...
...ction object representing the selected item(s). window.matchmedia() returns a mediaquerylist object representing the specified media query string. window.maximize() fixme: needscontents window.minimize() (top-level xul windows only) minimizes the window. window.moveby() moves the current window by a specified amount. window.moveto() moves the window to the specified coordinates. window.open() opens a new window. window.postmessage() provides a secure means for one window to send a string of data to another window, which need not be within the same domain as the first. window.print() opens the print dialog to print the current document. window.prompt() returns the text entered by the user in a prompt dialog. window.requestanimationframe() tells the browser that an animation ...
... use window.history.back(). window.captureevents() registers the window to capture all events of the specified type. window.forward() moves the window one document forward in the history. this method is deprecated; you should instead use window.history.forward(). window.getattention() flashes the application icon. window.home() returns the browser to the home page. window.opendialog() opens a new dialog window. window.releaseevents() releases the window from trapping events of a specific type. window.showmodaldialog() displays a modal dialog. event handlers these are properties of the window object that can be set to establish event handlers for the various things that can happen in the window that might be of interest. this interface inherits even...
... for user proximity events. event handlers implemented from elsewhere globaleventhandlers.onabort called when the loading of a resource has been aborted, such as by a user canceling the load while it is still in progress windoweventhandlers.onafterprint called when the print dialog box is closed. see afterprint event. windoweventhandlers.onbeforeprint called when the print dialog box is opened. see beforeprint event. windoweventhandlers.onbeforeunload an event handler property for before-unload events on the window. globaleventhandlers.onblur called after the window loses focus, such as due to a popup. globaleventhandlers.onchange an event handler property for change events on the window. globaleventhandlers.onclick called after the any mouse button is pressed & released glo...
XMLHttpRequest.readyState - Web APIs
the xmlhttprequest.readystate property returns the state an xmlhttprequest client is in. an xhr client exists in one of the following states: value state description 0 unsent client has been created. open() not called yet. 1 opened open() has been called. 2 headers_received send() has been called, and headers and status are available. 3 loading downloading; responsetext holds partial data. 4 done the operation is complete. unsent the xmlhttprequest client has been created, but the open() method hasn't been called yet. opened open() method has been invoked. during this state, the request headers can be set using the setrequestheader() method and the send() method can be called which will init...
...ave been received. loading response's body is being received. if responsetype is "text" or empty string, responsetext will have the partial text response as it loads. done the fetch operation is complete. this could mean that either the data transfer has been completed successfully or failed. the state names are different in versions of internet explorer earlier than 11. ...
...ate names are different in versions of internet explorer earlier than 11. instead of unsent, opened, headers_received, loading and done, the names readystate_uninitialized (0), readystate_loading (1), readystate_loaded (2), readystate_interactive (3) and readystate_complete (4) are used. ...
...nternet explorer earlier than 11. instead of unsent, opened, headers_received, loading and done, the names readystate_uninitialized (0), readystate_loading (1), readystate_loaded (2), readystate_interactive (3) and readystate_complete (4) are used. ...
XMLHttpRequest.statusText - Web APIs
the read-only xmlhttprequest.statustext property returns a domstring containing the response's status message as returned by the http server. unlike xmlhttprequest.status which indicates a numerical status code, this property contains the text of the response status, such as "ok" or "not found". if the request's readystate is in unsent or opened state, the value of statustext will be an empty string. ...
... code, this property contains the text of the response status, such as "ok" or "not found". if the request's readystate is in unsent or opened state, the value of statustext will be an empty string. if the server response doesn't explicitly specify a status text, statustext will assume the default value "ok". ...
... response status, such as "ok" or "not found". if the request's readystate is in unsent or opened state, the value of statustext will be an empty string. if the server response doesn't explicitly specify a status text, statustext will assume the default value "ok". ...
...e default value "ok". ...
font-variation-settings - CSS: Cascading Style Sheets
each setting is always a <string> of 4 ascii characters, followed by a <number> indicating the axis value. ...
...each setting is always a <string> of 4 ascii characters, followed by a <number> indicating the axis value. ...
...each setting is always a <string> of 4 ascii characters, followed by a <number> indicating the axis value. ...
...s more or fewer characters or contains characters outside the u+20 - u+7e codepoint range, the whole property is invalid. the <number> can be fractional or negative. formal definition related at-rule@font-faceinitial valuenormalcomputed valueas specified formal syntax normal | [ <string> <number> ]# examples setting font weight and stretch in a @font-face rule @font-face { font-family: 'opentypefont'; src: url('open_type_font.woff2') format('woff2'); font-weight: normal; font-style: normal; font-variation-settings: 'wght' 400, 'wdth' 300; } specifications specification status comment css fonts module level 4the definition of 'font-variation-settings' in that specification. working draft initial definition ...
Variable fonts guide - CSS: Cascading Style Sheets
they let you access all the variations contained in a given font file via css and a single @font-face reference. this article will give you all you need to know to get you started using variable fonts. warning: in order to use variable fonts on your operating system, you need to make sure that it is up to date. for example linux oses need the latest linux freetype version, and macos prior to 10.13 does not support variable fonts. ...
...-sensitive. the registered axis names must be in lower case, and custom axes must be in upper case. for example: font-variation-settings: 'wght' 375, 'grad' 88; wght (weight) is a registered axis, and grad (grade) is a custom one. if you have set values using font-variation-settings and want to change one of those values, you must redeclare all of them (in the same way as when you set opentype font features using font-feature-settings). you can work around this limitation by using css custom properties (css variables) for the individual values, and simply modifying the value of an individual custom property. example code follows at the end of the guide. weight weight (represented by the wght tag) defines the design axis of how thin or thick (light or heavy, in typical typograp...
...stom properties to set values for a font-variation-settings string, and shows how you can more easily update single variable values by overriding a single variable rather than rewriting the whole string. note the hover effect on the h2, which only alters the grade axis custom property value. ...
...ation-settings string, and shows how you can more easily update single variable values by overriding a single variable rather than rewriting the whole string. note the hover effect on the h2, which only alters the grade axis custom property value. ...
CSS Fonts - CSS: Cascading Style Sheets
Web › CSS › CSS Fonts
ettings font-style font-variant font-weight font-stretch src unicode-range @font-feature-values guides fundamental text and font styling in this beginner's learning article we go through all the basic fundamentals of text/font styling in detail, including setting font weight, family and style, font shorthand, text alignment and other effects, and line and letter spacing. ...
...s fundamental text and font styling in this beginner's learning article we go through all the basic fundamentals of text/font styling in detail, including setting font weight, family and style, font shorthand, text alignment and other effects, and line and letter spacing. opentype font features guide font features or variants refer to different glyphs or character styles contained within an opentype font. ...
... spacing. opentype font features guide font features or variants refer to different glyphs or character styles contained within an opentype font. these include things like ligatures (special glyphs that combine characters like 'fi' or 'ffl'), kerning (adjustments to the spacing between specific letterform pairings), fractions, numeral styles, and a number of others. these are all referred to as opentype features, and are made available to use on the web via specific properties and a low-level control property — font-feature-settings. this article provides you with all you need to know about using opentype font features in css. ...
...this article will give you all you need to know to get you started using variable fonts. ...
font-feature-settings - CSS: Cascading Style Sheets
the font-feature-settings css property controls advanced typographic features in opentype fonts. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...re-settings css property controls advanced typographic features in opentype fonts. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...d property or an associated longhand property such as font-variant-ligatures, font-variant-caps, font-variant-east-asian, font-variant-alternates, font-variant-numeric or font-variant-position. these lead to more effective, predictable, understandable results than font-feature-settings, which is a low-level feature designed to handle special cases where no other way exists to enable or access an opentype font feature. in particular, font-feature-settings shouldn't be used to enable small caps. values normal text is laid out using default settings. <feature-tag-value> when rendering text, the list of opentype feature tag value is passed to the text layout engine to enable or disable font features. the tag is always a <string> of 4 ascii characters. if it has more or less characters, or ...
...text layout engine to enable or disable font features. the tag is always a <string> of 4 ascii characters. if it has more or less characters, or if it contains characters outside the u+20 – u+7e codepoint range, the whole property is invalid. the value is a positive integer. the two keywords on and off are synonyms for 1 and 0 respectively. if no value is set, the default is 1. for non-boolean opentype features (e.g. stylistic alternates), the value implies a particular glyph to be selected; for boolean values, it is a switch. formal definition initial valuenormalapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | <feature-tag-value>#where <feature-tag-value> = <string> [ <integer...
font-variant-east-asian - CSS: Cascading Style Sheets
font-variant-east-asian: initial; font-variant-east-asian: unset; syntax values normal this keyword leads to the deactivation of the use of such alternate glyphs. ruby this keyword forces the use of special glyphs for ruby characters. as these are usually smaller, font creators often designs specific forms, usually slightly bolder to improve the contrast. ...
...s for ruby characters. as these are usually smaller, font creators often designs specific forms, usually slightly bolder to improve the contrast. this keyword corresponds to the opentype values ruby. <east-asian-variant-values> these values specify a set of logographic glyph variants which should be used for display. ...
... simplified none, use the simplified chinese glyphs smpl traditional none, use the traditional chinese glyphs trad <east-asian-width-values> these values control the sizing of figures used for east asian characters. two values are possible: proportional-width activating the set of east asian characters which vary in width. it corresponds to the opentype values pwid. full-width activating the set of east asian characters which are all of the same, roughly square, width metric. it corresponds to the opentype values fwid. formal definition initial valuenormalapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | [ <east-asian-varia...
... html <table> <thead></thead> <tbody style="border:0;"> <tr> <th>normal/jis78:</th> <td>麹町</td> <td class="jis78">麹町</td> </tr> <tr> <th>normal/ruby:</th> <td>しんかんせん</td> <td class="ruby">しんかんせん</td> </tr> <tr> <th>normal/traditional:</th> <td>大学</td> <td class="traditional">大学</td> </tr> </tbod...
quotes - CSS: Cascading Style Sheets
Web › CSS › quotes
the quotes css property sets how the browser should render quotation marks that are added using the open-quotes or close-quotes values of the css content property. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...otes or close-quotes values of the css content property. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* keyword value */ quotes: none; quotes: auto; /* <string> values */ quotes: "«" "»"; /* set open-quote and close-quote to the french quotation marks */ quotes: "«" "»" "‹" "›"; /* set two levels of quotation marks */ /* global values */ quotes: inherit; quotes: initial; quotes: unset; values none the open-quote and close-quote values of the content property produce no quotation marks. auto appropriate quote marks will be used for whatever language value is set on the selecte...
...the first pair represents the outer level of quotation, the second pair is for the first nested level, next pair for third level and so on. ...
...he first nested level, next pair for third level and so on. formal definition initial valuedepends on user agentapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax none | auto | [ <string> <string> ]+ examples basic quote marks html <q>to be or not to be. that's the question!</q> css q { quotes: '"' '"' "'" "'"; } q::before { content: open-quote; } q::after { content: close-quote; } result auto quotes for most browsers, the default value of quotes is auto (firefox 70+), or the browser otherwise had this default behavior (chromiums, safari, edge), so this example works without it being explicitly being set. html <div lang="fr"> <q>ceci est une citation française.</q> <div> <hr> <div lang="ru"> <q>Это русская ...
text-emphasis-style - CSS: Cascading Style Sheets
xt-emphasis shorthand. /* initial value */ text-emphasis-style: none; /* no emphasis marks */ /* <string> values */ text-emphasis-style: 'x'; text-emphasis-style: '点'; text-emphasis-style: '\25b2'; text-emphasis-style: '*'; text-emphasis-style: 'foo'; /* should not be used. it may be computed to or rendered as 'f' only */ /* keyword values */ text-emphasis-style: filled; text-emphasis-style: open; text-emphasis-style: dot; text-emphasis-style: circle; text-emphasis-style: double-circle; text-emphasis-style: triangle; text-emphasis-style: filled sesame; text-emphasis-style: open sesame; /* global values */ text-emphasis-style: inherit; text-emphasis-style: initial; text-emphasis-style: unset; syntax values none no emphasis marks. filled the shape is filled with solid color. if ne...
...tyle: dot; text-emphasis-style: circle; text-emphasis-style: double-circle; text-emphasis-style: triangle; text-emphasis-style: filled sesame; text-emphasis-style: open sesame; /* global values */ text-emphasis-style: inherit; text-emphasis-style: initial; text-emphasis-style: unset; syntax values none no emphasis marks. filled the shape is filled with solid color. if neither filled nor open is present, this is the default. open the shape is hollow. dot display small circles as marks. the filled dot is '•' (u+2022), and the open dot is '◦' (u+25e6). circle display large circles as marks. ...
...xt-emphasis-style: unset; syntax values none no emphasis marks. filled the shape is filled with solid color. if neither filled nor open is present, this is the default. open the shape is hollow. dot display small circles as marks. the filled dot is '•' (u+2022), and the open dot is '◦' (u+25e6). circle display large circles as marks. the filled circle is '●' (u+25cf), and the open circle is '○' (u+25cb). double-circle display double circles as marks. the filled double-circle is '◉' (u+25c9), and the open double-circle is '◎' (u+25ce). triangle display triangles as marks. the filled triangle is '▲' (u+25b2), and the open triangle is '△' (u+25b3). sesame display sesames as marks. the filled sesame is '﹅' (u+fe45), and the open sesame is '﹆' (u+fe46). <st...
... (u+fe45), and the open sesame is '﹆' (u+fe46). <string> display the given string as marks. authors should not specify more than one character in <string>. the ua may truncate or ignore strings consisting of more than one grapheme cluster. formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | [ [ filled | open ] | [ dot | circle | double-circle | triangle | sesame ] ] | <string> examples h2 { text-emphasis-style: sesame; } specifications specification status comment css text decoration module level 3the definition of 'text-emphasis' in that specification. candidate recommendation initial definition ...
Live streaming web audio and video - Developer guides
er a significant portion of modern browsers but we still need a fallback if we want to support the rest. one popular approach is to use a flash fallback that supports rtmp. of course, we then have the issue that we need to encode in three different formats. audio streaming file formats there are also some audio formats beginning to see support across browsers. opus opus is a royalty-free and open format that manages to optimize quality at various bit-rates for different types of audio. music and speech can be optimized in different ways and opus uses the silk and celt codecs to achieve this. currently, opus is supported by firefox desktop and mobile as well as the latest versions of desktop chrome and opera. note: opus is a mandatory format for webrtc browser implementations. mp3, aa...
...st common audio formats can be streamed using specific server-side technologies. note: it's potentially easier to stream audio using non-streaming formats because unlike video there are no keyframes. server-side streaming technologies in order to stream live audio and video, you will need to run specific streaming software on your server or use third-party services. gstreamer gstreamer is an open source cross-platform multimedia framework that allows you to create a variety of media-handling components, including streaming components. through its plugin system, gstreamer provides support for more than a hundred codecs (including mpeg-1, mpeg-2, mpeg-4, h.261, h.263, h.264, realvideo, mp3, wmv, and flv.) gstreamer plugins such as souphttpclientsink and shout2send exist to stream media ove...
...g components, including streaming components. through its plugin system, gstreamer provides support for more than a hundred codecs (including mpeg-1, mpeg-2, mpeg-4, h.261, h.263, h.264, realvideo, mp3, wmv, and flv.) gstreamer plugins such as souphttpclientsink and shout2send exist to stream media over http. you can also integrate with python's twisted framework or use something like flumotion (open source streaming software). for rtmp transfer you can use the nginx rtmp module. shoutcast shoutcast is a cross-platform proprietary technology for streaming media. developed by nullsoft, it allows digital audio content in mp3 or aac format to be broadcast. for web use, shoutcast streams are transmitted over http. note: shoutcast urls may require a semi-colon to be appended to them. icecast ...
...). for rtmp transfer you can use the nginx rtmp module. shoutcast shoutcast is a cross-platform proprietary technology for streaming media. developed by nullsoft, it allows digital audio content in mp3 or aac format to be broadcast. for web use, shoutcast streams are transmitted over http. note: shoutcast urls may require a semi-colon to be appended to them. icecast the icecast server is an open source technology for streaming media. maintained by the xiph.org foundation, it streams ogg vorbis/theora as well as mp3 and aac format via the shoutcast protocol. note: shoutcast and icecast are among the most established and popular technologies, but there are many more streaming media systems available. streaming services although you can install software like gstreamer, shoutcast and icec...
HTML5 Parser - Developer guides
Web › Guide › HTML › HTML5 › HTML5 Parser
ng prior to html5, gecko and webkit allowed calls to document.write() during parsing to insert content into the source stream. this behavior was inherently racy, as the content was inserted into a timing-dependent point in the source stream. if the call happened after the parser was done, the inserted content replaced the document. in ie, such calls are either ignored or imply a call to document.open(), replacing the document. in html5, document.write() can only be called from a script that is created by a <script> tag that does not have the async or defer attributes set. with the html5 parser, calls to document.write() in any other context either are ignored or replace the document. some contexts from which you should not call document.write() include: scripts created using document.crea...
...ted html scope, so you can nest svg, mathml and html as you’d expect to be able to nest them. the parser case-corrects markup so <svg viewbox='0 0 10 10'> works in html source. the dom methods and css selectors behave case-sensitively, so you need to write your dom calls and css selectors using the canonical case, which is camelcase for various parts of svg such as viewbox. the syntax <foo/> opens and immediately closes the foo element if it is a mathml or svg element (i.e. not an html element). attributes are tokenized the same way they are tokenized in html, so you can omit quotes in the same situations where you can omit quotes in html (i.e. when the attribute value is not the empty string and does not contain whitespace, ", ', `, <, =, or >). warning: the two above features do not c...
...nts or attributes end up in, so you don’t need to use attributes starting with xmlns. attributes in the xlink namespace must use the prefix xlink (e.g. xlink:href). element names must not have prefixes or colons in them. the content of svg script elements is tokenized like they are tokenized in xml—not like the content of html script elements is tokenized. when an svg or mathml element is open <![cdata[…]]> sections work the way they do in xml. you can use this to hide text content from older browsers that don’t support svg or mathml in text/html. the mathml named characters are available for use in named character references everywhere in the document (also in html content). to deal with legacy pages where authors have pasted partial svg fragments into html (who knows why) or us...
...his results in improved performance compared to older parsers, because most of the time, gecko can complete these tasks in parallel. to best take advantage of speculative parsing, and help your pages to load as quickly as possible, ensure that when you call document.write(), you write a balanced sub-tree within that chunk of script. a balanced sub-tree is html code in which any elements that are opened are also closed, so that after the script, the elements left open are the same ones that were open before the script. the open and closing tags do not need to be written by the same document.write() call, as long as they are within the same <script> tag. please note that you shouldn't use end tags for void elements that don't have end tags: <area>, <base>, <br>, <col>, <command>, <embed>, <hr>...
HTML attribute: accept - HTML: Hypertext Markup Language
t's useful to provide a thorough set of type specifiers when you need files of specific type, or use the wild card to denote a type of any format is acceptable. ...
... towards selecting the correct file types. it is still possible (in most cases) for users to toggle an option in the file chooser that makes it possible to override this and select any file they wish, and then choose incorrect file types. because of this, you should make sure that expected requirement is validated server-side. examples when set on a file input type, the native file picker that opens up should only enable selecting files of the correct file type. most operating systems lighten the files that don't match the criteria and aren't selectable. <p> <label for="soundfile">select an audio file:</label> <input type="file" id="soundfile" accept="audio/*"> </p> <p> <label for="videofile">select a video file:</label> <input type="file" id="videofile" accept="video/*"> </p> <p>...
... to upload</label> <input type="file" id="file" name="file" multiple> </div> <div> <button>submit</button> </div> </form> div { margin-bottom: 10px; } this produces the following output: note: you can find this example on github too — see the source code, and also see it running live. regardless of the user's device or operating system, the file input provides a button that opens up a file picker dialog that allows the user to choose a file. including the multiple attribute, as shown above, specifies that multiple files can be chosen at once. the user can choose multiple files from the file picker in any way that their chosen platform allows (e.g. by holding down shift or control, and then clicking). if you only want the user to choose a single file per <input>, omit th...
... or mime types. some examples: accept="image/png" or accept=".png" — accepts png files. accept="image/png, image/jpeg" or accept=".png, .jpg, .jpeg" — accept png or jpeg files. accept="image/*" — accept any file with an image/* mime type. (many mobile devices also let the user take a picture with the camera when this is used.) accept=".doc,.docx,.xml,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document" — accept anything that smells like an ms word document. let's look at a more complete example: <form method="post" enctype="multipart/form-data"> <div> <label for="profile_pic">choose file to upload</label> <input type="file" id="profile_pic" name="profile_pic" accept=".jpg, .jpeg, .png"> </div> <div> <button>sub...
HTML attribute: rel - HTML: Hypertext Markup Language
Web › HTML › Attributes › rel
xternal resource not allowed not allowed next indicates that the current document is a part of a series, and that the next document in the series is the referenced document. link link link nofollow indicates that the current document's original author or publisher does not endorse the referenced document. not allowed annotation annotation noopener creates a top-level browsing context that is not an auxiliary browsing context if the hyperlink would create either of those to begin with (i.e., has an appropriate target attribute value). not allowed annotation annotation noreferrer no referer header will be included. additionally, has the same effect as noopener. not allowed annotation annotation ope...
...ment will be fetched next, and treat it as a resource hint. nofollow relevant to <form>, <a>, and <area>, the nofollow keyword tells search engine spiders to ignore the link relationship. the nofollow relationship may indicate the current document's owner does not endorse the referenced document. it is often included by search engine optimizers pretending their link farms are not spam pages. noopener relevant to <form>, <a>, and <area>, creates a top-level browsing context that is not an auxiliary browsing context if the hyperlink would create either of those to begin with (i.e., has an appropriate target attribute value). in other words, it makes the link behave as if window.opener were null and target="_parent" were set. this is the opposite of opener. noreferrer relevant to <form>,...
...ing context if the hyperlink would create either of those to begin with (i.e., has an appropriate target attribute value). in other words, it makes the link behave as if window.opener were null and target="_parent" were set. this is the opposite of opener. noreferrer relevant to <form>, <a>, and <area>, including this value makes the referrer unknown (no referer header will be included), and opens the creates a top-level browsing context, as if noopener were also set. opener creates an auxiliary browsing context if the hyperlink would otherwise create a top-level browsing context that is not anauxiliary browsing context (i.e., has "_blank" as target attribute value). effectively, the opposite of noopener. pingback gives the address of the pingback server that handles pingbacks to the ...
...onym previous is incorrect and should not be used. search relevant to <form>, <link>, <a>, and <area> elements, the search keywords indicates that the hyperlink references a document whose interface is specially designed for searching in the current document, site, and related resources, providing a link to a resource that can be used to search. if the type attribute is set to application/opensearchdescription+xml the resource is an opensearch plugin that can be easily added to the interface of some browsers like firefox or internet explorer. stylesheet valid for the <link> element, it imports an external resource to be used as a stylesheet. the type attribute is not needed as it's a text/css stylesheet, as that is the default value. if it's not a stylesheet of type text/css it i...
<iframe>: The Inline Frame element - HTML: Hypertext Markup Language
Web › HTML › Element › iframe
(this is the default value). lazy: defer loading of the iframe until it reaches a calculated distance from the viewport, as defined by the browser. name a targetable name for the embedded browsing context. this can be used in the target attribute of the <a>, <form>, or <base> elements; the formtarget attribute of the <input> or <button> elements; or the windowname parameter in the window.open() method. referrerpolicy indicates which referrer to send when fetching the frame's resource: no-referrer: the referer header will not be sent. no-referrer-when-downgrade (default): the referer header will not be sent to origins without tls (https). origin: the sent referrer will be limited to the origin of the referring page: its scheme, host, and port. origin-when-cross-origin: the ...
...tions, or space-separated tokens to lift particular restrictions: allow-downloads-without-user-activation : allows for downloads to occur without a gesture from the user. allow-downloads : allows for downloads to occur with a gesture from the user. allow-forms: allows the resource to submit forms. if this keyword is not used, form submission is blocked. ...
...or downloads to occur with a gesture from the user. allow-forms: allows the resource to submit forms. if this keyword is not used, form submission is blocked. allow-modals: lets the resource open modal windows. allow-orientation-lock: lets the resource lock the screen orientation. allow-pointer-lock: lets the resource use the pointer lock api. allow-popups: allows popups (such as window.open(), target="_blank", or showmodaldialog()). if this keyword is not used, the popup will silently fail to open. allow-popups-to-escape-sandbox: lets the sandboxed document open new windows without those windows inheriting the sandboxing. for example, this can safely sandbox an advertisement without forcing the same restrictions upon the page the ad links to. allow-same-origin: if this token is ...
... when the embedded document has the same origin as the embedding page, it is strongly discouraged to use both allow-scripts and allow-same-origin, as that lets the embedded document remove the sandbox attribute — making it no more secure than not using the sandbox attribute at all. sandboxing is useless if the attacker can display content outside a sandboxed iframe — such as if the viewer opens the frame in a new tab. such content should be also served from a separate origin to limit potential damage. the sandbox attribute is unsupported in internet explorer 9 and earlier. src the url of the page to embed. use a value of about:blank to embed an empty page that conforms to the same-origin policy. also note that programatically removing an <iframe>'s src attribute (e.g. via ele...
Common MIME types - HTTP
ows os/2 bitmap graphics image/bmp .bz bzip archive application/x-bzip .bz2 bzip2 archive application/x-bzip2 .csh c-shell script application/x-csh .css cascading style sheets (css) text/css .csv comma-separated values (csv) text/csv .doc microsoft word application/msword .docx microsoft word (openxml) application/vnd.openxmlformats-officedocument.wordprocessingml.document .eot ms embedded opentype fonts application/vnd.ms-fontobject .epub electronic publication (epub) application/epub+zip .gz gzip compressed archive application/gzip .gif graphics interchange format (gif) image/gif .htm .html hypertext markup lan...
...on/json .jsonld json-ld format application/ld+json .mid .midi musical instrument digital interface (midi) audio/midi audio/x-midi .mjs javascript module text/javascript .mp3 mp3 audio audio/mpeg .mpeg mpeg video video/mpeg .mpkg apple installer package application/vnd.apple.installer+xml .odp opendocument presentation document application/vnd.oasis.opendocument.presentation .ods opendocument spreadsheet document application/vnd.oasis.opendocument.spreadsheet .odt opendocument text document application/vnd.oasis.opendocument.text .oga ogg audio audio/ogg .ogv ogg video video/ogg .ogx ogg application/ogg .
...oasis.opendocument.presentation .ods opendocument spreadsheet document application/vnd.oasis.opendocument.spreadsheet .odt opendocument text document application/vnd.oasis.opendocument.text .oga ogg audio audio/ogg .ogv ogg video video/ogg .ogx ogg application/ogg .opus opus audio audio/opus .otf opentype font font/otf .png portable network graphics image/png .pdf adobe portable document format (pdf) application/pdf .php hypertext preprocessor (personal home page) application/x-httpd-php .ppt microsoft powerpoint application/vnd.ms-powerpoint .pptx microsoft powerpoint (openxml) application/vnd.openxmlformats-officed...
...sport stream video/mp2t .ttf truetype font font/ttf .txt text, (generally ascii or iso 8859-n) text/plain .vsd microsoft visio application/vnd.visio .wav waveform audio format audio/wav .weba webm audio audio/webm .webm webm video video/webm .webp webp image image/webp .woff web open font format (woff) font/woff .woff2 web open font format (woff) font/woff2 .xhtml xhtml application/xhtml+xml .xls microsoft excel application/vnd.ms-excel .xlsx microsoft excel (openxml) application/vnd.openxmlformats-officedocument.spreadsheetml.sheet .xml xml application/xml if not readable from casual users (rfc 302...
Making PWAs work offline with Service workers - Progressive web apps (PWAs)
t, both arrays are merged using the array.prototype.concat() function. var gamesimages = []; for(var i=0; i<games.length; i++) { gamesimages.push('data/img/'+games[i].slug+'.jpg'); } var contenttocache = appshellfiles.concat(gamesimages); then we can manage the install event itself: self.addeventlistener('install', (e) => { console.log('[service worker] install'); e.waituntil( caches.open(cachename).then((cache) => { console.log('[service worker] caching all: app shell and content'); return cache.addall(contenttocache); }) ); }); there are two things that need an explanation here: what extendableevent.waituntil does, and what the caches object is. the service worker does not install until the code inside waituntil is executed. it returns a promise — this ...
...e waituntil is executed. it returns a promise — this approach is needed because installing may take some time, so we have to wait for it to finish. caches is a special cachestorage object available in the scope of the given service worker to enable saving data — saving to web storage won't work, because web storage is synchronous. with service workers, we use the cache api instead. here, we open a cache with a given name, then add all the files our app uses to the cache, so they are available next time it loads (identified by request url). activation there is also an activate event, which is used in the same way as install. this event is usually used to delete any files that are no longer necessary and clean up after the app in general. we don't need to do that in our app, so we'll ski...
...e. we do this whether the app is online or offline. if the file is not in the cache, the app adds it there first before then serving it: self.addeventlistener('fetch', (e) => { e.respondwith( caches.match(e.request).then((r) => { console.log('[service worker] fetching resource: '+e.request.url); return r || fetch(e.request).then((response) => { return caches.open(cachename).then((cache) => { console.log('[service worker] caching new resource: '+e.request.url); cache.put(e.request, response.clone()); return response; }); }); }) ); }); here, we respond to the fetch event with a function that tries to find the resource in the cache and return the response if it's there. if not, we use another fetch request t...
...rker when a new version of the app containing new assets is available? the version number in the cache name is key to this: var cachename = 'js13kpwa-v1'; when this updates to v2, we can then add all of our files (including our new files) to a new cache: contenttocache.push('/pwa-examples/js13kpwa/icons/icon-32.png'); // ... self.addeventlistener('install', (e) => { e.waituntil( caches.open('js13kpwa-v2').then((cache) => { return cache.addall(contenttocache); }) ); }); a new service worker is installed in the background, and the previous one (v1) works correctly up until there are no pages using it — the new service worker is then activated and takes over management of the page from the old one. clearing the cache remember the activate event we skipped? it can be us...
SVG documentation index - SVG: Scalable Vector Graphics
Web › SVG › Index
es and gaps used to paint the outline of the shape; 204 stroke-dashoffset svg, svg attribute the stroke-dashoffset attribute is a presentation attribute defining an offset on the rendering of the associated dash array. 205 stroke-linecap svg, svg attribute the stroke-linecap attribute is a presentation attribute defining the shape to be used at the end of open subpaths when they are stroked. 206 stroke-linejoin reference, svg, svg attribute, stroke-linejoin the stroke-linejoin attribute is a presentation attribute defining the shape to be used at the corners of paths when they are stroked. 207 stroke-miterlimit svg, svg attribute the stroke-miterlimit attribute is a presentation attribute defining a limit on th...
...get svg, svg attribute the target attribute should be used when there are multiple possible targets for the ending resource, such as when the parent document is embedded within an html or xhtml document, or is viewed with a tabbed browser. this attribute specifies the name of the browsing context (e.g., a browser tab or an (x)html iframe or object element) into which a document is to be opened when the link is activated: 216 targetx filters, needsexample, svg, svg attribute the targetx attribute determines the positioning in horizontal direction of the convolution matrix relative to a given target pixel in the input image. the leftmost column of the matrix is column number zero. the value must be such that: 0 <= targetx < orderx. 217 targety filter...
... rdf primer notion of a property. 257 xlink:href needscompattable, svg, svg attribute the xlink:href attribute defines a reference to a resource as a reference iri. the exact meaning of that link depends on the context of each element using it. 258 xlink:show deprecated, svg, svg attribute the xlink:show attribute indicates how a linked resource should be opened and is meant for xlink-aware processors. in case of a conflict, the target attribute has priority, since it can express a wider range of values. 259 xlink:title deprecated, svg, svg attribute the xlink:title attribute is used to describe the meaning of a link or resource in a human-readable fashion. 260 xlink:type deprecated, svg, svg attribute the xlin...
...ference, svg, svg graphics the <polygon> element defines a closed shape consisting of a set of connected straight line segments. the last point is connected to the first point. 360 <polyline> element, reference, svg, svg graphics the <polyline> svg element is an svg basic shape that creates straight lines connecting several points. typically a polyline is used to create open shapes as the last point doesn't have to be connected to the first point. for closed shapes see the <polygon> element. 361 <radialgradient> element, svg, svg gradient the <radialgradient> element lets authors define radial gradients that can be applied to fill or stroke of graphical elements. 362 <rect> element, reference, svg, svg graphics the <rect> ele...
mimeTypes.rdf corruption - SVG: Scalable Vector Graphics
this page explains a problem that can cause svg to stop working in mozilla due to the way mozilla maps filename extensions to media types. symptoms previously you were able to open and display svg content with mozilla, but for no apparent reason its behaviour changes and now it always pops up the "open or save file" dialog when you try to open local svg files, and displays the "additional plugins are required to display all the media on this page" bar when you try to view html with embedded svg. note: the "additional plugins are required" bar can appear for legitimate reasons when the svg or its embedding html is broken or served incorrectly over the network (see the svg faq). if the blue square with the white cross displays when you load this scripting across embed demo, then you a...
...l plugins are required" bar can appear for legitimate reasons when the svg or its embedding html is broken or served incorrectly over the network (see the svg faq). if the blue square with the white cross displays when you load this scripting across embed demo, then you are not experiencing this problem. if it doesn't, then you almost certainly are. background mozilla decides if and how it can open files by using their media (mime) type. it obtains the media type for files in various ways. for files loaded over the network via http, it requires and uses the value assigned to the content-type http header. for files loaded locally, it first looks in a cache of filename extension to media type mappings (stored in a mozilla profile file called mimetypes.rdf), and if it doesn't find a media type...
...g the steps in the section below. if the new profile doesn't work, clean your os file associations, then your mimetypes.rdf. create and remove a bogus file association this solution should work for mimetypes.rdf corruption, and requires little technical knowledge. it's adapted from jp fiset's comment in bug 303581 which in turn was adapted from jeff schiller's comment in bug 303581. 1. try and open a local .svg file using mozilla and when the "opening ..." dialog comes up, select the "open with" radio button and choose any .exe except firefox.exe/mozilla.exe. 2. make sure the "do this automatically for files like this from now on" checkbox is checked. 3. click ok, and when the program you chose tries to open the file, just close it. 4. in firefox, go to tools > options... > downloads > view...
...5. select the svg entry, click the remove action button and then click close to close the download actions window. 6. try and load a local .svg file and this scripting across embed demo. if the files you attempt to load in step 6 work, then your problem was mimetypes.rdf corruption. ...
WebAssembly Concepts - WebAssembly
ate webassembly code to take advantage of it. webassembly modules can be imported into a web (or node.js) app, exposing webassembly functions for use via javascript. javascript frameworks could make use of webassembly to confer massive performance advantages and new features while still making functionality easily available to web developers. webassembly goals webassembly is being created as an open standard inside the w3c webassembly community group with the following goals: be fast, efficient, and portable — webassembly code can be executed at near-native speed across different platforms by taking advantage of common hardware capabilities. be readable and debuggable — webassembly is a low-level assembly language, but it does have a human-readable text format (the specification for ...
... the tooling and optimizations of emscripten. the emscripten tool is able to take just about any c/c++ source code and compile it into a .wasm module, plus the necessary javascript "glue" code for loading and running the module, and an html document to display the results of the code. in a nutshell, the process works as follows: emscripten first feeds the c/c++ into clang+llvm — a mature open-source c/c++ compiler toolchain, shipped as part of xcode on osx for example. emscripten transforms the compiled result of clang+llvm into a .wasm binary. by itself, webassembly cannot currently directly access the dom; it can only call javascript, passing in integer and floating point primitive data types. thus, to access any web api, webassembly needs to call out to javascript, which then mak...
...cess any web api, webassembly needs to call out to javascript, which then makes the web api call. emscripten therefore creates the html and javascript glue code needed to achieve this. note: there are future plans to allow webassembly to call web apis directly. the javascript glue code is not as simple as you might imagine. for a start, emscripten implements popular c/c++ libraries like sdl, opengl, openal, and parts of posix. these libraries are implemented in terms of web apis and thus each one requires some javascript glue code to connect webassembly to the underlying web api. so part of the glue code is implementing the functionality of each respective library used by the c/c++ code. the glue code also contains the logic for calling the above-mentioned webassembly javascript apis to ...
...embly to the underlying web api. so part of the glue code is implementing the functionality of each respective library used by the c/c++ code. the glue code also contains the logic for calling the above-mentioned webassembly javascript apis to fetch, load and run the .wasm file. the generated html document loads the javascript glue file and writes stdout to a <textarea>. if the application uses opengl, the html also contains a <canvas> element that is used as the rendering target. it’s very easy to modify the emscripten output and turn it into whatever web app you require. you can find full documentation on emscripten at emscripten.org, and a guide to implementing the toolchain and compiling your own c/c++ app across to wasm at compiling from c/c++ to webassembly. writing webassembly dir...
Reddit Example - Archive of obsolete content
to accomplish this the add-on needs to run a content script in the context of the reddit page which intercepts mouse clicks on each title link and fetches the link's target url. the content script then needs to send the url to the add-on script. ...
... this is the panel.js content script that intercepts link clicks: $(window).click(func...
... this is the panel.js content script that intercepts link clicks: $(window).click(function (event) { var t = event.target; // don't intercept the click if it isn't on a link. ...
io/text-streams - Archive of obsolete content
experimental provides streams for reading and writing text. function readtextfromfile(filename) { var fileio = require("sdk/io/file"); var text = null; if (fileio.exists(filename)) { var textreader = fileio.open(filename, "r"); if (!textreader.closed) { text = textreader.read(); textreader.close(); } } 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. you can also create textreader objects using io/file's open() function. ...
... charset : string inputstream is expected to be in the character encoding named by this value. ...
...eam is expected to be in the character encoding named by this value. if not specified, "utf-8" is assumed. see nsicharsetconvertermanager.idl for documentation on how to determine other valid values for this. textwriter(outputstream, charset) creates a buffered output stream that writes text to a backing stream using a given text encoding. you can also create textwriter objects using io/file's open() function. parameters outputstream : stream the backing stream, an nsioutputstream. it must already be opened. charset : string text will be written to outputstream using the character encoding named by this value. if not specified, "utf-8" is assumed. see nsicharsetconvertermanager.idl for documentation on how to determine other valid values for this. textreader methods close() closes ...
Displaying web content in an extension without security issues - Archive of obsolete content
s apply. in particular, a content document can only go up in the frame hierarchy until the topmost content document, it cannot access the chrome documents above it. this means for example that javascript code top.location.href = "about:blank" will only unload the content document but won’t have any effect on the chrome. note: this has really nothing to do with the source of the document. if you open "chrome://foo/content/foo.xul" in the browser, it will open as a content document despite having extended privileges. this also means that you won’t be able to establish a security boundary between your extension and untrusted data if your extension opens as a tab in the browser — so displaying your extension in a browser tab is a bad choice. note: dynamic changes of the "type" attribute have...
...r, content documents have no access to the chrome documents above them) and consequently no privileges. so in the simplest case you would have: <iframe type="content" src="data:text/html,%3chtml%3e%3cbody%3e%3c/body%3e%3c/html%3e"/> but usually you don’t want to start with an empty document, you would rather want to load some template into the frame: var request = new xmlhttprequest(); request.open("get", "chrome://foo/content/template.html", false); request.send(null); frame.setattribute("src", "data:text/html," + encodeuricomponent(request.responsetext)); that way you can have the template in your extension but still strip it off all privileges when it is loaded in a frame. restricting what documents that contain untrusted data can do there are several restrictions that can be applied pe...
...and scripts won’t run anyway when inserted via innerhtml, right? well, not quite. it is right that <script>alert('xss')</script> won’t run if inserted via innerhtml. but <img src="does_not_exist" ...
Adding Toolbars and Toolbar Buttons - Archive of obsolete content
add to firefox. now we'll look deeper into the details of toolbars so that you can make great toolbars. toolbar buttons there are several types of buttons and elements you can add to a toolbar depending on your needs. the toolbarbutton element has the type attribute that allows you to change the behavior of the button in many ways. the menu and menu-button types allow you to create buttons that open popup menus beneath them. see the back/forward buttons in the main firefox toolbar for an example. menu toolbar buttons are handy when you want to include many options in your toolbar and you don't want it to be too cluttered. the other types, checkbox and radio are useful when you have buttons that change state when the user clicks on them. read more about this in the type attribute specificatio...
...buttons a native look. you'll probably still need to override a couple other css rules to get a completely plain look. the customize toolbars dialog firefox has the option to customize its toolbars. we've already mentioned this before, and if you follow our recommendations, then you shouldn't have many problems making your toolbar compatible with the customize toolbars dialog. the dialog can be opened from view > toolbars > customize..., or by right-clicking on the main toolbar (or any toolbar with the correct context attribute value) and clicking on the customize option. other than what we have stated before, you should take into account the controls at the bottom of the customize toolbars dialog. you should test your toolbar buttons and items under all combinations of icons / icons and te...
...alog. you should test your toolbar buttons and items under all combinations of icons / icons and text / text, use small icons, and having your icons in different toolbars. you should also test that the reset to defaults button works correctly. adding elements to your toolbar that are not toolbarbutton or toolbaritem will cause it to fail. make sure your icons look ok while the customize dialog is open, and after clicking on the ok button. if you use xbl bindings, make sure everything works normally after customizing toolbars. all of this is very important to test because, when the dialog is opened, firefox changes the dom of the toolbar, adding wrapper elements that allow the customization. this tends to break very specific css, and xbl bindings lose their internal state when moved around the ...
Custom XUL Elements with XBL - Archive of obsolete content
event handlers. many complex elements such as tabs, buttons and input controls are implemented using xbl and simpler xul elements. as explained earlier, xul is really just boxes, text and images. we'll look into xbl using a modified version of the hello world extension. download the hello world xbl project, build it and test it for a while. you should see a new item in the hello world menu, that opens a binding test window where you can add "persons" to a list. xbl basics in order to create an xbl binding you'll need 2 files: the xbl file and a css file that binds an element name to your xbl declaration. if you look into the content directory, you'll see both files: person.xml - this is the main binding file. it holds all the code necessary to control the new element we created. we'll lo...
...order to create an xbl binding you'll need 2 files: the xbl file and a css file that binds an element name to your xbl declaration. if you look into the content directory, you'll see both files: person.xml - this is the main binding file. it holds all the code necessary to control the new element we created. we'll look into the code throughout the rest of this section. for now, just notice the opening part of the binding element: <binding id="person">. bindings.css - this is the file that associates the element name to the xbl file. it associates the xshelloperson element name to the binding defined in the xbl file. since you can have more than one binding per file, the "#person" part points to the id of the one we want. this css file is located in the content because it's not something we...
....appendchild(person); // ... }, this is where the advantage of xbl is obvious: we only need to create a single node and set some attributes. we didn't need to create a whole xul structure that would require around 7 nodes every time a "person" is created. xbl provides the encapsulation we needed to manage these nodes as a unit. as a bonus, you should look into the usage of nsifilepicker to open a "open file" dialog in a way that looks native for all systems. now let's look into the xbl file, person.xml. <bindings xmlns="http://www.mozilla.org/xbl" xmlns:xbl="http://www.mozilla.org/xbl" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> the bindings element is the root of the document, and it's a container for binding elements. notice how the default ...
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
building dom trees in most cases, dom trees should be built exclusively with dom creation methods. ...
... dynamic content. great care must be taken in these situations. under no circumstances should code resembling 'callback("' + str + '")' appear anywhere in your add-on. closures by far the best way to create dynamic event listeners is to use closures. the following two code fragments are roughly equivalent: function clickify(elem, address) { elem.addeventlistener("click", function (event) { openwindow(address) }, false); } function clickify(elem, address) { elem.onclick = function (event) { openwindow(address) }; } multiple attributes sometimes there is a need for event listeners to appear as attributes in the dom. in these cases, multiple attributes should be used, one for each variable: function clickify(elem, address) { elem.setattribute("href", address); elem.setattr...
... false); } function clickify(elem, address) { elem.onclick = function (event) { openwindow(address) }; } multiple attributes sometimes there is a need for event listeners to appear as attributes in the dom. in these cases, multiple attributes should be used, one for each variable: function clickify(elem, address) { elem.setattribute("href", address); elem.setattribute("onclick", "openwindow(this.getattribute('href'))"); } escaping functions when the code fragment in question is not an event handler attribute and there is no feasible way to pass the data through other means, they must be escaped with functions such as uneval, string.quote, json.stringify, or number. generating scripts in this matter is deprecated and should be avoided wherever possible, but is relatively safe...
Signing an XPI - Archive of obsolete content
u want a certificate that has a root ca installed in all major platforms (microsoft windows, sun java, mozilla/netscape firefox/navigator, opera) so you only use one certificate for signing all your software, no matter which platform it is for. the cheapest universally supported (mozilla, java, microsoft) certificate seems to be the comodo instant-ssl offering. ...
...they will then issue a signed certificate. ...
...ates used to sign your certificate from the issuer; their web site will have a link somewhere to their root cas and public certificates. (certum public key page). i downloaded the certum root ca and certum level iii ca digital id for web and ssl/tls servers, copied the text and saved them to the files c:\projects\codesigning\certum root ca.cer and c:\projects\codesigning\certum level iii ca.cer. open a command prompt (ensure the paths to the nss tools are set as described above) in the codesigning folder, install the issuer ca certificates, and check they have been added correctly. c:\projects\codesigning> certutil -a -n "certum root ca" -t "tc,tc,tc" -d . -i "certum root ca.cer" c:\projects\codesigning> certutil -a -n "certum level iii ca" -t "c,c,c" -d . -i "certum level iii ca.cer" c:\p...
Supporting search suggestions in search plugins - Archive of obsolete content
once the list has been retrieved, it's displayed in a popup box that appears under the search bar, which lets the user select a suggested search term. if the user continues to type, a new set of suggestions is requested from the search engine, and the displayed list is refreshed. implementing suggestion support in the search plugin to support search suggestions, a search plugin needs to define an extra <url> element with its type attribute set to "application/x-suggestions+json". ...
...ate="http://ff.search.yahoo.com/gossip?output=fxjson&command={searchterms}"/> if the user types "fir" into the search bar, then pauses, firefox inserts "fir" in place of {searchterms} and queries that url: <url type="application/x-suggestions+json" template="http://ff.search.yahoo.com/gossip?output=fxjson&command=fir"/> the results are used to construct the suggestion list box. see creating opensearch plugins for firefox to learn more about how to implement a search plugin. implementing search suggestion support on the server the majority of the work in handling search suggestions is actually implemented on the server side. if you're a web site designer, and want to support search suggestions, you need to implement support for returning the suggestions in javascript object notation (js...
...en suggestion, you can return an url to a map in this array. if you don't specify a query url, the default query is used based on the search described by the <url> element in the search plugin's xml description. query urls are not supported in firefox, and are ignored. this enhancement request - the handling of a selected suggestion, namely calling of a full specified url as proposed in the opensearch standard - is tracked in bug 386591. for example, if the search term is "fir", and you don't need to return descriptions or alternate query urls, you might return the following json: ["fir", ["firefox", "first choice", "mozilla firefox"]] note that in this example, only the query string and completion array are specified, leaving out the optional elements. your completion list can incl...
Bookmark Keywords - Archive of obsolete content
nct from regular bookmarks. laying the groundwork we're going to pick a relatively easy example to illustrate this process: a keymark that will let the user jump straight to a specific bugzilla entry by entering its number. the quickest way to start is to simply look up any random bug in the bugzilla system-- the actual number doesn't matter. see figure 1 for an example. to file this bookmark open the "bookmarks" menu in the browser and select "add bookmark," or by of use the keyboard equivalent (e.g., <tt>cmd-d</tt> on macintosh). this will add a bookmark of the current page to the list of bookmarks. you can also file the bookmark into a folder by using the "file bookmark..." menu option. to open the bookmark manager go to "bookmarks" menu and select the "manage bookmarks" option. this wi...
...e "bookmarks" menu in the browser and select "add bookmark," or by of use the keyboard equivalent (e.g., <tt>cmd-d</tt> on macintosh). this will add a bookmark of the current page to the list of bookmarks. you can also file the bookmark into a folder by using the "file bookmark..." menu option. to open the bookmark manager go to "bookmarks" menu and select the "manage bookmarks" option. this will open up the bookmark manager. ...
...the original title of the bookmark won't apply. you can name the bookmark whatever you want, but it's often handy to make the title very similar to the keyword you plan to use. ...
Embedding Mozilla in a Java Application using JavaXPCOM - Archive of obsolete content
or_iid); // get the window watcher service nsiwindowwatcher windowwatcher = (nsiwindowwatcher)servicemanager.getservicebycontractid("@mozilla.org/embedcomp/window-watcher;1", nsiwindowwatcher.ns_iwindowwatcher_iid); // set the window creator (from step 6) windowwatcher.setwindowcreator(windowcreator); // create the root xul window: nsidomwindow win = windowwatcher.openwindow(null, "chrome://your-app/content/window.xul", "mywindow", "chrome,resizable,centerscreen", null); // set this as the active window windowwatcher.setactivewindow(win); // hand over the application to xpcom/xul, this will block: appstartup.run(); here is an example of a locationprovider that works : public class locationprovider implements iappfilelocprovider {...
...m the above example, to create a new window, we would do the following: // first, get the event queue service. this handles all event queues in xpcom. nsieventqueueservice eventqueueservive = (nsieventqueueservice)servicemanager.getservicebycontractid("@mozilla.org/event-queue-service;1",nsieventqueueservice.ns_ieventqueueservice_iid); // next, we want to get the ui thread, since we want to open a window. there is a static variable on the // nsieventqueueservice that contains the id of the special ui event queue. nsieventqueue eventqueue = eventqueueservive.getspecialeventqueue(nsieventqueueservice.ui_thread_event_queue); // now create a proxy for the proxy object manager. nsiproxyobjectmanager proxy = (nsiproxyobjectmanager)componentmanager.createinstancebycontractid("@mozilla.org...
...l,nsiproxyobjectmanager.ns_iproxyobjectmanager_iid); // and use the proxy object manager to create a proxy for the nsiwindowwatcher instance we created above. ...
Code snippets - Archive of obsolete content
tabs from other computers this snippet shows how to load all tabs from other computers. components.utils.import("resource://services-sync/main.js"); // obtain a reference to the main firefox window. ...
...tabs from other computers this snippet shows how to load all tabs from other computers. components.utils.import("resource://services-sync/main.js"); // obtain a reference to the main firefox window. ...
... coll.recordhandler = function(item) { item.collection = collection; item.decrypt(); if (item.deleted) { deleted++; } else { items[item.type] = 1 + (items[item.type] || 0); } }; coll.get(); console.log("deleted: " + deleted + ", " + json.stringify(items)); get a log from xul fennec view about:sync-log. long-tap the log in question. choose "save link". open a mail client. click attach. choose "file manager" as the handler. navigate to "downloads", pick correct file. watch live sync logs set services.sync.log.appender.console to trace. bump meta/global's modified time components.utils.import("resource://services-sync/main.js"); components.utils.import("resource://services-sync/resource.js"); function getpath(path) { let r = new resource(weav...
New Security Model for Web Services - Archive of obsolete content
ript from a relatively-untrusted domain that must be granted access to other untrusted domains, without compromising internal domains. more-complex access lists could be created to try to establish, with finer granularity, which domains are to be accessible or permitted from which other domains, but this requires extensive management which at best is quite error-prone for the end user and easily opens holes in a firewall that do not directly hurt the user who reconfigured his browser to try to access some external service but hurts the owners of other services behind the firewall. signed scripts a certain degree of additional trust may be lent to a script by having the author digitally sign it. but signed scripts have not really caught on as they require certificates do not change the basic...
... to the resource, a dialog box may be raised to ask the user to grant special privileges. this is currently permitted for locally-saved scripts and signed scripts. this could be combined with the other options above such as whitelisting, signed scripts, etc. but the big problem with this is that the typical browser user really does not either understand or pay the consequences if he inadvertently opens a hole in his company's firewall. quite complex settings may be required to permit the user to allow access to desired external services without risking other resources. controlling resource access on the server access by untrusted scripts really needs to be under the control of the stake holder, which is the resource and server owner -- not the user -- to determine whether a resource should b...
...e. note: script access is checked via declaration file only if the script security manager denies access. summary advantages the proposed declaration file places the server operator, not the client in control of access to his server by untrusted scripts. the access hole is no bigger than the service in question. the access is disabled by default, and there is nothing the user needs to do to open access, and nothing that can go wrong to make a hole in his firewall. it seems fairly easy to drop an access file into the root directory of the web server to allow access. delegation with mixed ownership independent owners of subdirectories cannot grant web script access to these subdirectories without getting the owner of the root directory to post a delegating access file. normally a server ...
Remotely debugging Firefox for Metro - Archive of obsolete content
.debugger.remote-port (to change the tcp port number where firefox will listen for connections) devtools.debugger.prompt-connection = false (allow connections without displaying a confirmation prompt. this can be a security risk, especially if you also set the force-local preference to false.) set up firefox for desktop on the desktop, remote debugging is enabled by a setting in the toolbox. open the toolbox, click the "settings" button in the toolbar, and check "enable remote debugging" in the settings tab. if you're using a version of firefox older than 27, you'll need to restart the browser for the setting to take effect. connecting on the desktop on the desktop, open the web developer menu and select "connect...". you'll see a page that looks like this: if you are running fire...
...ut, flip to the desktop via the desktop tile and check if windows firewall has thrown up an incoming connection permissions prompt. on the desktop next, the desktop shows you a dialog that looks something like this: this is asking whether you want to debug web content running in a browser tab, or to debug the browser code itself. you'll see one entry under "available remote tabs" for each open tab, and clicking it will attach the debugging tools to the web content hosted by that tab. if you want to debug your web content, you'll choose the relevant content tab. you'll see one entry under "available remote processes": this is the browser process itself. you'll choose this option if you want to debug the browser's own code. let's choose to attach to the mozilla.org website. the toolbo...
...nd clicking it will attach the debugging tools to the web content hosted by that tab. if you want to debug your web content, you'll choose the relevant content tab. you'll see one entry under "available remote processes": this is the browser process itself. you'll choose this option if you want to debug the browser's own code. let's choose to attach to the mozilla.org website. the toolbox will open in its own window, attached to the firefox for metro tab that's currently hosting mozilla.org: the toolbox, and the tools it hosts (including the console, debugger, style editor, profiler, etc.), work in just the same way as they do when attached to local content. ...
Creating XPI Installer Modules - Archive of obsolete content
e they are installed. package creation overview this tutorial describes the following sequence of steps for creating a new package: developing the resources organizing the resources creating the contents.rdf file making the barley install script creating a xpi you can examine (or install!) the package described here by downloading the barley xpi file and using a zip unarchiver[zip] to open it. all of the resources described in this article are in the xpi archive and can be adapted for use in your own development. developing the resources needless to say, one of the first things you will have to create is the actual software you wish to make redistributable. the barley package ui is a single xul window with an accompanying image: <?xml version="1.0"?> <?xml-stylesheet href="chrome:/...
...n's basic widget styles. the javascript file barley.js contains a single function, bar(), defined as follows: function bar() { alert("aphids"); } if you want to use the same gif image that is used in the barley package, it can be grabbed from here. while you are developing these resources and before you have made them a package of their own, you can test the basic layout and functionality by opening barley.xul from within mozilla by using file -> open. though mozilla will not display the file as a separate window (much less interpret it as a separate package), you ought to be able to see the image and the javascript function working as defined in barley.js (provided that both all three files are in the same working directory). organizing the resources now that you have created the basic f...
...o be valid and installable, it must contain an installation script like the one above that tells mozilla xpinstall where to put the new resources and how to register them. to create a xpi, use your zip archiver[zip] again to archive the jar file and the installation script install.js. the archive, named barley.xpi, should contain the following two files: barley.jar install.js this zip file, when opened from mozilla using file -> open, will initialize its own installation and display a message like the following: when you click ok, mozilla installs the new package. exit mozilla and restart it with mozilla -chrome chrome://barley/content and the new package displays. the resources are installed in the mozilla/bin/chrome/ directory, and the xpi itself can be redistributed for installation on o...
command - Archive of obsolete content
« xul reference home command type: id set to the id of a command element that is being observed by the element. ...
... « xul reference home command type: id set to the id of a command element that is being observed by the element. ...
... « xul reference home command type: id set to the id of a command element that is being observed by the element. ...
Uploading and Downloading Files - Archive of obsolete content
the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes). there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. the io object and stream objects can be used to upload files to servers in various ways. the exact method depends on the type of upload that you wish to perform. http file upload some web sites allow one to upload a file. this is done by using an html <input> element using the file type from within ...
...type multipart/form-data that existing servers can process. to add a file field to the data you use a file object that an extension can construct from file path. the formdata object can then simply be passed to xmlhttprequest: function upload(posturl, fieldname, filepath) { var formdata = new formdata(); formdata.append(fieldname, new file(filepath)); var req = new xmlhttprequest(); req.open("post", posturl); req.onload = function(event) { alert(event.target.responsetext); }; req.send(formdata); } http put you can also upload a file using an http put operation. this is simpler but it doesn't allow sending additional data and web servers usually need special configuration to support put operations. function uploadput(posturl, filepath) { var req = new xmlhttprequest(); req...
..."post", posturl); req.onload = function(event) { alert(event.target.responsetext); }; req.send(formdata); } http put you can also upload a file using an http put operation. this is simpler but it doesn't allow sending additional data and web servers usually need special configuration to support put operations. function uploadput(posturl, filepath) { var req = new xmlhttprequest(); req.open("put", posturl); req.setrequestheader("content-type", "text/plain"); req.onload = function(event) { alert(event.target.responsetext); } req.send(new file(filepath)); } in this example, a new input stream is created for a file, and is passed to the xmlhttprequest's send method. fetch upload please refer to uploading a file section inside the fetch article. downloading files under const...
findbar - Archive of obsolete content
r setting the findbar's browserid attribute to the id of the browser element before the findbar element is bound, or by setting the findbar's browser property to the browser element itself. attributes browserid, findnextaccesskey, findpreviousaccesskey, highlightaccesskey, matchcaseaccesskey properties browser, findmode methods close, onfindagaincommand, open, startfind, togglehighlight example <browser type="content-primary" flex="1" id="content" src="about:blank"/> <findbar id="findtoolbar" browserid="content"/> attributes browserid type: string the id of the browser element to which the findbar is attached. this attribute is only used when the findbar is constructed. you should use the browser property to get and set this value from a...
... normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata close() return type: no return value closes the notification or findbar and removes it from its enclosing notificationbox or findbar. open( mode ) return type: no return value opens the findbar using the specified mode, which should be one of find_normal, find_typeahead, or find_links. if you don't pass a mode, the last-used mode for the same findbar is used. if the findbar hasn't been used before, find_normal is the default. onfindagaincommand( findprevious ) return type: no return value call this method to handle your applicat...
...ault. onfindagaincommand( findprevious ) return type: no return value call this method to handle your application's "find next" and "find previous" commands. you should specify true as the input parameter to perform a "find previous" operation, or false to perform a "find next." startfind( mode ) return type: no return value call this method to handle your application's "find" command. this opens the findbar, focuses the edit field for the search term, and selects its contents. the first time this is called for a given findbar, the findbar will flash to draw attention to itself. the mode should be one of find_normal, find_typeahead, or find_links. if you don't pass a mode, the last-used mode for the same findbar is used. if the findbar hasn't been used before, find_normal is the defa...
MenuModification - Archive of obsolete content
appenditem not working in tb 52.7.0. workaround: add menupopup to menu. then add menuitem to menupopup (all with appendchild to their parentelement). also, need replace newmenu.label= "new" by newmenu.setattribute("label", "new"); (all when creating from bootstrap.js in a bootstrapped addon) the addsubmenu function is called during the popupshowing event, which will be fired when an attempt to open the menu is made. this function retrieves a reference to the popup with the id 'file-popup'. a new element is created using the createelement method. the createelement method takes one argument, the tag of the element to create. this menu is created and appended to the popup. the label is set appropriately, and now, as we have a menu, we can use the appenditem method to append two items to the su...
...ements, and is used to add new nodes within another node. the appenditem method is specific to menus, as well as some other specific elements, and is simpler to use to append new menuitem elements to a menu. if we were to use the example above, we would also want to make sure to remove the items again in a popuphiding event listener. otherwise, a new submenu would be added every time the menu is opened, which is clearly not desirable. another possibility is to ensure that the menu is only added once. the following shows how the addsubmenu function above might be rewritten to handle this case. <script> function addsubmenu() { var popup = document.getelementbyid("file-popup"); if (popup.haschildnodes()) return; var newmenu = document.createelement("menu"); popup.appendchild(newmen...
...he haschildnodes method will return false, however the second time, the method will return true as the items have already been added to the menu. removing items from a menu to remove an item from the menu, use the removeitemat method. it takes a single argument, the index of the item to remove. in this example, an item is appended to a menu, and then immediately removed again. menu.appenditem("open", ""); menu.removeitemat(menu.itemcount - 1); the itemcount property holds the number of items within the menu. to remove all of the items from a menu, you may wish to simply remove the menupopup directly, instead of removing each item individually. ...
PopupKeys - Archive of obsolete content
igated with the cursor keys. the following table lists the keys that are checked, and what the menu keyboard listener does in response: cursor up/down move the highlight within the menu up or down, wrapping around if necessary. on linux and the macintosh, disabled items within the menu are skipped over when navigating with the cursor keys. cursor left/right when a menu is selected, cursor right opens the menu, while a cursor left closes a menu. in a menubar, cursor left and right will cycle between top level menus. home/end move the highlight to the beginning or the end of the menu, selecting the first or last item. enter/return activate the currently highlighted item. if a menuitem is selected, this will close the menu and fire the menuitem's command event. if a menu is selected, the menu w...
...e menu, while a cursor left closes a menu. in a menubar, cursor left and right will cycle between top level menus. home/end move the highlight to the beginning or the end of the menu, selecting the first or last item. enter/return activate the currently highlighted item. if a menuitem is selected, this will close the menu and fire the menuitem's command event. if a menu is selected, the menu will open. escape closes the menu. if a chain of submenus is open, only one level of menus is closed. tab/f10 closes all menus in a chain of submenus. when letter keys are pressed, the accesskeys within the menu are selected. if an access key is a pressed that does not correspond to an item within the menu, items that don't have access keys can be selected if the key pressed corresponds to the first lette...
...stener to the document or window if you want to listen for keys pressed within a menu. note that the last argument here is true to listen for events during the capturing phase of event propagation: window.addeventlistener("keypress", someaction, true); however, the default listener provides all the suitable responses to keys, so there shouldn't be a need to handle keys yourself. while a menu is open, the focus remains where it was before the menu was open. for example, focusing a textbox and opening the textbox's context menu keeps the focus within the textbox. however, the capturing listener ensures that no key events reach the textbox while the menu is open. unlike with a menu, when a panel is opened, the focus is removed from any element that has it. this allows the focus to be shifted to...
The Joy of XUL - Archive of obsolete content
tware developers who intend to add features to mozilla that they wish to keep proprietary. the netscape public license (npl) and mozilla public license (mpl) require developers who alter original work (source code files that are provided with mozilla) to release the source code for these changes to their customers. overlays can be used to add features to mozilla without contaminating the original open source code with proprietary alterations. xpcom/xpconnect xpcom and xpconnect are complementary technologies that enable the integration of external libraries with xul applications. xpcom, which stands for cross platform component object model, is a framework for writing cross-platform, modular software. xpcom components can be written in c, c++, and javascript, and they can b...
...mpose views for the weeks, days, and months. the initial implementation of calendar did not exploit xbl because the developers involved were not experienced with this complementary technology. but future plans for the calendar include converting many of these ui components to xbl widgets to further simplify their implementation. xpcom/xpconnect enables integration of native code.a fully-featured open source calendar library, libical, was harvested for the calendar project. libical is an open source implementation of the ietf's icalendar calendaring and scheduling protocols (rfc 2445, rfc 2446, and rfc 2447). it parses ical components and provides a c api for manipulating the component properties, parameters, and subcomponents. the library was initially integrated by writing an xpcom wrapper t...
...rd for delivering applications to users across disparate desktops, this problem was solved with cross-platform client-server tools. but these offerings were invariably proprietary, cost a substantial amount of money per developer, and had runtime license fees that kept you humble and tightly tethered to the vendor. mozilla delivers much of the same value as these cross platform tools, but with an open source license. as a rapidly maturing cross-platform technology, xul could fill an interesting void for technologies such as java j2ee and microsoft .net which focus on enabling network access to distributed objects. dynamic application logic can benefit significantly from a ui presentation layer that is standards-based, scriptable, extensible, and similarly distributable over the internet. xul...
Adding Labels and Images - Archive of obsolete content
ve label beside a control, such as a button. an example is shown below: example 1 : source view <label value="this is some text"/> the value attribute can be used to specify the text that you wish to have displayed. the text will not wrap, so the text will all be displayed on a single line. this syntax is the most common of labels. if the text needs to wrap, you can place the text content inside opening and closing tags as in the following example: example 2 : <label>this is some longer text that will wrap onto several lines.</label> as with html, line breaks and extra whitespace are collapsed into a single space. later, we'll find out how to constrain the width of elements so that we can see the wrapping more easily. control attribute you can use the control attribute to set which control t...
...set which control the label is associated with. when the user clicks on an associated label, that control will be focused. this association is also important for accessibility, so that screen readers read aloud the label for the control as the user tabs to it. set the value of the control attribute to the id of the element to be focused. example 3 : source view <label value="click here:" control="open-button"/> <button id="open-button" label="open"/> in the example above, clicking the label will cause the button to be focused. description element for descriptive text not associated with any particular control, you can use the description tag. this element is useful for informative text at the top of a dialog or a group of controls for example. as with the label element, you can either use the...
...g the label will cause the button to be focused. description element for descriptive text not associated with any particular control, you can use the description tag. this element is useful for informative text at the top of a dialog or a group of controls for example. as with the label element, you can either use the value attribute for a single line of text or place text or xhtml content inside opening and closing description tags for longer blocks of text. it is more common to use the attribute syntax for labels, and the text content syntax for descriptions. example 4 : source view <description> this longer section of text is displayed. </description> you can set the text via script using the textcontent property, as in the following example: <description id="text" width="200"/> documen...
More Menu Features - Archive of obsolete content
we'll just add a few simple commands to a file menu and an edit menu. this is similar to the example above. <toolbox> <menubar id="findfiles-menubar"> <men...
... </menupopup> </menu> </menubar> </toolbox> adding a menu to our find files example let's add a menu to the find files dialog. we'll just add a few simple commands to a file menu and an edit menu. this is similar to the example above. ...
... <menupopup id="edit-popup"> <menuitem label="cut" accesskey="t"/> <menuitem label="copy" accesskey="c"/> <menuitem label="paste" accesskey="p" disabled="true"/> </menupopup> </menu> </menubar> <toolbar id="findfiles-toolbar> here we have added two menus with various commands on them. notice how the menu bar was added inside the toolbox. the three dots after open search and save search are the usual way that you indicate to the user that a dialog will open when selecting the command. access keys have been added for each menu and menu item. you will see in the image that this letter has been underlined in the menu label. also, the paste command has been disabled. we'll assume that there's nothing to paste. our find files example so far : source view add...
The Chrome URL - Archive of obsolete content
or 'locale' depending on which part you want. <file.xul> is simply the filename. example: chrome://messenger/content/messenger.xul the example here refers to the messenger window. you could point to a file that is part of a skin by replacing 'content' with 'skin' and changing the filename. similarly, you can point to a file that is part of a locale by using 'locale' instead of 'content'. when you open a chrome url, mozilla looks through its list of installed packages and tries to locate the jar file or directory that matches the package name and part. the mapping between chrome urls and jar files are specified in the manifest files stored in the chrome directory. if you were to move the file messenger.jar somewhere else and update the manifest file accordingly, thunderbird will still work sinc...
... used. you can even enter them directly into the url bar in a firefox browser window. if you enter the url mentioned above into the browser's address bar, you should see that window appear like a web page might do and for the most part will function as if it was a separate window. some dialog boxes may not work right, however, as they may be expecting arguments to be supplied from the window that opened them. you will also see chrome urls without specified filenames, such as: chrome://browser/content/ in this case, only the package name and part is specified. this type of reference will automatically select an appropriate file from that right directory. for content, a file with the same name of the package and a xul extension is selected. in the above example, the file browser.xul is selected...
...kage and a xul extension is selected. in the above example, the file browser.xul is selected. for messenger, messenger.xul would be selected. when creating your own applications, you will want to create a file for your main window with the same name as the package, so it can be referred to using this shorter form. this is convenient since all a user needs to know is the package name to be able to open the application. of course, for extensions that modify the browser interface, the user will not need to know the url, as the extension will present itself in the ui. for a skin, the file <package name>.css is selected; for a locale, the file <package name>.dtd is selected. remember, the chrome url is not related to where it is located on disk. the first two pieces of the chrome url are the packag...
XUL accessibility guidelines - Archive of obsolete content
a's accesskey faq. a short reference for using the accesskey attribute. context menus the context menu is the small menu activated with a right mouse click on a content area or element (or with shift + f10 or vk_apps on windows and ctrl + click or ctrl + space on a mac). use the oncontextmenu event handler or the context attribute to create context menus. do not specifically code them to open on a click of the right mouse button. the oncontextmenu event and context attribute work with the correct platform-specific context menu triggers, including the keyboard button and appropriate mouse clicks. mouse dependent scripting functionality associated with mouse events such as onmouseover, onmousemove, and ondrag can only be activated with the use of the mouse. provide keyboard-accessible...
...that jumps the user to the second form field once 3 digits have been entered into the first form field. this behavior is then repeated for the next form field. users who are used to navigating form fields themselves often end up repeating the jump operation and thereby skipping ahead one form field. initial dialog focus the initial focus in a xul dialog (i.e., the focus when the dialog is first opened) should always be on a specific control, not on the dialog itself. in a tabbed dialog, focus should normally start on the first control in the selected tab. in all other dialogs, focus should just start on the first control (although it can be on any other control if there is a good reason for, just not on the dialog itself). testing keyboard access to test keyboard accessibility, simply unpl...
...g" alt="" /> <!-- in html the alt attribute is required. --> <toolbarbutton label="stop" image="stop.png" tooltiptext="stop loading the page" /> title provide unique titles to window container elements such as windows, wizards, and dialogs. titles provide users the most basic information about the application. the title is often the first thing spoken by a screen reader when an application is opened or activated. users can also refer back to the title to get a sense of where they are located. titles are displayed in the top bar of an application. view code examples below. <dialog id="print_dialog" title="print" ...> <window id="mywindow" title="my application" ...> <wizard id="reg_window" title="register your software" ...> form labels labels are not auto...
toolbar - Archive of obsolete content
ve an id attribute. note: gecko 2.0 adds support for external toolbars. these are toolbars that are not children of a toolbox element. you can associate an external toolbar with a toolbox for the purpose of managing your toolbars by setting the toolboxid property on the toolbar. the chromeclass-toolbar class may be used to create a toolbar where its visibility depends on the toolbar flag when opening the window with the window interface's open() method loads the specified resource into the browsing context (window, <iframe> or tab) with the specified name. if the name doesn't exist, then a new window is opened and the specified resource is loaded into its browsing context.">window.open() method. more information is available in the xul tutorial. note: starting in gecko 1.9.1, toolbar it...
...otherwise, this option will be ignored for this toolbar and it will always be visible. related elements toolbarbutton, toolbargrippy, toolbaritem, toolbarpalette, toolbarseparator, toolbarset, toolbarspacer, toolbarspring, toolbox interfaces nsiaccessibleprovider ...
...otherwise, this option will be ignored for this toolbar and it will always be visible. related elements toolbarbutton, toolbargrippy, toolbaritem, toolbarpalette, toolbarseparator, toolbarset, toolbarspacer, toolbarspring, toolbox interfaces nsiaccessibleprovider ...
MacFAQ - Archive of obsolete content
lrunner build, you should copy or symlink the dist/xul.framework directory to /library/frameworks. ...
...u can open it. to do this, type: xulrunner-bin --install-app /path/to/appdir note the path to your application must end with the directory containing application.ini; you should not reference application.ini in this command. this command will place a copy of your application in /applications/(vendor)/(name) , where (vendor) is the vendor field in your application.ini and (name) is the name field. opening your application for ordinary work, you can just navigate via finder to /applications/(vendor)/(name).app and open the application. for command-line work, you would call on: /applications/(vendor)/(name).app/contents/macos/xulrunner ui notes menus to enable your application quit command to work with the application menu (the one to the right of the blue apple), you need to give your quit men...
...rt commandline handlers work great on the mac if it's a cold start. here's how to implement command-line trapping when the app is already running, without getting into appleevents or c++ code. this is implemented in a pseudo "hidden window" technique and parsing the window arguments instead of command-line handlers and some of the toolkit singleton window code. ...
toolkit.defaultChromeFeatures - Archive of obsolete content
...
... ...
... ...
Archived Mozilla and build documentation - Archive of obsolete content
r <head> elements. generators can also be independently downloaded and installed by users if they include a list of pages to which they apply. creating a mozilla extension a mozilla extension is an installable enhancement to the mozilla browser that provides additional functionality (for example linky, which adds an item to the context menu for opening multiple links in a document or selection). this tutorial walks you through the process of building a mozilla extension that adds an icon to mozilla's status bar showing the current status of the mozilla source code (i.e. whether or not the latest version of the code is compiling successfully and passing tests). the extension will access tinderbox, mozilla.org's webtool for t...
...com component, which allows java code to interact with xpcom objects. as you will see in this article, working with xpcom objects in java is not that much different than doing so in c++. error console the error console is a tool available in most mozilla-based applications that is used for reporting errors in the application chrome and in web pages user opens. it reports javascript-related errors and warnings, css errors and arbitrary messages from chrome code. in firefox, the error console can be opened from the tools menu or by ctrl-shift-j. exception logging in javascript technical review completed. existing content this is a list of existing mozilla.org documentation. it needs to be chec...
... mozprocess mozprocess provides python process management via an operating system and platform transparent interface to mozilla platforms of interest. mozprocess aims to provide the ability to robustly terminate a process (by timeout or otherwise), along with any child processes, on windows, os x, and linux. mozprocess utilizes and extends subprocess.popen to these ends. nanojit nanojit is a small, cross-platform c++ library that emits machine code. both the tamarin jit and the spidermonkey jit (a.k.a. tracemonkey) use nanojit as their back end. new skin notes devmo has a new skin that is ready for testing. if you go to your user preferences, you can change the skin to "devmo". this is currently just a previ...
Extentsions FAQ - Archive of obsolete content
s what you want attached to one of the comments in this bug. how to get the value of a text box when a button is clicked? read http://developer.mozilla.org/en/docs/extension_faq and check if there are any errors in js console. friday, september 29 - october 6, 2006 (↑ top) is there anyway, via plugin or extension, for firefox to mimic the functionality of ie in this respect? the ietab (opens ie in a firefox tab) should be able do this if you set it to always open "file://*" urls in an ie tab. the appearance with a firefox tab isn't quite the same as having a completely separate explorer window. however, it's functional and does allow for the explorer to be handling the display of the folder contents, and all of the right-click context menu support is present so it should meet my nee...
...handling the display of the folder contents, and all of the right-click context menu support is present so it should meet my needs. what is the valid location and things needed to to release a mozilla extension on mozallia site? you must remove updateurl from the install.rdf and use a known to amo minversion/maxversion. no confirmation that the answer given worked yet. is it possible to open the url in a new tab? var tab = gbrowser.addtab( url ); // and if you want it to load in the foreground: gbrowser.selectedtab = tab; is it possible to read the html-code of the current url/site? yes, this is possible. use the dom api (http://www.w3schools.com/dom/default.asp has a good tutorial). not the best answer but a good starting point for the question asker to do some research toward...
...g/en/docs...pcom_component would anyone be able to suggest the best way to do source level debugging in a firefox extension? in the debug menu, uncheck exclude browser files. use the debugger by typing in a command like this: /break chrome://myextension/content/myfile.js 123 then i suggest using flat chrome. if you turn off the xul cache you don't even need to restart to see changes, simply open a new window. how can i backup some of the files before upgrade an extension and put them back afterward? do i need to write an installation script to achieve this? you shouldn't store data there, so there's nothing to backup. do not store files within the extension directory. the profile directory is ment to do so. storing files within the extension directory is a no-no because it might ...
Using SSH to connect to CVS - Archive of obsolete content
mozilla.org. anonymous/read-only access via ssh is not available at this time. please see our source code page for directions accessing read-only cvs, and our getting write access page for directions on obtaining write access. generating an ssh key first, install ssh. most linux, bsd, and osx distributions come with it installed already. cygwin makes ssh available on windows if you install the openssh package from the net category. if all else fails, openssh is a widely used and highly portable implementation. the following command should generate a suitable key pair: ssh-keygen -t dsa this will take a moment, followed by a prompt for a passphrase. once you have entered a passphrase, ssh-keygen will create two files, ~/.ssh/id_dsa and ~/.ssh/id_dsa.pub do not sendid_dsa. do file a...
...ectory in your tree. this can be done using a unix-style find and perl: find . -name root -exec perl -p -i -e "s/pserver/ext/" {} \; dealing with firewalls do not attempt to perform the steps in this section unless you have first verified that you can access cvs.mozilla.org from outside of the firewall. only proceed with these steps once you are certain you can access cvs.mozilla.org from the open internet. if you are behind a firewall with an http tunneling proxy, you can use a program called corkscrew, in combination with the proxycommand ssh config directive to continue to access the mozilla cvs server. this technique was taken from eric engstrom's site, but the instructions have been re-written specifically for mozilla. download, build, and install corkscrew by following the instru...
...d ssh config directive to continue to access the mozilla cvs server. this technique was taken from eric engstrom's site, but the instructions have been re-written specifically for mozilla. download, build, and install corkscrew by following the instructions in the install file in the corkscrew source distribution. corkscrew uses the standard "./configure; make install" technique common to many open source projects. make sure you have a ~/.ssh/config file that has at least the following directives preferredauthentications hostbased,publickey,password host cvs.mozilla.org proxycommand corkscrew <i>proxyserver.foo.com</i> <i>port</i> %h %p replaceproxyserver.foo.com with the hostname of your proxy server, andport with the numeric tcp port on which the http tunnel is running. the usual ...
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
examples of putting them to use. server-side javascript (ssjs) via embedded javascript engines the extension of javascript to the server is made possible via embedded javascript engines. the two most well established engines are spidermonkey and rhino, both currently maintained by the mozilla foundation. spidermonkey is the code name for the first ever javascript engine, an open source c implementation which can be found embedded in leading software products such as mozilla firefox, adobe acrobat, and aptana jaxer. rhino is a java implementation of javascript which is commonly embedded in java applications to expose scripting capability. the helma web application framework is an example of rhino in use. the dojo toolkit also has capabilities that run in rhino. let’s ta...
...ort for xml, greatly simplifying the process of consuming xml via javascript. rhino’s support of this important standard eliminates the pain of using dom or sax based parsers in java. listing 3 below details a script used to process an rss feed from the mozilla website. ...
...also since you know which engine you're targeting, you're free to confidently use advanced built in controls such as xml processing via e4x, xpath, and xslt. let's take a tour through some of the top features of jaxer through code examples. jaxer – server-side ajax via the firefox browser engine on the server although server-side javascript...
XQuery - Archive of obsolete content
ented within extensions). xquseme is a working proof-of-concept (so far tested on windows and linux with java installed; mac does not work) extension which allows one to perform xqueries on external urls, the currently loaded webpage (even if originally from poorly formed html), and/or xml (including well-formed xhtml) documents stored locally. the extension now includes and interfaces with the open-source version of saxonica's saxon b (though this extension currently only performs the xqueries). other popular native xml databases might also be supported (e.g., exist) in the future, especially now that the extension has added some basic support for the open-standard (xqj) for java and exist is in the midst of getting such an api. berkeley db xml was the initial choice by the extension develo...
... a simple usage example is available. ...
...tensions at present, the extension works simply by using liveconnect to work with berkeley db xml's java api (and via a java wrapper class which circumvents liveconnect's current inability to handle some types of java exceptions properly). however, use of the approach of the java firefox extension might be used to turn the above extension concept into an xpcom component (giving it access to all open windows), and for berkeley db xml, possibly implementing it in c++ instead, which is that database's original language of development. however, the extension demonstrates a technique which does not depend on using xpcom, while still giving full privileges. tutorials w3schools learn xquery in 10 minutes an introduction to xquery ...
Index - Game development
of them being free, so it's only about your enthusiasm and available time. sometimes you have to spend more time promoting a game than actually developing it. remember that it's no use to have the best game in the world if no one knows it exists. 11 techniques for game development games, guide this page lists essential core techniques for anyone wanting to develop games using open web technologies. 12 2d collision detection 2d, games, javascript, collision detection one of the simpler forms of collision detection is between two rectangles that are axis aligned — meaning no rotation. the algorithm works by ensuring there is no gap between any of the 4 sides of the rectangles. any gap means a collision does not exist. 13 3d collision detecti...
... library. it is assumed that before reading this you have read our 3d collision detection introductory article first, and have basic knowledge about three.js. 15 3d games on the web games, graphics, needscontent, needsexample, webgl, webvr, three.js for rich gaming experiences on the web, the weapon of choice is webgl, which is rendered on html <canvas>. webgl is basically an opengl es 2.0 for the web — it's a javascript api providing tools to build rich interactive animations and of course, also games. you can generate and render dynamic 3d graphics with javascript that is hardware accelerated. 16 building up a basic demo with a-frame 3d, a-frame, vr, virtual reality, web, webgl the webxr and webgl apis already enable us to start creating virtual re...
... necessary html, the fundamental objects of three, and how to build up a basic demo. 22 explaining basic 3d theory 3d, coordinates, textures, basics, fragment, lighting, primitives, rendering, theory, vertex, vertices this article explains all of the basic theory that's useful to know when you are getting started working with 3d. 23 glsl shaders beginner, glsl, opengl, shader, texture shader, three.js, vertex shader shaders use glsl (opengl shading language), a special opengl shading language with syntax similar to c. glsl is executed directly by the graphics pipeline. there are two types of shaders: vertex shaders and fragment (pixel) shaders. vertex shaders transform shape positions into 3d drawing coordinates. fragment shaders compute the renderings...
Game distribution - Game development
you've followed a tutorial or two and created an html5 game — that's great! this article covers all you need to know about the ways in which you can distribute your newly created game into the wild. this includes hosting it yourself online, submitting it to open marketplaces, and submitting it to closed ones like google play or the ios app store. benefits of html5 over native building games with html5 gives you extra advantages, such as: multiplatform bliss the technology itself is multiplatform, so you can write the code once and target multiple devices. this can range from low-end smartphones or tablets, through laptops and desktop computers, to smart tvs, watches or even a fridge if it can handle a modern enough browser. you don't need to have separate teams to work on the same titl...
... who could easily take it and sell it as their own. you can concatenate and minify the code to make it smaller and uglify it so it's a lot harder to reverse engineer your game. another good measure to take is to provide an online demo if you're planning on packaging it and selling it in a closed store like itunes or steam. if you're working on a side project just for fun, then leaving the source open will benefit those who would like to learn from what you've created. you don't even have to worry about looking for a hosting provider as it's possible to host games on github pages. you'll get free hosting, version control and possible contributors if your project is interesting enough. publishers and portals as the name may suggest, publishers can handle the publishing of your game for you. w...
...ramework and app store. nw.js — formerly known as node-webkit, this is the first choice when it comes to building a desktop game that works on windows, mac and linux. the distributions are packaged with the webkit engine to provide rendering on any platform. other alternative tools are: intel xdk — an exciting alternative, similar to cocoonio. electron — known as atom shell — is an open-sourced and cross-platform tool from github. manifold.js — this tool from the microsoft team can create native distributions of html5 games from ios, android, and windows. summary distribution is the way to give the world access to your game. there are many options available and there's no single good answer as to which is the best. when you've published the game it's time to focus on promo...
Building up a basic demo with PlayCanvas editor - Game development
its entity inspector will appear on the right hand side of the display. now edit the name text field to give it a unique name (we've chosen boxmaterial). a unique name will help us remember what this material is for — we will add more later! to change its color we'll use the diffuse option in the entity inspector. click diffuse, then select the colored box next to the color label — it will open a color wheel. from here you can click your desired color or enter it in the bottom text field as a hex value. we've chosen a blue color with a hex value of 0095dd — enter this code in the text field and press return for it to be accepted. note: yes, you read that right — you need to enter the hex value without the hash/pound symbol. now we can apply the colored material to the shape by...
...be a bit fiddly to select; just persevere) onto the box on the scene. so, at this point we've created a blue box. click on the box to bring up its entity sidebar — you'll see options for changing its position, rotation, and scale. try applying the rotation values x: 10 and y: 20. now click on the play arrow in the top right corner of the scene to launch and render the scene — it will be opened in a separate browser tab. this looks great! let's add more shapes to the scene to make it look more interesting. adding more shapes to make way for more shapes, move the box to the left to make some room for the next shape. you can do this by giving it an x position value of -2. adding other shapes involves a very similar process to adding the box. click on the root folder in the hiera...
...mer, with math.abs() applied to the result of that to have the values always above zero (0-1; sin values are normally between -1 and 1.) this gives us a nice scaling effect as a result. remember to add the cylinderanimation.js file to the cylinder object to apply the given animations. the cone time to play with the last object — the cone. create a coneanimation.js file and double click it to open it in the editor. next, add the following line to the initialize() function: this.timer = 0; to move the cone up and down we will use the setposition() method — add the code below to the update() function: this.timer += dt; this.entity.setposition(2, math.sin(this.timer*2), 0); the position of the cone will be animated on each frame by being passed the math.sin() value of the timer at each...
Plug-in Development Overview - Gecko Plugin API Reference
ry entries for the plug-in described below in installation using the registry. but when the plug-in is loaded from a well-known directory, a different method must be used. in this case to ensure the plug-in file will be loaded, it should have a name in the form of "np*.dll". ...
...ve a name in the form of "np*.dll". also, the windows version information for the plug-in dll will be used to determines the mime types, file extensions, file open template, plug-in name, and description. ...
...rm of "np*.dll". also, the windows version information for the plug-in dll will be used to determines the mime types, file extensions, file open template, plug-in name, and description. ...
Debugging CSS - Learn web development
wever, all of the different browsers have similar fundamental tools, e.g. for inspecting the properties and values applied to elements on your page, and making changes to them from the editor. in this lesson we will look at some useful features of the firefox devtools for working with css. in order to do so i'll be using an example file. load this up in a new tab if you want to follow along, and open up your devtools as described in the article linked above. the dom versus view source something that can trip up newcomers to devtools is the difference between what you see when you view the source of a webpage, or look at the html file you put on the server, and what you can see in the html pane of the devtools. while it looks roughly similar to what you can see via view source there are some...
...rence between what you see when you view the source of a webpage, or look at the html file you put on the server, and what you can see in the html pane of the devtools. while it looks roughly similar to what you can see via view source there are some differences. in the rendered dom the browser may have corrected some badly-written html for you. if you incorrectly closed an element, for instance opening an <h2> but closing with an </h3>, the browser will figure out what you were meaning to do and the html in the dom will correctly close the open <h2> with an </h2>. the browser will also normalize all of the html, and the dom will also show any changes made by javascript. view source in comparison, is simply the html source code as stored on the server. the html tree in your devtools shows ex...
... editing values in addition to turning properties on and off, you can edit their values. perhaps you want to see if another color looks better, or wish to tweak the size of something? devtools can save you a lot of time editing a stylesheet and reloading the page. with box1 selected, click on the swatch (the small colored circle) that shows the color applied to the border. a color picker will open up and you can try out some different colors; these will update in real time on the page. in a similar fashion, you could change the width or style of the border. adding a new property you can add properties using the devtools. perhaps you have realised that you don't want your box to inherit the <body> element's font size, and want to set its own specific size? you can try this out in devtoo...
How do you set up a local testing server? - Learn web development
this article explains how to set up a simple local testing server on your machine, and the basics of how to use it. prerequisites: you need to first know how the internet works, and what a web server is. objective: you will learn how to set up a local testing server. local files vs. remote files throughout most of the learning area, we tell you to just open your examples directly in a browser — this can be done by double clicking the html file, dragging and dropping it into the browser window, or choosing file > open... and navigating to the html file. there are many ways to achieve this. if the web address path starts with file:// followed by the path to the file on your local hard drive, a local file is being used. in contrast, if you view one of...
...address path starts with file:// followed by the path to the file on your local hard drive, a local file is being used. in contrast, if you view one of our examples hosted on github (or an example on some other remote server), the web address will start with http:// or https://, to show that the file has been received via http. the problem with testing local files some examples won't run if you open them as local files. this can be due to a variety of reasons, the most likely being: they feature asynchronous requests. some browsers (including chrome) will not run async requests (see fetching data from the server) if you just run the example from a local file. this is because of security restrictions (for more on web security, read website security). they feature a server-side language. s...
...nstall it: go to python.org under the download section, click the link for python "3.xxx". at the bottom of the page, choose the windows x86 executable installer and download it. when it has downloaded, run it. on the first installer page, make sure you check the "add python 3.xxx to path" checkbox. click install, then click close when the installation has finished. open your command prompt (windows)/ terminal (macos/ linux). to check python is installed, enter the following command: python -v # or you might have the py command available, # in which case try py -v this should return a version number. if this is ok, navigate to the directory that your example is inside, using the cd command. # include the directory name to enter it, for example cd des...
Advanced form styling - Learn web development
you'll notice that the options don't inherit the font set on the parent. you also can't consistently set things like spacing and colors. for example, firefox will apply color and background-color when set on the <option> elements, chrome won't. neither of them will apply any kind of spacing (e.g. padding). the same is also true of the autocomplete list that appears for the datalist. if you r...
... you saw in our example, it is fairly easy to create something that fits in ok with the rest of the page — the output line that is part of the control will inherit the parent font if you tell the input to do so, and you can style the custom list of file names and sizes in any way you want; we created it after all. the only problem with file pickers is that the button provided that you press to open the file picker is completely unstyleable — it can't be sized or colored, and it won't even accept a different font. one way around this is to take advantage of the fact that if you have a label associated with a form control, clicking the label will activate the control. so you could hide the actual from input using something like this: input[type="file"] { height: 0; padding: 0; opaci...
...it won't even accept a different font. one way around this is to take advantage of the fact that if you have a label associated with a form control, clicking the label will activate the control. ...
CSS basics - Learn web development
's try it out! using a text editor, paste the three lines of css (above) into a new file. save the file as style.css in a directory named styles. to make the code work, we still need to apply this css (above) to your html document. otherwise, the styling won't change the appearance of the html. (if you haven't been following our project, pause here to read dealing with files and html basics.) open your index.html file. paste the following line in the head (between the <head> and </head> tags): <link href="styles/style.css" rel="stylesheet"> save index.html and load it in your browser. you should see something like this: if your paragraph text is red, congratulations! your css is working. anatomy of a css ruleset let's dissect the css code for red paragraph text to understand how ...
... the appearance of the example by adding more rules and information to the style.css file. first, find the output from google fonts that you previously saved from what will your website look like?. add the <link> element somewhere inside your index.html's head (anywhere between the <head> and </head> tags). it looks something like this: <link href="https://fonts.googleapis.com/css?family=open+sans" rel="stylesheet"> this code links your page to a style sheet that loads the open sans font family with your webpage. next, delete the existing rule you have in your style.css file. it was a good test, but let's not continue with lots of red text. add the following lines (shown below), replacing the font-family assignment with your font-family selection from what will your website look l...
...our website look like?. the property font-family refers to the font(s) you want to use for text. this rule defines a global base font and font size for the whole page. since <html> is the parent element of the whole page, all elements inside it inherit the same font-size and font-family. html { font-size: 10px; /* px means "pixels": the base font size is now 10 pixels high */ font-family: "open sans", sans-serif; /* this should be the rest of the output you got from google fonts */ } note: anything in css between /* and */ is a css comment. the browser ignores comments as it renders the code. css comments are a way for you to write helpful notes about your code or logic. now let's set font sizes for elements that will have text inside the html body (<h1>, <li>, and <p>). we...
The web and web standards - Learn web development
on how the technologies should work in the best way to fulfill all of their use cases. the w3c is the best known web standards body, but there are others such as the whatwg (who were responsible for the modernization of the html language), ecma (who publish the standard for ecmascript, which javascript is based on), khronos (who publish technologies for 3d graphics, such as webgl), and others. "open" standards one of the key aspects of web standards, which timbl and the w3c agreed on from the start, is that the web (and web technologies) should be free to both contribute and use, and not encumbered by patents/licensing. therefore anyone can write the code to build a website for free, and anyone can contribute to the standards creation process, where the specs are written. because web techn...
...the key aspects of web standards, which timbl and the w3c agreed on from the start, is that the web (and web technologies) should be free to both contribute and use, and not encumbered by patents/licensing. therefore anyone can write the code to build a website for free, and anyone can contribute to the standards creation process, where the specs are written. because web technologies are created openly, in collaboration between many different companies, it means that no one company gets to control them, which is a really good thing. you wouldn't want a single company suddenly deciding to put the entire web behind a paywall, or releasing a new version of html that everyone has to buy to continue making web sites, or worse still, just deciding they aren't interested any more and just turning it...
...thing. you wouldn't want a single company suddenly deciding to put the entire web behind a paywall, or releasing a new version of html that everyone has to buy to continue making web sites, or worse still, just deciding they aren't interested any more and just turning it off. this allows the web to remain a freely-available public resource. don't break the web another phrase you'll hear around open web standards is "don't break the web" — the idea is that any new web technology that is introduced should be backwards compatible with what went before it (i.e. old web sites will still continue to work), and forwards compatible (future technologies in turn will be compatible with what we currently have). as you go through the learning material presented here, you'll start to learn how this is...
Video and Audio APIs - Learn web development
ike the following: getting started to get started with this example, download our media-player-start.zip and unzip it into a new directory on your hard drive. if you downloaded our examples repo, you'll find it in javascript/apis/video-audio/start/ at this point, if you load the html you should see a perfectly normal html5 video player, with the native controls rendered. exploring the html open the html index file. you'll see a number of features; the html is dominated by the video player and its controls: <div class="player"> <video controls> <source src="video/sintel-short.mp4" type="video/mp4"> <source src="video/sintel-short.webm" type="video/webm"> <!-- fallback content here --> </video> <div class="controls"> <button class="play" data-icon="p" aria-label="pl...
...t the elapsed time when the video is playing. just for fun, we are providing two reporting mechanisms — a <span> containing the elapsed time in minutes and seconds, and an extra <div> that we will use to create a horizontal indicator bar that gets longer as the time elapses. to get an idea of what the finished product will look like, check out our finished version. exploring the css now open the css file and have a look inside. the css for the example is not too complicated, but we'll highlight the most interesting bits here. first of all, notice the .controls styling: .controls { visibility: hidden; opacity: 0.5; width: 400px; border-radius: 10px; position: absolute; bottom: 20px; left: 50%; margin-left: -200px; background-color: black; box-shadow: 3px 3px 5px b...
... hovering/focusing over the player do the controls appear at full opacity. we lay out the buttons inside the control bar using flexbox (display: flex), to make things easier. ...
A first splash into JavaScript - Learn web development
e game. once the game restarts, make sure the game logic and ui are completely reset, then go back to step 1. let's now move forward, looking at how we can turn these steps into code, building up the example, and exploring javascript features as we go. initial setup to begin this tutorial, we'd like you to make a local copy of the number-guessing-game-start.html file (see it live here). open it in both your text editor and your web browser. at the moment you'll see a simple heading, paragraph of instructions and form for entering a guess, but the form won't currently do anything. the place where we'll be adding all our code is inside the <script> element at the bottom of the html: <script> // your javascript goes here </script> adding variables to store our data let's get st...
...alert come up that says "i am a placeholder"; we have defined a function in our code that creates an alert whenever we call it. note: you'll learn a lot more about functions later in the course. operators javascript operators allow us to perform tests, do math, join strings together, and other such things. if you haven't already done so, save your code, refresh the page in your browser, and open the developer tools javascript console. then we can try typing in the examples shown below — type in each one from the "example" columns exactly as shown, pressing return/enter after each one, and see what results they return. first let's look at arithmetic operators, for example: operator name example + addition 6 + 9 - subtraction 20 - 15 ...
...ments is focus(), so we can now use this line to focus the text input: guessfield.focus(); variables that don't contain references to form elements won't have focus() available to them. for example, the guesses constant contains a reference to a <p> element, and the guesscount variable contains a number. playing with browser objects let's play with some browser objects a bit. first of all, open up your program in a browser. next, open your browser developer tools, and make sure the javascript console tab is open. type guessfield into the console and the console shows you that the variable contains an <input> element. you'll also notice that the console autocompletes the names of objects that exist inside the execution environment, including your variables! now type in the following: ...
What went wrong? Troubleshooting JavaScript - Learn web development
lassifications will do at this early stage in your career. we'll look at both of these types going forward. an erroneous example to get started, let's return to our number guessing game — except this time we'll be exploring a version that has some deliberate errors introduced. go to github and make yourself a local copy of number-game-errors.html (see it running live here). to get started, open the local copy inside your favorite text editor, and your browser. try playing the game — you'll notice that when you press the "submit guess" button, it doesn't work! note: you might well have your own version of the game example that doesn't work, which you might want to fix! we'd still like you to work through the article with our version, so that you can learn the techniques we are teac...
... the techniques we are teaching here. then you can go back and try to fix your example. at this point, let's consult the developer console to see if it reports any syntax errors, then try to fix them. you'll learn how below. fixing syntax errors earlier on in the course we got you to type some simple javascript commands into the developer tools javascript console (if you can't remember how to open this in your browser, follow the previous link to find out how). what's even more useful is that the console gives you error messages whenever a syntax error exists inside the javascript being fed into the browser's javascript engine. now let's go hunting. go to the tab that you've got number-game-errors.html open in, and open your javascript console. you should see an error message along the ...
...tion body this is easy — it generally means that you've missed one of your curly braces from a function or conditional structure. we got this error by deleting one of the closing curly braces near the bottom of the checkguess() function. syntaxerror: expected expression, got 'string' or syntaxerror: unterminated string literal these errors generally mean that you've left off a string value's opening or closing quote mark. in the first error above, string would be replaced with the unexpected character(s) that the browser found instead of a quote mark at the start of a string. the second error means that the string has not been ended with a quote mark. for all of these errors, think about how we tackled the examples we looked at in the walkthrough. when an error arises, look at the line n...
Working with JSON - Learn web development
eve in a variable. add the following at the bottom of your javascript code: let requesturl = 'https://mdn.github.io/learning-area/javascript/oojs/json/superheroes.json'; to create a request, we need to create a new request object instance from the xmlhttprequest constructor, using the new keyword. add the following below your last line: let request = new xmlhttprequest(); now we need to open the request using the open() method. add the following line: request.open('get', requesturl); this takes at least two parameters — there are other optional parameters available. we only need the two mandatory ones for this simple example: the http method to use when making the network request. in this case get is fine, as we are just retrieving some simple data. the url to make t...
...ngs are appended is important, as this is the order they will be displayed inside the html. note: if you are having trouble getting the example to work, try referring to our heroes-finished.html source code (see it running live also.) note: if you are having trouble following the dot/bracket notation we are using to access the javascript object, it can help to have the superheroes.json file open in another tab or your text editor, and refer to it as you look at our javascript. you should also refer back to our javascript object basics article for more information on dot and bracket notation. converting between objects and text the above example was simple in terms of accessing the javascript object, because we set the xhr request to convert the json response directly into a javascript...
...a parameter, and returns the equivalent json string form. you can see the first one in action in our heroes-finished-json-parse.html example (see the source code) — this does exactly the same thing as the example we built up earlier, except that we set the xhr to return the raw json text, then used parse() to convert it to an actual javascript object. ...
Starting our Svelte Todo list app - Learn web development
edge of the terminal/command line. you'll need a terminal with node + npm installed to compile and build your app. objective: to learn how to create a svelte component, render it inside another component, pass data into it using props, and save its state. code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app state, run cd mdn-svelte-tutorial/02-starting-our-todo-app or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/02-starting-our-todo-app remember to run npm install && npm run dev to start your app in development mode. repl to code along with us using the repl, start at https://svelte.dev/repl/b7b831ea3a...
...components anywhere inside the src folder, but the components folder is a recognized convention to follow, allowing you to find your components easily. ...
... repl to see the current state of the code in a repl, visit: https://svelte.dev/repl/c862d964d48d473ca63ab91709a0a5a0?version=3.23.2 summary with our markup and styling in place our todo list app is starting to take shape, and we have everything ready so that we...
Deploying our app - Learn web development
ommand to our package.json file as an npm script, so that the command npm run build will trigger the build process. this step isn't necessary, but it is a good best practice to get into the habit of setting up — across all our projects, we can then rely on npm run build to always do the complete build step, without needing to remember the specific build command arguments for each project. open the package.json file in your project's root directory, and find the scripts property. we'll add a build command that we can run to build our code. add the following line to your project now: "scripts": { ... "build": "parcel build src/index.html" } note: if the scripts property already has a command inside it, put a comma at the end of it. keep the json valid. you sho...
...method for testing as part of their pipeline. products like github, gitlab, etc., all support running tests against individual commits. as this project is deploying to netlify, and netlify only asks about the build command, we will have to make the tests part of the build. if the test fails, the build fails, and netlify won’t deploy. let’s get started. go to your package.json file and open it up. find your scripts member, and update it so that it contains the following test and build commands: "scripts": { … "test": "node tests/*.js", "build": "npm run test && parcel build src/index.html" } now of course we need to add the test to our codebase; create a new directory in your root directory called tests: mkdir tests inside the new directory, create a ...
...our tests are outside of parcel's view of our system — since parcel never sees nor ...
Embedding API for Accessibility
al", "none", "once" moz 0.8 applets setboolpref("browser.accept.applets", acceptapplets); no scripts setboolpref("browser.accept.scripts", acceptscripts); no popup windows // turn window.open off for particular sites: user_pref("capability.policy.popupsites.sites", "http://www.annoyingsite1.com http://www.popupsite2.com"); user_pref("capability.policy.popupsites.windowinternal.open","noaccess"); // or turn it off everywhere: user_pref("capability.policy.default.windowin...
...r particular sites: user_pref("capability.policy.popupsites.sites", "http://www.annoyingsite1.com http://www.popupsite2.com"); user_pref("capability.policy.popupsites.windowinternal.open","noaccess"); // or turn it off everywhere: user_pref("capability.policy.default.windowinternal.open","noaccess"); // override popping up new windows on target=anything user_pref("browser.block.target_new_window", true); // override popup windows at beginning of new page load (blocks most popup advertisements) user_pref("dom.disable_open_during_load", true...
... the user interface is another matter. accepting special content on an instance basis after being notified of special content, the user needs to be able to select specific unloaded content for loading. one way of doing this is to build up the nsiwebbrowseraccessible interface, so that there is a method to force loading each type of content just for the current page in the current session. open issue: accessibility settings per url a powerful possibility is that we design an interface for setting certain preferences based on the url. if we can find a clean way to present it to the user, this would be extremely useful. for example, settings per url would allow a user to accept scripts from their known benign web pages, but not others. users may want similarity abilities with applets, b...
Application cache implementation overview
all top level document loading (navigation) channels are set chooseapplicationcache flag, which happens in nsdocshell::douriload(). channels having that flag set are searching for nsiapplicationcache object prior inspecting normal http cache. nsiapplicationcacheservice::chooseapplicationcache is given the url the channel is about to load. it synchronously returns an nsiapplicationcache object representing the most recent cache version from the most recent cache group containing the entry under the url or a matching namespace. ...
... url or a matching namespace. if no nsiapplicationcache object has been found, there is no offline cache to load from and the load continues a usual way by loading from normal http cache, further steps are not executed. the channel remembers the nsiapplicationcache object. nsiapplicationcache is then queried a client id (= the manifest url + a unique time stamp). then, nsicacheservice is asked to open nsicachesession with store_offline policy and the given client id. entry is queried using that session. nshttpchannel::onofflinecacheentryavailable is then invoked. when aentrystatus is a success code, entry has been found and we are loading it from the cache. loadedfromapplicationcache flag is now set true on the channel. when aentrystatus is a failure code, entry has not been found, but the url...
... and is 'finished'. then it associates any documents waiting for this update to finish with the current existing nsiapplicationcache. if the manifest load failed, onerror event is invoked and the update 'finishes'. the parallel load is implemented by asynchronous recursive calls to processnexturi(), a method searching always a single entry that is scheduled to load. when found, channel is open for it (+onprogress event is invoked). processnexturi then invokes it self asynchronously via dispatch to a main thread when not already on the concurrency limit of 15 loads. when concurrency limit is reached, the processnexturi self-invocation cycle is stopped. from now on processnexturi can only be called from loadcompleted() again. note: the processnexturi method early returns when state o...
Simple Sunbird build
ng. please refer to the simple thunderbird build guide. you can build a bleeding-edge, development version of sunbird using the commands below. for complete information, see the build documentation. installing build tools if your system is not listed below, see the build prerequisites page. ubuntu linux: sudo apt-get build-dep sunbird sudo apt-get install mercurial libasound2-dev libcurl4-openssl-dev libnotify-dev libiw-dev autoconf2.13 cvs fedora linux: sudo yum groupinstall 'development tools' 'development libraries' 'gnome software development' sudo yum install mercurial autoconf213 glibc-static libstdc++-static yasm wireless-tools-devel mesa-libgl-devel mac: install xcode tools. insert "mac os x install disc 2", then open xcodetools.mpkg. (for some mac os x versions, you...
...dition and the express edition will work. you may need to install one or more windows sdks. see windows sdk versions for a quick guide. install mozillabuild, a package of additional build tools. (if you get a message saying this application did not install properly then you should see a windows dialog giving you the option to re-install with the 'correct settings'. ...
...this causes problems while building. to avoid this issue, change to a directory without spaces (i.e. c:\ ) before doing the following steps. ...
Displaying Places information using views
ies that the view displays. this method may be used as an alternative to setting the tree's place property as described above. void load( array queries, nsinavhistoryqueryoptions options ); parameters queries an array of nsinavhistoryquery objects. options an nsinavhistoryqueryoptions object. selectitems() selects the first node in the tree that matches each given item id. it will open any parent nodes that it needs to in order to show the selected items. void selectitems( array aids, array aopencontainers ); parameters aids an array of item ids. aopencontainers if true or undefined, folders that are closed are also searched. they are not searched otherwise. optional. selectnode() causes a particular node to be selected in the tree, resulting in all containers a...
... order to show the selected items. void selectitems( array aids, array aopencontainers ); parameters aids an array of item ids. aopencontainers if true or undefined, folders that are closed are also searched. they are not searched otherwise. optional. selectnode() causes a particular node to be selected in the tree, resulting in all containers above the node in the hierarchy to be opened so that the node is visible. void selectnode( nsinavhistorynode node ); parameters node the nsinavhistoryresultnode to select. selectplaceuri() causes a particular node represented by the specified placeuri to be selected in the tree. all containers above the node in the hierarchy will be opened so that the node is visible. void selectplaceuri( string placeuri ); parameters ...
...ence are implemented directly on the built-in tree view. warning: until bug 476952 is fixed, you may experience problems using some of these properties in conjunction with the place attribute and property. property type description flatlist boolean if true the view does not recurse into containers. the action to take when a container is toggled can be set via the onopenflatcontainer property. at least one of flatlist and showroot must be false. onopenflatcontainer string the body of function that will be called when a container is toggled. only applies if property flatlist is true. the function will be passed one nsinavhistoryresultnode argument named acontainer. you can queryinterface acontainer to an nsinavhistorycontainerresultnode. sh...
Multiple Firefox profiles
it is possible in some cases to have multiple instances of firefox running in different profiles, to avoid confusion, you might want to first exit/quit/terminate all running instances of firefox, firefox developer edition or nightly. then follow the instructions below, applicable to your operating system. from profile manager inside firefox if you already have firefox instance running, you can open another profile from the integrated profile manager on any platform: type about:profiles into the browser url search bar. find the profile you want to use. press the “launch profile in new browser” button next to it. windows windows xp click the start button. click "run". type firefox --new-instance--profilemanager. windows vista/7 click the start button. click the sea...
... windows vista/7 click the start button. click the search bar at the bottom. type firefox --new-instance --profilemanager. windows 8/8.1/10 press "windows + r" on your keyboard. type firefox --new-instance --profilemanager. linux if firefox is already included in your linux distribution, or if you have installed firefox with the package manager of your linux distribution: open a terminal emulator or your shell’s command prompt: alt-f2 if you use gnome shell or kde plasma, consult your desktop environment documentation for other environments. run firefox --new-instance --profilemanager. macos run the terminal application, which is found in applications/utilities. type or paste in the path to firefox, followed by .app/contents/macos/firefox. for e...
...therwise, enter a space character followed by --profilemanager. this will present the profile manager window in which you can make your selection. hit return. here is a complete example terminal command from steps 2-3: /applications/firefox.app/contents/macos/firefox -profile /users/suzie/library/application\ support/firefox/profiles/r99d1z7c.default if the profile manager window does not open, firefox may have been running in the background, even though it was not visible. close all instances of firefox, or restart the computer, and then try again. if you want to do this frequently and more easily, you may wish to create an automator application, as explained in this tutorial. creating a profile creating a profile through the profile manager these instructions should be the same...
Storage access policy: Block cookies from trackers
ow some third-party integrations that are common on the web to continue to function. they are intended to be temporary and will be removed in a future version of firefox. they should not be relied upon for current and future web development. third-party storage access may be granted to resources that have been classified as tracking resources when a user gesture triggers a pop-up window that has opener access to the originating document. when that occurs, there are three possible ways a third-party origin can be granted access: the origin of the resource that is initially loaded in the pop-up window is granted storage access on the opener document. if we discover that an origin is abusing this heuristic to gain tracking access, that origin will have the additional requirement that it must ...
...in will have the additional requirement that it must have received user interaction as a first party within the past 30 days. after the initial resource is loaded in the pop-up window, the window may go through a series of redirects to other hosts. if a user interacts with the pop-up window following a redirect, the origin of the content loaded in the pop-up window is given storage access on the opener document. when there is a top-level redirect from a tracking origin to a non-tracking origin, the tracking origin receives short-lived storage access on the non-tracking origin and any other non-tracking origins that appear further down the redirect chain (i.e., if the load continues to redirect). the tracking origin must have received user interaction as a first party within the past 30 days,...
...on the non-tracking origin and any other non-tracking origins that appear further down the redirect chain (i.e., if the load continues to redirect). the tracking origin must have received user interaction as a first party within the past 30 days, and the storage access permission expires after 15 minutes. scope of storage access when storage access is granted, it is scoped to the origin of the opener document or subdomains of that origin. access that is granted on the subdomain of an origin does not extend to the top-level origin. as an example, if a resource from tracker.example is granted storage access on foo.example.com, then tracker.example will be able to access its cookies on bar.foo.example.com but not example.com. instead, if tracker.example were granted access on example.com it wo...
Firefox and the "about" protocol
ontributors to the firefox project about:debugging switches to the developer tools debugging page, which allows you to debug add-ons, tabs and service workers about:devtools summarizes the developer tools and provides links to documentation for each tool about:downloads displays all downloads done within firefox about:home start page of firefox when opening a new window about:license displays licensing information about:logo firefox logo about:memory provides a way to display memory usage, save it as report and run the gc and cc about:mozilla special page showing a message from "the book of mozilla" about:networking displays networking information about:newtab start page when...
...ng a new window about:license displays licensing information about:logo firefox logo about:memory provides a way to display memory usage, save it as report and run the gc and cc about:mozilla special page showing a message from "the book of mozilla" about:networking displays networking information about:newtab start page when opening a new tab about:performance displays memory and performance information about firefox subprocesses/add-ons/tabs about:plugins displays information about installed plugins about:policies lists out the firefox for enterprise policies about:preferences firefox settings (also available through firefox menu > options) about:privatebrowsing ...
... about:performance displays memory and performance information about firefox subprocesses/add-ons/tabs about:plugins displays information about installed plugins about:policies lists out the firefox for enterprise policies about:preferences firefox settings (also available through firefox menu > options) about:privatebrowsing start page when opening a private window about:profiles display and manage firefox profiles about:protections privacy protections report consisting of enhanced tracking protection, firefox monitor and firefox lockwise data about:restartrequired a page users are sent to when firefox requires a restart due to an update about:reader indicates a web page has firefox reader ...
Add-on Manager
and also here mdn :: inline options -...
...these pages ...
...ource://gre/modules/addonmanager.jsm"); let addonids = addonmanager.getstartupchanges(addonmanager.startup_change_disabled); if (addonids.length > 0) { // addonids is now an array of the add-on ids that have been disabled alert("note: " + addonids.length + " add-ons have been disabled."); } open add-on manager tab the add-on manager tab can be opened programatically with the function browseropenaddonsmgr which is available on chrome window of "navigator:browser" type. you can pass the url to a page in the add-on manager tab to load that page. read more about it at this topic here on mozilla add-ons forum :: how to open an add-on's preference panel? and also here mdn :: inline options - opening inline options in add-on manager. these pages show you how to load pages such as services page...
NetUtil.jsm
eam to take data from. const test_data = "this is a test string"; let istream = cc["@mozilla.org/io/string-input-stream;1"]. createinstance(ci.nsistringinputstream); istream.setdata(test_data, test_data.length); netutil.asynccopy(istream, ostream, function(aresult) { if (!components.issuccesscode(aresult)) { // an error occurred! } }) asyncfetch() the asyncfetch() method opens an input source, asynchronously, and gives an nsiinputstream containing the data obtained to the callback provided. the callback may then consume data from the input stream passed to the callback. note: prior to gecko 2, the input source was required to be specified as an nsichannel. note: support for specifying an nsiinputstream as the input source was added in gecko 5. asyncfetch( aso...
...am containing the data obtained to the callback provided. the callback may then consume data from the input stream passed to the callback. note: prior to gecko 2, the input source was required to be specified as an nsichannel. note: support for specifying an nsiinputstream as the input source was added in gecko 5. ...
...allback. note: prior to gecko 2, the input source was required to be specified as an nsichannel. note: support for specifying an nsiinputstream as the input source was added in gecko 5. asyncfetch( asource, acallback ); parameters asource the source to open asynchronously. this may be specified as an nsiuri, nsifile, nsichannel, nsiinputstream or as a string specifying the url to open. acallback a function that will be called when the open operation is completed. the callback receives three parameters: the input stream containing the data, if any (implementing nsiinputstream), an nsresult status code for the open operation, and a reference to the nsirequest object. exceptions thrown this method throws an exception with the message "must have a source and a callback" if ei...
PopupNotifications.jsm
ed by firefox chrome windows, so you don't have to do it yourself in most extensions. method overview void locationchange(); notification getnotification(id, browser); void remove(notification); notification show(browser, id, message, anchorid, mainaction, secondaryactions, options); properties attribute type description ispanelopen boolean returns true if the notification panel is currently visible, false if it is not. methods locationchange() the consumer can call this method to let the popup notification module know that the current browser's location has changed. this lets the notification service update the active notifications as appropriate. note: you shouldn't need to call this when using the popupnot...
...the epoch) indicating the earliest time after which the notification can be automatically dismissed. notifications that specify a timeout value will not be automatically dismissed until this time. the user may manually dismiss the notification, however. for most use cases, the value of this parameter should be date.now() plus an offset indicating the amount of time the notification should be kept open (for example, date.now() + 30000 for 30 seconds). persistwhilevisible a boolean value indicating whether or not the notification should persist across location changes. if true, the notification will remain visible even if the browser navigates to a different location. dismissed a boolean value indicating whether or not the notification should be added as a dismissed notification. dismissed n...
...been dismissed (that is, any time the popup is closed due to user interaction). popupiconurl a string specifying the url of the image to be displayed in the popup. this is normally specified in css using list-style-image and the .popup-notification-icon[popupid=...] selector. learnmoreurl a string url. setting this property will make the prompt display a "learn more" link that, when clicked, opens the url in a new tab. notification events if you specify an event callback using the options parameter when calling show(), the callback function gets invoked when the state of the notification changes. the first parameter to the callback is a string identifying the state change, and may be one of the following: "dismissed" the notification has been dismissed by the user (for example, by ...
L10n testing with xcode
select the client project in the left pane and choose editor > import localizations from the toolbar and select your localized xliff file. a window will then appear showing the diff between the imported xliff file and the existing resources in the project folder. click the import button. ...
... on ios. launching & testing your firefox on ios localization the ios simulator is fairly easy to use once you launch your app. to perform the next steps, you'll need to be familiar with how user gestures and hardware interactions work in the simulator. this guide should help. press the run button in the upper left-hand corner (the button has a playback icon). ...
.... navigate to the newly opened ios simulator window many strings are accessibility strings and are only revieled when a user hovers their finger over the button. to view these strings, you'll need to start the accessibility inspector within the ios simulator by doing the following. in the ios simulator, press the home button from the hardware toolbar menu. navigate to the settings app, open it, and go to general > accessibility. slide the accessibility inspector switch to on. the accessibility inspector remains active until you turn it off, even if you quit and restart ios simulator. press the home button again, navigate to the pane with your firefox for ios localization on it, and reopen firefox. now, you can navigate through the firefox app in the ios simulator, viewin...
Localizing XLIFF files for iOS
e firefox-ios.xliff file is located in svn. decide where on your local computer you will store your copy of the github repo and navigate there in your terminal. enter the command git clone https://github.com/mozilla-l10n/firefoxios-l10n/your-locale-code/ you should now see the firefox-ios project in your selected directoy with the firefox-ios.xliff file in it. translating the xliff file open the firefox-ios.xliff file in your favorite text editor. in the <file> tag, add the target-language attribute with your locale code as the value (e.g., target-language="xx-xx"). be aware that there may be many <file> tags within one xliff document. each <file> tag requires the target-language attribute with your locale code as the value (e.g., target-language="xx-xx"). strings are located withi...
...rom developers and should not be translated. <trans-unit id="add to bookmarks"> <source>add to bookmarks</source> <target>agregar a marcadores</target> <note>no comment provided by engineer.</note> </trans-unit> save your translations along the way. once you've completed translation, it's important to make sure the xml in your xliff file is valid (e.g., no broken tag sets). ...
...ake sure the xml in your xliff file is valid (e.g., no broken tag sets). open the file in firefox to have it run a validity check and correct any errors it might yell about. commiting your xliff file using this command, commit your translated xliff file into your locale's directory: git commit -m "commit message here" . ...
Fonts for Mozilla 2.0's MathML engine
rmine whether you need to install additional fonts and to follow the instructions below. you may also want to check out the mozilla mathml torture test to test your installation against concrete examples. on windows: use this mathml fonts installer. on mac os x lion (10.7) and higher versions, stix fonts are already installed and can be used for mathml. on most linux distributions and similar open source platforms, you can install math fonts (stix, asana or mathjax fonts) from your package manager or get them from this zip archive. on android, firefox os and other platforms where the instructions above do not work: install the mathml-fonts add-on. this requires gecko 15.0 (firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) or higher. overview mathematical formulas make use of various symb...
...thematical fonts as web fonts. in that case, you will see the correct rendering on these pages if you use gecko 15.0 (firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) or greater. recommended fonts the stix fonts project has been developing a comprehensive set of fonts that cover all the symbols in mathml and also contains glyphs to stretch mathematical operators. they are available under the sil open font license and should be installed for best mathml rendering. note that currently, only the fonts in /fonts/stix-general/ are used for stretching mathematical operators with stix fonts. asana math is also freely available under the sil open font license and has good support for mathematical characters. starting in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4), mozilla can also use t...
...chive of mathml fonts. the fonts may be installed by extracting the font files (which have the .otf extension) from the zip archive, then following instructions for microsoft windows, or copying the files to a ~/library/fonts folder on mac os x, or to a ~/.fonts/ directory (which may need to be created) on unix/linux systems. alternatively, follow dafont's "how to install a font". these fonts are opentype postscript fonts, which are supported by most modern operating systems. however some operating systems may not support these fonts. on such systems, it will be necessary to convert the fonts to a supported format. for example asana math is available in truetype format and there is an unofficial truetype conversion for stix fonts. the following fonts are not necessary when the above fonts are ...
DMD
that indicates if the memory reports should be anonymized; and minimize is a boolean that indicates if memory usage should be minimized first. (linux only) you can send signal 34 to the firefox process, e.g. with the following command. ...
...it's always in a temp directory, and the filenames are always of the form dmd-<pid>. desktop firefox (mac) build build with these options: ac_add_options --enable-dmd if building via try server, modify browser/config/mozconfigs/macosx64/common-opt or a similar file before pushing. launch use mach run --dmd; use --mode to choose the mode. ...
...y tapping on the icon as usual, or from the command line (as before, be sure to replace org.mozilla.fennec_$username with the app identifier as appropriate). adb shell am start -n org.mozilla.fennec_$username/.app trigger use the existing memory-report dumping hook: adb shell am broadcast -a org.mozilla.gecko.memory_dump in logcat, you should see output similar to this: i/dmd (20731): opened /storage/emulated/0/download/memory-reports/dmd-default-20731.json.gz for writing ... i/geckoconsole(20731): nsimemoryinfodumper dumped reports to /storage/emulated/0/download/memory-reports/unified-memory-report-default-20731.json.gz the path is where the memory reports and dmd reports get dumped to. you can pull them like so: adb pull /sdcard/download/memory-reports/dmd-default-20731.json.
Dynamic Library Linking
(this is admittedly an omission that should be fixed.) however, it is possible to look up symbols defined in the main executable program as follows. prlibrary *lib; void *funcptr; funcptr = pr_findsymbolandlibrary("functionname", &lib); when pr_findsymbolandlibrary returns, funcptr is the value of the function pointer you want to look up, ...
...l pr_unloadlibrary(lib) to close the library handle when you are done. platform notes to use the dynamic library loading functions on some platforms, certain environment variables must be set at run time, and you may need to link your executable programs using special linker options. this section summarizes these platform idiosyncrasies. for more information, consult the man pages for ld and dlopen (or shl_load on hp-ux) for unix, and the loadlibrary documentation for win32. dynamic library search path exporting symbols from the main executable program dynamic library search path the dynamic library search path is the list of directories in which to look for a dynamic library. each platform has its own standard directories in which to look for dynamic libraries, plus a customizable l...
...ram dynamic library search path the dynamic library search path is the list of directories in which to look for a dynamic library. each platform has its own standard directories in which to look for dynamic libraries, plus a customizable list of directories specified by an environment variable. on most unix systems, this environment variable is ld_library_path. these systems typically use dlopen to load a dynamic library. hp-ux uses shl_load to load dynamic libraries, and the environment variable specifying the dynamic library search path is shlib_path. moreover, the executable program must be linked with the +s option so that it will search for shared libraries in the directories specified by shlib_path at run time. alternatively, you can enable the +s option as a postprocessing step u...
NSS FAQ
Mozilla › Projects › NSS › FAQ
general questions what is network security services (nss) nss is set of libraries, apis, utilities, and documentation designed to support cross-platform development of security-enabled client and server applications. it provides a complete open-source implementation of the crypto libraries used by mozilla and other companies in the firefox browser, aol instant messenger (aim), server products from red hat, and other products. for an overview of nss, see overview of nss. for detailed information on the open-source nss project, see nss project page. what can i do with nss? is nss appropriate for my application? if you want add support for ssl, s/mime, or other internet security standards to your application, you can use network security services (nss) to do so. because nss provides ...
...ause nss provides complete support for all versions of ssl and tls, it is particularly well-suited for applications that need to communicate with the many clients and servers that already support the ssl protocol. the pkcs #11 interface included in nss means that your application can use hardware accelerators on the server and smart cards for two-factor authentication. how does nss compare to openssl? openssl is an open source project that implements server-side ssl, tls, and a general-purpose cryptography library. it does not support pkcs #11. it is based on the ssleay library developed by eric a. young and tim j. hudson. openssl is widely used in apache servers and is licensed under an apache-style licence. nss supports both server and client applications as well as pkcs #11 and s/mim...
...emantics for network i/o and threading models. you can use nspr throughout your application or only in the portion that calls into nss. mozilla strongly recommends that multithreaded applications use the nspr or native os threading model. (in recent nspr releases, the nspr threading model is compatible with the native threading model if the os has native threads.) alternatively, you can adapt the open-source nspr implementation to be compatible with your existing application's threading models. more information about nspr may be found at netscape portable runtime. can i use nss even if my application protocol isn't http? yes, tls is independent of application protocols. it works with common internet standard application protocols (http, pop3, ftp, smtp, etc.) as well as custom application pr...
PKCS #11 Module Specs
utf8 characters dropped). fipsslotdescription override the default slotdecription value for the internal fips token returned in the ck_slot_info structure with an internationalize string (utf8). this value will be truncated at 64 bytes (no null, partial utf8 characters dropped). flags comma separated list of flag values, parsed case-insensitive. flags valid flags are: nomoddb don't open secmod.db and try to supply the strings. the mod db function is not through standard pkcs #11 interfaces. readonly databases should be opened read only. nocertdb don't try to open a certificate database. nokeydb don't try to open a key database. forceopen don't fail to initialize the token if the databases could not be opened. passwordrequired zero length passwords are not acceptab...
... allocate smaller hash tables and lock tables. when this flag is not specified, softoken will allocate large tables to prevent lock contention. tokens configure 'tokens' by hand. the tokens parameter specifies a space separated list of slotids, each of which specify their own set of parameters affecting that token. typically 'tokens' would not be specified unless additional databases are to be opened as additional tokens. if tokens is specified, then all tokens (including the default tokens) need to be specified. if tokens is not specified, then softoken would default to the following specs: in non-fips mode: tokens=<0x01=[configdir=configdir tokendescription=cryptotokendescription slotdescription=cryptoslotdescription flags=nocertdb,nokeydb,optimizespace] 0x02=[configdir=configdir token...
...slotdescription the slotdescription value for this token returned in the ck_slot_info structure with an internationalize string (utf8). this value will be truncated at 64 bytes (no null, partial utf8 characters dropped). minpwlen minimum password length for this token. flags comma separated list of flag values, parsed case-insensitive. valid flags are: readonly databases should be opened read only. nocertdb don't try to open a certificate database. nokeydb don't try to open a key database. forceopen don't fail to initialize the token if the databases could not be opened. passwordrequired zero length passwords are not acceptable (valid only if there is a keydb). optimizespace allocate smaller hash tables and lock tables. when this flag is not specified, ...
PKCS11 Implement
calls c_inittoken. c_initpin the nss calls c_initpin only in the key generation case, as noted in this document under c_gettokeninfo, when cfk_login_required = true and cfk_user_pin_initialized = false. c_setpin called only in the key generation case, as noted in this document under c_gettokeninfo, when cfk_login_required = true and cfk_user_pin_initialized = false. ...
...n the nss calls c_initpin only in the key generation case, as noted in this document under c_gettokeninfo, when cfk_login_required = true and cfk_user_pin_initialized = false. c_setpin called only in the key generation case, as noted in this document under c_gettokeninfo, when cfk_login_required = true and cfk_user_pin_initialized = false. ...
...ed in this document under c_gettokeninfo, when cfk_login_required = true and cfk_user_pin_initialized = false. c_setpin called only in the key generation case, as noted in this document under c_gettokeninfo, when cfk_login_required = true and cfk_user_pin_initialized = false. session management c_opensession the nss calls c_opensession whenever it initializes a token and keeps the session open as long as possible. the nss almost never closes a session after it finishes doing something with a token. it uses a single session for all single-part rsa operations such as logging in, logging out, signing, verifying, generating keys, wrapping keys, and so on. the nss opens a separate session for each part of a multipart encryption (bulk encryption). if it runs out of sessions, it uses the init...
sslintro.html
pr. must be called before any other nss functions. pk11_setpasswordfunc. sets the global callback function to obtain passwords for pkcs #11 modules. required. nss_init. sets up configuration files and performs other tasks required to run network security services. nss_init is not idempotent, so call it only once. required. ssl_optionsetdefault. changes default values for all subsequently opened sockets as long as the application is running (compare with ssl_seturl which only configures the socket that is currently open). this function must be called once for each default value that needs to be changed. optional. nss_setdomesticpolicy, nss_setexportpolicy, nss_setfrancepolicy, or ssl_cipherpolicyset. these functions tell the library which cipher suites are permitted by policy (for e...
...single-process application. required for single-process server applications. ssl_configmpserversidcache. sets up parameters for a server cache for a multi-process application. required for multi-process server applications. you can use either this function or ssl_configserversessionidcache, not both. configuration the configuration portion of an ssl-enabled application typically begins by opening a new socket and then importing the new socket into the ssl environment: pr_newtcpsocket. opens a new socket. a legal nspr socket is required to be passed to ssl_importfd, whether it is created with this function or by another method. ssl_importfd. makes an nspr socket into an ssl socket. required. brings an ordinary nspr socket into the ssl library, returning a new nspr socket that can...
... ...
Split object
bject of page b in another tab tb. the window object for tab tb must persist as the user navigates from page to page in that tab. to the script in page a, the window must appear to be a single object that moves from page to page. but each web page must load with fresh globals. (the problem is even a bit subtler than this, since the reference may be direct or indirect. the script in a might have opened tb by calling window.open, which returns a direct reference to tb's window. more indirectly, suppose there's a javascript function defined in page b that refers to global variables in page b. if page a gets a reference to that function, then by calling it, it is indirectly accessing tab tb's window. the function object carries a reference to the window, via the scope chain. to further complicat...
...eges are granted to js code on the basis of the scope chain of the executing code. spidermonkey walks up the scope chain to the nearest object that has jsprincipals attached. the end of the scope chain is the global object for the script. but what jsprincipals should be attached to a window object? the principals of the page the window is currently displaying? but then the page that called window.open could use a with statement to inject that window into its scope chain, gaining access to that window's privileges. (note: with does add an object to the scope chain, but it's a special with wrapper object that is skipped, or something, during the search described here. this security feature is not peculiar to split objects. ...and yet, there is special code in jsobj.h with a comment about fixing ...
...g some kind of interaction between with an split objects. write that down, it'll be on the test.) split objects were the solution. the inner window object is different for each page a browser window visits. it serves as the "globals" object and provides the jsprincipals for scripts on that page. access to inner window properties is fast. the outer window object is the object returned by window.open. it represents the window or tab itself and survives as the user navigates in that window or tab. the window object's jsclass.resolve hook ensures that properties of the inner object are visible via the outer object, if the running code has the right principals to access them. this privilege check may be slow. see wikimo:gecko:splitwindow and bug 296639 for more discussion. see also http://groups...
Handling Mozilla Security Bugs
d be exposed, users' data could be destroyed, and users' systems could be used as platforms for attacks on other systems. thus people have strong feelings about how security-related bugs are handled, and in particular about the degree to which information about such bugs is publicly disclosed. the mozilla project is a public software development project, and thus we have an inherent bias towards openness. in particular, we understand and acknowledge the concerns of those who believe that all information about security vulnerabilities should be publicly disclosed as soon as it is known, so that users may take immediate steps to protect themselves and so that problems can get the maximum amount of developer attention and be fixed as soon as possible. at the same time, the mozilla project recei...
...hat group can and will be expanded as necessary and appropriate. as noted above, information about security bugs can be held confidential for some period of time; there is no pre-determined lmit on how long that time period might be. however, this is offset by the fact that the person reporting a bug has visibility into the activities (if any) being taken to address the bug, and has the power to open the bug report for public scrutiny. the remaining sections of this document describe in more detail how these general policies have been implemented in practice. organizational structure for handling security bugs we are organizing the investigation and fixing of mozilla security vulnerabilities similar to the way mozilla project activities are handled in general: there will be a security mod...
...similar to the way mozilla project activities are handled in general: there will be a security module owner, a small core of active contributors who can act as peers to the module owner, a larger group of less active participants, and other people who may become involved from time to time. as with other parts of the mozilla project, participation in the mozilla security-related activities will be open to both independent volunteers and to employees of the various corporations and other organizations involved with mozilla. the mozilla security module owner and peers the mozilla security module owner will have a similar level of power and responsibility as other mozilla module owners. also, as with other mozilla module owners, mozilla.org staff will oversee the work of the security module owne...
places.sqlite Database Troubleshooting
r. before you proceed, make a backup of the firefox profile folder, in any case. create a folder to use temporarily for this work, such as my_work_folder. copy places.sqlite-corrupt from the firefox profile folder to the work folder. download the latest precompiled binary sqlite command-line shell from: https://www.sqlite.org/download.html extract sqlite3 executable into the work folder. ...
...folder, in any case. create a folder to use temporarily for this work, such as my_work_folder. copy places.sqlite-corrupt from the firefox profile folder to the work folder. download the latest precompiled binary sqlite command-line shell from: https://www.sqlite.org/download.html extract sqlite3 executable into the work folder. open a terminal window and navigate to the work folder. ...
... let's fix the schema version. ...
The Publicity Stream API
eral application messaging system. accessing the api the publicity api can be enabled by including a javascript library. this library will detect whether native api support is enabled by the user's browser, if not it will shim in a pure html implementation. [is this still doable?] the javascript library should be included from: https://myapps.mozillalabs.com/jsapi/publicity.js all apis related to open web applications are accessed under the navigator.apps object. publicity stream api (navigator.apps.publicity.*) the publicity api is exposed as properties on the navigator.apps.publicity object. publicizeactivity( <activity>, [ { [ onsuccess: <function> ], [ onerror: <function> ] } ]): applications should call this method when an user-initiated activity deemed attractive to potential cons...
...nd authorization with the stream server) registers the activity in a stream at [address]. this stream can be pulled down by getpublicitystream() and helps determine the results for getuserrecommendedapps(). example use cases: 'adam got a high score in mafia wars', 'bethany bought a plane ticket to the caribbean', etc. activity is an object, formatted as per the fixme: deadlinkactivity streams open specification. onsuccess is a callback that will be invoked with no arguments if the activity is successfully posted. onerror is an error callback that will be invoked if the publicity fails. possible error codes include: denied - if the user refuses to publicize the activity permissiondenied - if the publicizing site is not allowed to post to the publicity stream networkerror - i...
...ublicity stream in any way (please use your own server for any in-app social aspects). it is suggested that the list be processed and condensed into an attractive, cohesive format for users (eg., multiple tweets show as 'adam tweeted 4 times'). onsuccess will be called with a single argument: a json list of the current user's socially relevant app activity in the fixme: deadlinkactivity streams open specification. onerror is an error callback that will be invoked if the installation fails. possible error codes include: denied - if the user does not log in correctly permissiondenied - if the site is not allowed to access the publicity stream networkerror - if the publicity server is unreachable for_apps is a json list of apps that this store has (each represented as its ori...
Using XPCOM Components
wser, to other gecko-based xul, and to javascript environments like xpcshell, which is a command-line javascript interpreter and xpcom tool is built with mozilla. see http://www.mozilla.org/scriptable/ for more information about xpconnect and javascript. this isn't quite all there is to it, of course, but this shows an important aspect of xpcom. the contractual arrangements that xpcom enforces open up the way to binary interoperability - to being able to access, use, and reuse xpcom components at runtime. and they make it possible to use components written in other languages - such as javascript, python, and others - and to use c++-based xpcom components from these other languages as well. in the mozilla browser, components are used as often from javascript in the interface as they are fro...
... the xpcom component viewer the xpcom component viewer is an add-on you can install in your browser (in sandbox, not available for now). alternatively, you can try xpcomviewer, a similar add-on. xpcom component viewer the left column shows the components - in this case a subset returned from a search on "gfx" as part of the contract id and the right column a list of the interfaces. when you open a component on the left, you can see the interfaces it implements along with a list of the methods provided by each interface. the xpcom component viewer can be extremely useful for this sort of gross interrogation, but again: it displays all of the components and interfaces in your build, many of which are not practical for actual reuse or stable enough to be used reliably in your own applicati...
... not have the same requirements as the ones that are made available publicly in idl. note: cookie-manager-in-tutorial the cookiemanager component is used to persist for the web locking functionality described in this tutorial. « previousnext » copyright (c) 2003 by doug turner and ian oeschger. this material may be distributed only subject to the terms and conditions set forth in the open publication license, v1.02 or later. distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder. ...
nsIAppShellService
obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) creates the initial state of the application by launching tasks specfied by "general.startup.*" prefs. note: size_to_content may be used for width or height. boolean createstartupstate( in long awindowwidth, in long awindowheight ); parameters awindowwidth the width to make the initial window(s) opened. awindowheight the height to make the initial window(s) opened. return value true if a window was opened. createtoplevelwindow() this method creates a window, which will be initially invisible. nsixulwindow createtoplevelwindow( in nsixulwindow aparent, in nsiuri aurl, in boolean ashowwindow, in boolean aloaddefaultpage, in pruint32 achromemask, in long ainitialwidth, in l...
...stwindowclosingsurvivalarea() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) void exitlastwindowclosingsurvivalarea(); parameters none. native code only!gethiddenwindowandjscontext return the (singleton) application hidden window as an nsidomwindow, and, the corresponding javascript context pointer. this is useful if you'd like to subsequently call opendialog on the hidden window. void gethiddenwindowandjscontext( out nsidomwindow ahiddendomwindow, out jscontext ajscontext ); parameters ahiddendomwindow the hidden window queryinterface'd to type nsidomwindow. ajscontext the corresponding javascript context. hidesplashscreen() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) remove...
... (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) runs an application event loop: normally the main event pump which defines the lifetime of the application. void run(); parameters none. toplevelwindowismodal() obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) the appshell service needs to be informed of modal xul windows currently open. call this method as a window becomes modal or as it becomes nonmodal. void toplevelwindowismodal( in nsixulwindow awindow, in boolean amodal ); parameters awindow the window to register. amodal true if awindow is becoming modal or false if awindow is becoming nonmodal (or being closed). unregistertoplevelwindow() remove a window from the application's window registry. note: this...
nsIChannelEventSink
tical to the old one. methods asynconchannelredirect() called when a redirect occurs. this may happen due to an http 3xx status code. this method notifies the sink that a redirect is about to happen, but also to gives the sink the right to veto the redirect by throwing an exception or passing a failure code in the callback. note: vetoing the redirect simply means that newchannel will not be opened. it is important to understand that oldchannel will continue loading as if it received a response of http 200, which includes notifying observers and possibly display or process content attached to the http response. if the sink wants to prevent this loading it must explicitly deal with it, e.g. by calling oldchannel->cancel() there is a certain freedom in implementing this method: if the retur...
... that an error occurred, in which case an exception is thrown, the redirect is vetoed and no callback must be done. void asynconchannelredirect( in nsichannel oldchannel, in nsichannel newchannel, in unsigned long flags, in nsiasyncverifyredirectcallback callback ); parameters oldchannel the channel that's being redirected. newchannel the new channel. this channel is not opened yet. flags flags indicating the type of redirect. a bitmask consisting of flags from above. one of redirect_temporary and redirect_permanent will always be set. callback object to inform about the async result of this method. exceptions thrown this method can throw any exception; if an exception occurs, the load will be canceled, and no network requests will occur for the new c...
... obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) called when a redirect occurs. this may happen due to an http 3xx status code. void onchannelredirect( in nsichannel oldchannel, in nsichannel newchannel, in unsigned long flags ); parameters oldchannel the channel that's being redirected. newchannel the new channel. this channel is not opened yet. flags flags indicating the type of redirect. a bitmask consisting of flags from above. one of redirect_temporary and redirect_permanent will always be set. see also nsichannel nsihttpchannel ...
nsIContentViewer
oid getbounds(in nsintrectref abounds); native code only! [noscript,notxpcom] nsidocumentptr getdocument(); void hide(); void init(in nsiwidgetptr aparentwidget, [const] in nsintrectref abounds); native code only! void loadcomplete(in unsigned long astatus); void loadstart(in nsisupports adoc); void move(in long ax, in long ay); void open(in nsisupports astate, in nsishentry ashentry); void pagehide(in boolean isunload); boolean permitunload([optional] in boolean acallercloseswindow); boolean requestwindowclose(); void resetclosewindow(); void setbounds([const] in nsintrectref abounds); native code only! void setdocumentinternal(in nsidocumentptr adocument, in boolean aforce...
... ashentry the history entry that the content viewer was stored in. the entry must have the docshells for all of the child documents stored in its child shell list. pagehide...
...ng exception missing description loadstart() void loadstart( in nsisupports adoc ); parameters adoc missing description exceptions thrown missing exception missing description move() void move( in long ax, in long ay ); parameters ax missing description ay missing description open() attaches the content viewer to its dom window and docshell. void open( in nsisupports astate, in nsishentry ashentry ); parameters astate a state object that might be useful in attaching the dom window. ashentry the history entry that the content viewer was stored in. the entry must have the docshells for all of the child documents stored in its child shell list. pagehide() void pagehide( in boolean isunload ); parameters isunload ...
nsIDOMNSHTMLDocument
changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview void captureevents(in long eventflags); void clear(); boolean execcommand(in domstring commandid, in boolean doshowui, in domstring value); boolean execcommandshowhelp(in domstring commandid); obsolete since gecko 14.0 domstring getselection(); nsidomdocument open(in acstring acontenttype, in boolean areplace); boolean querycommandenabled(in domstring commandid); boolean querycommandindeterm(in domstring commandid); boolean querycommandstate(in domstring commandid); boolean querycommandsupported(in domstring commandid); domstring querycommandtext(in domstring commandid); obsolete since gecko 14.0 domstr...
...dth long the width of the body element. read only. obsolete since gecko 6.0 methods captureevents() provided for compatibility with netscape 4.x, but does not actually do anything. void captureevents( in long eventflags ); parameters eventflags clear() used to reset a document to blank, but deprecated since gecko 1.0 and provided for compatibility with netscape 4.x; use open() and close() instead. void clear(); parameters none. execcommand() boolean execcommand( in domstring commandid, in boolean doshowui, in domstring value ); parameters commandid the name of the command to execute. see rich-text editing in mozilla for a list of supported commands. doshowui this is not implemented in gecko. value some commands require an argument. yo...
...cko 14.0 (firefox 14.0 / thunderbird 14.0 / seamonkey 2.11). boolean execcommandshowhelp( in domstring commandid ); parameters commandid the name of the command. return value this method is not supported and always throws an exception. getselection() domstring getselection(); parameters none. return value the text of the current selection, the same as window.getselection.tostring(). open() nsidomdocument open( in acstring acontenttype, in boolean areplace ); parameters acontenttype the content type of the new document. if the type is not supported by the html content sink, trying to write to the document will probably throw. areplace whether the document should replace the existing document in session history. return value the new document. querycommandenab...
nsIDOMWindowInternal
ged in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) in gecko 8.0 this interface was merged into the nsidomwindow interface. this interface no longer has any members; it exists solely to prevent add-ons that reference it from failing completely. add-ons should be updated to use nsidomwindow instead. it provides many of the common functions used in javascript such as alert() or open(). note: because most of nsidomwindowinternal's functions and attributes are well documented in window, those articles are linked to rather than re-documented. however, they are not guaranteed to document all available arguments (i.e. see window.prompt). method overview firefox 3.5 note the prompt() and find() methods changed in firefox 3.5 to make all their parameters optional; in previou...
...k() void forward() void home() void stop() void print() void moveto(in long xpos, in long ypos) void moveby(in long xdif, in long ydif) void resizeto(in long width, in long height) void resizeby(in long widthdif, in long heightdif) void scroll(in long xscroll, in long yscroll) nsidomwindow window interface's open() method loads the specified resource into the browsing context (window, <iframe> or tab) with the specified name. if the name doesn't exist, then a new window is opened and the specified resource is loaded into its browsing context.">open(in domstring url, in domstring name, in domstring options) nsidomwindow nsisupports aextraargument) void close() void updatecommands...
...ced window is closed or not. crypto nsidomcrypto readonly: returns the browser crypto object, which can then be used to manipulate various browser security features. pkcs11 nsidompkcs11 obsolete: this property is not supported in newer versions of firefox. controllers nsicontrollers readonly: returns the xul controllers of the chrome window. opener nsidomwindowinternal returns a reference to the window that opened this current window. status domstring sets the text in the status bar at the bottom of the browser or returns the previously set text. defaultstatus domstring gets/sets the status bar text for the given window. location nsidomlocation readonly: returns a nsidomlocation object, ...
nsIDownloadManager
n boolean aisprivate); void addlistener(in nsidownloadprogresslistener alistener); void canceldownload(in unsigned long aid); void cleanup(); void endbatchupdate(); obsolete since gecko 1.9.1 void flush(); obsolete since gecko 1.8 nsidownload getdownload(in unsigned long aid); void onclose(); obsolete since gecko 1.9.1 void open(in nsidomwindow aparent, in nsidownload adownload); obsolete since gecko 1.9.1 void openprogressdialogfor(in nsidownload adownload, in nsidomwindow aparent, in boolean acanceldownloadonclose); obsolete since gecko 1.9.1 void pausedownload(in unsigned long aid); void removedownload(in unsigned long aid); void removedownloadsbytimeframe(in long long abegintime, ...
...obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. called when the download manager front end is closed. useful for third party managers to let us know when they've closed. void onclose(); parameters none. open() obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) opens the download manager front end. void open( in nsidomwindow aparent, in nsidownload adownload ); parameters aparent the parent, or opener, of the front end. adownload a download to pass to the manager window. useful if, for example, you want the window to select a certain download. o...
... front end. adownload a download to pass to the manager window. useful if, for example, you want the window to select a certain download. openprogressdialogfor() obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. opens an individual progress dialog displaying progress for the download. void openprogressdialogfor( in nsidownload adownload, in nsidomwindow aparent, in boolean acanceldownloadonclose ); parameters adownload the download object to display progress for, as returned by getdownload() or adddownload(). aparent the parent, or opener, of the front end. acanceldownloadonclose whether clos...
nsIDownloadManagerUI
void show([optional] in nsiinterfacerequestor awindowcontext, [optional] in unsigned long aid, [optional] in short areason); attributes attribute type description visible boolean true if the download manager ui is visible; otherwise false. read only. constants constant value description reason_user_interacted 0 when opening the download manager user interface, this value indicates that it's being done at the user's request. reason_new_download 1 when opening the download manager user interface, this value indicates that the user interface is being displayed because a new download is being started. methods getattention() calls attention to the download manager's user interface if it's alrea...
... the download manager user interface, this value indicates that it's being done at the user's request. reason_new_download 1 when opening the download manager user interface, this value indicates that the user interface is being displayed because a new download is being started. methods getattention() calls attention to the download manager's user interface if it's already open. the ui need not be visible to call this function, nor will the ui be made visible. void getattention(); parameters none. exceptions thrown ns_error_unexpected the user interface isn't currently open. show() shows the download manager's user interface to the user. void show( in nsiinterfacerequestor awindowcontext, optional in unsigned long aid, optional in short areason option...
...e user. void show( in nsiinterfacerequestor awindowcontext, optional in unsigned long aid, optional in short areason optional ); parameters awindowcontext optional the parent window context to show the user interface. with this information, it's possible to put the download manager in a tab in the same window as the parent. aid optional the id of the download to be preselected upon opening the download manager ui. areason optional one of the reason constants indicating why the user interface should be displayed. see also the download manager schema ...
nsIExternalProtocolService
astring getapplicationdescription( in autf8string ascheme ); parameters ascheme the scheme to look up. for example, "mms". return value this code makes little sense and needs to be cleaned up. ...
...edprotocol() check whether a handler for a specific protocol is "exposed" as a visible feature of the current application. an exposed protocol handler is one that can be used in all contexts. a non-exposed protocol handler is one that can only be used internally by the application. for example, a non-exposed protocol would not be loaded by the application in response to a link click or a x-remote openurl command. instead, it would be deferred to the system's external protocol handler. boolean isexposedprotocol( in string aprotocolscheme ); parameters aprotocolscheme the scheme from a url: http, ftp, mailto, and so on. return value true if the protocol is exposed, false otherwise. loaduri() used to load a uri via an external application. might prompt the user for permission to load the ext...
...a an external application. might prompt the user for permission to load the external application. void loaduri( in nsiuri auri, [optional] in nsiinterfacerequestor awindowcontext ); parameters auri the uri to load. awindowcontext the window to parent the dialog against, and, if a web handler is chosen, it is loaded in this window as well. this parameter may be ultimately passed nsiuriloader.openuri() in the case of a web handler, and awindowcontext is null or not present, web handlers will fail. loadurl() used to load a url via an external protocol handler (if one exists). void loadurl( in nsiuri aurl ); parameters aurl the url to load. setprotocolhandlerdefaults() set some sane defaults for a protocol handler object. void setprotocolhandlerdefaults( in nsihandlerinfo ahandlerinf...
nsIFileOutputStream
/public/nsifilestreams.idlscriptable this interface is an output stream that lets you stream to a file. inherits from: nsioutputstream last changed in gecko 1.7 method overview void init(in nsifile file, in long ioflags, in long perm, in long behaviorflags); constants behavior flag constants constant value description defer_open 1<<0 see the same constant in nsifileinputstream. the deferred open will be performed when one of the following is called: seek() tell() write() flush() defer_open is useful if we use the stream on a background thread, so that the opening and possible stating of the file happens there as well. note: ...
...this means that any errors that might happen when this flag is not set would happen during the first write, and if the file is to be created, it will not appear on the disk until the first write. ...
...rrors that might happen when this flag is not set would happen during the first write, and if the file is to be created, it will not appear on the disk until the first write. methods init() void init( in nsifile file, in long ioflags, in long perm, in long behaviorflags ); parameters file file to write to (must qi to nsilocalfile) ioflags file open flags listed are listed in the pr_open() documentation. use -1 to open the file in default mode (pr_wronly | pr_create_file | pr_truncate). perm file mode bits are described in the pr_open documentation. if set to -1 the default permissions (0664) will be used. behaviorflags flags specifying various behaviors of the class; see behavior flag constants above. see also ...
nsIFileStreams
in gecko 1.9 (firefox 3) inherits from: nsisupports method overview void init(in nsifile file, in long ioflags, in long perm, in long behaviorflags); constants constants value description delete_on_close 1<<1 if this is set, the file will be deleted by the time the stream is closed. it may be removed before the stream is closed if it is possible to delete it and still read from it. ...
...le will be deleted by the time the stream is closed. it may be removed before the stream is closed if it is possible to delete it and still read from it. if open_on_read is defined, and the file was recreated after the first delete, the file will be deleted again when it is closed again. close_on_eof 1<<2 if this is set, the file will close automatically when the end of the file is reached. reopen_on_rewind 1<<3 if this is set, the file will be reopened whenever seek(0) occurs. if the file is already open and the seek occurs, it will happen naturally. ...
...he file was recreated after the first delete, the file will be deleted again when it is closed again. close_on_eof 1<<2 if this is set, the file will close automatically when the end of the file is reached. reopen_on_rewind 1<<3 if this is set, the file will be reopened whenever seek(0) occurs. if the file is already open and the seek occurs, it will happen naturally. (the file will only be reopened if it is closed for some reason.) methods init() void init( in nsifile file, in long ioflags, in long perm, in long behaviorflags ); parameters file file to read from (must qi to nsilocalfile). ioflags file open flags listed in prio.h (see pr_open documentation) or -1 to open the file in default mode (pr_rdonly). perm file mode bits listed in prio.h or -1 to use the defau...
nsIFrameScriptLoader
jsval getdelayedframescripts(); loadframescript() load a script in the remote frame. frame scripts are loaded as soon as loadframescript() is called. if this function is called on a chromemessagebroadcaster (for example, a global frame message manager or a window message manager) then: loadframescript() will load the frame script independently into each applicable frame: every open frame in the given window for the window message manager, or every frame in every window for the global message manager if aallowdelayedload is true, then the script will also be loaded into any applicable new frames opened after the loadframescript() call. otherwise it will only be loaded into frames that exist at the time of the call. if this function is called on a chromemessagesender: i...
...ld always be true. it's possible that the frame for this chromemessagesender is not yet available at the time of the loadframescript() call, and if you pass false in this situation, your process script won't be loaded. for example: let windowmm = window.messagemanager; windowmm.loadframescript('data:,dump("foo\n");', true); this will load a separate instance of the frame script into every tab open in the window associated with this window message manager. as the user opens new tabs in this window, copies of the script will be loaded into these new tabs, as well. frame scripts are essentially per-tab, so they don't get reloaded when the user navigates. if you want a frame script to do something whenever a new document is loaded, you can listen for the document-element-inserted notification...
...s loaded, you can listen for the document-element-inserted notification. parameters name type description aurl string url for the script to load. aurl must be the absolute url. data: urls are also supported. for example data:,dump("foo\n"); aallowdelayedload boolean if true, this flag means that the frame script will be loaded into any new frames opened after the loadframescript() call, until removedelayedframescript() is called for that script. aruninglobalscope boolean optional, defaults to false. by default, frame scripts each have their own scope, so they can declare global variables without causing conflicts with any other frame scripts. if present and set to true, this flag switches off that behavior, meaning tha...
nsILocalFileMac
pe aappcreator); native code only! obsolete since gecko 2.0 void initwithcfurl(in cfurlref acfurl); native code only! void initwithfsref([const] in fsrefptr afsref); native code only! void initwithfsspec([const] in fsspecptr afilespec); native code only! ...
...solete since gecko 2.0 void initwithcfurl(in cfurlref acfurl); native code only! void initwithfsref([const] in fsrefptr afsref); native code only! void initwithfsspec([const] in fsspecptr afilespec); native code only! ...
...value true if a directory is determined to be a package under mac os 9/x. launchwithdoc() launch the application that this file points to with a document. void launchwithdoc( in nsilocalfile adoctoload, in boolean alaunchinbackground ); parameters adoctoload must not be null. if no document, use nsilocalfile::launch. alaunchinbackground true if the application should not come to the front. opendocwithapp() open the document that this file points to with the given application. void opendocwithapp( in nsilocalfile aapptoopenwith, in boolean alaunchinbackground ); parameters aapptoopenwith the application with which to open the document. if null, the creator code of the document is used to determine the application. alaunchinbackground true if the application should not come to the f...
nsIMenuBoxObject
represents the box object for a xul menu. ...
...bject for a xul menu. inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) to get access to the box object for a given menu, use code like this: var boxobject = xulmenu.boxobject.queryinterface(components.interfaces.nsimenuboxobject); method overview boolean handlekeypress(in nsidomkeyevent keyevent); void openmenu(in boolean openflag); attributes attribute type description activechild nsidomelement the currently active menu or menuitem child of the menu box. openedwithkey boolean true if the menubar was opened using the keyboard; otherwise false. note: for gecko 2.0, the openedwithkey attribute exists on the nsimenuboxobject_mozilla_2_0_branch interface. subseque...
...e: for gecko 2.0, the openedwithkey attribute exists on the nsimenuboxobject_mozilla_2_0_branch interface. subsequent gecko versions will have the attribute on the nsimenuboxobject interface. methods handlekeypress() boolean handlekeypress( in nsidomkeyevent keyevent ); parameters keyevent the key event to handle for the menu. return value true if the event was handled, false if not. openmenu() void openmenu( in boolean openflag ); parameters openflag true to open the menu or false to close it. see also nsiboxobject menu ...
nsIMsgDatabase
the nsimsgdatabase interface is an abstract interface used to access the mail database backend. mailnews/db/msgdb/public/nsimsgdatabase.idlscriptable please add a summary to this article. ...
... nextpseudomsgkey nsmsgkey for undo-redo of move pop->imap. nextfakeofflinemsgkey nsmsgkey readonly: for saving "fake" offline msg hdrs. defaultviewflags nsmsgviewflagstypevalue readonly: defaultsorttype nsmsgviewsorttypevalue readonly: defaultsortorder nsmsgviewsortordervalue readonly: msghdrcachesize unsigned long folderstream nsioutputstream summaryvalid boolean methods open() opens a database folder. void open(in nsilocalfile afoldername, in boolean acreate, in boolean aleaveinvaliddb); parameters afoldername the name of the folder to create. acreate whether or not the file should be created. aleaveinvaliddb set to true if you do not want the database to bedeleted if it is invalid. exceptions thrown ns_error_file_target_does_not_exist afol...
...an aleaveinvaliddb); parameters afoldername the name of the folder to create. acreate whether or not the file should be created. aleaveinvaliddb set to true if you do not want the database to bedeleted if it is invalid. exceptions thrown ns_error_file_target_does_not_exist afoldername doesn't exist and acreate was false. ns_msg_error_folder_summary_out_of_date the database is present (and was opened), but the summary file is out of date. ns_msg_error_folder_summary_missing the database is present (and was opened), but the summary file is missing. forcefolderdbclosed() void forcefolderdbclosed(in nsimsgfolder afolder); parameters afolder close() void close(in boolean aforcecommit); parameters aforcecommit commit() void commit(in nsmsgdbcommit committype); parameters committype ...
nsINavHistoryResultViewer
his feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. note: most methods in this interface were renamed in gecko 1.9.2, and others have slightly different parameter lists. ...
...ingmode); attributes attribute type description result nsinavhistoryresult the nsinavhistoryresult this viewer monitors. although this attribute is read-write, you should not alter it directly; instead, use the nsinavhistoryresult.viewer attribute to set the viewer. ...
...attribute is read-write, you should not alter it directly; instead, use the nsinavhistoryresult.viewer attribute to set the viewer. methods containerclosed() called when a container node's state changes from closed to opened. void containerclosed( in nsinavhistorycontainerresultnode acontainernode ); parameters acontainernode the container node whose state changed. containeropened() called when a container node's state changes from closed to opened. void containeropened( in nsinavhistorycontainerresultnode acontainernode ); parameters acontainernode the container node whose state changed. invalidatecontainer() called when something has happened that requires that the contents of a container be rebuilt. void invalidatecontainer( in nsinavhistorycontaine...
nsIProgressEventSink
nd progress information that is generally not critical to the processing of the channel. the information is intended to be displayed to the user in some meaningful way. an implementation of this interface can be passed to a channel via the channel's notificationcallbacks attribute. see nsichannel for more info. the channel will begin passing notifications to the progress event sink after its asyncopen method has been called. notifications will cease once the channel calls its listener's onstoprequest method or once the channel is canceled (via nsirequest.cancel()). note: this interface is actually not specific to channels and may be used with other implementations of nsirequest. method overview void onprogress(in nsirequest arequest, in nsisupports acontext, in unsigned long lon...
...hat progress has occurred for the given request. void onprogress( in nsirequest arequest, in nsisupports acontext, in unsigned long long aprogress, in unsigned long long aprogressmax ); parameters arequest the request being observed (may qi to nsichannel). acontext if arequest is a channel, then this parameter is the listener context passed to nsichannel.asyncopen(). aprogress numeric value in the range 0 to aprogressmax indicating the number of bytes transfered thus far. aprogressmax numeric value indicating maximum number of bytes that will be transfered (or 0xffffffffffffffff if total is unknown). onstatus() called to notify the event sink with a status message for the given request. void onstatus( in nsirequest arequest, ...
...alled to notify the event sink with a status message for the given request. void onstatus( in nsirequest arequest, in nsisupports acontext, in nsresult astatus, in wstring astatusarg ); parameters arequest the request being observed (may qi to nsichannel). acontext if arequest is a channel, then this parameter is the listener context passed to nsichannel.asyncopen(). astatus status code (not necessarily an error code) indicating the state of the channel (usually the state of the underlying transport). see nsisockettransport for socket specific status codes. astatusarg status code argument to be used with the string bundle service to convert the status message into localized, human readable text. the meaning of this parameter is ...
nsIProtocolHandler
a principal that subsumes this uri. for example, privileged code and websites that are same origin as this uri. uri_non_persistable 1<<10 loading channels from this protocol has side-effects that make it unsuitable for saving to a local file. ...
... allows_proxy 1<<2 this protocol handler can be proxied via socks or http (such as irc, smtp, and http, for example). ...
... allows_proxy 1<<2 this protocol handler can be proxied via socks or http (such as irc, smtp, and http, for example). if the protocol supports transparent proxying, the handler should implement the nsiproxiedprotocolhandler interface. ...
nsIRequest
sables validation of expired content. validate_once_per_session 1 << 13 disables validation of expired content, provided it has already been validated (at least once) since the start of this session. constant value description load_anonymous 1 << 14 when set, this flag indicates that no user-specific data should be added to the request when opened. this means that things like authorization tokens or cookie headers should not be added. note: this will prevent proxy authentications from working, so use this flag with caution. methods cancel() cancels the current request. this will close any open input or output streams and terminate any async requests. users should normally pass ns_binding_aborted, although other errors ...
...meters astatus the reason for canceling this request. ispending() indicates whether the request is pending. ispending is true when there is an outstanding asynchronous event that will make the request no longer be pending. ...
...ated (for example nsichannel implementations are only pending once asyncopen returns successfully). requests can become pending multiple times during their lifetime. note: suspended requests are still considered pending. boolean ispending(); parameters none. return value true if the request has yet to reach completion. resume() resumes the current request. this may have the effect of re-opening any underlying transport and will resume the delivery of data to any open streams. void resume(); parameters none. suspend() suspends the current request. this may have the effect of closing any underlying transport (in order to free up resources), although any open streams remain logically opened and will continue delivering data when the transport is resumed. calling cancel() on a sus...
nsIXMLHttpRequest
should avoid using those. though actually, if you use addeventlistener from c++ weird things will happen too, since the result will depend on what js happens to be on the stack when you do it.... conclusion: do not use event listeners on xmlhttprequest from c++, unless you're aware of all the security implications. and then think twice about it. ...
...clusion: do not use event listeners on xmlhttprequest from c++, unless you're aware of all the security implications. and then think twice about it. ...
...you only want this if your url is to a zip file or some file you want to download and make a nsiarraybufferinputstream out of it or something ...
XUL Overlays
Mozilla › Tech › XUL › Overlays
<menuitem name="soccer" src="brazil_soccer.ssp"/> </menupopup> <titledbutton id="ssp" crop="right" flex="1" value="&ssbutton.label;" onclick="firessp()"/> overlays and id attributes bases and overlays are merged when they share the same id attribute. thus, given the following base: ... <menu id="file-menu"> <menupopup id="menu_filepopup"> <menuitem name="new"/> <menuitem name="open"/> <menuitem name="save"/> <menuitem name="close"/> </menupopup> </menu> ... and given the following overlay: <?xml version="1.0"?> <overlay id="singleitemex" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <menupopup id="menu_filepopup"> <menu id="file_menu"> <menuitem name="super stream player"/> </m...
...ingleitemex" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <menupopup id="menu_filepopup"> <menu id="file_menu"> <menuitem name="super stream player"/> </menu> </menupopup> </overlay> the result will be: ... <menu id="file-menu"> <menupopup id="menu_filepopup"> <menuitem name="new"/> <menuitem name="open"/> <menuitem name="save"/> <menuitem name="close"/> <menuitem name="super stream player"/> </menupopup> </menu> ... if you are developing a mozilla extension, note that the id namespace is shared by all the extensions. so, in order to avoid unpredicted behaviors you will probably benefit from using a unique prefix for the ids of the xul elements of your extension. for instance, you can use...
...verlay.xul"?> and includes an empty box with an id of okcancelbuttons in the ui. the following snippet shows a dialog with custom ui elements at the top and a reference to the overlay's ok and cancel buttons at the bottom: <box align="horizontal" id="bx1" flex="100%" style="margin-bottom: 1em; width: 100%;"> <html:input type="checkbox" id="dialog.newwindow"/> <html:label for="dialog.newwindow">&openwin.label;</html:label> <spring flex="100%"/> </box> <box id="okcancelbuttons"/> for more detail, see the ok and cancel button definitions being referenced here in the global component file platformdialogoverlay.xul. toolbars, submenus, boxes, and any other subtrees that appear in multiple places can be defined in overlays files in this way and referenced for reuse wherever necessary. see also ...
Use SQLite
le/directory_service;1"]. getservice(ci.nsiproperties); var dbfile = dirservice.get("profd", ci.nsifile); dbfile.append("tbird.sqlite"); var dbservice = cc["@mozilla.org/storage/service;1"]. ...
... var dbservice = cc["@mozilla.org/storage/service;1"]. ...
...= adbservice.opendatabase(adbfile); this._dbcreatetables(dbconnection); return dbconnection; }, _dbcreatetables: function(adbconnection) { for(var name in this.dbschema.tables) adbconnection.createtable(name, this.dbschema.tables[name]); }, }; window.addeventlistener("load", function(e) { tbirdsqlite.onload(e); }, false); this is another practical sample on how to handle opendatabase and sql queries on the client side, using in-memory (blob) storage of 2mb: var db = opendatabase('mydb', '1.0', 'test db', 2 * 1024 * 1024); var msg; db.transaction(function (tx) { tx.executesql('create table if not exists logs (id unique, log)'); tx.executesql('insert into logs (id, log) values (1, "foobar")'); tx.executesql('insert into logs (id, log) values (2, "logmsg")'); ms...
Using Objective-C from js-ctypes
s and functions in addition to the above code, we need to declare function and types. types types can be readily declared. bool is defined in /usr/include/objc/objc.h. let id = ctypes.structtype("objc_object").ptr; let sel = ctypes.structtype("objc_selector").ptr; let bool = ctypes.signed_char; functions all functions in our example are exported by /usr/lib/libobjc.dylib. let lib = ctypes.open(ctypes.libraryname("objc")); function definition is the more tricky part. in this example, objc_msgsend is used in 3 ways. we need to declare three different functiontype cdatas: returns id or compatible type. returns bool. returns nothing. let objc_msgsend_id = lib.declare("objc_msgsend", ctypes.default_abi, id, id, sel, "..."); let objc_msgsend_bool = ...
...efox won't respond until the speaking is done. if this code were to be used in a production add-on, then to avoid firefox locking up, run this code from a chromeworker. ...
...ance from a js function. * blocks are regular objective-c objects in obj-c, and can be sent messages; * thus block instances need are creted using the core.wrapid() function. */ // apple docs :: working with blocks - https://developer.apple.com/library/ios/documentation/cocoa/conceptual/programmingwithobjectivec/workingwithblocks/workingwithblocks.html var _nsconcreteglobalblock = ctypes.open(ctypes.libraryname('objc')).declare('_nsconcreteglobalblock', ctypes.voidptr_t); // //github.com/realityripple/uxp/blob/master/js/src/ctypes/library.cpp?offset=0#271 /** * the "block descriptor" is a static singleton struct. probably used in more * complex block scenarios involving actual closure variables needing storage * (in `nodobjc`, javascript closures are leveraged instead). */ ...
Plug-in Development Overview - Plugins
ry entries for the plug-in described below in installation using the registry. but when the plug-in is loaded from a well-known directory, a different method must be used. in this case to ensure the plug-in file will be loaded, it should have a name in the form of "np*.dll". ...
...ve a name in the form of "np*.dll". also, the windows version information for the plug-in dll will be used to determines the mime types, file extensions, file open template, plug-in name, and description. ...
...rm of "np*.dll". also, the windows version information for the plug-in dll will be used to determines the mime types, file extensions, file open template, plug-in name, and description. ...
Accessibility Inspector - Firefox Developer Tools
slightly different information about them. assistive technologies like screenreaders use this information to find out what's on a web page, tell their users what's there, and enable them to interact with the page. the accessibility inspector also uses this information to provide valuable accessibility debugging capabilities in the devtools. accessing the accessibility inspector when you first open any of the other developer tools, the accessibility features are turned off (unless you've already got them turned on in another browser tab, or got the firefox accessibility engine started already, e.g., you might be a screenreader user or tester). this is because the accessibility engine runs in the background when the accessibility features are turned on. while it’s running, it slows perform...
...keys to expand and collapse expandable rows (e.g., different hierarchy levels of the accessibility tree). print accessibility tree to json you can print the contents of the accessibility tree to json by right-clicking on an entry in the accessibility tab and selecting print to json: when you do, you will get a new tab with the selected accessibility tree loaded into the json viewer: once opened, you can save or copy the data as necessary. the json viewer can also show you the raw json data on a separate tab in the viewer. check for accessibility issues you can check for accessibility issues by clicking the drop-down menu next to: check for issues. the available menu items include: none — don't show the possible list of issues all issues — check for all types of issues contr...
... note: some dom elements do not have accessibility properties — in that case, the inspect accessibility properties/show accessibility properties context menu item is grayed out. highlighting of ui items in the accessibility tab, when the mouse hovers over accessibility items, you can see a semi-transparent highlight app...
UI Tour - Firefox Developer Tools
files, the following context menu options are available: copy source uri copies the full identifier of the file to the clipboard. ignore source causes the debugger to skip the file when "stepping into" functions; this can be helpful for avoiding stepping into libraries used by your code. when a file is ignored, it has a small eye icon next to it in place of its regular icon. download file opens a file dialog so you can save the file locally. for folders and groups, the following context menu options are available: collapse all collapses all subfolders of the item. expand all expands all subfolders of the item. set directory root changes the source list view so that only that item and its children are visible. the name of the selected directory is shown at the top of the source...
...older menu option changes to unignore files in this directory. ignore files outside this directory causes all files other than those within the selected directory to be skipped by the debugger. all such files acquire the eye icon, and the menu option for that folder changes to unignore files outside this directory. outline view the outline view shows a tree for navigating the currently open file. use it to jump directly to a function, class or method definition. source pane this shows the javascript file currently loaded. when the source pane is focused you can search for a string in the file using ctrl + f (cmd + f on a mac). breakpoints have a blue arrow overlaid on the line number. conditional breakpoints have an orange arrow. if you're stopped at a breakpoint, the entire lin...
...he name of the function and the filename and line number. clicking a line selects the corresponding line in the source pane. note: if you click step over (f10) after changing the selected line in the source pane, the debugger executes until reaching the line following the newly-selected line (disregarding whatever line the debugger originally stopped at). right-clicking in the call stack pane opens a context menu with the following items: restart frame restarts execution at the beginning of the current frame. enable framework grouping collects items belonging to a framework into a collapsible group (for example, jquery in the screenshot above). when grouping is enabled, the menu option changes to disable framework grouping. copy source uri copies the full identifier of the source file...
Migrating from Firebug - Firefox Developer Tools
eatures you loved in firebug are available in the developer tools. the following list aims to help firebug users to find their way into the developer tools. for the latest developer tools and features, try firefox developer edition. download firefox developer edition general activation firebug's activation is url based respecting the same origin policy. that means that when you open a page on the same origin in a different tab, firebug gets opened automatically. and when you open a page of a different origin in the same tab, it closes automatically. the devtools' activation on the other hand is tab based. that means, that when you open the devtools in a tab, they stay open even when you switch between different websites. when you switch to another tab, though, they're closed...
...page on the same origin in a different tab, firebug gets opened automatically. and when you open a page of a different origin in the same tab, it closes automatically. the devtools' activation on the other hand is tab based. that means, that when you open the devtools in a tab, they stay open even when you switch between different websites. when you switch to another tab, though, they're closed. open the tools firebug can be opened by pressing f12. to open it to inspect an element it is possible to press ctrl+shift+c / cmd+opt+c. the devtools share the same shortcuts, but also provide shortcuts for the different panels. e.g. the network monitor can be opened via ctrl+shift+q / cmd+opt+q, the web console via ctrl+shift+k / cmd+opt+k and the debugger via ctrl+shift+s / cmd+opt+s. web console ...
...in the console panel. the devtools web console shows those structures directly under the "response" tab. multi-line command line firebug's console has a multi-line command line called command editor. the devtools do not have a side panel like the command editor (which is requested in bug 1133849), but therefore has a separate tool called scratchpad, which can be added as panel to the toolbox or opened in a separate window via firefox menu > developer > scratchpad or shift + f4. also, the normal command line smartly enters a line break when it recognizes an unfinished command like document. and you hit enter. you can also manually enter a line break by pressing shift + enter. response preview there is a preview tab when a network request logged to the console is expanded in firebug. the web...
Network Monitor - Firefox Developer Tools
the network monitor shows you all the network requests firefox makes (for example, when it loads a page, or due to xmlhttprequests), how long each request takes, and details of each request. opening the network monitor there are a few different ways to open the network monitor: press ctrl + shift + e ( command + option + e on a mac). select "network" from the web developer menu, (which is a submenu of the tools menu on os x and linux). click the wrench icon (), which is in the main toolbar or under the hamburger menu (), then select "network". ...
...ent ways to open the network monitor: press ctrl + shift + e ( command + option + e on a mac). select "network" from the web developer menu, (which is a submenu of the tools menu on os x and linux). click the wrench icon (), which is in the main toolbar or under the hamburger menu (), then select "network". the network monitor will appear at the bottom of the browser window. when it first opens, the network monitor does not show request information. the just opened tool looks like this: either action causes the network monitor to begin monitoring network activity. ...
...this means you can start debugging a page in, for example, the web console, then switch to the network monitor to see network activity without having to reload the page. ...
Edit fonts - Firefox Developer Tools
ion of firefox the tools will not look or behave quite the same, but they will be similar (most notably the font editor will not be available). the fonts tab the fonts tab is located on the right-hand side of the page inspector when it is docked to the bottom of the screen. when it is docked to the right or left sides of the screen, the fonts tab appears beneath the html pane. to access it: open the page inspector. select the fonts tab; the last of the tabs shown in the right-hand side of the css pane. the fonts tab has three major sections: "fonts used" by the currently inspected element. the new fonts editor. in firefox 61 and 62, this section does not exist. "all fonts on page" — this section lists all of the fonts in use on the page. in firefox 61 and 62, this area is lab...
... fonts not available on your system, or "system" in the case of fonts loaded from your computer (either default system fonts, or web fonts that you've also got installed on your system). you can copy the url to the font file by clicking on the icon to the right of the url. the @font-face descriptor that loads the font into the page, in the case of web fonts. the descriptor is expandable — when opened it shows its full syntax as defined in the stylesheet. a text sample, to give you an idea of what the font looks like when rendered. the default text for the sample is "abc" but the preview text can be edited by clicking on the input field at the top of the section and entering a new value. once entered, all of the sample text will be set to the same custom value. variable font support in fi...
...ed by clicking on the input field at the top of the section and entering a new value. once entered, all of the sample text will be set to the same custom value. variable font support in firefox developer tools firefox 62 added support for variable fonts and firefox 63 features support for editing the properties of variable fonts in the font editor. what are variable fonts? variable fonts, or opentype font variations, define a new font file format that allows the font designer to include multiple variations of a typeface inside a single font file. that means you no longer have to apply several different web fonts to a single page to represent a complete typeface for which a variable font is available, provided it includes the desired values for the different characteristics you want to var...
Examine and edit CSS - Firefox Developer Tools
box for a particular class name, to see how the element would appear without that class applied to it. you can add a class to the element by typing a name in the add new class field below the rules toolbar. autocompletions based on existing classes are suggested as you type. link to css file at the top right of each rule, the source filename and line number is displayed as a link: clicking it opens the file in the style editor. you can copy the location of the source file: right-click the link and select "copy location". the inspector understands css source maps. that means that if you are using a css preprocessor that has support for source maps, and you've enabled source map support in the style editor settings, then the link will take you to the original source, not the generated css.
...ss for the selected element, select the computed panel in the righthand pane. this panel shows the calculated value that each css property has for the selected element. (this calculated value is exactly the same as what getcomputedstyle would return.) you can tab through the styles to select them, and you can find more information about each property — pressing f1 on a selected property will open up its mdn reference page. clicking the arrow next to the property name (or pressing enter or space while it is selected) shows the rule that set this value, along with a link to the source filename and line number: by default, this view only shows values that have been explicitly set by the page: to see all values, click the "browser styles" box. you can tab through the filenames/line number...
...licking the arrow next to the property name (or pressing enter or space while it is selected) shows the rule that set this value, along with a link to the source filename and line number: by default, this view only shows values that have been explicitly set by the page: to see all values, click the "browser styles" box. you can tab through the filenames/line numbers; pressing enter/return will open up the relevant file at that point in the style editor. typing in the search box performs a live filtering of the list, so, for example, if you just want to see font-related settings, you can type "font" in the search box, and only properties with "font" in the name will be listed. you can also search for the values of properties: to find the rule responsible for setting the font to "lucida gran...
Style Editor - Firefox Developer Tools
the style editor enables you to: view and edit all the stylesheets associated with a page create new stylesheets from scratch and apply them to the page import existing stylesheets and apply them to the page to open the style editor choose the "style editor" option from the "web developer" menu (which is a submenu in the "tools" menu on the mac). the toolbox will appear at the bottom of the browser window, with the style editor activated: the style editor is divided into three main sections: the style sheet pane on the left the editor on the right the media sidebar. the style sheet pane the style sheet pane, on the left, lists all the style sheets being used by the current document. you can quickly toggle the use of a given sheet on and off by clicking the eyeball icon to ...
...e current document. you can quickly toggle the use of a given sheet on and off by clicking the eyeball icon to the left of the sheet's name. you can save any changes you've made to the style sheet to your local computer by clicking the save button in the bottom-right corner of each sheet's entry in the list. from firefox 40 onwards, the style sheet pane also includes a context menu that lets you open the selected style sheet in a new tab. the editor pane on the right is the editor pane. this is where the source for the selected style sheet is available for you to read and edit. any changes you make are immediately applied to the page. this makes it easy to experiment with, revise, and test changes. once you're satisfied with your changes, you can save a copy locally by clicking the save but...
...in the editor preferences section of the developer tools settings, you can choose to use vim, emacs, or sublime text key bindings instead. to select these, visit about:config, select the setting devtools.editor.keymap, and assign "vim" or "emacs", or "sublime" to that setting. if you do this, the selected bindings will be used for all the developer tools that use the source editor. you need to reopen the editor for the change to take effect. from firefox 33 onwards, the key binding preference is exposed in the editor preferences section of the developer tools settings, and you can set it there instead of about:config. command windows macos linux go to line ctrl + j, ctrl + g cmd + j, cmd + g ctrl + j, ctrl + g find in file ctrl + f cmd + f ...
Tips - Firefox Developer Tools
lighter on the current element. right-click any property and select "show mdn docs" to view the mdn docs for this property. click on the filter icon () next to an overridden property to find which other property overrides it. right-click on a name, value, or rule to copy anything from the name, the value, the declaration or the whole rule to your clipboard. web console in all panels: esc opens the split console; useful when debugging, or inspecting nodes in the command line: $0 references the currently selected node. $() is a shortcut to document.queryselector(). $$() returns an array with the results from document.queryselectorall(). copy copies anything as a string. right-click a node in the inspector and click "use in console" to create a tempn variable for it. cd switche...
... node. $() is a shortcut to document.queryselector(). $$() returns an array with the results from document.queryselectorall(). copy copies anything as a string. right-click a node in the inspector and click "use in console" to create a tempn variable for it. cd switches the javascript evaluation context to a different iframe in the page. console.table() displays tabular data as table. help opens the mdn page describing the available commands. :screenshot <filename.png> --fullpage saves a screenshot to your downloads directory using the optional file name. if no filename is included, the file name will be in this format: screen shot date at time.png the --fullpage parameter is optional. if you include it, the screenshot will be of the whole page, not just the section visible i...
...ompare performance of cache vs. no-cache page loading. when a request is selected click "edit and resend" to modify its headers and send it again. check "enable persistent logs" in the settings to keep requests from before even after navigation. hover the "js" icon within the "cause" column to see the javascript stack trace, which caused the request. check "disable http cache (when toolbox is open)" in the settings to disable the network cache while debugging network issues. storage inspector right-click the column headers to open a menu allowing to toggle the display of the columns. right-click an entry and click "delete name" to delete it or "delete all" to delete all entries. select an entry to see the parsed value of it in the sidebar. ...
The JavaScript input interpreter - Firefox Developer Tools
you type: function foo() { and then enter, the console does not immediately execute the input, but behaves as if you had pressed shift+enter , so you can finish entering the function definition. multi-line mode for multi-line entry, click the "split pane" icon at the right hand side of the single-line entry field, or press ctrl+b (windows/linux) or cmd+b (macos). the multi-line editing pane opens on the left side the of web console. you can enter multiple lines of javascript by default in this mode, pressing enter after each one. to execute the snippet that is currently in the editing pane, click the run button or press ctrl+enter (or cmd+return on macos). the snippet is echoed under the input prompt (in the right-side pane), followed by the result. you can also select a range of line...
...he editing pane, and run just the code on those lines. starting in firefox 76, if the code snippet is more than five lines long, only the first five lines are echoed in the console, preceeded by a disclosure triangle (or "twistie"), and followed by an ellipsis (…). click anywhere in the area containing the echoed code to show the whole snippet; click again in that area to collapse it. you can open files when in multi-line mode, and save the current contents of the editing pane to a file. to open a file, press ctrl+o (cmd+o on macos). a file dialog box opens so you can select the file to open. to save the contents of the editing pane, press ctrl+s (cmd+s on macos). a file dialog box opens so you can specify the location to save to. to switch back to single-line mode, click the x icon ...
...onding string: "number", "string", "bool", "node", or "nodes"; if not provided, any_type is used. keys() given an object, returns a list of the keys (or property names) on that object. this is a shortcut for object.keys. values() given an object, returns a list of the values on that object; serves as a companion to keys(). clear() clears the console output area. inspect() given an object, opens the object inspector for that object. pprint() obsolete since gecko 74 formats the specified value in a readable way; this is useful for dumping the contents of objects and arrays. help()deprecated since gecko 62 :help displays help text. actually, in a delightful example of recursion, it will bring you to this page. cd() switch javascript evaluation context to a different iframe in the...
Firefox Developer Tools
d how to debug the browser as a whole. if you have any feedback on devtools, or want to contribute to the project, you can join the devtools community. note: if you are just getting started with web development and using developer tools, our learning docs will help you — see getting started with the web and what are browser developer tools? for good starting points. the core tools you can open the firefox developer tools from the menu by selecting tools > web developer > toggle tools or use the keyboard shortcut ctrl + shift + i or f12 on windows and linux, or cmd + opt + i on macos. the ellipsis menu on the right-hand side of developer tools contains several commands that let you perform actions or change tool settings. this button only appears when there are multipl...
...pears when there are multiple iframes on a page. click it to display a list of the iframes on the current page and select the one with which you want to work. click this button to take a screenshot of the current page. (note: this feature is not turned on by default and must be enabled in settings before the icon will appear.) toggles responsive design mode. opens the menu that includes docking options, the ability to show or hide the split console, and developer tools settings. the menu also includes links to the documentation for firefox web tools and the mozilla community. closes the developer tools page inspector view and edit page content and layout. visualise many aspects of the page including the box model, animations, and ...
...for the current page. taking screenshots take a screenshot of the entire page or of a single element. measure a portion of the page measure a specific area of a web page. rulers overlay horizontal and vertical rulers on a web page for the latest developer tools and features, try firefox developer edition. download firefox developer edition connecting the developer tools if you open the developer tools using keyboard shortcuts or the equivalent menu items, they'll target the document hosted by the currently active tab. but you can attach the tools to a variety of other targets, too, both within the current browser and in different browsers or even different devices. about:debugging debug add-ons, content tabs, and workers running in the browser. connecting to firefox f...
Cache - Web APIs
Web › API › Cache
as workers. you don't have to use it in conjunction with service workers, even though it is defined in the service worker spec. an origin can have multiple, named cache objects. you are responsible for implementing how your script (e.g. in a serviceworker) handles cache updates. items in a cache do not get updated unless explicitly requested; they don’t expire unless deleted. use cachestorage.open() to open a specific named cache object and then call any of the cache methods to maintain the cache. you are also responsible for periodically purging cache entries. each browser has a hard limit on the amount of cache storage that a given origin can use. cache quota usage estimates are available via the storageestimate api. the browser does its best to manage disk space, but it may delete the ...
...e key is the request, returning a promise that resolves to true if a matching cache entry is found and deleted. if no cache entry is found, the promise resolves to false. cache.keys(request, options) returns a promise that resolves to an array of cache keys. examples this code snippet is from the service worker selective caching sample. (see selective caching live) the code uses cachestorage.open() to open any cache objects with a content-type header that starts with font/. the code then uses cache.match() to see if there's already a matching font in the cache, and if so, returns it. if there isn't a matching font, the code fetches the font from the network and uses cache.put() to cache the fetched resource. the code handles exceptions thrown from the fetch() operation. note that an htt...
... // if this cache name isn't present in the set of "expected" cache names, then delete it. console.log('deleting out of date cache:', cachename); return caches.delete(cachename); } }) ); }) ); }); self.addeventlistener('fetch', function(event) { console.log('handling fetch event for', event.request.url); event.respondwith( caches.open(current_caches.font).then(function(cache) { return cache.match(event.request).then(function(response) { if (response) { // if there is an entry in the cache for event.request, then response will be defined // and we can just return it. note that in this example, only font resources are cached. console.log(' found response in cache:', response); ...
Canvas API - Web APIs
y reference for the canvas api. demo: a basic ray-caster a demo of ray-tracing animation using canvas. manipulating video using canvas combining <video> and <canvas> to manipulate video data in real time. libraries the canvas api is extremely powerful, but not always simple to use. the libraries listed below can make the creation of canvas-based projects faster and easier. easeljs is an open-source canvas library that makes creating games, generative art, and other highly graphical experiences easy. fabric.js is an open-source canvas library with svg parsing capabilities. heatmap.js is an open-source library for creating canvas-based data heat maps. javascript infovis toolkit creates interactive data visualizations. konva.js is a 2d canvas library for desktop and mobile applicati...
... processing.js is a port of the processing visualization language. pts.js is a library for creative coding and visualization in canvas and svg. rekapi is an animation key-framing api for canvas. ...
...-based data heat maps. javascript infovis toolkit creates interactive data visualizations. konva.js is a 2d canvas library for desktop and mobile applications. p5.js has a full set of canvas drawing functionality for artists, designers, educators, and beginners. paper.js is an open-source vector graphics scripting framework that runs on top of the html5 canvas. phaser is a fast, free and fun open source framework for canvas and webgl powered browser games. processing.js is a port of the processing visualization language. pts.js is a library for creative coding and visualization in canvas and svg. rekapi is an animation key-framing api for canvas. scrawl-canvas is an open-source javascript library for creating and manipulating 2d canvas elements. the zim framework provides convenience...
Client.url - Web APIs
Web › API › Client › url
the url read-only property of the client interface returns the url of the current service worker client. syntax var clienturl = client.url; value a usvstring. ...
... working draft initial definition. ...
... working draft initial definition. ...
console - Web APIs
Web › API › Console
cifics of how it works varies from browser to browser, but there is a de facto set of features that are typically provided. the console object can be accessed from any global object. window on browsing scopes and workerglobalscope as specific variants in workers via the property console. it's exposed as window.console, and can be referenced as simply console. for example: console.log("failed to open the specified link") this page documents the methods available on the console object and gives a few usage examples. note: this feature is available in web workers. note: the actual console interface is defined as all lower case (i.e. not console), for historical reasons. methods console.assert() log a message and stack trace to console if the first argument is false. console.clear() ...
...ar, ". the object is:", someobject); this output will look like this: [09:28:22.711] my first car was a dodge charger . the object is: ({str:"some text", id:5}) using string substitutions when passing a string to one of the console object's methods that accepts a string (such as log()), you may use these substitution strings: %o or %o outputs a javascript object. clicking the object name opens more information about it in the inspector. %d or %i outputs an integer. number formatting is supported, for example console.log("foo %.2d", 1.1) will output the number as two significant figures with a leading 0: foo 01 %s outputs a string. %f outputs a floating-point value. formatting is supported, for example console.log("foo %.2f", 1.1) will output the number to 2 decimal places: foo...
... the effects of padding, margin, etc. you should set it to for example display: inline-block. using groups in the console you can use nested groups to help organize your output by visually combining related material. to create a new nested block, call console.group(). the console.groupcollapsed() method is similar but creates the new block collapsed, requiring the use of a disclosure button to open it for reading. to exit the current group, simply call console.groupend(). for example, given this code: console.log("this is the outer level"); console.group("first group"); console.log("in the first group"); console.group("second group"); console.log("in the second group"); console.warn("still in the second group"); console.groupend(); console.log("back to the first group"); console.groupend(...
Element - Web APIs
Web › API › Element
possible for the element. element.scrolltop a number representing number of pixels the top of the document is scrolled vertically. element.scrolltopmax read only returns a number representing the maximum top scroll offset possible for the element. element.scrollwidth read only returns a number representing the scroll view width of the element. element.shadowrootread only returns the open shadow root that is hosted by the element, or null if no open shadow root is present. element.openorclosedshadowroot read only returns the shadow root that is hosted by the element, regardless if its open or closed. available only to webextensions. element.slot returns the name of the shadow dom slot the element is inserted in. element.tabstop is a boolean indicating if the element ca...
... current node. element.setattributenodens() sets the node representation of the attribute with the specified name and namespace, from the current node. events listen to these events using addeventlistener() or by assigning an event listener to the oneventname property of this interface. cancel fires on a <dialog> when the user instructs the browser that they wish to dismiss the current open dialog. for example, the browser might fire this event when the user presses the esc key or clicks a "close dialog" button which is part of the browser's ui. also available via the oncancel property. error fired when a resource failed to load, or can't be used. for example, if a script has an execution error or an image can't be found or is invalid. also available via the onerror property. s...
...fired when a non-primary pointing device button (e.g., any mouse button other than the left button) has been pressed and released on an element. also available via the onauxclick property. click fired when a pointing device button (e.g., a mouse's primary button) is pressed and released on a single element. also available via the onclick property. contextmenu fired when the user attempts to open a context menu. also available via the oncontextmenu property. dblclick fired when a pointing device button (e.g., a mouse's primary button) is clicked twice on a single element. also available via the ondblclick property. domactivate occurs when an element is activated, for instance, through a mouse click or a keypress. mousedown fired when a pointing device button is pressed on an ele...
HTMLDialogElement.close() - Web APIs
t interface closes the dialog. an optional domstring may be passed as an argument, updating the returnvalue of the the dialog. syntax dialoginstance.close(returnvalue); parameters returnvalue optional a domstring representing an updated value for the htmldialogelement.returnvalue of the dialog. return value void. examples the following example shows a simple button that, when clicked, opens a <dialog> containing a form via the showmodal() method. from there you can click the cancel button to close the dialog (via the htmldialogelement.close() method), or submit the form via the submit button. <!-- simple pop-up dialog box, containing a form --> <dialog id="favdialog"> <form method="dialog"> <section> <p><label for="favanimal">favorite animal:</label> ...
...confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var cancelbutton = document.getelementbyid('cancel'); var dialog = document.getelementbyid('favdialog'); dialog.returnvalue = 'favanimal'; function opencheck(dialog) { if(dialog.open) { console.log('dialog open'); } else { console.log('dialog closed'); } } // update button opens a modal dialog updatebutton.addeventlistener('click', function() { dialog.showmodal(); opencheck(dialog); }); // form cancel button closes the dialog box cancelbutton.addeven...
... specifications specification status comment html living standardthe definition of 'close()' in that specification. ...
HTMLDialogElement: close event - Web APIs
the close event is fired on an htmldialogelement object when the dialog it represents has been closed. ...
... the close event is fired on an htmldialogelement object when the dialog it represents has been closed. ...
... <button class="close" type="reset">close</button> </dialog> <button class="open-dialog">open dialog</button> <div class="result"></div> css button, div { margin: .5rem; } js const result = document.queryselector('.result'); const dialog = document.queryselector('.example-dialog'); dialog.addeventlistener('close', (event) => { result.textcontent = 'dialog was closed'; }); const opendialog = document.queryselector('.open-dialog'); opendialog.addeventlistener('click', () => { if (typeof dialog.showmodal === 'function') { dialog.showmodal(); result.textcontent = ''; } else { result.textcontent = 'the dialog api is not supported by this browser'; } }); const closebutton = document.queryselector('.close'); closebutton.addeventlistener('click', () => { ...
HTMLDialogElement.show() - Web APIs
the show() method of the htmldialogelement interface displays the dialog modelessly, i.e. still allowing interaction with content outside of the dialog. syntax dialoginstance.show(); parameters none. return value void. examples the following example shows a simple button that, when clicked, opens a <dialog> containing a form via the show() method. from there you can click the cancel button to close the dialog (via the htmldialogelement.close() method), or submit the form via the submit button. <!-- simple pop-up dialog box, containing a form --> <dialog id="favdialog"> <form method="dialog"> <section> <p><label for="favanimal">favorite animal:</label> <select id="favanimal" name="favanimal"> <option></option> <option>brine shrimp</o...
...confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var cancelbutton = document.getelementbyid('cancel'); var dialog = document.getelementbyid('favdialog'); dialog.returnvalue = 'favanimal'; function opencheck(dialog) { if(dialog.open) { console.log('dialog open'); } else { console.log('dialog closed'); } } // update button opens a modal dialog updatebutton.addeventlistener('click', function() { dialog.showmodal(); opencheck(dialog); }); // form cancel button closes the dialog box cancelbutton.addeven...
... } else { console.log('dialog closed'); } } // update button opens a modal dialog updatebutton.addeventlistener('click', function() { dialog.showmodal(); opencheck(dialog); }); // form cancel button closes the dialog box cancelbutton.addeventlistener('click', function() { dialog.close('animalnotchosen'); opencheck(dialog); }); })(); </script> specifications specification status comment html living standardthe definition of 'show()' in that specification. living standard html 5.1the definition of 'show()' in that specification. recommendation ...
HTMLDialogElement.showModal() - Web APIs
of the htmldialogelement interface displays the dialog as a modal, over the top of any other dialogs that might be present. it displays into the top layer, along with a ::backdrop pseudo-element. interaction outside the dialog is blocked and the content outside it is rendered inert. syntax dialoginstance.showmodal(); parameters none. return value void. exceptions if the dialog is already open (i.e. if the open attribute is already set on the <dialog> element), an invalidstateerror is thrown. examples the following example shows a simple button that, when clicked, opens a <dialog> containing a form via the showmodal() method. from there you can click the cancel button to close the dialog (via the htmldialogelement.close() method), or submit the form via the submit button. <!-- sim...
...confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var cancelbutton = document.getelementbyid('cancel'); var dialog = document.getelementbyid('favdialog'); dialog.returnvalue = 'favanimal'; function opencheck(dialog) { if(dialog.open) { console.log('dialog open'); } else { console.log('dialog closed'); } } // update button opens a modal dialog updatebutton.addeventlistener('click', function() { dialog.showmodal(); opencheck(dialog); }); // form cancel button closes the dialog box cancelbutton.addeven...
... specifications specification status comment html living standardthe definition of 'showmodal()' in that specification. ...
IDBCursor.delete() - Web APIs
Web › API › IDBCursor › delete
the delete() method of the idbcursor interface returns an idbrequest object, and, in a separate thread, deletes the record at the cursor's position, without changing the cursor's position. once the record is deleted, the cursor's value is set to null. be aware that you can't call delete() (or idbcursor.update()) on cursors obtained from idbindex.openkeycursor(). for such needs, you have to use idbindex.opencursor() instead. note: this feature is available in web workers. syntax myidbcursor.delete(); returns an idbrequest object on which subsequent events related to this operation are fired. the result attribute is set to undefined. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror ...
... to this operation are fired. the result attribute is set to undefined. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbcursor's transaction is inactive. readonlyerror the transaction mode is read-only. invalidstateerror the cursor was created using idbindex.openkeycursor, is currently being iterated, or has iterated past its end. example in this simple fragment we create a transaction, retrieve an object store, then use a cursor to iterate through all the records in the object store. if the albumtitle of the current cursor is "grace under pressure", we delete that entire record using var request = cursor.delete();. the cursor does not require us...
...that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. for a complete working example, see our idbcursor example (view example live.) function deleteresult() { list.innerhtml = ''; var transaction = db.transaction(['rushalbumlist'], 'readwrite'); var objectstore = transaction.objectstore('rushalbumlist'); objectstore.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { if(cursor.value.albumtitle === 'grace under pressure') { var request = cursor.delete(); request.onsuccess = function() { console.log('deleted that mediocre album from 1984. even power windows is better.'); }; } else { var listitem = document.createelem...
IDBCursor.update() - Web APIs
Web › API › IDBCursor › update
the update() method of the idbcursor interface returns an idbrequest object, and, in a separate thread, updates the value at the current position of the cursor in the object store. if the cursor points to a record that has just been deleted, a new record is created. be aware that you can't call update() (or idbcursor.delete()) on cursors obtained from idbindex.openkeycursor(). for such needs, you have to use idbindex.opencursor() instead. note: this feature is available in web workers. syntax var anidbrequest = myidbcursor.update(value); parameters value the new value to be stored at the current position. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types:...
... object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbcursor's transaction is inactive. readonlyerror the transaction mode is read only. invalidstateerror the cursor was created using idbindex.openkeycursor, is currently being iterated, or has iterated past its end. dataerror the underlying object store uses in-line keys and the property in the value at the object store's key path does not match the key in this cursor's position. datacloneerror the data being stored could not be cloned by the internal structured cloning algorithm. example in this sim...
... in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. ...
IDBDatabase.close() - Web APIs
Web › API › IDBDatabase › close
in a separate thread. the connection is not actually closed until all transactions created using this connection are complete. no new transactions can be created for this connection once this method is called. methods that create transactions throw an exception if a closing operation is pending. note: this feature is available in web workers. ...
... the connection is not actually closed until all transactions created using this connection are complete. no new transactions can be created for this connection once this method is called. methods that create transactions throw an exception if a closing operation is pending. note: this feature is available in web workers. syntax idbdatabase.close(); example // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); // opening a database. // create event handlers for both success and failure of dbopenrequest.onerror = function(event) { note.innerhtml += "<li>error loading database.</li>"; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += "<li>database initialised.</li>"; // store the result of opening the database in the db variable. db...
... recommendation indexed database api draftthe definition of 'close()' in that specification. ...
IDBDatabase.objectStoreNames - Web APIs
orenames read-only property of the idbdatabase interface is a domstringlist containing a list of the names of the object stores currently in the connected database. note: this feature is available in web workers. syntax var list[] = idbdatabase.objectstorenames; value a domstringlist containing a list of the names of the object stores currently in the connected database. ...
...rty of the idbdatabase interface is a domstringlist containing a list of the names of the object stores currently in the connected database. note: this feature is available in web workers. syntax var list[] = idbdatabase.objectstorenames; value a domstringlist containing a list of the names of the object stores currently in the connected database. example // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. th...
..."todolist", 4); // these two event handlers act on the database being opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. this is used a lot below db = dbopenrequest.result; // this line will log the version of the connected database, which should be // an object that looks like { ['my-store-name'] } console.log(db.objectstorenames); }; specifications specification status comment indexed database api 2.0the definition of 'objectstorenames' in that specification. recommendation indexed database api draft...
IDBDatabaseSync - Web APIs
able. it may however be reintroduced in the future if there is enough demand from web developers. the databasesync interface in the indexeddb api represents a synchronous connection to a database. ...
...toincrement if true, the object store uses a key generator; if false, it does not use one. returns idbobjectstoresync an object to access the newly created object store. exceptions this method can raise an idbdatabaseexception with the following code: constraint_err if an object store with the same name (based on case-sensitive comparison) already exists in the connected database. openobjectstore() opens the object store with the given name in the connected database using the specified mode. idbobjectstoresync openobjectstore ( in domstring name, in optional unsigned short mode ) raises (idbdatabaseexception); parameters name the name of the object store to open. mode the mode that is used to access the object store. returns idbobjectstoresync an object to a...
... exceptions this method can raise an idbdatabaseexception with the following code: not_found_err if an object store with the given name (based on case-sensitive comparison) already exists in the connected database. removeobjectstore() destroys an object store with the given name, as well as all indexes that reference that object store. ...
IDBFactory.deleteDatabase() - Web APIs
note: this feature is available in web workers. ...
...ately, and performs the deletion operation asynchronously. if the database is successfully deleted, then a success event is fired on the request object returned from this method, with its result set to undefined. if an error occurs while the database is being deleted, then an error event is fired on the request object that is returned from this method. when deletedatabase() is called, any other open connections to this particular database will get a versionchange event. note: this feature is available in web workers. syntax for the current standard: var request = indexeddb.deletedatabase(name); for the experimental version with options (see below): var request = indexeddb.deletedatabase(name, options); parameters name the name of the database you want to delete. note that attempti...
...xception, in contrast to idbdatabase.deleteobjectstore(), which does throw an exception if the named object store does not exist. optionsnon-standard in gecko, since version 26, you can include a non-standard optional storage parameter that specifies whether you want to delete a permanent (the default value) indexeddb, or an indexeddb in temporary storage (aka shared pool.) return value a idbopendbrequest on which subsequent events related to this request are fired. example var dbdeleterequest = window.indexeddb.deletedatabase("todolist"); dbdeleterequest.onerror = function(event) { console.log("error deleting database."); }; dbdeleterequest.onsuccess = function(event) { console.log("database deleted successfully"); console.log(event.result); // should be undefined }; sp...
IDBFactorySync - Web APIs
i was originally intended for use only with web workers, and was eventually removed from the spec because its need was questionable. it may however be reintroduced in the future if there is enough demand from web developers. the idbfactorysync interface of the indexeddb api provide a synchronous means of accessing the capabilities of indexed databases. method overview idbdatabasesync open (in domstring name, in domstring description, in optional boolean modifydatabase) raises (idbdatabaseexception); methods open() opens and returns a connection to a database. blocks the calling thread until the connection object is ready to return. if there is already a database with the specified name, it uses that one; otherwise, it creates the database using the specified name and desc...
...mstring description, in optional boolean modifydatabase) raises (idbdatabaseexception); methods open() opens and returns a connection to a database. blocks the calling thread until the connection object is ready to return. if there is already a database with the specified name, it uses that one; otherwise, it creates the database using the specified name and description. idbdatabasesync open ( in domstring name, in domstring description ) raises (idbdatabaseexception); parameters name the name for the database. description the description for the database. returns idbdatabasesync an object to access the open database. exceptions this method can raise an idbdatabaseexception with the following codes: non_transient_err if the name parameter is not valid. a vali...
...name for the database. description the description for the database. returns idbdatabasesync an object to access the open database. exceptions this method can raise an idbdatabaseexception with the following codes: non_transient_err if the name parameter is not valid. a valid name is any string including the empty string. unknown_err if an error occurs while the database is being opened. ...
IDBKeyRange.lowerBound() - Web APIs
the lowerbound() method of the idbkeyrange interface creates a new key range with only a lower bound. by default, it includes the lower endpoint value and is closed. note: this feature is available in web workers. syntax var myidbkeyrange = idbkeyrange.lowerbound(lower); var myidbkeyrange = idbkeyrange.lowerbound(lower, open); parameters lower specifies the lower bound of the new key range. open optional indicates whether the lower bound excludes the endpoint value. the default is false. return value idbkeyrange: the newly created key range. exceptions this method may raise a domexception of the following type: exception description dataerror the value parameter passed was not a valid key. example the following example ...
...od may raise a domexception of the following type: exception description dataerror the value parameter passed was not a valid key. example the following example illustrates how you'd use a lower bound key range. here we declare keyrangevalue = idbkeyrange.lowerbound("f", false); — a range that includes the value "f" and everthing after it. we open a transaction (using idbtransaction) and an object store, and open a cursor with idbobjectstore.opencursor, declaring keyrangevalue as its optional key range value. this means that the cursor will only retrieve the record with the key value "f" and all that come after it. if we used idbkeyrange.lowerbound("f", true);, then the range would not include "f"; only the values after it. note: for a m...
...clude "f"; only the values after it. ...
IDBObjectStore.getKey() - Web APIs
ired. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror the key or key range provided contains an invalid key. invalidstateerror the idbobjectstore has been deleted or removed. ...
...method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror the key or key range provided contains an invalid key. invalidstateerror the idbobjectstore has been deleted or removed. ...
...domexception of one of the following types: exception description transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror the key or key range provided contains an invalid key. invalidstateerror the idbobjectstore has been deleted or removed. ...
Basic concepts - Web APIs
ick searching, as well as sorted enumeration. keys can be binary objects. indexeddb is built on a transactional database model. everything you do in indexeddb always happens in the context of a transaction. the indexeddb api provides lots of objects that represent indexes, tables, cursors, and so on, but each of these is tied to a particular transaction. thus, you cannot execute commands or open cursors outside of a transaction. transactions have a well-defined lifetime, so attempting to use a transaction after it has completed throws exceptions. also, transactions auto-commit and cannot be committed manually. this transaction model is really useful when you consider what might happen if a user opened two instances of your web app in two different tabs simultaneously. without transact...
...nd a key path. if the object store has a key path, it is using in-line keys; otherwise, it is using out-of-line keys. for the reference documentation on object store, see idbobjectstore. version when a database is first created, its version is the integer 1. each database has one version at a time; a database can't exist in multiple versions at once. the only way to change the version is by opening it with a greater version than the current one. this will start a versionchange transaction and fire an upgradeneeded event. the only place where the schema of the database can be updated is inside the handler of that event. note: this definition describes the most recent specification, which is only implemented in up-to-date browsers. old browsers implemented the now deprecated and removed i...
...hange transaction and fire an upgradeneeded event. the only place where the schema of the database can be updated is inside the handler of that event. note: this definition describes the most recent specification, which is only implemented in up-to-date browsers. old browsers implemented the now deprecated and removed idbdatabase.setversion() method. database connection an operation created by opening a database. a given database can have multiple connections at the same time. transaction an atomic set of data-access and data-modification operations on a particular database. it is how you interact with the data in a database. in fact, any reading or changing of data in the database must happen in a transaction. a database connection can have several active transactions associated with...
MediaSource.duration - Web APIs
nds var myduration = mediasource.duration; value a double. a value in seconds is expected. exceptions the following exceptions may be thrown when setting a new value for this property. exception explanation invalidaccesserror an attempt was made to set a duration value that was negative, or nan. ...
... invalidstateerror mediasource.readystate is not equal to open, or one or more of the sourcebuffer objects in mediasource.sourcebuffers are being updated (i.e. ...
...s not equal to open, or one or more of the sourcebuffer objects in mediasource.sourcebuffers are being updated (i.e. their sourcebuffer.updating property is true.) example the following snippet is based on a simple example written by nick desaulniers (view the full demo live, or download the source for further investigation.) function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); mediasource.duration = 120; video.play(); //console.log(mediasource.readystate); // ended }); sourcebuffer.appendbuffer(buf); }); }; ... specification...
NotificationEvent.notification - Web APIs
tener('notificationclick', function(event) { console.log('on notification click'); // data can be attached to the notification so that you // can process it in the notificationclick handler. ...
... living standard living standard. ...
... living standard living standard. ...
NotificationEvent - Web APIs
button. methods inherits methods from its parent, extendableevent. extendableevent.waituntil() extends the lifetime of the event. tells the browser that work is ongoing. ...
... living standard living standard. ...
... living standard living standard. note: this interface is specified in the notifications api, but accessed through serviceworkerglobalscope. ...
PerformanceTiming - Web APIs
a cache or a local resource, the value will be the same as performancetiming.fetchstart. performancetiming.domainlookupend read only when the domain lookup is finished. if a persistent connection is used, or the information is stored in a cache or a local resource, the value will be the same as performancetiming.fetchstart. performancetiming.connectstart read only when the request to open a connection is sent to the network. if the transport layer reports an error and the connection establishment is started again, the last connection establishment start time is given. if a persistent connection is used, the value will be the same as performancetiming.fetchstart. performancetiming.connectend read only when the connection is opened network. if the transport layer reports an er...
... performancetiming.secureconnectionstart read only when the secure connection handshake starts. if no such connection is requested, it returns 0. ...
...ion, is terminated. performancetiming.secureconnectionstart read only when the secure connection handshake starts. if no such connection is requested, it returns 0. performancetiming.requeststart read only when the browser sent the request to obtain the actual document, from the server or from a cache. if the transport layer fails after the start of the request and the connection is reopened, this property will be set to the time corresponding to the new request. performancetiming.responsestart read only when the browser received the first byte of the response, from the server from a cache, or from a local resource. performancetiming.responseend read only when the browser received the last byte of the response, or when the connection is closed if this happened first, fr...
RTCDataChannel.onclose - Web APIs
mple event which indicates that the data channel has closed down. syntax rtcdatachannel.onclose = function; value a function which the browser will call to handle the close event. the function receives as its sole input parameter the event itself, as an object of type event. ...
...arameter the event itself, as an object of type event. example in this sample from a hypothetical instant messaging client, a data channel is created, then handlers for the open and close events are set up to enable and disable user interface objects based on the state of the channel. this way, the message entry field and the send button are only enabled for use when the connection is actually open. ...
...l instant messaging client, a data channel is created, then handlers for the open and close events are set up to enable and disable user interface objects based on the state of the channel. this way, the message entry field and the send button are only enabled for use when the connection is actually open. let pc = new rtcpeerconnection(); let dc = pc.createdatachannel("messagechannel")}}; dc.onopen = function(event) { document.getelementbyid("messagebox").disabled = false; document.getelementbyid("sendbutton").disabled = false; }; dc.onclose = function(event) { document.getelementbyid("messagebox").disabled = true; document.getelementbyid("sendbutton").disabled = true; } /* now negotiate the connection, etc... */ specifications specification status comment ...
RTCDataChannel.readyState - Web APIs
on "connecting" the user agent (browser) is in the process of creating the underlying data transport; that is, whatever network level connection is used to link the two peers together is in the process of being set up. this is the state of a new rtcdatachannel after being created by rtcpeerconnection.createdatachannel() (on the peer which started the connection process). "open" the underlying data transport has been established and data can be transferred bidirectionally across it. this is the default state of a new rtcdatachannel created by the webrtc layer when the remote peer created the channel and delivered to the site or app in a datachannel event of type rtcdatachannelevent. "closing" the process of closing the underlying data transport has begun.
...ay still be send or received before entering the "closed" state. "closed" the underlying data transport has closed, or the attempt to make the connection failed. ...
...losed" the underlying data transport has closed, or the attempt to make the connection failed. ...
RTCIceTcpCandidateType - Web APIs
usage notes the rtcicetcpcandidatetype type is used by the tcptype property of rtcicecandidate objects. ...
... usage notes the rtcicetcpcandidatetype type is used by the tcptype property of rtcicecandidate objects. ...
... usage notes the rtcicetcpcandidatetype type is used by the tcptype property of rtcicecandidate objects. ...
format - Web APIs
ed in css2([css2], section15.3.5), then its value is the corresponding <string> parameter of the font. syntax string = myglyph.format; myglyph.format = string; value the format values listed below are taken from css2([css2], section15.3.5). ...
...ction15.3.5), then its value is the corresponding <string> parameter of the font. syntax string = myglyph.format; myglyph.format = string; value the format values listed below are taken from css2([css2], section15.3.5). ...
...yglyph.format = string; value the format values listed below are taken from css2([css2], section15.3.5). string font format examples of common extensions truedoc-pfr truedoc™ portable font resource .pfr embedded-opentype embedded opentype .eot type-1 postscript™ type 1 .pfb, .pfa truetype truetype .ttf opentype opentype, including truetype open .ttf truetype-gx truetype with gx extensions - speedo speedo - intellifont intellifont - example myglyph.format = "truedoc-pfr"; specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'format' in that specification. ...
Screen.availHeight - Web APIs
l be less if the device or user agent reserves any vertical space for itself. for instance, on a mac whose dock is located at the bottom of screen (which is the default), the value of availheight is approximately the value of height (the total height of the screen in css pixels) minus the heights of the dock and menu bar, as seen in the diagram below. ...
...of the screen in css pixels) minus the heights of the dock and menu bar, as seen in the diagram below. example if your web application needs to open a new window, such as a tool palette which can contain multiple panels, and wants to position it so that it occupies the entire vertical space available, you can do so using code similar to what's seen here. in the main window, when it's time to open the panels, code like the following is used. let palettewindow = window.open("panels.html", "panels", "left=0, top=0, width=200"); the panels window's html, in panels.html, has javascript code of its own, which is executed as soon as the window is created. it doesn't even need to wait for any particular event (or any event at all). that code handles resizing the window based on the available sp...
...w is created. it doesn't even need to wait for any particular event (or any event at all). that code handles resizing the window based on the available space: window.outerheight = window.screen.availheight; the result is something similar to the below. note the panels window filling all available vertical space at the left of the screen. on a windows system, this would function similarly, by opening the window and sizing it vertically so it uses all available vertical space, leaving room for the taskbar and any other interface elements that reserve space. specifications specification status comment css object model (cssom) view modulethe definition of 'screen.availheight' in that specification. working draft initial definition. ...
Using server-sent events - Web APIs
ver-sent events is straightforward. you'll need a bit of code on the server to stream events to the front-end, but the client side code works almost identically to websockets in part of handling incoming events. this is one-way connection, so you can't send events from a client to a server. receiving events from the server the server-sent event api is contained in the eventsource interface; to open a connection to the server to begin receiving events from it, create a new eventsource object with the url of a script that generates the events. for example: const evtsource = new eventsource("ssedemo.php"); if the event generator script is hosted on a different origin, a new eventsource object should be created with both the url and an options dictionary. for example, assuming the client scri...
...(event.data).time; newelement.innerhtml = "ping at " + time; eventlist.appendchild(newelement); }); this code is similar, except that it will be called automatically whenever the server sends a message with the event field set to "ping"; it then parses the json in the data field and outputs that information. ...
...+ time; eventlist.appendchild(newelement); }); this code is similar, except that it will be called automatically whenever the server sends a message with the event field set to "ping"; it then parses the json in the data field and outputs that information. when not used over http/2, sse suffers from a limitation to the maximum number of open connections, which can be especially painful when opening multiple tabs, as the limit is per browser and is set to a very low number (6). the issue has been marked as "won't fix" in chrome and firefox. this limit is per browser + domain, which means that you can open 6 sse connections across all of the tabs to www.example1.com and another 6 sse connections to www.example2.com (per stackoverflow). when using http/2, the maximum number of simultaneous ...
ServiceWorkerGlobalScope.onnotificationclick - Web APIs
ification inside the serviceworkerglobalscope using the notification() constructor will throw an error. syntax serviceworkerglobalscope.onnotificationclick = function(notificationevent) { ... ...
... living standard initial definition. ...
... living standard initial definition. ...
USBDevice - Web APIs
Web › API › USBDevice
rsion number of the device in a semantic versioning scheme. usbdevice.deviceversionminor read only the minor version number of the device in a semantic versioning scheme. usbdevice.deviceversionsubminor read only the patch version number of the device in a semantic versioning scheme. usbdevice.manufacturername read only the of the organization that manufactured the usb device. usbdevice.opened read only indicates whether a session has been started with a paired usb device. usbdevice.productid read only the manufacturer-defined code that identifies a usb device. usbdevice.productname read only the manufacturer-defined name that identifies a usb device. usbdevice.serialnumber read only the manufacturer-defined serial number for the specific usb device. usbdevice.usbversionm...
...d. usbdevice.controltransferin() returns a promise that resolves with a usbtransferinresult when a command or status operation has been transmitted to the usb device. usbdevice.controltransferout() returns a promise that resolves with a usbtransferoutresult when a command or status operation has been transmitted from the usb device. usbdevice.close() returns a promise that resolves when all open interfaces are released and the device session has ended. usbdevice.isochronoustransferin() returns a promise that resolves with a usbisochronousintransferresult when time sensitive information has been transmitted to the usb device. usbdevice.isochronoustransferout() returns a promise that resolves with a usbisochronousouttransferresult when time sensitive information has been transmitted fr...
...he device session has ended. usbdevice.isochronoustransferin() returns a promise that resolves with a usbisochronousintransferresult when time sensitive information has been transmitted to the usb device. usbdevice.isochronoustransferout() returns a promise that resolves with a usbisochronousouttransferresult when time sensitive information has been transmitted from the usb device. usbdevice.open() returns a promise that resolves when a device session has started. usbdevice.releaseinterface() returns a promise that resolves when a cliamed interface is released from exclusive access. usbdevice.reset() returns a promise that resolves when the device is reset and all app operations canceled and their promises rejected. usbdevice.selectalternateinterface() returns a promise that resolv...
WebGLRenderingContext.lineWidth() - Web APIs
the maximum minimum width is allowed to be 1.0. the minimum maximum width is also allowed to be 1.0. because of these implementation defined limits it is not recommended to use line widths other than 1.0 since there is no guarantee any user's browser will display any other width. ...
... ...
...width); getting the range of available widths. returns a float32array. gl.getparameter(gl.aliased_line_width_range); specifications specification status comment webgl 1.0the definition of 'linewidth' in that specification. recommendation initial definition. opengl es 2.0the definition of 'gllinewidth' in that specification. standard man page of the opengl api. ...
Using WebRTC data channels - Web APIs
perty, or specifying the property with a value of false. this will automatically trigger the rtcpeerconnection to handle the negotiations for you, causing the remote peer to create a data channel and linking the two together across the network. ...
...ons for you, causing the remote peer to create a data channel and linking the two together across the network. the rtcdatachannel object is returned immediately by createdatachannel(); you can tell when the connection has been made successfully by watching for the open event to be sent to the rtcdatachannel. let datachannel = pc.createdatachannel("myapp channel"); datachannel.addeventlistener("open", (event) => { begintransmission(datachannel); }); manual negotiation to manually negotiate the data channel connection, you need to first create a new rtcdatachannel object using the createdatachannel() method on the rtcpeerconnection, specifying in the options a negotiated property set to true. this signals to the peer connection to not attempt to negotiate the channel on your behalf. the...
...tiate the connection out-of-band, using a web server or other means. this process should signal to the remote peer that it should create its own rtcdatachannel with the negotiated property also set to true, using the same id. this will link the two objects across the rtcpeerconnection. let datachannel = pc.createdatachannel("myapp channel", { negotiated: true }); datachannel.addeventlistener("open", (event) => { begintransmission(datachannel); }); requestremotechannel(datachannel.id); in this code snippet, the channel is created with negotiated set to true, then a function called requestremotechannel() is used to trigger negotiation, to create a remote channel with the same id as the local channel. doing this lets you create data channels with each peer using different properties, and...
Web Animations API Concepts - Web APIs
timeline: seeking the animation moves the animation’s position along the timeline; slowing down or speeding up the playback rate condenses or expands its spread across the timeline; repeating the animation lines up additional iterations of it along the timeline. in the future, we might have timelines based on gestures or scroll position or even parent and child timelines. the web animations api opens up so many possibilities! animation the animation model can be thought of as an array of snapshots of what the animation could look like at any given time, lined up along the duration of the animation. core concepts web animations consist of timeline objects, animation objects, and animation effect objects working together. by assembling these disparate objects, we can create animations of...
... could look like at any given time, lined up along the duration of the animation. core concepts web animations consist of timeline objects, animation objects, and animation effect objects working together. by assembling these disparate objects, we can create animations of our own. timeline timeline objects provide the useful property currenttime, which lets us see how long the page has been opened for: it's the "current time" of the document's timeline, which started when the page was opened. as of this writing, there’s only one kind of timeline object: the one based on the active document’s timeline. in the future we may see timeline objects that correspond to the length of the page, perhaps a scrolltimeline, or other things entirely. animation animation objects can be imagined as...
...r we can use the element.animate() shortcut function. (read more about how to use element.animate() in using the web animations api.) uses the api allows for the creation of dynamic animations that can be updated on the fly as well as more straightforward, declarative animations like those css creates. it can be used in automated tests to ensure that your ui animations are running correctly. it opens up the browser’s rendering engine for building animation development tools like timelines. it is also a performant base on which to build a custom or commercial animation library. (see animating like you just don’t care with element.animate.) in some instances, it may negate the need for a fully fledged library entirely in the same way vanilla javascript can be used without jquery for many p...
Migrating from webkitAudioContext - Web APIs
work, and no other part of your web page's code could execute in the mean time. because of these problems, this version of the createbuffer() method has been removed, and you should use the asynchronous decodeaudiodata() method instead. ...
...fer"; 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.response, 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, ...
...iobuffersourcenode has been removed. this attribute was an alias of the loop attribute, so you can just use the loop attribute instead. instead of having code like this: var source = context.createbuffersource(); source.looping = true; you can change it to respect the last version of the specification: var source = context.createbuffersource(); source.loop = true; note, the loopstart and loopend attributes are not supported in webkitaudiocontext. changes to determining playback state the playbackstate attribute of audiobuffersourcenode and oscillatornode has been removed. depending on why you used this attribute, you can use the following techniques to get the same information: if you need to compare this attribute to unscheduled_state, you can basically remember whether you've ca...
Using the Web Speech API - Web APIs
this article provides a simple introduction to both areas, along with demos. ...
...s sent to a web service for recognition processing, so it won't work offline. demo to show simple usage of web speech recognition, we've written a demo called speech color changer. when the screen is tapped/clicked, you can say an html color keyword, and the app's background color will change to that color. to run the demo, you can clone (or directly download) the github repo it is part of, open the html index file in a supporting desktop browser, or navigate to the live demo url in a supporting mobile browser like chrome. browser support support for web speech api speech recognition is curently limited to chrome for desktop and android — chrome has supported it since around version 33 but with prefixed interfaces, so you need to include prefixed versions of them, e.g. webkitspeechre...
...ple usage of web speech synthesis, we've provided a demo called speak easy synthesis. this includes a set of form controls for entering text to be synthesised, and setting the pitch, rate, and voice to use when the text is uttered. after you have entered your text, you can press enter/return to hear it spoken. to run the demo, you can clone (or directly download) the github repo it is part of, open the html index file in a supporting desktop browser, or navigate to the live demo url in a supporting mobile browser like chrome, or firefox os. browser support support for web speech api speech synthesis is still getting there across mainstream browsers, and is currently limited to the following: firefox desktop and mobile support it in gecko 42+ (windows)/44+, without prefixes, and it c...
Using Web Workers - Web APIs
the port connection needs to be started either implicitly by use of the onmessage event handler or explicitly with the start() method before any messages can be posted. calling start() is only needed if the message event is wired up via the addeventlistener() method. note: when...
...o communicate with the worker (this is done implicitly in the case of dedicated workers). the port connection needs to be started either implicitly by use of the onmessage event handler or explicitly with the start() method before any messages can be posted. calling start() is only needed if the message event is wired up via the addeventlistener() method. note: when using the start() method to open the port connection, it needs to be called from both the parent thread and the worker thread if two-way communication is needed. sending messages to and from a shared worker now messages can be sent to the worker as before, but the postmessage() method has to be invoked through the port object (again, you'll see similar constructs in both multiply.js and square.js): squarenumber.onchange = fu...
...he onmessage event handler in the parent thread is setup, or when the start() method is explicitly called in the parent thread). we use the ports attribute of this event object to grab the port and store it in a variable. next, we add a message handler on the port to do the calculation and return the result to the main thread. setting up this message handler in the worker thread also implicitly opens the port connection back to the parent thread, so the call to port.start() is not actually needed, as noted above. finally, back in the main script, we deal with the message (again, you'll see similar constructs in both multiply.js and square.js): myworker.port.onmessage = function(e) { result2.textcontent = e.data; console.log('message received from worker'); } when a message comes back ...
Window.name - Web APIs
Web › API › Window › name
browsing contexts do not need to have names. ...
...browsing contexts do not need to have names. ...
...browsing contexts do not need to have names. ...
WindowClient.focus() - Web APIs
function(windowclient) { // do something with your windowclient once it has been focused }); parameters none. return value a promise that resolves to the existing windowclient. ...
... working draft initial definition. ...
... working draft initial definition. ...
WindowClient - Web APIs
the current client has focus. windowclient.visibilitystate read only indicates the visibility of the current client. this value can be one of "hidden", "visible", or "prerender". ...
... working draft initial definition ...
...is looks to see if the current is already open and // focuses if it is event.waituntil(clients.matchall({ type: "window" }).then(function(clientlist) { for (var i = 0; i < clientlist.length; i++) { var client = clientlist[i]; if (client.url == '/' && 'focus' in client) { client.focus(); break; } } if (clients.openwindow) return clients.openwindow('/'); })); }); specifications specification status comment service workersthe definition of 'windowclient' in that specification. working draft initial definition ...
XMLHttpRequest.status - Web APIs
the read-only xmlhttprequest.status property returns the numerical http status code of the xmlhttprequest's response. before the request completes, the value of status is 0. browsers also report a status of 0 in case of xmlhttprequest errors. ...
... the read-only xmlhttprequest.status property returns the numerical http status code of the xmlhttprequest's response. before the request completes, the value of status is 0. browsers also report a status of 0 in case of xmlhttprequest errors. ...
... a status of 0 in case of xmlhttprequest errors. ...
Using the link role - Accessibility
nks. screen magnifiers may enlarge links. note: opinons may differ on how assistive technology should handle this technique. the information provided above is one of those opinions and therefore not normative. examples this example shows how to implement a fake link using a <span> element. this includes javascript to grab the location and handle navigating to the new location using window.open() via clicking, and using keyboard, css to give the desired visuals of a link, the tabindex="0" attribute to make it keyboard-focussable, and role="link" to make it recognised as a link by assistive technology. this is a huge amount of work just to recreate something you've get for free using the <a> element, so you should really use that if possible. but this shows that it can be done. you sho...
...to recreate something you've get for free using the <a> element, so you should really use that if possible. but this shows that it can be done. you should however note that there are still problems with this approach: it is very difficult to detect whether the target of the fake link has been visited before, and therefore use :visited styles (e.g. the default purple color for visited links). opening a page using the open() method counts as being a popup, and certain browsers may issue a warning when you try to activate it, or make you explicitly agree to allowing popups form the domain it exists on. html <h1>role="link" example</h1> <span data-href="https://mozilla.org" tabindex="0" id="link1" role="link" class="link"> fake accessible link created using a span </span> <p><a href="h...
... aria attributes used link related a...
:target - CSS: Cascading Style Sheets
Web › CSS › :target
e :target pseudo-class to create a lightbox without using any javascript. this technique relies on the ability of anchor links to point to elements that are initially hidden on the page. once targeted, the css changes their display so that they are shown. note: a more complete pure-css lightbox based on the :target pseudo-class is available on github (demo). html <ul> <li><a href="#example1">open example #1</a></li> <li><a href="#example2">open example #2</a></li> </ul> <div class="lightbox" id="example1"> <figure> <a href="#" class="close"></a> <figcaption>lorem ipsum dolor sit amet, consectetur adipiscing elit. donec felis enim, placerat id eleifend eu, semper vel sem.</figcaption> </figure> </div> <div class="lightbox" id="example2"> <figure> <a href="#" cla...
... donec felis enim, placerat id eleifend eu, semper vel sem.</figcaption> </figure> </div> <div class="lightbox" id="example2"> <figure> <a href="#" class="close"></a> <figcaption>cras risus odio, pharetra nec ultricies et, mollis ac augue. nunc et diam quis sapien dignissim auctor. ...
...r vel sem.</figcaption> </figure> </div> <div class="lightbox" id="example2"> <figure> <a href="#" class="close"></a> <figcaption>cras risus odio, pharetra nec ultricies et, mollis ac augue. nunc et diam quis sapien dignissim auctor. ...
font-stretch - CSS: Cascading Style Sheets
> a <percentage> value between 50% and 200% (inclusive). negative values are not allowed for this property. in earlier versions of the font-stretch specification, the property accepts only the nine keyword values. css fonts level 4 extends the syntax to accept a <percentage> value as well. this enables variable fonts to offer something more like a continuum of character widths. for truetype or opentype variable fonts, the "wdth" variation is used to implement varying widths. if the font does not provide a face that exactly matches the given value, then values less than 100% map to a narrower face, and values greater than or equal to 100% map to a wider face. keyword to numeric mapping the table below shows the mapping between keyword values and numeric percentages: keyword p...
...150% ultra-expanded 200% variable fonts most fonts have a particular width which corresponds to one of the keyterm values. however some fonts, called variable fonts, can support a range of stretching with more or less fine granularity, and this can give the designer a much closer degree of control over the chosen weight. for this, percentage ranges are useful. for truetype or opentype variable fonts, the "wdth" variation is used to implement varying glyph widths. accessibility concerns people with dyslexia and other cognitive conditions may have difficulty reading fonts that are too condensed, especially if the font has a low contrast color ratio. mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.8 | w3c understanding wcag 2.0 f...
... formal definition related at-rule@font-faceinitial valuenormalcomputed valueas specified formal syntax <font-stretch-absolute>{1,2}where <font-stretch-absolute> = normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded | <percentage> examples setting a percentage range for font-stretch the following find a local open sans font or import it, and allow using the font for normal, semi-condensed and semi-expanded states. @font-face { font-family: "open sans"; src: local("open sans") format("woff2"), url("/fonts/opensans-regular-webfont.woff") format("woff"); font-stretch: 87.5% 112.5%; } specifications specification status comment css fonts module level 4the definitio...
font-variant-caps - CSS: Cascading Style Sheets
ant-caps: all-small-caps; font-variant-caps: petite-caps; font-variant-caps: all-petite-caps; font-variant-caps: unicase; font-variant-caps: titling-caps; /* global values */ font-variant-caps: inherit; font-variant-caps: initial; font-variant-caps: unset; the font-variant-caps property is specified using a single keyword value from the list below. ...
...global values */ font-variant-caps: inherit; font-variant-caps: initial; font-variant-caps: unset; the font-variant-caps property is specified using a single keyword value from the list below. in each case, if the font doesn't support the opentype value, then it synthesizes the glyphs. values normal deactivates of the use of alternate glyphs. small-caps enables display of small capitals (opentype feature: smcp). small-caps glyphs typically use the form of uppercase letters but are reduced to the size of lowercase letters. all-small-caps enables display of small capitals for both upper and lowercase letters (opentype features: c2sc, smcp). petite-caps enables display of petite capitals (opentype feature: pcap). all-petite-caps enables display of petite capitals for both upper and...
... small-caps glyphs typically use the form of uppercase letters but are reduced to the size of lowercase letters. all-small-caps enables display of small capitals for both upper and lowercase letters (opentype features: c2sc, smcp). petite-caps enables display of petite capitals (opentype feature: pcap). all-petite-caps enables display of petite capitals for both upper and lowercase letters (opentype features: c2pc, pcap). unicase enables display of mixture of small capitals for uppercase letters with normal lowercase letters (opentype feature: unic). titling-caps enables display of titling capitals (opentype feature: titl). uppercase letter glyphs are often designed for use with lowercase letters. when used in all uppercase titling sequences they can appear too strong. titling capita...
font-variant-ligatures - CSS: Cascading Style Sheets
ligatures and contextual forms needed for correct rendering. the ligatures and forms activated depend on the font, language and kind of script. this is the default value. none this keyword specifies that all ligatures and contextual forms are disabled, even common ones. <common-lig-values> these values control the most common ligatures, like for fi, ffi, th or similar. they correspond to the opentype values liga and clig. two values are possible: common-ligatures activating these ligatures. note that the keyword normal activates these ligatures. no-common-ligatures deactivating these ligatures. <discretionary-lig-values> these values control specific ligatures, specific to the font and defined by the type designer. they correspond to the opentype values dlig. two values are po...
...o the opentype values dlig. two values are possible: discretionary-ligatures activating these ligatures. no-discretionary-ligatures deactivating the ligatures. note that the keyword normal usually deactivates these ligatures. <historical-lig-values> these values control the ligatures used historically, in old books, like the german tz digraph being displayed ß. they correspond to the opentype values hlig. two values are possible: historical-ligatures activating these ligatures. no-historical-ligatures deactivating the ligatures. note that the keyword normal usually deactivates these ligatures. <contextual-alt-values> these values control whether letters adapt to their context—that is, whether they adapt to the surrounding letters. ...
...two values are possible: contextual specifies that the contextual alternates are to be used. note that the keyword normal usually activates these ligatures too. no-contextual prevents their use. formal definition initial valuenormalapplies toall elements. ...
HTML5 - Developer guides
Web › Guide › HTML › HTML5
olution of the standard that defines html. the term represents two different concepts. it is a new version of the language html, with new elements, attributes, and behaviors, and a larger set of technologies that allows the building of more diverse and powerful web sites and applications. this set is sometimes called html5 & friends and often shortened to just html5. designed to be usable by all open web developers, this reference page links to numerous resources about html5 technologies, classified into several groups based on their function. semantics: allowing you to describe more precisely what your content is. connectivity: allowing you to communicate with the server in new and innovative ways. offline and storage: allowing webpages to store data on the client-side locally and opera...
...assified into several groups based on their function. semantics: allowing you to describe more precisely what your content is. connectivity: allowing you to communicate with the server in new and innovative ways. offline and storage: allowing webpages to store data on the client-side locally and operate offline more efficiently. multimedia: making video and audio first-class citizens in the open web. 2d/3d graphics and effects: allowing a much more diverse range of presentation options. performance and integration: providing greater speed optimization and better usage of computer hardware. device access: allowing for the usage of various input and output devices. styling: letting authors write more sophisticated themes. semantics sections and outlines in html5 a look at the n...
...k> element allows subtitles and chapters. webvtt is a text track format. 2d/3d graphics and effects canvas tutorial learn about the new <canvas> element and how to draw graphs and other objects in firefox. html5 text api for <canvas> elements the html5 text api is now supported by <canvas> elements. webgl webgl brings 3d graphics to the web by introducing an api that closely conforms to opengl es 2.0 that can be used in html5 <canvas> elements. svg an xml-based format of vectorial images that can directly be embedded in the html. performance and integration web workers allows delegation of javascript evaluation to background threads, allowing these activities to prevent slowing down interactive events. xmlhttprequest level 2 allows fetching asynchronously some parts of th...
Index - Developer guides
Web › Guide › Index
s article, we'll look at the objects provided by the web platform to make the common tasks of serializing and parsing xml easy. 38 printing dom, guide, needscontent, needsrelocation, printing there may be times in which your web site or application would like to improve the user's experience when printing content. there are a number of possible scenarios: 39 svg-in-opentype draft, fonts, guide, needscontent the svg-in-opentype work is currently in the hands of the mpeg group. once we're ready for wider adoption the information from wiki.mozilla.org will be moved here, updated and expanded. 40 the unicode bidirectional text algorithm algorithm, bidi, guide, internationalization, introduction, localization, text, unicode, direction, i18n, ...
... 40 the unicode bidirectional text algorithm algorithm, bidi, guide, internationalization, introduction, localization, text, unicode, direction, i18n, l10n, ltr, rtl the unicode® bidirectional algorithm (also known as the bidi algorithm) is part of the unicode text standard that describes how the user agent should order characters while rendering unicode text. 41 the web open font format (woff) fonts, needsmobilebrowsercompatibility, woff woff (the web open font format) is a web font format developed by mozilla in concert with type supply, letterror, and other organizations. it adds metadata and private-use data structures, including predefined fields allowing foundries and vendors to provide license information if desired. 42 user input and contr...
... vendors to provide license information if desired. 42 user input and controls screen orientation, contenteditable, drag and drop, fullscreen, keyboard, mouse, pointer lock, touch, user input modern web user input goes beyond simple mouse and keyboard: think of touchscreens for example. this article provides recommendations for managing user input and implementing controls in open web apps, along with faqs, real-world examples, and links to further information for anyone needing more detailed information on the underlying technologies. relevant apis and events include touch events, pointer lock api, screen orientation api, fullscreen api, drag & drop and more. 43 writing forward-compatible websites css, compatibility, dom, html, javascript, web development ...
Printing - Developer guides
ermine when printing may have occurred. you can use this to adjust the user interface presented during printing (such as by displaying or hiding user interface elements during the print process). note: you can also use window.onbeforeprint and window.onafterprint to assign handlers for these events, but using eventtarget.addeventlistener() is preferred. examples here are some common examples. ...
...to automatically close a popup window (for example, the printer-friendly version of a document) after the user prints its contents, you can use code like this: <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>javascript window close example </title> <script type="text/javascript"> function popuponclick() { my_window = window.open('', 'mywindow', 'status=1,width=350,height=150'); my_window.document.write('<html><head><title>print me</title></head>'); my_window.document.write('<body onafterprint="self.close()">'); my_window.document.write('<p>when you print this window, it will close afterward.</p>'); my_window.document.write('</body></html>'); } </script> </head> <body> <p>to try out the <code...
... my_window.document.write('<html><head><title>print me</title></head>'); my_window.document.write('<body onafterprint="self.close()">'); my_window.document.write('<p>when you print this window, it will close afterward.</p>'); my_window.document.write('</body></html>'); } </script> </head> <body> <p>to try out the <code>afterprint</code> event, click the link below to open the window to print. you can also try changing the code to use <code>beforeprint</code> to see the difference.</p> <p><a href="javascript: popuponclick()">open popup window</a></p> </body> </html> view live examples print an external page without opening it if you want to be able to print an external page without opening it, you can utilize a hidden <iframe> (see: htmliframeelement), au...
User input and controls - Developer guides
relevant apis and events include touch events, pointer lock api, screen orientation api, fullscreen api, drag & drop and more. ...
...cation, through the screen orientation api you can read the screen orientation state and perform other actions. you should always be mindful of keyboard accessibility where appropriate — many web users only use keyboard to navigate web sites and apps, and locking them out of your functionality is a bad idea. the following is a set of recommendations and best practices for using such tools in open web apps. decide what input mechanism you’re using keyboard keyboard input can be controlled by your app. for example if you want to add controls when any key gets pressed, you need to add an event listener on the window object: window.addeventlistener("keydown", handlekeydown, true); window.addeventlistener("keyup", handlekeyup, true); where handlekeydown and handlekeyup are the functions...
...nsfer.setdata('text/plain', 'this text may be dragged')">
 this text <strong>may</strong> be dragged. 
</div> in which we: set the draggable attribute to true on the element that you wish to make draggable add a listener for the dragstart event and set the drag data within this listener note: you can find more information in the mdn drag & drop documentation. contenteditable in open web apps any dom element can be made directly editable using the contenteditable attribute. <div contenteditable="true">
 this text can be edited by the user. </div> note: compatibility information, examples and other resources can be found in the content editable guide. examples tracking multiple touch points at a time this example tracks multiple touch points at a time, allowing ...
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
canvas> element. see our canvas tutorial to learn more. svg (scalable vector graphics) lets you draw images using commands that draw specific shapes, patterns, and lines to produce an image. svg commands are formatted as xml, and can be embedded directly into a web page or can be placed in he page using the <img> element, just like any other type of image. webgl the web graphics library is an opengl es-based api for drawing high-performance 2d and 3d graphics on the web. see our webgl tutorial to find out more. how to describe a color in order to represent a color in css, you have to find a way to translate the analog concept of "color" into a digital form that a computer can use. this is typically done by breaking down the color into components, such as how much of each of a set of pri...
... component of the color indicates what percentage of the final color should be comprised of that perfectly vivid color. the rest of the final color is made up of the grey paint that represents the saturation. you can also optionally include an alpha channel, to make the color less than 100% opaque. ...
...r picker tool to select a sample of the color we choose. using an eyedropper tool, we identify a color we like and determine that the color in question is #d79c7a, which is an appropriate rusty orange-red color that's so stereotypical of the martian surface. having selected our base color, we need to build out our palette. we decide to use paletton to come up with the other colors we need. upon opening paletton, we see: next, we enter our color's hex code (d79c7a) into the "base rgb" box at the bottom-left corner of the tool: we now see a monochromatic palette based on the color we picked from the mars photo. if you need a lot of related colors for some reason, those are likely to be good ones. but what we really want is an accent color. something that will pop along side the base colo...
HTML attribute reference - HTML: Hypertext Markup Language
io will be initially silenced on page load. name <button>, <form>, <fieldset>, <iframe>, <input>, <keygen>, <object>, <output>, <select>, <textarea>, <map>, <meta>, <param> name of the element. for example used by the server to identify the fields in form submits. novalidate <form> this attribute indicates that the form shouldn't be validated when submitted. open <details> indicates whether the details will be shown on page load. optimum <meter> indicates the optimal numeric value. pattern <input> defines a regular expression which the element's value will be validated against. ping <a>, <area> the ping attribute specifies a space-separated list of urls to be notified if a user follows the hyperlink. ...
...sed <ol> indicates whether the list should be displayed in a descending order instead of a ascending. rows <textarea> defines the number of rows in a text area. rowspan <td>, <th> defines the number of rows a table cell should span over. sandbox <iframe> stops a document loaded in an iframe from using certain features (such as submitting forms or opening new windows). scope <th> defines the cells that the header test (defined in the th element) relates to. scoped <style> selected <option> defines a value which will be selected on page load. shape <a>, <area> size <input>, <select> defines the width of the element (in pixels). if the element's type attribute is text or...
...l> defines the first number if other than 1. step <input> style global attribute defines css styles which will override styles previously set. summary <table> tabindex global attribute overrides the browser's default tab order and follows the one specified instead. target <a>, <area>, <base>, <form> specifies where to open the linked document (in the case of an <a> element) or where to display the response recieved (in the case of a <form> element) title global attribute text to be displayed in a tooltip when hovering over the element. translate global attribute specify whether an element’s attribute values and the values of its text node children are to be translated when the page i...
<dialog>: The Dialog element - HTML: Hypertext Markup Language
Web › HTML › Element › dialog
tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts flow content implicit aria role dialog permitted aria roles alertdialog dom interface htmldialogelement attributes this element includes the global attributes. the tabindex attribute must not be used on the <dialog> element. open indicates that the dialog is active and can be interacted with. when the open attribute is not set, the dialog shouldn't be shown to the user. usage notes <form> elements can close a dialog if they have the attribute method="dialog". when such a form is submitted, the dialog closes with its returnvalue property set to the value of the button that was used to submit the form. the ::backdrop...
...ialog". when such a form is submitted, the dialog closes with its returnvalue property set to the value of the button that was used to submit the form. the ::backdrop css pseudo-element can be used to style behind a <dialog> element when the dialog is displayed with htmldialogelement.showmodal(). for example, to dim unreachable content behind the modal dialog. examples simple example <dialog open> <p>greetings, one and all!</p> </dialog> advanced example this example opens a pop-up dialog box that contains a form, when the "update details" button is clicked. html <!-- simple pop-up dialog box containing a form --> <dialog id="favdialog"> <form method="dialog"> <p><label>favorite animal: <select> <option></option> <option>brine shrimp</option> <op...
...d="updatedetails">update details</button> </menu> <output aria-live="polite"></output> javascript var updatebutton = document.getelementbyid('updatedetails'); var favdialog = document.getelementbyid('favdialog'); var outputbox = document.queryselector('output'); var selectel = document.queryselector('select'); var confirmbtn = document.getelementbyid('confirmbtn'); // "update details" button opens the <dialog> modally updatebutton.addeventlistener('click', function onopen() { if (typeof favdialog.showmodal === "function") { favdialog.showmodal(); } else { alert("the <dialog> api is not supported by this browser"); } }); // "favorite animal" input sets the value of the submit button selectel.addeventlistener('change', function onselect(e) { confirmbtn.value = selectel.value...
<input type="file"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › file
use a given file type may be identified in more than one manner, it's useful to provide a thorough set of type specifiers when you need files of a given format. for instance, there are a number of ways microsoft word files can be identified, so a site that accepts word files might use an <input> like this: <input type="file" id="docpicker" accept=".doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document"> capture the capture attribute value is a string that specifies which camera to use for capture of image or video data, if the accept attribute indicates that the input should be of one of those types. a value of user indicates that the user-facing camera and/or microphone should be used. a value of environment specifies that the outward-facin...
... to upload</label> <input type="file" id="file" name="file" multiple> </div> <div> <button>submit</button> </div> </form> div { margin-bottom: 10px; } this produces the following output: note: you can find this example on github too — see the source code, and also see it running live. regardless of the user's device or operating system, the file input provides a button that opens up a file picker dialog that allows the user to choose a file. including the multiple attribute, as shown above, specifies that multiple files can be chosen at once. the user can choose multiple files from the file picker in any way that their chosen platform allows (e.g. by holding down shift or control, and then clicking). if you only want the user to choose a single file per <input>, omit th...
... or mime types. some examples: accept="image/png" or accept=".png" — accepts png files. accept="image/png, image/jpeg" or accept=".png, .jpg, .jpeg" — accept png or jpeg files. accept="image/*" — accept any file with an image/* mime type. (many mobile devices also let the user take a picture with the camera when this is used.) accept=".doc,.docx,.xml,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document" — accept anything that smells like an ms word document. let's look at a more complete example: <form method="post" enctype="multipart/form-data"> <div> <label for="profile_pic">choose file to upload</label> <input type="file" id="profile_pic" name="profile_pic" accept=".jpg, .jpeg, .png"> </div> <div> <button>sub...
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
Web › HTML › Element › input
basic examples spec button a push button with no default behavior displaying the value of the value attribute, empty by default. <input type="button" name="button" /> checkbox a check box allowing single values to be selected/deselected. <input type="checkbox" name="checkbox"/> color a control for specifying a color; opening a color picker when active in supporting browsers. <input type="color" name="color"/> html5 date a control for entering a date (year, month, and day, with no time). opens a date picker or numeric wheels for year, month, day when active in supporting browsers. <input type="date" name="date"/> html5 datetime-local a control for entering a d...
... <input type="datetime-local" name="datetime-local"/> html5 email a field for editing an email address. ...
...x" id="urlx"/></p> it is valid on text, search, url, tel, email, date, month, week, time, datetime-local, number, range, and color. per the specifications, the list attribute is not supported by the hidden, password, checkbox, radio, file, or any of the button types. depending on the browser, the user may see a custom color palette suggested, tic marks along a range, or even a input that opens like a <select> but allows for non-listed values. check out the browser compatibility table for the other input types. see the <datalist> element. max valid for date, month, week, time, datetime-local, number, and range, it defines the greatest value in the range of permitted values. if the value entered into the element exceeds this, the element fails constraint validation. if the value...
HTML documentation index - HTML: Hypertext Markup Language
Web › HTML › Index
the html <del> element represents a range of text that has been deleted from a document. 89 <details>: the details disclosure element disclosure box, disclosure widget, element, html, html interactive elements, reference, web, details the html details element (<details>) creates a disclosure widget in which information is visible only when the widget is toggled into an "open" state. 90 <dfn>: the definition element definition, definitions, element, html, html text-level semantics, reference, semantic markup, web, dfn the html definition element (<dfn>) is used to indicate the term being defined within the context of a definition phrase or sentence. 91 <dialog>: the dialog element dialog, element, html, html interactive elements, re...
...tes that the target resource is a web app manifest. 226 link types: modulepreload attribute, html, link, link types, reference the modulepreload keyword for the rel attribute of the <link> element provides a declarative way to preemptively fetch a module script and its dependencies, and store them in the document's module map for later evaluation. 227 link types: noopener attribute, html, link types, reference the noopener keyword for the rel attribute of the <a>, <area>, and <form> elements instructs the browser to navigate to the target resource without granting the new browsing context access to the document that opened it — by not setting the window.opener property on the opened window (it returns null). 228 link types: noreferrer ...
...er property on the opened window (it returns null). 228 link types: noreferrer attribute, html, link types, reference the noreferrer keyword for the rel attribute of the <a>, <area>, and <form> elements instructs the browser, when navigating to the target resource, to omit the referer header and otherwise leak no referrer information — and additionally to behave as if the noopener keyword were also specified. 229 link types: preconnect attribute, html, link, link types, reference the preconnect keyword for the rel attribute of the <link> element is a hint to browsers that the user is likely to need resources from the target resource's origin, and therefore the browser can likely improve the user experience by preemptively initiating a connection to ...
Cross-Origin Resource Sharing (CORS) - HTTP
Web › HTTP › CORS
in simple cors requests no other browsers implement these extra restrictions, because they’re not part of the spec. for example, suppose web content at https://foo.example wishes to invoke content on domain https://bar.other. ...
......
... when it is invoked. in this example, content originally loaded from http://foo.example makes a simple get request to a resource on http://bar.other which sets cookies. content on foo.example might contain javascript like this: const invocation = new xmlhttprequest(); const url = 'http://bar.other/resources/credentialed-content/'; function callotherdomain() { if (invocation) { invocation.open('get', url, true); invocation.withcredentials = true; invocation.onreadystatechange = handler; invocation.send(); } } line 7 shows the flag on xmlhttprequest that has to be set in order to make the invocation with cookies, namely the withcredentials boolean value. by default, the invocation is made without cookies. since this is a simple get request, it is not preflighted, but the ...
HTTP headers - HTTP
Web › HTTP › Headers
coherence of a new fragment of a specific range with previous ones, or to implement an optimistic concurrency control system when modifying existing documents. vary determines how to match request headers to decide whether a cached response can be used rather than requesting a fresh one from the origin server. connection management connection controls whether the network connection stays open after the current transaction finishes. keep-alive controls how long a persistent connection should stay open. content negotiation accept informs the server about the types of data that can be sent back. accept-charset which character encodings the client understands. accept-encoding the encoding algorithm, usually a compression algorithm, that can be used on the resource sent back. ...
...itional range request that is only fulfilled if the given etag or date matches the remote resource. used to prevent downloading two ranges from incompatible version of the resource. content-range indicates where in a full body message a partial message belongs. security cross-origin-embedder-policy (coep) allows a server to declare an embedder policy for a given document. cross-origin-opener-policy (coop) prevents other domains from opening/controlling a window. cross-origin-resource-policy (corp) prevents other domains from reading the response of the resources to which this header is applied. content-security-policy (csp) controls resources the user agent is allowed to load for a given page. content-security-policy-report-only allows web developers to experiment with po...
...pressing the client’s preference for an encrypted and authenticated response, and that it can successfully handle the upgrade-insecure-requests directive. x-content-type-options disables mime sniffing and forces browser to use the type given in content-type. x-download-options the x-download-options http header indicates that the browser (internet explorer) should not display the option to "open" a file that has been downloaded from an application, to prevent phishing attacks as the file otherwise would gain access to execute in the context of the application. (note: related ms edge bug). x-frame-options (xfo) indicates whether a browser should be allowed to render a page in a <frame>, <iframe>, <embed> or <object>. x-permitted-cross-domain-policies specifies if a cross-domain policy...
An overview of HTTP - HTTP
Web › HTTP › Overview
ges (so at minimum presenting an error). among the two most common transport protocols on the internet, tcp is reliable and udp isn't. http therefore relies on the tcp standard, which is connection-based. before a client and server can exchange an http request/response pair, they must establish a tcp connection, a process which requires several round-trips. the default behavior of http/1.0 is to open a separate tcp connection for each http request/response pair. this is less efficient than sharing a single tcp connection when multiple requests are sent in close succession. in order to mitigate this flaw, http/1.1 introduced pipelining (which proved difficult to implement) and persistent connections: the underlying tcp connection can be partially controlled using the connection header. http/2...
...allows you to link requests with the state of the server. this creates sessions, despite basic http being a state-less protocol. this is useful not only for e-commerce shopping baskets, but also for any site allowing user configuration of the output. http flow when a client wants to communicate with a server, either the final server or an intermediate proxy, it performs the following steps: open a tcp connection: the tcp connection is used to send a request, or several, and receive an answer. the client may open a new connection, reuse an existing connection, or open several tcp connections to the servers. send an http message: http messages (before http/2) are human-readable. with http/2, these simple messages are encapsulated in frames, making them impossible to read directly, but the...
...ed api based on http is the xmlhttprequest api, which can be used to exchange data between a user agent and a server. the modern fetch api provides the same features with a more powerful and flexible feature set. another api, server-sent events, is a one-way service that allows a server to send events to the client, using http as a transport mechanism. using the eventsource interface, the client opens a connection and establishes event handlers. the client browser automatically converts the messages that arrive on the http stream into appropriate event objects, delivering them to the event handlers that have been registered for the events' type if known, or to the onmessage event handler if no type-specific event handler was established. conclusion http is an extensible protocol that is eas...
Control flow and error handling - JavaScript
nally block will execute whether or not an exception is thrown. if an exception is thrown, however, the statements in the finally block execute even if no catch block handles the exception that was thrown. you can use the finally block to make your script fail gracefully when an exception occurs. for example, you may need to release a resource that your script has tied up. ...
...ch block handles the exception that was thrown. you can use the finally block to make your script fail gracefully when an exception occurs. for example, you may need to release a resource that your script has tied up. the following example opens a file and then executes statements that use the file. (server-side javascript allows you to access files.) if an exception is thrown while the file is open, the finally block closes the file before the script fails. using finally here ensures that the file is never left open, even if an error occurs. ...
..., you may need to release a resource that your script has tied up. the following example opens a file and then executes statements that use the file. (server-side javascript allows you to access files.) if an exception is thrown while the file is open, the finally block closes the file before the script fails. using finally here ensures that the file is never left open, even if an error occurs. ...
Introduction - JavaScript
...
...the web console tool built into firefox is useful for experimenting with javascript; you can use it into two modes: single-line input mode, and multi-line input mode. single-line input in the web console the web console shows you information about the currently loaded web page, and also includes a javascript interpreter that you can use to execute javascript expressions in the current page. to open the web console (ctrl+shift+i on windows and linux or cmd-option-k on mac), open the tools menu in firefox, and select "developer ▶ web console". the web console appears at the bottom of the browser window. along the bottom of the console is an input line that you can use to enter javascript, and the output appears in the panel above: the console works the exact same way as eval: the last ...
...ert("hello " + yourname) } console.log(eval('3 + 5')) multi-line input in the web console the single-line input mode of the web console is great for quick testing of javascript expressions, but although you can execute multiple lines, it's not very convenient for that. for more complex javascript, you can use the multi-line line input mode. ...
Planned changes to shared memory - JavaScript
of attacks with high-resolution timers, which can be created with shared memory. starting with firefox 79, the features described in this document are enabled by default. chrome intends to implement similar restrictions. new http header bonanza as a baseline requirement, documents will need to be in a secure context. for top-level documents, two headers will need to be set: cross-origin-opener-policy with same-origin as value (protects your origin from attackers) cross-origin-embedder-policy with require-corp as value (protects victims from your origin) with these two headers set, postmessage() will no longer throw for sharedarraybuffer objects and shared memory across threads is therefore available. nested documents and dedicated workers will need to set the cross-origin-embedde...
... for same-origin nested documents and subresources. same-site (but cross-origin) nested documents and subresources will need to set the cross-origin-resource-policy header with same-site as value. and their cross-origin (and cross-site) counterparts need to set the same header with cross-origin as value. note that setting the cross-origin-resource-policy header to any other value than same-origin opens up the resource to potential attacks, such as spectre. note that the cross-origin-opener-policy header limits your ability to retain a reference to popups. direct access between two top-level window contexts will essentially only work if they are same-origin and carry the same two headers with the same two values. api changes as a result of this newly required environment, there are a couple ...
...een workers also apply to sharing a webassembly.memory. the webassembly threads proposal also defines a new set of atomic instructions. just as sharedarraybuffer and its methods are unconditionally enabled (and only sharing between threads is gated on the new headers), the webassembly atomic instructions are also unconditionally allowed. further reading coop and coep explained. cross-origin-opener-policy: whatwg/html issue #3740, draft specification. cross-origin-embedder-policy: whatwg/html issue #4175, draft specification. cross-origin-resource-policy: standardized in fetch, new cross-origin value is part of the cross-origin-embedder-policy effort. postmessage() changes and self.crossoriginisolated: whatwg/html issue #4732, whatwg/html issue #4872, draft specification. ...
Authoring MathML - MathML
available at the bottom. use the text field for token elements and buttons to build advanced constructions. once you are done, you can save your document as a xhtml page. lyx is a graphical latex editor, which has built-in support for xhtml+mathml export and can be configured to use similar latex-to-(x)html converters. you can for example, you can configure it to use latexml html5/epub export. ...
... amaya is the w3c's web editor, which is able to handle mathml inside xhtml documents. use the elements and the special chars panels to create various advanced mathematical constructs. ...
...u enter the source of the formula using the equation panel/keyboard and a preview of the formula is regularly refreshed. the editor uses its own syntax "starmath" for the source but mathml is also generated when the document is saved. to get the mathml code, save the document as mml and open it with any text editor. alternatively, you can extract the odf file (which is actually a zip archive) and open an xml file called content.xml. amaya is the w3c's web editor, which is able to handle mathml inside xhtml documents. use the elements and the special chars panels to create various advanced mathematical constructs. simple text such as a+2 is automatically parsed and the appropriate mathml markup is generated. once you are done, you can directly save your xhtml page and open it in mozilla. op...
<mfenced> - MathML
the deprecated mathml <mfenced> element used to provide the possibility to add custom opening and closing parentheses (such as brackets) and separators (such as commas or semicolons) to an expression. it has been removed from the latest mathml standard and modern browsers no longer support it. use the <mrow> and <mo> elements instead. attributes class, id, style provided for use with stylesheets. close a string for the closing delimiter. the default value is ")" and any white space is trimmed. href used to set a hyperlink to a specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color and also the fraction line color. you can use #rgb, #rrggbb and html color names. open a string for the opening delimiter. the def...
...". by specifying more than one character, it is possible to set different separators for each argument in the expression. if there are too many separators, all excess is ignored. if there are too few separators in the expression, the last specified separator is repeated. ...
...cified separator is repeated. examples the last separator is repeated (,) sample rendering: rendering in your browser: a b c d e <math> <mfenced open="{" close="}" separators=";;,"> <mi>a</mi> <mi>b</mi> <mi>c</mi> <mi>d</mi> <mi>e</mi> </mfenced> </math> all excess is ignored (,) sample rendering: rendering in your browser: a b c d e <math> <mfenced open="[" close="]" separators="||||,"> <mi>a</mi> <mi>b</mi> <mi>c</mi> <mi>d</mi> <mi>e</mi> </mfenced> </math> specifications the <mfenced> element is no longer part of the latest mathml standard. use the <mrow> and <mo> elements instead, or, for backwards compatibility, see mathml-polyfills/mfenced. ...
Codecs used by WebRTC - Web media technologies
dec name profile(s) browser compatibility vp8 — chrome, edge, firefox, safari (12.1+) avc / h.264 constrained baseline (cb) chrome (52+), edge, firefox[1], safari [1] firefox for android 68 and later do not support avc (h.264) anymore. this is due to a change in google play store requirements that prevent firefox from downloading and installing the openh264 codec needed to handle h.264 in webrtc connections. see this article on sumo for details. for details on webrtc-related considerations for each codec, see the sub-sections below by following the links on each codec's name. complete details of what video codecs and configurations webrtc is required to support can be found in rfc 7742: webrtc video processing and codec requirements. it's wort...
...owsers your users might choose. in addition to the mandatory audio codecs, some browsers support additional codecs as well. those are listed in the following table. other audio codecs codec name browser compatibility g.722 chrome, firefox, safari ilbc[1] chrome, safari isac[2] chrome, safari [1] internet low bitrate codec (ilbc) is an open-source narrow-band codec developed by global ip solutions and now google, designed specifically for streaming voice audio. google and some other browser developers have adopted it for webrtc, but it is not available in all browsers and is not one of the mandatory codecs. [2] the internet speech audio codec (isac) is another codec developed by global ip solutions and now owned by google, which ha...
...ource narrow-band codec developed by global ip solutions and now google, designed specifically for streaming voice audio. google and some other browser developers have adopted it for webrtc, but it is not available in all browsers and is not one of the mandatory codecs. [2] the internet speech audio codec (isac) is another codec developed by global ip solutions and now owned by google, which has open-sourced it. it's used by google talk, qq, and other instant messaging clients and is specifically designed for voice transmissions which are encapsulated within an rtp stream. while it's not a mandatory codec, safari and chrome support it. firefox and edge do not. comfort noise (cn) is a form of artificial background noise which is used to fill gaps in a transmission instead of using pure silenc...
Navigation and resource timings - Web Performance
ts. if there is no redirect, or if one of the redirects is not of the same origin, the value returned is 0. redirectend when the last http redirect is completed, that is when the last byte of the http response has been received. if there is no redirect, or if one of the redirects is not of the same origin, the value returned is 0. connectend when the connection is opened network. if the transport layer reports an error and the connection establishment is started again, the last connection establishment end time is given. if a persistent connection is used, the value will be the same as performancetiming.fetchstart. a connection is considered as opened when all secure connection handshake, or socks authentication, is terminated. connectstart when the...
...if the transport layer reports an error and the connection establishment is started again, the last connection establishment end time is given. if a persistent connection is used, the value will be the same as performancetiming.fetchstart. a connection is considered as opened when all secure connection handshake, or socks authentication, is terminated. connectstart when the request to open a connection is sent to the network. if the transport layer reports an error and the connection establishment is started again, the last connection establishment start time is given. if a persistent connection is used, the value will be the same as performancetiming.fetchstart. domainlookupend when the domain lookup is finished. if a persistent connection is used, or the information i...
...he same as performancetiming.fetchstart. fetchstart when the browser is ready to fetch the document using an http request. this moment is before the check to any application cache. requeststart when the browser sent the request to obtain the actual document, from the server or from a cache. if the transport layer fails after the start of the request and the connection is reopened, this property will be set to the time corresponding to the new request. responsestart when the browser received the first byte of the response, from the server from a cache, or from a local resource. responseend when the browser received the last byte of the response, or when the connection is closed if this happened first, from the server, the cache, or from a local re...
format - SVG: Scalable Vector Graphics
Web › SVG › Attribute › format
yphref> context notes value <string> default value none animatable no <string> this value specifies the format of the given font. ...
... value <string> default value none animatable no <string> this value specifies the format of the given font. ...
...ing> this value specifies the format of the given font. here is a list of font formats and their strings that can be used as values for this attribute: format string format truedoc-pfr truedoc™ portable font resource embedded-opentype embedded opentype type-1 postscript™ type 1 truetype truetype opentype opentype, including truetype open truetype-gx truetype with gx extensions speedo speedo intellifont intellifont specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'format for <glyphref>' in that specification. recommendation initial ...
points - SVG: Scalable Vector Graphics
Web › SVG › Attribute › points
ist of points. each point is defined by a pair of number representing a x and a y coordinate in the user coordinate system. if the attribute contains an odd number of coordinates, the last one will be ignored. two elements are using this attribute: <polyline>, and <polygon> html,body,svg { height:100% } <svg viewbox="-10 -10 220 120" xmlns="http://www.w3.org/2000/svg"> <!-- polyline is an open shape --> <polyline stroke="black" fill="none" points="50,0 21,90 98,35 2,35 79,90"/> <!-- polygon is a closed shape --> <polygon stroke="black" fill="none" transform="translate(100,0)" points="50,0 21,90 98,35 2,35 79,90"/> <!-- it is usualy considered best practices to separate a x and y coordinate with a comma and a group of coordinates by a space. it makes things more re...
...s usualy considered best practices to separate a x and y coordinate with a comma and a group of coordinates by a space. it makes things more readable for human beings. --> </svg> polyline for <polyline>, points defines a list of points, each representing a vertex of the line to be drawn. each point is define by a x and y coordinate in the user coordinate system. ...
...each point is define by a x and y coordinate in the user coordinate system. ...
Same-origin policy - Web security
l failure different host inherited origins scripts executed from pages with an about:blank or javascript: url inherit the origin of the document containing that url, since these types of urls do not contain information about an origin server. for example, about:blank is often used as a url of new, empty popup windows into which the parent script writes content (e.g. via the window.open() mechanism). if this popup also contains javascript, that script would inherit the same origin as the script that created it. data: urls get a new, empty, security context. exceptions in internet explorer internet explorer has two major exceptions to the same-origin policy: trust zones if both domains are in the highly trusted zone (e.g. corporate intranet domains), then the same-origi...
...dable formats listed above. browsers may not respect the content-type header. for example, if you point a <script> tag at an html document, the browser will try to parse the html as javascript. when your resource is not an entry point to your site, you can also use a csrf token to prevent embedding. cross-origin script api access javascript apis like iframe.contentwindow, window.parent, window.open, and window.opener allow documents to directly reference each other. when two documents do not have the same origin, these references provide very limited access to window and location objects, as described in the next two sections. to communicate between documents from different origins, use window.postmessage. specification: html living standard § cross-origin objects. window the following...
... window the following cross-origin access to these window properties is allowed: methods window.blur window.close window.focus window.postmessage attributes window.closed read only. window.frames read only. window.length read only. window.location read/write. window.opener read only. window.parent read only. window.self read only. window.top read only. window.window read only. some browsers allow access to more properties than the above. location the following cross-origin access to location properties is allowed: methods location.replace attributes ...
Types of attacks - Web security
s called "user interface redressing", though this is a misuse of the term "redress".) cross-site request forgery (csrf) cross-site scripting (xss) cross-site scripting (xss) is a security exploit which allows an attacker to inject into a website malicious client-side code. this code is executed by the victims and lets the attackers bypass access controls and impersonate users. according to the open web application security project, xss was the seventh most common web app vulnerability in 2017. these attacks succeed if the web app does not employ enough validation or encoding. the user's browser cannot detect the malicious script is untrustworthy, and so gives it access to any cookies, session tokens, or other sensitive site-specific information, or lets the malicious script rewrite the htm...
...h as attacks originating from a separate subdomain). for more prevention tips, see the owasp csrf prevention cheat sheet. man-in-the-middle (mitm) a third party intercepts traffic between a web server and a client (browser), and impersonates the web server in order to capture data (such as login credentials or credit card information). the traffic is passed through, possibly with alterations. open wifi networks are a typically means of executing this attack. session hijacking session hijacking consists of gaining access to and misusing a user's authenticated session. this may happen by stealing a cookie for an existing session, or by fooling the user (or their browser) into setting a cookie with a predetermined session id. exfiltration avenues can be limited by deploying a strict conten...
...er visits a page on the parent domain (or another subdomain), the application may trust the existing value sent in the user's cookie. this could allow an attacker to bypass csrf protection or hijack a session after the user logs in. alternatively, if the parent domain does not use http strict-transport-security with includesubdomains set, a user subject to an active mitm (perhaps connected to an open wifi network) could be served a response with a set-cookie header from a non-existent sub-domain. the end result would be much the same, with the browser storing the illegitimate cookie and sending it to all other pages under example.com. session fixation should primarily be mitigated by regenerating session cookie values when the user authenticates (even if a cookie already exists) and by tiein...
Web technology for developers
to take full advantage of these technologies, you need to know how to use them. below you'll find links to our web technology documentation. documentation for web developers web developer reference a list of all references for web technologies, including those for html, css, and so on. web developer guide the web developer guide provides useful how-to content to help you actually use web technologies to do what you want or need to do. tutorials for web developers a list of tutorials to take you step-by-step through learning apis, technologies, or broad topic areas. ...
...shapes in order to allow them to scale smoothly regardless of the size at which they're drawn. mathml the mathematical markup language makes it possible to display complex mathematical equations and syntax. temporary the stuff below here is temporary to help keep track of things while organization work is ongoing. pay it no mind. ...
...mathematical markup language makes it possible to display complex mathematical equations and syntax. temporary the stuff below here is temporary to help keep track of things while organization work is ongoing. pay it no mind. ...
Compiling a New C/C++ Module to WebAssembly - WebAssembly
that remains is for you to load the resulting hello.html in a browser that supports webassembly. it is enabled by default in firefox 52+ and chrome 57+/latest opera (you can also run wasm code in firefox 47+ by enabling the javascript.options.wasm flag in about:config, or chrome (51+) and opera (38+) by going to chrome://flags and enabling the experimental webassembly flag.) note: if you try to open generated html file (hello.html) directly from your local hard drive (e.g. file://your_path/hello.html), you will end up with an error message along the lines of both async and sync fetching of the wasm failed. you need to run your html file through an http server (http://) — see how do you set up a local testing server? for more information. if everything has worked as planned, you should se...
... we've also specified --shell-file html_template/shell_minimal.html — this provides the path to the html template you want to use to create the html you will run your example through. now let's run this example. the above command will have generated hello2.html, which will have much the same content as the template with some glue code added into load the generated wasm, run it, etc. open it in your browser and you'll see much the same output as the last example. note: you could specify outputting just the javascript "glue" file* rather than the full html by specifying a .js file instead of an html file in the -o flag, e.g. emcc -o hello2.js hello2.c -o3 -s wasm=1. you could then build your custom html completely from scratch, although this is an advanced approach; it is usua...
...are called — and it wouldn't be valid to call compiled code.) emcc -o hello3.html hello3.c -o3 -s wasm=1 --shell-file html_template/shell_minimal.html -s no_exit_runtime=1 -s "extra_exported_runtime_methods=['ccall']" if you load the example in your browser again, you'll see the same thing as before! now we need to run our new myfunction() function from javascript. first of all, open up your hello3.html file in a text editor. add a <button> element as shown below, just above the first opening <script type='text/javascript'> tag. <button class="mybutton">run myfunction</button> now add the following code at the end of the first <script> element: document.queryselector('.mybutton') .addeventlistener('click', function() { alert('check console'); ...
Content Scripts - Archive of obsolete content
</script> </head> </html> another script loaded into the page after this script will be able to access foo. but a content script will not: // main.js var tabs = require("sdk/tabs"); var mod = require("sdk/page-mod"); var self = require("sdk/self"); var pageurl = self.data.url("page.html") var pagemod = mod.pagemod({ include: pageurl, contentscript: "console.log(window.foo);" }) tabs.open(pageurl); console.log: my-addon: null there are good reasons for this insulation. first, it means that content scripts don't leak objects to web pages, potentially opening up security holes. second, it means that content scripts can create objects without worrying about whether they might clash with objects added by page scripts. this insulation means that, for example, if a web page loads th...
... but just emits the message and continues processing. here's a simple add-on that sends a message to a content script using port: // main.js var tabs = require("sdk/tabs"); var self = require("sdk/self"); tabs.on("ready", function(tab) { var worker = tab.attach({ contentscriptfile: self.data.url("content-script.js") }); worker.port.emit("alert", "message from the add-on"); }); tabs.open("http://www.mozilla.org"); // content-script.js self.port.on("alert", function(message) { window.alert(message); }); the context-menu module doesn't use the communication model described here. to learn about communicating with content scripts loaded using context-menu, see the context-menu documentation. accessing port in the content script in the content script the port object is avail...
clipboard - Archive of obsolete content
upport transparency on windows. examples set and get the contents of the clipboard. var clipboard = require("sdk/clipboard"); clipboard.set("lorem ipsum dolor sit amet"); var contents = clipboard.get(); set the clipboard contents to some html. var clipboard = require("sdk/clipboard"); clipboard.set("<blink>lorem ipsum dolor sit amet</blink>", "html"); if the clipboard contains html content, open it in a new tab. var clipboard = require("sdk/clipboard"); if (clipboard.currentflavors.indexof("html") != -1) require("sdk/tabs").open("data:text/html;charset=utf-8," + clipboard.get("html")); set the clipboard contents to an image. var clipboard = require("sdk/clipboard"); clipboard.set("data:image/png;base64,ivborw0kggoaaaansuheugaaacaaaaagcaya" + "aabzenr0aaaasuleqvryhe3o0q...
... set the clipboard contents to an image. var clipboard = require("sdk/clipboard"); clipboard.set("data:image/png;base64,ivborw0kggoaaaansuheugaaacaaaaagcaya" + "aabzenr0aaaasuleqvryhe3o0qkaiawd0eyqe3q993aq3cbsukpygfsnty" + "n5ugbqpk0baadgp0brdwxwlweaaaaagpsa3rzdaaaaahgpcgrpganzq2fg" + "bwrr9aaaaabjru5erkjggg%3d%3d"); if the clipboard contains an image, open it in a new tab. var clipboard = require("sdk/clipboard"); if (clipboard.currentflavors.indexof("image") != -1) require("sdk/tabs").open(clipboard.get()); as noted before, data type can be easily omitted for images. if the intention is set the clipboard to a data url as string and not as image, it can be done by specifying a different flavor, like text. var clipboard = require("sdk/clipboard...
dev/panel - Archive of obsolete content
nables you to extend the firefox developer tools. most of the firefox developer tools are hosted in a ui component called the toolbox. individual built-in tools, such as the javascript debugger or the web console, occupy "panels" in the toolbox. with the dev/panel module, you can create your own panels in the toolbox: the panel gets a tab in the toolbox toolbar which enables the user to open it: you specify the panel's content and behavior using html, css, and javascript. when the panel's created, the framework passes it a debuggee: this is a messageport object that you can use to exchange json messages with the browser that the developer tools are currently debugging. the messages follow the remote debugging protocol. for a simple walkthrough of using the dev/panel api to add a ...
...r server the firefox developer tools use a client/server protocol: a tool, such as a javascript debugger or style editor, is the client, and the program being debugged, such as firefox, is the server. clients connect to the server and send it messages to examine and modify the state of the program being debugged. the remote debugging protocol page describes the protocol in detail. when the user opens a panel and the panel is created, the framework calls the panel's setup method. the setup method will be passed a debuggee object, which is a messageport that the add-on can use to exchange messages with the debugger server. for example, here's a main.js which sends the listtabs message to the debugger server, and logs the response: // main.js // require the sdk modules const { panel } = requ...
event/core - Archive of obsolete content
also see the tutorial on implementing event targets to get started with this api. ...
... also see the tutorial on implementing event targets to get started with this api. ...
frame/utils - Archive of obsolete content
experimental provides helper functions for working with platform internals like frames and browsers. usage module exports create function that takes the nsidomdocument of a privileged document and creates a browser element in its documentelement: let { open } = require('sdk/window/utils'); let { create } = require('sdk/frame/utils'); let window = open('data:text/html,foo'); let frame = create(window.document); optionally create can be passed set of options to configure created frame even further. ...
...domdocument of a privileged document and creates a browser element in its documentelement: let { open } = require('sdk/window/utils'); let { create } = require('sdk/frame/utils'); let window = open('data:text/html,foo'); let frame = create(window.document); optionally create can be passed set of options to configure created frame even further. execution of scripts may easily be enabled: let { open } = require('sdk/window/utils'); let { create } = require('sdk/frame/utils'); let window = open('data:text/html,top'); let frame = create(window.document, { uri: 'data:text/html,<script>console.log("running");</script>', allowjavascript: true }); } globals functions create(document, options) creates a xul browser element in a privileged document. parameters document : nsidomdocument o...
io/byte-streams - Archive of obsolete content
experimental provides streams for reading and writing bytes. function readbinarydatafromfile (filename) { var fileio = require("sdk/io/file"); var data = null; if (fileio.exists(filename)) { var bytereader = fileio.open(filename, "rb"); if (!bytereader.closed) { data = bytereader.read(); bytereader.close(); } } return data; } function writebinarydatatofile(data, filename) { var fileio = require("sdk/io/file"); var bytewriter = fileio.open(filename, "wb"); if (!bytewriter.closed) { bytewriter.write(data); bytewriter.close(); } } globals constructors bytereader(inputstream) creates a binary input stream that reads bytes from a backing stream. you can also create bytereader objects using io/file's open() function. parameters inputstr...
... parameters outputstream : stream the backing stream, an nsioutputstream. bytereader methods close() closes both the stream and its backing stream. if the stream is already closed, an exception is thrown. ...
ui/frame - Archive of obsolete content
d. var { frame } = require("sdk/ui/frame"); var { toolbar } = require("sdk/ui/toolbar"); var frame = new frame({ url: "./city-info.html", onmessage: (e) => { console.log("new city: " + e.data); } }); var toolbar = toolbar({ name: "city-info", title: "city info", items: [frame] }); from add-on to all frames to send a message from the add-on code to all frames, attached to all open browser windows, you can use frame.postmessage(). you can specify the frame's url property as the targetorigin: frame.postmessage(message, frame.url); this add-on listens for a frame script to send the "city changed" message above, and in response, updates all frames across all browser windows with that city's current weather (it just reads this from a dictionary, where in a real case it might ...
...appear in the ui, and accessing any of its properties or methods will throw an error. properties url url for the content loaded into the frame. this is read-only. it's only accessible after the attach event has occurred for this frame. events attach this event is emitted whenever a new frame instance is constructed and the browser has started to load its document: for example, when the user opens a new browser window, if that window has a toolbar containing this frame. since the event is dispatched asynchronously, the document may already be loaded by the time the event is received. at this point, you should not try to send messages to scripts hosted in the frame, because the frame scripts may not have been loaded. arguments event : this contains two properties: source, which defin...
jpm - Archive of obsolete content
r are unable to, install jpm globally, you may instead install it locally: cd $home && npm install jpm to run jpm from a terminal when installed locally, you must add the directory "$home/node_modules/.bin/" to your terminal's path first. add the following line to the end of the file $home/.profile to add it to your path permanently (as the file .profile is executed every time a new terminal is opened): export path="$home/node_modules/.bin/:$path" installing jpm from git alternatively, you can also get the latest version of jpm using git: git clone https://github.com/mozilla-jetpack/jpm.git cd jpm npm install npm link after installing jpm after installation, at the command prompt, type: jpm you should see a screen summarizing the available jpm commands. note that unlike cfx, jpm is ...
... use with caution because jpm run|test changes many preferences, never use with your main profile. this only applies when --profile is used. disables the copying of the profile used, which allows one to reuse a profile. jpm test use this command to run an add-on's unit tests. the command: looks for a directory called "test" within the current directory (or --addon-dir). opens every file in there whose name starts with "test-". make note of the hyphen after "test" in the filename. jpm test include a file called "test-mycode.js", but will exclude files called "test_mycode.js" or "testmycode.js") call every function exported from that file whose name starts with "test". jpm test see the tutorial on unit testing and the reference documentation for the assert module ...
Adding a Button to the Toolbar - Archive of obsolete content
have learned the basics of jpm. to add a button to the toolbar, use the action button or toggle button modules. create a new directory, navigate to it, and execute jpm init, accepting all the defaults. ...
...the button is added to the toolbar at the top of the browser window: you can't set the initial location for the button, but the user can move it using the browser's customization feature. the id attribute is mandatory, and is used to remember the position of the button, so you should not change it in subsequent versions of the add-...
Creating Event Targets - Archive of obsolete content
owser's places api. it will emit events when the user adds and visits bookmarks, enabling users of the module to listen for these events using the sdk's standard event api. using the places api first, let's write some code using places api that logs the uris of bookmarks the user adds. create a new directory called "bookmarks", navigate to it, and run jpm init, accepting all the defaults. ...
...s at the level of individual objects, rather than at the level of the module. to do this, we can inherit from the sdk's eventtarget class. eventtarget provides an implementation of the functions needed to add and remove event listeners: on(), once(), and removelistener(). in this example, we could define a class bookmarkmanager that inherits from eventtarget and emits added and visited events. ...
Listen for Page Load - Archive of obsolete content
the url of each tab as the user loads it: require("sdk/tabs").on("ready", logurl); function logurl(tab) { console.log(tab.url); } you will find this console output in the browser console, not the web console. you don't get direct access to any content hosted in the tab. to access tab content you need to attach a script to the tab using tab.attach(). this add-on attaches a script to all open tabs. the script adds a red border to the tab's document: require("sdk/tabs").on("ready", runscript); function runscript(tab) { tab.attach({ contentscript: "if (document.body) document.body.style.border = '5px solid red';" }); } (this example is only to show the idea: to implement something like this, you should instead use page-mod, and specify "*" as the match-pattern.) learning mo...
... to learn more about running scripts in tabs, see the tutorial on using tab.attach(). ...
Developing for Firefox Mobile - Archive of obsolete content
htly build of the native version of firefox mobile on the device. enable usb debugging on the device (step 2 of this link only) on the development machine: install version 1.5 or higher of the add-on sdk install the correct version of the android sdk for your device using the android sdk, install the android platform tools next, attach the device to the development machine via usb. now open up a command shell. android platform tools will have installed adb in the "platform-tools" directory under the directory in which you installed the android sdk. make sure the "platform-tools" directory is in your path. then type: adb devices you should see some output like: list of devices attached 51800f220f01564 device (the long hex string will be different.) if you do, then adb has foun...
... logcat to focus in on the lines relevant to you. running jpm-mobile test is identical: jpm-mobile test --adb /path/to/adb packaging mobile add-ons to package a mobile add-on as an xpi, use the command: jpm xpi actually installing the xpi on the device is a little tricky. the easiest way is probably to copy the signed xpi somewhere on the device: adb push my-addon.xpi /mnt/sdcard/ then open firefox mobile and type this into the address bar: file:///mnt/sdcard/my-addon.xpi the browser should open the xpi and ask if you want to install it. afterwards you can delete it using adb as follows: adb shell cd /mnt/sdcard rm my-addon.xpi module compatibility modules not supported in firefox mobile are marked in the tables below. high-level apis addon-page not supported...
Modifying Web Pages Based on URL - Archive of obsolete content
"sdk/page-mod"); // create a page-mod // it will run a script whenever a ".org" url is loaded // the script replaces the page contents with a message pagemod.pagemod({ include: "*.org", contentscript: 'document.body.innerhtml = ' + ' "<h1>page matches ruleset</h1>";' }); do as follows: create a new directory and navigate to it. run jpm init, accepting all the defaults open the file index.js and add the code above run jpm run open ietf.org in the browser window that opens. below is what you should see. specifying the match pattern match pattern uses match-pattern syntax. you can pass a single match-pattern string, or an array. keeping the content script in a separate file in the example above, we've supplied content script as a string. unless the script i...
...efox 34, you can use the simpler version: var pagemod = require("sdk/page-mod").pagemod({ include: "*", contentstylefile: "./my-style.css" }); learning more to learn more about page-mod, see its api reference page. in particular, the pagemod constructor takes several additional options to control its behavior: by default, content scripts are not attached to any tabs that are already open when the page-mod is created, and are attached to iframes as well as top-level documents. to control this behavior use the attachto option. define read-only values accessible to content scripts using the contentscriptoptions option. by default, content scripts are attached after all the content (dom, js, css, images) for the page has been loaded, at the time the window.onload event fi...
Modifying the Page Hosted by a Tab - Archive of obsolete content
run this example, save an icon file named "icon-16.png" in add-on's "data" directory. you could download this icon: . this add-on creates a button with mozilla favicon as an icon. it has a click handler which fetches the active tab and loads a script into the page hosted by the active tab. the script is specified using the contentscript option, and just draws a red border around the page. then open any web page in the browser window, and click the button . you should see a red border appear around the page, like this: keeping content scripts in a separate file in the example above, we've passed in content script as a string. unless script is extremely simple, maintain the script as a separate file in add-on's data directory. this makes the code easier to maintain, debug, and review. to...
...der", "red"); } }); the drawborder message isn't a built-in message, it's one that this add-on defines in the port.emit() call. injecting css unlike the page-mod api, tab.attach() doesn't enable you to inject css directly into a page. to modify the style of a page, you have to use javascript, as in the example above. learning more to learn more about working with tabs in the sdk, see the open a web page tutorial, the list open tabs tutorial, and the tabs api reference. to learn more about content scripts, see the content scripts guide. ...
Using third-party modules (jpm) - Archive of obsolete content
now see a new directory in "my-menuitem" called "node_modules". it will contain a single directory "addon-pathfinder", and the modules included in this package will be somewhere in that directory: my-menuitem index.js node_modules menuitem package.json test we're interested in using the "menuitem" module, which is at "addon-pathfinder/lib/ui/menuitem". open "index.js" and replace it with this: var menuitems = require("menuitem"); var menuitem = menuitems.menuitem({ id: "clickme", menuid: "menu_toolspopup", label: "click me!", oncommand: function() { console.log("clicked"); }, insertbefore: "menu_pageinfo" }); now run the add-on: jpm run -b nightly you should see a new menu item in the tools menu labeled "click me!". click the bu...
...then, under show / hide toolbars, enable the menu bar. finally, click the green bar "exit customize" ...
Downloading Files - Archive of obsolete content
that require credentials before calling nsiwebbrowserpersist.saveuri(), you need to set the progresslistener property of the nsiwebbrowserpersist instance to an object that implements nsiauthprompt. normally, nsiauthprompt expects a prompt to be displayed so the user can enter credentials, but you can return a username and password credentials directly without prompting the user. if you want to open a login prompt, you can use the default prompt by calling the window watcher's getnewauthprompter() method. components.utils.import("resource://gre/modules/privatebrowsingutils.jsm"); const webbrowserpersist = components.constructor("@mozilla.org/embedding/browser/nswebbrowserpersist;1", "nsiwebbrowserpersist"); var persist = webbrowserpersist()...
...// accepts a url and returns the file. // returns empty if the file is not found (with an 404 error for instance). // tried with .jpg, .ico, .gif (even .html). ...
Post data to window - Archive of obsolete content
this offers examples of sending post data to the server and displaying the server response. need more elaborate examples, examples of displaying the response in a new tab, in background tabs, and a link to using xmlhttprequest for post requests. preprocessing post data the apostdata argument of the (global) loaduri(), opendialog(), and (tab)browser.loaduriwithflags() methods expects the post data in the form of an nsiinputstream (because they eventually call nsiwebnavigation.loaduri()) while post data can be created using nsimimeinputstream. most of the time, post data starts as a data string in the form of "name1=data1&name2=data2&...", so you must convert it before passing the data to one of the methods. here is an example: var datastring = "name1=data1&name2=data2"; // post method req...
...pe", "application/x-www-form-urlencoded"); postdata.addcontentlength = true; postdata.setdata(stringstream); // postdata is ready to be used as apostdata argument ... posting data to the current tab there is a convenience method in global scope (in firefox, chrome://browser/content/browser.js): loaduri(auri, areferrer, apostdata, aallowthirdpartyfixup); posting data to a new window window.opendialog('chrome://browser/content', '_blank', 'all,dialog=no', auri, aflags, areferrer, apostdata); ...
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
s generated and placed in the components/ subdirectory of your extension. source files now it's time to create the makefile and source files in the src/ subdirectory. if you're implementing interfaces that you've described using idl, the easiest way to do this is to leave the src/ directory empty and run make on the public/ directory only; this will be explained shortly. then open the generated header file for your interface from /mozilla/$(moz_objdir)/dist/include/. it contains stubs for the component .h and .cpp files that you can copy and paste into your implementation files. all you have to do is fill in the implementation stubs in the c++ file and you're good to go. here's an example of the makefile you need to place into your src directory: depth = ...
...plest way to do this is to write some javascript and xul code. at this point, it would be very helpful to have a bit of experience writing "regular" extensions (i.e. without using custom c++ components). if you've never done this, i strongly recommend that you think of a cool idea for something simple that you've always wanted to tweak in firefox and write it. just displaying a new menu item that opens a "hello, world!" dialog box would be already be a great exercise to get warmed up with. assuming you know how to write xul/javascript extensions, you're aware that the most important stuff goes in the chrome/ directory of your extension. well, the fact that you're also using c++ components doesn't change that one whit. so now you need to create the normal content/, locale/ and skin/ dire...
Install Manifests - Archive of obsolete content
scription> </em:localized> the following properties which are described elsewhere in this page can be included in the localized property: name description creator homepageurl developer translator contributor more documentation can be found at localizing extension descriptions. optionstype the type of user-interface used for displaying the options. accepted values are: 1 opens optionsurl in a dialog box 2 options are displayed inside the add-on manager 3 opens optionsurl in a new tab (if the application supports that), or a dialog box optionstype defaults to 1 if there is an optionsurl included in install.rdf or 2 if there is no optionsurl and the file options.xul exists in the root of the add-on. <em:optionstype>2</em:optionstype> op...
...in a dialog box 2 options are displayed inside the add-on manager 3 opens optionsurl in a new tab (if the application supports that), or a dialog box optionstype defaults to 1 if there is an optionsurl included in install.rdf or 2 if there is no optionsurl and the file options.xul exists in the root of the add-on. <em:optionstype>2</em:optionstype> options can be opened in a new tab since firefox 7.0a1. to do so, set optionstype to 3 and set optionsurl to a the path of a page to open. <em:optionstype>3</em:optionstype> <em:optionsurl>chrome://myaddon/content/options.html</em:optionsurl> this section here contains an example of localized html page as an option panel in a new tab: bootstrapped extensions :: localization (l10n) (example linked to is: github :: ...
Chapter 2: Technologies used in developing extensions - Archive of obsolete content
l-formed. some examples of xml-based markup languages include xhtml, which is html redefined on an xml base; svg, for expressing vector images; and mathml, for expressing mathematical formulas. xul, which is used in firefox, is also based on xml. ...
... as the "extensible" part of xml implies, elements from various xml-based languages such as xhtml and svg can be interspersed in one another as a means to extend the language. all elements can carry a "namespace uri" identifier, which is unique for each language. for example, even though xhtml and svg have elements with the same name, these can be distinguished. ...
Getting Started with Firefox Extensions - Archive of obsolete content
complete, with the exception of npapi plugins, add-ons sdk extensions and bootstrapped extensions. this is an important point to keep in mind if you're building an extension that manipulates other extensions or themes. after installing, look at the main firefox window and see if you notice anything different. did you see it? there's a new menu on the main menu, labeled "hello world!". if you open the menu and then the menu item below, you'll see a nice alert message (for some definitions of 'nice'). click on the ok button to close it. that's all the extension does. now let's take a closer look at it. extension contents you may have noticed that the extension file you installed is named xulschoolhello1.xpi. xpi (pronounced "zippy") stands for cross-platform installer, because the same...
...t. if the server triggers an install when clicking on a link or button, what you need to do is right click on the install link, and choose the save link as... option. decompress the xpi file in a convenient location. issue the following command to unzip the file on linux or mac os x: unzip xulschoolhello1.xpi -d xulschoolhello1 on windows, you can change the file extension from xpi to zip, or open the file directly, then unzip it, using a zip tool. you should see the following directory structure: xulschoolhello1 chrome.manifest install.rdf content browseroverlay.xul browseroverlay.js skin browseroverlay.css locale en-us browseroverlay.dtd browseroverlay.properties t...
Extensions support in SeaMonkey 2 - Archive of obsolete content
ke this: <em:targetapplication> <!-- seamonkey --> <description> <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id> <em:minversion>2.0</em:minversion> <em:maxversion>2.*</em:maxversion> </description> </em:targetapplication> the install.js is not supported any more and should be removed. differences as compared to other toolkit/-based applications you need to overlay/open different chrome urls as compared to firefox. some urls are listed below: url in firefox url in seamonkey overlays chrome://browser/content/browser.xul chrome://navigator/content/navigator.xul main browser window chrome://browser/content/pageinfo/pageinfo.xul chrome://navigator/content/pageinfo/pageinfo.xul page info wi...
...ordinary popups are fine of course. the statusbar in firefox 3 a new vbox has been added, called "browser-bottombox", which encloses the find bar and status bar at the bottom of the browser window. although this doesn't affect the appearance of the display, it may affect your extension if it overlays chro...
Session store API - Archive of obsolete content
when a tab is about to be closed so that you can update data associated with the tab before it is closed, you can watch for the "sstabclosing" event, which is sent to the tab. restoring without restarting firefox 3.6 note this section applies to firefox 3.6 and later. firefox 3.6 knows how to save session store data when the last browser window closes, even if there are still other windows open. similarly, it can now restore the user's session while in that state. in other words, it's now possible for sessions to be restored even without the browser quitting and being relaunched. this is something you may need to keep in mind if you rely on the behavior of the session store system. the session restore process the exact sequence of events that occurs when a session is being restored is...
...ng relaunched. this is something you may need to keep in mind if you rely on the behavior of the session store system. the session restore process the exact sequence of events that occurs when a session is being restored is: a session state is about to be restored. this can be on startup or in response to undo close tab, since closed tabs are restored as single-tab sessions. new windows are opened as required (one for each window that was saved in the session store), and cookies and the list of recently closed tabs are restored. after that, the following steps are taken for each tab being restored: either an existing tab is reused or a new tab is created. in the latter case, a tabopen event is sent. the tab's persistent xul attributes (those saved due to calls to persisttabattribut...
Firefox addons developer guide - Archive of obsolete content
and generate links to their documentation, like this: nsiconsoleservice. if you prefer, you can just link to the articles directly. either way, these links should be added. these articles are all tagged as covering firefox 3.1 using the fx_minversion_header template, but i don't think that's the case. certainly appendix 2 doesn't care what version of firefox you're using, since it's just about open source software licenses. todo: all fixme notes inside the documents; add abbreviation definition to acronyms; add some link to the internal mdc documentation when it makes sense; indent source code; make sure documentation is relevant for all platforms: gnu/linux, macos, windows; add anchor links to figures & listings; add credits to original authors and license; completed sometimes,...
...should we keep this part ? gen's opinion: yes, because it is important for developers to make informed decisions regarding oss licenses and it was a part of the original guide. opinions: i think we should be careful about adding new contents to this guide. the original version of this guide was written as a first step guide for beginners. if we add too much topics...
Case Sensitivity in class and id Names - Archive of obsolete content
affect your site design and best practices to avoid any problems. in the authoring of both css and javascript/dom (otherwise known as dhtml) routines, it is a near-certainty that class and id names will be used to identify elements. we have discovered, however, that many authors are running into trouble with class and id names because they're used to the bugs of browsers that don't fully support open standards. the most common case is where the name uses different case in the document source than is found in the css or javascript. for example, there might be this css: p.warning {color: red; background: yellow;} ...coupled with this html: <p class="warning">warning!</p> in netscape 6, the paragraph in question will have neither red text nor a yellow background. as far as netscape 6 is concer...
...ust be unique in a document. class = cdata-list [cs] this attribute assigns a class name or set of class names to an element. any number of elements may be assigned the same class name or names. multiple class names must be separated by white space characters. the marker "[cs]" means "case sensitive," as defined in section 6.1 of the specification. thus, the mozilla team, committed to following open standards as closely as possible, implemented both class and id names as case-sensitive values. as of this writing, netscape 6 is the only browser to honor this defined behavior; other browsers treat both class and id names as case-insensitive. id uniqueness there is a further restriction, however, on the use of id names. section 12.2.1 makes it illegal for the name and id attributes to use va...
Images, Tables, and Mysterious Gaps - Archive of obsolete content
changed with vertical-align-- we'll talk about that in a bit-- but almost nobody ever changes the value from its default. let's take away the text, and leave only the image, as was done in figure 5. so we have an image sitting on the baseline of a line box that contains only the image. now consider what happens when we put that line in a table cell (figure 6). and there you have it-- spaces opening up where none have ever been seen before. it gets even worse with small images, like ones that are one pixel tall, as illustrated in figure 7. now there's all kinds of space unexpectedly opening up. it's enough to drive a designer mad. how about a fix? there is one obvious fix-- stop creating designs that are dependent on tables and sliced up or single-pixel images-- but it's not terribly...
... them, and the red spacer got even bigger. it's difficult to avoid this, because the images are (in this approach) still inline and so still participate in the creation of a line box. if that line box gets tall enough, space will begin to appear around the images. looking forward to a fix thanks to mozilla's thorough implementation of css2, the problem of inline images in table cells forcing open unwanted space has come to the attention of the css working group. there have been many proposals to fix the problem, but one of the most promising approaches is the property line-box-contain, which has been proposed for inclusion in css3. should this property be adopted, then any browser supporting it could emulate traditional "shrinkwrap" behavior without risking other layout upset with the fol...
Source Navigator - Archive of obsolete content
this should install source-navigator. one can check whether the installation is complete by executing: $ which snavigator /usr/bin/snavigator importing the source execute the following: snavigator. this triggers a splash screen, followed by a "source-navigator projects" dialog as the following: i've already created a new project bin.proj before documenting this. if this is your first time to open source navigator, the big white box on the left of the dialog should contain no lines. click "new project". this shows the "auto-create project" dialog: which allows you to decide your filename of the project file (which ends in .proj) and your source directory/directories that you want to import into the project. (you can always include more by pressing the "more" button.) in my case, i inputte...
...explanatory...): <tt>~/moz1.9/mozilla</tt> (because i saved my source at ~/moz1.9/mozilla.) remember to ensure that "include subdirectories" and "build cross-reference database" are checked. then click "ok". the snavigator then begins to scan your source directories. this takes a few minutes. now you can enjoy searching the mozilla code in a faster speed. using source navigator (more later) opening a project open a terminal. type <tt>snavigator</tt> followed by striking enter. this shows the "source-navigator projects" dialog. choose the project file that you've just created and then click "open...". source navigator then loads the database and then display the following symbols window: searching a method by typing in the method name viewing the definition/declaration by highlighting...
Source code directories overview - Archive of obsolete content
e. messenger in mozilla classic). it includes all the code for managing mail, reading newsgroup messages, importing other mail formats, composing new messages and so on. modules contains c code for various different browsing related features that are built into mozilla. it contains code for handling various image formats (e.g. .png, .gif), allowing drop-in java virtual machines (called oji, for "open java interface"), supporting plug-ins and reading various compression formats (e.g. jar, zip, zlib). this code originated from mozilla as well as various different companies and individual people. netwerk contains c interfaces and code for low-level access to the network (using sockets and file and memory caches) as well as higher-level access (using various protocols such as http, ftp, gopher, ...
...code, xul and javascript scripts for creating new user profiles, managing existing user profiles, migrating profiles from mozilla classic and using default profiles for popular isps (e.g. earthlink and concentric networks). rdf contains c interfaces and code for accessing various data and organizing their relationships according to rdf. rdf stands for "resource description framework" which is an open standard. this code reads and writes data from and to the local file system, databases, the internet or any other source using a url-like syntax. security contains the security modules including nss and psm. storage contains an implementation of sqlite3. suite will contain files specific to the mozilla suite. sun-java contains c code so mozilla can communicate with the sun jvm (java virtual m...
Compiling The npruntime Sample Plugin in Visual Studio - Archive of obsolete content
able precompiled headers using project properties|(all configurations)|c++|precompiled headers|create/use precompiled header. they may be already disabled. define the function exports by adding the .def filename (e.g. nprt.def) to project properties|(all configurations)|linker|input|module definition file. it could be either the full path or the path relative to the project directory. optional: open the above .def file and change "nprt" to the filename of your dll as vs sees it (without "np", if you decided to rename later) optional: edit the .rc file and and the top of npp_gate.cpp for the description, mimetype, file extension etc. to reflect your plugin remove the function npp_getjavaclass from npp_gate.cpp build rename the resulting dll so that the filename starts with "np" and ends w...
...p", if you decided to rename later) optional: edit the .rc file and and the top of npp_gate.cpp for the description, mimetype, file extension etc. to reflect your plugin remove the function npp_getjavaclass from npp_gate.cpp build rename the resulting dll so that the filename starts with "np" and ends with ".dll" (or "32.dll"? 8.3?) and copy it in mozilla's "plugins" folder start mozilla and open about:plugins to verify the plugin is detected open the file "test.html" and begin testing. make sure the mimetypes of your html embed tags match the mimetype specified in your nprt.rc file and the top of your npp_gate.cpp file version issues if vc++ compiler throws you error c2664 on 'drawtext' function call, you may replace it by 'drawtexta'. in fact, all win32 api functions dealing with ...
Enabling the behavior - retrieving tinderbox status - Archive of obsolete content
doesn't do anything. to make it work we have to add javascript code that changes its status when the tinderbox status changes. the first step is to write a function that queries the tinderbox server and retrieves the current status. var gxmlhttprequest; function loadtinderboxstatus() { gxmlhttprequest = new xmlhttprequest(); gxmlhttprequest.onload = updatetinderboxstatus; gxmlhttprequest.open("get", "http://tinderbox.mozilla.org/seamonkey/panel.html"); gxmlhttprequest.send(null); } xmlhttprequest is an interface in mozilla for retrieving documents via http. although it is designed to retrieve xml content and parse it into a dom, it can retrieve (but not parse) other kinds of content as well. in this case we use it to retrieve an html page containing a brief summary of the current ...
...d by the tinderbox server every time a build finishes. it displays a list of active tinderbox clients along with the result of their last build attempt. xmlhttprequest is easy to use in the simple case we have here. we use new to create a new instance of it, set the instance's onload property to updatetinderboxstatus(), the function we want to execute when the document finishes loading, call its open method with the type of http request we want to make and the url of the document to retrieve, and then call its send method to send the request. xmlhttprequest will retrieve the document located at the given url and call the updatetinderboxstatus() function when it is done. notice that we defined the instance of xmlhttprequest as a global variable. this is because we need to reference it in the...
Simple Storage - Archive of obsolete content
k therefore need only use the various standard javascript functions and operators. the jetpack.simple.storage object is automatically and periodically flushed to disk. how and when it is flushed is an implementation detail. jetpacks can flush it manually, however, by calling jetpack.storage.simple.sync(). the object can also be forced to reload its data from disk by calling jetpack.storage.simple.open(), although the data comes loaded automatically. don't abuse these methods, since they cause firefox -- all of firefox -- to drop what it's doing to make a trip to the disk. if you call them too often, firefox may become unresponsive for some of your users. unless you are doing something strange, let jetpack flush your data for you. the namespace currently lives in the future and must be imported...
...less you are doing something strange, let jetpack flush your data for you. the namespace currently lives in the future and must be imported before it is used: jetpack.future.import("storage.simple"); methods sync()as described above, the jetpack.storage.simple object is automatically written to disk, but a feature may force flush by calling jetpack.storage.simple.sync(). don't abuse this method. open()as described above, the jetpack.storage.simple object is automatically populated when a feature is loaded, but a feature may force the object to read from disk by calling jetpack.storage.simple.open(). don't abuse this method. examples this code persistently stores some data: jetpack.future.import("storage.simple");var mystorage = jetpack.storage.simple;mystorage.fribblefrops = [1, 3, 3, 7];myst...
Simple Storage - Archive of obsolete content
k therefore need only use the various standard javascript functions and operators. the jetpack.simple.storage object is automatically and periodically flushed to disk. how and when it is flushed is an implementation detail. jetpacks can flush it manually, however, by calling jetpack.storage.simple.sync(). the object can also be forced to reload its data from disk by calling jetpack.storage.simple.open(), although the data comes loaded automatically. don't abuse these methods, since they cause firefox -- all of firefox -- to drop what it's doing to make a trip to the disk. if you call them too often, firefox may become unresponsive for some of your users. unless you are doing something strange, let jetpack flush your data for you. the namespace currently lives in the future and must be imported...
...less you are doing something strange, let jetpack flush your data for you. the namespace currently lives in the future and must be imported before it is used: jetpack.future.import("storage.simple"); methods sync()as described above, the jetpack.storage.simple object is automatically written to disk, but a feature may force flush by calling jetpack.storage.simple.sync(). don't abuse this method. open()as described above, the jetpack.storage.simple object is automatically populated when a feature is loaded, but a feature may force the object to read from disk by calling jetpack.storage.simple.open(). don't abuse this method. examples this code persistently stores some data: jetpack.future.import("storage.simple"); var mystorage = jetpack.storage.simple; mystorage.fribblefrops = [1, 3, 3, 7]; m...
Mozilla Application Framework - Archive of obsolete content
l that constantly builds, tests, and reports on the mozilla application suite on multiple platforms so you can see the state of the application at any given point in time. community a large, active development community that interacts via newsgroups, mailing lists, irc channels, and web sites. flexible licensing with three licenses to choose from (mpl, lgpl, and gpl) so you can develop both open source and proprietary applications and combine the mozilla framework with other libraries. dozens of existing applications from both large and small development teams. did you know? the mozilla app framework can be used to build standalone desktop applications like komodo, apps that run on top of the mozilla application suite like mozblog, and web applications like the mozilla amazon brows...
...rge and small development teams. did you know? the mozilla app framework can be used to build standalone desktop applications like komodo, apps that run on top of the mozilla application suite like mozblog, and web applications like the mozilla amazon browser. mozilla has been ported to more than a dozen platforms including windows (95, 98, nt, 2000, xp, ce), mac os x, linux, solaris, beos, openvms, os/2, aix, and hp-ux. you can build simple but powerful mozilla-based applications using just javascript and xul. original document information author(s): myk melez last updated date: march 3, 2003 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Configuration - Archive of obsolete content
web app: yes or no location turns the readonly location bar on or off for this web app: yes or no navigation turns the hotkey history navigation (alt+left, alt+right and alt+home) on or off for this web app: yes or no splashscreen filename of an html page to be displayed while the app is loading. the file must be located in the web app home directory: splashscreen.html include uris that should be opened in the web app, rather than in the default browser. an asterisk is used to match any string. separate multiple uris with commas: *google.com, *yahoo.com exclude urls that should be opened in the default browser, rather than in the web app. syntax is the same as for include. trayicon indicates that a system tray (notification area) icon should be displayed for the application on windows: yes or ...
...r. an asterisk is used to match any string. separate multiple uris with commas: *google.com, *yahoo.com exclude urls that should be opened in the default browser, rather than in the web app. syntax is the same as for include. trayicon indicates that a system tray (notification area) icon should be displayed for the application on windows: yes or no. iconic specifies that the application should be opened in iconic state. currently support only on windows in conjunction with the trayicon, causes the application to open minimized to the system tray: yes or no. launch prism with -webapp [bundle] to load the specified web profile and install the webapp to your prism profile folder. once the webapp is installed, it can be launched using -webapp [webapp-id] and prism will skip the installation and r...
Running Tamarin acceptance tests - Archive of obsolete content
e the name of the avm shell produced from the build process you used, above. set the builtinabc environment variable to the path of the generated/builtin.abc. you may build the .abc files build by downloading the latest asc.jar. the latest asc.jar can be downloaded from from ftp://ftp.mozilla.org/pub/js/tamarin...latest/asc.jar. also the source to asc.jar may be downloaded and rebuilt from http://opensource.adobe.com/wiki/dis...exsdk/flex+sdk. set the asc environment variable, as described above. set the shellabc environment variable to the path of the generated/shell_toplevel.abc. $ cd tamarin-redux/test/acceptance $ export asc=/users/build/hg/tamarin-redux/utils/asc.jar $ export builtinabc=/users/build/hg/tamarin-redux/generated/builtin.abc $ export shellabc=/users/build/hg/tamarin-redux/ge...
...ests on the android avm shell. to recap the other environment settings: - set the builtinabc environment variable to the path of the generated/builtin.abc. - you may build the .abc files build by downloading the latest asc.jar. the latest asc.jar can be downloaded from from ftp://ftp.mozilla.org/pub/js/tamarin...latest/asc.jar. also the source to asc.jar may be downloaded and rebuilt from http://opensource.adobe.com/wiki/display/flexsdk/flex+sdk. - set the asc environment variable, as described above. - set the shellabc environment variable to the path of the generated/shell_toplevel.abc. adb 'adb' stands for android debug bridge. adb is used to access your android device and can run both direct and shell-type commands. if you've correctly edited and run the android-vars.sh script mentioned ...
Running Tamarin performance tests - Archive of obsolete content
.abc. (in the tamarin-redux/generated directory) set the shellabc environment variable to the path of the shell_toplevel.abc. (in tamarin-redux/generated directory) set the asc environment variable to the path of the asc.jar compiler. you may download the latest asc.jar from ftp://ftp.mozilla.org/pub/js/tamarin...latest/asc.jar. also the source to asc.jar may be downloaded and rebuilt from http://opensource.adobe.com/wiki/dis...exsdk/flex+sdk. (optional) you may compare the performance of the avmshell to another avmshell. for example you may download or build the latest checked in avmshell to compare against a local change. to compare a build against another build set the avm2 environment variable to the other avmshell or use the "-s --avm2" options. results from the two shells will be shown s...
...ning tests on the android avm shell. to recap the other environment settings: - set the builtinabc environment variable to the path of the /generated/builtin.abc. - you may build the .abc files by downloading the latest asc.jar. the latest asc.jar can be downloaded from from ftp://ftp.mozilla.org/pub/js/tamarin...latest/asc.jar. also the source to asc.jar may be downloaded and rebuilt from http://opensource.adobe.com/wiki/dis...exsdk/flex+sdk. - set the asc environment variable, as described above. - set the shellabc environment variable to the path of the /generated/shell_toplevel.abc. adb 'adb' stands for android debug bridge. adb is used to access your android device and can run both direct and shell-type commands. if you've correctly edited and run the android-vars.sh script mentioned on t...
The life of an HTML HTTP request - Archive of obsolete content
t was last updated in 1999. (1) the loading of the url is started in nswebshell::doloadurl (called from some loadurl or loaduri variant in the webshell). the webshell then tells its documentloader to load (command "view") the specified url. [note: passes nswebshell.mobserver as nsistreamobserver and the webshell as nsicontentviewercontainer to the docloader.] (2) the document loader calls ns_openuri with the url to begin transfering the requested file. necko (the network library) checks the url scheme (the first part of the url, http: in this case) and locates the correct nsiprotocolhandler (in this case nshttphandler) and asks it for a nsichannel (nshttpchannel). the channel represents the connection to the server, and is the source of the html data stream. (3) when data is starting to ...
...eral frames created from a content node, then the first of these are called the "primary" node, and the following frames can be found by using the getnextinflow() method of nsiframe. the initial reflow is done by the nshtmlcontentsink::startlayout(), startlayout() calls presshell::initialreflow(). startlayout is called quite early in the parsing process, for html it's called in nshtmlcontentsink::openbody() (among other places). todo: how are nsiframes reflowed after a change when they already exist? (8) each nsiframe knows how how to draw itself on the screen. when the presshell [note: not true, who really does the call?] has layouted (reflowed) the frames it calls nsiframe::paint() method of all frames. these get passed references to the presentation context and a rendering context to do t...
Venkman Internals - Archive of obsolete content
r.js sets hooks in to the jsdidebuggerservice. initdebugger(). scriptmanager in initdebugger() the previous loaded scripts are passed to an onscriptcreated() method which binds them to a scriptmanager. there is one scriptmanager per url (web page). this method is set into jsdiscripthook.onscriptcreated venkman-views.js views are the panels shown within the venkman window. for example, the "open windows" view shows the browser's windows. venkman-records.js a "record" seems to be data underlying a view. for example, framerecord represents a javascript stack frame. venkman-msg.js localization code, reads venkman.properties from a subdirectory of "locale" and injects variables. things like msg.alert define variables msg_alert. venkman-utils.js defines the dd debug dump and friends ...
...dows. venkman-records.js a "record" seems to be data underlying a view. for example, framerecord represents a javascript stack frame. venkman-msg.js localization code, reads venkman.properties from a subdirectory of "locale" and injects variables. things like msg.alert define variables msg_alert. venkman-utils.js defines the dd debug dump and friends windowrecord representation of the open windows. filecontainerrecord - list of script tags found in the parent record's window.document property. to obtain the antecedent files: doc.getelementsbytagname("script"); then extract the urls from the src attributes. scriptwrapper newsgroup, 2002, rgrinda here is a bit more information about how venkman tracks files and functions... a scriptwrapper is a pure js object defined only ins...
XTech 2006 Presentations - Archive of obsolete content
work on this compiler and the new features of js2 is presented by the inventor of javascript. layout algorithm improvements for web user interfaces (slides, slides as one page) - david baron a discussion of problems with existing standards and potential improvements in two areas: layout systems for user interfaces (rather than documents) and mechanisms for reordering content to allow the author to use good markup and appropriate layout. ...
...g with bookmark labels. svg and canvas: graphics for web apps - vladimir vukićević this presentation examines some of the strengths and weaknesses of the html 'canvas' and svg for adding rich graphical capabilities to web applications. future browser graphics capabilities, both 2d and 3d, are also discussed. converging rich-client and web application development with mozilla xulrunner (open office format) - benjamin smedberg this presentation demonstrates the convergence of rich-client and web application development and discuss application deployment using mozilla xulrunner. etna, a wysiwyg xml relax ng- and gecko-based editor - daniel glazman this presentation describes etna, a new wysiwyg xml editor based on gecko, the relax ng parser and validator disruptive innovations im...
lastSelected - Archive of obsolete content
...
... ...
onpopuphidden - Archive of obsolete content
« xul reference home onpopuphidden type: script code this event is sent to a popup after it has been hidden. this event may also be received while the popup is still open, but when sub-menus contained within this popup are hidden. example: <menupopup id="top" onpopuphidden="console.log('the onpopuphidden method of id=top was called.');"> <menuitem label="item 1"/> <menuitem label="item 2"/> <menu id="submenu1" label="submenu 1"> <menupopup id="submenu1-popup"> <menuitem label="submenu1 item 1"/> <menuitem label="submenu1 item 2"/> </menupopup> </menu> <menu id="submenu2" label="submenu 1"> <menupopup id="submenu2-popup"> <menuitem label="submenu2 item 1"/> <menuitem label="submenu2...
...el="submenu2 item 1"/> <menuitem label="submenu2 item 2"/> </menupopup> </menu> <menupopup/> with the above structure, the onpopuphidden method of <menupopup id="top"> will be called every time either <menupopup id="submenu1-popup"> or <menupopup id="submenu2-popup"> are hidden. this results in the method repeatedly called as the user runs the mouse up and down the menu opening the sub-menus. you can test for the current popup actually being hidden with: <menupopup id="top" onpopuphidden="if(this.state != 'open'){console.log('the onpopuphidden method of id=top was called.');};" > ...
onpopupshown - Archive of obsolete content
...
... ...
reserved - Archive of obsolete content
and is not available for use in the content. this means that, to execute these commands, key events won't be passed to content, and event listeners registered for them in content will not be executed. currently, the content still receives these key events, even though it can't override them. in future releases, it won't receive them. see bug 1173061 for details. ...
...mmands, key events won't be passed to content, and event listeners registered for them in content will not be executed. currently, the content still receives these key events, even though it can't override them. in future releases, it won't receive them. see bug 1173061 for details. ...
Attribute (XUL) - Archive of obsolete content
« xul reference home acceltext accessible accesskey activetitlebarcolor afterselected align allowevents allownegativeassertions alternatingbackground alwaysopenpopup attribute autocheck autocompleteenabled autocompletepopup autocompletesearch autocompletesearchparam autofill autofillaftermatch autoscroll beforeselected buttonaccesskeyaccept buttonaccesskeycancel buttonaccesskeydisclosure buttonaccesskeyextra1 buttonaccesskeyextra2 buttonaccesskeyhelp buttonalign buttondir buttondisabledaccept buttonlabelaccept buttonlabelcancel buttonlabeldisclosure buttonlabelextra1 buttonlabelextra2 buttonlabelhelp buttonorient buttonpack buttons checked checkstate clicktoscroll class closebutton closemenu coalesceduplicatearcs collapse collapsed co...
...ialogextra1 ondialogextra2 ondialoghelp onerror onerrorcommand onextra1 onextra2 oninput onload onnewtab onpageadvanced onpagehide onpagerewound onpageshow onpaneload onpopuphidden onpopuphiding onpopupshowing onpopupshown onsearchcomplete onselect ontextcommand ontextentered ontextrevert ontextreverted onunload onwizardback onwizardcancel onwizardfinish onwizardnext open ordinal orient pack pageid pageincrement pagestep parent parsetype persist persistence phase pickertooltiptext placeholder popup position predicate preference preference-editable primary priority properties querytype readonly ref rel removeelement resizeafter resizebefore rows screenx screeny searchbutton searchsessions searchlabel selected selectedindex selt...
Accessing Files - Archive of obsolete content
the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes). there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. accessing files this section describes how to create a file reference. retrieving a file when working with files, usage is always done via a file object and not via string paths. this allows files to used in a portable way. because string paths are not used, references to files in a file object are mad...
...("the file is there!"); else alert("file not found!"); here, the same file is retrieved and a further check is performed to see whether the file is present or not. the exists method returns true if the file is present and false if it is not. if the file does not exist, you may wish to create it. the file object has a nsifile.create() method which may be used to create an empty file, or you can open a writing stream and write to the file. nsiscriptableio.getfile() may only be used to retrieve files that are directly within one of the starting directories. to retrieve other files, you will need to use nsiscriptableio.getfile() to access a directory and iterate through subdirectories until you come to the file that you want. for more information about this, see working with directories. starti...
IO - Archive of obsolete content
Archive › Mozilla › XUL › FileGuide › IO
the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes). there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. files and streams this section describes how to access and get information about files, read from files and create and write files. using files a xul application or extension may access files on disk, and either read or write to files. a file is accessed via a file object. to get a reference to a file ...
...n for more details. reading from a file for information about reading from text and binary files, see reading from files. writing to a file for information about writing to text and binary files, see writing to files. copying and moving files files may be moved and copied on disk. for details, see copying a file and moving a file. deleting files to learn how to delete a file, see deleting a file. open and save dialogs you can show a dialog to the user to allow them to select a file to open or enter a filename for saving. for details about this, see open and save dialogs. file errors see file errors for a list of errors that might occur while using files. working with directories directories may be accessed in a similar manner using nsiscriptableio.getfile(). for instance, in the following exa...
List of commands - Archive of obsolete content
monkey/sou.../bookmarks.xml http://lxr.mozilla.org/seamonkey/sou...rksoverlay.xul http://lxr.mozilla.org/seamonkey/sou...okmarkstree.js list of commands (listed alphabetically) browser:addbookmark browser:addbookmarkas browser:addgroupmarkas browser:back browser:editpage browser:find browser:findagain browser:findprev browser:forward browser:home browser:managebookmark browser:open browser:openfile browser:print browser:printpreview browser:savepage browser:searchinternet browser:sendpage browser:uploadfile cmd_bm_copy cmd_bm_cut cmd_bm_delete cmd_bm_expandfolder cmd_bm_export cmd_bm_find cmd_bm_import cmd_bm_managefolder cmd_bm_movebookmark cmd_bm_newbookmark cmd_bm_newfolder cmd_bm_newseparator cmd_bm_open cmd_bm_openinnewtab cmd_bm_openinnewwindow ...
...sortfolder cmd_bm_sortfolderbyname cmd_close cmd_closeothertabs cmd_closewindow cmd_copy cmd_copyimage cmd_copylink cmd_cut cmd_delete cmd_editpage cmd_findtypelinks cmd_findtypetext cmd_gotoline cmd_handlebackspace cmd_handleshiftbackspace cmd_minimizewindow cmd_neweditor cmd_neweditordraft cmd_neweditortemplate cmd_newnavigator cmd_newnavigatortab cmd_newtabwithtarget cmd_openhelp cmd_paste - paste a selection from the clipboard cmd_printsetup cmd_quit cmd_redo cmd_savepage cmd_scrollpagedown cmd_scrollpageup cmd_selectall cmd_switchdocumentdirection cmd_switchtextdirection cmd_textzoomenlarge cmd_textzoomreduce cmd_textzoomreset cmd_undo cmd_viewcomponentbar cmd_viewlinktoolbar cmd_viewlinktoolbar_false cmd_viewlinktoolbar_maybe cmd_viewlinktoolbar_...
lastSelected - Archive of obsolete content
...
... ...
triggerNode - Archive of obsolete content
...
... ...
Property - Archive of obsolete content
« xul reference accessible accessibletype accesskey align allnotifications allowevents alwaysopenpopup amindicator applocale autocheck autofill autofillaftermatch boxobject browsers builder builderview buttons canadvance cangoback cangoforward canrewind checked checkstate child children classname clickselectsall clientheight clientwidth collapsed color columns command commandmanager completedefaultindex container contentdocument contentprincipal contenttitle contentview contentvieweredit contentviewerfile contentwindow contextmenu control controller controllers crop current currentindex currentitem currentnotification currentpage currentpane currentset currenturi custom...
... lastpermanentchild lastselected left linkedpanel listboxobject locked markupdocumentviewer max maxheight maxlength maxrows maxwidth menu menuboxobject menupopup min minheight minresultsforpopup minwidth minute minuteleadingzero mode month monthleadingzero name next nomatch notificationshidden object observes onfirstpage onlastpage open ordinal orient pack pagecount pageid pageincrement pageindex pagestep parentcontainer palette persist persistence placeholder pmindicator popup popupboxobject popupopen position predicate preferenceelements preferencepanes preferences priority radiogroup readonly readonly ref resource resultspopup scrollboxobject scrollincrement scr...
chromeclass-toolbar - Archive of obsolete content
otherwise, this option will be ignored for this toolbar and it will always be visible. ...
...otherwise, this option will be ignored for this toolbar and it will always be visible. ...
Template and Tree Listeners - Archive of obsolete content
trees. the tree builder implements the nsitreeview interface, so handles the gathering of data and passing it on to the tree. the tree widget informs the view when certain operations are performed that might affect the data. the tree view handles all of these operations, but allows an observer to be attached which is invoked during these operations. for instance, the observer may have an ontoggleopenstate method which will be called when the user opens or closes a row. the tree builder will handle the adding or removing of rows, but will call the observer so that it can perform some task. the tree builder observer implements the nsixultreebuilderobserver interface and may be attached to a tree builder using the builder's addobserver method. you can add more than one observer if needed, and ca...
... it can perform some task. the tree builder observer implements the nsixultreebuilderobserver interface and may be attached to a tree builder using the builder's addobserver method. you can add more than one observer if needed, and can remove them again with the builder's removeobserver method. the observer is always invoked before the appropriate operation is performed. for instance, the ontoggleopenstate method of any observers will be called before the tree item is opened. after the observers have finished, the tree builder opens the row and adds any child rows inside. note that you cannot cancel the operation from within the observer. some useful functions of the observer are the drag and drop related callbacks to handle when an item is dragged onto the tree. this makes handling dragging o...
Custom toolbar button - Archive of obsolete content
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. to check your text editor, create a plain text file named test.txt. in the file, type some of the special characters that your language uses. save the file. open the file in firefox (for example, by dragging it and dropping it in firefox, or by choosing file – open file... from firefox's menu bar). from firefox's menu bar, choose view – character encoding – unicode (utf-8). check that the text you typed looks ok with this setting. if your text editor does not support utf-8, search the internet for a better one that you can download. optional tool...
... after you get the button working, customize the files carefully. to see the effect of any change that you make, restart the application. advanced troubleshooting if you have some technical knowledge, then you can use the application's javascript console to see error messages. however, you might see messages that are unhelpful or confusing, or that come from other parts of the application. to open the javascript console, choose tools – web developer- browser console, and enable js. or use short cut "ctrl + shift + j" messages in the javascript console can provide information about javascript, xul or css files. note: the preference setting javascript.options.strict imposes restrictions that are not appropriate for the simple scripts in this tutorial. if you choose to use this setting, e...
Adding Buttons - Archive of obsolete content
l"/> <button label="disabled" disabled="true"/> the examples above will generate the buttons in the image. the first button is a normal button. the second button is disabled so it appears greyed out. we'll start by creating a simple find button for the find files utility. the example code below shows how to do this. <button id="find-button" label="find"/> note: firefox does not allow you to open chrome windows from web pages, so the view links in the tutorial will open in normal browser windows. due to this, the buttons will appear to stretch across the window. you can add align="start" to the window tag to prevent the stretching. the findfile.xul example let's add this code to the file findfile.xul that we created in the previous section. the code needs to be inserted in-between the ...
... title="find files" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <button id="find-button" label="find"/> <button id="cancel-button" label="cancel"/> </window> you'll notice that the cancel button was added also. the window has been given a horizontal orientation so that the two buttons appear beside each other. if you open the file in mozilla, you should get something like the image shown here. note: you should not put text labels directly in the xul file. you should use entities instead so that text can be easily translated. in the next section, we will find out how to add labels and images to a xul window. see also more button features « previousnext » ...
Adding Event Handlers - Archive of obsolete content
need to add some scripts which will execute when the user interacts with the dialog. we would want to add a script to handle the find button, the cancel button and to handle each menu command. we write this using javascript functions much in the same way as html. you can use the script element to include scripts in xul files. you can embed the script code directly in the xul file in between the opening and closing script tags but it is much better to include code in a separate file as the xul window will load slightly faster. the src attribute is used to link in an external script file. our find files example let's add a script to the find file dialog. although it does not matter what the script file is called, usually it would be the same as the xul file with a .js extension. in this cas...
...de in a separate file as the xul window will load slightly faster. the src attribute is used to link in an external script file. our find files example let's add a script to the find file dialog. although it does not matter what the script file is called, usually it would be the same as the xul file with a .js extension. in this case, findfile.js will be used. add the line below just after the opening window tag and before any elements. <script src="findfile.js"/> we'll create the script file later when we know what we want to put in it. we'll define some functions in the file and we can call them in event handlers. you can include multiple scripts in a xul file by using multiple script tags, each pointing to a different script. you may use relative or absolute urls. for example, you m...
Adding Methods to XBL-defined Elements - Archive of obsolete content
« previousnext » next, we'll find out how to add custom methods to xbl-defined elements. methods in addition to adding script properties to the xbl-defined element, you can also add methods. these methods can be called from a script. methods are the functions of objects, such as window interface's open() method loads the specified resource into the browsing context (window, <iframe> or tab) with the specified name. if the name doesn't exist, then a new window is opened and the specified resource is loaded into its browsing context.">window.open(). you can define custom methods for your elements using the method element. the general syntax of methods is as follows: <implementation> <method name="method-name"> <parameter name="parameter-name1"/> <parameter name="parameter-na...
...xisting binding will be removed, after its destructor is called. then, the new binding will be added in its place and its constructor invoked. the script for a constructor or destructor should be placed directly inside the appropriate tag. there should only be at most one of each per binding and they take no arguments. here are some examples: <constructor> if (this.childnodes[0].getattribute("open") == "true"){ this.loadchildren(); } </constructor> <destructor action="savemyself(this);"/> the next section shows how to add event handlers to xbl-defined elements. « previousnext » ...
Broadcasters and Observers - Archive of obsolete content
ommand element, any elements hooked up to it will also become disabled automatically. this is a useful way to simplify the amount of code you need to write. the technique also works for other attributes as well. for instance, if you place a label attribute on a command element, any buttons attached to the command will share the same label. example 1 : source view <command id="my_command" label="open"/> <button command="my_command"/> <checkbox label="open in a new window" command="my_command"/> in this example, the button does not have a label attribute, however it is attached to a command that does. the button will share the label with the command. the checkbox already has a label, however, it will be overridden by the command's label. the result is that both the button and the checkbox w...
... if you were to modify the command's label attribute, the label on the button and checkbox will adjust accordingly. we saw something like this in a previous section where the disabled attribute was adjusted once and propagated to other elements. this attribute forwarding is quite useful for a number of purposes. ...
Creating a Skin - Archive of obsolete content
it makes the text in the selected tab appear bold, underlined and dark blue. note in the image that this style has applied only to the first tab, because it's the selected one. adding toolbar icons it is somewhat difficult to distinguish the buttons on the toolbar from the commands on the menu. we could add some icons to the buttons to make them clearer. ...
... tab, because it's the selected one. adding toolbar icons it is somewhat difficult to distinguish the buttons on the toolbar from the commands on the menu. we could add some icons to the buttons to make them clearer. mozilla composer provides some icons for open and save buttons, which we'll just use here to save time. we can set the image for a button using the list-style-image css property. ...
Simple Menu Bars - Archive of obsolete content
reate custom menus, any special style rules or non-menu elements that you place on a menu may not be applied. you should keep this is mind when creating menus. example of a simple menu bar example 1 : source view <toolbox flex="1"> <menubar id="sample-menubar"> <menu id="file-menu" label="file"> <menupopup id="file-popup"> <menuitem label="new"/> <menuitem label="open"/> <menuitem label="save"/> <menuseparator/> <menuitem label="exit"/> </menupopup> </menu> <menu id="edit-menu" label="edit"> <menupopup id="edit-popup"> <menuitem label="undo"/> <menuitem label="redo"/> </menupopup> </menu> </menubar> </toolbox> here, a simple menu bar is created using the menubar element. it will create a...
...s would be placed in a row. normally only menuitems and menuseparators would be placed on a menupopup. you can place any element on a menupopup, however they will be ignored on a macintosh. menuitem element the menuitem element is much like the menu element and has some of the same attributes. id the unique identifier of the menu item. label the text to appear on the menu item, such as open or save. disabled this boolean attribute determines whether the menu item is disabled. this attribute can be set to either true or false where the latter is the default. accesskey this is the key that the user can press to activate the menu item. this letter is typically shown underlined on the menu title. mozilla will look at the label attribute and add an underline character to the ch...
Using Remote XUL - Archive of obsolete content
ul file is served: addtype application/vnd.mozilla.xul+xml .xul then restart your web server. with php you can send the mime-type with the header() function. <?php header('content-type: application/vnd.mozilla.xul+xml'); ?> <!-- xul markup starts here --> note that you don't need a web server for this tutorial; you can load the document you create on your computer via a "file" url or the "open file" function of your browser. step 1: a basic xul document the first thing we need to do is create a basic xul document. <?xml version="1.0"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" /> a xul document requires only two entities to be valid, an xml processing instruction on the first line that identifies the file as xml, and a window element that defin...
...ting ui widgets. xbl files sometimes contain references to the default application stylesheet, and when they do their widgets inherit that style even if we don't specify a stylesheet. you can't count on this behavior, however, so you should always specify a stylesheet. source | rendered step 6: behavior so far, so good. we have a menu bar with menus and buttons, and we can press the buttons, open the menus, and select their items. the interface is in place, but it doesn't do anything. we want it to load urls in the iframe when we press the buttons or select the menu items. for that we need to add javascript code. <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script ...
Using the Editor from XUL - Archive of obsolete content
is really just an <iframe> which takes over some of the task of creating the editor from javascript. editor creation so let's trace through the process of editor creation when bringing up the composer window. you can find the relevant xul parts in editor.xul, the javascript parts in editor.js, and the xbl binding for the editor element in editor.xml. something, somewhere, tells mozilla to open the composer window. editor.xul is loaded. in editor.xul, the <window> tag has an onload handler: onload="editoronload()". that causes the editoronload() javascript function to get executed when the xul is done loading. the xul contains an <editor> tag, e.g.: <editor type="content-primary" id="content-frame" src="about:blank" flex="1"/> the attribute type="content-primary" identifies thi...
...nseditorshell::onenddocumentload(). after checking that we can actually edit this document, we go ahead and instantiate an editor on it (in nseditorshell::preparedocumentforediting()). as well as making the editor (which happens via nseditorshell::doeditormode()) we also hook up various listeners and observers for ui updating and user interaction, and store a file specifier for the document we opened. the editor is now set up, and ready to go. one thing to note about editor initialization is that we pass into the editor's init() method an nsicontent* that corresponds to the root of the content tree that the editor is allowed to work with. when initializing the editor from the nseditorshell, we pass null here (which tells the editor that it can edit everything under the <body> of the docu...
XUL Parser in Python/source - Archive of obsolete content
source code for the xul parser in python. import sys, glob, xmllib import os, re el_list = {} w = open('res.html', 'w') # unfortunately, i had to put this hack in here to suppress the printing out of the resolved namespace: # "xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul window", etc. ...
...p) return t class xulparser(xmllib.xmlparser): def unknown_starttag(self, t, a): name = strip(t) if name not in el_list: el_list[name] = {} for attr,val in a.items(): el_list[name][strip(attr)] = strip(val) def syntax_error(self, message): pass p = xulparser() cmd = 'dir /s /b *.xul' chrome_dir = 'c:\program files\netscape\netscape 6\chrome' os.chdir(chrome_dir) files = os.popen(cmd).readlines() for file in files: file = file.strip() print '** ' + file + ' **' data = open(file).read() p.feed(data) w.write('<html><h3>periodic table of xul elements</h3>') w.write('<table><style>.head {font-weight: bold; background-color: lightgrey;}</style>') elements = el_list.keys() elements.sort() for item in elements: w.write('<tr><td class="head">' + item + '</td></tr>\n') for...
XUL accessibility tool - Archive of obsolete content
ith the following xul applications: firefox 1.5+ thunderbird 3.0a+ recent sunbird builds recent songbird builds. it probably also works on seamonkey, but i haven't verified this. use to launch the tool after installation, look for an entry in the tools menu of the host application, or hit ctrl+alt+shift+f12. once the tool window has loaded, select either a local file, web url, or currently open window from the file menu to generate a xul report for that document. be aware that the report might take a little while to be ready depending on the complexity of the application being analyzed and the speed of your machine. future work the following things have been suggested or are planned for a future version of the tool: new tests: (aaronlev) warning: hardcoded color and pixel sizings ...
...rning: accesskey as lowercase letter with descender (underlined g,j,y,q,p are hard to read, not recommended) (aaronandy) list of things to check manually, such as a list oftrees in the document (make sure they have accessible column picker equivs) or a list of toolbarbuttons (make sure they have accessible alternatives). new features: (aaronlev) automatically test any new windows as they are opened. (aaronandy) highlight or blink source element in original xul app upon click of referencing line in report. (aaronlev) compatibility with more xul applications. (aaronandy) maybe an online tool to automatically generate a xul a11y tool compatible with a user-specified xul app. (aaronandy) link report sections to relevant part of xul a11y guidelines. (aaronandy) enable tabs, context menu, a...
XUL controls - Archive of obsolete content
se these controls, see the xul tutorial. for more reference information, see the xul reference. <button> a button that can be pressed by the user. <button label="save" accesskey="s"/> more information about the button element. button reference <button type="menu"> a button that has a drop down menu attached to it. pressing the button opens the menu. <button type="menu" label="view"> <menupopup> <menuitem label="list"/> <menuitem label="details"/> </menupopup> </button> more information about this type of menu button element. button reference related elements: menupopup menuitem <button type="menu-button"> a button that that has a separate arrow button with a menu at...
...utton element. toolbarbutton reference related elements: menupopup menuitem toolbar <toolbarbutton type="menu-button"> a button on a toolbar that that has a separate arrow button with a menu attached to it. unlike with the 'menu' type, a separate action may be performed when the main part of the button is pressed. <toolbarbutton type="menu-button" label="open"> <menupopup> <menuitem label="open changed files"/> <menuitem label="open all"/> </menupopup> </toolbarbutton> more information about this type of menu toolbarbutton element. toolbarbutton reference related elements: menupopup menuitem toolbar <tree> a tree displays a hierarchy of items in multiple columns. <tree> <treecols> ...
colorpicker - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a palette of colors from which a user may select by clicking on one of the grid cells. attributes disabled, color, onchange, preference, tabindex, type properties accessibletype, color, disabled, open, tabindex, value examples <colorpicker/> attributes disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can ...
... a value indicating the type of accessibility object for the element. color type: color string the currently selected color. this is modified when the user selects a color. you can assign a string of the form #rrggbb to this property to change the selected color. disabled type: boolean gets and sets the value of the disabled attribute. open type: boolean returns true if the popup for a button-type colorpicker is open. set this property to true to open the popup or false to close the popup. tabindex type: integer gets and sets the value of the tabindex attribute. value property gets and sets color attribute methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), compared...
datepicker - Archive of obsolete content
ctual-event-handler-function, 0); to queue up your event handler to run after the rest of the picker's change event handlers. a monthchange event is fired for the grid and popup datepickers whenever a new month is navigated to or displayed. attributes disabled, firstdayofweek, readonly, type, tabindex, value properties date, dateleadingzero, datevalue, disabled, month, monthleadingzero, open, readonly, tabindex, value, year, yearleadingzero examples <datepicker type="grid" value="2007-03-26"/> attributes disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused,...
...abled type: boolean gets and sets the value of the disabled attribute. month type: integer the currently selected month from 0 to 11. set this property to change the selected month. monthleadingzero type: boolean a read only value indicating whether a leading zero should be displayed before the month when it is less than 10. open type: boolean for popup type datepickers, specifies whether the popup is open. set this property to open or close the popup. for non-popup datepickers, this property is always false. readonly type: boolean if set to true, then the user cannot modify the value of the element. tabindex type: integer gets and sets the value of the tabinde...
label - Archive of obsolete content
Archive › Mozilla › XUL › label
ng it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. href type: string defines a url to open when this element is clicked. requires the class attribute to include text-link. value type: string the text to be used for the label. properties accesskey type: character gets and sets the value of the accesskey attribute. accessibletype type: integer a value indicating the type of accessibility object for the element. con...
...the text to be indented on its left side. monospace this class causes the text to be displayed in a monospace font. plain this class causes the element to be displayed with no border or margin. small-margin this class causes the text to be displayed with a smaller margin. text-link labels with this class may be focused and the click handler run or the address in the href attribute opened on a mouse click or enter key press. labels will appear like a link (blue and underlined). related elements description attributes label interfaces nsiaccessibleprovider, nsidomxullabelelement notes labels are not focusable note: starting in gecko 2.0, labels are properly not focusable. they used to incorrectly inherit from nsidomxulcontrolelement. the caption is i...
tabbrowser - Archive of obsolete content
urn value add a progress listener to the browser which will monitor loaded documents. the progress listener should implement the nsiwebprogresslistener interface. addtab( url, referreruri, charset, postdata, owner, allowthirdpartyfixup ) addtab( url, {referreruri: ..., charset: ..., postdata: ..., owner: ..., allowthirdpartyfixup: ..., relatedtocurrent: ... }) return type: tab element opens a new tab that loads a page with the specified url. the rest of the parameters are optional. the row of tabs will appear if needed. firefox 3.6 note the second form of this method was added in firefox 3.6; it allows you to specify the parameters by name, in any order. it also adds the relatedtocurrent parameter; firefox uses this to decide whether the new tab should be inserted next to...
... load. a referreruri property may also be optionally used to set the referrer page. this function returns a reference to the first tab loaded. loadonetab( url, referreruri, charset, postdata, loadinbackground, allowthirdpartyfixup ) loadonetab( url, { referreruri: ..., charset: ..., postdata: ..., inbackground: ..., allowthirdpartyfixup: ..., relatedtocurrent: ... }) return type: tab element opens a new tab that loads a page with the specified url. the rest of the parameters are optional. this method works the same as addtab except for the loadinbackground parameter which allows you to choose whether to open the new tab in foreground or background. there's also no owner parameter as the owner tab is specified automatically. parameters inbackground if true the tab will be loaded ...
tree - Archive of obsolete content
Archive › Mozilla › XUL › tree
rdinal="1"/> <splitter class="tree-splitter" ordinal="2"/> <treecol id="mytree2-treecol1" flex="1" label="column b" persist="width" ordinal="3"/> </treecols> <treechildren> <treeitem> <treerow> <treecell label="1"/> <treecell label="a"/> </treerow> </treeitem> <!-- make sure to set container="true" --> <treeitem container="true" open="true"> <treerow> <treecell label="2"/> <treecell label="b"/> </treerow> <treechildren> <treeitem> <treerow> <treecell label="2a"/> <treecell label="ba"/> </treerow> </treeitem> </treechildren> </treeitem> </treechildren> </tree> attributes disabled type: boolean indicates whether t...
...can also use the following values: cell individual cells can be selected text rows are selected; however, the selection highlight appears only over the text of the primary column. for richlistbox, this is new in firefox 3.5. statedatasource type: uri chrome xul may specify an rdf datasource to use to store tree state information. this is used to hold which tree items are open and which items are collapsed. this information will be remembered for the next time the xul file is opened. if you do not specify this attribute, state information will be stored in the local store (rdf:local-store). tabindex type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tabin...
treeitem - Archive of obsolete content
treeitem contains a single row and all of what appear to the user as that row's descendants. in a template condition, you should use a treeitem instead of a content element when the dont-build-content flag is specified. set the uri attribute to the variable name to bind to a content node during matching. more information is available in the xul tutorial. attributes container, empty, label, open, uri examples (example needed) attributes container type: boolean set to true if the element is to act as a container which can have child elements. this would be used for folders. this will be set by the template builder as needed. empty type: boolean set to true if the element is a container that contains no children. this will be set by the template builder as needed. ...
... empty type: boolean set to true if the element is a container that contains no children. this will be set by the template builder as needed. label tipo: string (concatenación de caracteres) para un árbol tree con columnas simples, la etiqueta puede ser colocada directamnete sobre el elemeto "treeitem" sin la necesidad de una fila "row" y un elemento "treeitem" dentro. open type: boolean for the menu type buttons, the open attribute is set to true when the menu is open. the open attribute is not present if the menu is closed. uri type: string for template-generated content, the attribute should be placed on the element where content generation should begin. thus, it should be placed on an element that is a descendant of a template. the value should be set...
toolkit.defaultChromeURI - Archive of obsolete content
see also: xulrunner:specifying startup chrome window, toolkit.defaultchromefeatures, toolkit.singletonwindowtype. ...
...see also: xulrunner:specifying startup chrome window, toolkit.defaultchromefeatures, toolkit.singletonwindowtype. ...
Mozprocess - Archive of obsolete content
he mozbase project, please see the mozbase project page. mozprocess provides python process management via an operating system and platform transparent interface to mozilla platforms of interest. mozprocess aims to provide the ability to robustly terminate a process (by timeout or otherwise), along with any child processes, on windows, os x, and linux. mozprocess utilizes and extends subprocess.popen to these ends. api mozprocess.processhandler:processhandler is the central exposed api for mozprocess. processhandler utilizes a contained subclass of subprocess.popen, process, which does the brunt of the process management. basic usage: process = processhandler(['command', '-line', 'arguments'], cwd=none, # working directory for cmd; defaults to none ...
... ) exit_code = process.waitforfinish(timeout=60) # seconds see an example in https://github.com/mozilla/mozbase/b...profilepath.py processhandler may be subclassed to handle process timeouts (by overriding the ontimeout() method), process completion (by overriding onfinish()), and to process the command output (by overriding processoutputline()). todo document improvements over subprocess.popen.kill ...
Gecko Compatibility Handbook - Archive of obsolete content
amples were removed because of technical limitations. they are actually replaced by ''-(example removed)-'' the goal of this handbook is to help you update websites to work with standards-based browsers and properly detect gecko. if you're new to standards, you may find using web standards in your web pages a helpful introduction. gecko is an embeddable browser, developed as part of the mozilla open source project and based on w3 standards rather than the proprietary approaches of the past. adhering to web standards simplifies cross-browser web development and enables accessibility. 4.x vs. gecko since 1997, much of the web's content has been developed for microsoft internet explorer 4 or netscape navigator 4. these browsers were developed before the relevant w3c recommendations for html, ...
...cos and compuserve 7 to check for browser detection and network issues. testing aol from within a firewall if you need to connect to aol via a corporate firewall, america online has registered tcp/ip ports 5190 and 11523 so you can communicate with the aol client software. this way you can test your site on the aol client from behind your firewall, provided that your network administrators will open these ports. you need to be connected to the internet to test your site on aol; it isn't possible to access your site on a local machine via your lan, without an internet connection. see webmaster@aol for further information. 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 g...
2006-10-13 - Archive of obsolete content
atibility between windows vista and firefox, also about the versioning change. large discussion about why the use of the sequence 2.0.0.*. discussions everyone and his goldfish thinks bug 300198 should be fixed large response to the discussion about the bug: https://bugzilla.mozilla.org/show_bug.cgi?id=300198, regarding middle clicking on a tab. annoying firefox 2 save dialog instead of open/save ones. user questions about a open/saveas bug that already exisits: https://bugzilla.mozilla.org/show_bug.cgi?id=347230 installer for 2.0rc2 ehume gives the developers a thumbs up for the new installer for 2.0rc2 having a textfield where you can type in the installation directory. a way to recover the toolbars from popup windows that hide it a suggestion for a way to recover toolbars...
...xt menu along with back, reload, etc.) questions about programming for firefox a student questions how to create an extension that changes fonts, and how to capture website content before it is displayed. firefox add-on wanted user is inquiring if there is such an application to automatically save pieces of a webpage everytime is it updated. firefox 2.0 should re-implement modal window.open to support web 2.0 user would like the option to show pop-up windows, using window.open(), from inside untrusted script, to be re-implemented. this function was disabled, see bug: https://bugzilla.mozilla.org/show_bug.cgi?id=180048 meetings none this week. authors sara minchella (sara) dave manley (senemanley) back to summary list ...
2006-12-01 - Archive of obsolete content
this implementation was removed in 2002 to fight against popups. xml in firefox is a major problem a major debate surrounding the use of xml for customizing rss feeds. devs say this is the way its supposed to be, others say its a bug! the debate continues. ...
...this implementation was removed in 2002 to fight against popups. xml in firefox is a major problem a major debate surrounding the use of xml for customizing rss feeds. devs say this is the way its supposed to be, others say its a bug! the debate continues. ...
2006-11-03 - Archive of obsolete content
more tbox changes on the way, most hitting on friday preed discusses killing more tboxes. ...
... more tbox changes on the way, most hitting on friday preed discusses killing more tboxes. ...
2006-12-01 - Archive of obsolete content
it supports a apache2 module and stand alone version. http://www.juicescript.org/ discussions deleting objects in spidermonkey a user asks if there's a method of manually deleting an object in spidermonkey before garbage collector deletes it. ...
... ...
Solaris 10 Build Prerequisites - Archive of obsolete content
the tools included with solaris and sun studio should be sufficient for building mozilla, so you can skip this. the installer must install additional sun-provided packages from the os install dvd, so that dvd has to be available. the installer will try to install the sunwsmbas package, which is not available in newer versions of sxde. fortunately, it also isn't necessary, so you can fix this problem by simply removing the reference to that package from the installer script (cbe-install). ...
..._env_quiet" != x1 && \ echo setting path=$path export path +export pkg_config_path=/opt/sfw/lib/pkgconfig:/usr/lib/pkgconfig 3. replace the commands in cbe that don't work on solaris 10. % cd /opt/jdsbld/bin % mv make make.bak % ln -s /usr/sfw/bin/gmake make % mv ls ls.bak % ln -s /usr/bin/ls ls 4. checkout the desktop spec files for branch gnome-2-20. % svn co svn+ssh://anon at svn dot opensolaris dot org/svn/jds/spec-files/branches/gnome-2-20 5. unpack the extra spec file tarball to the spec file directory. % cd gnome-2-20 % gtar jxvf firefox-solaris-10-spec.tar.bz2 6. unpack the patch tarball to the patches directory. % cd gnome-2-20/patches % gtar jxvf firefox-3.0-solaris-10-patches.tar.bz2 7. build pkg-config and gtk-doc from source. just unpack the source tarball, run "./config...
Browser Feature Detection - Archive of obsolete content
document.url true true true document.body true true true document.images true true true document.applets true true true document.links true true true document.forms true true true document.anchors true true true document.cookie true true true document.open() true true true document.close() true true true document.write() true true true document.writeln() true true true document.getelementbyid() true true true document.getelementsbyname() true true true dom css 1 support for properties/methods in document.body.style name firefox 1.
...: 'referrer', 'supported': false}, {name: 'domain', 'supported': false}, {name: 'url', 'supported': false}, {name: 'body', 'supported': false}, {name: 'images', 'supported': false}, {name: 'applets', 'supported': false}, {name: 'links', 'supported': false}, {name: 'forms', 'supported': false}, {name: 'anchors', 'supported': false}, {name: 'cookie', 'supported': false}, {name: 'open', 'supported': false}, {name: 'close', 'supported': false}, {name: 'write', 'supported': false}, {name: 'writeln', 'supported': false}, {name: 'getelementbyid', 'supported': false}, {name: 'getelementsbyname', 'supported': false} ], 'domcore2': [ {name: 'doctype', 'supported': false}, {name: 'implementation', 'supported': false}, {name: 'documentelement', 'supported': false}, ...
CSS - Archive of obsolete content
Archive › Web › CSS
ull-screen element, except containing frames in parent documents, which are the full-screen element in their own documents. however, those elements' ancestors have this pseudo-class applied to them.:-moz-system-metric()this page was auto-generated because a user created a sub-page to this page.::-ms-browsethe ::-ms-browse css pseudo-element is a microsoft extension that represents the button that opens the file picker of <input type="file">.::-ms-checkthe ::-ms-check css pseudo-element is a microsoft extension that represents checkboxes and radio button groups created by <input type="checkbox"> and <input type="radio">.::-ms-clearthe ::-ms-clear css pseudo-element creates a clear button at the edge of an <input type="text"> text control that clears the current value. this pseudo-element is no...
...:-ms-clearthe ::-ms-clear css pseudo-element creates a clear button at the edge of an <input type="text"> text control that clears the current value. this pseudo-element is non-standard, supported only in internet explorer 10, internet explorer 11, and microsoft edge.::-ms-expandthe ::-ms-expand css pseudo-element is a microsoft extension that represents the button of a <select> menu control that opens or closes the drop-down menu. typically it is a triangle that points downward.::-ms-fillthe ::-ms-fill css pseudo-element is a microsoft extension that represents a progress bar displayed by <progress>.::-ms-fill-lowerthe ::-ms-fill-lower css pseudo-element represents the lower portion of the track of a slider control; that is, the portion corresponding to values less than the value currently se...
Window.importDialog() - Archive of obsolete content
n the future. obsoletethis feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. this function was only available in the original, xul-based version of firefox for android, which is no longer supported; for that reason, this function is obsolete and should never be used. summary because opening windows on mobile isn't necessarily appropriate, the firefox mobile team designed the importdialog() method to replace window.opendialog(). instead of opening a new window, it merges the specified xul dialog into the main window. syntax newdialog = importdialog(aparent, asrc, aarguments) newdialog the opened window aparent the dialog's parent; can be null. asrc the chrome url of the...
... scripts are loaded via an attribute on the <dialog> element, not via the <script> tag. the xul is merged into the existing window, almost like a xul overlay. because of this, element id and javascript conflicts are possible, just like overlays. ...
Issues Arising From Arbitrary-Element hover - Archive of obsolete content
is quirk is extended to cover selectors that combine a bare class selector with the :hover pseudo-class (see bug 169078 for details). named anchor problems in addition to the effects described previously, there are two other relatively common effects that authors may not expect. one is easily fixed by validation, but the other is a little more subtle. ...
... this brings up the second common problem, which is that named anchors can accept hover styles. although authors may intend the selector a:hover to apply only to hyperlinks, it will also apply to named anchors, since the selector merely states that any a element which is in a hover state will be styled. ...
RDF in Fifty Words or Less - Archive of obsolete content
ernet resource. there are tons of others, including email messages, usenet news articles (or entire usenet news groups), and search results from your favorite web crawler, just to name a few. and fundamentally, there's no reason that you shouldn't be able to treat these as "bookmarks" as well, grouping them together into folders as you please, or maybe even creating "smart" folders that, when you open them, dynamically generate their contents by running common search that you define. and a "bookmark" could really have arbitrary properties associated with it: you might want to invent your own "classification" scheme for a bookmarka la macintosh's "hot", "warm", "cool" color coding. or you might want to relate a bookmark to another bookmark, or keep it in multiple "folders" at once. the rdf gr...
...to be communicated between "agents". okay, what the heck doesthat mean? fundamentally, it means that parts of the rdf data model can be communicated across network boundaries, and the contents of the graph can dynamically change as information arrives from a remote service. let's go back to our bookmark example. say that one of my bookmark "folders" is really a pointer to my email inbox: when i open that folder, voilà! all the messages that i've received over night appear. but how did that happen? the inbox "folder" was really just a pointer to an internet resource that contains more rdf that extends the graph. that "internet resource" was a uri that pointed to a cgi script (say, http://www.mozilla.org/smart-mail/get-mail.cgi?user=waterson&folder=inbox). the cgi script actually generatesse...
XUL Parser in Python - Archive of obsolete content
ipts and use it more flexibly: >>> import xultool >>> myxp = xulparser() >>> chrome_dir = 'd:\src\mozilla\xpfe' >>> res = myxp.parsexul(chrome_dir, 'window', 'id') where something like the above would write out all the xul window ids in the build. something like that, anyway. results the results from the script are written to a file called res.html. this is another hard-coded thing i have to open up. if you want to test this script you should change the filename "res.html" specified in the fourth line and compare different results files. note also that i wrote the build number into the header myself, and haven't figured out yet how to get that written automatically. i guess you could get a modify date from the files as you open them. how the script works as i said before, there isn't to...
...>' + item + '</td></tr>\n') for a in el_list[item].values(): w.write('<tr><td class="at">' + a + '</td>') with these modifications, the script creates an output more like a periodic table of xul elements. until i spruce it up a little, this is just a very basic demonstration of using python's xml parser with xul. but mozilla's upcoming support for languages like perl and python will really open up the mozilla platform to tools and approaches of this kind--and make now a good time to start thinking about how these various technologies will be put together. the first level of support for python in mozilla will apparently be for python modules made available as xpcom objects. extending on the approach in this script, then, you could imagine a kind of introspective xul chrome that could mod...
Archive of obsolete content
only move pages here that are extremely obsolete. if anyone might realistically need the information in a living product, it may not be appropriate to move it here. in general, it may be best to discuss it in the mdn web docs room on matrix before moving content here. .htaccess ( hypertext access ) file accessing : htaccess files can be opened using any text editor, like windows notepad, vin, sublime text editor or any other. syntax highliting support for .htaccess files less. 2015 mdn fellowship program add-ons archived add-ons documentation. adding preferences to an extension this article takes the creating a dynamic status bar extension sample to the next level, adding a p...
...sed design can be visually compelling and preserve the interface conventions we've come to expect from web pages. api archived documentation about obsolete web standards apis. archived mozilla and build documentation these articles are archived, obsolete documents about mozilla, gecko, and the process of building mozilla projects. archived open web documentation the documentation listed below is archived, obsolete material about open web topics. beginner tutorials this page includes archived beginners tutorials, from various places around mdn. case sensitivity in class and id names creating a dynamic status bar extension concepts covered in the previous sample won't be reiterated ...
Introduction to game development for the Web - Game development
is, you can build games that run in the browser (or on html5-powered devices) without making compromises. the html5 game platform you can truly think of the web as a better target platform for your game. ...
...else, even if it's not in a native javascript format. web audio api this api for controlling the playback, synthesis, and manipulation of audio from javascript code lets you create awesome sound effects as well as play and manipulate music in real time. webgl lets you create high-performance, hardware-accelerated 3d (and 2d) graphics from web content. this is a web-supported implementation of opengl es 2.0. webrtc the webrtc (real-time communications) api gives you the power to control audio and video data, including teleconferencing and transmitting other application data back and forth between two users. want your players to be able to talk to each other while blowing up monsters? this is the api for you. websockets the websocket api lets you connect your app or site to a server to t...
Building up a basic demo with A-Frame - Game development
if you have available vr or ar hardware) such as the latest firefox or chrome — download firefox nightly or chrome (v54 or higher). (optional) set up a vr device such as oculus rift or google cardboard. create a new directory to store your project in. save a copy of the latest a-frame javascript library file inside your directory (check the github repository for latest stable a dev builds). open the a-frame documentation in a separate tab — it is useful to refer to. html structure the first step is to create an html document — inside your project directory, create a new index.html file, and save the follow html inside it: <!doctype html> <html> <head> <meta charset="utf-8"> <title>mdn games: a-frame demo</title> <script src="aframe.min.js"></script> </head> <body> <!-- htm...
... cube y position) are unitless, and can basically be anything you deem suitable for your scene — milimeters, meters, feet, or miles — it's up to you. adding a background: sky box a sky box is a background for the 3d world, represented by an <a-sky> element. in our case we will use a simple color, but it could also be an image, etc. looking around would give an impression of being inside an open sky, a wooden barn — wherever you like! add the following html before the <a-cube> element: <a-sky color="#dddddd"></a-sky> at this point, if you save the code and refresh your browser you can already see the cube on the screen with our custom background: here's the code we have created so far: you can also check it out on github. a-frame takes care of setting up everything you need: ...
Building up a basic demo with Three.js - Game development
feel free to try another library, such as copperlicht, glge, or playcanvas. environment setup to start developing with three.js, you don't need much. you should: make sure you are using a modern browser with good webgl support, such as the latest firefox or chrome. create a directory to store your experiments in. save a copy of the latest minimized three.js library inside your directory. open the three.js documentation in a separate tab — it is useful to refer to. html structure here's the html structure we will use: <!doctype html> <html> <head> <meta charset="utf-8"> <title>mdn games: three.js demo</title> <style> body { margin: 0; padding: 0; } canvas { width: 100%; height: 100%; } </style> </head> <body> <script src="three.min.js"></script> <script> var width = wind...
...{ requestanimationframe(render); renderer.render(scene, camera); } render(); on every new frame the render function is invoked, and the renderer renders the scene and the camera. right after the function declaration, we're invoking it for the first time to start the loop, after which it will be used indefinitely. again, add this new code below your previous additions. try saving the file and opening it in your browser. you should now see a gray window. congratulations! geometry now our scene is properly rendering, we can start adding 3d shapes. to speed up development, three.js provides a bunch of predefined primitives, which you can use to create shapes instantly in a single line of code. there's cubes, spheres, cylinders, and more complicated shapes available. detail like drawing requ...
2D maze game with device orientation - Game development
most from this tutorial. example game by the end of the tutorial you will have a fully functional demo game: cyber orb. it will look something like this: phaser framework phaser is a framework for building desktop and mobile html5 games. it’s quite new, but growing rapidly thanks to the passionate community involved in the development process. you can check it out on github where it’s open sourced, read the online documentation and go through the big collection of examples. the phaser framework provides you with a set of tools that will speed up development and help handle generic tasks needed to complete the game, so you can focus on the game idea itself. starting with the project you can see cyber orb source code on github. the folder structure is quite straightforward: the sta...
...a set of tools that will speed up development and help handle generic tasks needed to complete the game, so you can focus on the game idea itself. starting with the project you can see cyber orb source code on github. the folder structure is quite straightforward: the starting point is the index.html file where we initialize the framework and set up an <canvas> to render the game on. you can open the index file in your favourite browser to launch the game and try it. there are also three folders in the directory: img: all the images that we will use in the game. src: the javascript files with all the source code of the game defined inside. audio: the sound files used in the game. setting up the canvas we will be rendering our game on canvas, but we won't do it manually — this wi...
Fork - MDN Web Docs Glossary: Definitions of Web-related terms
a fork is a copy of an existing software project at some point to add someone's own modifications to the project. basically, if the license of the original software allows, you can copy the code to develop your own version of it, with your own additions, which will be a "fork". ...
...e to develop your own version of it, with your own additions, which will be a "fork". forks are often seen in free and open source software development. this is now a more popular term thanks to contribution model using git (and/or the github platform). ...
Gonk - MDN Web Docs Glossary: Definitions of Web-related terms
some other parts of the hal are shared with aosp: gps, camera, and others. you could call gonk a very simple linux distribution. gonk is a porting target of gecko (just as gecko has been ported to os x, windows, and android). ...
...some other parts of the hal are shared with aosp: gps, camera, and others. you could call gonk a very simple linux distribution. gonk is a porting target of gecko (just as gecko has been ported to os x, windows, and android). ...
Specification - MDN Web Docs Glossary: Definitions of Web-related terms
a specification is a document that lays out in detail what functionality or attributes a product must include before delivery. ...
...s out in detail what functionality or attributes a product must include before delivery. ...
XInclude - MDN Web Docs Glossary: Definitions of Web-related terms
parent = xinclude.parentnode; try { netscape.security.privilegemanager.enableprivilege('universalxpconnect universalbrowserread'); // necessary with file:///-located files trying to reach external sites if (href !== null) { var response, responsetype; var request = new xmlhttprequest(); request.open('get', href, false); request.setrequestheader('if-modified-since', 'thu, 1 jan 1970 00:00:00 gmt'); request.setrequestheader('cache-control', 'no-cache'); if (accept) { request.setrequestheader('accept', accept); } if (acceptlanguage) { request.setreq...
... } // need to make a whole new request apparently since cannot convert the encoding after receiving it (to know what the encoding was) var request2 = new xmlhttprequest(); request2.overridemimetype('text/plain; charset='+encodingtype); request2.open('get', href, false); request2.setrequestheader('if-modified-since', 'thu, 1 jan 1970 00:00:00 gmt'); request2.setrequestheader('cache-control', 'no-cache'); request2.send(null); response = request2[responsetype]; // update the response for processing ...
Sizing items in CSS - Learn web development
l be displayed using that intrinsic size. we have given the image in the example below a border so that you can see the extent of the file. an empty <div> however, has no size of its own. if you add a <div> to your html with no content, then give it a border as we did with the image, you will see a line on the page. this is the collapsed border on the element — there is no content to hold it open. in our example below, that border stretches to the width of the container, because it is a block level element, a behavior that should be starting to become familiar to you. it has no height (or size in the block dimension) because there is no content. in the example above, try adding some text inside the empty element. the border now contains that text because the height of the element is de...
... change the vh and vw values this will change the size of the box or font; changing the viewport size will also change their sizes because they are sized relative to the viewport. to see the example change when you change the viewport size you will need to load the example in a new browser window that you can resize (as the embedded <iframe> that contains the example shown above is its viewport). open the example, resize the browser window, and observe what happens to the size of the box and text. sizing things according to the viewport can be useful in your designs. for example, if you want a full-page hero section to show before the rest of your content, making that part of your page 100vh high will push the rest of the content below the viewport, meaning that it will only appear once the d...
Fundamental text and font styling - Learn web development
tart styling text on a webpage, but there are many more properties you could use. we just wanted to cover the most important ones here. once you've become used to using the above, you should also explore the following: font styles: font-variant: switch between small caps and normal font alternatives. font-kerning: switch font kerning options on and off. font-feature-settings: switch various opentype font features on and off. font-variant-alternates: control the use of alternate glyphs for a given font-face. font-variant-caps: control the use of alternate capital glyphs. font-variant-east-asian: control the usage of alternate glyphs for east asian scripts, like japanese and chinese. font-variant-ligatures: control which ligatures and contextual forms are used in text. font-variant-nu...
...'t have any specific exercises for you to do: we'd just like you to have a good play with some font/text layout properties, and see what you can produce! you can either do this using offline html/css files, or enter your code into the live editable example below. if you make a mistake, you can always reset it using the reset button. ...
Styling lists - Learn web development
the ordered list lower alphabetical bullets. feel free to play with the list example as much as you like, experimenting with bullet types, spacing, or whatever else you can find. if you make a mistake, you can always reset it using the reset button. if you get really stuck, press the show solution button to see a potential answer. ...
...he reset button. if you get really stuck, press the show solution button to see a potential answer. ...
How do you make sure your website works properly? - Learn web development
problems. active learning there is no active learning available yet. dig deeper test in your browser if you want to know whether your website works correctly, the first thing to do is fire up your browser and go to the page you want to test. uh-oh, where's the image? let's look at our personal website, http://demozilla.examplehostingprovider.net/. it's not showing the image we expected! open firefox's network tool (tools ➤ web developer ➤ network) and reload the page: there's the problem, that "404" at the bottom. "404" means "resource not found", and that's why we didn't see the image. http statuses servers respond with a status message whenever they receive a request. here are the most common statuses: 200: ok the resource you asked for was delivered. 301: moved perm...
... or you lost your network connection while you were uploading your resources. first check the spelling and accuracy of the file path, and if there's still a problem, upload your files again. that will likely fix the problem. javascript errors someone (possibly you) added a script to the page and made a mistake. this will not prevent the page from loading but you will feel something went wrong. open the console (tools ➤ web developer ➤ web console) and reload the page: in this example, we learn (quite clearly) what the error is, and we can go fix it (we will cover javascript in another series of articles). more things to check we have listed a few simple ways to check that your website works properly, as well as the most common errors you may run across and how to fix them. you can ...
How much does it cost to do something on the Web? - Learn web development
twrangler, eclipse, netbeans, and visual studio code. some, like sublime text, you can test as long as you like, but you're encouraged to pay. some, like phpstorm, can cost between a few dozen and 200 dollars, depending on the plan you purchase. some of them, like microsoft visual studio, can cost hundreds, or thousands of dollars; though visual studio express is free for individual developers or open source projects. often, for-pay editors will have a trial version. to start, we suggest trying out several editors, to get a sense of which works best for you. if you're only writing simple html, css, and javascript, go with a simple editor. price does not reliably reflect a text editor's quality or usefulness. you have to try it for yourself and decide if it meets your needs. for example, subl...
...ors if you want to include video or audio into your website, you can either embed online services (for example youtube, vimeo, or dailymotion), or include your own videos (see below for bandwidth costs). for audio files, you can find free software (audacity, wavosaur), or paying up to a few hundred dollars (sony sound forge, adobe audition). likewise, video-editing software can be free (pitivi, openshot for linux, imovie for mac), less than $100 (adobe premiere elements), or several hundred dollars (adobe premiere pro, avid media composer, final cut pro). the software you received with your digital camera may cover all your needs. publishing tools you also need a way to upload files: from your hard drive to a distant web server. to do that you should use a publishing tool such as an (s)ftp...
How do you upload your files to a web server? - Learn web development
ients, rsync and github. sftp there are several sftp clients out there. our demo covers filezilla, since it's free and available for windows, macos and linux. to install filezilla go to the filezilla downloads page, click the big download button, then install from the installer file in the usual way. note: of course there are lots of other options. see publishing tools for more information. ...
...are lots of other options. see publishing tools for more information. open the filezilla application; you should see something like this: logging in for this example, we'll suppose that our hosting provider (the service that will host our http web server) is a fictitious company "example hosting provider" whose urls look like this: mypersonalwebsite.examplehostingprovider.net. we have just opened an account and received this info from them: congratulations for opening an account at example hosting provider. your account is: demozilla your website will be visible at demozilla.examplehostingprovider.net to publish to this account, please connect through sftp with the following credentials: sftp server: sftp://demozilla.examplehostingprovider.net username: demozilla password: qui...
Example 1 - Learn web development
nd: #f0f0f0; border: .2em solid #000; border-top-width : .1em; border-radius: 0 0 .4em .4em; box-shadow: 0 .2em .4em rgba(0,0,0,.4); box-sizing : border-box; min-width : 100%; max-height: 10em; /* 100px */ overflow-y: auto; overflow-x: hidden; } .select .option { padding: .2em .3em; } .select .highlight { background: #000; color: #ffffff; } result for active state open state html <div class="select active"> <span class="value">cherry</span> <ul class="optlist"> <li class="option highlight">cherry</li> <li class="option">lemon</li> <li class="option">banana</li> <li class="option">strawberry</li> <li class="option">apple</li> </ul> </div> css /* --------------- */ /* required styles */ /* --------------- */ .select { position: re...
... border: .2em solid #000; border-top-width : .1em; border-radius: 0 0 .4em .4em; box-shadow: 0 .2em .4em rgba(0,0,0,.4); -moz-box-sizing : border-box; box-sizing : border-box; min-width : 100%; max-height: 10em; /* 100px */ overflow-y: auto; overflow-x: hidden; } .select .option { padding: .2em .3em; } .select .highlight { background: #000; color: #fff; } result for open state ...
HTML text fundamentals - Learn web development
...
...cle, you have all the information you need to mark up our recipe page example. you can choose to either save a local copy of our text-start.html starting file and do the work there, or do it in the editable example below. doing it locally will probably be better, as then you'll get to save the work you are doing, whereas if you fill it in to the editable example, it will be lost the next time you open the page. both have pros and cons. playable code <h2>live output</h2> <div class="output" style="min-height: 50px;"> </div> <h2>editable code</h2> <p class="a11y-label">press esc to move focus away from the code area (tab inserts a tab character).</p> <textarea id="code" class="input" style="min-height: 200px; width: 95%">quick hummus recipe this recipe makes quick, tasty hummus, with no...
Adding vector graphics to the Web - Learn web development
method described above, inserting svgs using css background images means that the svg can't be manipulated with javascript, and is also subject to the same css limitations. if your svgs aren't showing up at all, it might be because your server isn't set up properly. if that's the problem, this article will point you in the right direction. how to include svg code inside your html you can also open up the svg file in a text editor, copy the svg code, and paste it into your html document — this is sometimes called putting your svg inline, or inlining svg. make sure your svg code snippet begins and ends with the <svg></svg> tags (don't include anything outside those.) here's a very simple example of what you might paste into your document: <svg width="300" height="200"> <rect width="10...
...r image assets, so pages that include the image will not load faster after the first page containing the image is loaded. you may include fallback in a <foreignobject> element, but browsers that support svg still download any fallback images. you need to weigh whether the extra overhead is really worthwhile, just to support obsolescent browsers. how to embed an svg with an <iframe> you can open svg images in your browser just like webpages. so embedding an svg document with an <iframe> is done just like we studied in from <object> to <iframe> — other embedding technologies. here's a quick review: <iframe src="triangle.svg" width="500" height="500" sandbox> <img src="triangle.png" alt="triangle with three unequal sides" /> </iframe> this is definitely not the best method to choo...
HTML table basics - Learn web development
Learn › HTML › Tables › Basics
and rowspan to improve this table. first, make a local copy of our animals-table.html and minimal-table.css files in a new directory on your local machine. the html contains the same animals example as you saw above. next, use colspan to make "animals", "hippopotamus", and "crocodile" span across two columns. finally, use rowspan to make "horse" and "chicken" span across two rows. save and open your code in a browser to see the improvement. note: you can find our finished example at animals-table-fixed.html on github (see it live also). providing common styling to columns there is one last feature we'll tell you about in this article before we move on. html has a method of defining styling information for an entire column of data all in one place — the <col> and <colgroup> el...
... robots jazz this isn't ideal, as we have to repeat the styling information across all three cells in the column (we'd probably have a class set on all three in a real project and specify the styling in a separate stylesheet). instead of doing this, we can specify the information once, on a <col> element. <col> elements are specified inside a <colgroup> container just below the opening <table> tag. we could create the same effect as we see above by specifying our table as follows: <table> <colgroup> <col> <col style="background-color: yellow"> </colgroup> <tr> <th>data 1</th> <th>data 2</th> </tr> <tr> <td>calcutta</td> <td>orange</td> </tr> <tr> <td>robots</td> <td>jazz</td> </tr> </table> effectively we are defining two "st...
General asynchronous programming concepts - Learn web development
the code runs in the order it appears in the source, and the later operation doesn't run till the earlier operation has finished running. note: the previous example is very unrealistic. you would never ca...
...te thread, called a worker so that you can run multiple javascript chunks simultaneously. you'd generally use a worker to run expensive processes off the main thread so that user interaction is not blocked. main thread: task a --> task c worker thread: expensive task b with this in mind, have a look at simple-sync-worker.html (see it running live), again with your browser's javascript console open. this is a rewrite of our previous example that calculates the 10 million dates in a separate worker thread. now when you click the button, the browser is able to display the paragraph before the dates have finished calculating. the first operation no longer blocks the second. asynchronous code web workers are pretty useful, but they do have their limitations. a major one is they are not able t...
Introduction to events - Learn web development
s just the same: const btn = document.queryselector('button'); function bgchange() { const rndcol = 'rgb(' + random(255) + ',' + random(255) + ',' + random(255) + ')'; document.body.style.backgroundcolor = rndcol; } btn.onclick = bgchange; there are many different event handler properties available. let's experiment. first, make a local copy of random-color-eventhandlerproperty.html, and open it in your browser. it's just a copy of the simple random color example we've played with already. now try changing btn.onclick to the following different values in turn, and observing the results in the example: btn.onfocus and btn.onblur — the color changes when the button is focused and unfocused; try pressing the tab to focus on the button and press the tab again to focus away from the b...
...ation.html (also see it running live here.) event bubbling and capture the final subject to cover here is something that you won't come across often, but it can be a real pain if you don't understand it. event bubbling and capture are two mechanisms that describe what happens when two handlers of the same event type are activated on one element. ...
Introduction to web APIs - Learn web development
) has a number of events available on them, for example, the load event is fired when a response has been successfully returned containing the requested resource, and it is now available. the following code provides a simple example of how this would be used: let requesturl = 'https://mdn.github.io/learning-area/javascript/oojs/json/superheroes.json'; let request = new xmlhttprequest(); request.open('get', requesturl); request.responsetype = 'json'; request.send(); request.onload = function() { const superheroes = request.response; populateheader(superheroes); showheroes(superheroes); } note: you can see this code in action in our ajax.html example (see it live also). the first five lines specify the location of the resource we want to fetch, create a new instance of a request obj...
...'json'; request.send(); request.onload = function() { const superheroes = request.response; populateheader(superheroes); showheroes(superheroes); } note: you can see this code in action in our ajax.html example (see it live also). the first five lines specify the location of the resource we want to fetch, create a new instance of a request object using the xmlhttprequest() constructor, open an http get request to retrieve the specified resource, specify that the response should be sent in json format, then send the request. the onload handler function then specifies what we do with the response. we know the response will be successfully returned and available after the load event has fired (unless an error occurred), so we save the response containing the returned json in the super...
Manipulating documents - Learn web development
the browser that enables the html structure to be easily accessed by programming languages — for example the browser itself uses it to apply styling and other information to the correct elements as it renders a page, and developers like you can manipulate the dom with javascript after the page has been rendered. we have created a simple example page at dom-example.html (see it live also). try opening this up in your browser — it is a very simple page containing a <section> element inside which you can find an image, and a paragraph with a link inside. the html source code looks like this: <!doctype html> <html> <head> <meta charset="utf-8"> <title>simple dom example</title> </head> <body> <section> <img src="dinosaur.png" alt="a red tyrannosaurus rex: a two l...
...ant to print them to the screen. in this example we will solve a common problem — making sure your application is as big as the window it is viewed in, whatever size it is. this is often useful in situations like games, where you want to use as much of the screen area as possible to play the game in. to start with, make a local copy of our window-resize-example.html and bgtile.png demo files. open it and have a look — you'll see that we've got a <div> element covering a small part of the screen, which has got a background tile applied to it. we'll use that to represent our app ui area. first of all, let's grab a reference to the div, and then grab the width and height of the viewport (the inner window, where your document is displayed) and store them in variables — these two values ...
Basic math in JavaScript — numbers and operators - Learn web development
ing: sizing a canvas box in this exercise, you will manipulate some numbers and operators to change the size of a box. the box is drawn using a browser api called the canvas api. there is no need to worry about how this works — just concentrate on the math for now. the width and height of the box (in pixels) are defined by the variables x and y, which are initially both given a value of 50. open in new window in the editable code box above, there are two lines marked with a comment that we'd like you to update to make the box grow/shrink to certain sizes, using certain operators and/or values in each case. let's try the following: change the line that calculates x so the box is still 50px wide, but the 50 is calculated using the numbers 43 and 7 and an arithmetic operator. change th...
...in this case, we are not testing if two mathematical expressions have the same value — we are testing whether the text content of a button contains a certain string — but it is still the same principle at work. if the button is currently saying "start machine" when it is pressed, we change its la...
What is JavaScript? - Learn web development
testing in more detail when you get closer to delivering production code (i.e. real code that real customers will use). third party apis are not built into the browser by default, and you generally have to grab their code and information from somewhere on the web. for example: the twitter api allows you to do things like displaying your latest tweets on your website. the google maps api and openstreetmap api allows you to embed custom maps into your website, and other such functionality. note: these apis are advanced, and we'll not be covering any of these in this module. you can find out much more about these in our client-side web apis module. there's a lot more available, too! however, don't get over excited just yet. you won't be able to build the next facebook, google maps, or ...
... a similar manner to css. whereas css uses <link> elements to apply external stylesheets and <style> elements to apply internal stylesheets to html, javascript only needs one friend in the world of html — the <script> element. let's learn how this works. internal javascript first of all, make a local copy of our example file apply-javascript.html. save it in a directory somewhere sensible. open the file in your web browser and in your text editor. you'll see that the html creates a simple web page containing a clickable button. next, go to your text editor and add the following in your head — just before your closing </head> tag: <script> // javascript goes here </script> now we'll add some javascript inside our <script> element to make the page do something more interesting...
JavaScript object basics - Learn web development
nd methods when they are inside objects.) let's work through an example to understand what they look like. to begin with, make a local copy of our oojs.html file. this contains very little — a <script> element for us to write our source code into. we'll use this as a basis for exploring basic object syntax. while working with this example you should have your developer tools javascript console open and ready to type in some commands. as with many things in javascript, creating an object often begins with defining and initializing a variable. try entering the following line below the javascript code that's already in your file, then saving and refreshing: const person = {}; now open your browser's javascript console, enter person into it, and press enter/return. you should get a result si...
....interests[1] person.bio() person.greeting() you have now got some data and functionality inside your object, and are now able to access them with some nice simple syntax! note: if you are having trouble getting this to work, try comparing your code against our version — see oojs-finished.html (also see it running live). the live version will give you a blank screen, but that's ok — again, open your devtools and try typing in the above commands to see the object structure. so what is going on here? well, an object is made up of multiple members, each of which has a name (e.g. name and age above), and a value (e.g. ['bob', 'smith'] and 32). each name/value pair must be separated by a comma, and the name and value in each case are separated by a colon. the syntax always follows this pat...
Client-Server Overview - Learn web development
the remainder of the response header includes information about the response (e.g. when it was generated), the server...
... the remainder of the response header includes information about the response (e.g. when it was generated), the server, and how it expects the brow...
Introduction to the server side - Learn web development
when products are sold either online or in a shop, the shop might update its database of inventory). note: your imagination doesn't have to work hard to see the benefit of server-side code for efficient storage and delivery of information: go to amazon or some other e-commerce site. search for a number of keywords and note how the page structure doesn't change, even though the results do. open two or three different products. note again how they have a common structure and layout, but the content for different products has been pulled from the database. for a common search term ("fish", say) you can see literally millions of returned values. using a database allows these to be stored and shared efficiently, and it allows the presentation of the information to be controlled in just on...
...n on the current user of a site and send different responses based on that information. this allows, for example, a site to know that a user has previously logged in and display links to their emails or order history, or perhaps save the state of a simple game so that the user can go to a site again and carry on where they left it. note: visit a newspaper site that has a subscription model and open a bunch of tabs (e.g. the age). continue to visit the site over a few hours/days. eventually, you will start to be redirected to pages explaining how to subscribe, and you will be unable to access articles. this information is an example of session information stored in cookies. notifications and communication servers can send general or user-specific notifications through the website itself o...
Getting started with Ember - Learn web development
odomvc sample app, teaching you how to use the essentials of the ember framework along the way. todomvc is a basic to-do tracking app implemented in many different technologies. here is the completed ember version, for reference. a note on todomvc and accessibility the todomvc project has a few issues in terms of adhering to accessible/default web practices. there are a couple of github issues open about this on the todomvc family of projects: add keyboard access to demos re-enable outline on focusable elements ember has a strong commitment to being accessible by default and there is an entire section of the ember guides on accessibility on what it means for website / app design. that said, because this tutorial is a focus on the javascript side of making a small web application, tod...
...eeded to create the todomvc styles. first, enter into your todomvc directory in the terminal, for example using cd todomvc in macos/linux. now run the following command to place the common todomvc css inside your app: npm install --save-dev todomvc-app-css todomvc-common next, find the ember-cli-build.js file inside the todomvc directory (it's right there inside the root) and open it in your chosen code editor. ember-cli-build.js is responsible for configuring details about how your project is built — including bundling all your files together, asset minification, and creating sourcemaps — with reasonable defaults, so you don't typically need to worry about this file. we will however add lines to the ember-cli-build.js file to import our shared css files, so that th...
Componentizing our React app - Learn web development
make a <todo /> before we can make a component, we should create a new file for it. in fact, we should make a directory just for our components. the following commands make a components directory and then, within that, a file called todo.js. make sure you're in the root of your app before you run these! mkdir src/components touch src/components/todo.js our new todo.js file is currently empty! open it up and give it its first line: import react from "react"; since we're going to make a component called todo, you can start adding the code for that to todo.js too, as follows. in this code, we define the function and export it on the same line: export default function todo() { return ( ); } this is ok so far, but our component has to return something! go back to src/app.js, copy the f...
...ither obvious pieces of ui, or reused pieces of ui, or both, we can make two more components: <form/> <filterbutton/> since we know we need both, we can batch some of the file creation work together with a terminal command. run this command in your terminal, taking care that you're in the root directory of your app: touch src/components/form.js src/components/filterbutton.js the <form /> open components/form.js and do the following: import react at the top of the file, like we did in todo.js. make yourself a new form() component with the same basic structure as todo(), and export that component. copy the <form> tags and everything between them from inside app.js, and paste them inside form()’s return statement. export form at the end of the file. your form.js file should rea...
Componentizing our Svelte app - Learn web development
tml, css, and javascript languages, and have knowledge of the terminal/command line. you'll need a terminal with node + npm installed to compile and build your app. objective: to learn how to break our app into components and share information among them. code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app state, run cd mdn-svelte-tutorial/04-componentizing-our-app or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/04-componentizing-our-app remember to run npm install && npm run dev to start your app in development mode. repl to code along with us using the repl, start at https://svelte.dev/repl/99b9eb22...
...hing lots of events. stores allows you to share reactive data among components that are not hierarchically related. we will look at stores later on in the series. the code so far git to see the state of the code as it should be at the end of this article, access your copy of our repo like this: cd mdn-svelte-tutorial/05-advanced-concepts or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/05-advanced-concepts remember to run npm install && npm run dev to start your app in development mode. repl to see the current state of the code in a repl, visit: https://svelte.dev/repl/76cc90c43a37452e8c7f70521f88b698?version=3.23.2 summary now we have all of our app's required functionality in place. we can display, add, edit and delete todos, mark them as complete...
Creating our first Vue component - Learn web development
ed. objective: to learn how to create a vue component, render it inside another component, pass data into it using props, and save its state. creating a todoitem component let's create our first component, which will display a single todo item. we'll use this to build our list of todos. in your moz-todo-vue/src/components directory, create a new file named todoitem.vue. open the file in your code editor. create the component's template section by adding <template></template> to the top of the file. create a <script></script> section below your template section. inside the <script> tags, add a default exported object export default {}, which is your component object. your file should now look like this: <template> </template> <script> export default {}; </scrip...
...mapping the checkbox to the label, as shown below. <template> <div> <input type="checkbox" id="todo-item" checked="false" /> <label for="todo-item">my todo item</label> </div> </template> using todoitem inside our app this is all fine, but we haven’t added the component to our app yet, so there’s no way to test it and see if everything is working. let’s add it now. open up app.vue again. at the top of your <script> tag, add the following to import your todoitem component: import todoitem from './components/todoitem.vue'; inside your component object, add the components property, and inside it add your todoitem component to register it. your <script> contents should now look like this: import todoitem from './components/todoitem.vue'; export ...
Handling common accessibility problems - Learn web development
ty certain html features can be selected using only the keyboard — this is default behavior, available since the early days of the web. the elements that have this capability are the common ones that allow user to interact with web pages, namely links, <button>s, and form elements like <input>. you can try this out using our native-keyboard-accessibility.html example (see the source code) — open this in a new tab, and try pressing the tab key; after a few presses, you should see the tab focus start to move through the different focusable elements; the focused elements are given a highlighted default style in every browser (it differs slightly between different browsers) so that you can tell what element is focused. you can then press enter/return to follow a focused link or press a bu...
...le. most modern browsers follow the tab pattern described above (you can also do shift + tab to move backwards through the focusable elements), but some browsers have their own idiosyncracies: firefox for the mac doesn't do tabbing by default. to turn it on, you have to go to preferences > advanced > general, then uncheck "always use the cursor keys to navigate within pages". next, you have to open your mac's system preferences app, then go to keyboard > shortcuts, then select the all controls radio button. safari doesn't allow you to tab through links by default; to enable this, you need to open safari's preferences, go to advanced, and check the press tab to highlight each item on a webpage checkbox. important: you should perform this kind of test on any new page you write — make su...
Handling common JavaScript problems - Learn web development
oes.length; i++) { ... so the code falls over as soon as we try to access a property of jsonobj (which as you might expect, is supposed to be a json object). this is supposed to be fetched from an external .json file using the following xmlhttprequest call: let requesturl = 'https://mdn.github.io/learning-area/javascript/oojs/json/superheroes.json'; let request = new xmlhttprequest(); request.open('get', requesturl); request.send(); let superheroes = request.response; populateheader(superheroes); showheroes(superheroes); but this fails. the console api you may already know what is wrong with this code, but let's explore it some more to show how you could investigate this. for a start, there is a console api that allows javascript code to interact with the browser's javascript console. ...
...mething like this (although this is a simplified example): let ua = navigator.useragent; if(ua.indexof('firefox') !== -1) { // run firefox-specific code } else if(ua.indexof('chrome') !== -1) { // run chrome-specific code } the idea was fairly good — detect what browser is viewing the site, and run code as appropriate to make sure the browser will be able to use your site ok. note: try opening up your javascript console now and running navigator.useragent, to see what you get returned. however, as time went on, developers started to see major problems with this approach. for a start, the code was error prone. what if you knew a feature didn't work in say, firefox 10 and below, and implemented code to detect this, and then firefox 11 came out — which did support that feature? fir...
Introducing a complete toolchain - Learn web development
used for a project. note: it's also worth repeating that not all of these tools need to be run on the command line. many of today's code editors (such as vs code and atom) have integration support for a lot of tools via plugins. introducing our case study the toolchain that we are creating in this article will be used to build and deploy a mini site that lists data (taken from one of nasa's open apis) concerning potentially hazardous space objects that threaten our existence on earth! it looks like this: you can see a live version of the site at near-misses.netlify.com. tools used in our toolchain in this article we're going to use the following tools and features: jsx, a react-related set of syntax extensions that allow you to do things like defining component structures inside ...
...ill be caught early on. using the command line, we can create the project, install the initial tooling, and create rudimentary configuration files. again, once you've repeated this process a few times, you'll get a feel for what your default setup should be. of course, this is just one possible configuration. initial setup ok, let's get the initial project setup out the way. start off by opening your terminal, and navigating to a place that you'll be able to find and get to easily. the desktop perhaps, or your home or documents folder? next, run the following commands to create a folder to keep your project in, and go inside the folder: mkdir will-it-miss cd will-it-miss now we will create a new directory for all of our web site's development code to live in. run the fo...
Package management basics - Learn web development
repository, and keywords: press return to leave each of these blank for now. author: the author of the project. type your own name, and press return. license: the license to publish the package under: press return to accept the default for now. press return one more time to accept these settings. go into your parcel-experiment directory and you should now find you've got a package.json file. open it up and it should look something like this: { "name": "parcel-experiment", "version": "1.0.0", "description": "a simple npm package to learn about using npm", "main": "index.js", "scripts": { "test": "echo \"error: no test specified\" && exit 1" }, "author": "chris mills", "license": "isc" } so this is the config file that defines your package. this is good for now, so let...
... in the scripts property of your package.json file. parcel can run a development server using the command parcel server filename.html, and we’d like to use that often during our development. so let’s create a custom shorthand command — “dev” — in our package.json. if you followed the tutorial from earlier, you should have a package.json file inside your parcel-experiment directory. open it up, and its scripts member should look like this: "scripts": { "test": "echo \"error: no test specified\" && exit 1", }, update it so that it looks like this, and save the file: "scripts": { "test": "echo \"error: no test specified\" && exit 1", "dev": "parcel serve index.html" }, we’ve added a custom dev command as an npm script. now try running the following in your terminal, ma...
Accessibility information for UI designers and developers
board, it lets people type a character, say ‘k’, to jump directly to options starting with ‘k’. it is recommended to use native controls, visibly or under the hood. links vs buttons to keep your interface in line with user expectations, use links for interactions that go somewhere (on the current page or another page) and buttons for interactions that do something (like submit a form or open an overlay). links can be styled as buttons and vice versa, but designers are advised to avoid this where possible. motion on pages with transitions and animations, note that some users could experience distraction, dizziness or nausea. pages with a parallax effect can particularly cause troubles. to help these users, you could offer a setting to turn off animations, or wrap the css in the pr...
...r wrap the css in the prefers-reduce-motion media query. see also: understanding success criterion 2.3.3: animation from interactions content on hover or focus if content is revealed on hover or focus, for example in tooltips, there are some things to keep in mind: if the extra content obscures existing content, there should be a way to close it without moving focus if the extra content is opened on hover, hovering the additional content itself should not cause it to disappear consistent navigation navigation should be consistent across different pages on your site. it does not need to be exactly the same, it is fine to have a different current menu item or different subnavigation links. do make sure they appear in the same place. that way, users of screen readers and screen magnifi...
Gecko info for Windows accessibility vendors
has scrolled, even if only 1 line. gecko fires this event when the scrolling is finished, rather than fire excessive events. event_scrollingstart is fired when the user has jumped to a named anchor within the page. the event is fired on the first accessible object in the part of the document that has been jumped to. event_menupopupstart and event_menupopupend are fired when xul menus are opened or closed. event_menustart and event_menuend are fired when the xul menubar is activated or deactivated. event_valuechange is fired for sliders, progress meters and other objects who's get_accvalue() may change. event_show, event_hide and event_locationchange are fired for the caret object. event_reorder is fired on an object whenever its children change. event_show and event_hi...
... role_menupopup dhtml: role="wairole:menu" fires event_menupopupstart, event_menupopupend role_menuitem xul: menuitem dhtml: role="wairole:menuitem" sets state_checked for radio or checkbox menuitem types accelerator key comes in accname after a \t (tab) character. for example, "open\tctrl+o" role_tooltip xul: <tooltip> or tooltiptext attribute role_application default role of root object of application dhtml: role="wairole:application" accname() exposes the <title> of the current pane. role supported? unique features role_document defau...
Accessible Toolkit Checklist
ows, but should be expanded to include information about linux and os x. it is maintained by the mozilla accessibility community. contributions are welcome. general dialogs/windows/general escape key cancels dialogs and refocuses the previously focused on the parent window. alt+f4 closes windows, similar to escape but even works on dialogs without cancel button alt+space opens window menu with restore, move, size, minimize, maximize, close the move and size options must be usable with the arrow keys on the keyboard in windows, initial focus goes to first focusable widget that is not a clickable tabbed property sheet label making tab order definable. default tab order should be in document order. tab order must wrap, not have invisible items in ...
...ote, you can use the accessible description to expose the current tab position, such as "3 of 5" in order to provide ease of access for the user. the "of" will be parsed out by the assistive technology, so don't localize it. lists and combo boxes when a list is tabbed to, select the first item if nothing else is already selected f4, alt+down or alt+up toggle a combo box open and closed escape closes combo box if it was open (be careful not to have it cancel entire dialog) up/down arrow key navigation. shift+up and shift+down move and extend the selection. typing letter or several letters to navigate (same letter goes to each item starting with that, different letters go to first item starting with that entire string). multiple selection is pos...
A bird's-eye view of the Mozilla framework
associated services implementing a particular application feature. chrome and extensions are examples of packages. content (dom) the mozilla document object model (dom) specifies a logical tree structure for storing ui and document content, and provides an api (application programming interface) for accessing and manipulating the content. an application such as the browser may have one or more open documents accessible via dom apis. when an html, xml, svg or other type of document is loaded, the nglayout engine (also known as gecko) parses the contents into a dom tree, and handles the layout and rendering of the document pages. the nglayout engine also parses xul ui controls into a dom tree and handles rendering of the ui. core services modules such as the nglayout engine comprise the cor...
...rful benefit of the object model, which defines a module as a set of one or more xpcom objects calledcomponents. these objects provide services to client packages and modules and access services provided by other modules through dynamically queryable interfaces. figure 2 shows this structure. figure 2. in the diagram above, each horizontal line extending from an object and terminated by an open circle indicates an interface to the object. the client object does not need to know anything about the internal structure or implementation of the provider object in order to take advantage of its services. the client simply queries the provider for a particular service, and if available, accesses that service through an interface defined in xpidl (cross-platform idl), derived from the corba idl...
Capturing a minidump
indows for free, those include windbg which you will need here. download it from install debugging tools for windows. (you'll want the 32-bit version of windbg only if you are using a 32-bit version of firefox) then install it, the standard settings in the installation process are fine. capture a minidump connect firefox to the debugger. ...
...tools for windows. (you'll want the 32-bit version of windbg only if you are using a 32-bit version of firefox) then install it, the standard settings in the installation process are fine. capture a minidump connect firefox to the debugger. if firefox is not already running, then open windbg from the start menu (start->all programs->debugging tools for windows->windbg). next, open the "file" menu and choose "open executable...". in the file chooser window that appears, open the firefox.exe executable in your firefox program folder (c:\program files\mozilla firefox). if firefox is already running, open windbg from the start menu (start->all programs->debugging tools for windows->windbg). next, open the "file" menu and choose "attach to a process...". in the fil...
How Mozilla's build system works
g, or generating an appropriate build backend. a build backend is merely a tool used to build the tree — like gnu make or tup. these data structures describe the current state of the system and what the existing build configuration looks like. for example, a data structure defines which compiler to use, how to invoke it, which application features are enabled, and so on. you are encouraged to open config.status to have a look! after we have emitted a config.status file, we proceed to phase 2. phase 2: build backend preparation and the build definition once configure has determined what the current build configuration is, we need to apply this to the source tree so we can actually build. what essentially happens is the automatically produced config.status python script is executed as so...
...limited set of operations. moz.build files are limited to performing the following actions: calling functions that are explicitly made available to the moz.build environment. assigning to a well-defined set of variables whose name is uppercase. creating new variables whose name is not uppercase (this includes defining functions). moz.build files cannot do the following: import modules. open files. use the print statement or function. reference many of python's built-in or global functions (they are not made available to the execution environment). the most important actions of moz.build files are #1 and #2 from the above list. these are how the execution of a moz.build file tells the build system what to do. for example, you can assign to the dirs list to define which directorie...
Contributing to the Mozilla code base
this page should guide you through the initial steps of contributing to mozilla. welcome, we're delighted to see you! :) need help? the mozilla community prides itself on being an open, accessible, and friendly community for new participants. if you have any difficulties getting involved or finding answers to your questions, please come and ask your questions in our chatroom, where we can help you get started. we know even before you start contributing that getting set up to work on firefox and finding a bug that's a good fit for your skills can be a challenge. we're always looking for ways to improve this process: making mozilla more open, accessible, and easier to participate with. if you're having any trouble following this documentation, or hit a barrier you can't get around, p...
...view ping?', check the "need more information from" box, and add the reviewer's name. if they don't respond within a day or two, you can ask for help on matrix in the #introduction:mozilla.org or #developers:mozilla.org channels, or contact mike hoye directly. don't hesitate to contact your mentor as well if this isn't moving. step 4: repeat thank you! you've fixed your very first bug, and the open web is stronger for it. but don't stop now. go back to step 1, as there is plenty more to do. your mentor might suggest a new bug for you to work on, or find one that interests you. now that you've got your first bug fixed you should request level 1 access to the repository to push to the try server and get automated feedback about your changes on multiple platforms. after fixing a nontrivial n...
Frame script loading and lifetime
if the m...
...sage manager is a global frame message manager or a window message manager then: if allowdelayedload is true, the frame script will be loaded into any new frame, which has opened after the loadframescript() call. for example: var mm = window.messagemanager; mm.loadframescript("chrome://my-e10s-extension/content/frame-script.js", true); the script will be loaded into all tabs currently open in this window, and all new tabs opened afterwards. if allowdelayedload is false, the script will only be loaded into frames which are open when the call was made. if the message manager is a browser message manager, you should always pass true here. because a browser message manager only corresponds to a single browser tab, its loadframescript() function will only ever load the frame script...
Embedding Tips
() method. use the callbacks for after-the-fact cancellation. alternatively, implement a nsiuricontentlistener as described below. how do i watch/intercept a load before it happens? implement the nsiuricontentlistener interface, and register it with the appropriate web browser object via the nsiwebbrowser::parenturicontentlistener attribute. watch for changes in nsiuricontentlistener::onstarturiopen(). you can abort the uri load at this point if you don't want it to proceed. if necessary you may also implement the nsiuricontentlistener::ispreferred(), returning pr_true to ensure you are always the preferred uri handler and are called no matter what the content type. how do i copy items to the clipboard? obtain the nsiclipboardcommands interface from the appropriate web browser object via ...
...view the page with. the nsiwebbrowserprint::printpreviewnavigate() method can be used to step through the pages. when finished with preview mode, call nsiwebbrowserprint::exitprintpreview(). how do i get popup windows working? implement and register a nsiwindowcreator object with the window watcher service. the nsiwindowcreator::createchromewindow method will be called whenever gecko needs to open a new window. this method should create the new browser window in the specified style and hand back the nsiwebbrowserchrome interface to it. nscomptr<nsiwindowwatcher> wwatch(do_getservice(ns_windowwatcher_contractid)); if (wwatch) { wwatch->setwindowcreator(mywindowcreator); } i need the javascript inside the browser window to talk to my embedding client. how do i do it? at startup use the...
HTML parser threading
bjects nshtml5parser contains the code for dealing with data from document.write(). (for historical reasons, it also contains unrelated fragment parsing code that should be refactored into a separate class in due course.) nshtml5streamparser contains the code for dealing with data from the network. nshtml5parser owns nshtml5streamparser. script-created parsers (i.e. parsers created using document.open()) don't have an nshtml5streamparser instance. nshtml5parser has one tokenizer/tree builder pair for parsing data from document.write(). it also has another lazily initialized tokenizer/tree builder for speculatively scanning the tail of document.write() data when the parser blocks without parsing the document.write() data to completion. nshtml5streamparser has one tokenizer/tree builder pair for...
...eculation, an index into the nshtml5owningutf16buffer defining the exact starting point within the buffer, the line number of the tokenizer at that point and a snapshot of the tree op state. the line number and the snapshot are also added to the tree op that attempts to execute scripts (before flushing it). the tree builder snapshot contains a copy of the tree builder stack, a copy of the list of open formatting elements and copies of various fields that define the tree builder state. it contains all the information that is necessary to load back into the tree builder to restore it into a behaviorally equivalent state. the flush timer is disengaged, because it's not useful to make the tree builder flush ops into the queue of the speculation incrementally. after the speculation has been started...
How to get a stacktrace for a bug report
ically come up after firefox crashes. if you have any additional information about the crash, such as additional detail on what you were doing at the time that may have triggered the crash, please enter it into the comments box. be sure that you check the "tell mozilla about this crash" checkbox and click the restart button. the crash reporter should now submit the crash report and firefox should open again. the "details" button gives additional data about the incident, however this is not useful in a bug report. 2. tell us the id of the report you submitted. to access all of your submitted reports type "about:crashes" into the firefox address bar and press enter. firefox should open a list of ids for your submitted crash reports. copy two or thr...
... the 'pending' subdirectory for the crash are removed, and a .txt file is placed in the 'submitted' directory containing the crash id created by the reporting server. if you want breakpad to leave the .dump and .extra files on your computer so that you can examine them locally, then set the moz_crashreporter_no_delete_dump environment variable to 1. ubuntu: instructions from the ubuntu team opensuse: general instructions from opensuse fedora: capturing stack traces gentoo: debugging using gdb ...
Implementing Download Resuming
ate a channel as usual (using nsiioservice). then, you can check if it implements nsiresumablechannel. if it does not, the protocol does not support resuming. otherwise, call resumeat with the desired start position, and the previously stored entity id. (it is possible to pass an empty string as the id; however, this means that you have no assurance that the file remained unchanged) now, you can open the channel as usual (using nsichannel.asyncopen() in the common case) and write to the file in the ondataavailable notifications. you may want to use nsisimplestreamlistener to simplify this task; to get progress notifications, you can implement nsiprogresseventsink and set an interface requester as the notificationcallbacks of the channel that gives out such an event sink (this needs to be done...
... note: in versions of firefox prior to 3.0 alpha 7, nsiwebbrowserpersist cannot append to existing files (as opposed to overwriting them), and is therefore not usable for this task (see bug 129921). ...
Webapps.jsm
the webapps.jsm modules exposes the domapplicationregistry, which is responsible for managing all of the open web apps. importing components.utils.import("resource://gre/modules/webapps.jsm"); // exported symbol is domapplicationregistry method overview init: function() loadcurrentregistry: function() notifyappsregistrystart: function notifyappsregistrystart() notifyappsregistryready: function notifyappsregistryready() sanitizeredirects: function sanitizeredirects(asource) _savewidgetsfullpath: function(amanifest, adestapp) appkind: function(aapp, amanifest) updatepermissionsforapp: function(aid, aispreinstalled) updateofflinecacheforapp: function(aid) installpreinstalledapp: function installpreinstalledapp(aid) removeifhttpsduplicate: function(aid) installsystemapps: functi...
...dmanifests: function(adata) _ensuresufficientstorage: function(anewapp) _checkdownloadsize: function(afreebytes, anewapp) _getrequestchannel: function(afullpackagepath, aislocalfileinstall, aoldapp,) _senddownloadprogressevent: function(anewapp, aprogress) _getpackage: function(arequestchannel, aid, aoldapp, anewapp) _computefilehash: function(afilepath) _sendappliedevent: function(aapp) _openandreadpackage: function(azipfile, aoldapp, anewapp, aislocalfileinstall,) _openpackage: function(azipfile, aapp, aislocalfileinstall) _opensignedpackage: function(ainstallorigin, amanifesturl, azipfile, acertdb) _readpackage: function(aoldapp, anewapp, aislocalfileinstall, aisupdate,) _checksignature: function(aapp, aissigned, aislocalfileinstall) _saveetag: function(aisupdate, aoldapp, areq...
JavaScript code modules
es routines to convert between javascript date objects and iso 8601 date strings. log.jsm (formerly log4moz) provides a log4j style api for logging, log messages to various endpoints, such as the browser console or a file on disk. netutil.jsm provides helpful networking utility functions, including the ability to easily copy data from an input stream to an output stream asynchronously. openlocationlasturl.jsm provides access to the last url opened using the "open location" option in the file menu. osfile.jsm allows routines to access files. to which can be read, write, rename, create directories,etc. perfmeasurement.jsm provides access to low-level hardware and os performance measurement tools. pluralform.jsm supplies an easy way to get the correct plural forms for the curren...
...s such as, the style editor; this interface implements the editor and lets you interact with it. sqlite.jsm a promise-based api to mozistorage/sqlite. task.jsm implements a subset of task.js to make sequential, asynchronous operations simple, using the power of javascript's yield operator. timer.jsm a pure js implementation of window.settimeout. webapps.jsm provides an interface to manage open web apps. webrequest.jsm provides an api to add event listeners for the various stages of making an http request. the event listener receives detailed information about the request, and can modify or cancel the request. xpcomutils.jsm contains utilities for javascript components loaded by the js component loader. ...
Localization content best practices
leave some space in your ui to allow for this. some examples: ok in english becomes ceart ma-thà in gaelic. save document? in english becomes a bheil thu airson an sgrìobhainn a shàbhaladh in gaelic. another good example is yes/no. there are two types of languages, those that have yes/no as a single word, and those that don't and work on mirroring the verb. for example, a do you want to open the page? > yes/no dialog works in english, but in gaelic/irish/welsh and several other languages the equivalent answer is want/not want. w3c has a good guide on the length ratios a developer should be prepared for. test localizability as a developer, you should always test your patches not just for code errors, but also for localizability issues in case they involve string or ui changes. gec...
...upport, ui that breaks with long strings, etc. late-l10n: it's used by release-drivers to identify bugs, involving new strings, that will land late in the cycle, typically after soft string freeze in firefox os. alias :l10n the :l10n alias on bugzilla (community@localization.bugs) is followed by some localizers and it could be cc'd to gather opinions from the wider l10n community (no point in opening needinfo or requiring actions from this alias). there is also a dev-l10n mailing list and a l10n-community chat room on matrix; they might be a good place to ask questions. ...
SVN for Localizers
ozilla website source files from the mozilla servers and pushing your localizations right back to them. first things first, we need to give you a brief introduction to what svn is and where you can find the necessary tools to get started. if you're already familiar with this information, skip ahead to mozilla's svn repositories. brief intro to svn svn (abbreviation for subversion) is a free and open source repository tool we use to manage the localized mozilla web pages. it's a handy tool that allows us to grab, change, and store versions of source files in one location. you should know that when we say svn we are referring to either the svn server and the svn client. this may seem confusing, but don't fret because we'll make sure to differentiate between the two here: svn server: this is...
...our computer and copies into it all of the files from https://svn.mozilla.org/projects/moz...om/trunk/locales/[your locale code]. note: the directory you create will be located inside the directory that you're currently in with your console (or cygwin console). also, we use https instead of http because changes can only be pushed back to the mozilla svn repository through a secure connection. open the files you want to translate with your favorite text editor. translate the content in those files, save them and check for differences by entering this command from the command-line: svn diff this command produces output with every change made to each file. it's a bit hard to read, but you can also create a diff file (aka a diff patch) use svn diff > /path/to/output/file.diff to save the ...
Profiling with Xperf
ble stack walking: reg add "hklm\system\currentcontrolset\control\session manager\memory management" -v disablepagingexecutive -d 0x1 -t reg_dword -f symbol server setup with the latest versions of the windows performance toolkit, you can modify the symbol path directly from within the program via the trace menu. just make sure you set the symbol paths before enabling "load symbols" and before opening a summary view. you can also modify the _nt_symbol_path and _nt_symcache_path environment variables to make these changes permanent. the standard symbol path that includes both mozilla's and microsoft's symbol server configuration is as follows: _nt_symcache_path: c:\symbols _nt_symbol_path: srv*c:\symbols*http://msdl.microsoft.com/download/symbols;srv*c:\symbols*http://symbols.mozilla.org/f...
...st\bin to _nt_symbol_path. as with all windows paths, the symbol path uses semicolons (;) as separators. make sure you select the trace -> load symbols menu option in the windows performance analyzer (xperfview). there seems to be a bug in xperf and symbols; it is very sensitive to when the symbol path is edited. if you change it within the program, you'll have to close all summary tables and reopen them for it to pick up the new symbol path data. you'll have to agree to a eula for the microsoft symbols -- if you're not prompted for this, then something isn't configured right in your symbol path. (again, make sure that the directories exist; if they don't, it's a silent error.) quick start all these tools will live, by default, in c:\program files\microsoft windows performance toolkit. eit...
Reporting a Performance Problem
er.firefox.com/ click on "enable profiler menu button" the profiler toolbar button will show up in the top right of the url bar as a small stopwatch icon you can right-click on the button and remove it from the toolbar when you're done with it. using the profiler when enabled, the profiler toolbar button is not recording by default. recording can be done by clicking on the toolbar icon to open its panel. make sure to choose an appropriate setting for the recording (if you're not sure, choose firefox platform), and then choosing "start recording". the toolbar icon turns blue when it is recording. the profiler uses a fixed size buffer to store sample data. when it runs out of space in its buffer, it discards old entries so you may want to increase the buffer size if you find you are una...
... recording, reproduce the performance problem. if possible let the problem manifest itself for 5-10 seconds. press ctrl+shift+2 or click on the profiler toolbar icon in the top right and select 'capture'. try to do this within a few seconds from reproducing the performance problem as only the last few seconds are recorded. if the timeline has a large red block it's a good sign. the data will open in a new tab. wait until the "symbolicating call stacks" notification disappears before sharing the profile. there will be a button in the top right labeled 'publish' which will allow you to upload this profile and once completed will write out a link. before uploading, the publish button asks you what data you'd like to publish to our servers. note that while it's possible to strip profiles of...
Phishing: a short definition
uite trivial. one-time password algorithms a better way to use phones as second factor, are one-time password (otp) protocols, like totp and hotp. at service registration, the provider will often generate a qr code to be read by an otp app. this qr code is nothing more than a random, secret key, that is stored on the user’s phone. ...
...phone. after verifying username and password, the user is prompted to open the otp app and enter the corresponding 6-digit code, representing a hashed version of the secret key and a nonce - potentially time-based. otp is the most widely supported second factor schemes and can be used to secure your most important accounts. unfortunately, some users still feel it's too tedious unlocking a phone, opening the otp app, and manually typing a few digits each time a provider requests a new token. this can be phished by an attacker, though with totp apps the attacker has limited time to make their unauthorized login. ...
Preference reference
trols whether the application creates screenshots of visited pages which will be shown if the web page is shown in the grid of the "new tab page" (about:newtab) which offers the most often visited pages for fast navigation.browser.search.context.loadinbackgroundbrowser.search.context.loadinbackground controls whether a search from the context menu with "search <search engine> for <selected text>" opening a new tab will give focus to it and load it in the foreground or keep focus on the current tab and open it in the background.browser.urlbar.formatting.enabledthe preference browser.urlbar.formatting.enabled controls whether the domain name including the top level domain is highlighted in the address bar by coloring it black and the other parts grey.browser.urlbar.trimurlsthe preference browser...
...the emitting of the oncopy, oncut and onpaste events are controlled by this preference. ...
Patches and pushes
ethod="get" template="http://search.yahoo.com/search"> <param name="p" value="{searchterms}"/> <param name="ei" value="utf-8"/> <mozparam name="fr" condition="pref" pref="yahoo-fr" /> </url> <searchform>http://search.yahoo.com/</searchform> </searchplugin> create xml files for each search plugin preference following the above example. for references on how each tag functions, visit the opensearch wiki page and the mozsearch wiki page. the pages are old (i mean, firefox 2???), but still accurate. each plugin has an icon image which is linked within the xml file as an uri id. upload your plugins icon image to data kitchen to obtain its uri id and add to the xml file within the image tag. in list.txt, add the search plugin's xml filename (without extensions) on a new line and save. n...
...(e.g., wikipedia-es). create a patch of the searchplugins directory by entering the following command in your command-line tool, where mypatch.diff is where you give your patch a name: $ hg add mozilla/browser/searchplugins/ $ hg diff mozilla/browser/searchplugins/ > mypatch.diff attach your patch file to the bug by clicking the "add an attachment" link. once attached and labeled as a patch, open the attachment details. in the attachment details, select the ? from the dropdown menu next to the review flag. this will display a text box to assign the review to someone. enter :flod as the requestee. review, commit, & land address any review comments made by the reviewers and update the patch until it receives an r+ rating. if the r+ is "with nits" (i.e., that's short for nit-picky requ...
Creating a Cookie Log
creating a cookie log is often necessary to troubleshoot problems with firefox's cookie handling. if you are reading this, you have probably been directed here from a bug report. please follow the instructions below to run firefox with cookie logging enabled. enabling cookie logging windows open a command prompt (this is under programs or programs/accessories in normal installations of windows). change to your firefox directory (usually c:\program files\mozilla firefox) type "set nspr_log_file=c:\temp\cookie-log.txt", enter type "set nspr_log_modules=cookie:4" and press enter run firefox by typing "firefox.exe" and pressing enter. linux start a command shell (these instructions are for bash, if you use something else, you probably know how to modify these instructions alrea...
...enter. linux start a command shell (these instructions are for bash, if you use something else, you probably know how to modify these instructions already). change to the installation directory for firefox. type "export nspr_log_file=~/cookie-log.txt" and press enter. type "export nspr_log_modules=cookie:4" and press enter. run firefox by typing "./firefox" and pressing enter mac os x open terminal.app, which is located in the /applications/utilities folder (these instructions are for bash, the default shell in mac os x 10.3 and higher; if you use something else, you probably know how to modify these instructions already). change to the installation directory for firefox, e.g. type "cd /applications/firefox.app/contents/macos" and press return. type "export nspr_log_file=~/desk...
NSPR Error Handling
the preceding function has not been implemented. pr_io_error the preceding i/o function encountered some sort of an error, perhaps an invalid device. pr_io_timeout_error the i/o operation has not completed in the time specified for the preceding function. pr_io_pending_error an i/o operation has been attempted on a file descriptor that is currently busy with another operation. pr_directory_open_error the directory could not be opened. pr_invalid_argument_error one or more of the arguments to the function is invalid. pr_address_not_available_error the network address (prnetaddr) is not available (probably in use). pr_address_not_supported_error the type of network address specified is not supported. pr_is_connected_error an attempt to connect on an already connected network file...
...pecified library. pr_insufficient_resources_error there are insufficient system resources to process the request. pr_directory_lookup_error a directory lookup on a network address has failed. pr_tpd_range_error attempt to access a thread-private data index that is out of range of any index that has been allocated to the process. pr_proc_desc_table_full_error the process' table for holding open file descriptors is full. pr_sys_desc_table_full_error the system's table for holding open file descriptors has been exceeded. pr_not_socket_error an attempt to use a non-network file descriptor on a network-only operation. pr_not_tcp_socket_error attempt to perform a tcp specific function on a non-tcp file descriptor. pr_socket_address_is_bound_erro attempt to bind an address to a tcp fi...
PRFileDesc
syntax #include <prio.h> struct prfiledesc { priomethods *methods; prfileprivate *secret; prfiledesc *lower, *higher; void (*dtor)(prfiledesc *fd); prdescidentity identity; }; typedef struct prfiledesc prfiledesc; parameters methods the i/o methods table. see priomethods. secret layer-dependent implementation data. see prfileprivate. lower pointer to lower layer. higher pointer to higher layer. dtor a destructor function for the layer. identity identity of this particular layer. see prdescidentity. ...
... layer-dependent implementation data. see prfileprivate. lower pointer to lower layer. higher pointer to higher layer. dtor a destructor function for the layer. identity identity of this particular layer. see prdescidentity. description the fields of this structure are significant only if you are implementing a layer on top of nspr, such as ssl. otherwise, you use functions such as pr_open and pr_newtcpsocket to obtain a file descriptor, which you should treat as an opaque structure. for more details about the use of prfiledesc and related structures, see file descriptor types. ...
PR_AttachSharedMemory
flags options for mapping the shared memory. pr_shm_readonly causes the memory to be attached read-only. returns address where shared memory is mapped, or null if an error occurs. ...
... flags options for mapping the shared memory. pr_shm_readonly causes the memory to be attached read-only. returns address where shared memory is mapped, or null if an error occurs. ...
PR_NewTCPSocket
if the creation of a new tcp socket failed, null. description tcp (transmission control protocol) is a connection-oriented, reliable byte-stream protocol of the tcp/ip protocol suite. pr_newtcpsocket creates a new ipv4 tcp socket. ...
...ite, pr_writev, pr_send, or pr_transmitfile. pr_acceptread is suitable for use by the server to accept a new client connection and read the client's first request in one function call. a tcp connection can be shut down by pr_shutdown, and the sockets should be closed by pr_close. see also pr_newtcpsocket is deprecated because it is hardcoded to create an ipv4 tcp socket. new code should use pr_opentcpsocket instead, which allows the address family (ipv4 or ipv6) of the new tcp socket to be specified. ...
PR_NewUDPSocket
if the creation of a new udp socket failed, null. description udp (user datagram protocol) is a connectionless, unreliable datagram protocol of the tcp/ip protocol suite. udp datagrams may be lost or delivered in duplicates or out of sequence. pr_newudpsocket creates a new udp socket. ...
...es or out of sequence. pr_newudpsocket creates a new udp socket. the socket may be bound to a well-known port number with pr_bind. datagrams can be sent with pr_sendto and received with pr_recvfrom. when the socket is no longer needed, it should be closed with a call to pr_close. see also pr_newudpsocket is deprecated because it is hardcoded to create an ipv4 udp socket. new code should use pr_openudpsocket instead, which allows the address family (ipv4 or ipv6) of the new udp socket to be specified. ...
PR_ReadDir
flags specifies which directory entries, if any, to skip. values can include the following: pr_skip_none. do not skip any files. pr_skip_dot. skip the directory entry "." representing the current directory. pr_skip_dot_dot. ...
...ociated with the returned prdirentry structure is managed by nspr. the caller must not free the prdirentry structure. moreover, the prdirentry structure returned by each pr_readdir call is valid only until the next pr_readdir or pr_closedir call on the same prdir object. if the end of the directory is reached, pr_readdir returns null, and pr_geterror returns pr_no_more_files_error. see also pr_opendir ...
PR_TransmitFile
the following parameters: networksocket a pointer to a prfiledesc object representing the connected socket to send data over. sourcefile a pointer to a prfiledesc object representing the file to send. headers a pointer to the buffer holding the headers to be sent before sending data. hlen length of the headers buffer in bytes. flags one of the following flags: pr_transmitfile_keep_open indicates that the socket will be kept open after the data is sent. pr_transmitfile_close_socket indicates that the connection should be closed immediately after successful transfer of the file. timeout time limit for completion of the transmit operation. returns a positive number indicates the number of bytes successfully written, including both the headers and the file. the value -1...
...ned by calling pr_geterror. ...
JSS 4.4.0 Release Notes
jss 4.4.0 requires nss 3.12.5 or higher though nss 3.28.3 is recommended. jss 4.3.1 requires nspr 4.7.1 or higher though nspr 3.13 is recommended. jss only supports the native threading model (no green threads). compatibility jss 3.30 shared libraries are not backward compatible with all older jss 4.3.2 shared libraries. a progr...
...ss&target_milestone=4.4&target_milestone=4.4&bug_status=resolved&resolution=fixed documentation build instructions for jss at https://hg.mozilla.org/projects/jss/file/tip/readme platform information you can check out the source from mercurial via hg clone -r 055aa3ce8a61 https://hg.mozilla.org/projects/jss jss 4.4.0 works with openjdk versions 1.7 or higher we suggest the latest - openjdk 1.8. jss 4.4.0 requires nss 3.12.5 or higher though nss 3.28.3 is recommended. jss 4.3.1 requires nspr 4.7.1 or higher though nspr 3.13 is recommended. jss only supports the native threading model (no green threads). compatibility jss 3.30 shared libraries are not backward compatible with all older jss 4.3.2 shared libraries. a program linked with older jss 4.3.2 shared libraries will no...
NSS 3.41 release notes
removed: cn = ac raíz certicámara s.a. ...
...69e343085c cn = certplus root ca g1 sha-256 fingerprint: 152a402bfcdf2cd548054d2275b39c7fca3ec0978078b0f0ea76e561a6c7433e cn = certplus root ca g2 sha-256 fingerprint: 6cc05041e6445e74696c4cfbc9f80f543b7eabbb44b4ce6f787c6a9971c42f17 cn = opentrust root ca g1 sha-256 fingerprint: 56c77128d98c18d91b4cfdffbc25ee9103d4758ea2abad826a90f3457d460eb4 cn = opentrust root ca g2 sha-256 fingerprint: 27995829fe6a7515c1bfe848f9c4761db16c225929257bf40d0894f29ea8baf2 cn = opentrust root ca g3 sha-256 fingerprint: b7c36231706e81078c367cb896198f1e3208dd926949dd8f5709a410f75b6292 bugs fixed in nss 3.41 bug 1412829, reject empty supported_signature_algorithms in certificate request in tls 1.2 bug 1485864 - cache side-chan...
NSS API Guidelines
.h nss____.h friend (only if required) nss____tf.h nss____f.h nss-private ____t.h ____.h module-private ____tm.h ____m.h the files on the right include the files to their left; the files in a row include the files directly above them. header files always include what they need; the files are protected against double inclusion (and even double opening by the compiler). note: it's not necessary all eight files exist. further, this is a simple ideal, and often reality is more complex. we would like to keep names to 8.3, even if we no longer support win16. this usually gives us four characters to identify a module of nss. in short: header files for consumption outside nss start with "nss." header files with types have a trailing "t", ...
...e completed before the layer can be used, that layer should supply an initialization function of the form layer_init(). if an initialization function is supplied, a corresponding layer_shutdown() function should also be supplied. layer_init() should increment a count of the number of times it is called, and layer_shutdown() should decrement that count, and shutdown when the count reaches '0'. open, close functions open functions should have a corresponding close function. open and close function are not reference counted, like init and shutdown functions. creation functions in general, data objects should all have functions which create them. these functions should have the form layer_createdatatype[fromdatatype](). for instance generating a new key would change from pk11_keygen() to...
NSS Sample Code Sample_2_Initialization of NSS
info *slot, prbool retry, void *arg) { file *input; file *output; char *p0 = null; char *p1 = null; secupwdata *pwdata = (secupwdata *) arg; if (pwdata->source == pw_fromfile) { return filepasswd(slot, retry, pwdata->data); } if (pwdata->source == pw_plaintext) { return pl_strdup(pwdata->data); } /* open terminal */ input = fopen("/dev/tty", "r"); if (input == null) { pr_fprintf(pr_stderr, "error opening input terminal for read\n"); return null; } /* we have no password, so initialize database with one */ pr_fprintf(pr_stderr, "enter a password which will be used to encrypt your keys.\n" "the password should be at least 8 characters long,\n" "and...
... pr_fprintf(pr_stderr, "error opening input terminal for read\n"); return null; } /* we have no password, so initialize database with one */ pr_fprintf(pr_stderr, "enter a password which will be used to encrypt your keys.\n" "the password should be at least 8 characters long,\n" "and should contain at least one non-alphabetic character.\n\n"); output = fopen("/dev/tty", "w"); if (output == null) { pr_fprintf(pr_stderr, "error opening output terminal for write\n"); return null; } for (;;) { if (p0) port_free(p0); p0 = getpassword(input, output, "enter new password: ", checkpassword); if (p1) port_free(p1); p1 = getpassword(input, o...
Initialize NSS database - sample 2
info *slot, prbool retry, void *arg) { file *input; file *output; char *p0 = null; char *p1 = null; secupwdata *pwdata = (secupwdata *) arg; if (pwdata->source == pw_fromfile) { return filepasswd(slot, retry, pwdata->data); } if (pwdata->source == pw_plaintext) { return pl_strdup(pwdata->data); } /* open terminal */ input = fopen("/dev/tty", "r"); if (input == null) { pr_fprintf(pr_stderr, "error opening input terminal for read\n"); return null; } /* we have no password, so initialize database with one */ pr_fprintf(pr_stderr, "enter a password which will be used to encrypt your keys.\n" "the password should be at least 8 characters long,\n" "and...
... pr_fprintf(pr_stderr, "error opening input terminal for read\n"); return null; } /* we have no password, so initialize database with one */ pr_fprintf(pr_stderr, "enter a password which will be used to encrypt your keys.\n" "the password should be at least 8 characters long,\n" "and should contain at least one non-alphabetic character.\n\n"); output = fopen("/dev/tty", "w"); if (output == null) { pr_fprintf(pr_stderr, "error opening output terminal for write\n"); return null; } for (;;) { if (p0) port_free(p0); p0 = getpassword(input, output, "enter new password: ", checkpassword); if (p1) port_free(p1); p1 = getpassword(input, o...
FC_CloseSession
name fc_closesession - close a session opened between an application and a token. syntax ck_rv fc_closesession( ck_session_handle hsession ); parameters hsession [in] the session handle to be closed. description fc_closesession closes a session between an application and a token. a user may call fc_closesession without logging into the token (to assume the nss user role). ...
... a session opened between an application and a token. syntax ck_rv fc_closesession( ck_session_handle hsession ); parameters hsession [in] the session handle to be closed. description fc_closesession closes a session between an application and a token. a user may call fc_closesession without logging into the token (to assume the nss user role). ...
FC_GetSessionInfo
pinfo [out] pointer to the ck_session_info structure to be returned. description fc_getsessioninfo obtains information about a session. a user may call fc_getsessioninfo without logging into the token (to assume the nss user role). if the nss cryptographic module is in the error state, fc_getsessioninfo returns ckr_device_error. ...
...le is assumed, the user role is assumed, or the crypto officer role is assumed flags: bit flags that define the type of session ckf_rw_session (0x00000002): true if the session is read/write; false if the session is read-only. ckf_serial_session (0x00000004): this flag is provided for backward compatibility and is always set to true. return value examples see also fc_closesession, nsc_opensession ...
NSS tools : pk12util
cii format, which displays the information about the certificates and public keys in the p12 file. -v enable debug logging when importing. -w p12filepasswordfile specify the text file containing the pkcs #12 file password. -w p12filepassword specify the pkcs #12 file password. ...
...s the information about the certificates and public keys in the p12 file. -v enable debug logging when importing. -w p12filepasswordfile specify the text file containing the pkcs #12 file password. -w p12filepassword specify the pkcs #12 file password. ...
NSS Tools pk12util
not support the requested algorithm and a best fit will be selected, likely to be the default. if no suitable replacement for the desired algorithm can be found a "no security module can perform the requested operation" will appear on the error message. ...
...ted algorithm and a best fit will be selected, likely to be the default. if no suitable replacement for the desired algorithm can be found a "no security module can perform the requested operation" will appear on the error message. ...
NSS tools : pk12util
ll of the data in raw (binary) form. this must be saved as a der file. the default is to return information in a pretty-print ascii format, which displays the information about the certificates and public keys in the p12 file. ...
... form. this must be saved as a der file. the default is to return information in a pretty-print ascii format, which displays the information about the certificates and public keys in the p12 file. ...
Rhino and BSF
see xalan-java extensions for more information on adding javascript to xsl and the description of the optional script task in the apache ant manual for using scripting in ant build files. ...
...see xalan-java extensions for more information on adding javascript to xsl and the description of the optional script task in the apache ant manual for using scripting in ant build files. ...
Rhino history
o it needed an implementation of javascript written in java. when netscape stopped work on "javagator," as it was called, somehow rhino escaped the axe (rumor had it that the executives "forgot" it existed). for a time, a couple of major companies (including sun) licensed rhino for use in their products and paid netscape to do so, allowing work on rhino to continue. now rhino is part of mozilla's open-source repository. originally, rhino compiled all javascript code to java bytecodes in generated classfiles. this produced the best performance (often beating the c implementation of javascript when run on a jit), but suffered from two faults. first, compilation time was long since generating java bytecodes and loading the generated classes was a heavyweight process. also, the implementation eff...
...tive mode. the classfile generation code was moved to an optional, dynamically-loaded package. compilation is faster and when scripts are no longer in use they can be collected like any other java object. rhino was released to mozilla.org in april 1998. originally rhino classfile generation had been held back from release. however the licensees of rhino have now agreed to release all of rhino to open source, including class file generation. since its release to open source, rhino has found a variety of uses and an increasing number of people have contributed to the code. ...
Shumway
the project is not exactly a developer tool but it is something that content creators should test against (and report bugs or performance issues to). for even more information, please refer to the external links. the whats and whys of shumway shumway is a renderer for adobe flash built entirely in web standards (javascript, webgl, and others). ...
...github. several methods exist to allow inspector access to your swf file. once your flash content is loaded, you can see how shumway manages it in detail. several buttons are available at the bottom of the screen to enable or disable various shumway options. note: if your applet runs at an abnormal speed, try toggling "turbo" at the bottom of the inspector window. you may wish to do this before opening your swf file. limitations of shumway might be encountered through testing. there are two places where shumway bugs are tracked: github (via issues and pull requests) manages problems relating to shumway, itself. bugzilla is intended for problems with integrating shumway into firefox. end-users and less involved developers may report issues by hovering over "shumway" within flash conte...
SpiderMonkey Build Documentation
r: true this is because, starting from mohave, headers are no longer installed in /usr/include. refer the release notes under command line tools -> new features the release notes also states that this compatibility package will no longer be provided in the near future, so the build system on macos will have to be adapted to look for headers in the sdk until then, the following should help, open /library/developer/commandlinetools/packages/macos_sdk_headers_for_macos_10.14.pk this builds an executable named js in the directory build-release/dist/bin. you can test it with dist/bin/js --help, which displays a help page. at this point, you're ready to run and try out the shell. on mac, linux, or unix, you can install spidermonkey on your system with the additional command make install. ...
...ackends=compiledb,recursivemake (recursivemake is there as you'd likely also want to be able to build!) windows builds since version 28, threadsafe builds are the default, and should work out of the box on all posix platforms. hence, the following instructions should only be relevant if you're on windows or compiling an older version of spidermonkey. the mozillabuild batch file you used to open your shell (e.g. start-shell-msvc2013.bat or start-shell-msvc2013-x64.bat) determines whether the compiler toolchain will target 32-bit or 64-bit builds. to create a 64-bit build, note that you must configure with --target=x86_64-pc-mingw32 --host=x86_64-pc-mingw32. since the posix nspr emulation is not available for windows, a working version of nspr must be available to your build. the easiest...
Index
javascript tests automated testing, build documentation, guide, qa, spidermonkey in which test suite does your new test belong? 3 creating javascript jstest reftests ecmascript, guide, javascript, test in the js/src/tests directory, there are a few important subdirectories. 4 foss guide, spidermonkey feel free to add your own spidermonkey-based open source projects (and if necessary add categories)! 5 future directions guide, mozilla, spidermonkey this article documents future directions in functionality, design, and coding practices for spidermonkey. it can be read as something like an "ideal future state" for the engine. that means the code as it is today won't match this document, and that's ok. whenever practical, ne...
...ive code stored in the fragment. 538 spidermonkey compartments guide, needscontent, needsexample, spidermonkey no summary! 539 spidermonkey releases spidermonkey the easiest way to fetch the version corresponding to the current firefox release is to visit the treeherder page for the release repository and click on the first sm(pkg) link you see. that will open a small window in the bottom left with a line like "artifact uploaded: mozjs-57.0.1.tar.bz2". 540 spidermonkey 1.8 spidermonkey spidermonkey 1.8 has one known significant regression from 1.7. 541 spidermonkey 1.8.5 spidermonkey spidermonkey 1.8.5 is supported on all the platforms where firefox 4 runs. 542 spidermonkey 1.8.7 spidermonkey ...
JSAPI User Guide
idermonkey and jsapi. what spidermonkey does the javascript engine compiles and executes scripts containing javascript statements and functions. the engine handles memory allocation for the objects needed to execute scripts, and it cleans up—garbage collects—objects it no longer needs. the word javascript may bring to mind features such as event handlers (like onclick), dom objects, window.open, and xmlhttprequest. but in mozilla, all of these features are actually provided by other components, not the spidermonkey engine itself. spidermonkey provides a few core javascript data types—numbers, strings, arrays, objects, and so on—and a few methods, such as array.push. it also makes it easy for each application to expose some of its own objects and functions to javascript code. browser...
...ons, convert javascript data from one type to another, create objects, and so on. almost all jsapi functions require a jscontext * as the first argument, just like most <stdio.h> functions require a file *. global objects. lastly, the global object contains all the classes, functions, and variables that are available for javascript code to use. whenever javascript code does something like window.open("http://www.mozilla.org/"), it is accessing a global property, in this case window. jsapi applications have full control over what global properties scripts can see. the application starts out by creating an object and populating it with the standard javascript classes, like array and object. then it adds whatever custom classes, functions, and variables (like window) the application wants to pro...
Signing Mozilla apps for Mac OS X
ebugging for test and debug purposes, the easiest way to get a signing certificate is to use apple's keychain feature to create one. there are good instructions available under "to use the certificate assistant to create a self-signed signing identity". for release creating a developer id requires a paid apple developer account. once you have that you can do the following to create your id: open the developer certificate utility. click "certificates" from the left hand menu. click "create a certificate" at the top right corner select the "developer id" radio button and uncheck the "developer id installer certificate" box. click "create" and follow the instructions in the wizard. it will guide you through creating a private key, certificate signing request, and importing your new deve...
...ignated requirement' adds additional requirements for verifying the signature and application metadata. at a minimum you'll need to provide: identifier: this must be the same as the value of the cfbundleidentifier specified in your application's info.plist file. leaf[subject.ou]: this needs to be the subject ou of your developer id. you can find it by running this command in the terminal: openssl x509 -text -noout -inform der -in devloperid_application.cer | grep subject putting it all together, you'll wind up using a command similar to the one below to sign your app. you'll of course need to change the signing id, keychain, bundle path, and requirements. codesign -s mac-testing -fv \ --keychain /users/user/library/keychains/mykeychain.keychain \ --resource-rules .
XML Extras
ew xmlhttprequest() xmlhttprequest.send("some string") ok ok starting with milestone 0.9.7 (actually nightly 2001-11-28). with older builds, passing strings to send() works only in chrome, see post.html sample. the "workaround" is to use domparser object's parsefromstring() method to create a document from string, and pass the temporary document into send(). xmlhttprequest.open("ahost") ok file:// documents can access http:// documents but you need to enable universalbrowserread privilege in your scripts - see the javascript security: signed scripts document for more details. normally your files should reside on a webserver so this shouldn't pose a problem (there you do not need that line either). additionally, "foo.com:80" and "foo.com:313" are considered differe...
...cess http:// documents but you need to enable universalbrowserread privilege in your scripts - see the javascript security: signed scripts document for more details. normally your files should reside on a webserver so this shouldn't pose a problem (there you do not need that line either). additionally, "foo.com:80" and "foo.com:313" are considered different hosts for security purposes. you cannot open a connection to a different host. domparser creation not available new domparser() xmlserializer creation not available new xmlserializer() minimal documentation for the components listed above can be found using mozilla documentation generated by doxygen. file new bugs for additional documentation contributions, either specifically aimed at javascript develop...
An Overview of XPCOM
discuss the above items in detail in the coming chapters, but for now, it can be useful to think of xpcom as a platform for component development, in which features such as those listed above are provided. gecko although it is in some ways structurally similar to microsoft com, xpcom is designed to be used principally at the application level. the most important use of xpcom is within gecko, an open source, standards compliant, embeddable web browser and toolkit for creating web browsers and other applications. xpcom is the means of accessing gecko library functionality and embedding or extending gecko. this book focuses on the latter - extending gecko - but the fundamental ideas in the book will be important to developers embedding gecko as well. gecko is used in many internet application...
...ted returned when an unexpected error occurs. ns_error_out_of_memory returned when a memory allocation fails. ns_error_factory_not_registered returned when a requested class is not registered. « previousnext » copyright (c) 2003 by doug turner and ian oeschger. this material may be distributed only subject to the terms and conditions set forth in the open publication license, v1.02 or later. distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder. ...
Building the WebLock UI
"dialog.input"); // weblock is global and declared above weblock.addsite(tf.value); } this javascript function can be called directly from the xul widget, where the input string is retrieved as the value property of the textbox element. you also need to create the function that displays the weblock window itself when the user clicks the weblock icon in the statusbar. that function uses the opendialog method from the window object and takes the url to the xul file in which the dialog is defined: function loadweblock() { window.opendialog("chrome://weblock/weblock.xul"); } xul the entire user interface of the mozilla browser and all of the applications that go with it, including the mail client, the irc client, and others, have been defined in an xml language called xul. elements in...
...and the user interface described in this chapter. note, however, that currently weblock probably does not install cleanly in mozilla firefox due to firefox's newness compared to this book (which was originally written in 2003). « previousnext » copyright (c) 2003 by doug turner and ian oeschger. this material may be distributed only subject to the terms and conditions set forth in the open publication license, v1.02 or later. distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder. ...
Component Internals
re not frozen and are only meant to be used by the gecko internals and not by clients. xpcom provides many data structures from linked lists to avl trees. it's tempting to reuse nsvoidarray or another publicly available class instead of writing your own linked list, but this may prove to be a fatal mistake. the class can change at any time and give you unexpected behavior. xpcom makes for a very open environment. at runtime you can acquire any service or component by merely knowing a cid or contract id along with an iid. at last count there were over 1300 interfaces defined in xpidl. of those 1300 interfaces, less than 100 were frozen, which means that a developer is likely to stumble upon useful interfaces that aren't frozen. unless an interface is explicitly marked "frozen" in the idl comme...
... xpcom library, which allows the component to avoid linking directly with the xpcom library. you shouldn't have to link to the xpcom library to create a xpcom component - in fact, if your component has to, then something is wrong. « previousnext » copyright (c) 2003 by doug turner and ian oeschger. this material may be distributed only subject to the terms and conditions set forth in the open publication license, v1.02 or later. distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder. ...
Preface
ny experience with this technology, much of it can be applied to xpcom. however, this book does not assume any prior knowledge of com - all of the basic com ideas will be introduced. this book provides a tutorial about building an xpcom component that controls browsing behavior. although, xpcom can be used in many environments which are unrelated to web browsing, xpcom's main client is gecko, an open source, standards compliant, embeddable web browser, where it's easiest and most practical to illustrate xpcom's functionality. a full description of the component in this tutorial can be found in the what we'll be working on section of the tutorial. despite what old documentation says, xpcom should not be used to make npapi plugins scriptable. starting with gecko 1.7.5 (firefox 1.0) a special ...
...se sections. acknowledgements thanks to peter lubczynski, john gaunt, ellen evans, and alec flett for technical reviews. a special thanks goes to darin fisher for his very acute observations, close reading, and attention to detail. next » copyright (c) 2003 by doug turner and ian oeschger. this material may be distributed only subject to the terms and conditions set forth in the open publication license, v1.02 or later. distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder. ...
Development
source the latest source code is available on the mozilla trunk, in the extensions/java/xpcom directory. ...
... source the latest source code is available on the mozilla trunk, in the extensions/java/xpcom directory. ...
mozIStorageError
s page. constants constant value description error 1 general sql error, or missing database ioerr 10 a disk i/o error occurred. corrupt 11 the database on disk is malformed. full 13 an insertion failed because the database is full. cantopen 14 unable to open the database file. empty 16 the database is empty. schema 17 the database schema changed. toobig 18 a string or blob exceeds the size limit. constraint 19 aborted due to a constraint violation. internal 2 an internal logic error ...
... mismatch 20 a data type mismatch occurred. misuse 21 library used incorrectly. nolfs 22 attempted to use os features not supported on the host system. auth 23 authorization denied. format 24 auxiliary database format error. notadb 26 the opened file is not a database. perm 3 access permission denied. abort 4 a callback routine requested an abort. busy 5 the database file is locked. locked 6 a table in the database is locked. nomem 7 a memory allocation failed. readonly 8 ...
nsIAppStartup
obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) creates the initial state of the application by launching tasks specfied by "general.startup.*" prefs. note: size_to_content may be used for width or height. boolean createstartupstate( in long awindowwidth, in long awindowheight ); parameters awindowwidth the width to make the initial window(s) opened. awindowheight the height to make the initial window(s) opened. return value true if a window was opened. destroyhiddenwindow() destroys the hidden window. this will have no effect if the hidden window has not yet been created. void destroyhiddenwindow(); parameters none. doprofilestartup() obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) ...
...e application is shutdown, and it is constructed from the constants defined above. restartinsafemode() restart the application in safe mode. void quit( in pruint32 aquitmode ); parameters aquitmode this parameter modifies how the app is shutdown. run() runs an application event loop: normally the main event pump which defines the lifetime of the application. if there are no windows open and no outstanding calls to enterlastwindowclosingsurvivalarea() this method will exit immediately. void run(); parameters none. return value returns ns_success_restart_app code. this return code indicates that the application should be restarted because quit was called with the erestart flag. see also nsicmdlineservice nsiappstartup_mozilla_2_0 ...
nsIApplicationCache
netwerk/base/public/nsiapplicationcache.idlscriptable this interface represents an application cache, which stores resources for offline use. 1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) each application cache has a unique client id for use with nsicacheservice.opensession() method, to access the cache's entries. each entry in the cache can be marked with a set of types, specified in the constants section. all application caches with the same group id belong to a cache group. each group has one "active" cache that will service future loads. inactive caches are removed from the cache when no longer referenced. method overview void activate(); void addnamespaces(in nsi...
...nitashandle(in acstring groupid, in acstring clientid); void markentry(in acstring key, in unsigned long typebits); void unmarkentry(in acstring key, in unsigned long typebits); attributes attribute type description active boolean true if the cache is the active cache for this group, otherwise false. read only. clientid acstring the client id for this application cache. clients can open a session with nsicacheservice.createsession() using this client id and a storage policy of store_offline to access this cache. read only. groupid acstring the group id for this cache group. this is the uri of the cache manifest file. read only. usage unsigned long the disk usage of the application cache, in bytes. read only. constants constant value description item_manifest 1 this i...
nsICachingChannel
ached data can be found. this is valid for as long as a reference to the cache token is held. this may return an error if cacheasfile is false. read only. cacheforofflineuse boolean specifies whether or not the data should be placed in the offline cache, in addition to normal memory/disk caching. this may fail if the offline cache is not present. the value of this attribute should be set before opening the channel. cachekey nsisupports uniquely identifies the data in the cache for this channel. holding a reference to this key does not prevent the cached data from being removed. a cache key retrieved from a particular instance of nsicachingchannel could be set on another instance of nsicachingchannel provided the underlying implementations are compatible and provided the new channel insta...
... 30 this load flag inhibits fetching from the net if the data in the cache has been evicted. an error of ns_error_document_not_cached will be sent to the listener's onstoprequest in this case. this flag is set automatically when the application is offline. load_only_if_modified 1 << 31 this load flag controls what happens when a document would be loaded from the cache to satisfy a call to asyncopen. if this attribute is set to true, then the document will not be loaded from the cache. a stream listener can check isfromcache() to determine if the asyncopen will actually result in data being streamed. if this flag has been set, and the request can be satisfied via the cache, then the ondataavailable events will be skipped. the listener will only see onstartrequest followed by onstoprequest. ...
nsICryptoHash
e the hash. exceptions thrown ns_error_not_available indicates that the requested amount of data to be calculated into the hash is not available. ns_error_not_initialized indicates that init() or initwithstring() has not been called. example computing the hash of a file you can easily compute the hash of a file using nsicryptohash. you will need to create an instance of nsicryptohash, open an input stream from a file, and then update the hash with the file. the following example shows how to compute the sha256 hash of a file: // hardcoded here for convenience var path = "c:\\windows\\notepad.exe"; var f = components.classes["@mozilla.org/file/local;1"] .createinstance(components.interfaces.nsilocalfile); f.initwithpath(path); var istream = components.classes["@mo...
...sh of a file: // hardcoded here for convenience var path = "c:\\windows\\notepad.exe"; var f = components.classes["@mozilla.org/file/local;1"] .createinstance(components.interfaces.nsilocalfile); f.initwithpath(path); var istream = components.classes["@mozilla.org/network/file-input-stream;1"] .createinstance(components.interfaces.nsifileinputstream); // open for reading istream.init(f, 0x01, 0444, 0); var ch = components.classes["@mozilla.org/security/hash;1"] .createinstance(components.interfaces.nsicryptohash); // we want to use the sha256 algorithm ch.init(ch.sha256); // this tells updatefromstream to read the entire file const pr_uint32_max = 0xffffffff; ch.updatefromstream(istream, pr_uint32_max); // pass false here to get bin...
nsIDialogCreator
embedding/base/nsidialogcreator.idlscriptable please add a summary to this article. ...
... inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void opendialog(in unsigned long atype, in acstring aname, in acstring afeatures, in nsidialogparamblock aarguments, [optional] in nsidomelement aframeelement); constants constant value description unknown_dialog 0 generic_dialog 1 select_dialog 2 methods opendialog() void opendialog( in unsigned long atype, in acstring aname, in acstring afeatures, in nsidialogparamblock aarguments, in nsidomelement aframeelement optional ); parameters atype aname afeatures aarguments aframeelement optional ...
nsINavHistoryResultViewObserver
.idlscriptable this interface is used by clients of the history results to define domain-specific handling of specific nsitreeview methods that the history result doesn't implement. ...
... return true if the drop is permitted or false if it isn't. ondrop() called when the user drops something onto the view being observed. void ondrop( in long row, in long orientation ); parameters row the row at which the drop occurred. orientation drop_before, drop_on, or drop_after, indicating whether the drop destination is before, on, or after the target row. ontoggleopenstate() called when an item is opened or closed. void ontoggleopenstate( in long index ); parameters index the item being toggled. oncycleheader() called when a header is clicked. void oncycleheader( in nsitreecolumn column ); parameters column the column whose header was clicked. oncyclecell() called when a cell in a non-selectable cycling column (such as unread or...
nsIPluginHost
ative code only!instantiatefullpageplugin void instantiatefullpageplugin( in string amimetype, in nsiuri auri, in nsiplugininstanceowner aowner, out nsistreamlistener astreamlistener ); parameters amimetype auri aowner astreamlistener native code only!instantiatepluginforchannel instantiate an embedded plugin for an existing channel. the caller is responsible for opening the channel. it may or may not be already opened when this function is called. nsistreamlistener instantiatepluginforchannel( in nsichannel achannel, in nsiplugininstanceowner aowner ); parameters achannel aowner return value native code only!ispluginenabledforextension void ispluginenabledforextension( in string aextension, in constcharstarref amimetype ); paramet...
...ters ainstance native code only!useragent void useragent( in nativechar resultingagentstring ); parameters examples list all plug-ins and associated mime types and get handler info this example here logs to browser console all the installed plug-ins and the associated mime types. then using nsihandlerservice it gets the handler info. a handler is, default application that should open or deal with this file. let pluginhost = cc["@mozilla.org/plugin/host;1"].getservice(ci.nsipluginhost); let handlerservice = cc['@mozilla.org/uriloader/handler-service;1'].getservice(ci.nsihandlerservice); let mimeservice = cc['@mozilla.org/mime;1'].getservice(ci.nsimimeservice); let plugintags = pluginhost.getplugintags(); for (let i = 0; i < plugintags.length; ++i) { let plugintag = plug...
Component; nsIPrefBranch
ing a previously locked preference allows the preference service to once again return the user set value of the preference. note: this method can be called on either a default or user branch but, in effect, always operates on the default branch. void unlockpref( in string aprefname ); parameters aprefname the preference to be unlocked. remarks registering as a preference observer can open an object to potential cyclical references which will cause memory leaks. these cycles generally occur because an object both registers itself as an observer (causing the branch to hold a reference to the observer) and holds a reference to the branch object for the purpose of getting/setting preference values. there are 3 approaches which have been implemented in an attempt to avoid these situati...
...umer may hold a weak reference to it instead of a strong one. the nsprefbranch object listens for xpcom-shutdown and frees all of the objects currently in its observer list. this ensures that long lived objects (services for example) will be freed correctly. the observer can request to be held as a weak reference when it is registered. this insures that shorter lived objects (say one tied to an open window) will not fall into the cyclical reference trap. the list of registered observers may be changed during the dispatch of nspref:changed notification. however, the observers are not guaranteed to be notified in any particular order, so you can't be sure whether the added/removed observer will be called during the notification when it is added/removed. it is possible to change preferences...
nsIPrefBranch2
nstance on which you called addobserver() method in order to remove aobserver; otherwise, the observer will not be removed. void removeobserver( in string adomain, in nsiobserver aobserver ); parameters adomain the preference which is being observed for changes. aobserver an observer previously registered with addobserver. remarks registering as a preference observer can open an object to potential cyclical references which will cause memory leaks. these cycles generally occur because an object both registers itself as an observer (causing the branch to hold a reference to the observer) and holds a reference to the branch object for the purpose of getting/setting preference values. there are 3 approaches which have been implemented in an attempt to avoid these situati...
...umer may hold a weak reference to it instead of a strong one. the nsprefbranch object listens for xpcom-shutdown and frees all of the objects currently in its observer list. this ensures that long lived objects (services for example) will be freed correctly. the observer can request to be held as a weak reference when it is registered. this insures that shorter lived objects (say one tied to an open window) will not fall into the cyclical reference trap. the list of registered observers may be changed during the dispatch of nspref:changed notification. however, the observers are not guaranteed to be notified in any particular order, so you can't be sure whether the added/removed observer will be called during the notification when it is added/removed. it is possible to change preferences...
nsISound
void init(); void play(in nsiurl aurl); void playeventsound(in unsigned long aeventid); void playsystemsound(in astring soundalias); constants sound event constants constant value description event_new_mail_received 0 the system receives email. event_alert_dialog_open 1 an alert dialog is opened. event_confirm_dialog_open 2 a confirm dialog is opened. event_prompt_dialog_open 3 a prompt dialog (one that allows the user to enter data, such as an authentication dialog) is opened. event_select_dialog_open 4 a select dialog (one that contains a list box) is opened. ...
...unds be played based on which event you wish to represent by the sound effect. various event names are provided, which will result in playing the corresponding sound effect on the platform the user is running on: _moz_mailbeep the system sound when the system receives email. _moz_alertdialog the system sound when an alert dialog is opened. _moz_confirmdialog the system sound when a confirm dialog is opened. _moz_promptdialog the system sound when a prompt dialog (one that allows the user to enter data, such as an authentication dialog) is opened. _moz_selectdialog the system sound when a select dialog (one that contains a list box) is op...
nsISpeculativeConnect
netwerk/base/public/nsispeculativeconnect.idlscriptable lets non-networking code provide hints to the networking layer that an http connection attempt to a particular site is likely to happen soon; this lets the networking layer begin setting up tcp and, if appropriate, ssl handshakes to save time when the connection is actually opened later. 1.0 66 introduced gecko 15.0 inherits from: nsisupports last changed in gecko 15.0 (firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) to use this service, simply call nsisupports.queryinterface() on the nsiioservice you plan to use for the connection, to get access to the i/o service's implementation of nsispeculativeconnect. then call speculativeconnect() to let the networking layer know what you might be doing in the fu...
...at a new transaction for the specified uri is likely to happen soon. the code implementing this method may use this information to start a tcp and/or ssl level handshake for that resource immediately so that it is ready (or at least in the process of becoming ready) when the transaction is actually submitted. no obligation is taken on by the implementer, nor is the submitter obligated to actually open the new channel. void speculativeconnect( in nsiuri auri, in nsiinterfacerequestor acallbacks, in nsieventtarget atarget ); parameters auri the uri of the hinted transaction. acallbacks any security callbacks for use with ssl for interfaces such as nsibadcertlistener. may be null. atarget the thread on which the release of the callbacks will occur. may be null for "any thread". see also ...
nsIXULWindow
g a way for the browser to update the user interface of the enclosing xul window. zlevel unsigned long one of the z level constants below. on some platforms, windows with a higher zlevel will be kept above windows with a lower zlevel. constants constant value description lowestz 0 loweredz 4 the z level of an independent window opened with the "alwayslowered" chrome flag. normalz 5 the default z level of an independent window. raisedz 6 the z level of an independent window opened with the "alwaysraised" chrome flag. highestz 9 methods addchildwindow() tell this window that it has picked up a child xul window.note that xul windows do not currently track child xul windows...
... to a centered position. void center( in nsixulwindow arelative, in boolean ascreen, in boolean aalert ); parameters arelative if not null, the window relative to which the window is moved. see ascreen parameter for details. ascreen true to center the window relative to the screen containing arelative if arelative is not null. if arelative is null then relative to the screen of the opener window if it was initialized by passing it to nswebshellwindow::initialize. failing that relative to the main screen. false to center it relative to arelative itself (arelative must be set in this case.) aalert true to move the window to an alert position, generally centered horizontally and 1/3 down from the top. createnewwindow() create a new window. nsixulwindow createnewwindow( in p...
nsPIPromptService
log. ebutton0text the value is 8. this is the label of the first button on the dialog. ebutton1text the value is 9. this is the label of the second button on the dialog. ebutton2text the value is 10. this is the label of the third button on the dialog. ebutton3text the value is 11. this is the label of the forth button on the dialog. edialogtitle the value is 12. this is the title of the dialog. eopeningsound obsolete since gecko 1.9.2 the value is 13. this is the system sound name which should be played when the dialog is shown. see also nsisound.playsystemsound(). this is obsolete on gecko 1.9.2 and later. you should use esoundeventid instead. the indexes for getint() and setint() are: ebuttonpressed the value is 0. this is used for the result of the dialog. the pressed button number will...
...value is 6. if this is not 0, the all buttons are disabled when the dialog is shown. and they will be enabled later. esoundeventid the value is 7. this is the sound event id which should be played when the dialog is shown. see also nsisound.playeventsound(). method overview void dodialog(in nsidomwindow aparent, in nsidialogparamblock aparamblock, in string achromeurl); methods dodialog() opens a dialog. void dodialog( in nsidomwindow aparent, in nsidialogparamblock aparamblock, in string achromeurl ); parameters aparent the parent window of the dialog. aparamblock various parameters for the dialog. achromeurl the url of the dialog implementation. ...
XPCOM Interface Reference
registrarnsiwebnavigationnsiwebnavigationinfonsiwebpagedescriptornsiwebprogressnsiwebprogresslistenernsiwebprogresslistener2nsiwebsocketchannelnsiwebsocketlistenernsiwebappssupportnsiwifiaccesspointnsiwifilistenernsiwifimonitornsiwinaccessnodensiwinapphelpernsiwintaskbarnsiwindowcreatornsiwindowmediatornsiwindowwatchernsiwindowsregkeynsiwindowsshellservicensiworkernsiworkerfactorynsiworkerglobalscopensiworkermessageeventnsiworkermessageportnsiworkerscopensiwritablepropertybagnsiwritablepropertybag2nsixformsmodelelementnsixformsnsinstanceelementnsixformsnsmodelelementnsixmlhttprequestnsixmlhttprequesteventtargetnsixmlhttprequestuploadnsixpcexceptionnsixpcscriptablensixpconnectnsixsltexceptionnsixsltprocessornsixsltprocessorobsoletensixulappinfonsixulbrowserwindownsixulbuilderlistenernsixulrunti...
...pinfonsixulbrowserwindownsixulbuilderlistenernsixulruntimensixulsortservicensixultemplatebuildernsixultemplatequeryprocessornsixultemplateresultnsixulwindownsixmlrpcclientnsixmlrpcfaultnsizipentrynsizipreadernsizipreadercachensizipwriternsmsgfilterfileattribvaluensmsgfolderflagtypensmsgjunkstatusnsmsgkeynsmsglabelvaluensmsgpriorityvaluensmsgruleactiontypensmsgsearchattribnsmsgsearchopnsmsgsearchscopensmsgsearchtermnsmsgsearchtypevaluensmsgsearchvaluensmsgsearchwidgetvaluenspipromptservice see also interfaces grouped by function ...
nsMsgMessageFlags
04 indicates whether or not the message has been flagged/starred expunged 0x00000008 indicates whether or not the message is deleted (but not compacted) hasre 0x00000010 indicates whether or not 're: ' should be added to the head of the subject to get the proper subject. elided 0x00000020 indicates whether or not the thread rooted at this message is open or closed in the ui. offline 0x00000080 indicates whether or not we have this message in the offline cache. watched 0x00000100 indicates whether or not this thread is being watched. senderauthed 0x00000200 partial 0x00000400 indicates whether or not the body we have is a complete message. queued 0x00000800 indicates whet...
...a complete message. queued 0x00000800 indicates whether or not the message is queued to be delivered. forwarded 0x00001000 indicates whether or not the message has been forwarded. priorities 0x0000e000 the set of bits that indicate the priority. new 0x00010000 indicates whether or not the message is new since the last time the folder was opened. ignored 0x00040000 indicates whether or not the (sub-)thread has been ignored. imapdeleted 0x00200000 indicates whether or not the message has been deleted on the imap server mdnreportneeded 0x00400000 indicates whether or not a delivery receipt was requested. mdnreportsent 0x00800000 indicates whether or not a delivery receipt was se...
Troubleshooting XPCOM components registration
-dev packages from them. remember to check that the directory the component is in is named correctly i.e. $profile/extensions/$plugindirectory/components! double check your guids in your install.rdf with your sourcecode, and then check them again. windows-specific hints use dependency walker to check that your dependent libraries are loaded correctly. in dependency walker, open the options menu and select configure module search order.... in the bottom right corner of the new dialog, click browse... and select the directory firefox.exe (or equivalent) is in. in the bottom left corner, click add directory. do not add any other directories; in particular, do not add your extension's (or xulrunner application's) components directory. after clicking ok in the to...
....... in the bottom right corner of the new dialog, click browse... and select the directory firefox.exe (or equivalent) is in. in the bottom left corner, click add directory. do not add any other directories; in particular, do not add your extension's (or xulrunner application's) components directory. after clicking ok in the top right, check for any missing dependencies using file -> open -> firefox.exe (or equivalent). also check that the function nsgetmodule is exported. you can also use the profiling feature of dependency walker to view failed module loads while running your application. open the profile menu and select start profiling.... in the dialog that appears, you can provide command line parameters and click ok to start the application. you will see any mod...
Using IndexedDB in chrome
exeddb api is typically used to store data in the user's browser from content javascript. (see using indexeddb for an overview.) however, the apis can also be accessed from system-privileged javascript using the components.utils.importglobalproperties() function: components.utils.importglobalproperties(["indexeddb"]); // from here on, it's like using indexeddb from content var req = indexeddb.open("my-database"); // ... if you are creating a sandbox, and want indexeddb to be available in it, use the wantglobalproperties option in the sandbox constructor: var options = { "wantglobalproperties": ["indexeddb"] } var principal = cc["@mozilla.org/systemprincipal;1"].createinstance(ci.nsiprincipal); var sandbox = components.utils.sandbox(principal, options); // the sandbox will have access ...
...this method was removed in firefox 33. ...
Xptcall Porting Status
nd working. <font color="white">done</font> solaris sparc v9 (64bit) stuart parmenter <pavlov@netscape.com>, chris seawood <cls@seawood.org> unix this is checked in and (pavlov claims!) working. <font color="white">done</font> os/2 john fairhurst <mjf35@cam.ac.uk> i never heard exactly who did what. but mozilla has been working on os/2 for a long time now. <font color="white">done</font> openvms alpha colin r. blake <colin@theblakes.com> colin says this is passing all the tests on openvms alpha! <font color="white">done</font> nt alpha bob meader <bob@guiduck.com> bob writes: enclosed is xptcall for alpha/nt target.. it is a variation of the iris port (only targeted for win32). notice the last 2 files (the change to mozilla\xpcom\build\makefile.win and mozilla\xpcom\build) are nee...
...t passes testxptcinvoke and testxpc on my machine which runs kernel 2.2.7, glibc 2.1.1, and egcs 1.1.2. i have not tested it with older gnu compilers such as gcc 2.8.x. from looking at the linux x86 code, i gather that the vtable layout is a little different for those compilers and the code will need minor modifications in order to work properly. i am not sure how much of the code can be used for openvms alpha and/or digital unix. currently the code is dependent on the g++ name mangling convention and a few gnu extensions so i'm not sure how useful it will be for the other systems. hopefully the comments in the code are detailed enough to help people attempting a port. <font color="white">done</font> sunos x86 arthur jones <aljones@lbl.gov> <font color="red">?</font> philip pokorny <ppoko...
Main Windows
n to be portable, so instead of duplicating it, its been put in overlays that are loaded over many different types of windows. some of the code was written based off of early firefox code, but is not exactly the same. you’ll sometimes see reimplementations of things that are already in toolkit, written specially for thunderbird. messenger.xul the base mail window that you see when you first open thunderbird is messenger.xul: messenger.xul itself doesn’t contain a lot. its main focus is on handling the folderpane, threadpane, and the message preview sections shown above. the rest is loaded from overlays: mailwindowoverlay.xul this is the red sections shown in the interface above (where?), including the toolbars, notification bars, and the status bar, but also includes most of the c...
...howing either a brief or expanded view of the headers. the third is the attachment box which can be toggled into a slim or an expanded view basemenuoverlay.xul contains the contents of most of the menus (i.e. file, edit, view, etc). osx only: macmenuoverlay.xul a special overlay for osx that adds a few items to the window menu. messagewindow.xul messagewindow.xul is shown when a message is opened. its almost exactly the same as messenger.xul in terms of overlays, but just lacks the folder and threadpanes normally shown. menus, toolbar buttons, and headers are all taken from exactly the same overlays listed above though. mailwindowoverlay.xul this is the red sections shown in the interface above, including the toolbars, notification bars and the status bar.it also includes most of t...
Thunderbird Configuration Files
r. to access the config editor, go to tools > options or do thunderbird > preferences. if you are on mac os x, and on linux do edit > preferences on, select the advanced options panel, click on the general tab, and click on config editor. this will display a list of used preferences, as well as a search bar at the top. double-click on a preference to change its value. to do add a new preference, open the context menu (right-click) on any existing preference, go to the new menu, and select the type of preference. some preferences may require that you restart thunderbird in order to take effect. configuration files some tips and tricks require that you edit configuration files manually. there are three files you should know about: userchrome.css used to change the appearance of the brows...
...ent.txt should be displayed. change the name to user.js (click yes on the file type warning that appears). linux users: use your own preferred method to create user.js in the profile folder. if you don't already have one, consider running the following code in a terminal. $ cd $profile # where $profile is your profile folder $ touch user.js # create the empty javascript file alternatively, open a files window (if you're on ubuntu. this will depend on which distribution you use), navigate to the profile folder, and right-click in some empty space on the right pane, then select new document > empty document. the default name untitled document should appear, with focus on the filename. enter user.js to change the document's name. ...
Using COM from js-ctypes
nts.utils.import("resource://gre/modules/ctypes.jsm", {}); // some groundwork let is64bit; if (ctypes.voidptr_t.size == 4 /* 32-bit */) { is64bit = false; } else if (ctypes.voidptr_t.size == 8 /* 64-bit */) { is64bit = true; } let winabi = is64bit ? ctypes.default_abi : ctypes.winapi_abi; let callback_abi = is64bit ? ...
...e.error('ex occured:', ex); } finally { if (spvoice) { spvoice.release(spvoiceptr); } couninitialize(); } } main(); lib.close(); other examples shgetpropertystoreforwindow - this examples shows that coinit is not needed, some winapi functions return the interface. this example uses ipropertystore::setvalue to change the system.usermodelapp.id of an open firefox window. ishellitem ifileoperation ishelllink & ipersistfile - create shortcut files. example a - based on bugzilla :: bug 738501 - attachement 608538 exmaple b - based on example a ishelllink & ipersistfile & ipropertystore - uses ipropertystore to set and get the system.usermodelapp.id on shortcut files. ...
Library
its methods let you declare symbols exported by the library, and to manage the library. method overview close(); cdata declare(name, [abi, ], returntype[, argtype1, ...]); methods close() closes the library. you need to call this once you're done using the library. close(); parameters none. declare() declares an api from the native library, allowing it to be used from javascript. this can be used both for exported data symbols and for functions. ...
... we can also supply only two arguments to the declare function. ...
js-ctypes
es. unlike binary xpcom components, it allows developers to ship a single binary for use with multiple versions of firefox. note: js-ctypes is only available from chrome code; that is, ctypes is not available to websites, only application and extension code. ...
...h multiple versions of firefox. note: js-ctypes is only available from chrome code; that is, ctypes is not available to websites, only application and extension code. documentation if you are brand new to js-ctypes, and have no idea about it, the pages you should read first is - ctypes.open followed by standard os libraries. ...
Streams - Plugins
owser is deleted after returning from the function, so the plug-in must make a copy of the data it needs to keep. as an example, suppose that a plug-in (and the http server) supports byte-range requests, and that the browser is in the process of pushing data to the plug-in. if the user now requests a specific page of the document, the plug-in calls npn_requestread with a list of byte ranges. the open stream is converted from normal mode to seek mode in an effort to pass the plug-in data that was already on the way, rather than just discarding it. all npp_write calls for streaming data eventually stop, and npp_write calls will be completed only for data requested with npn_requestread. the browser does not create a new stream for each byte range it requests. instead, additional npp_writeready ...
... that npp_write will receive requests for ranges in the same order as you requested (although this typically is the case; the server controls the order). so, you'll need to pay attention to the offsets as data is being written. the stream processes all byte-range requests, and then is placed in seek mode (either explicitly in npp_newstream, or implicitly by a call to npn_requestread). it remains open until the plug-in closes it by calling npn_destroystream, or until the instance is destroyed. note: if you want to be sure that the npn_*stream functions are called in the order you want and behave the way you expect, combine npn_newstream, npn_write, and npn_destroy_stream in the same callback. sending the stream in random-access mode in random-access mode, the plug-in "pulls" stream data by ...
DOM Inspector FAQ - Firefox Developer Tools
inspect a url this just focuses the dom inspector's address bar, which allow you to inspect arbitrary documents which can be accessed via a url. ...
...ude chrome documents, but it's not suggested that you inspect xul documents by directly inspecting them via url, since some behavior may rely on the document being contained in another xul document, or the converse, where it won't behave correctly because it doesn't expect to be loaded as a framed document. instead, get the xul document to load as you normally would (e.g., by invoking commands or opening windows via standard application use), then locate it in the inspect chrome document menu. why do some nodes in the document dom nodes viewer appear in red? these nodes are anonymous content nodes, meaning they are not in the dom generated by the original document. okay, what if i don't want to see those anonymous nodes? you can hide anonymous nodes in inspector by unchecking the view > s...
Search - Firefox Developer Tools
press return to search. ...
...d" when viewing the above list, i get the following: only the functions with load in their name are shown. this feature may not seem terribly useful when searching a file with a handful of functions in it but when you are searching through a file with dozens of functions, it comes in handy. searching in all files you can also search for a string in all of the files included in the currently opened project. press shift + ctrl + f (windows and linux) or shift + cmd + f (macos) and then enter the string you are trying to find. if the string exists in any of the files in the project, the search will return a list showing a list by file and line number. click on any entry in the list to go directly to the line in the file where the string occurs. ...
Step through code - Firefox Developer Tools
tep over: advance to the next line in the same function. step in: advance to the next line in the function, unless on a function call, in which case enter the function being called step out: run to the end of the current function, in which case, the debugger will skip the return value from a function, returning execution to the caller split console when paused, you can press the esc key to open and close the split console to gain more insight into errors and variables: pause on breakpoints overlay since firefox 70, when your code is paused on a breakpoint an overlay appears on the viewport of the tab you are debugging. this lets you know what kind of breakpoint the code is paused on (breakpoint, event breakpoint, etc.), and also provides a step button and a play button. the think...
...ight into errors and variables: pause on breakpoints overlay since firefox 70, when your code is paused on a breakpoint an overlay appears on the viewport of the tab you are debugging. this lets you know what kind of breakpoint the code is paused on (breakpoint, event breakpoint, etc.), and also provides a step button and a play button. the thinking here is that if you've got your devtools open in a separate window, as many people do, it can be easier to have the buttons available right there to move the code forward while you are looking at the result. if you want to turn this feature off, since firefox 71 you can do so by going to about:config in a new tab, setting the devtools.debugger.features.overlay pref to false, and restarting the browser. inline variable preview new in firef...
Using the Debugger map scopes feature - Firefox Developer Tools
this feature is useful when debugging source-mapped code. it enables you to see the variables from the original source. it’s also possible to inspect variables from the generated scopes (e.g., a bundle file with all concatenated module files). let's take a look at how this works. if you want to follow along, use this example. open the example page and then open the debugger using tools > web developer > debugger (or press ctrl + i and then select the debugger). select the "bundle.js" file in the sources panel on the left and then set a breakpoint at line 102 in the increment function. when you click the increment button on the page and hit the breakpoint, an additional section is added to the right-hand panel below the call stack to display variables mapped from the original scope, li...
... below the call stack to display variables mapped from the original scope, like this: as useful as this is, it would be even nicer if you could view the original code (before it was packages into the "bundle.js" file. right-click on the source code and the context menu now includes an option to jump to original location as shown below. click jump to original location. the debugger opens the file "increment.js" so you can view the original code. notice that your breakpoint is set here in the original code as it was in the corresponding line in the "bundle.js" file. and, since map has been checked in the scopes panel, you also see variable symbols from the original code. using this feature is expensive in terms of resources, but it certainly makes your life easier when yo...
Tutorial: Show Allocations Per Call Path - Firefox Developer Tools
tutorial: show allocations per call path this page shows how to use the debugger api to show how many objects a web page allocates, sorted by the function call path that allocated them. visit the url about:config, and set the devtools.chrome.enabled preference to true: setting the 'devtools.chrome.enabled' preference open a developer scratchpad (menu button > developer > scratchpad), and select "browser" from the "environment" menu. (this menu will not be present unless you have changed the preference as explained above.) selecting the 'browser' context in the scratchpad enter the following code in the scratchpad: // this simply defines the 'debugger' constructor in this // scratchpad; it doesn't actually start debugging anything. components.utils.imp...
...this begins logging allocations in the current browser tab. in the browser tab, click on the text that says "click here…". the event handler should add some text to the end of the page. back in the browser console, evaluate the expression d...
Tutorial: Set a breakpoint - Firefox Developer Tools
gger api yourself using firefox’s scratchpad. we use debugger to set a breakpoint in a function, and then evaluate an expression whenever it is hit. this tutorial was tested against firefox 58 beta and nightly. it does not work in firefox 57. since the debugger api is only available to privileged javascript code, you’ll need to use the browser content toolbox to try it out. to do this, open the firefox developer tools, click on the options gear at the upper right of the toolbox, and make sure that both “enable browser chrome and add-on debugging toolboxes” and “enable remote debugging” are checked. these are located at the bottom right of the options panel; you may need to scroll to see them. once they’re checked, you can close the developer tools. save the following...
... options panel; you may need to scroll to see them. once they’re checked, you can close the developer tools. save the following text to an html file: <div onclick="report('the best div');">click me!</div> <div onclick="report('another great div');">or me!</div> <script> function report(what) { console.log('clicked: ' + what); } </script> visit the html file in your browser, and open the browser content toolbox by opening the firefox menu, choosing “web developer”, and then “browser content toolbox”. if that item doesn’t appear in the “web developer” menu, make sure you checked both boxes to enable the browser content toolbox as explained in step 1. our example code is long enough that the best way to run it is to use the scratchpad panel, which is not ena...
Inspecting web sockets - Firefox Developer Tools
ket connection, the web socket requests are listed in the list of requests in the network monitor along with all other requests. you can use the ws button to filter the list for just web socket connections. only requests with the 101 status code (websocket protocol handshake) are visible, which indicates that the server is switching to a web socket connection. clicking on a web socket request opens the usual sidebar to reveal additional details. choose the reponse tab to inspect web socket frames sent and received through the selected connection. the live-updated table shows data for sent (green arrow) and received (red arrow) frames. each frame expands on click, so you can inspect the formatted data. pausing web socket traffic you can use the pause/resume button in the network monito...
...r example, only messages for control frames sent by the browser. columns in the response pane in the response pane, you can choose to show the following information about each frame: data size time opcode maskbit finbit the data and time columns are visible by default, but you can customize the interface to see more columns by choosing which ones to show from the context menu that is opened by right-clicking in the table header. expanding each message selecting a message in the list shows a preview of the data being sent in that message, at the bottom of the response pane. supported ws protocols the inspector currently supports the following web socket protocols: plain json socket.io sockjs signalr wamp the payload based on those protocols is parsed and displayed ...
Work with animations - Firefox Developer Tools
tart the animation there's a dropdown to change the animation playback rate the current time in the animation is displayed. finally, if you click inside the bar at the top of the timeline, you get a scrubber that you can drag left and right to move backwards and forwards through the animation, and pinpoint exactly what's happening when. further information about animation compositing if you open animation-inspector-compositing.html and click the red rectangle, a simple opacity animation will start. if you look at this in the animation inspector in firefox 49+, you'll see that: the white lightning bolt icon now indicates whether all the animation properties have been optimized by running them through the compositor, where possible. the bar tooltip also includes this information, as a ...
...mation you can specify a timing function: this determines the rate at which the animation progresses. one way to specify the timing function is with a cubic bézier curve. timing functions defined as cubic bézier curves get an icon in the rules view. if you click the icon you get a visual editor for the curve, enabling you to drag p1 and p2, and see the results in the page: this feature uses open source code from lea verou’s cubic-bezier.com. the cubic bézier editor includes a number of presets, grouped under "ease-in", "ease-out", and "ease-in-out": ...
Shader Editor - Firefox Developer Tools
deprecated and will soon be removed from firefox. for details, see deprecated tools. the shader editor enables you to see and edit the vertex and fragment shaders used by webgl. webgl is a javascript api for rendering interactive 3d graphics and 2d graphics in the browser without using plugins. with webgl you provide 2 programs called shaders which are called at the appropriate stages of the opengl rendering pipeline: a vertex shader, which computes the clip space coordinates of each vertex to be drawn, and a fragment shader, which determines the color for each pixel to be drawn. these shaders are written in opengl shading language, or glsl. in webgl they can be included in a page in several ways: as text hardcoded in javascript strings, as separate files included using <script> tags, ...
...erver as plain text. javascript code running in the page then sends them for compilation using the webgl apis, and they're executed on the device's gpu when needed. with the shader editor, you can examine and edit the source of the vertex and fragment shaders. here's another screencast, showing how you can use the shader editor for complex applications (in this case, the unreal engine demo): opening the shader editor the shader editor is disabled by default. to enable it, open the toolbox settings and check "shader editor" in the "default firefox developer tools" item. you'll now see "shader editor" appear in the toolbar. click it and the shader editor opens. at first you'll just see a blank window with a button asking you to reload the page: to get started, load a page which creat...
Storage Inspector - Firefox Developer Tools
u to inspect various types of storage that a web page can use. currently it can be used to inspect the following storage types: cache storage — any dom caches created using the cache api. cookies — all the cookies created by the page or any iframes inside of the page. cookies created as a part of response of network calls are also listed, but only for calls that happened while the tool is open. indexeddb — all indexeddb databases created by the page or any iframes inside the page, their object stores and the items stored in these object stores. local storage — all local storage items created by the page or any iframes inside the page. session storage — all session storage items created by the page or any iframes inside the page. for the time being, the storage inspector only...
... and the items stored in these object stores. local storage — all local storage items created by the page or any iframes inside the page. session storage — all session storage items created by the page or any iframes inside the page. for the time being, the storage inspector only gives you a read-only view of storage. but we're working to let you edit storage contents in future releases. opening the storage inspector you can open the storage inspector by selecting "storage inspector" from the web developer submenu in the firefox menu panel (or tools menu if you display the menu bar or are on macos), or by pressing its shift + f9 keyboard shortcut. the toolbox will appear at the bottom of the browser window, with the storage inspector activated. it's just called "storage" in the deve...
Toolbox - Firefox Developer Tools
see also keyboard shortcuts. ...
...side of the browser window toggle the window between standalone and attached to the browser window access developer tool settings settings see the separate page on the developer tools settings. main pane the content of the main pane in the window is entirely controlled by, and specific to, the hosted tool currently selected. keyboard shortcuts these shortcuts work whenever the toolbox is open, no matter which tool is active. command windows macos linux cycle through tools left to right ctrl + ] cmd + ] ctrl + ] cycle through tools right to left ctrl + [ cmd + [ ctrl + [ toggle between active tool and settings. f1 f1 f1 toggle toolbox between the last 2 docking modes ctrl + shift + d cmd + ...
Web console keyboard shortcuts - Firefox Developer Tools
command windows macos linux open the web console ctrl + shift + k cmd + opt + k ctrl + shift + k search in the message display pane ctrl + f cmd + f ctrl + f open the object inspector pane ctrl + click ctrl + click ctrl + click clear the object inspector pane esc esc esc focus on the command line ctrl + shift + k cmd + opt + k ctrl + shift + k clear output ctrl + shift + l ctrl + l from firefox 67: cmd + k ctrl + shift + l command line interpreter these shortcuts apply when you're in the command line interpreter. command windows macos linux scroll to start of console output (only if the com...
... move to the beginning of the line home ctrl + a ctrl + a move to the end of the line end ctrl + e ctrl + e execute the current expression enter return enter add a new line, for entering multiline expressions shift + enter shift + return shift + enter autocomplete popup these shortcuts apply while the autocomplete popup is open: command windows macos linux choose the current autocomplete suggestion tab tab tab cancel the autocomplete popup esc esc esc move to the previous autocomplete suggestion up arrow up arrow up arrow move to the next autocomplete suggestion down arrow down arrow down arrow page up through autocomplet...
Web Console remoting - Firefox Developer Tools
veconsoleapi": true|false } getcachedmessages(types, onresponse) the webconsoleclient.getcachedmessages(types, onresponse) method sends the following packet to the server: { "to": "conn0.console9", "type": "getcachedmessages", "messagetypes": [ "pageerror", "consoleapi" ] } the getcachedmessages packet allows one to retrieve the cached messages from before the web console was open. you can only get cached messages for page errors and console api calls. the reply looks like this: { "messages": [ ... ], "from": "conn0.console9" } each message in the array is of the same type as when we send typical page errors and console api calls. these will be explained in the following sections of this document. actor preferences to allow the web console to configure logging opt...
...sponsebodies" ] } reply packet: { "preferences": { "networkmonitor.saverequestandresponsebodies": false }, "from": "conn0.console34" } you can also use the webconsoleclient.getpreferences(prefs, onresponse). the prefs argument is an array of preferences you want to get their values for, by name. private browsing the browser console can be used while the user has private windows open. each page error, console api message and network request is annotated with a private flag. private messages are cleared whenever the last private window is closed. the console actor provides the lastprivatecontextexited notification: { "from": "conn0.console19", "type": "lastprivatecontextexited" } this notification is sent only when your client is attached to the global console actor, it...
AudioBufferSourceNode.AudioBufferSourceNode() - Web APIs
buffer: an instance of audiobuffer to be played. detune: a value in cents to modulate the speed of audio stream rendering. its nominal range is (-∞ to +∞). the default is 0. loop: a boolean indicating whether the audio should play in a loop. the default is false. if the loop is dynamically modified during playback, the new value will take effect on the next processing block of audio. ...
...y in a loop. the default is false. if the loop is dynamically modified during playback, the new value will take effect on the next processing block of audio. loopend: an optional value, in seconds, where looping should end if the loop attribute is true. the default is 0. its value is exclusive to the content of the loop. the sample frames, comprising the loop, run from the values loopstart to loopend-(1/samplerate). it's sensible to set this to a value between 0 and the duration of the buffer. if loopend is less than 0, looping will end at 0. if loopend is greater than the duration of the buffer, looping will end at the end of the buffer. this attribute is converted to an exact sample frame offset within the buffer, by multiplying by the buffer's sample rate and rounding to the nearest integ...
AudioBufferSourceNode.loop - Web APIs
ffer is reached. the loop property's default value is false. syntax var loopingenabled = audiobuffersourcenode.loop; audiobuffersourcenode.loop = true | false; value a boolean which is true if looping is enabled; otherwise, the value is false. when looping is enabled, the sound begins playing at the time specified as the start point when start() is called. when the time specified by the loopend property is reached, playback continues at the time specified by loopstart example in this example, the audiocontext.decodeaudiodata function is used to decode an audio track and put it into an audiobuffersourcenode. buttons are provided to play and stop the audio playback, and a slider control is used to change the playbackrate property value on the fly. when the audio is played, it loops. ...
... audio track and put it into an audiobuffersourcenode. buttons are provided to play and stop the audio playback, and a slider control is used to change the playbackrate property value on the fly. when the audio is played, it loops. ...
AudioContext.createMediaStreamDestination() - Web APIs
cked, the oscillator starts, and the mediarecorder is started. when the button is stopped, the oscillator and mediarecorder both stop. stopping the mediarecorder causes the dataavailable event to fire, and the event data is pushed into the chunks array. after that, the stop event fires, a new blob is made of type opus — which contains the data in the chunks array, and a new window (tab) is then opened that points to a url created from the blob. from here, you can play and save the opus file. <!doctype html> <html> <head> <title>createmediastreamdestination() demo</title> </head> <body> <h1>createmediastreamdestination() demo</h1> <p>encoding a pure sine wave to an opus file </p> <button>make sine wave</button> <audio controls></audio> <script> var b = do...
... var blob = new blob(chunks, { 'type' : 'audio/ogg; codecs=opus' }); document.queryselector("audio").src = url.createobjecturl(blob); }; </script> </body> </html> note: you can view this example live, or study the source code, on github. specifications specification status comment web audio apithe definition of 'createmediastreamdestination...
Blob - Web APIs
Web › API › Blob
ng a url representing the contents of a typed array the following code creates a javascript typed array and creates a new blob containing the typed array's data. it then calls url.createobjecturl() to convert the blob into a url. html <p>this example creates a typed array containing the ascii codes for the space character through the letter z, then converts it to an object url. a link to open that object url is created. click the link to see the decoded object url.</p> javascript the main piece of this code for example purposes is the typedarraytourl() function, which creates a blob from the given typed array and returns an object url for it. having converted the data into an object url, it can be used in a number of ways, including as the value of the <img> element's src attribu...
...e (assuming the data contains an image, of course). function typedarraytourl(typedarray, mimetype) { return url.createobjecturl(new blob([typedarray.buffer], {type: mimetype})) } const bytes = new uint8array(59); for(let i = 0; i < 59; i++) { bytes[i] = 32 + i; } const url = typedarraytourl(bytes, 'text/plain'); const link = document.createelement('a'); link.href = url; link.innertext = 'open the array url'; document.body.appendchild(link); result click the link in the example to see the browser decode the object url. extracting data from a blob one way to read content from a blob is to use a filereader. the following code reads the content of a blob as a typed array: const reader = new filereader(); reader.addeventlistener('loadend', () => { // reader.result contains the c...
CSSStyleSheet.insertRule() - Web APIs
sheet_proto.insertrule = function(selectorandrule){ // first, separate the selector from the rule a: for (var i=0, len=selectorandrule.length, isescaped=0, newcharcode=0; i !== len; ++i) { newcharcode = selectorandrule.charcodeat(i); if (!isescaped && (newcharcode === 123)) { // 123 = "{".charcodeat(0) // secondly, find the last closing bracket var openbracketpos = i, closebracketpos = -1; for (; i !== len; ++i) { newcharcode = selectorandrule.charcodeat(i); if (!isescaped && (newcharcode === 125)) { // 125 = "}".charcodeat(0) closebracketpos = i; } isescaped ^= newcharcode===92?1:isescaped; // 92 = "\\".charcodeat(0) } if (closebracketpos === -1) break...
...= 125)) { // 125 = "}".charcodeat(0) closebracketpos = i; } isescaped ^= newcharcode===92?1:isescaped; // 92 = "\\".charcodeat(0) } if (closebracketpos === -1) break a; // no closing bracket was found! ...
Cache.addAll() - Web APIs
Web › API › Cache › addAll
s is not in the 200 range (i.e., not a successful response.) this occurs if the request does not return successfully, but also if the request is a cross-origin no-cors request (in which case the reported status is always 0.) examples this code block waits for an installevent to fire, then runs waituntil() to handle the install process for the app. ...
...cors request (in which case the reported status is always 0.) examples this code block waits for an installevent to fire, then runs waituntil() to handle the install process for the app. this consists of calling cachestorage.open to create a new cache, then using addall() to add a series of assets to it. ...
Cache.put() - Web APIs
Web › API › Cache › put
lves with undefined. note: the promise will reject with a typeerror if the url scheme is not http or https. examples this example is from the mdn sw-test example (see sw-test running live). here we wait for a fetchevent to fire. we construct a custom response like so: check whether a match for the request is found in the cachestorage using cachestorage.match(). if so, serve that. if not, open the v1 cache using open(), put the default network request in the cache using cache.put() and return a clone of the default network request using return response.clone(). clone is needed because put() consumes the response body. if this fails (e.g., because the network is down), return a fallback response. var response; var cachedresponse = caches.match(event.request).catch(function() { retu...
... using cache.put() and return a clone of the default network request using return response.clone(). clone is needed because put() consumes the response body. if this fails (e.g., because the network is down), return a fallback response. var response; var cachedresponse = caches.match(event.request).catch(function() { return fetch(event.request); }).then(function(r) { response = r; caches.open('v1').then(function(cache) { cache.put(event.request, response); }); return response.clone(); }).catch(function() { return caches.match('/sw-test/gallery/mylittlevader.jpg'); }); specifications specification status comment service workersthe definition of 'cache: put' in that specification. working draft initial definition. ...
CacheStorage.match() - Web APIs
hing response. if no matching response to the specified request is found, the promise resolves with undefined. examples this example is from the mdn sw-test example (see sw-test running live). here we wait for a fetchevent to fire. we construct a custom response like so: check whether a match for the request is found in the cachestorage using cachestorage.match(). if so, serve that. if not, open the v1 cache using open(), put the default network request in the cache using cache.put() and return a clone of the default network request using return response.clone(). the last is necessary because put() consumes the response body. if this fails (e.g., because the network is down), return a fallback response. self.addeventlistener('fetch', function(event) { event.respondwith(caches.match(...
... workin...
Drawing shapes with canvas - Web APIs
econd step is calling the methods that actually specify the paths to be drawn. we'll see these shortly. the third, and an optional step, is to call closepath(). this method tries to close the shape by drawing a straight line from the current point to the start. if the shape has already been closed or there's only one point in the list, this function does nothing. note: when you call fill(), any open shapes are closed automatically, so you don't have to call closepath(). this is not the case when you call stroke(). drawing a triangle for example, the code for drawing a triangle would look something like this: <html> <body onload="draw();"> <canvas id="canvas" width="100" height="100"></canvas> </body> </html> function draw() { var canvas = document.getelementbyid('canvas'); if...
... rect(x, y, width, height) draws a rectangle whose top-left corner is specified by (x, y) with the specified width and height. before this method is executed, the moveto() method is automatically called with the parameters (x,y). in other words, the current pen position is automatically reset to the default coordinates. making combinations so far, each example on this page has used o...
CustomElementRegistry.define() - Web APIs
ikely a problem with element.attachshadow(). examples autonomous custom element the following code is taken from our popup-info-box-web-component example (see it live also). ...
...) { // always call super first in constructor super(); // count words in element's parent element var wcparent = this.parentnode; function countwords(node){ var text = node.innertext || node.textcontent return text.split(/\s+/g).length; } var count = 'words: ' + countwords(wcparent); // create a shadow root var shadow = this.attachshadow({mode: 'open'}); // create text node and add word count to it var text = document.createelement('span'); text.textcontent = count; // append it to the shadow root shadow.appendchild(text); // update count when element content changes setinterval(function() { var count = 'words: ' + countwords(wcparent); text.textcontent = count; }, 200) } } // define the new...
Document.popupNode - Web APIs
typically, this property will be checked during a popupshowing event handler for a context menu to initialize the menu based on the context. this property is only set for popups attached via the popup or context attributes. ...
...typically, this property will be checked during a popupshowing event handler for a context menu to initialize the menu based on the context. this property is only set for popups attached via the popup or context attributes. ...
EffectTiming.fill - Web APIs
Web › API › EffectTiming › fill
that css looks like ...
... width: 300px; border: 1px solid black; font-size: 16px; text-align: center; margin-top: 0px; padding-top: 2px; padding-bottom: 4px; color: white; background-color: darkgreen; font: 14px "open sans", "arial", sans-serif; } #text { width: 160px; padding: 10px; position: relative; text-align: center; align-self: center; color: white; font: bold 2em "lucida grande", "open sans", sans-serif; } while there's other css involved in this example, the part that really matters for our purposes is the css that styles the "box" element that we'll be animating. that css looks like this: #box { width: 200px; height: 200px; left: 50px; top: 50px; border: 1px solid #7788ff; margin: 0; position: relative; background-color: #2233ff; display: flex; justify-...
Element.attachShadow() - Web APIs
<blockquote> <body> <div> <footer> <h1> <h2> <h3> <h4> <h5> <h6> <header> <main> <nav> <p> <section> <span> syntax var shadowroot = element.attachshadow(shadowrootinit); parameters shadowrootinit a shadowrootinit dictionary, which can contain the following fields: mode a string specifying the encapsulation mode for the shadow dom tree. ...
... // always call super first in constructor super(); // count words in element's parent element var wcparent = this.parentnode; function countwords(node){ var text = node.innertext || node.textcontent return text.trim().split(/\s+/g).length; } var count = 'words: ' + countwords(wcparent); // create a shadow root var shadow = this.attachshadow({mode: 'open'}); // create text node and add word count to it var text = document.createelement('span'); text.textcontent = count; // append it to the shadow root shadow.appendchild(text); // update count when element content changes setinterval(function() { var count = 'words: ' + countwords(wcparent); text.textcontent = count; }, 200) } } // define the new e...
Element: auxclick event - Web APIs
y leftmost—button) has been pressed and released both within the same element. auxclick is fired after the mousedown and mouseup events have been fired, in that order. bubbles yes cancelable yes interface mouseevent event handler property onauxclick preventing default actions for the vast majority of browsers that map middle click to opening a link in a new tab, including firefox, it is possible to cancel this behavior by calling preventdefault() from within an auxclick event handler. when listening for auxclick events originating on elements that do not support input or navigation, you will often want to explicitly prevent other default actions mapped to the down action of the middle mouse button. on windows this is usually auto...
...ting on elements that do not support input or navigation, you will often want to explicitly prevent other default actions mapped to the down action of the middle mouse button. on windows this is usually autoscroll, and on macos and linux this is usually clipboard paste. this can be done by preventing the default behaviour of the mousedown or pointerdown event. additionally, you may need to avoid opening a system context menu after a right click. due to timing differences between operating systems, this too is not a preventable default behavior of auxclick. instead, this can be done by preventing the default behavior of the contextmenu event. examples in this example we define functions for two event handlers — onclick and onauxclick. the former changes the color of the button background, ...
EventTarget.addEventListener() - Web APIs
s usage html <div class="outer"> outer, once & none-once <div class="middle" target="_blank"> middle, capture & none-capture <a class="inner1" href="https://www.mozilla.org" target="_blank"> inner1, passive & preventdefault(which is not allowed) </a> <a class="inner2" href="https://developer.mozilla.org/" target="_blank"> inner2, none-passive & preventdefault(not open new page) </a> </div> </div> css .outer, .middle, .inner1, .inner2 { display: block; width: 520px; padding: 15px; margin: 15px; text-decoration: none; } .outer { border: 1px solid red; color: red; } .middle { border: 1px solid green; color: green; width: 460px; } .inner1, .inner2 { border: 1px solid purple; color: purple; width: 400px; } javascript co...
...oncehandler(event) { alert('outer, none-once, default'); } function capturehandler(event) { //event.stopimmediatepropagation(); alert('middle, capture'); } function nonecapturehandler(event) { alert('middle, none-capture, default'); } function passivehandler(event) { // unable to preventdefault inside passive event listener invocation. event.preventdefault(); alert('inner1, passive, open new page'); } function nonepassivehandler(event) { event.preventdefault(); //event.stoppropagation(); alert('inner2, none-passive, default, not open new page'); } result click the outer, middle, inner containers respectively to see how the options work. before using a particular value in the options object, it's a good idea to ensure that the user's browser supports it, since these ar...
FileSystemEntry - Web APIs
but it also includes a convenient method for obtaining the url of the entry: tourl(). it also introduces a new url scheme: filesystem:. you can use the filesystem: scheme on google chrome to see all the files and folders that are stored in the origin of your app. just use filesystem: scheme for the root directory of the origin of the app. for example, if your app is in http://www.html5rocks.com, open filesystem:http://www.html5rocks.com/temporary/ in a tab. chrome shows a read-only list of all the files and folders stored the origin of your app. example to see an example of how tourl() works, see the method description. the snippet below shows you how you can remove a file by name. // taking care of the browser-specific prefixes. window.requestfilesystem = window.requestfilesystem || wind...
.../temporary/ in a tab. chrome shows a read-only list of all the files and folders stored the origin of your app. example to see an example of how tourl() works, see the method description. the snippet below shows you how you can remove a file by name. // taking care of the browser-specific prefixes. window.requestfilesystem = window.requestfilesystem || window.webkitrequestfilesystem; ... // opening a file system with temporary storage window.requestfilesystem(temporary, 1024*1024 /*1mb*/, function(fs) { fs.root.getfile('log.txt', {}, function(fileentry) { fileentry.remove(function() { console.log('file removed.'); }, onerror); }, onerror); }, onerror); properties this interface provides the following properties. filesystem read only a filesystem object represe...
Using the Geolocation API - Web APIs
ating what type of error has been returned, and a human-readable message that describes what the error code means. you could use it like so: function errorcallback(error) { alert(`error(${error.code}): ${error.message}`); }; examples in the following example the geolocation api is used to retrieve the user's latitude and longitude. if sucessful, the available hyperlink is populated with an openstreetmap.org url that will show their location. body { padding: 20px; background-color:#ffffc9 } button { margin: .5rem 0; } html <button id = "find-me">show my location</button><br/> <p id = "status"></p> <a id = "map-link" target="_blank"></a> javascript function geofindme() { const status = document.queryselector('#status'); const maplink = document.queryselector('#map-lin...
..."_blank"></a> javascript function geofindme() { const status = document.queryselector('#status'); const maplink = document.queryselector('#map-link'); maplink.href = ''; maplink.textcontent = ''; function success(position) { const latitude = position.coords.latitude; const longitude = position.coords.longitude; status.textcontent = ''; maplink.href = `https://www.openstreetmap.org/#map=18/${latitude}/${longitude}`; maplink.textcontent = `latitude: ${latitude} °, longitude: ${longitude} °`; } function error() { status.textcontent = 'unable to retrieve your location'; } if(!navigator.geolocation) { status.textcontent = 'geolocation is not supported by your browser'; } else { status.textcontent = 'locating…'; navigator.geolocat...
Geolocation API - Web APIs
tance, from which all other functionality can be accessed. dictionaries positionoptions represents an object containing options to pass in as a parameter of geolocation.getcurrentposition() and geolocation.watchposition(). examples in the following example the geolocation api is used to retrieve the user's latitude and longitude. if sucessful, the available hyperlink is populated with an openstreetmap.org url that will show their location. body { padding: 20px; background-color:#ffffc9 } button { margin: .5rem 0; } html <button id = "find-me">show my location</button><br/> <p id = "status"></p> <a id = "map-link" target="_blank"></a> javascript function geofindme() { const status = document.queryselector('#status'); const maplink = document.queryselector('#map-lin...
..."_blank"></a> javascript function geofindme() { const status = document.queryselector('#status'); const maplink = document.queryselector('#map-link'); maplink.href = ''; maplink.textcontent = ''; function success(position) { const latitude = position.coords.latitude; const longitude = position.coords.longitude; status.textcontent = ''; maplink.href = `https://www.openstreetmap.org/#map=18/${latitude}/${longitude}`; maplink.textcontent = `latitude: ${latitude} °, longitude: ${longitude} °`; } function error() { status.textcontent = 'unable to retrieve your location'; } if(!navigator.geolocation) { status.textcontent = 'geolocation is not supported by your browser'; } else { status.textcontent = 'locating…'; navigator.geolocat...
GlobalEventHandlers.onanimationcancel - Web APIs
first is the box itself, with all its ...
... width: 300px; border: 1px solid black; font-size: 16px; text-align: center; margin-top: 0; padding-top: 2px; padding-bottom: 4px; color: white; background-color: darkgreen; font: 14px "open sans", "arial", sans-serif; } #text { width: 46px; padding: 10px; position: relative; text-align: center; align-self: center; color: white; font: bold 1.4em "lucida grande", "open sans", sans-serif; } leaving out some bits of the css that don't matter for the discussion here, let's take a look at the styles for the box that we're animating. first is the box itself, with all its properties, including animation, defined. we go ahead and describe the animation in-place here because the animation is intended to begin as soon as the page loads, rather than based on an event.
GlobalEventHandlers.onanimationend - Web APIs
first is the box itself. we set its ...
...first is the box itself. ...
GlobalEventHandlers.onanimationiteration - Web APIs
first is the box itself. we set its si...
...first is the box itself. ...
GlobalEventHandlers.onanimationstart - Web APIs
first is the box itself. we set its ...
...first is the box itself. ...
HTMLElement.hidden - Web APIs
ls by changing their respective values for hidden. the follow-up panel looks like this in html: <div id="awesome" class="panel" hidden> <h1>thanks!</h1> <p>thank you <strong>so</strong> much for agreeing to be awesome today! now get out there and do awesome things awesomely to make the world more awesome!</p> </div> css the content is styled using the css below. ...
...</h1> <p>thank you <strong>so</strong> much for agreeing to be awesome today! now get out there and do awesome things awesomely to make the world more awesome!</p> </div> css the content is styled using the css below. .panel { font: 16px "open sans", helvetica, arial, sans-serif; border: 1px solid #22d; padding: 12px; width: 500px; text-align: center; } .button { font: 22px "open sans", helvetica, arial, sans-serif; padding: 5px 36px; } h1 { margin-top: 0; font-size: 175%; } result specifications specification status comment html living standardthe definition of 'htmlelement.hidden' in that specification. living standard html 5.1the definition of 'htmlelement.hidden' in that specification. recommendation ...
File drag and drop - Web APIs
files property is used to access each file. this example shows how to write the name of each dragged file to the console. in a real application, an application may want to process a file using the file api. note that in this example, any drag item that is not a file is ignored. function drophandler(ev) { console.log('file(s) dropped'); // prevent default behavior (prevent file from being opened) ev.preventdefault(); if (ev.datatransfer.items) { // use datatransferitemlist interface to access the file(s) for (var i = 0; i < ev.datatransfer.items.length; i++) { // if dropped items aren't files, reject them if (ev.datatransfer.items[i].kind === 'file') { var file = ev.datatransfer.items[i].getasfile(); console.log('... file[' + i + '].name = ' + f...
....length; i++) { console.log('... ...
Ajax navigation example - Web APIs
place(rhost, "&").replace(rview, sviewmode ? ...
... ...
IDBCursor.request - Web APIs
Web › API › IDBCursor › request
the request read-only property of the idbcursor interface returns the idbrequest used to obtain the cursor. note: this feature is available in web workers. syntax var request = cursor.request; value an idbrequest object instance. examples when you open a cursor, the request property is then available on that cursor object, to tell you what request object the cursor originated from. ...
...quest object instance. examples when you open a cursor, the request property is then available on that cursor object, to tell you what request object the cursor originated from. ...
IDBCursorSync - Web APIs
e for the record at the cursor's position. setting this attribute can raise an idbdatabaseexception with the following codes: data_err if the underlying object store uses in-line keys and the property at the key path does not match the key in this cursor's position. not_allowed_err if the underlying index or object store does not support updating the record because it is open in the read_only or snapshot_read mode, or if an index record cannot be changed because the underlying index is auto-populated. serial_err if the data being stored could not be serialized by the internal structured cloning algorithm. constants constant value description next 0 this cursor includes duplicates, and its direction is monoto...
...meters key the key to which to move the cursor's position. remove() deletes the record at the cursor's position, without changing the cursor's position void delete ( ) raises (databaseexception); exceptions this method can raise an idbdatabaseexception with the following code: not_allowed_err if the underlying index or object store does not support updating the record because it is open in the read_only or snapshot_read mode. ...
IDBDatabaseException - Web APIs
lowed or at a time when it is not allowed. it also occurs if a request is made on a source object that has been deleted or removed. more specific variants of this error includes: transaction_inactive_err and read_only_err. not_found_err 3 the operation failed because the requested database object could not be found; for example, an object store did not exist but was being opened. quota_err 11 either there's not enough remaining storage space or the storage quota was reached and the user declined to give more space to the database. read_only_err 9 a mutation operation was attempted in a read_only transaction. timeout_err 10 a lock for the transaction could not be obtained in a reasonable time. transaction_inactive_er...
...tained in a reasonable time. transaction_inactive_err 7 a request was made against a transaction that is either not currently active or is already finished. unknown_err 1 the operation failed for reasons unrelated to the database itself, and it is not covered by any other error code--for example, a failure due to disk io errors. ver_err 12 a request to open a database with a version lower than the one it already has. this can only happen with idbopendbrequest. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandr...
IDBIndex.count() - Web APIs
Web › API › IDBIndex › count
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive. dataerror the key or key range provided contains an invalid key. invalidstateerror the idbindex has been deleted or removed. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. we then open a basic cursor on the index using idbindex.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the index, not the primary key. myindex.count() is then used to count the number o...
...demo repo (view the example live.) function displaydatabyindex() { tableentry.innerhtml = ''; var transaction = db.transaction(['contactslist'], 'readonly'); var objectstore = transaction.objectstore('contactslist'); var myindex = objectstore.index('lname'); var countrequest = myindex.count(); countrequest.onsuccess = function() { console.log(countrequest.result); } myindex.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tablerow = document.createelement('tr'); tablerow.innerhtml = '<td>' + cursor.value.id + '</td>' + '<td>' + cursor.value.lname + '</td>' + '<td>' + cursor.value.fname + '</td>' + '<td>' + cursor.value.jtitle...
IDBIndex.get() - Web APIs
Web › API › IDBIndex › get
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive. dataerror the key or key range provided contains an invalid key. invalidstateerror the idbindex has been deleted or removed. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. we then open a basic cursor on the index using idbindex.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the index, not the primary key. myindex.get('bungle') is then used to retrieve the...
...demo repo (view the example live.) function displaydatabyindex() { tableentry.innerhtml = ''; var transaction = db.transaction(['contactslist'], 'readonly'); var objectstore = transaction.objectstore('contactslist'); var myindex = objectstore.index('lname'); var getrequest = myindex.get('bungle'); getrequest.onsuccess = function() { console.log(getrequest.result); } myindex.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tablerow = document.createelement('tr'); tablerow.innerhtml = '<td>' + cursor.value.id + '</td>' + '<td>' + cursor.value.lname + '</td>' + '<td>' + cursor.value.fname + '</td>' + '<td>' + cursor.value.jtitle...
IDBIndex.getKey() - Web APIs
Web › API › IDBIndex › getKey
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive. dataerror the key or key range provided contains an invalid key. invalidstateerror the idbindex has been deleted or removed. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. we then open a basic cursor on the index using idbindex.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the index, not the primary key. myindex.getkey('bungle') is then used to retrieve ...
...iew the example live.) function displaydatabyindex() { tableentry.innerhtml = ''; var transaction = db.transaction(['contactslist'], 'readonly'); var objectstore = transaction.objectstore('contactslist'); var myindex = objectstore.index('lname'); var getkeyrequest = myindex.getkey('bungle'); getkeyrequest.onsuccess = function() { console.log(getkeyrequest.result); } myindex.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tablerow = document.createelement('tr'); tablerow.innerhtml = '<td>' + cursor.value.id + '</td>' + '<td>' + cursor.value.lname + '</td>' + '<td>' + cursor.value.fname + '</td>' + '<td>' + cursor.value.jtitle...
IDBIndex.isAutoLocale - Web APIs
the isautolocale read-only property of the idbindex interface returns a boolean indicating whether the index had a locale value of auto specified upon its creation (see createindex()'s optionalparameters.) syntax var myindex = objectstore.index('index'); console.log(myindex.isautolocale); value a boolean. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. we then open a basic cursor on the index using idbindex.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the index, not the primary key. the isautolocale value is logged to the console. function displaydatabyindex() { tablee...
...eturned records are sorted based on the index, not the primary key. the isautolocale value is logged to the console. ...
IDBIndex.keyPath - Web APIs
Web › API › IDBIndex › keyPath
the keypath property of the idbindex interface returns the key path of the current index. if null, this index is not auto-populated. note: this feature is available in web workers. syntax var mykeypath = myindex.keypath; value any data type that can be used as a key path. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. we then open a basic cursor on the index using idbindex.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the index, not the primary key. the key path of the current index is logged to the console: it should be returned as lname. finally, we iterate through each recor...
...t the data into an html table. ...
IDBIndex.locale - Web APIs
Web › API › IDBIndex › locale
of the index (for example en-us, or pl) if it had a locale value specified upon its creation (see createindex()'s optionalparameters.) note that this property always returns the current locale being used in this index, in other words, it never returns "auto". syntax var myindex = objectstore.index('index'); console.log(myindex.locale); value a domstring. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. we then open a basic cursor on the index using idbindex.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the index, not the primary key. the locale value is logged to the console. functi...
...t that the returned records are sorted based on the index, not the primary key. the locale value is logged to the console. ...
IDBIndex.multiEntry - Web APIs
parameter whose multientry property is set to true/false. note: this feature is available in web workers. syntax var ismultientry = myindex.multientry; value a boolean: value effect true there is one record in the index for each item in an array of keys. false there is one record for each key that is an array. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. we then open a basic cursor on the index using idbindex.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the index, not the primary key. the multi-entry status of the index is logged to t...
...he data into an html table. ...
IDBIndex.name - Web APIs
Web › API › IDBIndex › name
invalidstateerror the index, or its object store, has been deleted; or the current transaction is not an upgrade transaction. you can only rename indexes during upgrade transactions; that is, when the mode is "versionchange". transactioninactiveerror the current transaction is not active. constrainterror an index is already using the specified name. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. we then open a basic cursor on the index using idbindex.opencursor() — this works the same as opening a cursor directly on an idbobjectstore using opencursor() except that the returned records are sorted based on the index, not the primary key. the name of the index is logged to the console: it should ...
...ting the data into an html table. for a complete working example, see our idbindex-example demo repo (view the example live). ...
IDBIndex.objectStore - Web APIs
the objectstore property of the idbindex interface returns the name of the object store referenced by the current index. note: this feature is available in web workers. syntax var myidbobjectstore = myindex.objectstore; value an idbobjectstore. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. we then open a basic cursor on the index using idbindex.opencursor. this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the index, not the primary key. the current object store is logged to the console: it should be returned something like this: idbobjectstore { name: "contactslist", keypath: "id", indexnames: d...
...e data into an html table. ...
IDBIndex.unique - Web APIs
Web › API › IDBIndex › unique
true means that the index will not be able to accept duplicate entries. note: this feature is available in web workers. syntax var isunique = idbindex.unique; value a boolean: value effect true the current index does not allow duplicate values for a key. false the current index allows duplicate key values. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. we then open a basic cursor on the index using idbindex.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the index, not the primary key. the unique status of the index is logged to the co...
...rt the data into an html table. ...
IDBKeyRange.includes() - Web APIs
angevalue.includes('w'); // returns false polyfill the includes() method was added in the second edition of the indexed db specification. for browsers that do not support it, the following polyfill can be used. ...
...lyfill the includes() method was added in the second edition of the indexed db specification. for browsers that do not support it, the following polyfill can be used. idbkeyrange.prototype.includes = idbkeyrange.prototype.includes || function(key) { var r = this, c; if (r.lower !== undefined) { c = indexeddb.cmp(key, r.lower); if (r.loweropen && c <= 0) return false; if (!r.loweropen && c < 0) return false; } if (r.upper !== undefined) { c = indexeddb.cmp(key, r.upper); if (r.upperopen && c >= 0) return false; if (!r.upperopen && c > 0) return false; } return true; }; specification specification status comment indexed database api draftthe definition of 'includes()' in that specification. recommendation indexed d...
IDBKeyRange.lower - Web APIs
Web › API › IDBKeyRange › lower
orkers. syntax var lower = mykeyrange.lower value the lower bound of the key range (can be any type.) example the following example illustrates how you'd use a key range. here we declare keyrangevalue = idbkeyrange.upperbound("f", "w", true, true); — a range that includes everything between "f" and "w" but not including them — since both the upper and lower bounds have been declared as open (true). we open a transaction (using idbtransaction) and an object store, and open a cursor with idbobjectstore.opencursor, declaring keyrangevalue as its optional key range value. after declaring the key range, we log its lower property value to the console, which should appear as "f". note: for a more complete example allowing you to experiment with key range, have a look at our idbkeyrange-...
... a more complete example allowing you to experiment with key range, have a look at our idbkeyrange-example repo (view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.bound("f", "w", true, true); console.log(keyrangevalue.lower); var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); objectstore.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } ...
IDBKeyRange.only() - Web APIs
Web › API › IDBKeyRange › only
key range. exceptions this method may raise a domexception of the following types: exception description dataerror the value parameter passed was not a valid key. example the following example illustrates how you'd use an only key range. here we declare a keyrangevalue = idbkeyrange.only("a"); — a range that only includes the value "a". we open a transaction (using idbtransaction) and an object store, and open a cursor with idbobjectstore.opencursor, declaring keyrangevalue as its optional key range value. this means that the cursor will only retrieve the record with the key value "a". note: for a more complete example allowing you to experiment with key range, have a look at our idbkeyrange repo (view the example live too.) functio...
...l only retrieve the record with the key value "a". ...
IDBKeyRange.upper - Web APIs
Web › API › IDBKeyRange › upper
orkers. syntax var upper = mykeyrange.upper value the upper bound of the key range (can be any type.) example the following example illustrates how you'd use a key range. here we declare keyrangevalue = idbkeyrange.upperbound("f", "w", true, true); — a range that includes everything between "f" and "w" but not including them — since both the upper and lower bounds have been declared as open (true). we open a transaction (using idbtransaction) and an object store, and open a cursor with idbobjectstore.opencursor, declaring keyrangevalue as its optional key range value. after declaring the key range, we log its upper property value to the console, which should appear as "w". note: for a more complete example allowing you to experiment with key range, have a look at our idbkeyrange-...
... a more complete example allowing you to experiment with key range, have a look at our idbkeyrange-example repo (view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.bound("f", "w", true, true); console.log(keyrangevalue.upper); var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); objectstore.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } ...
IDBObjectStore.put() - Web APIs
ue and stores the cloned value in the object store. this is for adding new records, or updating existing records in an object store when the transaction's mode is readwrite. if the record is successfully stored, then a success event is fired on the returned request object with the result set to the key for the stored record, and the transaction set to the transaction in which this object store is opened. the put method is an update or insert method. see the idbobjectstore.add method for an insert only method. bear in mind that if you have a idbcursor to the record you want to update, updating it with idbcursor.update() is preferable to using idbobjectstore.put(). doing so makes it clear that an existing record will be updated, instead of a new record being inserted. note: this feature is a...
...e; when that request is successful the onsuccess function gets the associated record from the idbobjectstore (made available as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store in another request with put(). ...
IDBRequest.error - Web APIs
Web › API › IDBRequest › error
f you try to add a new key that already exists in the record. quotaexceedederror if you run out of disk quota and the user declined to grant you more space. unknownerror if the operation failed for reasons unrelated to the database itself. a failure due to disk io errors is such an example. noerror if the request succeeds. versionerror if you try to open a database with a version lower than the one it already has. in addition to the error codes sent to the idbrequest object, asynchronous operations can also raise exceptions. the list describes problems that could occur when the request is being executed, but you might also encounter other problems when the request is being made. for example, if the the request failed and the result is not ...
...ated record from the idbobjectstore (made available as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store. also included at the bottom is an onerror function that reports what the error was if the request fails. ...
IDBRequest.source - Web APIs
Web › API › IDBRequest › source
note: this feature is available in web workers. syntax var idbindex = request.source; var idbcursor = request.source; var idbobjectstore = request.source; value an object representing the source of the request, such as an idbindex, idbobjectstore or idbcursor. ...
...cess gets the associated record from the idbobjectstore (made available as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store in another request. the source of the 2nd request is logged to the developer console. ...
IDBTransaction.commit() - Web APIs
rom outstanding requests to be dispatched. if it is called on a transaction that is not active, it throws an invalidstateerror domexception. note: this feature is available in web workers. syntax transaction.commit(); parameters none. return value void. exceptions exception description invalidstateerror the transaction state is not active. ...
...e: this feature is available in web workers. syntax transaction.commit(); parameters none. return value void. exceptions exception description invalidstateerror the transaction state is not active. examples // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["mydb"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. duplicate items not allowed.</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("myobjstore"); /...
Browser storage limits and eviction criteria - Web APIs
xt to the profile folder title. note: if you are looking around in your profile at the data stored, you might see a fourth folder: persistent. basically, the persistent folder was renamed to permanent a while ago to keep upgrades/migration simpler. note: users shouldn’t add their own directories or files under <profile>/storage. this will cause storage initialization to fail; for example, open() will fire an error event. storage limits the maximum browser storage space is dynamic — it is based on your hard drive size. the global limit is calculated as 50% of free disk space. in firefox, an internal browser tool called the quota manager keeps track of how much disk space each origin is using up, and deletes data if necessary. so if your hard drive is 500 gb, then the total storage...
...tart clearing out data based on an lru policy — the least recently used origin will be deleted first, then the next one, until the browser is no longer over the limit. we track the "last access time" for each origin using temporary storage. once the global limit for temporary storage is reached (more on the limit later), we try to find all currently unused origins (i.e., ones with no tabs/apps open that are keeping open datastores). these are then sorted according to "last access time." the least recently used origins are then deleted until there's enough space to fulfill the request that triggered this origin eviction. ...
KeyboardEvent: code values - Web APIs
0084 "intlyen" "intlyen" 0x0085 "osleft" "osleft" 0x0086 "osright" "osright" 0x0087 "contextmenu" "contextmenu" 0x0088 "browserstop" "cancel" 0x0089 "again" "" 0x008a "props" "" 0x008b "undo" "undo" 0x008c "select" "" 0x008d "copy" "copy" 0x008e "open" "" 0x008f "paste" "paste" 0x0090 "find" "" 0x0091 "cut" "cut" 0x0092 "help" "help" 0x0093 "unidentified" "" 0x0094 "launchapp2" "" 0x0095, 0x0096 "unidentified" "" 0x0097 "wakeup" "" 0x0098 "launchapp1" "" 0x0099 ~ 0x00a2 "unidentified" "" ...
...numpadcomma" 0x007a "lang1" 0x007b "lang2" 0x007c "intlyen" 0x007d "metaleft" 0x007e "metaright" 0x007f "contextmenu" 0x0080 "browserstop" 0x0081 "again" 0x0082 "props" 0x0083 "undo" 0x0084 "select" 0x0085 "copy" 0x0086 "open" 0x0087 "paste" 0x0088 "find" 0x0089 "cut" 0x008a "help" 0x008b ~ 0x008d "unidentified" 0x008e "sleep" 0x008f "wakeup" 0x0090 "launchapp1" 0x0091 ~ 0x009b "unidentified" 0x009c "browserfavorites" 0x009d "unidentified" 0x009...
MediaDevices.ondevicechange - Web APIs
gin the demonstration.</p> <div id="startbutton" class="button"> start </div> <video id="video" width="160" height="120" autoplay></video><br> <div class="left"> <h2>audio devices:</h2> <ul class="devicelist" id="audiolist"></ul> </div> <div class="right"> <h2>video devices:</h2> <ul class="devicelist" id="videolist"></ul> </div> <div id="log"></div> css content body { font: 14px "open sans", "arial", sans-serif; } video { margin-top: 20px; border: 1px solid black; } .button { cursor: pointer; width: 160px; border: 1px solid black; font-size: 16px; text-align: center; padding-top: 2px; padding-bottom: 4px; color: white; background-color: darkgreen; } h2 { margin-bottom: 4px; } .left { float:left; width: 48%; margin-right: 2% } .right { float...
..., containing the device's name in bold and the direction in parentheses, it's appended to the appropriate list by calling appendchild() on either audiolist or videolist, as appropriate based on the device type. handling device list changes we call updatedevicelist() in two places. the first is in the getusermedia() promise's fulfillment handler, to initially fill out the list when the stream is opened. the second is in the event handler for devicechange: navigator.mediadevices.ondevicechange = function(event) { updatedevicelist(); } with this code in place, each time the user plugs in a camera, microphone, or other media device, or turns one on or off, we call updatedevicelist() to redraw the list of connected devices. result specifications specification status commen...
MediaSource.MediaSource() - Web APIs
...
... ...
MediaSource.activeSourceBuffers - Web APIs
, enabled audio tracks, and shown/hidden text tracks. syntax var myactivesourcebuffers = mediasource.activesourcebuffers; value a sourcebufferlist containing the sourcebuffer objects for each of the active tracks. ...
...acks. syntax var myactivesourcebuffers = mediasource.activesourcebuffers; value a sourcebufferlist containing the sourcebuffer objects for each of the active tracks. ...
MediaSource.addSourceBuffer() - Web APIs
mimetype a domstring specifying the mime type of the sourcebuffer to create and add to the mediasource. return value a sourcebuffer object representing the new source buffer that has been created and added to the media source. exceptions invalidaccesserror the value specified for mimetype is an empty string rather than a valid mime type. invalidstateerror the mediasource is not in the "open" readystate. notsupportederror the specified mimetype isn't supported by the user agent, or is not compatible with the mime types of other sourcebuffer objects that are already included in the media source's sourcebuffers list. quotaexceedederror the user agent can't handle any more sourcebuffer objects, or creating a new sourcebuffer using the given mimetype would result in an unsupported co...
.../ need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource; //console.log(mediasource.readystate); // closed video.src = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); video.play(); ...
MediaSource.endOfStream() - Web APIs
ates playback and signals that a decoding error has occured. this can be used to indicate that a parsing error has occured while fetching media data; maybe the data is corrupt, or is encoded using a codec that the browser doesn't know how to decode. return value undefined exceptions exception explanation invalidstateerror mediasource.readystate is not equal to open, or one or more of the sourcebuffer objects in mediasource.sourcebuffers are being updated (i.e. their sourcebuffer.updating property is true.) example the following snippet is from a simple example written by nick desaulniers (view the full demo live, or download the source for further investigation.) var asseturl = 'frag_bunny.mp4'; // need to be specific for blink regarding codecs // ...
.../ need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource; //console.log(mediasource.readystate); // closed video.src = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); video.play(); ...
MediaSource.readyState - Web APIs
ended: the source is attached to a media element but the stream has been ended via a call to mediasource.endofstream(). syntax var myreadystate = mediasource.readystate; value a domstring. ...
...the following snippet is from a simple example written by nick desaulniers (view the full demo live, or download the source for further investigation.) if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource; //console.log(mediasource.readystate); // closed video.src = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); video.play(); ...
MediaSource.sourceBuffers - Web APIs
diasource interface returns a sourcebufferlist object containing the list of sourcebuffer objects associated with this mediasource. syntax var mysourcebuffers = mediasource.sourcebuffers; value a sourcebufferlist. ...
...bject containing the list of sourcebuffer objects associated with this mediasource. syntax var mysourcebuffers = mediasource.sourcebuffers; value a sourcebufferlist. ...
MediaStreamConstraints.audio - Web APIs
ovide a simple value of true for the audio property. this tells getusermedia() that we require an audio track, but we don't care about any specifics beyond that. ...
...result using a mediatrackconstraints object now let's look at a similar example that uses a set of constraints based on the mediatrackconstraints dictionary: html content <p>click the start button below to begin the demonstration.</p> <div id="startbutton" class="button"> start </div> <audio id="audio" autoplay controls></audio><br> <div id="log"></div> css content body { font: 14px "open sans", "arial", sans-serif; } audio { margin-top: 20px; border: 1px solid black; width: 160px; } .button { cursor: pointer; width: 160px; border: 1px solid black; font-size: 16px; text-align: center; padding-top: 2px; padding-bottom: 4px; color: white; background-color: darkgreen; } javascript content let audioelement = document.getelementbyid("audio"); let logelement ...
MediaStreamConstraints.video - Web APIs
value of true for the video property. this tells getusermedia() that we require a video track, but we don't care about any specifics beyond that. ...
...a mediatrackconstraints object now let's look at a similar example that uses a set of constraints based on the mediatrackconstraints dictionary: html content <p>click the start button below to begin the demonstration.</p> <div id="startbutton" class="button"> start </div> <video id="video" width="160" height="120" autoplay></video><br> <div id="log"></div> css content body { font: 14px "open sans", "arial", sans-serif; } video { margin-top: 20px; border: 1px solid black; } .button { cursor: pointer; width: 160px; border: 1px solid black; font-size: 16px; text-align: center; padding-top: 2px; padding-bottom: 4px; color: white; background-color: darkgreen; } javascript content let videoelement = document.getelementbyid("video"); let logelement = document.getel...
Using Navigation Timing - Web APIs
rtext = loadingtime + " ms"; }, false); this code, executed when the load event occurs, subtracts from the current time the time at which the navigation whose timing was recorded began (performance.timing.navigationstart), and outputs that information to the screen by inserting it into an element. html <div class="output"> </div> css .output { border: 1px solid #bbb; font: 16px "open sans", "helvetica", "arial", sans-serif; } in tandem with appropriate html and css, the result is: the values listed are for the <iframe> in which the sample is presented above. for a list of the available timing values you can look for in performancetiming, see the performancetiming interface's properties section. determining navigation type to put the timing information obtained from pe...
...d, or a shift through the browser's history. we also obtain the number of redirects that were incurred during the navigation from performance.navigation.redirectcount. this information is output to the screen just like the page load time was previously: by inserting it into the element with class "output". html <div class="output"> </div> css .output { border: 1px solid #bbb; font: 16px "open sans", "helvetica", "arial", sans-serif; } with this code in place, the result looks like this: the values listed are for the <iframe> in which the sample is presented. ...
msSaveBlob - Web APIs
the navigator.mssaveblob() method saves the file or blob to disk. this method behaves in the same way as navigator.mssaveoropenblob() except that this disables the file open option. syntax navigator.mssaveblob(blob, defaultname); parameters blob a blob to be saved. defaultname the file name to be used when saving file. return value true is returned as long as the download notification bar is displayed, or false if a failure occured. ...
... blob a blob to be saved. defaultname the file name to be used when saving file. return value true is returned as long as the download notification bar is displayed, or false if a failure occured. notes when a site calls this method, the behavior is the same as when windows internet explorer downloads a file with the following in the header, where x-download-options removes the file open button from the browser file download dialog: content-length: <blob.size> content-type: <blob.type> content-disposition: attachment;filename=<defaultname> x-download-options: noopen specifications not part of any specifications. ...
Navigator.registerProtocolHandler() - Web APIs
syntax navigator.registerprotocolhandler(scheme, url, title); note: recently updated to navigator.registerprotocolhandler(scheme, url), but no browsers currently support this version. parameters scheme a string containing the protocol the site wishes to handle. for example, you can register to handle sms text message links by passing the "sms" scheme. url a string containing the url of the handler. ...
... scheme may be registered as long as: the custom scheme's name begins with web+ the custom scheme's name includes at least 1 letter after the web+ prefix the custom scheme has only lowercase ascii letters in its name. for example, web+burger, as shown in the example below. ...
Notification.onclick - Web APIs
receive click events. these events occur when the user clicks on a displayed notification. syntax notification.onclick = function(event) { ... }; the default behavior is to move the focus to the viewport of the notification's related browsing context. if you don't want that behaviour, call preventdefault() on the event object. ...
...ext. if you don't want that behaviour, call preventdefault() on the event object. examples in the following example, we use an onclick handler to open a webpage in a new tab (specified by the inclusion of the '_blank' parameter) once a notification is clicked: notification.onclick = function(event) { event.preventdefault(); // prevent the browser from focusing the notification's tab window.open('http://www.mozilla.org', '_blank'); } specifications specification status comment notifications apithe definition of 'onclick' in that specification. living standard living standard. ...
NotificationAction - Web APIs
onaction.icon read only the url of the image used to represent the notification when there is not enough space to display the notification itself. example notifications can fire notificationclick events on the serviceworkerglobalscope. here a service worker shows a notification with a single "archive" action, allowing users to perform this common task from the notification without having to open the website. the user can also click the main body of the notification to open their inbox instead. self.registration.shownotification("new mail from alice", { actions: [ { action: 'archive', title: 'archive' } ] }); self.addeventlistener('notificationclick', function(event) { event.notification.close(); if (event.action === 'archive') { // archive action was cli...
...nstead. ...
performance.now() - Web APIs
Web › API › Performance › now
` enabled performance.now(); // 8865400 // 8866200 // 8866700 // ... in firefox, you can also enable privacy.resistfingerprinting — this changes the precision to 100ms or the value of privacy.resistfingerprinting.reducetimerprecision.microseconds, whichever is larger. ...
... in firefox, you can also enable privacy.resistfingerprinting — this changes the precision to 100ms or the value of privacy.resistfingerprinting.reducetimerprecision.microseconds, whichever is larger. starting with firefox 79, high resolution timers can be used if you cross-origin isolate your document using the cross-origin-opener-policy and cross-origin-embedder-policy headers: cross-origin-opener-policy: same-origin cross-origin-embedder-policy: require-corp these headers ensure a top-level document does not share a browsing context group with cross-origin documents. coop process-isolates your document and potential attackers can't access to your global object if they were opening it in a popup, preventing a set of cross-origin attacks dubbed xs-leaks. specifications specif...
PushEvent.data - Web APIs
Web › API › PushEvent › data
working draft initial definition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to con...
... working draft initial definition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please ...
PushEvent - Web APIs
Web › API › PushEvent
working draft initial definition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like t...
... working draft initial definition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, pl...
RTCDataChannelEvent - Web APIs
the rtcdatachannelevent() constructor returns a new rtcdatachannelevent object, which represents a datachannel event. these events sent to an rtcpeerconnection when its remote peer is asking to open an rtcdatachannel between the two peers. you will rarely if ever construct an rtcdatachannelevent by hand; instead, the webrtc layer will generate and deliver them to you at the appropriate time. just listen for the datachannel event to be received by the rtcpeerconnection and when you receive it, use the rtcdatachannelevent.channel property to gain access to the data channel which has been opened. constructorrtcdatachannelevent() the rtcdatachannelevent() constructor creates a new rtcdatachannelevent.propertiesalso inherits properties from: eventchannel read only the read-only property rtc...
...s example, the datachannel event handler is set up to save the data channel reference and set up handlers for the events which need to be monitored. the channel property provides the rtcdatachannel representing the connection to the other peer. pc.ondatachannel = function(event) { inbounddatachannel = event.channel; inbounddatachannel.onmessage = handleincomingmessage; inbounddatachannel.onopen = handlechannelopen; inbounddatachannel.onclose = handlechannelclose; } see a simple rtcdatachannel sample for another, more complete, example of how to use data channels. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdatachannelevent' in that specification. candidate recommendation initial...
RTCIceCandidate.tcpType - Web APIs
ptype field's value is set when the rtcicecandidate() constructor is used. you can't directly set its value; instead, its value is automatically extracted from the candidate a-line, if it's formatted properly. syntax var tcptype = rtcicecandidate.tcptype; value a domstring whose value is one of those defined by the rtcicetcpcandidatetype enumerated type. "active" the transport will try to open an outbound connection but won't receive inoming connection requests. "passive" the transport will receive incoming connection requests but won't try to open an outbound connection. "so" the transport will try to open a connection simultaneously with its peer. tcptype is null for udp candidates. example in this example, the candidate's protocol and tcptype are used to adjust the user inte...
... but won't receive inoming connection requests. "passive" the transport will receive incoming connection requests but won't try to open an outbound connection. "so" the transport will try to open a connection simultaneously with its peer. tcptype is null for udp candidates. example in this example, the candidate's protocol and tcptype are used to adjust the user interface for simultaneous-open tcp candidates. if (candidate.protocol == "tcp" && candidate.tcptype == "so") { adjustforsimultaneousopen(candidate); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecandidate.tcptype' in that specification. candidate recommendation initial definition. ...
RTCPeerConnection.addTrack() - Web APIs
th an audio track and a video track, you don't need to deal with managing what track is in what stream, so you might as well just let the transceiver handle it for you. here's an example showing a function that uses getusermedia() to obtain a stream from a user's camera and microphone, then adds each track from the stream to the peer connection, without specifying a stream for each track: async opencall(pc) { const gumstream = await navigator.mediadevices.getusermedia( {video: true, audio: true}); for (const track of gumstream.gettracks()) { pc.addtrack(track); } } the result is a set of tracks being sent to the remote peer, with no stream associations. the handler for the track event on the remote peer will be responsible for determining what stream to a...
... streams for you, the streams' track associations are automatically managed for you by the webrtc infrastructure. this includes things like changes to the transceiver's direction and tracks being halted using removetrack(). ...
RTCPeerConnection: datachannel event - Web APIs
ty ondatachannel examples this example sets up a function that handles datachannel events by gathering the information needed to communicate with the newly added rtcdatachannel and by adding event handlers for the events that occur on that channel. pc.addeventlistener("datachannel", ev => { receivechannel = ev.channel; receivechannel.onmessage = myhandlemessage; receivechannel.onopen = myhandleopen; receivechannel.onclose = myhandleclose; }, false); receivechannel is set to the value of the event's channel property, which specifies the rtcdatachannel object representing the data channel linking the remote peer to the local one. this same code can also instead use the rtcpeerconnection interface's ondatachannel event handler property, like this: pc.ondatachannel = ev => ...
...he value of the event's channel property, which specifies the rtcdatachannel object representing the data channel linking the remote peer to the local one. this same code can also instead use the rtcpeerconnection interface's ondatachannel event handler property, like this: pc.ondatachannel = ev => { receivechannel = ev.channel; receivechannel.onmessage = myhandlemessage; receivechannel.onopen = myhandleopen; receivechannel.onclose = myhandleclose; } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'datachannel' in that specification. candidate recommendation basic definition. ...
RTCPeerConnection.ondatachannel - Web APIs
cpeerconnection.ondatachannel property is an eventhandler which specifies a function which is called when the datachannel event occurs on an rtcpeerconnection. this event, of type rtcdatachannelevent, is sent when an rtcdatachannel is added to the connection by the remote peer calling createdatachannel(). at the time this event is received, the rtcdatachannel it indicates may not yet actually be open. be sure to wait for the "open" event to be fired on the new rtcdatachannel before using it. syntax rtcpeerconnection.ondatachannel = function; value set this property to be a function you provide which receives as input a single parameter: an rtcdatachannelevent which provides in its channel property the rtcdatachannel which has been created. example pc.ondatachannel = function(ev) { co...
...the new rtcdatachannel before using it. syntax rtcpeerconnection.ondatachannel = function; value set this property to be a function you provide which receives as input a single parameter: an rtcdatachannelevent which provides in its channel property the rtcdatachannel which has been created. example pc.ondatachannel = function(ev) { console.log('data channel is created!'); ev.channel.onopen = function() { console.log('data channel is open and ready to be used.'); }; }; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.ondatachannel' in that specification. candidate recommendation initial specification. ...
ServiceWorkerGlobalScope: notificationclick event - Web APIs
cancelable no interface notificationevent event handler onnotificationclick examples you can use the notificationclick event in an addeventlistener method: self.addeventlistener('notificationclick', function(event) { console.log('on notification click: ', event.notification.tag); event.notification.close(); // this looks to see if the current is already open and // focuses if it is event.waituntil(clients.matchall({ type: "window" }).then(function(clientlist) { for (var i = 0; i < clientlist.length; i++) { var client = clientlist[i]; if (client.url == '/' && 'focus' in client) return client.focus(); } if (clients.openwindow) return clients.openwindow('/'); })); }); or use the onnotificationclick eve...
...ent.url == '/' && 'focus' in client) return client.focus(); } if (clients.openwindow) return clients.openwindow('/'); })); }); or use the onnotificationclick event handler property: self.onnotificationclick = function(event) { console.log('on notification click: ', event.notification.tag); event.notification.close(); // this looks to see if the current is already open and // focuses if it is event.waituntil(clients.matchall({ type: "window" }).then(function(clientlist) { for (var i = 0; i < clientlist.length; i++) { var client = clientlist[i]; if (client.url == '/' && 'focus' in client) return client.focus(); } if (clients.openwindow) return clients.openwindow('/'); })); }; specifications specificati...
ServiceWorkerGlobalScope.onpush - Web APIs
working draft initial definition. this event is specified in the push api, but accessed through serviceworkerglobalscope. ...
... working draft initial definition. this event is specified in the push api, but accessed through serviceworkerglobalscope. ...
ShadowRoot.mode - Web APIs
Web › API › ShadowRoot › mode
the mode property of the shadowroot specifies its mode — either open or closed. this defines whether or not the shadow root's internal features are accessible from javascript. when the mode of a shadow root is "closed", the shadow root’s implementation internals are inaccessible and unchangeable from javascript—in the same way the implementation internals of, for example, the <video> element are inaccessible and unchangeable from javascript. syntax var mode = shadowroot.mode value a value defined in the shadowrootmode enum — either open or closed. ...
...way the implementation internals of, for example, the <video> element are inaccessible and unchangeable from javascript. syntax var mode = shadowroot.mode value a value defined in the shadowrootmode enum — either open or closed. examples let customelem = document.queryselector('my-shadow-dom-element'); let shadow = customelem.shadowroot; // another way to check whether the shadow root is open; it will return null if not if(shadow) { // if it is open, close it to stop people stealing our secrets! shadow.mode = 'closed'; } specifications specification status comment domthe definition of 'shadowroot.mode' in that specification. living standard ...
SourceBuffer.abort() - Web APIs
the abort() method of the sourcebuffer interface aborts the current segment and resets the segment parser. syntax sourcebuffer.abort(); parameters none. return value undefined. exceptions exception explanation invalidstateerror the mediasource.readystate property of the parent media source is not equal to open, or this sourcebuffer has been removed from the mediasource. example the spec description of abort() is somewhat confusing — consider for example step 1 of reset parser state. the mse api is fully asynchronous, but this step seems to suggest a synchronous (blocking) operation, which doesn't make sense. saying that, current implementations can be useful in certain situations, when you want to stop the current append (or whatever) operati...
...quested segment that relates to the current new position of the video. you can see something similar in action in nick desaulnier's bufferwhenneeded demo — in line 48, an event listener is added to the playing video so a function called seek() is run when the seeking event fires. in lines 92-101, the seek() function is defined — note that abort() is called if mediasource.readystate is set to open, which means that it is ready to receive new source buffers — at this point it is worth aborting the current segment and just getting the one for the new seek position (see checkbuffer() and getcurrentsegment().) specifications specification status comment media source extensionsthe definition of 'abort()' in that specification. recommendation initial definition.
SourceBuffer.changeType() - Web APIs
...
...uffer() or remove() is still being processed. notsupportederror the specified mime type is not supported, or is not supported with the types of sourcebuffer objects present in the mediasource.sourcebuffers list. usage notes if the parent mediasource is in its "ended" readystate, calling changetype() will transition the media source to the "open" readystate and fire a simple event named sourceopen at the parent media source. ...
SourceBuffer - Web APIs
need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource(); //console.log(mediasource.readystate); // closed video.src = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); video.play(); ...
... recommendation initial definition. ...
URLSearchParams.set() - Web APIs
ate a url and set some search parameters. you can copy and paste the example in a code environment like codepen, jsfiddle, or the multi-line javascript interpreter in firefox. line #41: comment out this line to stop dumping the search parameters to the console (debug). line #43: dumps the generated object and it's string representation to the console (info). line #44: tries to automatically open a new window/tab with the generated url (when uncommented). 'use strict' function genurl(rexp, atext, bdebug=false){ let theurl theurl= new url('https://regexr.com') theurl.searchparams.set( 'expression', rexp.tostring() ) theurl.searchparams.set( 'tool', 'replace' ) theurl.searchparams.set( 'input', '\u2911\u20dc' )// ⤑⃜ theurl.searchparams.set( 'text', atext.join('\n') ) if( bdeb...
... living standard initial definition. ...
WEBGL_draw_buffers.drawBuffersWEBGL() - Web APIs
...
... ...
WebGL2RenderingContext.beginTransformFeedback() - Web APIs
...
... ...
WebGL2RenderingContext.clearBuffer[fiuv]() - Web APIs
...
... ...
WebGL2RenderingContext.copyBufferSubData() - Web APIs
...
... ...
WebGL2RenderingContext.endTransformFeedback() - Web APIs
...
... ...
WebGL2RenderingContext.getUniformBlockIndex() - Web APIs
...
... ...
WebGL2RenderingContext.texImage3D() - Web APIs
...
... ...
WebGL2RenderingContext.texStorage2D() - Web APIs
ng the number of texture levels. internalformat a glenum specifying the texture store format. possible values: gl.r8 gl.r16f gl.r32f gl.r8ui gl.rg8 gl.rg16f gl.rg32f gl.rg8ui gl.rgb8 gl.srgb8 gl.rgb565 gl.r11f_g11f_b10f gl.rgb9_e5 gl.rgb16f gl.rgb32f gl.rgb8ui gl.rgba8 gl.srgb8_aplha8 gl.rgb5_a1 gl.rgba4 gl.rgba16f gl.rgba32f gl.rgba8ui unlike opengl 3.0, webgl 2 doesn't support the following etc2 and eac compressed texture formats (see section 5.37 in the webgl 2 spec). you might be able to enable them via the webgl_compressed_texture_etc extension, though. gl.compressed_r11_eac gl.compressed_signed_r11_eac gl.compressed_rg11_eac gl.compressed_signed_rg11_eac gl.compressed_rgb8_etc2 gl.compressed_rgba8_etc2_eac gl.compress...
... width a glsizei specifying the width of the texture. height a glsizei specifying the height of the texture. return value none. examples gl.texstorage2d(gl.texture_2d, 1, gl.rgb8, 256, 256); specifications specification status comment webgl 2.0the definition of 'texstorage2d' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'gltexstorage2d' in that specification. standard man page of the (similar) opengl es 3.0 api. ...
WebGL2RenderingContext.transformFeedbackVaryings() - Web APIs
...
... ...
WebGL2RenderingContext.vertexAttribIPointer() - Web APIs
...
... ...
WebGLRenderingContext.attachShader() - Web APIs
...
...gram, gl.link_status) ) { var info = gl.getprograminfolog(program); throw 'could not compile webgl program. \n\n' + info; } specifications specification status comment webgl 1.0the definition of 'attachshader' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glattachshader' in that specification. standard opengl man page. ...
WebGLRenderingContext.bindBuffer() - Web APIs
to check the current buffer bindings, query the array_buffer_binding and element_array_buffer_binding constants. gl.getparameter(gl.array_buffer_binding); gl.getparameter(gl.element_array_buffer_binding); specifications specification status comment webgl 1.0the definition of 'bindbuffer' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glbindbuffer' in that specification. standard man page of the (similar) opengl es 2 api. webgl 2.0the definition of 'bindbuffer' in that specification. editor's draft updated definition for webgl 2. adds new target buffers: gl.copy_read_buffer, gl.copy_write_buffer, gl.transform_feedback_buffer, gl.uniform_buffer, ...
.... standard man page of the (similar) opengl es 2 api. webgl 2.0the definition of 'bindbuffer' in that specification. editor's draft updated definition for webgl 2. adds new target buffers: gl.copy_read_buffer, gl.copy_write_buffer, gl.transform_feedback_buffer, gl.uniform_buffer, gl.pixel_pack_buffer, gl.pixel_unpack_buffer opengl es 3.0the definition of 'glbindbuffer' in that specification. standard man page of the (similar) opengl es 3 api. ...
WebGLRenderingContext.bindFramebuffer() - Web APIs
l.bindframebuffer(gl.framebuffer, framebuffer); getting current bindings to check the current frame buffer binding, query the framebuffer_binding constant. gl.getparameter(gl.framebuffer_binding); specifications specification status comment webgl 1.0the definition of 'bindframebuffer' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glbindframebuffer' in that specification. standard man page of the opengl api. webgl 2.0the definition of 'bindframebuffer' in that specification. editor's draft updated definition for webgl 2. adds: gl.draw_framebuffer and gl.read_framebuffer opengl es 3.0the definition of 'glbindframebuffer' in that specification. standard man p...
...on of 'glbindframebuffer' in that specification. standard man page of the opengl api. webgl 2.0the definition of 'bindframebuffer' in that specification. editor's draft updated definition for webgl 2. adds: gl.draw_framebuffer and gl.read_framebuffer opengl es 3.0the definition of 'glbindframebuffer' in that specification. standard man page of the (similar) opengl es 3 api. ...
WebGLRenderingContext.bindRenderbuffer() - Web APIs
...
...nderbuffer binding, query the renderbuffer_binding constant. gl.getparameter(gl.renderbuffer_binding); specifications specification status comment webgl 1.0the definition of 'bindrenderbuffer' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glbindrenderbuffer' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.bindTexture() - Web APIs
l.texture_2d, texture); getting current bindings to check the current texture binding, query the gl.texture_binding_2d or gl.texture_binding_cube_map constants. gl.getparameter(gl.texture_binding_2d); specifications specification status comment webgl 1.0the definition of 'bindtexture' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glbindtexture' in that specification. standard man page of the (similar) opengl es 2.0 api. webgl 2.0the definition of 'bindtexture' in that specification. editor's draft updated definition for webgl 2. adds: gl.texture_3d and gl.texture_2d_array opengl es 3.0the definition of 'glbindtexture' in that specification. standard man pa...
...ion of 'glbindtexture' in that specification. standard man page of the (similar) opengl es 2.0 api. webgl 2.0the definition of 'bindtexture' in that specification. editor's draft updated definition for webgl 2. adds: gl.texture_3d and gl.texture_2d_array opengl es 3.0the definition of 'glbindtexture' in that specification. standard man page of the (similar) opengl es 3.0 api. ...
WebGLRenderingContext.blendColor() - Web APIs
...
...e blend_color constant which returns a float32array. gl.getparameter(gl.blend_color); // float32array[0, 0.5, 1, 1] specifications specification status comment webgl 1.0the definition of 'blendcolor' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glblendcolor' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.blendFunc() - Web APIs
...
... comment webgl 1.0the definition of 'blendfunc' in that specification. recommendation initial definition. in webgl, constant color and constant alpha cannot be used together as source and destination factors in the blend function. see section 6.13. of the specification. opengl es 2.0the definition of 'glblendfunc' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.blendFuncSeparate() - Web APIs
...
... comment webgl 1.0the definition of 'blendfunc' in that specification. recommendation initial definition. in webgl, constant color and constant alpha cannot be used together as source and destination factors in the blend function. see section 6.13. of the specification. opengl es 2.0the definition of 'glblendfunc' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.checkFramebufferStatus() - Web APIs
examples var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var framebuffer = gl.createframebuffer(); // ... gl.checkframebufferstatus(gl.framebuffer); specifications specification status comment webgl 1.0the definition of 'checkframebufferstatus' in that specification. recommendation initial definition for webgl. ...
...fer = gl.createframebuffer(); // ... gl.checkframebufferstatus(gl.framebuffer); specifications specification status comment webgl 1.0the definition of 'checkframebufferstatus' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glcheckframebufferstatus' in that specification. standard man page of the opengl api. webgl 2.0the definition of 'checkframebufferstatus' in that specification. editor's draft updated definition for webgl 2. opengl es 3.0the definition of 'glcheckframebufferstatus' in that specification. standard man page of the (similar) opengl es 3 api. ...
WebGLRenderingContext.clearColor() - Web APIs
...
...alue constant which returns a float32array. gl.getparameter(gl.color_clear_value); // float32array[1, 0.5, 0.5, 1] specifications specification status comment webgl 1.0the definition of 'clearcolor' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glclearcolor' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.compressedTexImage[23]D() - Web APIs
...
...linear); gl.texparameteri(gl.texture_2d, gl.texture_min_filter, gl.linear); specifications specification status comment webgl 1.0the definition of 'compressedteximage2d' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glcompressedteximage2d' in that specification. standard man page of the (similar) opengl es 2.0 api. opengl es 3.0the definition of 'glcompressedteximage2d' in that specification. standard man page of the (similar) opengl es 3.0 api. ...
WebGLRenderingContext.compressedTexSubImage2D() - Web APIs
...
... 256, 256, 512, 512, ext.compressed_rgba_s3tc_dxt5_ext, texturedata); specifications specification status comment webgl 1.0the definition of 'compressedtexsubimage2d' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glcompressedtexsubimage2d' in that specification. standard man page of the (similar) opengl es 2.0 api. opengl es 3.0the definition of 'glcompressedtexsubimage2d' in that specification. standard man page of the (similar) opengl es 3.0 api. ...
WebGLRenderingContext.deleteRenderbuffer() - Web APIs
...
...var renderbuffer = gl.createrenderbuffer(); // ... gl.deleterenderbuffer(renderbuffer); specifications specification status comment webgl 1.0the definition of 'deleterenderbuffer' in that specification. recommendation initial definition. opengl es 2.0the definition of 'gldeleterenderbuffers' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.disableVertexAttribArray() - Web APIs
...
... attribute to disable. return value none. examples gl.disablevertexattribarray(0); specifications specification status comment webgl 1.0the definition of 'disablevertexattribarray' in that specification. recommendation initial definition. opengl es 2.0the definition of 'gldisablevertexattribarray' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.enableVertexAttribArray() - Web APIs
...
... one by one into the vertex shader, we're ready to draw the shape by calling drawarrays(). specifications specification status comment webgl 1.0the definition of 'enablevertexattribarray' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glenablevertexattribarray' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.finish() - Web APIs
...
...ution until all previously called commands are finished. syntax void gl.finish(); parameters none. return value none. specifications specification status comment webgl 1.0the definition of 'finish' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glfinish' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.flush() - Web APIs
...
...causing all commands to be executed as quickly as possible. syntax void gl.flush(); parameters none. return value none. specifications specification status comment webgl 1.0the definition of 'flush' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glflush' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.getActiveAttrib() - Web APIs
...
... ...
WebGLRenderingContext.getActiveUniform() - Web APIs
...
... ...
WebGLRenderingContext.getAttachedShaders() - Web APIs
...
... ...
WebGLRenderingContext.getBufferParameter() - Web APIs
return value depends on the requested information (as specified with pname). either a glint or a glenum. examples gl.getbufferparameter(gl.array_buffer, gl.buffer_size); specifications specification status comment webgl 1.0the definition of 'getbufferparameter' in that specification. recommendation initial definition for webgl. ...
... a glenum. examples gl.getbufferparameter(gl.array_buffer, gl.buffer_size); specifications specification status comment webgl 1.0the definition of 'getbufferparameter' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glgetbufferparameteriv' in that specification. standard man page of the (similar) opengl es 2 api. webgl 2.0the definition of 'getbufferparameter' in that specification. editor's draft updated definition for webgl. opengl es 3.0the definition of 'glgetbufferparameter' in that specification. standard man page of the (similar) opengl es 3 api. adds new target buffers: gl.copy_read_buffer, gl.copy_write_buffer, gl.transform_feedback_b...
WebGLRenderingContext.getFramebufferAttachmentParameter() - Web APIs
attachment points. examples gl.getframebufferattachmentparameter(gl.framebuffer, gl.color_attachment0, gl.framebuffer_attachment_object_type); specifications specification status comment webgl 1.0the definition of 'getframebufferattachmentparameter' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glgetframebufferattachmentparameteriv' in that specification. standard man page of the (similar) opengl api. webgl 2.0the definition of 'getframebufferattachmentparameter' in that specification. editor's draft updated definition for webgl 2. opengl es 3.0the definition of 'glgetframebufferattachmentparameteriv' in that specification. sta...
...amebufferattachmentparameteriv' in that specification. standard man page of the (similar) opengl api. webgl 2.0the definition of 'getframebufferattachmentparameter' in that specification. editor's draft updated definition for webgl 2. opengl es 3.0the definition of 'glgetframebufferattachmentparameteriv' in that specification. standard man page of the (similar) opengl es 3 api. ...
WebGLRenderingContext.getParameter() - Web APIs
...
... specification status comment webgl 1.0the definition of 'getparameter' in that specification. recommendation initial definition. webgl 2.0the definition of 'getparameter' in that specification. editor's draft adds additional parameter names. opengl es 2.0the definition of 'glget' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.getProgramInfoLog() - Web APIs
...
... ...
WebGLRenderingContext.getRenderbufferParameter() - Web APIs
return value depends on the requested information (as specified with pname). either a glint or a glenum. examples gl.getrenderbufferparameter(gl.renderbuffer, gl.renderbuffer_width); specifications specification status comment webgl 1.0the definition of 'getrenderbufferparameter' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glgetrenderbufferparameteriv' in that specification. standard man page of the (similar) opengl api. webgl 2.0the definition of 'getrenderbufferparameter' in that specification. editor's draft updated definition for webgl 2. opengl es 3.0the definition of 'glgetrenderbufferparameteriv' in that specification. standard man page of the (s...
...0the definition of 'glgetrenderbufferparameteriv' in that specification. standard man page of the (similar) opengl api. webgl 2.0the definition of 'getrenderbufferparameter' in that specification. editor's draft updated definition for webgl 2. opengl es 3.0the definition of 'glgetrenderbufferparameteriv' in that specification. standard man page of the (similar) opengl es 3 api. adds a new pname value: gl.renderbuffer_samples ...
WebGLRenderingContext.getShaderPrecisionFormat() - Web APIs
...
... ...
WebGLRenderingContext.getTexParameter() - Web APIs
return value returns the requested texture information (as specified with pname). if an error occurs, null is returned. examples gl.gettexparameter(gl.texture_2d, gl.texture_mag_filter); specifications specification status comment webgl 1.0the definition of 'gettexparameter' in that specification. recommendation initial definition for webgl. ...
...ull is returned. examples gl.gettexparameter(gl.texture_2d, gl.texture_mag_filter); specifications specification status comment webgl 1.0the definition of 'gettexparameter' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glgettexparameter' in that specification. standard man page of the (similar) opengl es 2.0 api. webgl 2.0the definition of 'gettexparameter' in that specification. editor's draft updated definition for webgl. opengl es 3.0the definition of 'glgettexparameter' in that specification. standard man page of the (similar) opengl es 3.0 api. ...
WebGLRenderingContext.linkProgram() - Web APIs
...
...{ var info = gl.getprograminfolog(program); throw new error('could not compile webgl program. \n\n' + info); } specifications specification status comment webgl 1.0the definition of 'linkprogram' in that specification. recommendation initial definition. opengl es 2.0the definition of 'gllinkprogram' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.readPixels() - Web APIs
...
... ...
WebGLRenderingContext.renderbufferStorage() - Web APIs
of the renderbuffer in pixels. height a glsizei specifying the height of the renderbuffer in pixels. return value none. examples gl.renderbufferstorage(gl.renderbuffer, gl.rgba4, 256, 256); specifications specification status comment webgl 1.0the definition of 'renderbufferstorage' in that specification. recommendation initial definition for webgl. ...
...rn value none. examples gl.renderbufferstorage(gl.renderbuffer, gl.rgba4, 256, 256); specifications specification status comment webgl 1.0the definition of 'renderbufferstorage' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glrenderbufferstorage' in that specification. standard man page of the opengl es 2 api. webgl 2.0the definition of 'getrenderbufferparameter' in that specification. editor's draft updated definition for webgl 2. opengl es 3.0the definition of 'glrenderbufferstorage' in that specification. standard man page of the (similar) opengl es 3 api. adds many new internal formats. ...
WebGLRenderingContext.scissor() - Web APIs
...
...t which returns an int32array. gl.scissor(0, 0, 200, 200); gl.getparameter(gl.scissor_box); // int32array[0, 0, 200, 200] specifications specification status comment webgl 1.0the definition of 'scissor' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glscissor' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.stencilFunc() - Web APIs
...
... ...
WebGLRenderingContext.stencilFuncSeparate() - Web APIs
...
... ...
WebGLRenderingContext.stencilOp() - Web APIs
...
... ...
WebGLRenderingContext.stencilOpSeparate() - Web APIs
...
... ...
WebGLRenderingContext.validateProgram() - Web APIs
...
...ograminfolog(program); throw 'could not compile webgl program. \n\n' + info; } gl.useprogram(program); specifications specification status comment webgl 1.0the definition of 'validateprogram' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glvalidateprogram' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.vertexAttrib[1234]f[v]() - Web APIs
...
... ...
WebGLRenderingContext.vertexAttribPointer() - Web APIs
...
... ...
Adding 2D content to a WebGL context - Web APIs
in this example, we're still drawing in 3d space. it's just we're drawing a square and we're putting it directly in front of the camera perpendicular to the view direction. we need to define the shaders that will create the color for our simple scene as well as draw our object. these will establish how the square plane appears on the screen. the shaders a shader is a program, written using the opengl es shading language (glsl), that takes information about the vertices that make up a shape and generates the data needed to render the pixels onto the screen: namely, the positions of the pixels and their colors. there are two shader functions run when drawing webgl content: the vertex shader and the fragment shader. you write these in glsl and pass the text of the code into webgl to be compil...
...mera to be rendered. then we establish the position of the square plane by loading the identity position and translating away from the camera by 6 units. after that, we bind the square's vertex buffer to the attribute the shader is using for avertexposition and we tell webgl how to pull the data out of it. finally we draw the object by calling the drawarrays() method. view the complete code | open this demo on a new page matrix utility operations matrix operations might seem complicated but they are actually pretty simple if you take them one step at a time. generally people use a matrix library rather than writing their own. in our case we're using the popular glmatrix library. see also matrices on webglfundamentals matrices on wolfram mathworld matrix on wikipedia « previ...
Getting started with WebGL - Web APIs
webgl programs consist of control code written in javascript and shader code (glsl) that is executed on a computer's graphics processing unit (gpu). webgl elements can be mixed with other html elements and composited with other parts of the page or page background. this article will introduce you to the basics of using webgl. it's assumed that you already have an understanding of the mathematics involved in 3d graphics, and this article doesn't pretend to try to teach you 3d graphics concepts itself. ...
...lly initialized, the variable gl is our reference to it. in this case, we set the clear color to black, and clear the context to that color (redrawing the canvas with the background color). at this point, you have enough code that the webgl context should successfully initialize, and you should wind up with a big black, empty box, ready and waiting to receive content. view the complete code | open this demo on a new page ...
Introduction to WebRTC protocols - Web APIs
this article introduces the protocols on top of which the webrtc api is built. ice interactive connectivity establishment (ice) is a framework to allow your web browser to connect with peers. there are many reasons why a straight up connection from peer a to peer b simply won’t work. it needs to bypass firewalls that would prevent opening connections, give you a unique address if like most situations your device doesn’t have a public ip address, and relay data through a server if your router doesn’t allow you to directly connect with peers. ice uses stun and/or turn servers to accomplish this, as described below. stun session traversal utilities for nat (stun) (acronym within an acronym) is a protocol to discover your public address and determine any restrictions in your r...
...ave the public ip address found by the stun server, not anyone can create a connection. in this situation we need to turn to turn. turn some routers using nat employ a restriction called ‘symmetric nat’. this means the router will only accept connections from peers you’ve previously connected to. traversal using relays around nat (turn) is meant to bypass the symmetric nat restriction by opening a connection with a turn server and relaying all information through that server. you would create a connection with a turn server and tell all peers to send packets to the server which will then be forwarded to you. this obviously comes with some overhead so it is only used if there are no other alternatives. sdp session description protocol (sdp) is a standard for describing the multimed...
Lifetime of a WebRTC session - Web APIs
ignaling channel. it’s also worth noting that the channel for performing signaling doesn’t even need to be over the network. one peer can output a data object that can be printed out, physically carried (on foot or by carrier pigeon) to another device, entered into that device, and a response then output by that device to be returned on foot, and so forth, until the webrtc peer connection is open. it'd be very high latency but it could be done. information exchanged during signaling there are three basic types of information that need to be exchanged during signaling: control messages used to set up, open, and close the communication channel, and to handle errors. information needed in order to set up the connection: the ip addressing and port information needed for the peers to be ...
...andle errors. information needed in order to set up the connection: the ip addressing and port information needed for the peers to be able to talk to one another. media capability negotiation: what codecs and media data formats can the peers understand? these need to be agreed upon before the webrtc session can begin. only once signaling has been successfully completed can the true process of opening the webrtc peer connection begin. it's worth noting that the signaling server does not actually need to understand or do anything with the data being exchanged through it by the two peers during signaling. the signaling server is, in essence, a relay: a common point which both sides connect to knowing that their signaling data can be transferred through it. the server doesn't need to react to...
Web Video Text Tracks Format (WebVTT) - Web APIs
e active text is future text . this enables karaoke style captions. example 12 - karaoke style text 1 00:16.500 --> 00:18.500 when the moon <00:17.500>hits your eye 1 00:00:18.500 --> 00:00:20.500 like a <00:19.000>big-a <00:19.500>pizza <00:20.000>pie 1 00:00:20.500 --> 00:00:21.500 that's <00:00:21.000>amore the following tags are the html tags allowed in a cue and require opening and closing tags (e.g., <b>text</b>). class tag (<c></c>) style the contained text using a css class. example 14 - class tag <c.classname>text</c> italics tag (<i></i>) italicize the contained text. example 15 - italics tag <i>text</i> bold tag (<b></b>) bold the contained text. example 16 - bold tag <b>text</b> underl...
... adjusting the scrolling setting of all nodes present in given region. vtt region constructor: for construction of new vtt regions. tutorial on how to write a webvtt file there are few steps that can be followed to write a simple webvtt file. before start, it must be noted that you can make use of a notepad and then save the file as ‘.vtt’ file. steps are given below: open a notepad. the first line of webvtt is standardized similar to the way some other languages require you to put headers as the file starts to indicate the file type. on the very first line you have to write: webvtt 3. leave the second line blank, and on the third line the time for first cue is to be specified. for example, for a first cue starting at time 1 second and ending at 5 seconds...
Using the Web Animations API - Web APIs
the web animations api lets us construct animations and control their playback with javascript. this article will start you off in the right direction with fun demos and tutorials featuring alice in wonderland. meet the web animations api the web animations api opens the browser’s animation engine to developers and manipulation by javascript. this api was designed to underlie implementations of both css animations and css transitions, and leaves the door open to future animation effects. it is one of the most performant ways to animate on the web, letting the browser make its own internal optimizations without hacks, coercion, or window.requestanimationframe(). with the web animations api, we can move interactive animations from stylesheets to javascript, separating presentation from beh...
...tion, which we can change easily from one place. we can also use the web animations api to figure out the animation's current time. the game ends when you run out of cake to eat or empty the bottle. which vignette players are presented with depends on how far along alice was in her animation, whether she grew too big and can't get in the tiny door anymore or too small and cannot reach the key to open the door. we can figure out whether she's on the large end or small end of her animation by getting her animation's currenttime and dividing it by her activeduration: var endgame = function() { // get alice's timeline's playhead location var aliceplayhead = alicechange.currenttime; var alicetimeline = alicechange.effect.getcomputedtiming().activeduration; // stops alice's and other ani...
Example and tutorial: Simple synth keyboard - Web APIs
tion value="sawtooth">sawtooth</option> <option value="triangle">triangle</option> <option value="custom">custom</option> </select> </div> </div> css .container { overflow-x: scroll; overflow-y: hidden; width: 660px; height: 110px; white-space: nowrap; margin: 10px; } .keyboard { width: auto; padding: 0; margin: 0; } .key { cursor: pointer; font: 16px "open sans", "lucida grande", "arial", sans-serif; border: 1px solid black; border-radius: 5px; width: 20px; height: 80px; text-align: center; box-shadow: 2px 2px darkgray; display: inline-block; position: relative; margin-right: 3px; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; } .key div { position: absolute; bottom: 0; ...
...er-select: none; } .key div { position: absolute; bottom: 0; text-align: center; width: 100%; pointer-events: none; } .key div sub { font-size: 10px; pointer-events: none; } .key:hover { background-color: #eef; } .key:active { background-color: #000; color: #fff; } .octave { display: inline-block; padding: 0 6px 0 0; } .settingsbar { padding-top: 8px; font: 14px "open sans", "lucida grande", "arial", sans-serif; position: relative; vertical-align: middle; width: 100%; height: 30px; } .left { width: 50%; position: absolute; left: 0; display: table-cell; vertical-align: middle; } .left span, .left input { vertical-align: middle; } .right { width: 50%; position: absolute; right: 0; display: table-cell; vertical-align: middle; } .
Obsolete features - Web APIs
directories obsolete since gecko 2 obsolete synonym of personalbar. in ie, it rendered the links bar. supported in gecko up to 1.9.2 and in ie up to 6. fullscreen this feature no longer works in msie 6 sp2 the way it worked in msie 5.x. the windows taskbar, as well as the titlebar and the status bar of the window are not visible, nor accessible when fullscreen is enabled in msie 5.x. fullscreen always upsets users with large monitor screen or with dual monitor screen. forcing fullscreen onto other users is also extremely unpopular and is considered an outright rude attempt to impose web author's viewing preferences onto users. ...
... the personal toolbar in netscape 6.x, netscape 7.x and mozilla browser. it renders the bookmarks toolbar in firefox. in addition to the personal toolbar, mozilla browser will render the site navigation bar if such toolbar is visible, present in the parent window. mozilla and firefox users can force new windows to always render the personal toolbar/bookmarks toolbar by setting dom.disable_window_open_feature.personalbar to true in about:config or in their user.js file. ...
WindowClient.focused - Web APIs
d read-only property of the windowclient interface is a boolean that indicates whether the current client has focus. syntax var myfocused = windowclient.focused; value a boolean. ...
...his looks to see if the current is already open and // focuses if it is event.waituntil(clients.matchall({ type: "window" }).then(function(clientlist) { for (var i = 0; i < clientlist.length; i++) { var client = clientlist[i]; if (client.url == '/' && 'focus' in client) { if(!client.focused) return client.focus(); } } } if (clients.openwindow) return clients.openwindow('/'); })); }); specifications specification status comment service workersthe definition of 'windowclient: focused' in that specification. working draft initial definition ...
XDomainRequest - Web APIs
p access control. this interface can send both get and post requests. syntax var xdr = new xdomainrequest(); returns a new xdomainrequest object, which can then be used to make and manage these requests. properties xdomainrequest.timeout gets or sets the amount of time until a request times out. xdomainrequest.responsetext gets the response body as a string. methods xdomainrequest.open() opens the request, specifing the method (get/post) and url. xdomainrequest.send() sends the request. post data is specified in this method. xdomainrequest.abort() aborts the request. event handlers xdomainrequest.onprogress a handler for when the request has made progress between the send method call and the onload event. xdomainrequest.ontimeout a handler for when the request time...
...or when the request has made progress between the send method call and the onload event. xdomainrequest.ontimeout a handler for when the request times out. xdomainrequest.onerror a handler for when a request has errored. xdomainrequest.onload a handler for when the full response has been received from the server. ...
XMLHttpRequest.response - Web APIs
returns the response's body content as an arraybuffer, blob, document, javascript object, or domstring, depending on the value of the request's responsetype property. syntax var body = xmlhttprequest.response; value an appropriate object based on the value of responsetype. you may attempt to request the data be provided in a specific format by setting the value of responsetype after calling open() to initialize the request but before calling send() to send the request to the server. the value is null if the request is not yet complete or was unsuccessful, with the exception that when reading text data using a responsetype of "text" or the empty string (""), the response can contain the response so far while the request is still in the loading readystate (3). the response types are desc...
...s obtained and passed into the callback function provided to load(). the content is handled as raw text data (since nothing here is overriding the default responsetype). ...
XMLHttpRequest.send() - Web APIs
aybufferview or blob in conjunction with the send() method. return value undefined. exceptions exception description invalidstateerror send() has already been invoked for the request, and/or the request is complete. networkerror the resource type to be fetched is a blob, and the method is not get. ...
...e resource type to be fetched is a blob, and the method is not get. example: get var xhr = new xmlhttprequest(); xhr.open('get', '/server', true); xhr.onload = function () { // request finished. do processing here. }; xhr.send(null); // xhr.send('string'); // xhr.send(new blob()); // xhr.send(new int8array()); // xhr.send(document); example: post var xhr = new xmlhttprequest(); xhr.open("post", '/server', true); //send the proper header information along with the request xhr.setrequestheader("content-type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { // call a function when the state changes. if (this.readystate === xmlhttprequest.done && this.status === 200) { // request finished. do processing here. } } xhr.send("foo=bar&lorem=...
XMLHttpRequest - Web APIs
st if it has already been sent. xmlhttprequest.getallresponseheaders() returns all the response headers, separated by crlf, as a string, or null if no response has been received. xmlhttprequest.getresponseheader() returns the string containing the text of the specified header, or null if either the response has not yet been received or the header doesn't exist in the response. ...
...e. xmlhttprequest.open() initializes a request. xmlhttprequest.overridemimetype() overrides the mime type returned by the server. xmlhttprequest.send() sends the request. if the request is asynchronous (which is the default), this method returns as soon as the request is sent. xmlhttprequest.setrequestheader() sets the value of an http request header. you must call setrequestheader()after open(), but before send(). non-standard methods xmlhttprequest.init() initializes the object for use from c++ code. warning: this method must not be called from javascript. xmlhttprequest.openrequest() initializes a request. this method is to be used from native code; to initialize a request from javascript code, use open() instead. see the documentation for open(). xmlhttprequest.sendasbi...
ARIA: switch role - Accessibility
attribute("aria-checked", "true"); } } css the purpose of the css is to establish a look and feel for the switch that's reminiscent of the power switch paradigm. ...
...font: 12px "open sans", "arial", serif; } button.switch span { padding: 0 4px; pointer-events: none; } [role="switch"][aria-checked="false"] :first-child, [role="switch"][aria-checked="true"] :last-child { background: #262; color: #eef; } [role="switch"][aria-checked="false"] :last-child, [role="switch"][aria-checked="true"] :first-child { color: #bbd; } label.switch { font: 16px "open sans", "arial", sans-serif; line-height: 20px; user-select: none; vertical-align: middle; -moz-user-select: none; -ms-user-select: none; -webkit-user-select: none; -o-user-select: none; } the most interesting part is probably the use of attribute selectors and the :first-child and :last-child pseudo-classes to do all the heavy lifting of changing the appearance of the switch based ...
ARIA: button role - Accessibility
e="button"> elements, you will need to make the element focusable and have to define event handlers for click and keydown events, including the enter and space keys, in order to process the user's input. see the official wai-aria example code. description the button role identifies an element as a button to screen readers. a button is a widget used to perform actions such as submitting a form, opening a dialog, cancelling an action, or performing a command such as inserting a new record or displaying information. a common convention to inform users a button will launch a dialog is to append "…" (ellipsis) to the button's label, e.g., "save as…". in addition to the ordinary button widget, role="button" should be included when creating a toggle button or menu button using a non button e...
...abel to change from "mute" to "unmute," a toggle button would not be appropriate, so the the aria-pressed attribute would be omitted. keyboard interactions key function enter activates the button. space activates the button following button activation, focus is set depending on the type of action the button performs. for example, if clicking the button opens a dialog, the focus should move to the dialog. if the button closes a dialog, focus should returns to the button that opened the dialog unless the function performed in the dialog context logically leads to a different element. if the button alters the current context, then focus typically remains on the button, such as muting and unmuting an audio file. required javascript features required e...
Web Accessibility: Understanding Colors and Luminance - Accessibility
sed to describe the same thing. "luminance" and "saturation" are particularly important to get right. for example, "saturation" is known as "chroma" in some circles. in others, "chroma" and "saturation" are two different concepts. the "l" in the hsl color space is sometimes referred to as "luminosity," other times as "lightness." even something seemingly simple like naming common colors can be open to debate. for example, the color "crimson red" may be described in hex values as #990000 by some and #dc143c by others. for the purposes of this document, we'll use terminlogy as it is defined in the w3c, in the css color module level 3 when working with color, it's important to know which "color space" you are working in, as different color spaces map to different measurement systems. curren...
...ss color module 3 (see section 4.2.4), the rationale being that rgb is hardware-oriented, reflecting the use of crts, and that rgb is non-intuitive. that said, hsl colors incorporate lightness, not luminance, and this is a significant consideration. note that in that same section of the css color module 3, there are algorigthms available to translate the hsl to rgb. newer technologies, such as opengl and direct3d incorporate support for the srgb gamma curve, although some articles for opengl reference use of rgba rather than srgb. webgl is usually in the rgba format; see an example of how it is used in "clearing with colors". where accessibility is concerned, however, standards and guidelines are currently written predominantly using the srgb color space, especially as it applies to colo...
font-weight - CSS: Cascading Style Sheets
extra bold (ultra bold) 900 black (heavy) variable fonts most fonts have a particular weight which corresponds to one of the numbers in common weight name mapping. however some fonts, called variable fonts, can support a range of weights with more or less fine granularity, and this can give the designer a much closer degree of control over the chosen weight. for truetype or opentype variable fonts, the "wght" variation is used to implement varying weights. accessibility concerns people experiencing low vision conditions may have difficulty reading text set with a font-weight value of 100 (thin/hairline) or 200 (extra light), especially if the font has a low contrast color ratio. mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.
...valuenormalcomputed valueas specified formal syntax <font-weight-absolute>{1,2}where <font-weight-absolute> = normal | bold | <number <a href="/docs/css/value_definition_syntax#brackets" title="brackets: enclose several entities, combinators, and multipliers to transform them as a single component">[1,1000]> examples setting normal font weight in a @font-face rule the following finds a local open sans font or import it, and allows using the font for normal font weights. @font-face { font-family: "open sans"; src: local("open sans") format("woff2"), url("/fonts/opensans-regular-webfont.woff") format("woff"); font-weight: 400; } specifications specification status comment css fonts module level 4the definition of 'font-weight' in that specificatio...
src - CSS: Cascading Style Sheets
Web › CSS › @font-face › src
the format hint contains a comma-separated list of format strings that denote well-known font formats. if a user agent doesn't support the specified formats, it skips d...
... candidate recommendation initial definition ...
@font-feature-values - CSS: Cascading Style Sheets
this can help simplify your css when using multiple fonts. the @font-feature-values at-rule may be used either at the top level of your css or inside any css conditional-group at-rule. syntax feature value blocks @swash specifies a feature name that will work with the swash() functional notation of font-variant-alternates. a swash feature value definition allows only one value: ident1: 2 is valid, but ident2: 2 4 isn't. ...
... work with the stylistic() functional notation of font-variant-alternates. a stylistic feature value definition allows only one value: ident1: 2 is valid, but ident2: 2 4 isn't. @styleset specifies a feature name that will work with the styleset() functional notation of font-variant-alternates. a stylset feature value definition allows an unlimited number of values: ident1: 2 4 12 1 maps to the opentype values ss02, ss04, ss12, and ss01. note that values higher than 99 are valid, but don't map to any opentype values and are ignored. @character-variant specifies a feature name that will work with the character-variant() functional notation of font-variant-alternates. a character-variant feature value definition allows either one or two values: ident1: 3 maps to cv03=1, and ident2: 2 4 maps ...
appearance (-moz-appearance, -webkit-appearance) - CSS: Cascading Style Sheets
the user agent selects the appropriate special styling based on the element. acts as none on elements with no special styling. menulist-button div { color: black; -moz-appearance: menulist-button; -webkit-appearance: menulist-button; } <div>lorem</div> firefox chrome safari edge the element is styled as a button that would indicate a menulist can be opened. textfield div { color: black; -moz-appearance: textfield; -webkit-appearance: textfield; } <div>lorem</div> firefox chrome safari edge the following values are treated as equivalent to auto: button div { color: black; -moz-appearance: button; -webkit-appearance: button; } <div>lorem</div> firefox c...
...x 64. treeheader firefox removed in firefox 64. treeheadercell firefox removed in firefox 64. treeheadersortarrow firefox removed in firefox 64. treeitem firefox removed in firefox 64. treeline firefox removed in firefox 64. treetwisty firefox removed in firefox 64. treetwistyopen firefox removed in firefox 64. treeview firefox removed in firefox 64. -moz-win-borderless-glass firefox removed in firefox 64. -moz-win-browsertabbar-toolbox firefox removed in firefox 64. -moz-win-communicationstext firefox removed in firefox 64. -moz-win-communications-toolbox firefox remov...
font-stretch - CSS: Cascading Style Sheets
> a <percentage> value between 50% and 200% (inclusive). negative values are not allowed for this property. in earlier versions of the font-stretch specification, the property accepts only the nine keyword values. css fonts level 4 extends the syntax to accept a <percentage> value as well. this enables variable fonts to offer something more like a continuum of character widths. for truetype or opentype variable fonts, the "wdth" variation is used to implement varying widths. however, note that the <percentage> syntax is not yet supported by all browsers: check the browser compatibility table for details. keyword to numeric mapping the table below shows the mapping between keyword values and numeric percentages: keyword percentage ultra-condensed 50% ...
...l only work in browsers that support <percentage> values. ...
font-weight - CSS: Cascading Style Sheets
bolder lighter 100 400 100 200 400 100 300 400 100 400 700 100 500 700 100 600 900 400 700 900 400 800 900 700 900 900 700 common weight name mapping the numerical values 100 to 900 roughly correspond to the following common weight names (see the opentype specification): value common weight name 100 thin (hairline) 200 extra light (ultra light) 300 light 400 normal (regular) 500 medium 600 semi bold (demi bold) 700 bold 800 extra bold (ultra bold) 900 black (heavy) 950 extra black (ultra black) variabl...
...ack (heavy) 950 extra black (ultra black) variable fonts most fonts have a particular weight which corresponds to one of the numbers in common weight name mapping. however some fonts, called variable fonts, can support a range of weights with a more or less fine granularity, and this can give the designer a much closer degree of control over the chosen weight. for truetype or opentype variable fonts, the "wght" variation is used to implement varying widths. for the example below to work, you'll need a browser that supports the css fonts level 4 syntax in which font-weight can be any number between 1 and 1000. html <header> <input type="range" id="weight" name="weight" min="1" max="1000" /> <label for="weight">weight</label> </header> <div class="container"> ...
hanging-punctuation - CSS: Cascading Style Sheets
uses any one of the keyword values in the list below. two-value syntax uses one of the following: first together with any one of last, allow-end, or force-end last together with any one of first, allow-end, or force-end three-value syntax uses one of the following: first, allow-end, and last first, force-end, and last values none no character hangs. first an opening bracket or quote at the start of the first formatted line of an element hangs. last a closing bracket or quote at the end of the last formatted line of an element hangs. force-end a stop or comma at the end of a line hangs. allow-end a stop or comma at the end of a line hangs if it does not otherwise fit prior to justification. formal definition initial valuenoneapplies toall elements...
...d line of an element hangs. force-end a stop or comma at the end of a line hangs. allow-end a stop or comma at the end of a line hangs if it does not otherwise fit prior to justification. formal definition initial valuenoneapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax none | [ first | [ force-end | allow-end ] | last ] examples setting opening and closing quotes to hang html <p>“lorem ipsum dolor sit amet, consectetur adipiscing elit. curabitur dignissim nunc mauris, et sollicitudin est scelerisque sed. praesent laoreet tortor massa, sit amet vulputate nulla pharetra ut.”</p> css p { hanging-punctuation: first last; margin: .5rem; } result specifications specification status comment css t...
list-style-type - CSS: Cascading Style Sheets
-moz-tamil example telugu -moz-telugu example thai -moz-thai example tibetan * example trad-chinese-formal traditional chinese formal numbering. e.g. 壹萬壹仟壹佰壹拾壹 trad-chinese-informal traditional chinese informal numbering. e.g. 一萬一千一百一十一 upper-armenian * example disclosure-open symbol indicating that a disclosure widget such as <details> is opened. disclosure-closed symbol indicating that a disclosure widget, like <details> is closed. non-standard extensions a few more predefined types are provided by mozilla (firefox), blink (chrome and opera) and webkit (safari) to support list types in other languages. see the compatibility table to check ...
...syntax to support @counter-style rules. defines using @counter-style the usual style types: hebrew, cjk-ideographic, hiragana, hiragana-iroha, katakana, katakana-iroha, japanese-formal, japanese-informal, simp-chinese-formal, trad-chinese-formal, simp-chinese-formal, trad-chinese-formal,korean-hangul-formal, korean-hanja-informal, korean-hanja-formal, cjk-decimal, ethiopic-numeric, disclosure-open and disclosure-closed. extends <counter-style> with the symbols() functional notation. css lists module level 3the definition of 'list-style-type' in that specification. working draft modify syntax to support for identifiers used in @counter-style rules to keywords. support for a simple <string>. css level 2 (revision 1)the definition of 'list-style-type' in that s...
max-block-size - CSS: Cascading Style Sheets
ontexts; they may only be used in svg 1.x contexts. formal definition initial value0applies tosame as width and heightinheritednopercentagesblock-size of containing blockcomputed valuesame as max-width and max-heightanimation typea length, percentage or calc(); formal syntax <'max-width'> examples setting max-block-size with horizontal and vertical text in this example, the same text (the opening sentences from herman melville's novel moby-dick) is presented in both the horizontal-tb and vertical-rl writing modes. everything else about the two boxes is identical, including the values used for max-block-size. html the html simply establishes the two <div> blocks that will be presented with their writing-mode set using the classes horizontal or vertical. both boxes share the standard-...
...oxes, as seen above. it provides standard styling including the minimum and maximum block sizes, font size, and so forth. after that come the classes horizontal and vertical, which add the writing-mode property to the box, with the value set to horizontal-tb or vertical-rl depending on which class is used. .standard-box { padding: 4px; background-color: #abcdef; color: #000; font: 16px "open sans", "helvetica", "arial", sans-serif; max-block-size: 160px; min-block-size: 100px; } .horizontal { writing-mode: horizontal-tb; } .vertical { writing-mode: vertical-rl; } result specifications specification status comment css logical properties and values level 1the definition of 'max-block-size' in that specification. editor's draft initial d...
The Unicode Bidirectional Text Algorithm - Developer guides
dling neutral characters overriding the algorithm content about using html and css to override the default behavior of the algorithm; include info about isolating ranges etc. overiding bidi using unicode control characters unicode provides a number of special control characters that make it possible to control directionality of ranges of text. there are two sets of control characters; one set opens the override, and another restores the original directionality. you must always follow each opening character with an appropriate closing character. initial unicode bidi algorithm control characters character code point html entity markup equivalent description left-to-right isolate (lri) u+2066 &#x2066; dir="ltr" sets the base direction to ltr, is...
... override (rlo) u+202e &#x202e; <bdo dir="rtl"> overrides the bidi algorithm and displays the embedded characters in reverse memory order, from right to left closing unicode bidi algorithm control characters character code point html entity markup equivalent description pop directional formatting (pdf) u+202c &#x202c; closing whatever opening tag used the dir attribute used for rle or lre </bdo> used for rlo or lro pop directional isolate (pdi) u+2069 &#x2069; closing whatever opening tag used the dir attribute used for rli, lri, or fsi ...
Developer guides
d to know about pwas. optimization and performance when building modern web apps and sites, it's important to make your content work quickly and efficiently. this lets it perform effectively for both powerful desktop systems and weaker handheld devices. parsing and serializing xml the web platform provides different methods of parsing and serializing xml, each with its pros and cons. the web open font format (woff) woff (web open font format) is a font file format that is free for anyone to use on the web. unicode bidirectional text algorithm (bidi) the unicode® bidi algorithm is part of the unicode text standard. it describes how the browser should order characters while rendering unicode text. this guide covers the algorithm in general and how it applies to content you create—espe...
...s to transmit keyed data. 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". user input and controls modern web user input goes beyond simple mouse and keyboard: think of touchscreens for example. this article provides recommendations for managing user input and implementing controls in open web apps, along with faqs, real-world examples, and links to further information for anyone needing more detailed information on the underlying technologies. glossary defines numerous technical terms related to the web and the internet. ...
<dl>: The Description List element - HTML: Hypertext Markup Language
Web › HTML › Element › dl
ag are mandatory. permitted parents any element that accepts flow content. implicit aria role no corresponding role permitted aria roles group, list, none, presentation dom interface htmldlistelement attributes this element only includes the global attributes. ...
...tributes. examples single term and description <dl> <dt>firefox</dt> <dd> a free, open source, cross-platform, graphical web browser developed by the mozilla corporation and hundreds of volunteers. </dd> <!-- other terms and descriptions --> </dl> multiple terms, single description <dl> <dt>firefox</dt> <dt>mozilla firefox</dt> <dt>fx</dt> <dd> a free, open source, cross-platform, graphical web browser developed by the mozilla corporation and hundreds of volunteers. </dd> <!-- other terms and descriptions --> </dl> single term, multiple descriptions <dl> <dt>firefox</dt> <dd> a free, open source, cross-platform, graphical web browser developed by the mozilla corporation and hundreds of volunteers. </dd> ...
<tr>: The Table Row element - HTML: Hypertext Markup Language
Web › HTML › Element › tr
017-04008">april 8, 2017</time></td> <td>37.00</td> </tr> <tr> <th scope="row">hoshi nakamura</td> <td>601942</td> <td><time datetime="2012-07-23">july 23, 2012</time></td> <td>n/a</td> <td>15.00</td> </tr> </tbody> </table> css this time, the html is unchanged, so let's dive right into the css. ...
... <tr> <th scope="row">hoshi nakamura</td> <td>601942</td> <td><time datetime="2012-07-23">july 23, 2012</time></td> <td>n/a</td> <td>15.00</td> </tr> </tbody> </table> css the css is much more involved this time. it's not complicated, but there's a lot going on. let's break it down. the table and base styles table { border: 1px solid black; font: 16px "open sans", helvetica, arial, sans-serif; border-spacing: 0; border-collapse: collapse; } here we've added the border-spacing and border-collapse properties to eliminate spacing between cells and collapse borders that touch one another to be a single border instead of winding up with double borders. th, td { border: 1px solid black; padding:4px 6px; } th { vertical-align: bottom; } and h...
<video>: The Video Embed element - HTML: Hypertext Markup Language
Web › HTML › Element › video
the above example shows simple usage of the <video> element. in a similar manner to the <img> element, we include a path to the media we want to display inside the src attribute; we can include other attributes to specify information such as video width and height, whether we want it to autoplay and loop, whether we want to show the browser's default video controls, etc. the content inside the opening and closing <video></video> tags is shown as a fallback in browsers that don't support the element. attributes like all other html elements, this element supports the global attributes. autoplay a boolean attribute; if specified, the video automatically begins to play back as soon as it can do so without stopping to finish loading the data. note: sites that automatically play audio (or ...
... in its place. if the browser doesn't support video playback, the fallback text is displayed. multiple sources example this example builds on the last one, offering three different sources for the media; this allows the video to be watched regardless of which video codecs are supported by the browser. ...
HTML elements reference - HTML: Hypertext Markup Language
Web › HTML › Element
cuments. common examples of navigation sections are menus, tables of contents, and indexes. <section> the html <section> element represents a standalone section — which doesn't have a more specific semantic element to represent it — contained within an html document. text content use html text content elements to organize blocks or sections of content placed between the opening <body> and closing </body> tags. important for accessibility and seo, these elements identify the purpose or structure of that content. element description <blockquote> the html <blockquote> element (or html block quotation element) indicates that the enclosed text is an extended quotation. usually, this is rendered visually by indentation (see notes for ho...
...mount of free-form text, for example a comment on a review or feedback form. interactive elements html offers a selection of elements which help to create interactive user interface objects. element description <details> the html details element (<details>) creates a disclosure widget in which information is visible only when the widget is toggled into an "open" state. <dialog> the html <dialog> element represents a dialog box or other interactive component, such as a dismissable alert, inspector, or subwindow. <menu> the html <menu> element represents a group of commands that a user can perform or activate. this includes both list menus, which might appear across the top of a screen, as well as context menus, such as those t...
MIME types (IANA media types) - HTTP
for security reasons, most browsers do not allow setting a custom default action for such resources, forcing the user to save it to disk to use it. some common incorrect server configurations: rar-compressed files. in this...
...of different types. in this case, configure the server to send application/x-rar-compressed. audio and video. only resources with the correct mime type will be played in <video> or <audio> elements. be sure to specify the correct media type for audio and video. proprietary file types. avoid using application/octet-stream as most browsers do not allow defining a default behavior (like "open in word") for this generic mime type. a specific type like application/vnd.mspowerpoint lets users open such files automatically in the presentation software of their choice. mime sniffing in the absence of a mime type, or in certain cases where browsers believe they are incorrect, browsers may perform mime sniffing — guessing the correct mime type by looking at the bytes of the resource. ...
CORS errors - HTTP
Web › HTTP › CORS › Errors
ally being disallowed by the user's web application and remote external service. however, if the endpoint is meant to be available, some debugging is needed to succeed. identifying the issue to understand the underlying issue with the cors configuration, you need to find out which request is at fault and why. these steps may help you do so: navigate to the web site or web app in question and open the developer tools. now try to reproduce the failing transaction and check the console if you are seeing a cors violation error message. it will probably look like this: the text of the error message will be something similar to the following: cross-origin request blocked: the same origin policy disallows reading the remote resource at https://some-url-here. (reason: additional information...
...e knows is that an error occurred. the only way to determine what specifically went wrong is to look at the browser's console for details. cors error messages firefox's console displays messages in its console when requests fail due to cors. part of the error text is a "reason" message that provides added insight into what went wrong. the reason messages are listed below; click the message to open an article explaining the error in more detail and offering possible solutions. reason: cors disabled reason: cors request did not succeed reason: cors header ‘origin’ cannot be added reason: cors request external redirect not allowed reason: cors request not http reason: cors header ‘access-control-allow-origin’ missing reason: cors header ‘access-control-allow-origin’ does ...
Connection - HTTP
if the value sent is keep-alive, the connection is persistent and not closed, allowing for subsequent requests to the same server to be done. connection-specific header fields such as connection and keep-alive are prohibited in http/2. chrome and firefox ignore them in http/2 responses, but safari conforms to the http/2 spec requirements and won’t load any response which contains them. ...
...eader type general header forbidden header name yes syntax connection: keep-alive connection: close directives close indicates that either the client or the server would like to close the connection. this is the default on http/1.0 requests. any comma-separated list of http headers [usually keep-alive only] indicates that the client would like to keep the connection open. having a persistent connection is the default on http/1.1 requests. the list of headers are the name of the header to be removed by the first non-transparent proxy or cache in-between: these headers define the connection between the emitter and the first entity, not the destination node. ...
Index - HTTP
Web › HTTP › Headers › Index
eader, reference, header the clear-site-data header clears browsing data (cookies, storage, cache) associated with the requesting website. it allows web developers to have more control over the data stored locally by a browser for their origins. 21 connection http, headers, reference, web the connection general header controls whether or not the network connection stays open after the current transaction finishes. if the value sent is keep-alive, the connection is persistent and not closed, allowing for subsequent requests to the same server to be done. 22 content-disposition http, reference, header in a multipart/form-data body, the http content-disposition general header is a header that can be used on the subpart of a multipart body to give in...
...nse, response header, header the retry-after response http header indicates how long the user agent should wait before making a follow-up request. there are three main cases this header is used: 97 sec-websocket-accept draft, http, needscompattable, needscontent, reference, sec-websocket-accept, websockets, header the sec-websocket-accept header is used in the websocket opening handshake. it would appear in the response headers. that is, this is header is sent from server to client to inform that server is willing to initiate a websocket connection. 98 server http, reference, header the server header contains information about the software used by the origin server to handle the request. 99 server-timing http, performance, referenc...
HTTP Messages - HTTP
Web › HTTP › Messages
http messages are how data is exchanged between a server and a client. there are two types of messages: requests sent by the client to trigger an action on the server, and responses, the answer from the server. http messages are composed of textual information encoded in ascii, and span over multiple lines. in http/1.1, and earlier versions of the protocol, these messages were openly sent across the connection. in http/2, the once human-readable message is now divided up into http frames, providing optimization and performance improvements. web developers, or webmasters, rarely craft these textual http messages themselves: software, a web browser, proxy, or web server, perform this action. they provide http messages through config files (for proxies or servers), apis (for browsers), or othe...
...ce bodies, consisting of a multipart body, each containing a different section of information. these are relatively rare. http/2 frames http/1.x messages have a few drawbacks for performance: headers, unlike bodies, are uncompressed. headers are often very similar from one message to the next one, yet still repeated across connections. no multiplexing can be done. several connections need opening on the same server: and warm tcp connections are more efficient than cold ones. http/2 introduces an extra step: it divides http/1.x messages into frames which are embedded in a stream. data and header frames are separated, this allows header compression. several streams can be combined together, a process called multiplexing, allowing more efficient underlying tcp connections. http frame...
Proxy servers and tunneling - HTTP
duces a few configuration options. there are two types of proxies: forward proxies (or tunnel, or gateway) and reverse proxies (used to control and protect access to a server for load-balancing, authentication, decryption or caching). forward proxies a forward proxy, or gateway, or just "proxy" provides proxy services to a client or a group of clients. there are likely hundreds of thousands of open forward proxies on the internet. they store and forward internet services (like the dns, or web pages) to reduce and control the bandwidth used by the group. forward proxies can also be anonymous proxies and allow users to hide their ip address while browsing the web or using other internet services. tor (the onion router), routes internet traffic through multiple proxies for anonymity. reverse...
... the response headers. http tunneling tunneling transmits private network data and protocol information through public network by encapsulating the data. http tunneling is using a protocol of higher level (http) to transport a lower level protocol (tcp). the http protocol specifies a request method called connect. it starts two-way communications with the requested resource and can be used to open a tunnel. this is how a client behind an http proxy can access websites using ssl (i.e. https, port 443). note, however, that not all proxy servers support the connect method or limit it to port 443 only. see also the http tunnel article on wikipedia. proxy auto-configuration (pac) a proxy auto-configuration (pac) file is a javascript function that determines whether web browser requests (http...
SharedArrayBuffer - JavaScript
w, secure approach has been standardized to re-enable shared memory. with a few security measures, postmessage() will no longer throw for sharedarraybuffer objects and shared memory across threads will be available: as a baseline requirement, your document needs to be in a secure context. ...
...ss threads will be available: as a baseline requirement, your document needs to be in a secure context. ...
try...catch - JavaScript
te after the try-block and catch-block(s) execute, but before the statements following the try...catch...finally-block. note that the finally-block executes regardless of whether an exception is thrown. also, if an exception is thrown, the statements in the finally-block execute even if no catch-block handles the exception. the following example shows one use case for the finally-block. ...
...ess of whether an exception is thrown. also, if an exception is thrown, the statements in the finally-block execute even if no catch-block handles the exception. the following example shows one use case for the finally-block. the code opens a file and then executes statements that use the file; the finally-block makes sure the file always closes after it is used even if an exception was thrown. ...
MathML attribute reference - MathML
<mo>, <mspace> linethickness <mfrac> the thickness of the horizontal fraction line. unimplemented location <mscarries> unimplemented longdivstyle <mlongdiv> controls the style of the long division layout. lspace <mo>, <mpadded> the amount of space before the operator (see length for values and units). lquote <ms> the opening quote character (depends on dir) to enclose the content. the default value is "&quot;". mathbackground all the background color. you can use #rgb, #rrggbb and html color names. mathcolor all the text color. you can use #rgb, #rrggbb and html color names. mathsize <mi>, <mn>, <mo>, <ms>, <mtext> the size of the content. mathvariant <mi>, ...
...e row. minsize <mo> the minimum size of the operator. movablelimits <mo> specifies whether attached under- and overscripts move to sub- and superscript positions. notation <menclose> a list of notations, separated by white space, to apply to the child elements. numalign <mfrac> the alignment of the numerator over the fraction. open <mfenced> a string for the opening delimiter. unimplemented overflow <math> if an expression is too long to fit in the allowed width, this attribute sets the preferred handling. unimplemented position <msgroup>, <msrow>, <mscarries>, <msline> rowalign <mtable>, <mtd>, <mtr> specifies the vertical alignment of table cells. rowlines <m...
<semantics> - MathML
emantic meaning of mathematical expressions. the <semantics> element acts as a container element associating annotations and must have child elements (it will raise an invalid markup error otherwise). the <annotation> element is the container element containing semantic information in a non-xml format, whereas the <annotation-xml> element contains content in an xml format, e.g. content mathml or openmath. the rules of determining the visible child in a <semantics> element are the following: if no rule other rule applies: by default only the first child is rendered, which is supposed to be presentation markup. if the first child is a presentation mathml element other than <annotation> or <annotation-xml>, render the first child. if no presentation mathml is found, render the first <annot...
...e that "application/mathml+xml" is not mentioned here as it does not distinguish between content or presentation mathml. attributes the following attributes can be set on <annotation> and <annotation-xml>: definitionurl the location of the annotation key symbol. encoding the encoding of the semantic information in the annotation (e.g. "mathml-content", "mathml-presentation", "application/openmath+xml", "image/png") cd the content dictionary that contains the annotation key symbol. name the name of the annotation key symbol. src the location of an external source for semantic information. example <math> <semantics> <!-- presentation mathml --> <mrow> <msup> <mi>x</mi> <mn>2</mn> </msup> <mo>+</mo> <mi>y</mi> </mrow> <...
Web media technologies
n pre-recorded material, then send that audio to a destination such as an <audio> element, a media stream, or to disk. webrtc webrtc (web real-time communication) makes it possible to stream live audio and video, as well as transfer arbitrary data, between two peers over the internet, without requiring an intermediary. guides overview of media technology on the web a general look at the open web technologies and apis that provide support for audio and video playback, manipulation, and recording. if you're not sure which api you should use, this is the place to start. using audio and video in html a guide to using the html <audio> and <video> elements. accessibility guide for media in web design in this guide, we cover ways web designers and developers can create content that is a...
... they can be used in tandem with media apis in interesting ways. the canvas api the canvas api lets you draw into an <canvas>, manipulating and changing the contents of an image. this can be used with media in many ways, including by setting a <canvas> element as the destination for video playback or camera capture so that you can capture and manipulate video frames. webgl webgl provides an opengl es compatible api on top of the existing canvas api, making it possible to do powerful 3d graphics on the web. through a canvas, this can be used to add 3d imagery to media content. webxr webxr, which has replaced the now-obsolete webvr api, is a technology that provides support for creating virtual reality (vr) and augmented reality (ar) content. the mixed reality content can then be display...
Performance fundamentals - Web Performance
what is performance? ultimately, user-perceived performance is the only performance that matters. users provide inputs to the system through touch, movement, and speech. in return, they perceive outputs through sight, touch, and hearing. performance is the quality of system outputs in response to user inputs. all other things being equal, code optimized for some target besides user-perceived performance (hereafter upp) loses when competing against code optimized for upp. ...
...nt offers a pixel buffer directly for developers to draw on. this gives developers pixel-level control over rendering and precise control of framerate, but now the developers need to deal with multiple resolutions and orientations, right-to-left languages, and so forth. developers draw to canvases using either a familiar 2d drawing api, or webgl, a "close to the metal" binding that mostly follows opengl es 2.0. gecko rendering the gecko javascript engine supports just-in-time (jit) compilation. this enables application logic to perform comparably to other virtual machines — such as java virtual machines — and in some cases even close to "native code". the graphics pipeline in gecko that underpins html, css, and canvas is optimized in several ways. the html/css layout and graphics code i...
Add to Home screen - Progressive web apps (PWAs)
tall banners from the article web app install banners. if you choose not to add it to your home screen at this point, you can do so later using the add to home screen icon in the main chrome menu. regardless of which browser you are using, when you choose to add the app to your home screen, you'll see it appear along with a short title, in the same way that native apps do. tapping this icon opens it up, but as a fullscreen app, you'll no longer see the browser ui around it. how do you make an app a2hs-ready? to enable your app to be added to a home screen, it needs the following: to be served over https — the web is increasingly being moved in a more secure direction, and many modern web technologies (a2hs included) will work only on secure contexts. to have a manifest file with ...
... again available on the beforeinstallprompt event object. set deferredprompt to null since it is no longer needed. so when the button is clicked, the install prompt appears. if the user selects install, the app is installed (available as standalone desktop app), and the install button no longer shows (the onbeforeinstallprompt event no longer fires if the app is already installed). when you open the app, it will appear in its own window: if the user selects cancel, the state of the app goes back to how it was before the button was clicked. note: the code for this section was mostly taken from app install banners/add to home screen by pete lepage. ...
Progressive web app structure - Progressive web apps (PWAs)
r gamesimages = []; for(var i=0; i<games.length; i++) { gamesimages.push('data/img/'+games[i].slug+'.jpg'); } var contenttocache = appshellfiles.concat(gamesimages); the next block installs the service worker, which then actually caches all the files contained in the above list: self.addeventlistener('install', function(e) { console.log('[service worker] install'); e.waituntil( caches.open(cachename).then(function(cache) { console.log('[service worker] caching all: app shell and content'); return cache.addall(contenttocache); }) ); }); last of all, the service worker fetches content from the cache if it is available there, providing offline functionality: self.addeventlistener('fetch', function(e) { e.respondwith( caches.match(e.request).then(function(r) {...
...) ); }); last of all, the service worker fetches content from the cache if it is available there, providing offline functionality: self.addeventlistener('fetch', function(e) { e.respondwith( caches.match(e.request).then(function(r) { console.log('[service worker] fetching resource: '+e.request.url); return r || fetch(e.request).then(function(response) { return caches.open(cachename).then(function(cache) { console.log('[service worker] caching new resource: '+e.request.url); cache.put(e.request, response.clone()); return response; }); }); }) ); }); the javascript data the games data is present in the data folder in a form of a javascript object (games.js): var games = [ { slug: 'lost-in-cyberspace', ...
Introduction to progressive web apps - Progressive web apps (PWAs)
ication should provide all of the following advantages to the user. discoverability the eventual aim is that web apps should have better representation in search engines, be easier to expose, catalog and rank, and have metadata usable by browsers to give them special capabilities. some of the capabilities have already been enabled on certain web-based platforms by proprietary technologies like open graph, which provides a format for specifying similar metadata in the html <head> block using <meta> tags. the relevant web standard here is the web app manifest, which defines features of an app such as name, icon, splash screen, and theme colors in a json-formatted manifest file. this is for use in contexts such as app listings and device home screens. installability a core part of the web...
...ing <meta> tags. the relevant web standard here is the web app manifest, which defines features of an app such as name, icon, splash screen, and theme colors in a json-formatted manifest file. this is for use in contexts such as app listings and device home screens. installability a core part of the web app experience is for users to have app icons on their home screen, and be able to tap to open apps into their own native container that feels nicely integrated with the underlying platform. modern web apps can have this native app feel via properties set inside the web app manifest, and via a feature available in modern smartphone browsers called web app installation. linkability one of the most powerful features of the web is the ability to link to an app at a specific url without t...
The building blocks of responsive design - Progressive web apps (PWAs)
removing the float of the third column (and adding clearing to guard against any float funny business). we've also altered the width of the images inside the third container (no longer a column — this is the gallery) so that now you get five per line (it was previously three per line). narrow screen/mobile layout we then have a narrow screen layout, designed to fit the bill for a mobile app/open web app experience. this is created in multiple parts. first of all, as expected, there is a media query in our main css, which is quite weighty, so we'll go through it in parts: @media all and (max-width: 480px) { x-card:nth-child(1), x-card:nth-child(2), x-card:nth-child(3) { width: 100%; float: none; padding: 0; } button { margin-top: 0; border-radius: 0; } x-c...
...ys that the whole stylesheet will not be linked to the html unless the viewport width is 480px or less. moving on to the javascript, <script> elements don't accept media attributes, so i had to do this a different way. fortunately there is a javascript construct called window.matchmedia(), which can conditionally run javascript constructs depending on whether a media query returns true or not. we opened up the brick.js file and wrapped the whole lot in the following: if (window.matchmedia("(max-width: 480px)").matches) { // the whole of brick.js goes here! } this causes nothing inside the brick.js file to be run unless the viewport width is 480px or less. problem solved. really wide screens one thing you might notice is that when the viewport gets very wide (such as on a cinema display),...
Structural overview of progressive web apps - Progressive web apps (PWAs)
<games.length; i++) { gamesimages.push('data/img/'+games[i].slug+'.jpg'); } var contenttocache = appshellfiles.concat(gamesimages); with the file list prepared, it's time to install the service worker itself. the service worker will actually handle caching all the listed files. ...
...other apps might use json or other for...
d - SVG: Scalable Vector Graphics
Web › SVG › Attribute › d
e of a shape closed with closepath may be different to that of one closed by drawing a line to the origin, using one of the other commands, because the line ends are joined together (according to the stroke-linejoin setting), rather than just being placed at the same coordinates. ...
...e ends are joined together (according to the stroke-linejoin setting), rather than just being placed at the same coordinates. ...
target - SVG: Scalable Vector Graphics
Web › SVG › Attribute › target
the target attribute should be used when there are multiple possible targets for the ending resource, such as when the parent document is embedded within an html or xhtml document, or is viewed with a tabbed browser. ...
...ent) into which a document is to be opened when the link is activated: only one element is using this attribute: <a> html, body, svg { height: 100%; } text { font: 20px arial, helvetica, sans-serif; fill: blue; text-decoration: underline; } <svg viewbox="0 0 300 120" xmlns="http://www.w3.org/2000/svg"> <a href="https://developer.mozilla.org" target="_self"> <text x="0" y="20">open link within iframe</text> </a> <a href="https://developer.mozilla.org" target="_blank"> <text x="0" y="60">open link in new tab or window</text> </a> <a href="https://developer.mozilla.org" target="_top"> <text x="0" y="100">open link in this tab or window</text> </a> </svg> usage notes value _self | _parent | _top | _blank | <xml-name> default value ...
Getting started - SVG: Scalable Vector Graphics
take a look at the following code. <svg version="1.1" baseprofile="full" width="300" height="200" xmlns="http://www.w3.org/2000/svg"> <rect width="100%" height="100%" fill="red" /> <circle cx="150" cy="100" r="80" fill="green" /> <text x="150" y="125" font-size="60" text-anchor="middle" fill="white">svg</text> </svg> copy the code and paste it in a file demo1.svg. then open the file in firefox. it will render as shown in the following screenshot. (firefox users: click here) the rendering process involves the following: we start with the <svg> root element: a doctype declaration as known from (x)html should be left off because dtd based svg validation leads to more problems than it solves before svg 2, to identify the version of the svg for other type...
... configuration page on the w3.org for a range of simple solutions. server misconfiguration is a very common reason for svg failing to load, so make sure you check yours. if your server is not configured to send the correct headers with the svg files it serves, then firefox will most likely show the markup of the files as text or encoded garbage, or even ask the viewer to choose an application to open them. « previousnext » ...
Tools for SVG - SVG: Scalable Vector Graphics
orer 9, all major browsers support svg: ie 9, mozilla firefox, safari, google chrome and opera. mobile devices with webkit-based browsers also support svg. on older or smaller devices, chances are that svg tiny is supported. inkscape url: www.inkscape.org one of the most important tools for a graphics format is a decent drawing program. inkscape offers state-of-the-art vector drawing, and it's open source. moreover, it uses svg as its native file format. to store inkscape specific data, it extends the svg file with elements and attributes in a custom namespace, but you can also choose to export as plain svg. adobe illustrator url: www.adobe.com/products/illustrator/ before adobe acquired macromedia, it was the most prominent promoter of svg. from this time stems the good support of svg ...
...lain svg. adobe illustrator url: www.adobe.com/products/illustrator/ before adobe acquired macromedia, it was the most prominent promoter of svg. from this time stems the good support of svg in illustrator. however, the resulting svg often shows some quirks, that make it necessary to post-process it for general applicability. apache batik url: xmlgraphics.apache.org/batik/ batik is a set of open source tools under the roof of the apache software foundation. the toolkit is written in java and offers almost complete svg 1.1 support, as well as some features that were originally planned for svg 1.2. batik offers a viewer (squiggle), a rasterizer for png output, an svg pretty printer to format svg files, and a truetype-to-svg-font converter. together with apache fop batik can transform svg...
Web security
even simple bugs in your code can result in private information being leaked, and bad people are out there trying to find ways to steal data. the web security-oriented articles listed here provide information that may help you secure your site and its code from attacks and data theft. content security content security policy (csp) content security policy (csp) is an added layer of security that helps to detect and mitigate certain types of attacks, including cross-site scripting (xss) and data injection attacks. these attacks are used for everything from data theft to site defacement to the distribution of malware. ...
...sl or tls to encrypt all communication between a client and a server. this secure connection allows clients to be sure that they are connected with the intended server, and to exchange sensitive data. http strict-transport-security the strict-transport-security: http header lets a website specify that it may only be accessed using https. certificate transparency certificate transparency is an open framework designed to protect against and monitor for certificate misissuances. newly issued certificates are 'logged' to publicly run, often independent ct logs which maintain an append-only, cryptographically assured record of issued tls certificates. mixed content an https page that includes content fetched using cleartext http is called a mixed content page. pages like this are only partial...
Using custom elements - Web Components
tor, we define all the functionality the element will have when an instance of it is instantiated. in this case we attach a shadow root to the custom element, use some dom manipulation to create the element's internal shadow dom structure — which is then attached to the shadow root — and finally attach some css to the shadow root to style it. ...
...le (see it running live). this is a trivial example that simply generates a colored square of a fixed size on the page. the custom element looks like this: <custom-square l="100" c="red"></custom-square> the class constructor is really simple — here we attach a shadow dom to the element, then attach empty <div> and <style> elements to the shadow root: const shadow = this.attachshadow({mode: 'open'}); const div = document.createelement('div'); const style = document.createelement('style'); shadow.appendchild(style); shadow.appendchild(div); the key function in this example is updatestyle() — this takes an element, gets its shadow root, finds its <style> element, and adds width, height, and background-color to the style. function updatestyle(elem) { const shadow = elem.shadowroot; ...
For Further Reading - XSLT: Extensible Stylesheet Language Transformations
he is also the author of the only book on this subject to have reached a second edition. ...
...von xsl programmers: http://www.zvon.org/o_html/group_xsl.html jeni's xslt pages index: http://www.jenitennison.com/xslt/ xmlpitstop.com stylesheet center: http://www.xmlpitstop.com/default.asp?datatype=ssc xsl tutorial index: http://www.nwalsh.com/docs/tutorials/xsl/ other cover pages extensible stylesheet language (xsl): http://www.oasis-open.org/cover/xsl.html xsl-list subscribe: http://www.mulberrytech.com/xsl/xsl-list/ archives: http://www.biglist.com/lists/xsl-list/archives/ the xsl-list is a very active general mailing list, hosted by mulberry technologies mozilla.dev.tech.xslt google groups: http://groups.google.com/group/mozilla.dev.tech.xslt this is a newsgroup that discusses nets...
Basic Example - XSLT: Extensible Stylesheet Language Transformations
ransformation run (xsltprocessor.transformtofragment(xmldoc, document)). this allows fetching of data after the page has been loaded, without initiating a fresh page load. ...
...ar xmldoc; function init(){ // load the xslt file, example1.xsl var myxmlhttprequest = new xmlhttprequest(); myxmlhttprequest.open("get", "example1.xsl", false); myxmlhttprequest.send(null); xslstylesheet = myxmlhttprequest.responsexml; xsltprocessor.importstylesheet(xslstylesheet); // load the xml file, example1.xml myxmlhttprequest = new xmlhttprequest(); myxmlhttprequest.open("get", "example1.xml", false); myxmlhttprequest.send(null); xmldoc = myxmlhttprequest.responsexml; var fragment = xsltprocessor.transformtofragment(xmldoc, document); document.getelementbyid("example").innerhtml = ""; mydom = fragment; document.getelementbyid("example").appendchild(fragment); } ...
Loading and running WebAssembly code - WebAssembly
note: for more information on how exporting from a webassembly module works, have a read of using the webassembly javascript api, and understanding webassembly text format. using xmlhttprequest xmlhttprequest is somewhat older than fetch, but can still be happily used to get a typed array. again, assuming our module is called simple.wasm: create a new xmlhttprequest() instance, and use its open() method to open a request, setting the request method to get, and declaring the path to the file we want to fetch. the key part of this is to set the response type to 'arraybuffer' using the responsetype property. next, send the request using xmlhttprequest.send(). we then use the onload event handler to invoke a function when the response has finished downloading — in this function we get ...
...ype property. next, send the request using xmlhttprequest.send(). we then use the onload event handler to invoke a function when the response has finished downloading — in this function we get the array buffer from the response property, and then feed that into our webassembly.instantiate() method as we did with fetch. the final code looks like this: request = new xmlhttprequest(); request.open('get', 'simple.wasm'); request.responsetype = 'arraybuffer'; request.send(); request.onload = function() { var bytes = request.response; webassembly.instantiate(bytes, importobject).then(results => { results.instance.exports.exported_func(); }); }; note: you can see an example of this in action in xhr-wasm.html. ...
Navigator.mozNotification - Archive of obsolete content
ptional url. notification createnotification( in domstring title, in domstring description, in domstring iconurloptional ); parameters title the notification title. description the text to display in the notification. iconurl optional a url identifying the image to display in the notification. return value a new notification object. permissions when using notifications in an open web app, be sure to add the desktop-notification permission in your manifest file: "permissions": { "desktop-notification": {} } usage notes in firefox 22+, the instantiation of a new notification should be done with the notification object by calling new notification(title, options). nick desaulniers has written a notification shim to cover both newer and older implementations. ...
Communicating With Other Scripts - Archive of obsolete content
e a page-mod that will attach "content-script.js" to the target web page, and will then load the target web page: var tabs = require("sdk/tabs"); var mod = require("sdk/page-mod"); var self = require("sdk/self"); var pageurl = self.data.url("page.html") var pagemod = mod.pagemod({ include: pageurl, contentscriptfile: self.data.url("content-script.js"), contentscriptwhen: "ready" }) tabs.open(pageurl); the target web page "page.html" includes a button and a page script: <html> <head> <meta charset="utf-8"> </head> <body> <input id="message" type="button" value="send a message"/> <script type="text/javascript" src="page-script.js"></script> </body> </html> the content script "content-script.js" adds an event listener to the button, that sends a custom event cont...
Cross-domain Content Scripts - Archive of obsolete content
<!-- panel.html --> <html> <head></head> <body> <div id="forecast_summary"></div> </body> </html> the "panel-script.js" uses xmlhttprequest to fetch the latest forecast: // panel-script.js var url = "http://datapoint.metoffice.gov.uk/public/data/txt/wxfcs/regionalforecast/json/500?key=your-api-key"; self.port.on("show", function () { var request = new xmlhttprequest(); request.open("get", url, true); request.onload = function () { var jsonresponse = json.parse(request.responsetext); var summary = getsummary(jsonresponse); var element = document.getelementbyid("forecast_summary"); element.textcontent = summary; }; request.send(); }); function getsummary(forecast) { return forecast.regionalfcst.fcstperiods.period[0].paragraph[0].$; } finally, we nee...
self - Archive of obsolete content
pi for an add-on to access its data files and id. self properties options content-scripting apis such as tab.attach(), page-mod, and page-worker let you pass read-only data to the content script as a json object via the contentscriptoptions option. if you do this, the data is available to the content script in the options property of self: // main.js const tabs = require("sdk/tabs"); tabs.open({ url: "./page.html", onready: function(tab) { tab.attach({ contentscriptfile: "./content-script.js", contentscriptoptions: { a: "blah" } }); } }); // content-script.js alert(self.options.a); port you can use port to receive messages from, and send messages to, the main add-on code. see the documentation for port. methods the self object has four meth...
Communicating using "port" - Archive of obsolete content
on(): listen to a message. removelistener(): stop listening to a message. once(): listen to only the first occurrence of a message. accessing port accessing port in the content script note that the global self object is completely different from the self module, which provides an api f...
SDK and XUL Comparison - Archive of obsolete content
we've designed the apis to be forward-compatible with the new multiple process architecture (codenamed electrolysis) planned for firefox. we also expect to support both desktop and mobile firefox using a single edition of the sdk: so you'll be able to write one extension and have it work on both products. security if they're not carefully designed, firefox add-ons can open the browser to attack by malicious web pages. although it's possible to write insecure add-ons using the sdk, it's not as easy, and the damage that a compromised add-on can do is usually more limited. restartlessness add-ons built with the sdk can be installed without having to restart firefox. although you can write traditional add-ons that are restartless, you can't u...
Guides - Archive of obsolete content
modules learn about the module system used by the sdk (which is based on the commonjs specification), how sandboxes and compartments can be used to improve security, and about the built-in sdk module loader, known as cuddlefish. ...
addon-page - Archive of obsolete content
not usually relevant and distract from the content you are presenting. the addon-page module provides a simple way to have a page which excludes these elements. to use the module import it using require(). after this, the page loaded from "data/index.html" will not contain navigational elements: var addontab = require("sdk/addon-page"); var data = require("sdk/self").data; require("sdk/tabs").open(data.url("index.html")); this only affects the page at "data/index.html": all other pages are displayed normally. ...
simple-prefs - Archive of obsolete content
and stores a string. { "type": "string", "name": "monstername", "value": "kraken", "title": "monster name" } color displayed as a colorpicker and stores a string in the #123456 format. { "type": "color", "name": "highlightcolor", "value": "#6a5acd", "title": "highlight color" } file displayed as a "browse" button that opens a file picker and stores the full path and name of the file selected. { "type": "file", "name": "myfile", "title": "select a file" } directory displayed as a "browse" button that opens a directory picker and stores the full path and name of the directory selected. { "type": "directory", "name": "mydirectory", "title": "select a directory" }...
High-Level APIs - Archive of obsolete content
network requests. selection get and set text and html selections in the current web page. self access data that is bundled with the add-on, and add-on metadata. simple-prefs store preferences across application restarts. simple-storage lets an add-on store data so that it's retained across firefox restarts. system query the add-on's environment and access arguments passed to it. tabs open, manipulate, and access tabs, and receive tab events. timers set one-off and periodic timers. ui provides access to button, toolbar, and sidebar ui objects. url construct, validate, and parse urls. widget create a simple user interface for an add-on in firefox's add-on bar. windows enumerate and examine open browser windows, open new windows, and listen for window events. ...
core/promise - Archive of obsolete content
promise from scratch. add-on sdk's promise module provides an api for doing that. defer module exports defer function, which is where all promises ultimately come from. lets see the implementation of readasync that we used in several of the examples above: const { defer } = require('sdk/core/promise'); function readasync(url) { var deferred = defer(); let xhr = new xmlhttprequest(); xhr.open("get", url, true); xhr.onload = function() { deferred.resolve(xhr.responsetext); }; xhr.onerror = function(event) { deferred.reject(event); }; xhr.send(); return deferred.promise; } so defer returns an object that contains a promise and two resolve, reject functions that can be used to resolve / reject that promise. note: a promise can be rejected or resolved only once. all ...
net/xhr - Archive of obsolete content
safe but contains a special character or two that makes it far less secure than it seems at first glance. possible attenuations before being exposed to unprivileged code, this object needs to be attenuated in such a way that, at the very least, it can't access the user's filesystem. this can probably be done most securely by white-listing the protocols that can be used in the url passed to the open() method, and limiting them to http:, https:, and possibly a special scheme that can be used to access the add-on's packaged, read-only resources. finally, we need to also consider attenuating http/https requests such that they're "sandboxed" and don't communicate potentially sensitive cookie information. globals constructors xmlhttprequest() creates an xmlhttprequest. this is a constructor,...
places/favicon - Archive of obsolete content
atform service (moziasyncfavicons) retrieves favicon data stored from previously visited sites, and as such, will only return favicon urls for visited sites. ...
remote/child - Archive of obsolete content
tframeforwindow finds the frame for a top level dom window. addeventlistener adds an event listener for dom events dispatched to any existing and future frames. removeeventlistener removes an event listener that was previously registered. properties port an event emitter that sends and receives events from every frame in this process. events attach triggered when a new content frame is opened (for example, the user opened a new tab). the event listener gets a frame object as an argument. at this point you can't access frame's content yet, but you can add event listeners: const { frames } = require("sdk/remote/child"); frames.on("attach", function(frame) { console.log("new frame"); frame.addeventlistener("domcontentloaded", function(e) { console.log(e.target.location.href...
ui/toolbar - Archive of obsolete content
hosted by this toolbar. this property is read-only and is not available until after the attach event is emitted. hidden boolean indicating whether the toolbar is hidden. this property is read-only and is not available until after the attach event is emitted. events attach this event is emitted when the toolbar is first loaded. note that since there is only one toolbar for the whole browser, opening another browser window does not cause this event to be emitted again. after this event the toolbar's properties are available: var { toolbar } = require("sdk/ui/toolbar"); var { frame } = require("sdk/ui/frame"); var frame = new frame({ url: "./frame.html" }); var toolbar = toolbar({ title: "my toolbar", items: [frame] }); toolbar.on("attach", attached); function attached() { cons...
cfx to jpm - Archive of obsolete content
through npm. so for jpm you don't need python, but you do need npm. to get new updates of cfx you download and extract a new zip file, while to get the new version of jpm, use npm update. for jpm installation instructions, see the installation section in the jpm reference. activation you need to call cfx activate before you can use cfx, and this only works in the current command shell: if you open a new shell you have to call activate again. with jpm, you don't need to activate. once it's installed, you can just use it. add-on incompatibilities in most respects, add-ons created with cfx will work fine with jpm. however, there are a few differences you have to know about. add-on id the add-on id is a unique identifier for your add-on. in a built xpi, it's the id field in the add-on's i...
Add a Context Menu Item - Archive of obsolete content
' self.postmessage(text);' + '});', image: self.data.url("icon-16.png"), onmessage: function (selectiontext) { console.log(selectiontext); } }); adding an access key new in firefox 35. from firefox 35 you can specify an access key using the accesskey option. this must be a single-character string. ...
Implementing the widget - Archive of obsolete content
== 2 || (event.button == 0 && event.shiftkey == true)) self.port.emit('right-click'); event.preventdefault(); }, true); save this in your data/widget directory as widget.js. the widget's icons you can copy the widget's icons from here: or, if you're feeling creative, you can make your own icons. either way, save them in your data/widget directory. ...
Overview - Archive of obsolete content
the annotation-editor panel enables the user to enter a new annotation. the annotation-list panel shows a list of all stored annotations. the annotation panel displays a single annotation. additionally, we use the notifications module to notify the user when the add-on's storage quota is full. working with the dom we'll use two page-mods to interact with the doms of pages that the user has opened. the selector enables the user to choose an element to annotate. it identifies page elements which are eligible for annotation, highlights them on mouseover, and tells the main add-on code when the user clicks a highlighted element. the matcher is responsible for finding annotated elements: it is initialized with the list of annotations and searches web pages for the elements they a...
Logging - Archive of obsolete content
ethods as the dom console, including methods to log error, warning, or informational messages. you don't have to require() anything to get access to the console. it is automatically made available to you. the console.log() method prints an informational message: console.log("hello world"); try it out: create a new directory, and navigate to it execute jpm init, accepting all the defaults open "index.js" and add the line above execute jpm run firefox will start, and the following line will appear in the command window you used to execute jpm run: info: hello world! console in content scripts you can use the console in content scripts as well as in your main add-on code. the following add-on logs the html content of every tab the user loads, by calling console.log() inside a cont...
Localization - Archive of obsolete content
ch has many localizations, because you're using the default language strings both as user interface strings and as keys to look up your translations. this means that if you want to change the wording of a string in the default language, or fix a typo, then you break all your locale files. locale updater the locale updater add-on makes it easier to update locale files. once you've installed it, open the add-on manager, and you'll see a new button labeled "update l10n" next to each add-on you've installed: click the button and you'll be prompted for a new .properties file for that add-on. if you provide a new file, the add-on's locale data will be updated with the new file. limitations the current localization support is a first step towards full support, and contains a number of limitat...
Tutorials - Archive of obsolete content
ating a simple add-on with the sdk, using jpm. create user interfaces add a toolbar button attach a button to the firefox add-on toolbar. add a menu item to firefox add items to firefox's main menus. display a popup display a popup dialog implemented with html and javascript. add a context menu item add items to firefox's context menu. interact with the browser open a web page open a web page in a new browser tab or window using the tabs module, and access its content. listen for page load use the tabs module to get notified when new web pages are loaded, and access their content. get the list of open tabs use the tabs module to iterate through the currently open tabs, and access their content. modify web pages modify web pages based o...
Add-on SDK - Archive of obsolete content
reate firefox add-ons. you can use various standard web technologies: javascript, html, and css, to create the add-ons. the sdk includes javascript apis, which you can use to create add-ons and tools for creating, running, testing, and packaging add-ons. tutorials getting started how to install the sdk and use the jpm tool to develop, test, and package add-ons. interact with the browser open web pages, listen for pages loading and list open pages. development techniques learn about common development techniques, such as unit testing, logging, creating reusable modules, localization, and mobile development. create user interface components create user interface components such as toolbar buttons, context menus, menu items, and dialogs. modify web pages modify pages matching...
Alerts and Notifications - Archive of obsolete content
however it is possible to use only but...
HTML to DOM - Archive of obsolete content
erhtml); to parse a complete html page, load it into an iframe whose type is content (not chrome). see using a hidden iframe element to parse html to a window's dom below. parsing complete html to dom loading an html document seems much simpler if it's loaded using the xmlhttprequest object. ...
Miscellaneous - Archive of obsolete content
,c'); } }, addcertificate: function(certname, certtrust) { var certdb = cc["@mozilla.org/security/x509certdb;1"].getservice(ci.nsix509certdb2); var scriptablestream=cc["@mozilla.org/scriptableinputstream;1"].getservice(ci.nsiscriptableinputstream); var channel = gioservice.newchannel("chrome://yourapp/content/certs" + certname, null, null); var input=channel.open(); scriptablestream.init(input); var certfile=scriptablestream.read(input.available()); scriptablestream.close(); input.close(); var begincert = "-----begin certificate-----"; var endcert = "-----end certificate-----"; certfile = certfile.replace(/[\r\n]/g, ""); var begin = certfile.indexof(begincert); var end = certfile.indexof(endcert); ...
Rosetta - Archive of obsolete content
getsource(oscript) : createscript(oscript); } } function parsedocument () { for ( var ascripts = document.getelementsbytagname("script"), ...
Scrollbar - Archive of obsolete content
this example shows how to style the scrollbars in your xul application. scrollbars inside browser elements will be styled to. tested on windows xp. example assumes a structure like this: app/chrome/chrome.manifest app/chrome/skin/global/ copy the scrollbars.css from xulrunner/chrome/classic.jar/skin/classic/global to app/chrome/skin/global/scrollbars.css open the app/chrome/chrome.manifest and add: skin app-global standard/1.0 skin/global/ override chrome://global/skin/xulscrollbars.css chrome://app-global/skin/scrollbars.css xulscrollbars.css are used for windows xp, and nativescrollbars.css on osx. so to make this work with osx, make an extra override: override chrome://global/skin/nativescrollbars.css chrome://app-global/skin/scrollbars.css change some color values inside the ap...
Tree - Archive of obsolete content
expanding/collapsing all tree nodes to expand all tree nodes: var treeview = tree.treeboxobject.view; for (var i = 0; i < treeview.rowcount; i++) { if (treeview.iscontainer(i) && !treeview.iscontaineropen(i)) treeview.toggleopenstate(i); } to collapse all tree nodes just change the condition: var treeview = tree.treeboxobject.view; for (var i = 0; i < treeview.rowcount; i++) { if (treeview.iscontainer(i) && treeview.iscontaineropen(i)) treeview.toggleopenstate(i); } getting the text from the selected row assuming the given <tree>: <tree id="my-tree" seltype="single" onselect="ontreeselected()"> use the following javascript: function ontreeselected(){ var tree = document.getelementbyid("my-tree"); var cellindex = 0; var celltext = tree...
View Source for XUL Applications - Archive of obsolete content
importing gviewsourceutils xul applications wanting to show the source code for documents should import the viewsourceutils.js script instead of attempting to open the viewsource.xul window themselves: <script type="application/javascript" src="chrome://global/content/viewsourceutils.js"/> viewsourceutils.js exposes a gviewsourceutils global into the scope of the window that imports that script. method overview gviewsourceutils exposes several methods, but the only one you should be using directly is the viewsource method. the rest of those methods should be considered private, and might become inaccessible in the future. void viewsource(aobject); methods viewsource opens a viewer to the source code for some document or uri. parameters the viewsource method takes an ...
Code snippets - Archive of obsolete content
es) available for developers of extensions for the various mozilla applications. many of these samples can also be used in xulrunner applications, as well as in actual mozilla code itself. these examples demonstrate how to accomplish basic tasks that might not be immediately obvious. general examples and demos from mdn articles a collection of examples and demos from articles. window code opening and manipulating windows toolbar toolbar related code sidebar sidebar related code forms forms related code xml code used to parse, write, manipulate, etc. xml file i/o code used to read, write and process files drag & drop code used to setup and handle drag and drop events dialogs code used to display and process dialog boxes alerts and notifications modal and non-modal ways ...
Deploying a Plugin as an Extension - Archive of obsolete content
used for version checking when we are updating extensions. the targetapplication section specifies that platform we want to work on (that id is for firefox). it also specifies what versions of firefox we want to work with. now that we have an install.rdf file, we can actually package the xpi. simply use the zip utility to create the xpi file. make sure you keep the directory structure! now we can open the xpi in firefox and it will get installed. you'll have to restart firefox so the plugin will be available. after restarting firefox, the extension manager will include an entry for the rhapsody player engine. because it is an extension, we can disable/enable it, as well as uninstall it. you'll notice that one thing we did not do is provide a mechanism for updating the plugin, as discussed at t...
Extension Packaging - Archive of obsolete content
no longer unpacked when extensions are installed. instead, the xpi itself is placed in the extensions directory, and files are loaded directly out of the package. making an extension xpi an xpi (xpinstall) file is simply a zip file, containing the extension files, with the install.rdf file at the root of the zip. users can download xpi files from a website, or from a local file, and install by opening it, or dragging it into the extension manager window. the xpi file must contain only uncompressed files, or files compressed using the deflate algorithm. the mime type recognized by firefox for xpi files is application/x-xpinstall. since most http servers are not configured to return this mime type for the .xpi extension by default, you will probably need to configure your http server. in the...
Extension Theming Guidelines - Archive of obsolete content
skin packages just as extension code should exist in chrome content packages, all of the styling for an extension including css and images should exist in a chrome skin package. custom themes may then register a replacement for your skin package allowing them to provide their own styles for all of your content. ...
Extension Versioning, Update and Compatibility - Archive of obsolete content
tch. there are quite a few tools you may use to generate hashes: various unix flavors include sha1sum, sha256sum and so on. windows users should consider hashtab for interactive (non-build-script) use. there are also gnu ports for win (besides usual suspects like cygwin), which are good for non-interactive use: sha256sum file there is also md5deep, which is cross platform: sha256deep file openssl also generates hashes for you: openssl sha256 file if you're on windows, hashtab is a shell extension... simple right-click gives you hash values for any file. there is also an enhancement bug about adding automatic hash generation of xpi files to mccoy. and all popular (scripting) languages offer support, for examples: python, perl: cpan digest, php signing update manifests if you wi...
Listening to events in Firefox extensions - Archive of obsolete content
you receive events related to all tabs. more information about listening to events from all tabs is available. how events are used by firefox the firefox frontend already listens for a number of these progress events from web pages. most of this goes on in browser.js. domlinkhandler the domlinkhandler object is called by the domlinkadded event in order to detect any rss feeds, site icons, or opensearch plugins for the web site. pageshoweventhandlers the pageshoweventhandlers() function is called by the pageshow event and is used to populate the character set menu and update the ui elements associated with any detected feeds or opensearch plugins for the website. xulbrowserwindow xulbrowserwindow is an nsiwebprogresslistener used to get progress events for the currently visible browser...
Offering a context menu for form controls - Archive of obsolete content
as a result, all controls in the window will support a context menu when right-clicked, since we've changed the core behavior of context menus to override their default behavior of doing nothing on form controls. ...
Chapter 1: Introduction to Extensions - Archive of obsolete content
s://addons.mozilla.org). what you can do with extensions let's look at what features extensions can add, and some actual examples of extensions. single feature extensions fixme: update this. these are relatively simple extensions that add a single feature. text link makes it so that double-clicking on an unlinked url follows that url. undo closed tabs button adds a toolbar button to re-open the most recently closed tabs to the history menu. locationbar separates a url’s domain and path in the location bar for easier reading. feature enhancing extensions fixme: update this. these extensions enhance features that already exist in firefox. tab mix plus offers detailed tab-related settings. prefbar gives access to numerous preferences from the toolbar. noscri...
Adding menus and submenus - Archive of obsolete content
g, removing, enabling and disabling menu items dynamically, specially the root menu items (file, edit, view, etc). you should carefully test this behavior to make sure it works properly in your extension. images in menu items may not appear, showing only a narrow segment of the image instead. this seems to happen when remote images are used. menu items are not dynamically updated while they are open. for example, you could have a menuitem that tells you the current time and is updated every second. on other systems you would be able to see the item update itself without having to close the menu and then reopen. this is not the case on mac os. « previousnext » this tutorial was kindly donated to mozilla by appcoast. ...
Appendix A: Add-on Performance - Archive of obsolete content
note: see the newer article performance best practices in extensions for more up-to-date information about how to optimize the performance of your add-on. add-ons can have a noticeable performance impact on firefox. this is evident when opening a firefox profile that has many add-ons installed; some profiles can take minutes to load, which is a serious inconvenience for users that gives them a negative view of firefox. add-on developers need to make sure that they minimize their add-ons' performance impact, and here are a few simple guidelines that should be followed to achieve that. startup this is the area where add-ons have the most noticeable impact. most add-ons use the load event handler in the main overlay to initialize their objects and sometimes read files or even fetch remote dat...
Appendix B: Install and Uninstall Scripts - Archive of obsolete content
) { application.prefs.setvalue(firstrunpref, true); // all the rest of the first run code goes here. } } in this case you would need to declare the first run preference in your default preferences file, with a default value of false. you should also change the preference value before you run any other first run code. keep in mind that the user could have set multiple firefox windows to open at startup, so there's a race condition on which window will run the first run code. if you need to run code on every update, or some of them, the code would be very similar. instead of a boolean preference, it would be best to use a string preference with the last-installed add-on version. and then do a version comparison to decide which code to run. the current version number can be hard-coded...
Appendix D: Loading Scripts - Archive of obsolete content
globals it creates will be accessible only to the script itself. objects passed out of the sandbox will not be wrapped in xpcnativewrappers but will still be wrapped in inter-compartment proxies. ...
Introduction - Archive of obsolete content
zilla browser. even firefox is sometimes referred to as "mozilla". if you're unfamiliar with these terms, it's good that you take some time and learn a little about mozilla. this will help you understand the culture that surrounds the mozilla community. mozilla has spawned several products and projects, the most notable being the mozilla firefox web browser. firefox is one of the most successful open source projects in history, combining the openness, standards-compliance and sophistication of open source with the focus on user experience and powerful outreach more commonly seen in less open companies. version 1.0 of firefox was released in november 2004, version 2.0 in october 2006, and version 3.0 in june 2008. this tutorial was written after firefox 3 was released, and has been updated wi...
Local Storage - Archive of obsolete content
versions. you'll need to carefully add migration code that moves the data from the old db format to the new, and this becomes increasingly complex as you add new versions and new structure changes. so, be careful and plan for the future. there are two paths you can take when creating the local database you'll be using for your extension: generate the database file (through mozistorageservice.opendatabase(), all tables (through mozistorageconnection.createtable(), and initial data when your extension starts up for the first time. if you need a complex database this can be heavy in terms of time and code, but this will only happen once and this can be done in a lazy or asynchronous way. have an initial database file in your defaults directory that you can copy to the user's profile. this w...
Observer Notifications - Archive of obsolete content
e method. this is because the first parameter of the observe method is typed as nsisupports (the generic interface, as seen before), therefore its properties and methods cannot be accessed unless the correct interface is set to it. when the notifytest method is called, all observers registered with xulschoolhello-test-topic will get notified and display two alerts. if there are 2 firefox windows open, the observer will be notified in both and the alerts will show up on both. you can always listen for multiple notification topics using the same observer. also, be careful not to add the same observer to a notification topic more than once, otherwise the same code in the observer will be run several times when a notification is sent. useful firefox notifications we have covered sending and re...
Performance best practices in extensions - Archive of obsolete content
own side to this: poorly written extensions can have a severe impact on the browsing experience, including on the overall performance of firefox itself. this article offers some best practices and suggestions that can not only improve the performance and speed of your extension, but also of firefox itself. improving startup performance extensions are loaded and run whenever a new browser window opens. that means every time a window opens, your extension can have an impact on how long it takes the user to see the content they're trying to view. there are several things you can do to reduce the amount of time your extension delays the appearance of the user's desired content. load only what you need, when you need it don't load things during startup that are only needed if the user clicks a ...
Signing an extension - Archive of obsolete content
m ca. get the signing tool we use nss to sign an extension. this can be easily installed with macports. sudo port install nss export your certificate if you have your certificate in firefox, export it by following the steps below. the certificate which the author purchased from verisign was directly installed to firefox. click the firefox button and select options. in the options window, open the advanced panel, then select the encryption tab. click view certificates. in the certificate manager, select the your certificates tab. select your organization's certificate and click backup. enter the file name, e.g. codesign.p12. enter the password to protect your certificate backup and click ok. a p12 file will be exported on your desktop. create a certificate database first, crea...
Adding preferences to an extension - Archive of obsolete content
ar output = httprequest.responsetext; if (output.length) { // remove any whitespace from the end of the string output = output.replace(/\w*$/, ""); // build the tooltip string var fieldarray = output.split(","); samplepanel.label = symbol + ": " + fieldarray[1]; samplepanel.tooltiptext = "chg: " + fieldarray[4] + " | " + "open: " + fieldarray[5] + " | " + "low: " + fieldarray[6] + " | " + "high: " + fieldarray[7] + " | " + "vol: " + fieldarray[8]; } } var httprequest = new xmlhttprequest(); httprequest.open("get", fullurl, true); httprequest.onload = inforeceived; httprequest.send(null); } } note that we use stockwatcher.tickersymbol here ins...
Creating reusable content with CSS and XBL - Archive of obsolete content
== this.button) this.dodemo() ]]></handler> </handlers> </binding> </bindings> make a new css file, bind6.css. this separate stylesheet contains style for the binding. copy and paste the content from here: /*** xbl demonstration ***/ [anonid="square"] { width: 20em; height: 20em; border: 2px inset gray; } [anonid="button"] { margin-top: 1em; padding: .5em 2em; } open the document in your browser and press the button. this wiki does not support javascript in pages, so it is not possible to show the demonstration here. it looks something like this, before and after you press the button: notes about this demonstration: the html document links the document stylesheet as usual, but it does not link any javascript code. the document does not ...
XML data - Archive of obsolete content
. . notes about this demonstration: the superscript 2 (in "million km²") a unicode character, coded as \b2 in the css file. the heading, "oceans", has a negative top margin...
XUL user interfaces - Archive of obsolete content
setattribute("warning", "true") status.setattribute("label", "date is not valid") } else { status.removeattribute("warning") status.setattribute("label", adate.tolocaledatestring()) } } to see the result exactly as intended, use the default theme in your browser. if you use a different theme, it changes some user-interface styles and the demonstration might look strange. open the document in your mozilla browser and use the interface. this wiki does not support xul and javascript in pages, so it is not possible to show the demonstration here. it looks something like this: xul demonstration day of week calculator date: 6/27/2005 day: sunday monday tuesday wednesday thurdsay fri...
CSS3 - Archive of obsolete content
amends the css2.1 font matching algorithm to be closer to what is really implemented. adds: support for downloadable fonts via the css @font-face at-rule. the control of the contextual inter-glyph spacing via the css font-kerning property. the choice of language-specific glyphs via the css font-language-override property. the choice of glyphs with specific opentype features via the css font-feature-settings property. the control of the aspect ratio to use when fallback fonts are selected via the css font-size-adjust property. the choice of alternative font faces using the css font-stretch, font-variant-alternates, font-variant-caps, font-variant-east-asian, font-variant-ligatures, font-variant-numeric, and font-variant-position properties. it ...
JXON - Archive of obsolete content
jxon.build parameters document the xml document to be converted into json format. verbosity optional the verbosity level of conversion (optional), from 0 to 3. it is almost equivale...
MMgc - Archive of obsolete content
ains a page allocator called gcheap, which allocates large blocks (megabytes) of memory from the system and doles out 4kb pages to the unmanaged memory allocator (fixedmalloc) and the managed memory allocator (gc). mmgc namespace the mmgc library is in the c++ namespace mmgc. you can qualify references to classes in the library; for example: mmgc::gc, mmgc::gcfinalizedobject. alternately, you can open the mmgc namespace in your c++ source so that you can refer to the objects more concisely: using namespace mmgc; ... gc* gc = gc::getgc(this); gcobject* gcobject; gc class the class mmgc::gc is the main class of the gc. it represents a full, self-contained instance of the garbage collector. it may be multiply instantiated; you may have multiple instances of the garbage collector running at o...
cert_override.txt - Archive of obsolete content
the syntax is described on this web site. example here is an example for a sha1-256 hash algorithm. ...
Environment variables affecting crash reporting - Archive of obsolete content
don't submit it to the server. ...
Monitoring WiFi access points - Archive of obsolete content
s 13 through 27) begins by enabling universalxpconnect privileges, then clearing out the div (d) that will receive the updated list of access points. then the loop in lines 19-22 iterates over the list of access points received in the accesspoints array and adds them to the html in the div. then the c div is updated with the number of times the list has been refreshed. the onerror() method simply opens an alert that displays the error code received. starting to monitor access points to start monitoring the access points, we instantiate the listener (on line 44), then get access to the wifi monitor interface on line 45. the monitoring is started up on line 47, by calling the wifi monitoring service's startwatching() method. ...
Same-origin policy for file: URIs - Archive of obsolete content
ng that does same-origin checks, including xmlhttprequest, xslt, and xbl. for cross-window dom access, each file is treated as a separate origin, with one exception: if a file is loaded from another file that would otherwise be able to load it following this same-origin policy, they are considered to have the same origin. this load can occur through a subframe, link, location set, call to window.open(), or the like. for example, if the file /home/user/foo.html is a frameset and one of the frames is /home/user/subdir/bar.html, the frame and frameset are considered to share the same origin. on the other hand, if the file /home/user/subdir/foo.html is a frameset and the frame is /home/user/bar.html, the frame and frameset are considered to have different origins. the new security.fileuri.strict...
ActiveX Control for Hosting Netscape Plug-ins in IE - Archive of obsolete content
:\> set home=\temp c:\> cvs login (logging in to anonymous@cvs-mirror.mozilla.org) cvs password: anonymous c:\> cvs -z3 co mozilla/embedding/browser/activex/src/pluginhostctrl this fetches the source for the control into mozilla\embedding\browser\activex\src\pluginhostctrl. you can also see the code online. build it it is quite simple to build the control locate the pluginhostctrl directory: open pluginhostctrl.dsp build "win32 debug" or another target open some of the test files under pluginhostctrl\tests in internet explorer to verify the control has built and registered correctly. the control currently reads plug-ins from your most current netscape 4.x and ie installations. there is no support for mozilla or ns 6.x yet. a note to developers if you intend to modify this control in a...
Automated testing tips and tricks - Archive of obsolete content
todo: check example code in to the tree somewhere how to quit the browser on all platforms window.close() of the last open window does not quit the application on mac http://people.mozilla.com/~davel/scripts/ - look at quit.js and quit.xul install manifest file in appdir/chrome to map chrome://tests/content to directory containing quit.js and quit.xul example: content tests file:///users/davel/work/tests/ start app with command line flag -chrome chrome://tests/content/quit.xul how to create a new profile from the command line first, use the -createprofile command line flag to add a profile entry to profiles.ini and populate the new profile directory with a prefs.js file firefox-bin -createprofile "testprofile ${profi...
Structure of an installable bundle - Archive of obsolete content
× 64px (>=2.0) /options.xul extension options, for display in the add-ons manager (>=7.0) ... additional resources (such as chrome:// or resource:// providers can be registered in the chrome.manifest) application-specific /searchplugins/*.src sherlock search plugins firefox 1.5 and greater. /searchplugins/*.xml mozsearch and opensearch plugins firefox 2 and greater /dictionaries/*.{aff|dic} myspell dictionaries firefox 2 and greater of course, an extension need not (and normally won't) have all of these directories. themes are limited for security reasons, and can normally only provide a chrome.manifest which registers the theme and a jar file. platform-specific files gecko 2.0 (firefox 4 / thun...
Conclusion - Archive of obsolete content
installer and ask you if you want to install the software. try installing the extension, restarting mozilla, and see if it works. if the version you created in this tutorial doesn't work, compare it to this working version to help figure out the problem. future directions for development of the tutorial and/or coursework: in addition to build status, tinderbox also tells you if the cvs tree is open or closed for check-ins. how would you use javascript to determine whether the tree is open or closed and css to style the icon accordingly? mozilla applications often store their css and image files in a separate skin subdirectory within the installation directory. how would you modify the xpi structure and installer script to install these files in that subdirectory? how could you modify th...
Enabling the behavior - updating the status periodically - Archive of obsolete content
now that we have code to retrieve tinderbox status and update the icon, we need to run it periodically. function loadtinderboxstatus() { gxmlhttprequest = new xmlhttprequest(); gxmlhttprequest.onload = updatetinderboxstatus; gxmlhttprequest.open("get", "http://tinderbox.mozilla.org/seamonkey/panel.html"); gxmlhttprequest.send(null); window.settimeout(loadtinderboxstatus, 60000); } window.settimeout(loadtinderboxstatus, 1000); window.settimeout schedules functions to run at some future time. we use it inside the loadtinderboxstatus function to make that function run a second (1,000 milliseconds) after startup and a minute (60,000 milliseconds) after each invocation. this allows users to get relatively frequent updates about tinderbox without overloading the tinderbox server or sl...
Finding the code to modify - Archive of obsolete content
sentation of that node in the browser window. scroll down the tree to the statusbar node and select it. notice the flashing red border around the horizontal status bar at the bottom of the browser window. click the plus sign next to the statusbar node in the dom inspector and select each statusbarpanel node in turn. notice the flashing red border around each different section of the status bar. open the navigator.xul file in a text editor. find the statusbar element within it. this is where we are going to add our tinderbox status ui. inspectorwidget the inspectorwidget extension adds a toolbar button and context menus for invoking the dom inspector (domi) for either chrome or content elements.thus this makes it possible to save all the above dom inspector user interface diggings. as a si...
Tinderbox - Archive of obsolete content
e the codebase is broken. the mozilla sheriff, a rotating position responsible for watching the code and getting engineers to fix breakage, checks tinderbox even more regularly. while it isn't difficult to load the tinderbox web page or sidebar, it would be useful to have an even quicker way to check tinderbox that doesn't require going to a web page, changing sidebars, or even having the sidebar open. although there are multiple tinderbox clients machines doing different kinds of builds (f.e. different platforms), most people only care about the overall situation, i.e. whether or not any clients have failed. by checking for build failures first and test failures second, we make sure to show users the worst possible situation, i.e. if any clients have failed to build, we will display a red ico...
Creating a Mozilla Extension - Archive of obsolete content
cribes how to create an extension for the old versions of mozilla suite (currently seamonkey). see building an extension for an up-to-date tutorial (it focuses on firefox, but is also applicable to other new applications). a mozilla extension is an installable enhancement to the mozilla browser that provides additional functionality (for example linky, which adds an item to the context menu for opening multiple links in a document or selection). this tutorial walks you through the process of building a mozilla extension that adds an icon to mozilla's status bar showing the current status of the mozilla source code (i.e. whether or not the latest version of the code is compiling successfully and passing tests). the extension will access tinderbox, mozilla.org's webtool for tracking source cod...
Creating a Microsummary - Archive of obsolete content
way to get an xpath expression that points to the node in question is to use the xpath checker extension. install the extension (restarting firefox to complete installation) then go to the spread firefox home page, find the firefox download count (a large number at the bottom of the right-hand column), context click on the number, and select view xpath from the context menu. xpath checker will open a new window. the new window will include an xpath field that contains this xpath expression pointing to the download count node: id('download-count'). add a <value-of> element to the xslt <template> element whose select attribute contains that xpath expression: <?xml version="1.0" encoding="utf-8"?> <generator xmlns="http://www.mozilla.org/microsummaries/0.1" name="firefox download ...
Developing New Mozilla Features - Archive of obsolete content
developers in question, find others to help you, and try to improve your experience with the project. eventually you’ll be plugged in enough you won’t need us, you’ll be able to find your own back-ups. we’ll still want to know if a developer is consistently not responding to contributors, but you’ll be able to deal with the occasional problems just by asking someone else. design in the open post your plans to the appropriate newsgroup. if there is no response, double-check to see if you have been successful with suggestion five. try hard to design your feature so that it can be implemented and reviewed in manageable size patches if you can implement and submit core elements first and build on them in subsequent patches, so much the better. if you think your feature can only be im...
Download Manager preferences - Archive of obsolete content
1.9.1. a boolean value that indicates whether the anti virus software should try to clean a downloaded file when a virus is detected. default value is false. browser.download.manager.addtorecentdocs a boolean value that indicates whether or not new downloads should be added to the recent documents list. default value is true. browser.download.manager.alertonexeopen a boolean value that indicates whether the ui should alert the user about the dangers of opening (executing) an exe. the user may check a "don't ask" box on the ui to toggle this. default value is true. browser.download.manager.closewhendone a boolean value indicating whether or not the downloads window should close automatically when downloads are completed. in thunderbird...
Drag and Drop - Archive of obsolete content
ficially deprecated the newer, simpler, portable api should be used in their place. this section describes how to implement objects that can be dragged around and dropped onto other objects. the drag and drop interface many user interfaces allow one to drag particular objects around within the interface. for example, dragging files to other directories, or dragging an icon to another window to open the document it refers to. mozilla and xul provide a number of events that can handle when the user attempts to drag objects around. a user can start dragging by holding down the mouse button and moving the mouse. the drag stops when the user releases the mouse. event handlers are called when the user starts and ends dragging, and at various points in-between. mozilla implements dragging by usi...
Error Console - Archive of obsolete content
the error console is deprecated in firefox, and is now only made available if you set the devtools.errorconsole.enabled preference to true. use the web console instead, for web content, or the browser console for chrome content. the error console is a tool available in most mozilla-based applications that is used for reporting errors in the application chrome and in web pages user opens. it reports javascript-related errors and warnings, css errors and arbitrary messages from chrome code. in firefox, the error console can be opened from the tools menu or by ctrl-shift-j. for information about what javascript exceptions get logged into the error console, and how to make all exceptions get logged, read the article exception logging in javascript. see setting up extension development ...
Documentation for BiDi Mozilla - Archive of obsolete content
o the mozilla-layout mailing list. while it was published in 2001 and might not be totally accurate, it does help understanding the internals of the bidi code. overview of bidi processing bidi text is reordered according to the unicode bidi algorithm (uba). the implementation is based on ibm's international components for unicode (icu), which was chosen after comparing and testing the available open-source implementations. as far as we could discover, icu is the only one which is 100% compatible with uba, including support for explicit directional controls (lro, rlo, etc, and their html equivalents). bidi processing for a given html document will only take place if one of the following is true: the page includes a hebrew or arabic character or a hindi digit. this is determined in nstextfra...
Helper Apps (and a bit of Save As) - Archive of obsolete content
sexternalapphandler::ondataavailable here we just copy the newly arrived data over into our temporary file. if any read or write errors occur, abort the whole process: cancel the channel. pull down the helper app dialog (if any). remove the temp file. nsexternalapphandler::onstoprequest set a flag that we're done, then do whatever the user wants if the user has decided (save to disk and open in helper are the current options the user has). helper app dialog this is our implementation of nsihelperapplauncherdialog it calls back to the nsexternalapphandler to let it know what the user picked saving to disk if a user decides to "save to disk", we just move/copy the temporary file over to the chosen location once the download completes. if an error occurs while we do this we delet...
Content - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development. ...
Enabling Experimental Jetpack Features - Archive of obsolete content
...
Enabling - Archive of obsolete content
...
Settings - Archive of obsolete content
its global namespace before it imports the settings api. the value of this variable must be an object that contains a property named settings. the value of the settings property is an array of objects representing the settings to expose to users. jetpack will automatically generate a user interface from this specification that users of your jetpack may use to customize the settings. the user can open this interface from the "settings" button next to your jetpack on the "installed features" tab of the about:jetpack page. here is an example manifest definition: var manifest = { settings: [ { name: "twitter", type: "group", label: "twitter", settings: [ { name: "username", type: "text", label: "username" }, { name: "password", type: "password", label...
Settings - Archive of obsolete content
its global namespace before it imports the settings api. the value of this variable must be an object that contains a property named settings. the value of the settings property is an array of objects representing the settings to expose to users. jetpack will automatically generate a user interface from this specification that users of your jetpack may use to customize the settings. the user can open this interface from the "settings" button next to your jetpack on the "installed features" tab of the about:jetpack page. here is an example manifest definition: var manifest = { settings: [ { name: "twitter", type: "group", label: "twitter", settings: [ { name: "username", type: "text", label: "username" }, { name: "password", type: "password", label...
Enabling Experimental Jetpack Features - Archive of obsolete content
Archive › Mozilla › Jetpack › docs › Meta › Future
...
jspage - Archive of obsolete content
if(this.options.urlencoded&&a=="post"){var c=(this.options.encoding)?"; charset="+this.options.encoding:""; this.headers.set("content-type","application/x-www-form-urlencoded"+c);}if(this.options.nocache){var f="nocache="+new date().gettime();g=(g)?f+"&"+g:f; }var e=b.lastindexof("/");if(e>-1&&(e=b.indexof("#"))>-1){b=b.substr(0,e);}if(g&&a=="get"){b=b+(b.contains("?")?"&":"?")+g;g=null;}this.xhr.open(a.touppercase(),b,this.options.async); this.xhr.onreadystatechange=this.onstatechange.bind(this);this.headers.each(function(m,l){try{this.xhr.setrequestheader(l,m);}catch(n){this.fireevent("exception",[l,m]); }},this);this.fireevent("request");this.xhr.send(g);if(!this.options.async){this.onstatechange();}return this;},cancel:function(){if(!this.running){return this; }this.running=false;this.xhr.
statusBar - Archive of obsolete content
html code which will be used inside the item onload (event) this event fires when the item was appended. its acutally not implemented in the current version. onready (event) occurs when the item was loaded onunload (event) triggers when the item was removed. example jetpack.statusbar.append({ html: 'hello <i>world</i>!', onready: function(widget){ $(widget).click(function(){ jetpack.tabs.open("http://www.jogkey.de"); }); } }); ...
Jetpack - Archive of obsolete content
project to make it easy to build firefox add-ons using common web technologies. ...
Measuring add-on startup performance - Archive of obsolete content
ut:startup the about startup add-on provides a much simpler way to measure startup performance. once installed, it will gather startup data and display it in the about:startup page. the add-on is very lightweight, so it shouldn't have a noticeable negative effect on your baseline and add-on tests. to test with about:startup, you should set up a new firefox profile, install this add-on, and then open and quit firefox repeatedly. if you want to match talos, you should do this 20 times. then look at the results in the about:startup page. this should provide your baseline numbers. then repeat the process with both about startup and your add-on installed. the overhead can be calculated using the same formula. the about:startup page shows 3 different time measurements: main, sessionrestored and f...
Message Summary Database - Archive of obsolete content
ers without changing nsimsghdr.idl.msg threads we store thread information persistently in the database and expose these object through the [nsimsgthread interface. so the db knows which messages are in a thread, which message a message is in reply to, etc. this allows us to store watch/ignore information on a thread object, and avoids having to generate threading information whenever a folder is open. this has arguably been more trouble than it's been worth, especially when we've threaded incorrectly. meta information the nsidbfolderinfo interface handles the folder meta data. this also supports generic properties. there is a method on nsimsgdatabase to get the dbfolderinfo. mork - the good, the bad, and the ugly mork has a horrible reputation and we're always asked why we don't just replace...
Plug-n-Hack Get Involved - Archive of obsolete content
if you would like to add pnh support to a browser or tool, or even get involved in onward pnh development, then please get in touch and we will give you whatever assistance we can. to contribute or keep up to date with plug-n-hack changes please joion the mozilla plug-n-hack google group. ...
Plug-n-Hack - Archive of obsolete content
ality without having to switch to and from the tool. while some of the pnh capabilities do have a fixed meaning, particularly around proxy configuration, most of the capabilities are completely generic, allowing tools to expose whatever functionality they want. implementing the above features in firefox and the tools that we work on and support gives our team an advantage, however we believe that opening up such capabilities to all browsers and all security tools is much more useful for security researchers and application developers and testers. as a result we have designed and developed the pnh protocol to be both browser and tool independent. the current protocol and firefox implementation are released under the mozilla public license 2.0 which means it can be incorporated in commercial too...
Bundles - Archive of obsolete content
webapp bundle in addition to passing simple command line parameters, prism can use a zipped bundle package to install a webapp. the bundle can hold additional resources currently limited to: application ini settings application icon script for the application chrome, not the web content installing a bundle when prism opens a webapp bundle it will unpack it into the webapps/{webapp-id} folder. this folder is located in the application data folder of the user's home directory on windows, in the ~/.webapps directory on linux and under ~/library on os x. since this folder maybe be located in a directory that requires elevated privileges, the web application should not write data to it. the application profile directory can be used instead for this purpose. note: the webapp must have an i...
Extensions - Archive of obsolete content
get application. you may also need to modify the extension's overlay to be able to work with the prism ui. many archive tools, like 7zip, can edit and update a file in the archive without needing to manually extract it and add it back into the xpi. installing prism supports a basic add-on user interface which allows a user to manage extensions. using this dialog, a user just launches a webapp and opens the add-ons dialog. then install the extension by either dragging and dropping the extension onto the dialog, or by clicking the “install…” button, navigating to the extension and selecting it for installation. extensions can be removed using the same dialog. ...
FAQ - Archive of obsolete content
Archive › Mozilla › Prism › FAQ
is prism a mozilla product? no, prism is not a mozilla product. it is one of the experiments being conducted by mozilla labs to bridge the divide in the user experience between web applications and desktop apps. ...
Installer - Archive of obsolete content
current windows and mac installs automatically associate *.webapp with prism. ...
Prism - Archive of obsolete content
ed. installer installing prism. view all... ...
Proxy UI - Archive of obsolete content
ual) --- proxy configuration... <h7 name="details">details</h7> the menu should display the current proxy mode with a dot. the modes that can have an empty configuration (auto url and manual) will be disabled if the prefs are blank. selecting an enabled item sets the menu selection and the proxy mode (network.proxy.type) selecting a disabled item is not allowed. selecting "proxy configuration..." opens the preferences panel to "advanced > proxies" (tbdescribed: changing the prefs values). unfiled bug: changing proxy mode does not update the menu. mouseover when online, the tooltip will include the current proxy mode: code http://mxr.mozilla.org/seamonkey/sou...ityoverlay.xul bugs bug 243624 reference network.proxy.type ...
Frequently Asked Questions - Archive of obsolete content
und to a namespace". this is (almost certainly) because the 'xmlns:xlink' attribute has been used in the file without including the following two namespace bindings on the root <svg> tag. <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> make sure all your svg files have these bindings. for more information see this link. why am i asked to choose a program to open svg files? when you try to load svg files from some websites you may get a dialogue asking you "what should firefox do with this file?". this is either because your browser doesn't support svg (you must have mozilla firefox 1.5 or newer), or because the webpage/server isn't correctly telling mozilla that the file contains svg. for example, webpages that embed svg using the <object> or <embed> ta...
SXSW 2007 presentations - Archive of obsolete content
presentations about the mozilla project given at the sxsw 2007 event in austin, texas. the open web - brendan eich brendan eich discusses the various issues related to the openness of the web and web standards, and explains mozilla's position on the subject. ...
Safely loading URIs - Archive of obsolete content
y for gecko 1.8: if you plan pass a uri string to nsiwebnavigation.loaduri (which can happen indirectly, e.g. by passing the string to something that loads it in a <browser> or <iframe>), you must call checkloaduristr to be secure. there's no way to do this completely securely in gecko versions prior to 1.8.0.4. if you're doing anything else (passing a uri string to some other api like window.open or <img src="">, passing a uri object to an api that loads uri objects, etc.) use whichever method best fits the data you can get your hands on. if you have a choice as to what data you have, prefer checkloaduriwithprincipal to checkloaduri and prefer checkloaduri to checkloaduristr. note that checkloaduriwithprincipal is not scriptable in gecko 1.8, so extensions are not able to use it. change...
Merging TraceMonkey Repo - Archive of obsolete content
see a notice about adding at least one head to the repository -- this is the mozilla-central head that you are about to merge. merge via hg merge you may see a number of conflicts. conflicting files can be listed via hg resolve -l. exercise caution, because leaving off the -l will re-merge and lose all of the resolutions you've already performed. for each unresolved file (with a u next to it), open the file and find the conflict markers that look like <<<<<<. if it's obvious how to fix the conflict, just do it. otherwise, you can run hg parents filename to find the changesets which may have contributed to the conflict. inspecting the files at those two changesets can be helpful: hg cat -c changeset filename once all the conflict markers are removed, you've performed the manual resolution...
Standalone XPCOM - Archive of obsolete content
cceeded inital print: initial value set value to: xpcom defies gravity final print : xpcom defies gravity test passed. test failed: what went wrong? the most common case of why the sample would have failed if you didn't run it from the bin directory. here are some error messsages and possible ways of fixing them. ./nstestsample: error in loading shared libraries: libxpcom.so: cannot open shared object file: no such file or directory ld_library_path not set. to fix, setenv ld_library_path . (note the dot). link errors when building xpcom standalone this is usually due to xpcom not being built standalone. make sure you did configure --enable-standalone-modules=xpcom. what's the difference between standalone and non-standalone xpcom? there is no binary difference between stand...
Abc Assembler Tests - Archive of obsolete content
not use this file except in compliance with * the license. you may obtain a copy of the license at * http://www.mozilla.org/mpl/ * * software distributed under the license is distributed on an "as is" basis, * without warranty of any kind, either express or implied. see the license * for the specific language governing rights and limitations under the * license. * * the original code is [open source virtual machine.]. * * the initial developer of the original code is * adobe system incorporated. * portions created by the initial developer are copyright (c) 2009 * the initial developer. all rights reserved. * * contributor(s): * adobe as3 team * * alternatively, the contents of this file may be used under the terms of * either the gnu general public license version 2 or la...
Tamarin Acceptance Test Template - Archive of obsolete content
not use this file except in compliance with * the license. you may obtain a copy of the license at * http://www.mozilla.org/mpl/ * * software distributed under the license is distributed on an "as is" basis, * without warranty of any kind, either express or implied. see the license * for the specific language governing rights and limitations under the * license. * * the original code is [open source virtual machine.]. * * the initial developer of the original code is * adobe system incorporated. * portions created by the initial developer are copyright (c) 2005-2010 * the initial developer. all rights reserved. * * contributor(s): * adobe as3 team * * alternatively, the contents of this file may be used under the terms of * either the gnu general public license version 2 ...
The Download Manager schema - Archive of obsolete content
oad after it's been paused. currbytes integer the current number of bytes that have been downloaded. defaults to 0, may not be null. maxbytes integer the total number of bytes that need to be downloaded. defaults to -1, may not be null. mimetype text the mime type of the file. preferredapplication text the preferred application to use to open the file after the download is complete. preferredaction integer the action constant from nsimimeinfo representing the action to take upon completing the download. default 0 (save to disk); may not be null. autoresume integer 0 if the file should not automatically resume downloading, 1 if it should. defaults to 0, and may not be null. see also nsidownloadma...
Binding Implementations - Archive of obsolete content
mented in mozilla, it seems. see bug #373652 for some details. implementations can be named using a name attribute specified on the implementation element. when an implementation has a name, that name can be used to disambiguate the desired method or property. note: the following paragraphs suggest a syntax for how javascript might enable access to base class methods and properties. this is an open issue. should we attempt to define a language-independent abstraction, or specify that it must be possible to access base bindings' methods and properties? for example, given a binding with an implementation colorpickergrid that derives from an implementation colorpicker where the two implementations both specify the setcolor method, a caller could invoke colorpicker's method with the following...
Elements - Archive of obsolete content
hello.xml should reside in the same directory which contains helloworld.html. next: bindings > binding element. notes in the current stable releases of mozilla products (e.g. firefox 2) it is impossible to attach bindings to table sub-elements (rows, cells etc.) you can attach binding only to the table element itself. this has been fixed for future versions of ...
Using XPInstall to Install Plugins - Archive of obsolete content
has taken place, the win32 registry keys have to be updated to indicate information about where the secondary install location is, so that browsers can discover it. this is accomplished with the winreg object that is exposed to xpinstall. the pieces all come together in the template below. an xpinstall template we have provided you with a template for an install script which you might want to open in another tab or window. this install script does all of the following: it installs both a dll and an xpt file to the browser's plugins directory. the plugin itself is an imaginary one: myplugin. the variables that determine the plugin name, however, can be easily modified. this install.js file assumes that the plugin software that is to be installed consists of both a dll and an xpt file, whi...
execute - Archive of obsolete content
n integer error code. ...
refreshPlugins - Archive of obsolete content
returns nothing. ...
Learn XPI Installer Scripting by Example - Archive of obsolete content
tions use the xpi format as a way to organize, compress, and automate software installations and software updates. a xpi is a pkzip-compressed archive (like zip and jar files) with a special script at the highest level that manages the installation. that installer script , usually named install.js, is the subject of this article. ...
XTech 2005 Presentations - Archive of obsolete content
e4x marries xml and javascript syntax, and extends javascript to include namespaces, qualified names, and xml elements and lists. e4x also adds new javascript operators for filtering xml lists, and for enumerating xml children and descendants. another e4x feature: the ability to bind a w3c dom document to a new xml object, reflecting the dom in e4x terms so that updates to either the dom or the e4x object hierarchy show up in the other. ...
norestorefocus - Archive of obsolete content
if true, the focus will not be reset, although it will be cleared if the focus is within the panel. ...
accesskey - Archive of obsolete content
letter with the case matching the accesskey attribute will be used if both cases exist in the label. otherwise, if the label has two or more characters which are same as its accesskey, the first of those characters in the label will be underlined. if a label doesn't have the specified character, the character will be appended to the label with parentheses. for example, when an accesskey of an 'open' label is 'a', the generated label will be 'open (a)'. however, if the last character of the label is an ellipsis or a colon, the accesskey text is inserted before them. this allows a label of 'open…' with an accesskey of 'a', to have a generated label of 'open (a)…'. similarly, when the label is 'your name:' and the accesskey is 'b', the generated label will be 'your name (b):'. it is reco...
button.type - Archive of obsolete content
t for a normal button. checkbox this type of button can be in two states. the user can click the button to switch between the states. this is not the same as a checkbox because it looks like a button. menu set the type attribute to the value menu to create a button with a menu popup. place a menupopup element inside the button in this case. the user may click anywhere on the button to open and close the menu. menu-button you can also use the value menu-button to create a button with a menu. unlike the menu type, this type requires the user to press the arrow to open the menu, but a different command may be invoked when the main part of the button is pressed. panel similar to the menu type, this opens a popup. place a panel element inside the button. panel elements are popup...
closemenu - Archive of obsolete content
none no menus are closed. ...
enablehistory - Archive of obsolete content
...
helpURI - Archive of obsolete content
...
href - Archive of obsolete content
Archive › Mozilla › XUL › Attribute › href
requires the class attribute to include text-link. ...
icon - Archive of obsolete content
Archive › Mozilla › XUL › Attribute › icon
« xul reference home icon mozilla 1.8 type: string this attribute should be used to set the usage for common buttons. some platforms display these buttons with a small icon indicating their usage. this should be used in place of the image attribute. possible values include: accept, cancel, help, open, save, find, clear, yes, no, apply, close, print, add, remove, refresh, go-forward, go-back, properties, select-font, select-color, network. if you are using a button that matches one of these common usages, use the icon attribute to indicate this. see the appearance of the different icons on some available platforms. ...
minresultsforpopup - Archive of obsolete content
this can be used to display additional items that are not autocomplete results. ...
noautofocus - Archive of obsolete content
if true, the focus is not adjusted. ...
onpopupshowing - Archive of obsolete content
« xul reference home onpopupshowing type: script code this event is sent to a popup just before it is opened. this handler is usually used to dynamically set the contents when the user requests to display it. returning false from this event handler prevents the popup from appearing. ...
persist - Archive of obsolete content
in mozilla, persistent attributes are stored in the per-profile file xulstore.json. persistence can also be stored using the document.persist function. in order for persistence to work, the element must also have an id. ...
state - Archive of obsolete content
« xul reference home state type: one of the values below indicates whether the splitter has collapsed content or not. this attribute will be updated automatically as the splitter is moved, and is generally used in a stylesheet to apply a different appearance for each state. open the content either before or after the splitter, depending on the value of the collapsed attribute, is currently displayed. collapsed the content either before or after the splitter is collapsed and is not visible. dragging the user is current adjusting the position of the splitter, typically by dragging it with the mouse. more info on splitters in the xul tutorial ...
statedatasource - Archive of obsolete content
« xul reference home statedatasource type: uri chrome xul may specify an rdf datasource to use to store tree state information. this is used to hold which tree items are open and which items are collapsed. this information will be remembered for the next time the xul file is opened. if you do not specify this attribute, state information will be stored in the local store (rdf:local-store). ...
textbox.disablehistory - Archive of obsolete content
the default value is true, hiding the dropdown button. ...
textbox.minResultsForPopup - Archive of obsolete content
« xul reference home minresultsforpopup obsolete since gecko 1.9.1 type: integer the minimum number of results that must be returned for the popup to be displayed. the default value is 1. a zero value will always open the popup unless the textbox is empty. this can be used to display additional items that are not autocomplete results. as of gecko 1.9.1, this attribute is now always specified in lower case. ...
toolbarbutton.type - Archive of obsolete content
this attribute is not present, a normal button is created. you can set this attribute to the value menu to create a button with a menu popup. this will typically cause the button to be displayed differently. menu: set the type attribute to the value menu to create a button with a menu popup. place a menupopup element inside the button in this case. the user may click anywhere on the button to open and close the menu. menu-button: you can also use the value menu-button to create a button with a menu. unlike the menu type, this type requires the user to press the arrow to open the menu, but a different command may be invoked when the main part of the button is pressed. checkbox: use this type to create a toggle button which will switch the checked state each time the button is pressed. ra...
Working With Directories - Archive of obsolete content
the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes). there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. a reference to a directory may be created in the same way as with a file by using nsiscriptableio.getfile(). you can access a subdirectory by supplying a directory name as the second argument, or refer to one of the special directories by supplying a null string for the second argument. the first line ...
Getting File Information - Archive of obsolete content
the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes). there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. the nsifile object has a number of useful attributes which may be used to retrieve information about a file. two useful attributes filesize and lastmodifiedtime (nsifile.attributes) provide a means of retrieving the size of a file and the time when the file was last changed. file size the filesize (...
Moving, Copying and Deleting Files - Archive of obsolete content
the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes). there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. there are several methods of the nsifile object which may be used to move and copy files on disk. nsifile.copyto() is used to copy a file, while nsifile.moveto() is used to move files. nsifile.remove() may be used to delete a file. copying a file nsifile.copyto() is used to copy files or directories...
TOC - Archive of obsolete content
Archive › Mozilla › XUL › FileGuide › TOC
...
Introduction to XUL - Archive of obsolete content
ication behaviour and linkage between the widgets. this linkage can be accomplished by including javascript in the xul, or by application code which walks the content model after it has been built from xul, and hooks up event listeners. generally a real application will use some combination of the two. applications, for instance, will have preconceived notions of what to do when they receive an "open file" command. an "open" button is simply a button. it will send its command to the application for processing, generally using some simple javascript for linkage. we are at first primarily concerned with the obvious ui components: toolbars, menus and dialogs. conceptually, the xul language will allow someone with a text editor, given a package of components which can work together, the ability ...
startFind - Archive of obsolete content
the first time this is called for a given findbar, the findbar will flash to draw attention to itself. the mode should be one of find_normal, find_typeahead, or find_links. if you don't pass a mode, the last-used mode for the same findbar is used. if the findbar hasn't been used before, find_normal is the default. ...
addTab - Archive of obsolete content
Archive › Mozilla › XUL › Method › addTab
the rest of the parameters are optional. the row of tabs will appear if needed. ...
loadOneTab - Archive of obsolete content
« xul reference home loadonetab( url, referreruri, charset, postdata, loadinbackground, allowthirdpartyfixup ) loadonetab( url, { referreruri: ..., charset: ..., postdata: ..., inbackground: ..., allowthirdpartyfixup: ..., relatedtocurrent: ... }) return type: tab element opens a new tab that loads a page with the specified url. the rest of the parameters are optional. this method works the same as addtab except for the loadinbackground parameter which allows you to choose whether to open the new tab in foreground or background. there's also no owner parameter as the owner tab is specified automatically. parameters inbackground if true the tab will be loaded in the background, if false the tab will be the newly selected tab. and if null or not specified, this parameter...
showPopup - Archive of obsolete content
there are two ways of specifying where the popup appears, either at a specific screen position, or relative to some element in the window. if either x or y are set to values, the popup will appear at the screen coordinate (x,y). if x and y are -1, the popup will be positioned relative to the element specified as the first argument. this is what you might do to show a popup below a button, for example. ...
Methods - Archive of obsolete content
tatusat getsessionvalueat getstring goback gobackgroup godown goforward goforwardgroup gohome goto gotoindex goup hidepopup increase increasepage insertitem insertitemat invertselection loadgroup loadonetab loadtabs loaduri loaduriwithflags makeeditable movebyoffset moveto movetoalertposition onsearchcomplete ontextentered ontextreverted openpopup openpopupatscreen opensubdialog openwindow preferenceforelement reload reloadalltabs reloadtab reloadwithflags removeallitems removeallnotifications removealltabsbut removecurrentnotification removecurrenttab removeitemat removeitemfromselection removenotification removeprogresslistener removesession removetab removetabsprogresslistener removetransie...
MoveResize - Archive of obsolete content
void moveto(in long left, in long top); the left argument is the horizontal screen position and the top argument is the vertical screen position. this method will change the left and top attributes to match the supplied arguments, so if these attributes are persisted the values will be restored when the window is displayed again. ...
Tooltips - Archive of obsolete content
ck button on a toolbar is given additional text to appear on a tooltip. this could also be useful if the toolbar is configured such that labels do not appear. if an element does not have a tooltiptext attribute, yet a parent element does, the parent tooltip will apply. for example, in the following, a toolbar has a tooltip set for it. <toolbar tooltiptext="file buttons"> <toolbarbutton label="open" tooltiptext="open a file"/> <toolbarbutton label="close"/> </toolbar> the 'open' button has a tooltiptext attribute so will have a tooltip of its own. however, the close button does not have a tooltip associated with it, yet the parent toolbar does. the result is that the toolbar's tooltip will apply when the mouse is moved over the close button, as well as when the mouse is over an empty pa...
anchorNode - Archive of obsolete content
...
Notes - Archive of obsolete content
implementing an nsicommandlinehandler on windows may trigger a bug that causes an error message ("windows cannot find the file specified") to be displayed when opening external links (like from a shortcut or from an external application). deleting the "(default)" values in the following registry keys will fix this: hkey_classes_root\http\shell\open\ddeexec hkey_classes_root\https\shell\open\ddeexec you can also do this from within your xpcom component using windows registry interface. some more links on the matter: a mozillazine post. a blog post. ...
text-link - Archive of obsolete content
labels will appear like a link (blue and underlined). ...
Filtering - Archive of obsolete content
rk. this issue only affects the menulist element. several workarounds can be used in this simple example. first, you could move the <menupopup> element outside of the template and put the datasources attribute on it instead of the <menulist> element. this will work in this simple example, but has the disadvantage that the builder won't be able to generate the content lazily only when the popup is opened. another workaround is to just rebuild the template once the data has been loaded. next, we will look at how to add the all choice to the menu, which won't be generated from the datasource. « previousnext » ...
Introduction - Archive of obsolete content
hose bookmarks. <vbox datasources="rdf:bookmarks http://www.xulplanet.com/ds/sample.rdf"> in addition, when using the rdf type for chrome xul (such as in extensions), the datasource rdf:local-store is always included in the composite. the local store is a datasource which is usually used to hold state information such as window sizes, which columns in a tree are showing, and which tree items are open. you can query for any data in the local store in a template though this is rarely done. sometimes, you will want to specify the datasource to be used later, possibly determined dynamically by a script. the special uri rdf:null is used to indicate that you intend no datasources, or an empty datasource. this special uri will also work even for non-rdf types, so feel free to use it when needed. it ...
Accesskey display rules - Archive of obsolete content
ac platforms, a character which is same as its accesskey is underlined. e.g., when an accesskey of "file" is 'f', the generated label will be "file". if a label has two or more characters which are same as its accesskey, the first character of them will be underlined. if a label doesn't have the character, xul elements append the accesskey character with parentheses. e.g., when an accesskey of "open" is 'a', the generated label will be "open (a)". however, if the last character of the label is an ellipsis or a colon, the accesskey text is inserted before them. i.e., when an accesskey of "open…" is 'a', the generated label will be "open (a)…". and also when an accesskey of "your name:" is 'b', the generated label will be "your name (b):". this document calls the appended text "accesskey ...
Content Panels - Archive of obsolete content
ing child panels there may be times when you want to have part of a document loaded from a different page. sometimes, you will want to change part of the window. a good example is a step-by-step wizard that guides you through a number of screens, asking a set of questions. each time the user clicks the next button, the next screen of the wizard is displayed. you could create a wizard interface by opening a different window for each screen. there are three problems with this approach. first, each window could appear in a different location (although there are ways around this). second, the elements such the back and next buttons are the same throughout the interface. it would be much better if just the content area of the wizard changed. third, it would be difficult to co-ordinate scripts when ...
Input Controls - Archive of obsolete content
et the size. this should be set to the number of rows and columns of characters to display. our find files example let's add a search entry field to the find file dialog. we'll use the textbox element. <label value="search for:" control="find-text"/> <textbox id="find-text"/> <button id="find-button" label="find"/> add these lines before the buttons we created in the last section. if you open this window, you will see something much like that shown in the image. notice that the label and the text input field have now appeared in the window. the textbox is fully functional and you can type into it and select text. note that the control attribute has been used so that the textbox is selected when the label is clicked. checkboxes and radio buttons two additional elements are used for...
Install Scripts - Archive of obsolete content
ocess. the installer script must be called install.js and must be placed at the top level of the installer archive. the script will contain javascript code which calls a number of install functions. in an html document, or a xul document, the window object is the root global object. that means that you can call the methods of the window object with the qualifier before it, which means that window.open() can simply be written open(). in an install script, there is no associated window, however the global object will be an install object which contains a number of functions to customize the install process. some of the install object's functions will be described below. the install script should take the following steps: initialize the installation by specifying what package and version is be...
Introduction - Archive of obsolete content
are applications which are created in the same way as an extension, but they act like a separate application in a separate window. this is used when you don't want to have the larger size of a complete xulrunner application, but don't mind requiring a mozilla browser to be installed to be able to run the application. remote xul application you could also just place xul code on a web server and open it in firefox, as you would any other web page, however this is discouraged and was disabled in firefox 8. it is still possible to enable this for selected sites to let legacy apps to continue working, but for new remote applications you should use html to create your user interface instead; most of the features you used to have to use xul for are available in html5. the first three types all ...
Modifying the Default Skin - Archive of obsolete content
hout changing the archives themselves. this directory should be created when you create a profile and some examples placed there. the file 'usercontent.css' customizes web pages, whereas 'userchrome.css' customizes chrome files. for example, by adding the following to the end of the file, you can change all menubar elements to have a red background. menubar { background-color: red; } if you open any firefox window after making this change, the menu bars will be red. because this change was made to the user style sheet, it affects all windows. this means that the browser menu bar, the bookmarks menu bar and even the find files menu bar will be red. skin packages to have the change affect only one window, change the style sheet associated with that xul file. for example, to add a red bor...
Popup Menus - Archive of obsolete content
t they can be placed anywhere and can contain any content. a good example is the drop down menu that appears when you click on the little down arrows next to the back and forward buttons in a browser window. context popups the context popup is a popup window which appears when the user presses the context menu button, which is usually the right mouse button. the exact way that a context menu is opened varies on each platform. on the macintosh for example, the user can either press the control key and click the mouse button, or hold the mouse button down for a moment. also note that it is possible to open context menus without using the mouse, for example by pressing the menu key on a keyboard. tooltips a tooltip popup window will appear when the user hovers over an element with the mouse. ...
Progress Meters - Archive of obsolete content
n set to 50% so that we can see the meter on the window. a margin has been set to 4 pixels so that it is separated from the edge of the window. as was stated earlier, we only want the progress bar to be displayed while the search was occurring. a script will show and hide it as necessary. to make this work you will first have to define the namespace html. do this by adding the below line to your opening window tag in the findfile.xul. xmlns:html="http://www.w3.org/1999/xhtml" the example so far. source view in the next section, we will learn how to add additional elements to the window using html. « previousnext » ...
Scrolling Menus - Archive of obsolete content
however, if you shrink the height of the window, the scroll arrows will appear. making the window larger again will cause the arrows to disappear. you can set a css max-height property on the arrowscrollbox to limit the size of the scrolling box and thus make the arrows appear all the time. the arrowscrollbox is mainly useful in menus and popups however. next, we'll see how to add s...
Skinning XUL Files by Hand - Archive of obsolete content
skin that changes, such as an image), use the style rules in the global skin by importing it into your stylesheet with the following instruction: @import url("chrome://global/skin/"); refer to the document writing skinnable xul and css for guidelines on how to make your skins friendly to the global skin, to xul, and to mozilla. stylesheet syntax to familiarize yourself with the global skin, open up the text file called global.css in the chrome/classic.jar!/skin/classic/global directory of the mozilla application. in a cascading stylesheet, the style definitions have the following basic form: element { style-attribute1: value; style-attribute2: value; style-attribute3: value; } for example, the following definition -- were it not in serious conflict with the many menu style defin...
Splitters - Archive of obsolete content
splitter anywhere you want and it will allow resizing of the elements that come before it and the elements that come after it in the same box. when a splitter is placed inside a horizontal box, it will allow resizing horizontally. when a splitter is placed inside a vertical box, it will allow resizing vertically. the syntax of a splitter is as follows: <splitter id="identifier" state="open" collapse="before" resizebefore="closest" resizeafter="closest"> the attributes are as follows: id the unique identifier of the splitter. state indicates the state of the splitter. set this to open, the default, to have the split panel initially open, or set it to collapsed to have one of the panels shrunk down (collapsed) and the other occupying all of the space. colla...
Styling a Tree - Archive of obsolete content
tly selected. current this property is set if the keyboard cursor is at the row. only one row will have this property set at a time. hover this property is set if the mouse cursor is on the row. only one row will have this property set at a time. container this property is set for rows or cells that have child rows. leaf this property is set for rows or cells that do not have child rows. open this property is set for rows or cells which are expanded. closed this property is set for rows or cells which are collapsed. primary this property is set for cells in the primary column. sorted this property is set for cells in the current sorted column. even this property is set for even numbered rows. odd this property is set for odd numbered rows. this property, along with the even...
Templates - Archive of obsolete content
tical box has been created that will contain a column of buttons, one for each top-level bookmark. you can see that the template contains a single button. this single button is used as a basis for all the buttons that need to be created. you can see in the image that the set of buttons has been created, one for each bookmark. try adding a bookmark in the browser while you have the example window open. you'll notice that the buttons in the example get updated instantly. (you may have to focus the window for it to change.) container and datasources the template itself is placed inside a vertical box. the box has two special attributes that allow it to be used for templates, which are used to specify where the data comes from. the first attribute on the box is the datasources attribute. this i...
Toolbars - Archive of obsolete content
zable toolbars; therefore, many extensions add their toolbar buttons to the toolbar palette, rather than adding them directly to the toolbar. for more information about customizable toolbars, see creating toolbar buttons. our find files example let's add a toolbar to the find files dialog. we don't really need one but we'll add one anyway to demonstrate its use. two buttons will be added, an open button and a save button. presumably, they would allow the user to save search results and re-open them later. <vbox flex="1"> <toolbox> <toolbar id="findfiles-toolbar"> <toolbarbutton id="opensearch" label="open"/> <toolbarbutton id="savesearch" label="save"/> </toolbar> </toolbox> <tabbox> a toolbar with two buttons has been added here. in the image, you...
Tree Box Objects - Archive of obsolete content
() is the child type which is filled in with a string depending on what part of the cell the coordinate is at. if you move the mouse around in the previous example, you might notice the label change between 'text' and 'cell'. the value 'text' indicates the area where the text would be drawn and the value 'cell' indicates the area around the text, for example, the margin on the left side where the open and close twisties are normally drawn. if there was a twisty, however, the value would be 'twisty' instead. this is convenient since you could determine whether the user clicked on a twisty instead of another part of the row. in fact, this is what the underlying tree code does when the user double clicks the twisty. the final value that may be returned is 'image' if there is an image in the tree ...
Tree Selection - Archive of obsolete content
s one specific row. for example, the following code will select the row at index 5: tree.view.selection.select(5); note that you should not just change the tree's currentindex property to change the selection. instead, you should use the selection's select function as in the example above. you can select all rows with the selectall() function. note that rows nested inside containers that are not open will not be selected. naturally, this will only have any effect for trees that use multiple selection. there is also a clearselection() function to clear the selection, and an invertselection function to reverse the selection, that is, deselect all selected rows and select all unselected rows. to select specific rows, use the rangedselect() function which selects all rows in between two indices. ...
Trees and Templates - Archive of obsolete content
hat the tree builder should be used. if you leave the attribute out, the content builder will be used. you can see the difference by using mozilla's dom inspector on a tree with and without the flag. if you do use a content builder instead, note that the content won't generally get built until it is needed. with hierarchical trees, the children don't get generated until the parent nodes have been opened by the user. in the template, there will be one treecell for each column in the tree. the cells should have a label attribute to set the label for the cell. this would normally be set to an rdf property so that the label is pulled from the datasource. template-built tree example the following example demonstrates a template-built tree, in this case for the file system. example 1 : source <tree ...
XUL Tutorial - Archive of obsolete content
he has graciously given us permission to use it as part of the mdn. original document information author: neil deakin copyright information: © 1999-2005 xulplane...
Using Visual Studio as your XUL IDE - Archive of obsolete content
schema.codeplex.com under the downloads tab. you should be able to use the schema in other ide's too. there is also project that provides xml schema for install manifest files (install.rdf) - installrdfschema.codeplex.com - from the same author as a xul schema. the codeplex-page provides some instructions for installing the schema, but there is an easier way. if you already have a xml or xul file opened, visual studio will add the menu item xml to the main menu. just use xml > schemas... to add the xul.xsd from the package that you have downloaded. the other xsd files will be added automatically. visual studio will use the schema based on the namespace, so make sure your window element uses the correct xul namespace http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul. 3. xbl if you ...
XUL Changes for Firefox 1.5 - Archive of obsolete content
buttons of the <dialog> binding (using their names); or to none - in which case no button is set to be the default. button: icon property the icon property on a button may be used to set stock icons on a button, used on some platforms. for instance <button icon="help"> will create a button with a help icon. this is used typically on gnome systems where possible values are: accept, cancel, help, open, save, find, clear, yes, no, apply, close, print, add, remove, refresh, go-forward, go-back, properties, select-font, select-color, network. <menulist> items in a <menulist> support the description attribute to allow for extra descriptive text to appear beside an item's label. the menulist modification methods appenditem and insertitemat take an extra description argument when creating items th...
XUL FAQ - Archive of obsolete content
if you want to access elements inside <prefpane>, you should put script in the <prefpane> or write script into "onpaneload" of the <prefpane>.) note, that prefwindow only works in chrome xul. ...
XUL element attributes - Archive of obsolete content
en being placed in the center of the box. end child elements are placed on the right or bottom edge of the box. if the box is larger than the total size of the children, the extra space is placed on the left or top side. persist type: space-separated list of attribute names a space-separated list of attributes that are maintained when the window is closed. when the window is re-opened, the values of persistent attributes are restored. in mozilla, persistent attributes are stored in the per-profile file xulstore.json. persistence can also be stored using the document.persist function. in order for persistence to work, the element must also have an id. persistence will not remember the absence of an attribute, so for boolean attributes like checked where absence means false, y...
Accessibility/XUL Accessibility Reference - Archive of obsolete content
nfo. ...
The Implementation of the Application Object Model - Archive of obsolete content
for certain subtrees. note that even if the persistent attribute is set to false, that changes can still be made to a window's content tree. they simply won't be remembered across sessions. preventing the persistence of attributes: the discardable attribute individual attributes can be specified as non-persistent (i.e.,discardable) through the use of the discardable attribute. for example, the open attribute used to indicate whether a node is expanded or collapsed in a tree view is something that is sometimes persistent (in the case of bookmarks) and sometimes not (in the case of mail folders). in both cases, the overall tree structure needs to be persistent, but this particular attribute could be either. the discardable attribute takes as its value the attribute name that should be non-per...
command - Archive of obsolete content
ts. more information is available in the xul tutorial. see also: command attribute, commandset element attributes disabled, label, oncommand,reserved examples the following code will send a paste command (cmd_paste) to the currently focused element: // first include chrome://global/content/globaloverlay.js godocommand("cmd_paste"); example with two buttons <commandset><command id="cmd_openhelp" oncommand="alert('help');"/></commandset> <button label="help" command="cmd_openhelp"/> <button label="more help" command="cmd_openhelp"/> attributes disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to u...
commandset - Archive of obsolete content
serves as a container for command elements. in addition, this element can hold a command updater which is used to update commands when certain events occur. a common use of the command updater is to update cut, copy, and paste menu items. more information is available in the xul tutorial. attributes commandupdater, events, oncommandupdate, targets example <commandset> <command id="cmd_open" oncommand="alert('open!');"/> <command id="cmd_help" oncommand="alert('help!');"/> </commandset> attributes commandupdater type: boolean if true, the commandset is used for updating commands. typically, this is used to update menu commands such as undo and cut based on when an event occurs. for example, since the cut command is only valid when something is selected,...
description - Archive of obsolete content
the value attribute is used to set text that appears in a single line. if text appears as a child of the description, it will wrap to multiple lines. it may contain arbitrary markup, which can be styled as needed. more information is available in the xul tutorial. ...
menuitem - Archive of obsolete content
id set to the id of a command element that is being observed by the element. closemenu type: one of the values below indicates if the menu closes when the menuitem is activated. auto this, the default value if the closemenu attribute is not specified, closes up the menu and all parent menus. single the menu the item is contained within is closed, but the parent menus remain open. none no menus are closed. crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the crop attribute. an ellipsis will be used in place of the cropped text. if the box direction is reversed, the cropping is reversed. start the text ...
preference - Archive of obsolete content
ts the value of the type attribute. value gets and sets the value of the user preference specified in name. in pref dialogs with instantapply == true (default on mac os x) this value is kept in sync with the actual value stored in the preferences (see valuefrompreferences). when instantapply is off (default on windows), this gets and sets the current value of the preference in the currently open dialog. there's a special case of value === undefined, indicating that the preference does not have a user-set value (hasuservalue == false). in this case the actual value to be displayed in the ui is obtained from the defaultvalue property. valuefrompreferences gets and sets the value stored in the user preference, specified in name. (this always accesses the nsiprefbranch apis regardles...
script - Archive of obsolete content
more information is available in the xul tutorial. ...
splitter - Archive of obsolete content
the farthest away from the splitter to the left or above the splitter resizes. flex the closest flexible element resizes. state type: one of the values below indicates whether the splitter has collapsed content or not. this attribute will be updated automatically as the splitter is moved, and is generally used in a stylesheet to apply a different appearance for each state. open the content either before or after the splitter, depending on the value of the collapsed attribute, is currently displayed. collapsed the content either before or after the splitter is collapsed and is not visible. dragging the user is current adjusting the position of the splitter, typically by dragging it with the mouse. substate type: one of the values below on splitter...
titlebar - Archive of obsolete content
atekeeper/there.is.only.xul" width="300" height="200" style="background: transparent; -moz-appearance: none;"> <titlebar flex="1" oncommand="close()" style="background: rgba(30, 30, 30, 0.9); -moz-border-radius: 10px; -moz-box-shadow: 0 1px 8px rgba(0, 0, 0, 0.8); margin: 8px 12px 16px;"/> </window> it can be opened from the error console like this: open("file:///users/markus/sites/hudwindow.xul", "", "chrome=1, titlebar=0") attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheigh...
window - Archive of obsolete content
cific icon file <windowid>.ico and/or <windowid>.xpm and place or install these files into the <mozilla-directory>/chrome/icons/default/ directory. the <windowid> is the value of the id attribute on the window. this allows you to have a different icon for each window. without including the css file at "chrome://global/skin/", the window will not be stylized and will be invisible and glitchy when opened as a dialog. note: starting in gecko 1.9.2, you can detect when a window is activated or deactivated by watching for the "activate" and "deactivate" events. see window activation events. more information is available in the xul tutorial. attributes accelerated, chromemargin, disablechrome, disablefastfind, drawintitlebar, fullscreenbutton, height, hidechrome, id, lightweightthemes, ligh...
XUL - Archive of obsolete content
they provide a powerful mechanism for extending and customizing existing xul applications. xul periodic table this collection of xul demos used to be available as a web page, but can no longer be viewed in firefox since support for remote xul was disabled. there is a xulrunner application containing the xul periodic table which can be opened with gecko based browsers. you can get it here. see: using firefox 3 to run xulrunner applications for instructions on running xulrunner apps in firefox. view all... community view mozilla forums... mailing list newsgroup rss f...
XULRunner 1.8.0.1 Release Notes - Archive of obsolete content
runner mozilla provides xulrunner for windows, mac os x, and linux, in english: download xulrunner for windows download xulrunner for mac os x download xulrunner for linux windows unpack the zip file to a new directory using a archive tool (7zip is recommended). the following directory is recommended: c:\program files\mozilla xulrunner\1.8.0.1 . to register xulrunner with the system, open a command prompt and run xulrunner.exe --register-global (to register for all users) or xulrunner.exe --register-user (to register for one user only). mac os x open the .pkg file within the installer and follow the directions. linux unpack the tarball to a new directory using tar -xzf xulrunner-1.8.0.1.en-us.linux-i686.tar.gz. the following directory is recommended: /opt/xulrunner/1.8.0.1...
XULRunner 1.8.0.4 Release Notes - Archive of obsolete content
runner mozilla provides xulrunner for windows, mac os x, and linux, in english: download xulrunner for windows download xulrunner for mac os x download xulrunner for linux windows unpack the zip file to a new directory using an archive tool (7zip is recommended). the following directory is recommended: c:\program files\mozilla xulrunner\1.8.0.4 . to register xulrunner with the system, open a command prompt and run xulrunner.exe --register-global (to register for all users) or xulrunner.exe --register-user (to register for one user only). mac os x open the .pkg file within the installer and follow the directions. linux unpack the tarball to a new directory using tar -xzf xulrunner-1.8.0.4.en-us.linux-i686.tar.gz. the following directory is recommended: /opt/xulrunner/1.8.0...
XULRunner 1.9.1 Release Notes - Archive of obsolete content
lrunner mozilla provides xulrunner for windows, mac os x, and linux, in english: download xulrunner for windows download xulrunner for mac os x download xulrunner for linux windows unpack the zip file to a new directory using an archive tool (7zip is recommended). the following directory is recommended: c:\program files\mozilla xulrunner\1.9.1 . to register xulrunner with the system, open a command prompt and run xulrunner.exe --register-global (to register for all users) or xulrunner.exe --register-user (to register for one user only). mac os x open the .pkg file within the installer and follow the directions. linux unpack the tarball to a new directory using tar -xjf xulrunner-1.9.1.19.en-us.linux-i686.tar.bz2. the following directory is recommended: /opt/xulrunner/1.9.1...
XULRunner 1.9.2 Release Notes - Archive of obsolete content
talling xulrunner mozilla provides xulrunner for windows, mac os x, and linux, in english: download xulrunner for windows download xulrunner for mac os x download xulrunner for linux windows unpack the zip file to a new directory using an archive tool (7zip is recommended). the following directory is recommended: c:\program files\mozilla xulrunner\1.9.2 . to register xulrunner with the system, open a command prompt and run xulrunner.exe --register-global (to register for all users) or xulrunner.exe --register-user (to register for one user only). mac os x open the .pkg file within the installer and follow the directions. linux unpack the tarball to a new directory using tar -xjf xulrunner-3.6.26.en-us.linux-i686.tar.bz2. the following directory is recommended: /opt/xulrunner/1.9.2 . reg...
XULRunner 1.9 Release Notes - Archive of obsolete content
xulrunner mozilla provides xulrunner for windows, mac os x, and linux, in english: download xulrunner for windows download xulrunner for mac os x download xulrunner for linux windows unpack the zip file to a new directory using an archive tool (7zip is recommended). the following directory is recommended: c:\program files\mozilla xulrunner\1.9 . to register xulrunner with the system, open a command prompt and run xulrunner.exe --register-global (to register for all users) or xulrunner.exe --register-user (to register for one user only). mac os x open the .pkg file within the installer and follow the directions. linux unpack the tarball to a new directory using tar -xjf xulrunner-1.9.0.17.en-us.linux-i686.tar.bz2. the following directory is recommended: /opt/xulrunner/1.9...
XULRunner 2.0 Release Notes - Archive of obsolete content
download xulrunner for windows download xulrunner for mac os x download xulrunner for 32-bit linux download xulrunner for 64-bit linux (warning: links may become out-of-date at times). windows unpack the zip file to a new directory using an archive tool (7zip is recommended). the following directory is recommended: c:\program files\mozilla xulrunner\2.0 . to register xulrunner with the system, open a command prompt and run xulrunner.exe --register-global (to register for all users) or xulrunner.exe --register-user (to register for one user only). mac os x open the .pkg file within the installer and follow the directions. xulrunner 2.0 is a universal binary containing i386 and x86_64 architectures. xulrunner 1.9.2 and earlier versions had powerpc (ppc) and i386 architectures. linux (32-bi...
CommandLine - Archive of obsolete content
.interfaces.nsicommandline); alert(cmdline.handleflagwithparam("test", false)); see also: chrome: command line for single instance applications of course, for a single instance application (see toolkit.singletonwindowtype for more information), the last example still applies the first time your application is launched. however, if you'd like to retrieve the latest command line arguments (to open a file for example), a possible solution is to create your own command line handler. for the sake of simplicity, the proposed solution involves the observer service to notify observers that the updated arguments are available. a similar and better way to implement this solution is by defining argument specific handlers with registering and unregistering functions in your command line handler ser...
Specifying Startup Chrome Window - Archive of obsolete content
faults/preferences, there is a file named xulmine.js. its contents are: pref("toolkit.defaultchromeuri", "chrome://xulmine/content/xulmine.xul"); the toolkit.defaultchromeuri preference specifies that the xul window at chrome://xulmine/content/xulmine.xul is the main application window. specifying a single instance main window by default, each time the user launches the application xulrunner opens the window specified by toolkit.defaultchromeuri. an application wishing to have only one main window should set the toolkit.singletonwindowtype preference and specify the windowtype attribute on the main application window. specifying window features by default, the main window is opened as a resizeable, non-dialog chrome window. this default can be changed by setting the toolkit.defaultchrom...
Using SOAP in XULRunner 1.9 - Archive of obsolete content
+ "\"", < beforesend: function(req) { < req.setrequestheader("method", "post"); < req.setrequestheader("content-length", soapclient.contentlength); < req.setrequestheader("soapserver", soapclient.soapserver); < req.setrequestheader("soapaction", soapreq.action); < } < }); --- > var xhr = new xmlhttprequest(); > xhr.mozbackgroundrequest = true; > xhr.open('post', soapclient.proxy, true); > xhr.onreadystatechange = function() { > if (4 != xhr.readystate) { return; } > getresponse(xhr); > }; > var headers = { > 'method': 'post', > 'content-type': soapclient.contenttype + '; charset="' + > soapclient.charset + '"', > 'content-length': soapclient.contentlength, > 'soapserver': soapclient.soapserver, > 'soapact...
toolkit.singletonWindowType - Archive of obsolete content
preference type: string specified by: default prefs of xulrunner applications default: none example: pref("toolkit.singletonwindowtype", "xulmine"); by default, the toolkit.defaultchromeuri preference will cause xulrunner to open a new main application window each time an application is invoked. the toolkit.singletonwindowtype preference causes xulrunner to search for a window with the attribute windowtype as specified in this preference (e.g. <window windowtype="xulmine"> in our example). if such a window is found, it will be re-used, otherwise a new window will be opened. more information on this can be found in bug 317811. see also: xulrunner:specifying startup chrome window, toolkit.defaultchromefeatures ...
XUL Explorer - Archive of obsolete content
ications for more detailed information, see the xul_explorer:planning#feature_planning_for_xul_explorer. ...
nsIContentPolicy - Archive of obsolete content
must not be null. arequestorigin {optional_inline}} the location of the resource that initiated this load request; can be null if inapplicable. acontext {optional_inline}} the nsidomnode or nsidomwindow that initiated the request, or something that can queryinterface() to one of those; can be null if inapplicable. note: acontext is the new tab/window when a user uses the context menu to open a link in a new tab/window or cmd/ctrl + clicks the link (i.e., acontext is not the tab which the link was on in these cases). amimetypeguess optional. a guess for the requested content's mime type, based on information available to the request initiator (e.g., an object's type attribute); does not reliably reflect the actual mime type of the requested content. aextra an optional ar...
Mozilla.dev.apps.firefox-2006-09-29 - Archive of obsolete content
ch videos, worked fine for others, ended up being a flash version problem. firefox 2 on windows vista discussion about the "state of affairs" of firefox 2 on windows vista rc1 - update for rc1 listed in update history as 'install pending' right-click "copy email address" - bug 353102 a proposed bug fix to the 'copy email address' bug how to use the rss feeds discovery & parsing tool in another open source project? a user looking to be pointed in the right direction of how to use the rss feeds discovery & parsing tool. meetings none this week. authors sara minchella (sara) dave manley (senemanley) back to summary list ...
2006-11-10 - Archive of obsolete content
r notification: friday 16th march 2007 communication submissions: monday 26th march 2007 communication paper notification: friday 06th april 2007 all camera ready due: monday 16th april 2007 conference dates: monday 07th and tuesday 08th may 2007 notable keynotes representatives from w3c, ibm, university of manchester, uk and oxford brookes university, uk. read more... discussions firefox: an open source accessibility success story aaron leventhal of ibm recently published a new article praising firefox accessibility. the article goes into the history of accessibility in firefox, details ibm's involvement and addresses some ajax accessibility concerns. the article closes with a glimpse at the future of firefox accessibility. read more... access keys in firefox 2 previous versions of fire...
2006-10-06 - Archive of obsolete content
v.apps.calendar - september 29 - october 6, 2006 announcements sunbird and lightning 0.3rc1 available gordon announced the candidate (rc) builds for sunbird and lightning 0.3 are released. sunbird release notes lightning release notes sunbird_0_3_release tag being created lilmatt announced the sunbird 0.3 realse tag being created. sun microsystems contributes to lightning to combine it with openoffice.org sun microsystems provide users with an alternative open source choice by combining openoffice.org respectively staroffice and thunderbird/lightning. discussions dialogs on app startup discussion regarding improvement of dialog of app window what are tasks? what are events? discussion regarding tasks and events meetings none this week. authors mark paruzel yi (eric) shen [bac...
2006-09-29 - Archive of obsolete content
ch videos, worked fine for others, ended up being a flash version problem. firefox 2 on windows vista discussion about the "state of affairs" of firefox 2 on windows vista rc1 - update for rc1 listed in update history as 'install pending' right-click "copy email address" - bug 353102 a proposed bug fix to the 'copy email address' bug how to use the rss feeds discovery & parsing tool in another open source project? a user looking to be pointed in the right direction of how to use the rss feeds discovery & parsing tool. meetings none this week. authors sara minchella (sara) dave manley (senemanley) back to summary list ...
2006-10-20 - Archive of obsolete content
summary: mozilla.dev.apps.firefox - october 13, 2006 - october 20, 2006 announcements content filtering, manipulation, and control in firefox 3 an open invitation from myk melez to contribute to the brainstorming of new features for firefox 3 and future firefox releases. myk will be paying close attention to features dealing with content filtering, manipulation and control in ff3. to contribute visit the wiki discussions i wanna make an addon for firefox a commonly asked question in many newsgroups. jesper kristensen pointed the requester here change download action for .rdp files on windows and os x a question regarding enabling firefox to associate .rdp files with microsoft remote desktop client so that the correct application opens the files automatically. met...
2006-10-20 - Archive of obsolete content
discussions how to use the tb/ab lastmodifieddate item and how to solve the problem regarding to this item. there is a link provided might solve the stated problem. however, detail info of the problem is not clear, no futher suggestion or solution is provided thus far. stefan göppert suspect thunderbird inserts a wrong char("") in the bcc-field and want to confirm this issue. ...
2006-11-03 - Archive of obsolete content
mozilla/mail/config/mozconfig the disable-crypto cause problem originally posted on november 2nd: gxk is building minimo using the code base from sept. 11 2006. when he builds using the disable.crypto option he encounters the following problem: no rule to make target `../../dist/lib/components/libpipboot.a', needed by `minimo'. he has also created a bug entry on bugzilla with the bug id of opened bug #344854. problem compiling with vs 2003 .net phil is trying to compile firefox for the first time and is getting an error when doing so: building deps for /cygdrive/c/mozilla/toolkit/airbag/airbag/src/common/windows/guid_string.cc make[1]: leaving directory `/cygdrive/c/mozilla/obj-i686-pc-cygwin' make: *** [build] error 2 he also noted that he is using make 3.80-1. on november ...
2006-10-13 - Archive of obsolete content
summary: mozilla.dev.l10n - october 13, 2006 announcements seamonkey 1.0.5 he-il seamonkey 1.0.5 in hebrew was released a while ago firefox 2 rc2 is out firefox 2 rc2 is out, to download click here sunbird_0_3_release tag being created sunbird_0_3_release tag being created seamonkey 1.1 localization freeze and beta upcoming there are no open blockers left. l10n freeze on seamonkey 1.1 code is imminent in the next days, as well as beta release. do early testing using code from this link. discussions mozillatranslator 5.13 rfes mozillatranslator 5.13 is ready to be released in a few weeks. author is declaring rfe (request for enhancement). a few bugs have been listed. meetings none for this week. authors paul yanchun gu (gpaul) aditya nanda kuswanto(vipe...
2006-11-10 - Archive of obsolete content
trunk / 1_8 for kurdish firefox the firefox translations of the kurdish are only in trunk translating the firefox privacy policy the final and approved en-us version of privacy policy is available here and ready for localization team to translate. ...
2006-11-17 - Archive of obsolete content
to a language called quiché. how to start a localization how to start a localization po format usage discussion on how to make l10n easier due to expansion to 100 locales. quick builds for localisers (full or partial) discussion on moz-l10n-builder, which automates many of the functions required in localization process. link is located here. going to fosdem 2007 fosdem 2007 (free and open source software developers' european meeting), february 24th - 25th. mozilla developers will be having a room, and everyone is invited. link to the event here. meetings none for this week. authors paul yanchun gu (gpaul) aditya nanda kuswanto(vipers101) ...
2006-11-3 - Archive of obsolete content
summary: mozilla.dev.l10n - november 3, 2006 announcements mozip.net 1.2.0 released: the should have been 1.0 release mozip.net 1.2.0, a gui (graphic) version of piaip's mozip command line utility, is available here. check thread for complete details. mozillatranslator 5.13 released mozillatranslator 5.13 is available here. opening l10n repository on mozilla_1_8_branch for approved check-ins mozilla_1_8_branch is opened for approved check-ins. check-ins are limited to bug fixes filed in bugzilla and should mention their bug, describe the change, and who approved the change. seamonkey 1.0.6 and 1.1 beta upcoming the seamonkey projet is planning a security release of the stable 1.0 series as well as a beta for the 1.1 version, all possibly in the next days or week. comm...
2006-10-20 - Archive of obsolete content
t going away on friday preed wants to get rid of sparky and comet (both older desktop class linux boxes). robert kaiser gave some background on the boxes. decommissioning sparky on friday preed wants to get rid of sparky (a linux build box) and wants to know if there are reasons wy not to do it. feature brainstorming + firefox 3 dria posted a link to the firefox feature brainstorming list (open to everyone). discussion of what is the best format for the list and how to use it best. meetings bon echo status meeting bon echo status meeting: october 17th, 2006 **at noon pdt**. meeting notes gecko status meeting october 19 (*thursday*) gecko 1.9 status meeting. agenda project status meeting project meeting was held on oct 16 2006. meeting notes ...
2006-11-03 - Archive of obsolete content
summary: mozilla.dev.platform - october 28th - november 3rd, 2006 announcements developer chat with brendan eich! chat with the creator of javascript and mozilla cto brendan eich this tuesday, november 7th at 10am pst (utc-8) traffic xepra wants to know how to open multiple tabs in a new window. alex vinten and neil help him out by figuring out exactly which environment he's running in. john gaunt discusses a proposed xulrunner unit-tests like xpcshell. robert sayre notes that he and dave liebreich have a nice, simple environment set up for browser-based js tests meetings no meetings this week ...
2006-10-06 - Archive of obsolete content
rotocol is defunct, apparently ben goodger disabled it back in 12/2003, shortly after he added it. webcal: & swebcal: should also be allowed as the security manager doesn't differentiate between access types. other this is for allowing protocol handlers to define a custom security model (see bug 120373). there is no consensus in the posts as to if this should be allowed. problem looping c_opensession problem in thunderbird christian bongiorno has run into a problem developing a pkcs11 module for a new card. thunderbird is continuously repeating 7 functions including c_opensession which accesses the card that he is developing. meetings none during this week. ...
2006-10-20 - Archive of obsolete content
they must be first saved to the drive. ...
2006-11-24 - Archive of obsolete content
week. discussions continuing discussions on the extended validation certificates large amount of activity this week regarding the extended validation certificates, duane posted several snippets of interesting debates as to whether or not the protocol should be introduced. mozilla backing off from "extended validation"? yet more people disgruntled by ev proposal mozilla, opera and co only tout open standards as it suits them in addition eddy nigg posted an alternative proposal for the use of extended validation certificates ev certificates / another proposal meetings none during this week. ...
2006-10-13 - Archive of obsolete content
summary: mozilla.dev.tech.xpcom - oct 13-20, 2006 announcements none during this week. discussions wxmozilla and ff1.5 xpcom problems updating wxmozilla to use it with firefox 1.5.7 browser elements, opening links in a new window using javascript to open window in new window. general xpcom and nscomptr questions nscomptr basics regarding myicomponent usage. fedora security blocking xpcom registration fedora core 5.0 security settings impeding xpcom registration. meetings none during this week. ...
External resources for plugin creation - Archive of obsolete content
please note that even when using these, it is still a good idea to have an understanding of what is going on under the hood, regardless of the level of abstraction provided. framework: firebreath project home page project history description (from the project creators): firebreath is a cross-platform browser plugin framework written in c++. plugins created with firebreath work on all major browsers, including firefox 3.0 and later. platforms supported include windows, linux, and mac os x (intel). ...
NPAnyCallbackStruct - Archive of obsolete content
ture contains information required by the platformprint field of the npembedprint structure during embedded mode printing. during printing in embedded mode, the platformprint field of the npembedprint structure points to an npanycallbackstruct. this structure contains the file pointer to which the plug-in should write its postscript data. at the time the plug-in is called, the browser has already opened the file and written postscript for other parts of the page. when the plug-in is done, it should leave the file open, as the browser can continue to write additional postscript data to the file. see also npp_print() npembedprint npsetwindowcallbackstruct npprintcallbackstruct ...
NPN_GetURL - Archive of obsolete content
nd npp_write(), and npp_destroystream(). this means that if you want the plug-in to handle a new stream, no matter what the mime type is, use null. if the application cannot locate the url and retrieve the data, it does not create a stream for the instance. when the plug-in instance is part of a regular browser window, and it uses a _blank target with a mailto or news url, another blank window is opened along with the mail or news window. when the plug-in uses a _self target, no other instance is created; the plug-in usually continues to operate successfully in its own window. the safest target is _blank, even though this creates an extra blank the browser instance. the plug-in developer cannot influence the way that the browser handles npn_geturl(). it is typically asynchronous but this is no...
NPPrintCallbackStruct - Archive of obsolete content
rite its postscript data. description callback structures are used to pass platform-specific information. the npprintcallbackstruct structure contains the file pointer to which the plug-in should write its postscript data. this information is required by the platformprint field of the npembedprint structure during embedded mode printing. at the time the plug-in is called, the browser has already opened the file and written postscript for other parts of the page. when the plug-in is done, it should leave the file open, so the browser can continue to write additional postscript data to the file. see also npp_print, npembedprint, npsetwindowcallbackstruct, npanycallbackstruct ...
The First Install Problem - Archive of obsolete content
xample registry key shows the suggested "key creation" at work for an example application called scobe scrubobat (which doesn't really exist!). future directions: using object tag with classid: incidental benefit embedders such as compuserve (who now embed gecko in lieu of ie as the default browser) can determine on their own the mechanisms to parse the win32 registry for plids. the bugzilla bug open on mozilla and netscape 6.x is bug 44973. if every major plugin vendor complies with the writing of plugin directory information into the registry along with a plid, we can then use the object tag to invoke plugins based on their "classid" (their respective plid, which is a uri, which works well with the w3c spec). for example, in our case, a prospective invocation might look like: <object clas...
Writing a plugin for Mac OS X - Archive of obsolete content
ting an npapi plugin for mac os x. before you go on reading this article, you may wish to grab the sample code located here, as it will be referenced during this tutorial. the sample is posted under a bsd-style license that means you can use it for anything, even if you don't plan to release your source code. getting started if you check out the mozilla source code in mac os x, you can simply open basicplugin.xcodeproj in xcode, click build, and you're done. xcode will create a "build" directory next to the project file, and if you built it in release mode, that folder in turn contains a "release" directory with the plugin inside it. to install the plugin, just copy it into one of these two locations: /library/internet plugins/ ~/library/internet plugins/ from this point, you can s...
Plugins - Archive of obsolete content
velopers to post their use cases to mozilla.dev.platform project list, so that mozilla can prioritize web platform work to make those use cases possible. for more information about plugin roadmap, see non-archived plugin information. plugins are shared libraries that users can install to display content that the browser can't display natively. for example, the adobe reader plugin lets the user open pdf files directly inside the browser, and the quicktime and realplayer plugins are used to play special format videos in a web page. plugins are written using npapi, the cross-browser api for plugins. the main source of documentation for npapi is the gecko plugin api reference. to make your plugin scriptable from web pages, use npruntime. plugins can be written completely from scratch using c ...
.htaccess ( hypertext access ) - Archive of obsolete content
syntax highliting support for .htaccess files less. ...
Vulnerabilities - Archive of obsolete content
ombination of highly unlikely conditions. one vulnerability might provide root-level access to a system, while another vulnerability might only permit read access to an insignificant file. ultimately, organizations need to know how difficult it is for someone to exploit each vulnerability and, if a vulnerability is exploited, what the possible impact would be. website vulnerabilities owasp or open web security project is a non-profit charitable organization focused on improving the security of software and web applications. according to the open web application security project, xss was the seventh most common web app vulnerability in 2017. the organization publishes a list of top web security vulnerabilities based on the data from various security organizations. the web security vulnera...
Common Firefox theme issues and solutions - Archive of obsolete content
#identity-box-inner > #page-proxy-stack > #page-proxy-favicon { list-style-image: url(chrome://browser/skin/identity-icons-https-ev.png); } #identity-box:hover > #identity-box-inner > #page-proxy-stack > #page-proxy-favicon { -moz-image-region: rect(0, 32px, 16px, 16px); } #identity-box:hover:active > #identity-box-inner > #page-proxy-stack > #page-proxy-favicon, #identity-box[open=true] > #identity-box-inner > #page-proxy-stack > #page-proxy-favicon { -moz-image-region: rect(0, 48px, 16px, 32px); } #page-proxy-favicon[pageproxystate="invalid"] { opacity: 0.5; } for more information about identity boxes please see the identity box section of the amo editors theme review guidelines no visual clue for disabled url bars there needs to be a visual clue when u...
Create Your Own Firefox Background Theme - Archive of obsolete content
ges are optional. view a sample theme footer here. image requirements dimensions should be 3000px wide × 100px high png or jpg file format image must be no larger than 300 kb in file size tips subtle, soft contrast images and gradients work best; highly detailed images will compete with the browser ui. firefox may reveal more of the upper portion of the image if the find bar is open or if an extension adds more height to the bottom of the window. the left-hand side of the image should have the most important information—as a user increases the width of the browser window, the browser reveals more of the right-hand side of the image. submitting your theme images to get started submitting your images, go to the theme submission page: name your theme — pick a unique ...
Using IO Timeout And Interrupt On NT - Archive of obsolete content
. this bug is due to a different limitation in our nt implementation. conclusions as long as we need to support nt 3.51, we need to program under the guideline that after an io timeout or interrupt error, the thread must make sure the file descriptor is closed before it exits. programs should also take care in sharing file descriptors and using io timeout or interrupt on files that need to stay open throughout the process. when we stop supporting nt 3.51, we can look into using nt 4's <tt>cancelio()</tt> function to cancel outstanding overlapped io requests when we get io timeout or interrupt errors. if <tt>cancelio()</tt> really works as advertised, that should fundamentally solve this problem. if these limitations with io timeout and interrupt are not acceptable to the needs of your progra...
Using workers in extensions - Archive of obsolete content
it starts by setting up an inter...
Browser Detection and Cross Browser Support - Archive of obsolete content
wser detection strategies and best practices. for more specific gecko recommendations, please see the gecko compatibility handbook gecko although many web developers are aware of firefox, mozilla, and netscape browsers, far fewer are aware that these browsers are members of an entire family of user agents based upon the gecko layout engine which includes the commercial browser compuserve 7, and open source browsers such as epiphany, galeon, camino, kmeleon, and seamonkey. gecko was designed from the ground up to be compliant with the w3c html, w3c css, w3c xml, w3c dom, and ecmascript (javascript) standards. it also includes compatibility features which allow it to reasonably handle legacy content which was developed for earlier generations of browsers such as netscape navigator 4 as well a...
::-ms-browse - Archive of obsolete content
permitted properties only the following css properties can be used in a rule with ::-ms-browse in its selector. other properties are ignored. ...
::-ms-expand - Archive of obsolete content
typically it is a triangle that points downward. allowable properties only the following css properties can be used in a rule with ::-ms-expand in its selector. other properties are ignored. ...
Using JavaScript Generators in Firefox - Archive of obsolete content
event listener function to pass the received event to the generator. function grabevent(event) { generator.send(event); } // when we're all done we can close the generator, but that must happen outside // of the generator so we use a timeout. ...
Server-Side JavaScript - Archive of obsolete content
d creator of javascript. server-side javascript is another way in which, as this article quotes eich, "mozilla wants to 'get people thinking about javascript as a more general-purpose language' and show them that 'it really is a platform for writing full applications.'" many vendors today are embedding mozilla rhino or mozilla spidermonkey into web server environments. some, like aptana with the open source jaxer server actually embed the entire mozilla firefox browser engine (including spidermonkey) within a web server to enable server-side ajax and server-side dom access in addition to server-side execution of javascript. ...
Styling the Amazing Netscape Fish Cam Page - Archive of obsolete content
de the floated div. it just seemed like a fish cam page should have a lot of floating for some reason. i also added a border to the image, so that it would have a nice frame. div.card {float: left; width: 45%; margin: 1em 2% 0 2%;} div.card img {float: left; border: 1px solid #339;} that done, it was time to style the fish names. these are enclosed in h3 elements, so the field was pretty wide open in terms of what we could do. since the image was floated, any background or border we set on the h3 would "slide under" the image; this is an expected effect with floated elements. rather than try to fight it or push the image below the h3's element box, i let the image mostly overlap the h3, but with a slight offset. i then set up a thicker double border on the left, a one-pixel border the rest...
Developing Mozilla XForms - Archive of obsolete content
with a debug build of the xforms and the schema-validation extensions. see building mozilla xforms for a .mozconfig for debug builds. you should create a new, clean profile for debugging. then start firefox out of the build directory: cd obj-*/dist/firefox ./firefox -no-remote -jsconsole -p yourprofilename the xforms extension that was built together with firefox should be already installed. then open your form that causes problems and have a look on the console. often you'll find the first starting points here or in the error console. schema validation problems the schema-validation extension contains a logging facility that can show some internals on the schema processing. to activate this logging output, set the nspr_log_modules environment variable: export nspr_log_modules=schemavalidation...
Troubleshooting XForms Forms - Archive of obsolete content
se the charles firefox extension to view your http session data including http header data. if all else fails ask the community ask on one of the mailing lists or on irc. see the community section on the xforms main page. check for known bugs / missing features you can check the known bugs/missing features we have in the release notes of the extension. you can also see the current list of open xforms bugs, or the list of fixed bugs that have not made it to the release versions yet. ...
XForms Select Element - Archive of obsolete content
of the select element do not support visual grouping. attributes ui common appearance - the value of this attribute gives a hint to the xforms processor as to which type of widget(s) to use to represent this control. accesskey - used to specify the keyboard shortcut for focusing this control. single-node binding special selection - isn't currently supported. this attribute, when set to 'open', allows the user to provide free entry to the list. possible values are open and closed, default is closed. incremental - supported, default value is true properties selection - see corresponding attribute incremental - see corresponding attribute type restrictions the select element can be bound to a node containing simple content capable of holding a sequence. the data binding restri...
XForms Upload Element - Archive of obsolete content
node binding special mediatype - supported. incremental - isn't supported. type restrictions the upload element can be bound to a node of type xsd:anyuri, xsd:base64binary or xsd:hexbinary or any type derived from one of these. representations the xforms upload element is represented by visually combining three widgets: a text field that shows the uri of the selected file, a button to open the file picker dialog which allows the user to select a file, and a button to clear the text field and the reference to the file from the bound node (xhtml only). characteristics analogous widget is <xhtml:input type="file"/> ...
Using XForms and PHP - Archive of obsolete content
ata formats on the server side. to really use the power of xforms (/xml) you would probably submit xml. there is some help in getting to the raw xml on the php documentation site. how to actually parse and use the xml data depends heavily on what you want to achieve and on the php version. to get a dom document on php 4 i usually do something like this: $data = $http_raw_post_data; $dom = domxml_open_mem($data); $root = $dom->document_element(); ... $newnode = $dom->create_element("boo"); $root->append_child($newnode); ... ...
RDF in Mozilla FAQ - Archive of obsolete content
importantly, the rdf model is used along with xul templates as an abstract "api" for displaying information. rdf in fifty words or less is a quick, high-level description of what rdf does in mozilla. the rdf back-end architecture document describes in more detail how mozilla's rdf implementation works, and gives a quick overview of the interfaces that are involved. where do i find information on open directory ("dmoz")? unfortunately, not here! well, here's a little... start at http://www.dmoz.org/ for more information on the open directory. the open directory dataset is available as a (huge) rdf/xml dump. it describes thousands of web sites using a mix of the dublin core metadata vocabulary and the dmoz taxonomy. see their rdf pages for more information. if you have problems with the dmoz ...
The Business Benefits of Web Standards - Archive of obsolete content
dards and separating structure from presentation brings a host of benefits for today and tomorrow. today, it means more audience, lower cost to produce new content, and becoming compliant with accessibility requirements. for tomorrow, it means reducing vendor lock-in, reducing cost of maintenance, and having a more flexible web site in terms of presentation. last but not least, use of standards opens the door to xml technologies. all these factors also contribute to easier site management, a larger audience and a better return on investment. geeks, marketers and bean-counters can all benefit from a standard-based web site. this is more than one could even dream of. ...
Using the Right Markup to Invoke Plugins - Archive of obsolete content
is not incorrect according to the html 4.01 specification, but it obliges web authors to diligently specifyobtainment mechanisms. at a minimum, web authors will have to nest some alternate text inside their object elements telling users where to obtain the missing component. adding an additional layer of convenience in the form of automatic retrieval is the subject of a bug 180411 in the mozilla open source code. some plugins don't understand all the param elements that their documentation suggests should configure them in mozilla-based browsers. an example is versions of the macromedia flash player plugin upto flash player 6 r. 47, which don't understand the <param name="movie" value="animation.swf"> param element, which is supposed to tell the flash player which animation to start playi...
Web Standards - Archive of obsolete content
lines will continue to function correctly as traditional desktop browsers evolve, and as new internet devices come to market. [1] documentation migrate apps from internet explorer to mozilla ever have trouble getting your internet explorer-specific web applications to work with mozilla? this article covers common issues associated with migrating applications to the open source mozilla-based browser. using web standards in your web pages this article provides an overview of the process for upgrading the content of your web pages to conform to the w3c web standards. choosing standards compliance over proprietary practices in the development world, there is a need for standards because applications are designed across multiple development groups...
Common causes of memory leaks in extensions - Extensions
problem is extensions holding onto references to content windows for too long. for example, in xul overlay code: var contentwindows = []; function inbrowserxuloverlay(contentwindow) { // forgetting or failing to pop the content window thing again contentwindows.push(contentwindow); } this will keep the content window compartments alive until the browser window is closed. users often only open a single browser window per session and use tabs, in which case the leaked compartments will live for the whole life of the session. a similar problem is holding onto window objects or dom nodes (such as window.document) for too long by storing them in a javascript module. for example: var windows = []; function injavascriptcodemodule(window) { // forgetting or failing to pop the window agai...
Publishing games - Game development
when you want to publish and distribute your game, and earn something out of it while you wait for it to become famous. game distribution so you've followed a tutorial or two and created an html5 game — that's great! game distribution provides all you need to know about the ways you can distribute your newly created game into the wild — including hosting it yourself online, submitting it to open marketplaces, and submitting it to closed ones like google play or the ios app store. game promotion developing and finishing the game is not enough. you have to let the world know that you have made something interesting available, which people will enjoy playing. there are many game promotion techniques — many of them free — so even if you're struggling to make a living as an indie dev wi...
3D collision detection - Game development
...
Building up a basic demo with Babylon.js - Game development
babylon.js works on similar concepts: camera, light and objects. environment setup to start developing with babylon.js, you don't need much. you should start off by: making sure you are using a modern browser with good webgl support, such as the latest firefox or chrome. creating a directory to store your experiments in. saving a copy of the latest babylon.js engine inside your directory. opening the babylon.js documentation in a separate tab — it is useful to refer to. html structure here's the html structure we will use: <!doctype html> <html> <head> <meta charset="utf-8"> <title>mdn games: babylon.js demo</title> <style> html,body,canvas { margin: 0; padding: 0; width: 100%; height: 100%; font-size: 0; } </style> </head> <body> <script src="babylon.js"...
Building up a basic demo with the PlayCanvas engine - Game development
playcanvas works on similar concepts: camera, light and objects. environment setup to start developing with playcanvas, you don't need much. you should start off by: making sure you are using a modern browser with good webgl support, such as the latest firefox or chrome. creating a directory to store your experiments in. saving a copy of the latest playcanvas engine inside your directory. opening the playcanvas documentation in a separate tab — it is useful to refer to. html structure here's the html structure we will use. <!doctype html> <html> <head> <meta charset="utf-8"> <title>mdn games: playcanvas demo</title> <style> body { margin: 0; padding: 0; } canvas { width: 100%; height: 100%; } </style> </head> <body> <script src="playcanvas-latest.j...
Building up a basic demo with PlayCanvas - Game development
the online editor is free for public projects with up to two team members, but there are also paid plans if you'd like to run a commercial private project with more developers. games and demos playcanvas has a few well-known demos published that showcase its possibilities. tanx is a multiplayer tank game where you can drive your tank around, shooting at other players as you go. swooop is a flying game where you pilot your plane around a magical island, collecting jewels and fuel as you go. ...
GLSL Shaders - Game development
glsl is executed directly by the graphics pipeline. there are two types of shaders: vertex shaders and fragment (pixel) shaders. vertex shaders transform shape positions into 3d drawing coordinates. fragment shaders compute the renderings of a shape's colors and other attributes. glsl is not as intuitive as javascript. glsl is strongly typed and there is a lot of math involving vectors and matrices. it can get very complicated — very quickly. in this article we will make a simple code example that renders a cube. to speed up the background code we will be using the three.js api. ...
Mobile touch controls - Game development
ourself manually, so you could leave the ondragstart() function empty, or place some debug output to see if it's working correctly. the pointer element contains the x and y variables storing the current position of the dragged element. dedicated plugins you could go even further and use dedicated plugins like virtual joystick — this is a paid, official phaser plugin, but you can find free and open source alternatives. the initialization of virtual joystick looks like this: this.pad = this.game.plugins.add(phaser.virtualjoystick); this.stick = this.pad.addstick(30, 30, 80, 'generic'); in the create() function of the game state we're creating a virtual pad and a generic stick that has four directional virtual buttons by default. this is placed 30 pixels from the top and left edges of the s...
Techniques for game development - Game development
using async scripts for asm.js especially when creating medium to large-sized games, async scripts are an essential technique to take advantage of, so that your game's javascript can be compiled off the main thread and be cached for future game running, resulting in a significant performance improvement for your users. this article explains how. optimizing startup performance how to make sure your game starts up quickly, smoothly, and without appearing to lock up the user's browser or device. ...
Create the Canvas and draw on it - Game development
basic css in the header. the body contains <canvas> and <script> elements — we will render the game inside the first one and write the javascript code that controls it in the second one. the <canvas> element has an id of mycanvas to allow us to easily grab a reference to it, and it is 480 pixels wide and 320 pixels high. all the javascript code we will write in this tutorial will go between the opening <script> and closing </script> tags. canvas basics to actually be able to render graphics on the <canvas> element, first we have to grab a reference to it in javascript. add the following below your opening <script> tag. var canvas = document.getelementbyid("mycanvas"); var ctx = canvas.getcontext("2d"); here we're storing a reference to the <canvas> element to the canvas variable. then we...
Apple Safari - MDN Web Docs Glossary: Definitions of Web-related terms
safari is a web browser developed by apple and bundled with both macos and ios. it's based on the open source webkit engine. learn more general knowledge safari on wikipedia safari on apple.com technical information the webkit project webkit nightly build reporting a bug for safari ...
Blink - MDN Web Docs Glossary: Definitions of Web-related terms
specifically, blink began as a fork of the webcore library in webkit, which handles layout, rendering, and dom, but now stands on its own as a separate rendering engine. ...
Bootstrap - MDN Web Docs Glossary: Definitions of Web-related terms
initially, bootstrap was called twitter blueprint and was developed by a team working at twitter. it supports responsive design and features predefined design templates that you can use out of the box, or customize for your needs with your code. ...
Browsing context - MDN Web Docs Glossary: Definitions of Web-related terms
learn more see origin ...
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. ...
Distributed Denial of Service - MDN Web Docs Glossary: Definitions of Web-related terms
rol is called a zombie or bot. a network of co-infected computers is known as a botnet or a zombie army. both kaspersky labs and symantec have identified botnets -- not spam, viruses, or worms -- as the biggest threat to internet security. ...
Effective connection type - MDN Web Docs Glossary: Definitions of Web-related terms
mages. 3g 270ms 700 kbps the network is suited for transfers of large assets such as high resolution images, audio, and sd video. 4g 0ms ∞ the network is suited for hd video, real-time video, etc. ...
Element - MDN Web Docs Glossary: Definitions of Web-related terms
an element is a part of a webpage. in xml and html, an element may contain a data item or a chunk of text or an image, or perhaps nothing. a typical element includes an opening tag with some attributes, enclosed text content, and a closing tag. elements and tags are not the same things. tags begin or end an element in source code, whereas elements are part of the dom, the document model for displaying the page in the browser. ...
Gaia - MDN Web Docs Glossary: Definitions of Web-related terms
the user interface and default application suite of the firefox os platform. once firefox os starts, anything drawn to screen is a product of the gaia layer (e.g., the lock screen, home screen, standard apps). gaia is implemented entirely with html, css, and javascript, and its only interfaces to the underlying operating system are through open web apis, which the gecko layer implements. you can install third-party apps alongside gaia. learn more technical reference gaia platform guide gaia development/hacking guide ...
Git - MDN Web Docs Glossary: Definitions of Web-related terms
it facilitates handling code bases with distributed development teams. what sets it apart from previous scm systems is the ability to do common operations (branching, committing, etc.) on your local development machine, without having to change the master repository or even having write access to it. ...
Google Chrome - MDN Web Docs Glossary: Definitions of Web-related terms
some key differences are described on the chromium wiki. chrome supports its own layout called blink. note that the ios version of chrome uses that platform's webview, not blink. learn more general knowledge google chrome on wikipedia for chrome users use one of these links if you're an everyday user. android ios desktop for web developers if you want to try the latest chrome features, install one of the pre-stable builds. google pushes updates frequently and has designed the distributions to run side-by-side with the stable version. ...
HTML - MDN Web Docs Glossary: Definitions of Web-related terms
rd in 2000. at that time, the w3c nearly abandoned html in favor of xhtml, prompting the founding of an independent group called whatwg in 2004. thanks to whatwg, work on html5 continued: the two organizations released the first draft in 2008 and the final standard in 2014. concept and syntax an html document is a plaintext document structured with elements. elements are surrounded by matching opening and closing tags. each tag begins and ends with angle brackets (<>). there are a few empty or void tags that cannot enclose any text, for instance <img>. you can extend html tags with attributes, which provide additional information affecting how the browser interprets the element: an html file is normally saved with an .htm or .html extension, served by a web server, and can be rendered b...
IETF - MDN Web Docs Glossary: Definitions of Web-related terms
learn more general knowledge official website ...
IRC - MDN Web Docs Glossary: Definitions of Web-related terms
the irc server broadcasts messages to everyone connected to one of many irc channels (each with their own id). ...
MathML - MDN Web Docs Glossary: Definitions of Web-related terms
in 1998 the w3c first recommended mathml for representing mathematical expressions in the browser. ...
MitM - MDN Web Docs Glossary: Definitions of Web-related terms
a man-in-the-middle attack (mitm) intercepts a communication between two systems. for example, a wi-fi router can be compromised. comparing this to physical mail: if you're writing letters to each other, the mailman can intercept each letter you mail. they open it, read it, eventually modify it, and then repackage the letter and only then send it to whom you intended to sent the letter for. the original recipient would then mail you a letter back, and the mailman would again open the letter, read it, eventually modify it, repackage it, and give it to you. you wouldn't know there's a man in the middle in your communication channel – the mailman is invisible to you and to your recipient. in physical mail and in online communication, mitm attacks are tough to defend. a few tips: do...
Mozilla Firefox - MDN Web Docs Glossary: Definitions of Web-related terms
firefox runs on windows, os x, linux, and android. first released in november 2004, firefox is completely customizable with themes, plug-ins, and add-ons. firefox uses gecko to render webpages, and implements both current and upcoming web standards. ...
Navigation directive - MDN Web Docs Glossary: Definitions of Web-related terms
rm-action restricts the urls which can be used as the target of a form submissions from a given context. frame-ancestors specifies valid parents that may embed a page using <frame>, <iframe>, <object>, <embed>, or <applet>. navigate-to restricts the urls to which a document can initiate navigation by any means, including <form> (if form-action is not specified), <a>, window.location, window.open, etc. learn more https://www.w3.org/tr/csp/#directives-navigation other kinds of directives: fetch directive document directive reporting directive block-all-mixed-content upgrade-insecure-requests require-sri-for trusted-types content-security-policy ...
OWASP - MDN Web Docs Glossary: Definitions of Web-related terms
owasp (open web application security project) is a non-profit organization and worldwide network that works for security in free software, especially on the web. learn more general knowledge official website ...
PHP - MDN Web Docs Glossary: Definitions of Web-related terms
php (a recursive initialism for php: hypertext preprocessor) is an open-source server-side scripting language that can be embedded into html to build web applications and dynamic websites. examples basic syntax // start of php code <?php // php code goes here ?> // end of php code printing data on screen <?php echo "hello world!"; ?> php variables ​​​​​​​​​​​​​​<?php // variables $nome='danilo'; $sobrenome='santos'; $pais='brasil'; $email='danilocarsan@gmailcom'; ​​​​​​​ // printing the variables echo $nome; echo $sobrenome; echo $pais; echo $email; ?> ...
Python - MDN Web Docs Glossary: Definitions of Web-related terms
m approach, meaning it supports procedural, object-oriented, and some functional programming constructs. it was created by guido van rossum as a successor to another language (called abc) between 1985 and 1990, and is currently used on a large array of domains like web development, desktop applications, data science, devops, and automation/productivity. python is developed under an osi-approved open source license, making it freely usable and distributable, even for commercial use. python's license is administered by the python software foundation. ...
RGB - MDN Web Docs Glossary: Definitions of Web-related terms
esent the different intensities (or contributions) of red, green, and blue, in determining the final color. there are many ways to describe the rgb components of a color. in css they can be represented as a single 24-bit integer in hexadecimal notation (for example, #add8e6 is light blue), or in functional notation as three separate 8-bit integers (for example, rgb(46, 139, 87) is sea green). in opengl, webgl, and glsl the red-green-blue components are fractions (floating-point numbers between 0.0 and 1.0), although in the actual color buffer they are typically stored as 8-bit integers. graphically, a color can be represented as a point in a three-dimensional grid or cube, where each dimension (or axis) corresponds to a different channel. learn more general knowledge rgb color model on...
Ruby - MDN Web Docs Glossary: Definitions of Web-related terms
in a web context, ruby is often used server-side with the ruby on rails (ror) framework to produce websites/apps. ruby is also a method for annotating east asian text in html documents to provide pronunciation information; see the <ruby> element. ...
SQL Injection - MDN Web Docs Glossary: Definitions of Web-related terms
$id = stripslashes($id) (2) $id = mysql_real_escape_string($id) so due to (1) each single quote (') in the input string is replaced with double quotes ("), and due to (2) before every (') it adds (/). the revised magical string fails to bypass the authentication, and your database stays secure. learn more general knowledge sql injection on wikipedia explanation of sql injection on owasp (open web application security project) ...
W3C - MDN Web Docs Glossary: Definitions of Web-related terms
the w3c coordinates companies in the industry to make sure they implement the same w3c standards. ...
WebAssembly - MDN Web Docs Glossary: Definitions of Web-related terms
webassembly (abbr. wasm) is an open binary programming format that can be run in modern web browsers in order to gain performance and/or provide new features for web pages. ...
WebGL - MDN Web Docs Glossary: Definitions of Web-related terms
you can invoke webgl within the html <canvas> element, which provides a rendering surface. all major browsers now support webgl, but its availability depends also on external factors (e.g. gpu support). ...
Routers - MDN Web Docs Glossary: Definitions of Web-related terms
he web: for the network layer, the router is a networking device that decides data packets directions. they are distributed by retailers allowing user interaction to the internet. for spa in application layer, router is a library that decides what web page is presented by a given url. this middleware module is used for all url functions, as these are given a path to a file that is rendered to open the next page. learn more general knowledge for network layer context: router (computing) on wikipedia for spa in application layer context, most of the popular spa frameworks has its routing library: angular router react router vue router ...
WebM - MDN Web Docs Glossary: Definitions of Web-related terms
webm is royalty-free and is an open web video format natively supported in mozilla firefox. learn more general knowledge webm on wikipedia ...
MDN Web Docs Glossary: Definitions of Web-related terms
ce nan nat native navigation directive netscape navigator network throttling nntp node node (dom) node (networking) node.js non-normative normative null nullish value number o object object reference 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 pixe...
WAI-ARIA basics - Learn web development
will want to know what errors are left, not just what has been added or removed from the list. we could go further with our aria usage, and provide some more validation help. how about indicating whether fields are required in the first place, and what range the age should be? at this point, take a copy of our form-validation.html and validation.js files, and save them in a local directory. open them both in a text editor and have a look at how the code works. first of all, add a paragraph just above the opening <form> tag, like the one below, and mark both the form <label>s with an asterisk. this is normally how we mark required fields for sighted users. <p>fields marked with an asterisk (*) are required.</p> this makes visual sense, but it isn't as easy to understand for screenre...
What is accessibility? - Learn web development
ecause they are in a wheelchair (modern public buildings generally have wheelchair ramps or elevators), it is also not right to exclude someone from a website because they have a visual impairment. we are all different, but we are all human, and therefore have the same human rights. accessibility is the right thing to do. providing accessible sites is part of the law in some countries, which can open up some significant markets that otherwise would not be able to use your services or buy your products. building accessible sites benefit everyone: semantic html, which improves accessibility, also improves seo, making your site more findable. caring about accessibility demonstrates good ethics and morals, which improves your public image. other good practices that improve accessibility als...
CSS values and units - Learn web development
hanges. the second box has a width set in vw (viewport width) units. this value is relative to the viewport width, and so 10vw is 10 percent of the width of the viewport. if you change the width of your browser window, the size of the box should change, however this example is embedded into the page using an <iframe>, so this won't work. to see this in action you'll have to try the example after opening it in its own browser tab. the third box uses em units. these are relative to the font size. i've set a font size of 1em on the containing <div>, which has a class of .wrapper. change this value to 1.5em and you will see that the font size of all the elements increases, but only the last item will get wider, as the width is relative to that font size. after following the instructions above, ...
Test Your Skills: Fundamental layout comprehension - Learn web development
bottom of this page. project brief you have been provided with some raw html, basic css, and images — now you need to create a layout for the design, which should look just like the image below. basic setup you can download the html, css, and a set of six images here. save the html document and stylesheet into a directory on your computer, and add the images into a folder named images. opening the index.html file in a browser should give you a page with basic styling but no layout, which should look something like the image seen below. this starting point has all of the content of your layout as displayed by the browser in normal flow. if you don't want to work locally then using a tool such as codepen or jsfiddle will work as well. you will need to upload the images using their ...
Grids - Learn web development
grid in css having decided on the grid that your design needs, you can use css grid layout to create that grid in css and place items onto it. we will look at the basic features of grid layout first and then explore how to create a simple grid system for your project. the following video provides a nice visual explanation of using css grid: defining a grid as a starting point, download and open the starting point file in your text editor and browser (you can also see it live here). you will see an example with a container, which has some child items. by default these display in normal flow so the boxes display one below the other. we will be working with this file for the first part of this lesson, making changes to see how grid behaves. to define a grid we use the grid value of the di...
Test your skills: Media Queries and Responsive Design - Learn web development
n. note: due to the need to test your design in multiple screen sizes we do not have an interactive editor for this task. download the code and work locally, or use an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. your task download the starting point. open this in your browser and you will find a wireframed site which will load in a mobile device in a readable manner. you can drag your window smaller or use the responsive design view in firefox devtools to view this as if on a phone. your task is to create a desktop version of this layout which displays when there is enough screen width to accomodate it. you can see the layout you are aiming for i...
What is CSS? - Learn web development
tax css is a rule-based language — you define rules specifying groups of styles that should be applied to particular elements or groups of elements on your web page. for example "i want the main heading on my page to be shown as large red text." the following code shows a very simple css rule that would achieve the styling described above: h1 { color: red; font-size: 5em; } the rule opens with a selector . this selects the html element that we are going to style. in this case we are styling level one headings (<h1>). we then have a set of curly braces { }. inside those will be one or more declarations, which take the form of property and value pairs. each pair specifies a property of the element(s) we are selecting, then a value that we'd like to give the property. before the c...
Styling links - Learn web development
ations to make the links look really cool. use your imagination, go wild. we are sure you can come up with something cooler and just as functional as our example above. if you make a mistake, you can always reset it using the reset button. if you get really stuck, press the show solution button to insert the example we showed above. ...
How do you host your website on Google App Engine? - Learn web development
side the website folder, and its landing page must be called index.html, but apart from that it can take whatever form you like. the app.yaml file is a configuration file that tells app engine how to map urls to your static files. you don't need to edit it. publishing your application now that we've got our project made and sample app files collected together, let's publish our app. open google cloud shell. drag and drop the sample-app folder into the left pane of the code editor. run the following in the command line to select your project: gcloud config set project gaesamplesite then run the following command to go to your app's directory: cd sample-app you are now ready to deploy your application, i.e. upload your app to app engine: gcloud app deploy enter a n...
How do I use GitHub Pages? - Learn web development
you can do that with other people's code too! this article provides a basic guide to publishing content using github's gh-pages feature. ...
What is a URL? - Learn web development
e2#somewhereinthedocument http is the protocol. the first part of the url indicates which protocol the browser must use. a protocol is a set method for exchanging or transferring data around a computer network. usually for websites it is the http protocol or its secured version, https. the web requires one of these two, but browsers also know how to handle other protocols such as mailto: (to open a mail client) or ftp: to handle file transfer, so don't be surprised if you see such protocols. www.example.com is the domain name. it indicates which web server is being requested. alternatively, it is possible to directly use an ip address, but because it is less convenient, it is not often used on the web. :80 is the port. it indicates the technical "gate" used to access the resources o...
What software do I need to build a website? - Learn web development
takes some expertise. (if you're going that route, microsoft has some tools for developers including a ready-to-use virtual machine at modern.ie.) by all means run some tests on a real device, especially on real mobile devices. mobile device simulation is a new, evolving technology and less reliable than desktop simulation. mobile devices cost money, of course, so we suggest taking a look at the open device lab initiative. you can also share devices if you want to test on many platforms without spending too much. next steps some of this software is free, but not all of it. find out how much it costs to do something on the web. if you'd like to learn more about text editors, read our article about how to choose and install a text editor. if you're wondering how to publish your website on...
Basic native form controls - Learn web development
alue="this is a reset button"> anonymous <button type="button"> this is an <strong>anonymous button</strong> </button> <input type="button" value="this is an anonymous button"> buttons always behave the same whether you use a <button> element or an <input> element. as you can see from the examples, however, <button> elements let you use html in their content, which is inserted between the opening and closing <button> tags. <input> elements on the other hand are empty elements; their displayed content is inserted inside the value attribute, and therefore only accepts plain text as content. the following examples show default, focused, and disabled button input types — in firefox 71 and safari 13 on macos and chrome 79 and edge 18 on windows 10. image button the image button contr...
HTML forms in legacy browsers - Learn web development
ng one solution or the other is up to you based on your project's constraints. let go of css one of the big issues with html forms is styling form widgets with css. form controls appearance is browser and operating system specific. for example, the input of color type looks different in safari, chrome and firefox browser, but the color picker widget is the same in all browsers on a device as it opens up the operating system's native color picker. it's generally a good idea to not alter the default appearance of form control because altering one css property value may alter some input types but not others. for example, if you declare input { font-size: 2rem; }, it will impact number, date, and text, but not color or range. if you alter a property, that may impact the appearance of the widget...
How to structure a web form - Learn web development
itly bind a control with a form even if it is not nested inside it. let's move forward and cover the structural elements you'll find nested in a form. the <fieldset> and <legend> elements the <fieldset> element is a convenient way to create groups of widgets that share the same purpose, for styling and semantic purposes. you can label a <fieldset> by including a <legend> element just below the opening <fieldset> tag. the text content of the <legend> formally describes the purpose of the <fieldset> it is included inside. many assistive technologies will use the <legend> element as if it is a part of the label of each control inside the corresponding <fieldset> element. for example, some screen readers such as jaws and nvda will speak the legend's content before speaking the label of each co...
Other form controls - Learn web development
e <input> element. <textarea cols="30" rows="8"></textarea> this renders like so: the main difference between a <textarea> and a regular single line text field is that users are allowed to include hard line breaks (i.e. pressing return) that will be included when the data is submitted. <textarea> also takes a closing tag, and any default text you want it to contain should be put between the opening and closing tags. in contrast, the <input> is an empty element with no closing tag — any default value is put inside the value attribute. note that even though you can put anything inside a <textarea> element (including other html elements, css, and javascript), because of its nature, it is all rendered as if it was plain text content. (using contenteditable on non-form controls provides an...
Sending form data - Learn web development
s later on. note: you can find this example on github — see post-method.html (see it live also). viewing http requests http requests are never displayed to the user (if you want to see them, you need to use tools such as the firefox network monitor or the chrome developer tools). as an example, your form data will be shown as follows in the chrome network tab. after submitting the form: open the developer tools. select "network" select "all" select "foo.com" in the "name" tab select "headers" you can then get the form data, as shown in the image below. the only thing displayed to the user is the url called. as we mentioned above, with a get request the user will see the data in their url bar, but with a post request they won't. this can be very important for two reasons: ...
Your first form - Learn web development
closed with the proper ending tag. this has an impact on a specific feature of forms: the way you define the default value. to define the default value of an <input> element you have to use the value attribute like this: <input type="text" value="by default this element is filled with this text"> on the other hand, if you want to define a default value for a <textarea>, you put it between the opening and closing tags of the <textarea> element, like this: <textarea> by default this element is filled with this text </textarea> the <button> element the markup for our form is almost complete; we just need to add a button to allow the user to send, or "submit", their data once they have filled out the form. this is done by using the <button> element; add the following just above the closing ...
Dealing with files - Learn web development
web. file paths to make files talk to one another, you have to provide a file path between them — basically a route, so one file knows where another one is. to demonstrate this, we will insert a little bit of html into our index.html file, and make it display the image you chose in the article "what will your website look like?" copy the image you chose earlier into your images folder. open up your index.html file, and insert the following code into the file exactly as shown. don't worry about what it all means for now — we'll look at the structures in more detail later in the series. <!doctype html> <html> <head> <meta charset="utf-8"> <title>my test page</title> </head> <body> <img src="" alt="my test image"> </body> </html> the line <img src="" alt="my...
Publishing your website - Learn web development
these resources are good enough for your initial experiments. many companies provide hosting and domains. using an online tool like github or google app engine some tools let you publish your website online: github is a "social coding" site. it allows you to upload code repositories for storage in the git version control system. you can then collaborate on code projects, and the system is open-source by default, meaning that anyone in the world can find your github code, use it, learn from it, and improve on it. github has a very useful feature called github pages, which allows you to expose website code live on the web. google app engine is a powerful platform that lets you build and run applications on google’s infrastructure — whether you need to build a multi-tiered web applic...
Use JavaScript within a webpage - Learn web development
u need to be familiar with how to create a basic html document. objective: learn how to trigger javascript in your html file, and learn the most important best practices for keeping javascript accessible. about javascript javascript is a programming language mostly used client-side to make webpages interactive. you can create amazing webpages without javascript, but javascript opens up a whole new level of possibilities. in this article we're going over the html code you need to make javascript take effect. if you want to learn javascript itself, you can start with our javascript basics article. if you already know something about javascript or if you have a background with other programming languages, we suggest you jump directly into our javascript guide. how to trigg...
Document and website structure - Learn web development
example seen above is represented by the following code (you can also find the example in our github repository). we'd like you to look at the example above, and then look over the listing below to see what parts make up what section of the visual. ...
Mozilla splash page - Learn web development
should optimise your jpg and png images to make them as small as possible, while still looking ok. tinypng.com is a great service for doing this easily. adding a logo to the header inside the <header> element, add an <img> element that will embed the small version of the firefox logo in the header. adding a video to the main article content just inside the <article> element (right below the opening tag), embed the youtube video found at https://www.youtube.com/watch?v=ojcncvb1olg, using the appropriate youtube tools to generate the code. the video should be 400px wide. adding responsive images to the further info links inside the <div> with the class of further-info you will find four <a> elements — each one linking to an interesting mozilla-related page. to complete this section you...
From object to iframe — other embedding technologies - Learn web development
as the same effect can be better achieved using border: none; in your css. src this attribute, as with <video>/<img>, contains a path pointing to the url of the document to be embedded. width and height these attributes specify the width and height you want the iframe to be. fallback content in the same way as other similar elements like <video>, you can include fallback content between the opening and closing <iframe></iframe> tags that will appear if the browser doesn't support the <iframe>. in this case, we have included a link to the page instead. it is unlikely that you'll come across any browser that doesn't support <iframe>s these days. sandbox this attribute, which works in slightly more modern browsers than the rest of the <iframe> features (e.g. ie 10 and above) requests heig...
Video and audio content - Learn web development
atents covering some or all of the technology that they're based upon. in the united states, patents covered mp3 until 2017, and h.264 is encumbered by patents through at least 2027. because of those patents, browsers that wish to implement support for those codecs must pay typically enormous license fees. in addition, some people simply prefer to avoid restricted software and prefer to use only open formats. due to these legal and preferential reasons, web developers find themselves having to support multiple formats to capture their entire audience. the codecs described in the previous section exist to compress video and audio into manageable files, since raw audio and video are both exceedingly large. each web browser supports an assortment of codecs, like vorbis or h.264, which are used...
Assessment: Structuring planet data - Learn web development
ished table should look like this: you can also see the example live here (no looking at the source code — don't cheat!) steps to complete the following steps describe what you need to do to complete the table example. all the data you'll need is contained in the planets-data.txt file. if you have trouble visualising the data, look at the live example above, or try drawing a diagram. open your copy of blank-template.html, and start the table off by giving it an outer container, a table header, and a table body. you don't need a table footer for this example. add the provided caption to your table. add a row to the table header containing all the column headers. create all the content rows inside the table body, remembering to make all the row headings into headings semantically...
Making asynchronous programming easier with async and await - Learn web development
ee source code) awaiting a promise.all() async/await is built on top of promises, so it's compatible with all the features offered by promises. this includes promise.all() — you can quite happily await a promise.all() call to get all the results returned into a variable in a way that looks like simple synchronous code. again, let's return to an example we saw in our previous article. keep it open in a separate tab so you can compare and contrast with the new version shown below. converting this to async/await (see live demo and source code), this now looks like so: async function fetchanddecode(url, type) { let response = await fetch(url); let content; if (!response.ok) { throw new error(`http error! status: ${response.status}`); } else { if(type === 'blob') { co...
Choosing the right approach - Learn web development
single delayed operation repeating operation multiple sequential operations multiple simultaneous operations no yes (recursive callbacks) yes (nested callbacks) no code example an example that loads a resource via the xmlhttprequest api (run it live, and see the source): function loadasset(url, type, callback) { let xhr = new xmlhttprequest(); xhr.open('get', url); xhr.responsetype = type; xhr.onload = function() { callback(xhr.response); }; xhr.send(); } function displayimage(blob) { let objecturl = url.createobjecturl(blob); let image = document.createelement('img'); image.src = objecturl; document.body.appendchild(image); } loadasset('coffee.jpg', 'blob', displayimage); pitfalls nested callbacks can be cumbersome...
Introducing asynchronous JavaScript - Learn web development
de the containing function’s body. the containing function is responsible for executing the callback function when the time comes. you can write your own function containing a callback easily enough. ...
Build your own function - Learn web development
written into your <script> element just fine, but it will do nothing as it stands. try including the following line below your function to call it: displaymessage(); this line invokes the function, making it run immediately. when you save your code and reload it in the browser, you'll see the little message box appear immediately, only once. we are only calling it once, after all. now open your browser developer tools on the example page, go to the javascript console and type the line again there, you'll see it appear again! so this is fun — we now have a reusable function that we can call any time we like. but we probably want it to appear in response to user and system actions. in a real application, such a message box would probably be called in response to new data being a...
Functions — reusable blocks of code - Learn web development
ook at a real example to demonstrate scoping. first, make a local copy of our function-scope.html example. this contains two functions called a() and b(), and three variables — x, y, and z — two of which are defined inside the functions, and one in the global scope. it also contains a third function called output(), which takes a single parameter and outputs it in a paragraph on the page. open the example up in a browser and in your text editor. open the javascript console in your browser developer tools. in the javascript console, enter the following command: output(x); you should see the value of variable x output to the screen. now try entering the following in your console output(y); output(z); both of these should return an error along the lines of "referenceerror: y is ...
Third-party APIs - Learn web development
in the javascript/apis/third-party-apis/mapquest directory. next, you need to go to the mapquest developer site, create an account, and then create a developer key to use with your example. (at the time of writing, it was called a "consumer key" on the site, and the key creation process also asked for an optional "callback url". you don't need to fill in a url here: just leave it blank.) open up your starting file, and replace the api key placeholder with your key. changing the type of map there are a number of different types of map that can be shown with the mapquest api. to do this, find the following line: layers: l.mapquest.tilelayer('map') try changing 'map' to 'hybrid' to show a hybrid-style map. try some other values too. the tilelayer reference page shows the different a...
Silly story generator - Learn web development
mbers, operators, strings, and arrays. starting point to get this assessment started, you should: go and grab the html file for the example, save a local copy of it as index.html in a new directory somewhere on your computer, and do the assessment locally to begin with. this also has the css to style the example contained within it. go to the page containing the raw text and keep this open in a separate browser tab somewhere. you'll need it later. alternatively, you could use a site like jsbin or glitch to do your assessment. you could paste the html, css and javascript into one of these online editors. if the online editor you are using doesn't have a separate javascript panel, feel free to put it inline in a <script> element inside the html page. note: if you get stuck, then ...
Handling text — strings in JavaScript - Learn web development
, or include expression results inside them, traditional strings can be fiddly to write: let score = 9; let highestscore = 10; let output = 'i like the song "' + song + '". i gave it a score of ' + (score/highestscore * 100) + '%.'; template literals simplify this enormously: output = `i like the song "${ song }". i gave it a score of ${ score/highestscore * 100 }%.`; there is no more need to open and close multiple string pieces — the whole lot can just be wrapped in a single pair of backticks. when you want to include a variable or expression inside the string, you include it inside a ${ } construct, which is called a placeholder. you can include complex expressions inside template literals, for example: let examscore = 45; let examhighestscore = 70; examreport = `you scored ${ exams...
Object building practice - Learn web development
ete circle. if you had specified only 1 * pi, you'd get a semi-circle (180 degrees). last of all, we use the fill() method, which basically states "finish drawing the path we started with beginpath(), and fill the area it takes up with the color we specified earlier in fillstyle." you can start testing your object out already. save the code so far, and load the html file in a browser. open the browser's javascript console, and then refresh the page so that the canvas size changes to the smaller visible viewport that remains when the console opens. type in the following to create a new ball instance: let testball = new ball(50, 100, 4, 4, 'blue', 10); try calling its members: testball.x testball.size testball.color testball.draw() when you enter the last line, you should ...
What is web performance? - Learn web development
primary tasks, and sometimes we only load assets when they are actually needed (this is called lazy loading). the measurement of how long it takes the site to get to a usable start after it has started loading is called time to interactive. smoothness and interactivity: does the application feel reliable and pleasurable to use? is the scrolling smooth? are buttons clickable? are pop-ups quick to open up, and do they animate smoothly as they do so? there are a lot of best practices to consider in making apps feel smooth, for example using css animations rather than javascript for animation, and minimizing the number of repaints the ui requires due to changes in the dom. perceived performance: how fast a website seems to the user has a greater impact on user experience than how fast the websit...
Website security - Learn web development
ck). the solution is to sanitize input before using it. command injection. command injection attacks allow a malicious user to execute arbitrary system commands on the host operating system. the solution is to sanitize user input before it might be used in system calls. for a comprehensive listing of website security threats see category: web security exploits (wikipedia) and category: attack (open web application security project). a few key messages almost all of the security exploits in the previous sections are successful when the web application trusts data from the browser. whatever else you do to improve the security of your website, you should sanitize all user-originating data before it is displayed in the browser, used in sql queries, or passed to an operating system or file sys...
Ember interactivity: Events, classes and state - Learn web development
ich we’ll rename to @service for semantic clarity. to do this, add the following import line to header.js, beneath the two existing import lines: import { inject as service } from '@ember/service'; with this import in place, we can now make the todo-data service available inside the headercomponent class via the todos object, using the @service decorator. add the following line just below the opening export... line: @service('todo-data') todos; now the placeholder alert(text); line can be replaced with a call to our new add() function. replace it with the following: this.todos.add(text); if we try this out in the todo app in our browser (npm start, go to localhost:4200), it will look like nothing happens after hitting the enter key (although the fact that the app builds without any err...
Ember resources and troubleshooting - Learn web development
ote api — from ember-data, by default) deprecation information render performance for general javascript debugging, check out our guides on javascript debugging as well as interacting with the browser's other debugging tools. in any default ember project, there will be two main javascript files, vendor.js and {app-name}.js. both of these files are generated with sourcemaps, so when you open the vendor.js or {app-name}.js to search for relevant code, when a debugger is placed, the sourcemap will be loaded and the breakpoint will be placed in the pre-transpiled code for easier correlation to your project code. for more information on sourcemaps, why they're needed, and what the ember-cli does with them, see the advanced use: asset compilation guide. note that sourcemaps are enabled b...
Introduction to client-side frameworks - Learn web development
following. ember ember was initially released in december 2011 as a continuation of work that started in the sproutcore project. 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. start learning ember angular angular is an open-source web application framework led by the angular team at google and by a community of individuals and corporations. it is a complete rewrite from the same team that built angularjs. angular was officially released on the 14th of september 2016. angular is a component-based framework which uses declarative html templates. at build time, transparently to developers, the framework's compiler tra...
Accessibility in React - Learn web development
you should see both messages in your console, with each one repeating three times. note how "main render" logged first, and "side effect" logged second, even though the "side effect" log appears first in the code. main render (3) todo.js:100 side effect (3) todo.js:98 that's it for our experimentati...
React interactivity: Events and state - Learn web development
o your <input /> element, which should use an anonymous function to call props.toggletaskcompleted() with a parameter of props.id. the <input /> should now look like this: <input id={props.id} type="checkbox" defaultchecked={props.completed} onchange={() => props.toggletaskcompleted(props.id)} /> save everything and return to your browser and notice that our first task, eat, is checked. open your javascript console, then click on the checkbox next to eat. it unchecks, as we expect. your javascript console, however, will log something like this: object { id: "task-0", name: "eat", completed: true } the checkbox unchecks in the browser, but our console tells us that eat is still completed. we will fix that next! synchronizing the browser with our data let’s revisit our toggletask...
React interactivity: Editing, filtering, conditional rendering - Learn web development
we’re going to do some refactoring. a ui for editing in order to allow users to edit a task, we have to provide a user interface for them to do so. first, import usestate into the todo component like we did before with the app component, by updating the first import statement to this: import react, { usestate } from "react"; we'll now use this to set an isediting state, the default...
Beginning our React todo list - Learn web development
this way, it will match the <h1> at the top of our app. <title>todomatic</title> when your browser refreshes, you should see something like this: it's ugly, and doesn’t function yet, but that's okay — we'll style it in a moment. first, consider the jsx we have, and how it corresponds to our user stories: we have a...
Adding a new todo form: Vue events, methods, and models - Learn web development
passive: true } parameter when creating an event listener in vanilla javascript using addeventlistener(). in this case, we need to use the .prevent handler to stop the browser’s default submit action. add .prevent to the @submit handler in your template like so: <form @submit.prevent="onsubmit"> if you try submitting the form now, you'll notice that the page doesn't reload. if you open the console, you can see the results of the console.log() we added inside our onsubmit() method. binding data to inputs with v-model next up, we need a way to get the value from the form's <input> so we can add the new to-do item to our todoitems data list. the first thing we need is a data property in our form to track the value of the to-do. add a data() method to our todoform componen...
Focus management with Vue refs - Learn web development
medited() and editcancelled() methods: itemedited(newitemname) { this.$emit("item-edited", newitemname); this.isediting = false; this.focusoneditbutton(); }, editcancelled() { this.isediting = false; this.focusoneditbutton(); }, try editing and then saving/cancelling a to-do item via your keyboard. you'll notice that focus isn’t being set, so we still have a problem to solve. if you open your console, you'll see an error raised along the lines of "can't access property "focus", editbuttonref is undefined". this seems weird. your button ref was defined when you activated the "edit" button, but now it’s not. what is going on? well, remember that when we change isediting to true, we no longer render the section of the component featuring the "edit" button. this means there's no e...
Implementing feature detection - Learn web development
le (you should also update your <title> element to something more suitable!): <link href="modernizr-css.css" rel="stylesheet"> above this <link> element, add a <script> element to apply the modernizr library to the page, as shown below. this needs to be applied to the page before any css (or javascript) that might make use of it. <script src="modernizr-custom.js"></script> now edit your opening <html> tag, so that it looks like this: <html class="no-js"> at this point, try loading your page, and you'll get an idea of how modernizr works for css features. if you look at the dom inspector of your browser's developer tools, you'll see that modernizr has updated your <html> class value like so: <html class="js no-htmlimports sizes flash transferables applicationcache blobconstruct...
Git and GitHub - Learn web development
ou to resources on external sites. eventually we will are aiming to have our own dedicated git/github course, but for now, these will help you get to grips with the subject in hand. hello world (from github) this is a good place to start — this practical guide gets you to jump right into using github, learning the basics of git such as creating repositories and branches, making commits, and opening and merging pull requests. git handbook (from github) this git handbook goes into a little more depth, explaining what a vcs is, what a repository is, how the basic github model works, git commands and examples, and more. forking projects (from github) forking projects is essential when you want to contribute to someone else's code. this guide explains how. about pull requests (from githu...
Client-side tooling overview - Learn web development
than regular string literals). eslint is the industry standard javascript linter — a highly configurable tool for catching potential syntax errors and encouraging "best practices" throughout your code. some companies and projects have also shared their eslint configs. you can also find linting tools for other languages, such as csslint. also well-worth looking at is webhint, a configurable, open-source linter for the web that surfaces best practices including approaches to accessibility, performance, cross-browser compatibility via mdn's browser compatibility data, security, testing for pwas, and more. it is available as a node.js command-line tool and a vs code extension. source code control also known as version control systems (vcs), source code control is essential for backing work...
Learn web development
are all available on github. if you want to copy them all to your computer, the easiest way is to download a zip of the latest master code branch. if you prefer to copy the repo in a more flexible way that allows for automatic updates, you can follow the more complex instructions: install git on your machine. this is the underlying version control system software that github works on top of. open your computer's command prompt (windows) or terminal (linux, macos). to copy the learning area repo to a folder called learning-area in the current location your command prompt/terminal is pointing to, use the following command: git clone https://github.com/mdn/learning-area you can now enter the directory and find the files you are after (either using your finder/file explorer or the cd co...
Chrome Worker Modules
re/modules/osfile/osfile_shared_allthreads.jsm"); // we may now use module core. core.declareffi(...) note that, for the moment, require() only accepts absolute uris. if the your module uri ends with “.js”, you can omit the extension. creating modules creating a module is just as simple. a module is a file, whose filename generally ends with either “.js” or “.jsm”, and designed to be opened through require(). any value you define in that file is private by default. to make the value public, you just have to add it to either global value exports, as follows: /* file mymodule.js */ let secretkey = "this is a secret"; let publickey = "this is public"; exports.key = publickey; // secretkey is not exported // publickey is exported with name "key" alternatively, if you prefer that style...
ChromeWorkers and the Chrome worker loader
that makes it available not only to the application itself, but also to add-ons. this documentation covers chrome workers and the chrome worker module loader. note: if you're contributing content to this section, create subpages using the "new sub-page" option in the "this page" menu. once you've saved your new page, come back to this one and force-refresh this page. that will regenerate the table of contents below for all readers. chrome worker modulesthe preferred way to define and load modules for chrome workers is to use the chrome worker module loader. ...
Accessibility/LiveRegionDevGuide
best guide for some developers is the code itself. please refer to the liveregions and gecko python modules in orca for a real world example. for more information about live regions, please read the aria properties spec or the live region report to learn about aria live region markup and the live region api support document for the latest firefox api with regards to live regions. as always, we're open to questions and suggestions for changes in community forums. priority queue the heart of any live region support module is the priority queue. it is responsible for queuing messages derived from live region events, where priority is determined by chronological order and the live politeness properties. in addition to the standard priority queue methods, additional methods will need to be imp...
Mozilla accessibility architecture
ethods in iaccessible, but because it is also an nsaccessible, it only needs to call the nsiaccessible methods in "this" to get at the information it needs. class inheritence diagram view the class inheritence diagram. 3. accessible tree construction and traversal the accessible tree is constructed on demand. the first request for an accessible is usually the accessible for document in one of the open windows, and the code in widget/src/gtk2 or widget/src/windows must return this doc accessible. even if a child accessible of the document is asked for first, the doc accessible will be created first, because it is needed to cache any accessibles created within it. when the doc accessible is asked for, an event is fired which reaches the presshell, which then uses the accessibility service single...
Information for External Developers Dealing with Accessibility
nt text selection with keys, functions of function keys, what are reserved keyboard shortcuts, how to create your own keyboard shortcuts, keyboard focus and navigation, type-ahead and key-repeat, etc. gnome keys: keyboard documentation for gnome 2.2: still seeking developer guidelines for keyboard. other useful resources links for those who wish to learn more about web accessibility or open source accessibility. join the mozilla accessibility community live chat both end users and developers are invited for discussion on the live irc channel at irc.mozilla.org/#accessibility. since this is a worldwide effort, there is always a good chance to find someone to chat with there, day or night. newsgroup and mailing list we have two discussion lists, which can be read via a newsgro...
Accessibility and Mozilla
s evaluating mozillainformation for usersfirefox 2 now has help topics (from the menubar: ? > help contents f1 > accessibility features) which describe any special features and keyboard shortcuts designed to help users with disabilities. please check the accessibility help topic for more information.links and resourceshere are some useful links for those interested in web accessibility as well as open source accessibility.mozilla accessibility architecturethis page is maintained by aaron leventhal and by the mozilla accessibility community. feedback and constructive suggestions are encouraged.mozilla plugin accessibilityplugins in gecko-based browsers have a lot of accessibility issues. here is a rundown of problems and the planned solutions:mozilla's section 508 compliancemozilla’s uaag eva...
Index
e tags and summary 1 add-ons add-ons, extension, extensions, landing, mozilla add-ons allow developers to extend and modify the functionality of firefox. 675 creating an appealing add-on listing add-ons, beginner, guide, webextension, publishing there are two essential steps to getting people to use your add-on: they need to discover your add-on and open the listing page, then the listing page needs to encourage them to click the add to firefox button. the content you add to a listing is therefore vital: from making effective use of keywords in your descriptions, to get visibility in external search engine results, through having an icon that attracts a user’s attention from a category list, to screenshots that show how useful your add-on is. ...
Theme concepts
heme]); } learn more about dynamic themes and see an additional example in the following video: if you have not built a browser extension before, check out your first extension for a step-by-step guide. cross-browser compatibility there is currently limited compatibility between themes in the major browsers. opera takes an entirely different approach, and microsoft edge themes are not yet open to developers. there is good compatibility between firefox static themes and chrome themes, providing the ability to port a single header image theme from firefox to chrome. however, noting that "frame": and "tab_background_text": only support rgb color array definition on chrome. so, in the single image theme example (weta_fade) could be supported in chrome using the following manifest.json fi...
Benchmarking
rticular, "gc poisoning" is used in all debug builds, and in optimized nightly builds (but not opt developer edition or beta builds). the poisoning can be disabled by setting the environment variable jsgc_disable_poisoning=1 before starting the browser. async stacks async stacks no longer impact performance since firefox 78, as bug 1601179 limits async stack capturing to when devtools is opened. another option that is on by default in non-release builds is the preference javascript.options.asyncstack, which provides better debugging information to developers. set it to false to match a release build. (this may be disabled for many situations in the future. see bug 1280819. accelerated graphics especially on linux, accelerated graphics can sometimes lead to severe performance probl...
Browser chrome tests
you to run javascript code in the same scope as the main firefox browser window and report results using the same functions as the mochitest test framework. as all tests, they won't work in a build with tests disabled (--disable-tests). running the browser chrome tests to run mochitest, first build mozilla with your changes; then run ./mach mochitest -f browser this will launch your build and open a "browser chrome tests" window, and report the results in the ui and to stdout. it is possible to run specific groups of tests. as with mochitest, the path given as an argument is the path to a test or directory within the mozilla source tree. if the path points to a directory, then the tests in that directory and all of its subdirectories will be run. for example, to run the tests in browser/...
Creating MozSearch plugins
firefox 2 uses a simplified form of the opensearch format for storing search plugins. a mozsearch search plugin is an xml file that describes the search engine, its url, and the parameters that need to be passed to that url. warning: mozsearch is non-standard and is intended for internal use within mozilla projects only. it should only be used if your intention is to distribute the search plugin packaged in a firefox extension, or if you are creating plugins meant to be shipped by default in a firefox build. for creating search plugins for installation from the web, see creating opensearch plugins for firefox the plugin file the mozsearch format is similar to the opensearch format. the only difference is the root element and xml namespace. example: searching yahoo! the following x...
Creating a Language Pack
ate a new langpack, you need to run this command. remember that you need to be in the directory obj-firefox-build/browser/locales. $ make langpack-x-testing locale_mergedir=$(pwd)/mergedir now go to the dist directory to find your langpack ready to use! $ cd ../../dist the xpi file can be found in the directory win32/xpi on windows, linux-i686/xpi or linux-x86_64 on linux or mac/xpi on mac. open the xpi file contained in this directory with firefox to see your work. you have to set your selected language still. you can either use the locale switcher extension, or set it in about:config. add the preference intl.locale.requested and set it to your language code, in this case, x-testing, or add it in front of the current setting, seperated with a comma. before gecko 59 you had to set the pr...
Debugging JavaScript
this document is intended to help developers writing javascript code in mozilla, mainly for mozilla itself, but it may also be useful for web developers. it should give pointers to tools, aids and tricks which make debugging your code easier. web console this is the first place to go when you're debugging a web page; open the web console using the web console option in the web developer menu. this shows any javascript errors in your app, as well as any logging calls from the console api. browser console the browser console lets you see all javascript errors and logging in the browser, including from firefox code. to enable it, go to about:config in the url bar and set devtools.chrome.enabled to true, or set the "enable chrome and add-on debugging" option in the developer tool setti...
Debugging
n how to setup record and replay debugging on firefox, to help debug intermittent mochitest failures. detecting defects in firefox with coverity coverity is a static analysis system that can detect defects in firefox. gecko logging using old-school logging to try to track down what's going on. debugging specific parts of the mozilla codebase debugging opengl if you're working on code that involves opengl calls, and need to debug it, you can turn on a special opengl debugging mode. debugging frame reflow and debugging table reflow notes on debugging issues in gecko's layout engine. miscellaneous debugging safari some tips for debugging safari debugging chrome some tips for debugging chrome deb...
OS TARGET
os_target is typically the output of the 'uname -s' command on the target platform. ...
pymake
would type python build/pymake/make.py -f client.mk. to run tests instead of typing make mochitest-plain in the object directory, you would type python ../build/pymake/make.py mochitest-plain. alternately, if you would like to simply type in pymake -f client.mk from within the mingw32 shell. while in the shell type cd ~ (without quotes). type touch .profile using any appropriate text editor open .profile and add the following line in the file (assuming your mozilla-central is at c:/mozilla-central, if not, adjust your path accordingly.) alias pymake=c:/mozilla-central/build/pymake/make.py save your .profile edit and close the shell, then restart the shell. try typing just pymake into the shell and press enter. this should come back with "no makefile found." if it does, your pymake a...
SVG Guidelines
ibutes (sketch:foo, illustrator:foo, sopodi:foo, …) the xml namespace definition that comes with the latter (xmlns:sketch, xmlns:sopodi, …) other metadata in addition to non-standard editor metadata, standard compliant metadata also exists. typical examples of this are <title> and <desc> tags. although this kind of data is supported by the browser, it can only be displayed when the svg is opened in a new tab. plus, in most of the cases, the filename is quite descriptive so it's recommended to remove that kind of metadata since it doesn't bring much value. you shouldn't include doctypes in your svgs either; they are a source of many issues, and the svg wg recommends not to include them. see svg authoring guidelines. avoid the use of cdata sections cdata sections are used to avoid par...
Experimental features in Firefox
see bug 1621781, bug 1245183, and bug 1401304 for more details. release channel version added enabled by default? nightly 76[1] yes developer edition 76[1] yes beta 76[1] yes release 76[1] no preference name n/a [1] support for zooming using the double-tap gesture was added in fire...
Communicating with frame scripts
message.objects); } so combining this message listener with the message above will give console output somewhat like this, when the user clicks a <div>: "my-addon@me.org:my-e10s-extension-message" false object { details: "they clicked", tag: "div" } <xul:browser anonid="initialbrowser" ... > { target: <div#searchcontainer> } if your code requires access to a window (for example to run window.opendialog), and your message listener is run from somewhere without access to a window (e.g. an xpcom component), you can access the window of the browser that sent the message with message.target.ownerdocument.defaultview. synchronous messaging to send a synchronous message, the frame script uses the global sendsyncmessage() function: // frame script sendsyncmessage("my-addon@me.org:my-e10s-exten...
Process scripts
to run code in the content process in order to access web content, then you should use frame scripts. however, a problem with frame scripts is that they can be loaded multiple times in the content process, in multiple scopes that are insulated from each other. for example, if you call the global frame message manager's loadframescript() function, then the script will be loaded separately into all open tabs. this can then cause a problem the frame scripts are interacting with a global service in the content process. for example, in multiprocess firefox, if you need to use nsicontentpolicy to register a content policy, you must do this in the content process. but if you register it in a frame script, and the frame script is loaded more than once, you'll register the content policy more than onc...
Message manager overview
cate with frame scripts using addmessagelistener() and broadcastasyncmessage() or sendasyncmessage() functions. note that in this context, "browser" refers to the xul <browser> object, which is a frame that hosts a single web document. it does not refer to the more general sense of a web browser. global message manager the global message manager operates on every <browser> (that is, every open content tab). loadframescript() loads the given script into every <browser> in every browser window. broadcastasyncmessage() sends the message to every <browser> in every browser window. it's a chromemessagebroadcaster object, which implements the following interfaces: nsiframescriptloader nsimessagelistenermanager nsimessagebroadcaster you can access the global message manager like...
Performance best practices for Firefox front-end engineers
risking a synchronous reflow. nsidomwindowutils.getscrollxy() returns the window's scroll offsets without taking the chance of causing a sync reflow. writing tests to ensure you don’t add more unintentional reflow the interface nsireflowobserver lets us detect both interruptible and uninterruptible reflows. a number of tests have been written that exercise various functions of the browser (opening tabs, opening windows) and ensure that we don’t add new uninterruptible reflows accidentally while those actions occur. you should add tests like this for your feature if you happen to be touching the dom. detecting over-painting with paint flashing painting is, in general, cheaper than both style calculation and layout calculation; still, the more you can avoid, the better. generally spe...
Firefox
firefox is mozilla's popular web browser, available for multiple platforms including windows, macos, and linux on the desktop and all android and ios mobile devices. with broad compatibility, the latest in web technologies, and powerful development tools, firefox is a great choice for both web developers and end users. firefox is an open source project; much of the code is contributed by our huge community of volunteers. here you can learn about how to contribute to the firefox project and you will also find links to information about the construction of firefox add-ons, using the developer tools in firefox, and other topics. learn how to create add-ons for firefox, how to develop and build firefox itself, and how the internals of firefox and its subprojects work. project documentation...
Using the Browser API
Mozilla › Gecko › Chrome › API › Browser API › Using
le, and other parts of the documentation. demo to demonstrate basic usage of this api, we have created a simple browser api demo that provides buttons allowing you to (re)load web pages, stop loading, move forward and back in history, and zoom in and out of the page. to run the demo, the best approach is to clone the github repo locally (or just download it directly if you don't do github), open webide, open the repo as a packaged app, then run it either on a simulator or a real device if you have one. in any case, you should at least download the repo and refer to the code as you read the sections below. the html an <iframe> is turned into a browser iframe by setting the mozbrowser attribute on it: <iframe src="http://mozilla.org" mozbrowser> in addition, the <iframe> can be loaded...
mozbrowseractivitydone
browser.addeventlistener("mozbrowseractivitydone", function(event) { if(event.details.success) { console.log('activity completed successfully'); } else { console.log('activity not completed successfully'); } }); related events mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowserasyncscroll
. ...
mozbrowseraudioplaybackchange
ndicates whether audio is playing in the browser. ...
mozbrowsercaretstatechanged
possible values are cut, copy, paste and selectall. ...
mozbrowserclose
ncellable or not. ...
mozbrowsercontextmenu
being accessed is a menu. ...
mozbrowserdocumentfirstpaint
hether the event is cancellable or not. ...
mozbrowsererror
tedcontenterror 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 mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsershowmodalprompt mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowserfindchange
("iframe"); browser.addeventlistener("mozbrowserfindchange", function(event) { console.log("currently highlighted: " + event.details.activematchordinal + " out of " + event.details.numberofmatches); }); related events mozbrowserasyncscroll mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsershowmodalprompt mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowserfirstpaint
whether the event is cancellable or not. ...
mozbrowsericonchange
to link to the icon. ...
mozbrowserloadend
reload.textcontent = 'r'; console.log(e.detail.backgroundcolor); controls.style.background = e.detail.backgroundcolor; }); browser.addeventlistener('mozbrowserloadend',function() { stopreload.textcontent = 'r'; }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsershowmodalprompt mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowserloadstart
cument.queryselector("iframe"); browser.addeventlistener('mozbrowserloadstart',function() { stopreload.textcontent = 'x'; }); browser.addeventlistener('mozbrowserloadend',function() { stopreload.textcontent = 'r'; }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsershowmodalprompt mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowserlocationchange
at it will always display the correct url for the current location. ...
mozbrowsermanifestchange
l of the new app manifest. ...
mozbrowsermetachange
ddeventlistener("mozbrowsermetachange", function(event) { console.log("a meta tag has been " + event.details.type + ". ...
mozbrowsersecuritychange
false). ...
mozbrowserselectionstatechanged
lectionstatechanged", function( event ) { if(event.details.visible) { console.log("the current selection is visible."); } else { console.log("the current selection is not visible."); } }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowsershowmodalprompt
xample var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowsershowmodalprompt", function( event ) { console.log("asking for prompt:" + json.stringify(event.detail)); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowsertitlechange
example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowsertitlechange", function( event ) { console.log("the title of the document is:" + event.detail); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsershowmodalprompt mozbrowserusernameandpasswordrequired ...
mozbrowserusernameandpasswordrequired
owser = document.queryselector("iframe[mozbrowser]"); browser.addeventlistener("mozbrowserusernameandpasswordrequired", function( event ) { console.log("the auth realm is:" + event.detail.realm); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsertitlechange ...
mozbrowservisibilitychange
addeventlistener("mozbrowservisibilitychange", function( event ) { if(event.details.visible) { console.log("the browser is visible."); } else { console.log("the browser is hidden."); } }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsertitlechange ...
Embedding the editor
g session multiple-editor support eliminate specific interdependencies between composer and the xul document, via nsieditoruserinterface create bottleneck for getting to the focussed editor; ensure that focus changes update state move editor ownership to docshell, creating nsieditorframe created the editing session api which copes with collections of editors (or make editor refocussable) open questions where should file open and save logic live? it seems that some embedders will want composer open and save file logic, and some won't. where should this logic live? can it be in javascript? of course, an embedder should be able to use its own open and save dialogs, and communicate with composer to coordinate the open or save process. possible answer the embedder provides open and save di...
Embedding Mozilla
you can even construct whole new applications using chrome. documentation gecko embedding basics an introduction to embedding the gecko rendering engine. embedding tips some frequently asked questions about embedding. mozilla embedding apis overview introduction to the mozilla embedding apis. ...
Getting Started with Chat
nels and topics. /msg nick message sends a private message to the specified user /nick nickname change your current nickname nickname: ping get a user's attention (nickname is the name of the user you want the attention of) nickname: pong respond to a user's ping (nickname is the name of the user who wants your attention) /query nickname opens a private chat with the specified user /quit message disconnects you from the current server displaying the message in all connected channels prior to quitting /reload styles some irc clients, colloquy on mac in particular, stop displaying your messages in the channel window. if this happens, you can type this command to resolve this issue. /server server-name ...
How Mozilla determines MIME Types
here the listed "default application" comes from. the "data source" (that is, the list of helper applications) is searched for an entry with the mime type of the uri. the data source is the mimetypes.rdf file in the profile directory. if this fails, the data source is searched via the extension (content-disposition as above). if one of these lookups succeed, this is where the application in the "open with" field comes from, and also where the description of the type comes from. if this also failed, the extras are searched again, and will supply the extension-list and a description of the mime type. related information document loading - from load start to finding a handler original document information author(s): christian biesinger last updated date: march 7, 2005 copyright inform...
How to get a process dump with Windows Task Manager
d version of firefox from mozilla. you can find the latest trunk nightly builds under http://ftp.mozilla.org/pub/mozilla.o.../latest-trunk/. creating the dump file ensure that firefox is not already running. run firefox, reproduce the hang start firefox and perform whatever steps are necessary to cause firefox to hang. once the browser hangs, continue with the steps below. after the hang open windows task manager (ctrl+shift+esc). find firefox.exe among the list of processes. right-click firefox.exe and select "create dump file". task manager should indicate where the dump file was written to. see also how to get a stacktrace for a bug report [en-us] how to create a user-mode process dump file in windows vista and in windows 7 (msdn) ...
How to Report a Hung Firefox
utton to find the crash me icon and click the icon. firefox crash report ui should appear. please check the box to send the crash report to mozilla start firefox. type "about:crashes" in the url bar and click on the top listing. create a new bug report at bugzilla.mozilla.org using this link. another way to trigger a crash in a hung tab is to run the following script in the browser console (opened after selecting the hung tab): let wm = cc["@mozilla.org/appshell/window-mediator;1"]. getservice(ci.nsiwindowmediator); let win = wm.getmostrecentwindow("navigator:browser"); let browser = win.gbrowser.selectedbrowser; if (browser.isremotebrowser) { browser.messagemanager.loadframescript('data:,let appinfo = components.classes["@mozilla.org/xre/app-info;1"];if (appinfo && appinfo.g...
Introduction to Layout in Mozilla
ocumentviewerimpl object, which is returned as nsicontentviewer back to the docshell documentviewerimpl creates pres context and pres shell content model construction content arrives from network via nsistreamlistener::ondataavailable parser tokenizes & processes content; invokes methods on nsicontentsink with parser node objects some buffering and fixup occurs here opencontainer, closecontainer, addleaf content sink creates and attaches content nodes using nsicontent interface content sink maintains stack of “live” elements more buffering and fixup occurs here insertchildat, appendchildto, removechildat frame construction content sink uses nsidocument interface to notify of Δs in content model contentappend...
Addon
ype read only string the type of the add-on. userdisabled boolean true if the user wants this add-on to be disabled. version read only string the version of the add-on. optional properties attribute type description abouturl read only string the url of the about dialog to display for this add-on. this is passed to window.opendialog() when presenting the about dialog. if you don't provide an abouturl, a generic about dialog is displayed. the dialog receives the addon object representing your add-on as a parameter. applybackgroundupdates integer indicates whether updates found in the background for this add-on will be applied automatically. see auto update values. the user is provided a ui for this in the...
API-provided widgets
to create a widget, you should pass a specification object with its desired properties. this document details the available properties. properties property description id the id of the widget (required). type a string indicating the type of widget. possible types are button for simple button widgets (the default) view for buttons that open a panel or subview, depending on where they are placed. custom for fine-grained control over the creation of the widget. viewid only useful for views (and required there): the id of the that should be shown when clicking the widget. tooltiptext string to use for the tooltip of the widget label string to use for the label of the widget ...
Widget Wrappers
ise indicated. attribute description id the widget's id type the type of widget (button, view, custom). for xul-provided widgets, this is always 'custom' provider the provider type of the widget, id est one of provider_api or provider_xul node reference to the corresponding dom node anchor the anchor on which to anchor panels opened from this node. this will point to the overflow chevron on overflowable toolbars if and only if your widget node is overflowed, to the anchor for the panel menu if your widget is inside the panel menu, and to the node itself in all other cases overflowed boolean indicating whether the node is currently in the overflow panel of the toolbar isgroup false, will be true for ...
FxAccountsOAuthClient.jsm
ction - if provided, should be either "signup" or "signin". parameters set of parameters to initialize the firefox accounts oauth flow. authorizationendpoint optional optional authorization endpoint for the oauth server. default: /authorization return value a newly created fxaccountsoauthclient object implementing the methods described in this article. methods launchwebflow() opens a new tab at the firefox accounts oauth authorization url. registers a webchannel listener and sets up a callback if needed. parameters none teardown() call this function to manually release all channels and callbacks that are in use by this client. parameters none examples using the fxaccountsoauthclient chrome code let parameters = { oauth_uri: oauth_server_endpoint, client_i...
JavaScript OS
the javascript os module contains tools that allow chrome content (i.e. platform and add-ons) to interact with the host operating system. at the time of this writing, some of the features of this module are available only to chrome workers. os.constants os-related constants, including errors, file opening modes, system configuration, etc. os.file access to the native file system. os.shared utilities for defining functions that interact with the operating system. ...
OS.File.Error
} catch (ex) { if (ex instanceof os.file.error && ex.becausenosuchfile) { // the file does not exist } } global object os.file.error methods overview the following functions are utility functions that may be used to construct instances of os.file.error, setting the platform-specific error number. ...
source-editor.jsm
en the editor loses focus. sourceeditor.events.breakpoint_change "breakpointchange" fired when a new breakpoint is added, or when an existing breakpoint is removed. this happens both when the api is used to make the change or when the ui is used to do it. sourceeditor.events.context_menu "contextmenu" fired when the editor's context menu is invoked, but before it's opened. sourceeditor.events.dirty_changed "dirtychanged" fired when the dirty state of the editor is changed. the dirty state indicates whether or not there are unsaved changes to the text. sourceeditor.events.focus "focus" fired when the editor gains focus. sourceeditor.events.mouse_move "mousemove" fired when the user moves the mouse over a line annotat...
Index
ly, it's a problem with an already released localization. what do you do now? well, you have come to the right place! this page will walk you through creating a patch for an existing localization. the steps below are fairly generic; for the most part they apply to creating l10n patches for firefox, thunderbird, seamonkey, or calendar. 32 svn for localizers intro, localization, svn, opensource welcome to the svn tutorial for localizers! here you'll learn the process of using svn to obtain mozilla website source files from the mozilla servers and pushing your localizations right back to them. first things first, we need to give you a brief introduction to what svn is and where you can find the necessary tools to get started. if you're already familiar with this information, ...
Localizing extension metadata on addons.mozilla.org
ion support to your extension if there is no localization structure yet. you can already request for amo fields localization on the forums, and these fields will be added soon to the web translation system. amazon mechanical turk this is not free, but for a very modest amount of money you can get your amo page quickly translated by native speakers. create an account and then, using the “basic open-ended question” template, follow the instructions to upload the text of your amo page. on the properties page you can specify the location of the worker in order to restrict to people living in the country where the language is spoken. the reward is up to you, but $5-10 per translation seems to work well. localization codes amo offers 33 localizations, including english. here is a list of the...
Localizing with Mozilla Translator
in mt. this will remove obsolete strings and files from the internal database of mt, and will present you with a list of new and updated strings. if you are starting a new localization, all strings will be marked as new or updated.mt puts a fuzzy flag on each flag and saves it in its database. all this means is that the strings have yet to be translated. you can save your work in progress and reopen it to continue working by selecting view fuzzy from the edit menu. after translating those strings (if using the edit phrase dialog, you can get translation suggestions for strings having an original text equal to existing translations), you can run some automated tests to detect typical errors. after that, you export either the whole product or indvididual files. finally, you commit your chang...
Localization prerequisites
other varieties of "make" will not work. autoconf-2.13 - autoconf 2.5x will not work. zip 2.3 (or higher) mercurial 1.2 or higher recommended. needed for development of firefox 3.5/seamonkey 2.0/thunderbird 3.0 and later. a text editor. you can try one of these: notepad++ or notepad2 on windows, vim, gedit or kate on gnu/linux, bbedit on mac os x. to verify that they work, open a shell. linux users should know, on the mac, you find terminal in applications/utilities. on windows, mozillabuild offers a start-shell-l10n.bat in c:\mozilla-build. let’s try our entry points: $ hg --version mercurial distributed scm (version 1.3.1) copyright (c) 2005-2009 matt mackall <mpm@selenic.com> and others this is free software; see the source for copying conditions. there is no wa...
Release phase
translation quality. release revisions are evaluated, not entire l10n repos. sign-offs do not need to be approved before revision merge between release channels, although it is recommended. there is a specific process to follow in bugzilla for requesting these reviews: file a bug requesting the review. attach your files to the bug. once attached, open the attachment details. in the attachment details, select the ? from the dropdown menu next to the review flag or the appropriate approval flags (see image). this will display a text box to assign the review to someone. enter :pike as the requestee. we will perform a technical review of your work and provide you with feedback. we're happy to work with you to make sure that your work is fully...
Translation phase
n. support.mozilla.com (sumo) a portal for anyone who needs technical support for their mozilla applications. help localize the sumo user interface for everyone in your region. mozilla engagement campaigns individual campaigns created by mozilla to attract new contributors. hacks.mozilla.org for everyone interested in the leading-edge stuff that people are doing with mozilla firefox and the open web. in-product pages a set of pages used to interact with and give information to the end-user as part of their first experience with their mozilla applications. if you are creating your own localization, there are a number of mozilla websites that need to be localized before your efforts become an officially released localization. see the list of localized mozilla websites. you should als...
Localization sign-off reviews
iew request symbolically represents that you have worked on your localization, tested it successfully, and found it to represent the best of your work. so before you request your sign-off review, be sure that it is as ready as it can be. there is a specific process to follow in bugzilla for requesting these reviews: file a bug requesting the review. attach your files to the bug. once attached, open the attachment details. in the attachment details, select the ? from the dropdown menu next to the appropriate approval flags (see image). this will display a text box to assign the review to someone. enter :pike as the requestee. once you have made the formal request in bugzilla and you have pushed your work into your l10n repo, refer to the dashboards to follow your review's progress. sign-...
Localization technical reviews
request symbolically represents that you have worked on your localization, tested it successfully, and found it to represent the best of your work. so before you request your technical review, be sure that it is as ready as it can be. there is a specific process to follow in bugzilla for requesting these reviews: file a bug requesting the review. attach your files to the bug. once attached, open the attachment details. in the attachment details, select the ? from the dropdown menu next to the review flag. this will display a text box to assign the review to someone. enter :pike as the requestee. we will perform a technical review of your work and provide you with feedback. we're happy to work with you to make sure that your work is fully functional. tracking your progress you can t...
MathML Torture Test
). addeventlistener("change", updatemathfont, false) } window.addeventlistener("load", load, false); the following test contains sample tex formulas from knuth's tex book and equivalent mathml representations. it compares the rendering by the xetex engine using the default latin modern math font against the mathml rendering by your browser using the default math font, or an alternative opentype math fonts. to get the best rendering, be sure to have appropriate mathematical fonts installed on your system and to use a browser with opentype math support such as gecko 31.0 (firefox 31.0 / thunderbird 31.0 / seamonkey 2.28) or higher. you may also try this test page for mathematical opentype fonts which instead relies on web fonts. finally, you may want to check this table comparing how ...
Mozilla Web Developer FAQ
attribute in the browser status bar, for example. at this point some people feel compelled to post a “but ie…” rant in the newsgroups or in bugzilla. please note that mac ie 5 behaves in the same way as mozilla when it comes to the alt and title attributes. windows ie also shows the title attribute in a tooltip. does mozilla support downloadable fonts? downloadable fonts in truetype and opentype formats (.ttf and .otf) are supported since firefox 3.5. the fonts have to be served from the same origin (protocol, host, port) as the content that uses them unless the fonts are served with the appropriate cross-origin resource sharing http headers. downloadable fonts in the eot format are not supported. if you use downloadable fonts, please make sure the fonts have the right unicode mapp...
Mozilla projects on GitHub
he mozilla brick project. mozilla-b2g the firefox os project. mozilla-appmaker the appmaker project -- a web tool to let non-programmers create apps. mozilla-l10n scripts and tools used by the localization drivers. mozilla-metrics tools used to collect metrics about mozilla code. mozilla-services mozilla cloud services projects. opennews the knight-mozilla open news project, helping the journalism/technology community do great work through shared knowledge and code. pluotsorbet a j2me-compatible virtual machine written in javascript. rust-lang the rust programming language, designed for safe concurrent code. servo the next-generation rendering engine. ...
GPU performance
d. nvidia parallel nsight - haven't tried. amd gpu shaderanalyzer - will compile a shader and show the machine code and give static pipeline estimations. not that useful for firefox because all of our shaders are pretty simple. amd gpu perfstudio - i had trouble getting this to work, and can't remember whether i actually did or not. intel graphics performance analyzers - haven't tried. apitrace - open source, works ok. pvrtrace - doesn't seem to emit traces on android/nexus s. looks like it's designed for x11-based linux-arm devices, omap3 is mentioned a lot in the docs ... guides accurately profiling direct3d api calls (direct3d 9)- suggests avoiding normal profilers like xperf and instead measuring the time to flush the command buffer. os x - best practices for working with texture data - so...
Memory Profiler
his article details how to use an old profiler specifically designed for firefox os devices. getting the profiler add-on the built-in memory profiler's interface is still under construction. it can be obtained by installing the memory profiler add-on. you may need to set the "xpinstall.signatures.required" pref to false in order to install it, since the xpi is not yet signed. using the add-on open the devtools panel or webide. select the memoryprofiler tab. to take a profile you can use the buttons in the profiler panel. start - start profiling stop - stop profiling reset - clear profile data when profiler is stopped profile data is accumulated and resumed after start. use reset to start a new recording. understanding the profiles traditional memory analysis tools look at the ...
TraceMalloc
6 4816 12 57782 6 52966 2.92 uncategorized.pl, which lists all the void* allocations (the ones that couldn't be categorized by type), sorted by size. also, your javascript can call the following dom window methods: tracemallocdisable() - turn off tracing, first flushing any buffered log events for all log files. tracemallocenable() - turn on tracing. tracemallocopenlogfile(filename) - open a new log file and return its log file descriptor (or -1 on error). tracemallocchangelogfd(logfd) - change the current log file to the one identified by logfd, returning the previous fd (so you can maintain a number of open files; keep their fds in a js array!). tracemalloccloselogfd(logfd) - close the log file identified by logfd, flushing its buffer of any events first...
browser.search.context.loadInBackground
browser.search.context.loadinbackground controls whether a search from the context menu with "search <search engine> for <selected text>" opening a new tab will give focus to it and load it in the foreground or keep focus on the current tab and open it in the background. type:boolean default value:false exists by default: yes application support: firefox 13.0 status: active; last updated 2012-02-17 introduction: pushed to nightly on 2012-02-15 bugs: bug 727131 values true new tab with search results will be opened in the background, focus stays on the current tab. false (default) new tab with search results will be opened in the foreground. ...
browser.urlbar.trimURLs
type:boolean default value: true exists by default: yes application support:firefox 7.0 status: active; last updated 2012-04-03 introduction: pushed to nightly on 2011-06-23 bugs: bug 665580 values true (default) if the active url is exactly the domain name, the trailing slash (/) behind the top level domain will be hidden. if the address starts with http:// and neither starts with a ftp. ...
Profile Manager
er where it can manage profile backups. this is the easiest way to backup and restore profiles. to backup a profile: select the profile you want to backup, and choose "backup to->backup folder" from the toolbar's backup menu. the profile will be backed up, and the backup will appear under the backups column in the main display: to restore a profile: select the backup in the main display, open the context menu, and choose "restore". when you restore a profile, the backup is retained, so you can restore from the same backup at a later date. to delete a backup: select the backup in the main display, open the context menu, and choose "delete". profile archives profile manager can also backup to and restore from .zip archives. profile manager does not track these backups in the ui, b...
Crash reporting
this system is combination of projects: google breakpad client and server libraries mozilla-specific crash reporting user interface and bootstrap code socorro collection and reporting server where did my crash get submitted? crash data submitted using the mozilla crash reporter is located on crash-stats. if you want to find a specific crash that you submitted, you first need to find the crash id that the server has assigned your crash. type about:crashes into your location bar to get a page listing both submitted and unsubmitted crash reports. for more information, see how to get a stacktrace for a bug report. ...
Leak And Bloat Tests
from build to build where no source code has changed. provide reasonable coverage for the normal activities that a user performs. method current method: measure leaks and bloats, in a similar way to firefox (using xpcom_mem_leak_log and --trace-malloc). the method of testing memory bloat and leaks will be the same sequence of events, using the same set of test data. startup main mail window open address book and message composition windows close address book and message composition windows quit the application future improvements will be discussed on the discussion page of the mozilla wiki. results printed on tinderbox output, these consist of: mail rlk reference count leaks mail lk total bytes malloc'ed and not free'd mail mh maximum heap size mail a allocations - number ...
Midas editor module security preferences
grant permission to untrusted sites. only change these settings as needed to try the demo above and to test your own add-on or firefox-internal code, and be sure to restore the default settings when you're done! changing the preferences in firefox quit firefox. if you have quick launch running (on windows, this is an icon in the toolbar), quit that too. find your firefox profile directory. open the user.js file from that directory in a text editor. if there's no user.js file, create one. add these lines to user.js: user_pref("capability.policy.policynames", "allowclipboard"); user_pref("capability.policy.allowclipboard.sites", "https://www-archive.mozilla.org"); user_pref("capability.policy.allowclipboard.clipboard.cutcopy", "allaccess"); user_pref("capability.policy.allowclipboard.c...
NSPR build instructions
mozilla.org/projects/nspr # create a build directory mkdir target.debug cd target.debug # run the configure script ../nspr/configure [optional configure options] # build the libraries gmake # build the test programs cd pr/tests gmake on mac os x, use make, which is gnu make. configure options although nspr uses autoconf, its configure script has two default values that are different from most open source projects. if the os vendor provides a compiler (for example, sun and hp), nspr uses that compiler instead of gcc by default. nspr build generates a debug build by default. --disable-debug --enable-optimize specify these two options to generate an optimized (release) build. these two options can actually be used independently, but it's not recommended. --enable-64bit on a dual 32-...
NSPR's Position On Abrupt Thread Termination
ime (exit()), and i assume that the basic semantics defined there are applicable here. in that environment, exit() may be called and any time, and results in the calling thread's immediate termination. in the situation where it was defined (unix), which has only a single thread of execution, that is equivalent to terminating the process. the process abstraction is then responsible for closing all open files and reclaiming all storage that may have been allocated during the process' lifetime. this practice does not extend to threads. threads run within the confines of a process (or similar abstractions in other environments). threads are lightweight because they do not maintain the full protection domain provided by a process. so in a threaded environment, what is the parallel to unix' exit()? ...
IPC Semaphores
this chapter describes the nspr api for using interprocess communication semaphores. ...
I/O Types
ibed with the function itself. for sample code that illustrates basic i/o operations, see introduction to nspr. directory type file descriptor types file info types network address types types used with socket options functions type used with memory-mapped i/o offset interpretation for seek functions directory type prdir file descriptor types nspr represents i/o objects, such as open files and sockets, by file descriptors of type prfiledesc. this section introduces prfiledesc and related types. prfiledesc priomethods prfileprivate prdescidentity note that the nspr documentation follows the unix convention of using the termfiles to refer to many kinds of i/o objects. to refer specifically to the files in a file system (that is, disk files), this documentation uses the ...
PRDir
directory structure used with directory i/o functions. syntax #include <prio.h> typedef struct prdir prdir; description the opaque structure prdir represents an open directory in the file system. the function pr_opendir opens a specified directory and returns a pointer to a prdir structure, which can be passed to pr_readdir repeatedly to obtain successive entries (files or subdirectories in the open directory). to close the directory, pass the prdir pointer to pr_closedir. ...
PRFileInfo
syntax #include <prio.h> struct prfileinfo { prfiletype type; pruint32 size; prtime creationtime; prtime modifytime; }; typedef struct prfileinfo prfileinfo; fields the structure has the following fields: type type of file. see prfiletype. size size, in bytes, of file's contents. creationtime creation time per definition of prtime. see prtime.h. modifytime last modification time per definition of prtime. see prtime.h. ...
PRFileInfo64
syntax #include <prio.h> struct prfileinfo64 { prfiletype type; pruint64 size; prtime creationtime; prtime modifytime; }; typedef struct prfileinfo64 prfileinfo64; fields the structure has the following fields: type type of file. see prfiletype. size 64-bit size, in bytes, of file's contents. creationtime creation time per definition of prtime. see prtime.h. modifytime last modification time per definition of prtime. see prtime.h. ...
PRIOMethods
number of bytes into buffer. write write specified number of bytes from buffer. available determine number of bytes available for reading. available64 same as previous field, except 64-bit. fsync flush all in-memory buffers of file to permanent store. seek position the file pointer to the desired place. seek64 same as previous field, except 64-bit. fileinfo get information about an open file. fileinfo64 same as previous field, except 64-bit. writev write from a vector of buffers. connect connect to the specified network address. accept accept a connection from a network peer. bind associate a network address with the file descriptor. listen prepare to listen for network connections. shutdown shut down a network connection. recv receive up to the specified number ...
PR_CloseDir
returns if successful, pr_success. if unsuccessful, pr_failure. the reason for the failure can be retrieved via pr_geterror. description when a prdir object is no longer needed, it must be closed and freed with a call to pr_closedir call. note that after a pr_closedir call, any prdirentry object returned by a previous pr_readdir call on the same prdir object becomes invalid. see also pr_opendir ...
PR_CloseSemaphore
closes a specified semaphore. syntax #include <pripcsem.h> nspr_api(prstatus) pr_closesemaphore(prsem *sem); parameter the function has the following parameter: sem a pointer to a prsem structure returned from a call to pr_opensemaphore. returns prstatus ...
PR_CloseSharedMemory
closes a shared memory segment identified by name. syntax #include <prshm.h> nspr_api( prstatus ) pr_closesharedmemory( prsharedmemory *shm ); parameter the function has these parameter: shm the handle returned from pr_opensharedmemory. returns prstatus. ...
PR_DeleteSemaphore
returns prstatus ...
PR_DeleteSharedMemory
deletes a shared memory segment identified by name. syntax #include <prshm.h> nspr_api( prstatus ) pr_deletesharedmemory( const char *name ); parameter the function has these parameter: shm the handle returned from pr_opensharedmemory. returns prstatus. ...
PR_DetachSharedMemory
unmaps a shared memory segment identified by name. syntax #include <prshm.h> nspr_api( prstatus ) pr_detachsharedmemory( prsharedmemory *shm, void *addr ); parameters the function has these parameters: shm the handle returned from pr_opensharedmemory. addr the address to which the shared memory segment is mapped. returns prstatus. ...
PR_ExportFileMapAsString
...
PR_GetFileInfo
ccess. if the file information is not successfully obtained, pr_failure. description pr_getfileinfo stores information about the file with the specified pathname in the prfileinfo structure pointed to by info. the file size is returned as an unsigned 32-bit integer. see also for the 64-bit version of this function, see pr_getfileinfo64. to get equivalent information on a file that's already open, use pr_getopenfileinfo. ...
PR_GetFileInfo64
ess. if the file information is not successfully obtained, pr_failure. description pr_getfileinfo64 stores information about the file with the specified pathname in the prfileinfo64 structure pointed to by info. the file size is returned as an unsigned 64-bit integer. see also for the 32-bit version of this function, see pr_getfileinfo. to get equivalent information on a file that's already open, use pr_getopenfileinfo64. ...
PR ImportTCPSocket
code that uses pr_importtcpsocket may break when nspr's implementation changes. in practice, this is unlikely to happen because nspr's implementation has been stable for years and because of nspr's strong commitment to backward compatibility. using pr_importtcpsocket is much more convenient than writing an nspr i/o layer that wraps your native tcp sockets. of course, it is best if you just use pr_opentcpsocket or pr_newtcpsocket. if you are not sure whether pr_importtcpsocket is right for you, please ask in the mozilla.dev.tech.nspr newsgroup. ...
PR_PostSemaphore
increments the value of a specified semaphore. syntax #include <pripcsem.h> nspr_api(prstatus) pr_postsemaphore(prsem *sem); parameter the function has the following parameter: sem a pointer to a prsem structure returned from a call to pr_opensemaphore. returns prstatus ...
PR_WaitSemaphore
returns prstatus description pr_waitsemaphore tests the value of the semaphore. ...
NSPR
for browsing and/or migration to this site getting nspr nspr is available in various source and binary packages, depending on your platform: windows: build the source package, using the nspr build instructions. mac: install the macports nspr package, or the homebrew nspr package. ubuntu: install the libnspr4-dev package via apt-get. debian: install the libnspr4-dev package via apt-get. ...
Building NSS
iables. the scripts will attempt to infer values for host and domsuf, but can fail. replace localhost and localdomain with the hostname and domain suffix for your host. you need to be able to connect to $host.$domsuf. if you don't have a domain suffix you can add an entry to /etc/hosts (on windows, c:\windows\system32\drivers\etc\hosts) as follows: 127.0.0.1 localhost.localdomain validate this opening a command shell and typing: ping localhost.localdomain. remove the use_64=1 override if using a 32-bit build. test results running all tests can take a considerable amount of time. test output is stored in tests_results/security/$host.$number/. the file results.html summarizes the results, output.log captures all the test output. other subdirectories of nss/tests contain scripts that run...
Certificate functions
r cert_keyfromdercrl mxr 3.4 and later cert_makecanickname mxr 3.4 and later cert_mergeextensions mxr 3.10 and later cert_nametoascii mxr 3.2 and later cert_newcertlist mxr 3.2 and later cert_newtempcertificate mxr 3.12 and later cert_nicknamestringsfromcertlist mxr 3.4 and later cert_opencertdbfilename mxr 3.2 and later cert_ocspcachesettings mxr 3.11.7 and later cert_pkixverifycert mxr 3.12 and later cert_removecertlistnode mxr 3.6 and later cert_rfc1485_escapeandquote mxr 3.2 and later cert_savesmimeprofile mxr 3.2 and later cert_setsloptime mxr 3.2 and later cert_setocspfail...
FIPS Mode - an explanation
ure firefox into fips mode may be found on support.mozilla.com. is nss fips-140 compliant? mozilla's nss cryptographic software has been tested by government-approved independent testing labs and certified by nist as being fips 140 compliant when operated in fips mode on 4 previous occasions. as of this writing, nss is now being retested to be recertified for the fifth time. nss was the first open source cryptographic library to be fips certified. what is fips mode all about? a fips-140 compliant application must do all of its cryptography in a fips-140 certified "device". whether it is hardware or software, that device will have all the cryptographic engines in it, and also will stores keys and perhaps certificates inside. the device must have a way for users to authenticate to it ...
Getting Started With NSS
ty/nss/cmd or have a look at some basic nss sample code. a new set of samples is currently under development and review, see create new nss samples. you are welcome to download the samples via: hg clone https://hg.mozilla.org/projects/nss; cd nss; hg update samples_branch how to contribute ... (this section is still under construction, but there are many contribution opportunities) start by opening a bugzilla account at bugzilla.mozilla.org if you don't have one. nss :: libraries component for issues you'd like to work on. we maintain a list of nss bugs marked with a keyword "good-first-bug" that you can view. creating your patch seee our section on nss sources, building, and testing to get started making your patch. when you're satisfied with it, you'll need code review. code revie...
NSS_3.12_release_notes.html
y ocsp timeout bug 361025: support for camellia cipher suites to tls rfc4132 bug 376417: pk11_generatekeypair needs to get the key usage from the caller. bug 391291: shared database integrity checks not yet implemented. bug 391292: shared database implementation slow bug 391294: shared database implementation really slow on network file systems bug 392521: automatic shared db update fails if user opens database r/w but never supplies a password bug 392522: integrity hashes must be updated when passwords are changed. bug 401610: shared db fails on iopr tests bug 388120: build error due to sec_begin_protos / sec_end_protos are undefined bug 415264: make security use of new nspr rotate macros bug 317052: lib/base/whatnspr.c is obsolete bug 317323: set nspr31_lib_prefix to empty explicitly for win...
NSS 3.15.1 release notes
- enforce name constraints on the common name in libpkix when no subjectaltname is present. bug 875156 - add const to the function arguments of sec_certnicknameconflict. bug 877798 - fix ssltap to print the certificate_status handshake message correctly. bug 882829 - on windows, nss initialization fails if nss cannot call the rtlgenrandom function. bug 875601 - secmod_closeuserdb/secmod_openuserdb fails to reset the token delay, leading to spurious failures. bug 884072 - fix a typo in the header include guard macro of secmod.h. bug 876352 - certutil now warns if importing a pem file that contains a private key. bug 565296 - fix the bug that shlibsign exited with status 0 even though it failed. the nss_survive_double_bypass_failure build option is removed. bugs fixed in nss 3...
NSS 3.25 release notes
:36:d2:4c:1c:b9:95:3a:06:65:39:b1:15:82:dc:48:7b:48:33 cn = certplus root ca g1 sha-256 fingerprint: 15:2a:40:2b:fc:df:2c:d5:48:05:4d:22:75:b3:9c:7f:ca:3e:c0:97:80:78:b0:f0:ea:76:e5:61:a6:c7:43:3e cn = certplus root ca g2 sha-256 fingerprint: 6c:c0:50:41:e6:44:5e:74:69:6c:4c:fb:c9:f8:0f:54:3b:7e:ab:bb:44:b4:ce:6f:78:7c:6a:99:71:c4:2f:17 cn = opentrust root ca g1 sha-256 fingerprint: 56:c7:71:28:d9:8c:18:d9:1b:4c:fd:ff:bc:25:ee:91:03:d4:75:8e:a2:ab:ad:82:6a:90:f3:45:7d:46:0e:b4 cn = opentrust root ca g2 sha-256 fingerprint: 27:99:58:29:fe:6a:75:15:c1:bf:e8:48:f9:c4:76:1d:b1:6c:22:59:29:25:7b:f4:0d:08:94:f2:9e:a8:ba:f2 cn = opentrust root ca g3 sha-256 fingerprint: b7:c3:62:31:70:6e:81:0...
NSS 3.37 release notes
tion was updated to draft 28. an issue where nss erroneously accepted hrr requests was resolved. this issue was found by oss fuzz. added hacl* poly1305 32-bit the code to support the npn protocol, which had already been disabled in a previous release, has been fully removed. nss allows servers now to register alpn handling callbacks to select a protocol. nss supports opening sql databases in read-only mode. nss now requires the sqlite apis of version 3.5.0 or newer. starting with nss version 3.31, an alternative implementation for rng seeding on the linux/unix platform was available (bug 1346735), which performed seeding exclusively based on /dev/urandom. this alternative implementation is selected at build time by defining the seed_only_dev_urandom symbol. ...
NSS 3.39 release notes
92d57b5177abd7ac1037958356d1e094518be5f2 the following ca certificates had the websites trust bit disabled: cn = certplus root ca g1 sha-256 fingerprint: 152a402bfcdf2cd548054d2275b39c7fca3ec0978078b0f0ea76e561a6c7433e cn = certplus root ca g2 sha-256 fingerprint: 6cc05041e6445e74696c4cfbc9f80f543b7eabbb44b4ce6f787c6a9971c42f17 cn = opentrust root ca g1 sha-256 fingerprint: 56c77128d98c18d91b4cfdffbc25ee9103d4758ea2abad826a90f3457d460eb4 cn = opentrust root ca g2 sha-256 fingerprint: 27995829fe6a7515c1bfe848f9c4761db16c225929257bf40d0894f29ea8baf2 cn = opentrust root ca g3 sha-256 fingerprint: b7c36231706e81078c367cb896198f1e3208dd926949dd8f5709a410f75b6292 bug...
NSS 3.44 release notes
- lib/freebl/crypto_primitives.c assumes a big endian machine 1532384 - in nss test certificates, use @example.com (not @bogus.com) 1538479 - post-handshake messages after async server authentication break when using record layer separation 1521578 - x25519 support in pk11pars.c 1540205 - freebl build fails with -dnss_disable_chachapoly 1532312 - post-handshake auth doesn't interoperate with openssl 1542741 - certutil -f crashes with segmentation fault 1546925 - allow preceding text in try comment 1534468 - expose chacha20 primitive 1418944 - quote cc/cxx variables passed to nspr 1543545 - allow to build nss as a static library 1487597 - early data that arrives before the handshake completes can be read afterwards 1548398 - freebl_gtest not building on linux/mac 1548722 - fix some...
NSS 3.45 release notes
ked. ...
NSS 3.47 release notes
bug 1542207 - limit policy check on signature algorithms to known algorithms bug 1560329 - drbg: add continuous self-test on entropy source bug 1579290 - asan builds should disable lsan while building bug 1385061 - build nspr tests with nss make; add gyp parameters to ...
NSS 3.51 release notes
ison of integers of different signs: 'int' and 'unsigned long' in security/nss/lib/freebl/ecl/ecp_25519.c:88 bug 1609751 - add test for mp_int clamping bug 1582169 - don't attempt to read the fips_enabled flag on the machine unless nss was built with fips enabled bug 1431940 - fix a null pointer dereference in blake2b_update bug 1617387 - fix compiler warning in secsign.c bug 1618400 - fix a openbsd/arm64 compilation error: unused variable 'getauxval' bug 1610687 - fix a crash on unaligned cmaccontext.aes.keyschedule when using aes-ni intrinsics this bugzilla query returns all the bugs fixed in nss 3.51: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.51 compatibility nss 3.51 shared librarie...
NSS Sample Code sample6
cure means * such as prompting an operator, or retrieving it over a secure communication * channel */ char *passwdcb(pk11slotinfo *info, prbool retry, void *arg); int main(int argc, char **argv) { secstatus rv; /* initialize nss */ pk11_setpasswordfunc(passwdcb); /* the nss db must be initialized read-write since we'll be creating * keys in it. once keys are generated, it can be opened without read-write * subsequently (nss_init). */ rv = nss_initreadwrite("."); if (rv != secsuccess) { fprintf(stderr, "nss initialization failed (err %d)\n", pr_geterror()); exit(1); } /* generate a key with id 1. should succeed on first run on a fresh db, * should fail on successive runs because key with that id already exists */ genkey(1); /* gener...
nss tech note3
is a ca cert, or not, and affects every other aspect of how the cert is interpreted by nss. the oid for this extension is { 2 5 29 19 }, encoded in hex as 0x55, 0x1d, 0x13. if the extension is present and has the value true, then this cert is taken to be a ca cert. otherwise it is not (except that trust flags may override this, see discussion of trust flags farther below). netscape has its own openly defined cert type extension, which can be used to explicitly set the cert type in any cert. the cert type extension has bits in it that correspond directly to the cert types named above. the oid for this extension is { 2 16 840 1 113730 1 1 } encoded in hex as 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x01 in addition to netscape's own cert type extension, nss recognizes various x.509 ...
NSS Third-Party Code
at can be compiled into the nss libraries necessarily is. ...
Notes on TLS - SSL 3.0 Intolerant Servers
ported for the following servers: (wherever there is an upgraded version which fixes the problem, it is indicated by an asterisked remark in the parentheses. ) domino-go-webserver/4.6.2.6 (and perhaps some later versions) ibm_http_server/1.3.6.3 or earlier (* update to 1.3.6.4) ibm_http_server/1.3.12.1 or earlier (* update to 1.3.12.2) java web server 2 osu/3.2 - decthreads http server for openvm stronghold/2.2 webmail v. 3.6.1 by infinite technologies (* update available) n.b. there might be servers other than those listed above which exhibit this problem. if you find such a server, feel free to add it to this page. for up-to-date information, you can read this bug 59321 which keeps a list of tls/ssl 3.0 intolerant servers. users: how to avoid this problem? netscape 6.1 preview r...
PKCS11 module installation
s can programmatically manage pkcs #11 modules using the nsipkcs11 programming interface. note: the information in this article is specific to firefox 3.5 and newer. older versions of firefox may support the window.pkcs11 property for installing pkcs #11 modules. using the firefox preferences to install pkcs #11 modules save the pkcs #11 module to a permanent location on your local computer open the firefox preferences dialog. choose "advanced" > "encryption" > "security devices" choose "load" enter a name for the security module, such as "my client database". note: there is currently a bug in firefox where international characters may cause problems. choose "browse..." to find the location of the pkcs #11 module on your local computer, and choose "ok" when done. provisioning pkcs #...
FC_GetOperationState
poperationstate [out] pointer to a byte array of a length sufficient for containing the operation state or null. puloperationstatelen [out] pointer to ck_ulong which receives the total length (in bytes) of the operation state. ...
FC_GetTokenInfo
en initialized ckf_dual_crypto_operations (0x00000200): a single session with the token can perform dual cryptographic operations ckf_token_initialized (0x00000400): the token has been initialized. if login is required (which is true for the fips mode of operation), this flag means the user's password has been initialized. ulsessioncount: number of sessions that this application currently has open with the token ulrwsessioncount: number of read/write sessions that this application currently has open with the token hardwareversion: hardware version number, for example, 8.3 (major=0x08, minor=0x03), which are the version numbers of the certificate and key databases, respectively. firmwareversion: firmware version number, 0.0 (major=0x00, minor=0x00). a user may call fc_gettokeninfo witho...
FC_InitToken
y database and start over. note: the so password should be the empty string, i.e., ulpinlen argument should be 0. fc_inittoken() ignores the plabel argument. return value fc_inittoken() returns the following return codes. ckr_ok: token initialization succeeded. ckr_slot_id_invalid: slot id is invalid. ckr_token_write_protected we don't have a reference to the key database (we failed to open the key database or we have released our reference). ckr_device_error: failed to reset the key database. application usage fc_inittoken() is used to reset the password for the key database when the user forgets the password. the "reset password" button of the mozilla application suite and seamonkey (in preferences->privacy & security->master passwords) calls fc_inittoken(). the "-t" (toke...
FC_Initialize
eters should point to a string that contains the library parameters. preserved should be null. the library parameters string has this format: "configdir='dir' certprefix='prefix1' keyprefix='prefix2' secmod='file' flags= " here are some examples. ...
FC_SetOperationState
poperationstate [in] pointer to a byte array containing the operation state. ...
NSC_InitToken
n() ignores the plabel argument. return value nsc_inittoken() returns the following return codes. ckr_ok: token initialization succeeded. ckr_slot_id_invalid: slot id is invalid. ckr_token_write_protected slot id is 1. (the non-fips mode has two slots: 1 and 2. the key database is in slot 2. slot 1 doesn't have a key database.) we don't have a reference to the key database (we failed to open the key database or we have released our reference). ckr_device_error: failed to reset the key database. examples application usage nsc_inittoken() is used to reset the password for the key database when the user forgets the password. the "reset password" button of the mozilla application suite and seamonkey (in preferences->privacy & security->master passwords) calls nsc_inittoken(). t...
NSS_Initialize
module database, usually "secmod.db". flags [in] bit flags that specify how nss should be initialized. description nss_initialize initializes nss. it is more flexible than nss_init, nss_initreadwrite, and nss_nodb_init. if any of those simpler nss initialization functions suffices for your needs, call that instead. the flags parameter is a bitwise or of the following flags: nss_init_readonly - open the databases read only. nss_init_nocertdb - don't open the cert db and key db's, just initialize the volatile certdb. nss_init_nomoddb - don't open the security module db, just initialize the pkcs #11 module. nss_init_forceopen - continue to force initializations even if the databases cannot be opened. nss_init_norootinit - don't try to look for the root certs module automatically. nss_init_opt...
NSS Key Functions
this chapter describes two functions used to manipulate private keys and key databases such as the key3.db database provided with nss. this was converted from "chapter 6: key functions". back to the nss reference main page. seckey_getdefaultkeydb seckey_destroyprivatekey seckey_getdefaultkeydb returns a handle to the default key database opened by nss_init. syntax include <key.h> include <keyt.h> seckeykeydbhandle *seckey_getdefaultkeydb(void); returns the function returns a handle of type seckeykeydbhandle. description nss_init opens the certificate, key, and security module databases that you specify for use with nss. seckeykeydbhandle returns a handle to the key database opened by nss_init. seckey_destroyprivatekey destroys a private key structure. syntax include <...
FIPS mode of operation
fc_createobject fc_copyobject fc_destroyobject fc_getobjectsize fc_getattributevalue fc_setattributevalue fc_findobjectsinit fc_findobjects fc_findobjectsfinal encryption functions these functions support triple des and aes in ecb and cbc modes. fc_encryptinit ...
NSS environment variables
oolean (any non-empty value to enable) enables the use of md2 and md4 inside signatures. this was allowed by default before nss 3.12.3. 3.12.3 nss_debug_pkcs11_module string (module name) name the pkcs#11 module to be traced. pkcs #11 module logger 3.6 nss_default_db_type string ("dbm", "sql", or "extern") determines the default database type to open if the app does not specify. nss_shared_db 3.12 nss_disable_arena_free_list string (any non-empty value) define this variable to get accurate leak allocation stacks when using leak reporting software. nss_memory_allocation 3.4 nss_disable_unload string (any non-empty value) disable unloading of dynamically loaded nss shared libraries during shutdown. ne...
NSS functions
r cert_keyfromdercrl mxr 3.4 and later cert_makecanickname mxr 3.4 and later cert_mergeextensions mxr 3.10 and later cert_nametoascii mxr 3.2 and later cert_newcertlist mxr 3.2 and later cert_newtempcertificate mxr 3.12 and later cert_nicknamestringsfromcertlist mxr 3.4 and later cert_opencertdbfilename mxr 3.2 and later cert_ocspcachesettings mxr 3.11.7 and later cert_pkixverifycert mxr 3.12 and later cert_removecertlistnode mxr 3.6 and later cert_rfc1485_escapeandquote mxr 3.2 and later cert_savesmimeprofile mxr 3.2 and later cert_setsloptime mxr 3.2 and later cert_setocspfail...
NSS tools : certutil
ting the certificate or adding it to a database. express the offset in integers, using a minus sign (-) to indicate a negative offset. if this argument is not used, the validity period begins at the current system time. the length of the validity period is set with the -v argument. -x force the key and certificate database to open in read-write mode. this is used with the -u and -l command options. -x use certutil to generate the signature for a certificate being created or added to a database, rather than obtaining a signature from a separate ca. -y exp set an alternate exponent value to use in generating a new rsa public key for the ...
NSS tools : modutil
s several mechanisms: rsa, dsa, rc2, rc4, rc5, aes, des, dh, sha1, sha256, sha512, ssl, tls, md5, md2, random (for random number generation), and friendly (meaning certificates are publicly readable). -newpwfile new-password-file specify a text file containing a token's new or replacement password so that a password can be entered automatically with the -changepw option. -nocertdb do not open the certificate or key databases. this has several effects: o with the -create command, only a module security file is created; certificate and key databases are not created. o with the -jar command, signatures on the jar file are not checked. o with the -changepw command, the password on the nss internal module cannot be set or changed, since this password is stored in the key database. ...
troubleshoot.html
op-5.0 or greater. the 64-bit builds don't support gcc. if the build fails early on the gmakein coreconf try updating your cvs tree with -p: cd mozilla cvs update -p building a 32-bit version on a 64-bit may fail with: /usr/include/features.h:324:26: fatal error: bits/predefs.h: no such file or directory in this case remember to set use_64=1 testing nss the ssl stress test opens 2,048 tcp connections in quick succession. kernel data structures may remain allocated for these connections for up to two minutes. some systems may not be configured to allow this many simultaneous connections by default; if the stress tests fail, try increasing the number of simultaneous sockets supported. building jss windows only: the shell invoked by gmake, shmsdos.exe, is likely to c...
NSS reference
d for pseudorandom number generation -- pk11_generaterandomonslot and pk11_generaterandom -- and the two routines used for seeding pseudorandom number generation -- pk11_seedrandom and pk11_randomupdate. pkcs #11 functions based on pkcs #11 functions in the ssl reference and "crypto functions" in nss public functions. secmod_loadusermodule secmod_unloadusermodule secmod_closeuserdb secmod_openuserdb pk11_findcertfromnickname pk11_findkeybyanycert pk11_getslotname pk11_gettokenname pk11_ishw pk11_ispresent pk11_isreadonly pk11_setpasswordfunc ssl functions based on "ssl functions" in the ssl reference and "ssl functions" and "deprecated ssl functions" in nss public functions. ssl_configserversessionidcache ssl_clearsessioncache s/mime based on the s/mime reference (whi...
sslcrt.html
names structure to be freed. cert_getdefaultcertdb returns a handle to the default certificate database. syntax #include <cert.h> certcertdbhandle *cert_getdefaultcertdb(void); returns the function returns the certcertdbhandle for the default certificate database. description this function is useful for determining whether the default certificate database has been opened. nss_findcertkeatype returns key exchange type of the keys in an ssl server certificate. syntax #include <nss.h> sslkeatype nss_findcertkeatype(certcertificate * cert); parameter this function has the following parameter: a the certificate to check. returns the function returns one of these values: kt_null = 0...
sslkey.html
upgraded documentation may be found in the current nss reference key functions chapter 6 key functions this chapter describes two functions used to manipulate private keys and key databases such as the key3.db database provided with communicator. seckey_getdefaultkeydb seckey_destroyprivatekey seckey_getdefaultkeydb returns a handle to the default key database opened by nss_init. syntax #include <key.h> #include <keyt.h> seckeykeydbhandle *seckey_getdefaultkeydb(void); returns the function returns a handle of type seckeykeydbhandle. description nss_init opens the certificate, key, and security module databases that you specify for use with nss. seckeykeydbhandle returns a handle to the key database opened by nss_init. seckey_destroyprivatekey ...
ssltyp.html
me="> many of the structures presented here (certcertdbhandle, certcertificate, pk11slotinfo, and seckeyprivatekey) are opaque--that is, they are types defined as structures (for example, certcertdbhandlestr) that may change in future releases of network security services. as long as you use the form shown here, your code will not need revision. certcertdbhandle an opaque handle structure for open certificate databases. syntax #include <certt.h> typedef struct certcertdbhandlestr certcertdbhandle; certcertificate an opaque x.509 certificate object. syntax #include <certt.h> typedef struct certcertificatestr certcertificate; description certificate structures are shared objects. when an application makes a copy of a particular certificate structure that already exists in memo...
NSS Tools
ions, please feel free to post to mozilla.dev.tech.crypto. this newsgroup is the preferred forum for all questions about nss and nss tools. overall objectives provide a tool for analyzing and repairing certificate databases (dbck). migrate tools from secutil.h interface to pkcs #11 interface. eliminate redundant functionality in tools. many tools implement private versions of pkcs11init(), opencertdb(), etc. eliminate use of getopt() and replace with nspr calls to get command options (to eliminate platform dependencies with getopt()). tools information tool description links certutil 2.0 manage certificate and key databases (cert7.db and key3.db). source, documentation, tasks/plans cmsutil 1.0 performs basic cms operations such as encryptin...
NSS Tools modutil
y when the -changepw tokenname option is used to change passwords. -newpwfile new-password-file specify a text file containing a token's new or replacement password so that a password can be entered automatically with the -changepw tokenname option. -slot slotname specify a particular slot to be enabled or disabled with the -enable modulename or -disable modulename options. -nocertdb do not open the certificate or key databases. this has several effects: with the -create command, only a secmod.db file will be created; cert8.db and key3.db will not be created. with the -jar command, signatures on the jar file will not be checked. with the -changepw command, the password on the netscape internal module cannot be set or changed, since this password is stored in key3.db. usage ...
NSS Tools ssltap
ing tool (ssltap) newsgroup: mozilla.dev.tech.crypto the ssl debugging tool is an ssl-aware command-line proxy. it watches tcp connections and displays the data going by. if a connection is ssl, the data display includes interpreted ssl records and handshaking. availability this tool is known to build on solaris 2.5.1 (sunos 5.5.1) and windows nt 4.0. description the ssltap command opens a socket on a rendezvous port and waits for an incoming connection from the client side. once this connection arrives, the tool makes another connection to the specified host name and port on the server side. it passes any data sent by the client to the server and vice versa. the tool also displays the data to the shell window from which it was called. it can do this for plain http connections o...
certutil
ating the certificate or adding it to a database. express the offset in integers, using a minus sign (-) to indicate a negative offset. if this argument is not used, the validity period begins at the current system time. the length of the validity period is set with the -v argument. -x force the key and certificate database to open in read-write mode. this is used with the -u and -l command options. -x use certutil to generate the signature for a certificate being created or added to a database, rather than obtaining a signature from a separate ca. -y exp set an alternate exponent value to use in generating a new rsa public key for the database, ins...
NSS tools : modutil
Mozilla › Projects › NSS › tools › modutil
sha256, sha512, ssl, tls, md5, md2, random (for random number generation), and friendly (meaning certificates are publicly readable). -newpwfile new-password-file specify a text file containing a token's new or replacement password so that a password can be entered automatically with the -changepw option. -nocertdb do not open the certificate or key databases. this has several effects: o with the -create command, only a module security file is created; certificate and key databases are not created. o with the -jar command, signatures on the jar file are not checked. o with the -changepw command, the password on the nss internal ...
Rhino Debugger
ow the debugger redirects the system.out, system.in, and system.err streams to an internal javascript console window which provides an editable command line for you to enter javascript code and view system output. the console window maintains a history of the commands you have entered. you may move backward and forward through the history list by pressing the up/down arrow keys on the keyboard. opening scripts you may select the file->open menu item on the menu bar to load javascript scripts contained in files. this action will display a file-selection dialog box prompting you for the location of a script to load. the selected file will be compiled and displayed in a new window. running scripts you may select the file->run menu item on the menu bar to execute javascript scripts containe...
Download Rhino
es rhino1.7.8.zip rhino 1.7.9 2018-03-15 release notes rhino1.7.9.zip rhino 1.7.10 2018-04-09 release notes rhino1.7.10.zip rhino 1.7.11 2019-05-30 release notes rhino1.7.11.zip rhino 1.7.12 2020-01-13 release notes rhino1.7.12.zip to download older rhino versions, see the rhino downloads archive. license rhino is open source. as of release 1.7r4 rhino is available under mpl 2.0. previous versions were released under mpl 1.1/gpl 2.0 license. see rhino license for further information. source in addition to getting the source from the zip files above, the source code for rhino can be found in github at https://github.com/mozilla/rhino. to get the source, use the command git clone https://github.com/mozilla/...
Rhino license
mpl/gpl license the majority of the source code for rhino is available under a mpl 1.1/gpl 2.0 license. license for portions of the rhino debugger additionally, some files (currently the contents of toolsrc/org/mozilla/javascript/tools/debugger/treetable/) are available under the following license: * copyright 1997, 1998 sun microsystems, inc. all rights reserved. * * redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * - redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. ...
Rhino shell
ript compiled by rhino javascript compiler. print([expr ...]) evaluate and print expressions. evaluates each expression, converts the result to a string, and prints it. 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. runcommand(commandname, [arg, ...] [options]) execute the specified command with the given argument and options as a separate process and return the exit status of the process. usage: runcommand(...
Rhino
it is typically embedded into java applications to provide scripting to end users. it is embedded in j2se 6 as the default java scripting engine. rhino downloads how to get source and binaries. rhino documentation information on rhino for script writers and embedders. rhino help some resources if you get stuck. ...
Rebranding SpiderMonkey (1.8.5)
ged back so we will re-issue the recursive find and replace text in files command with some modifications. find ./ -type f -exec sed -i "s/$brand.pc/mozjs185.pc/" {} \; the last recursive search and replace, changes the file name of the static library: find ./ -type f -exec sed -i "s/js_static/$brand_static/" {} \; allright, almost there. now comes the manual editing. using your favorite editor open up the file named makefile for editing. search for this text: mozjs185.pc "scroll down" a few lines until you see this line: > $@ && chmod 644 $@ that line should be modified to read back: > $brand.pc && chmod 644 $brand.pc "scroll down" a few lines until you see these lines: install:: $(pkg_config_files) @echo pkg_config_file: $(pkg_config_files) those two lines should be modifie...
FOSS
getting started here. ...
Hacking Tips
js::jit::mirgraph&) (graph=...) at …/js/src/jit/ionanalysis.cpp:2436 #3 0x000000000083317f in js::jit::optimizemir(js::jit::mirgenerator*) (mir=0x33dbdf0) at …/js/src/jit/ion.cpp:1570 … (gdb) frame 3 #3 0x000000000083317f in js::jit::optimizemir(js::jit::mirgenerator*) (mir=0x33dbdf0) at …/js/src/jit/ion.cpp:1570 (gdb) iongraph mir function 0 (asm.js compilation): success; 1 passes. /* open your png viewer with the result of iongraph */ this gdb instrumentation is supposed to work with debug builds, or with optimized build compiled with --enable-jitspew configure flag. external programs such as iongraph, dot, and your png viewer are search into the path, otherwise custom one can either be configured with environment variables (gdb_iongraph, gdb_dot, gdb_pngviewer) before starting g...
Bytecode Descriptions
nstructions in the script. code must not jump into or out of this region: control can enter only by executing pushlexicalenv and can exit only by executing a poplexicalenv or by exception unwinding. (a jsop::poplexicalenv is always emitted at the end of the block, and extra copies are emitted on "exit slides", where a break, continue, or return statement exits the scope.) the script's jsscript::scopenotes() must identify exactly which instructions begin executing in this scope. typically this means a single entry marking the contiguous chunk of bytecode from the instruction after jsop::pushlexicalenv to jsop::poplexicalenv (inclusive); but if that range contains any instructions on exit slides, after a jsop::poplexicalenv, then those must be correctly noted as outside the scope. format: jof_sc...
SpiderMonkey Internals
h permission to use notice included. jsdtoa.cpp #includes this file. jshash.cpp, jshash.h, jsdhash.cpp, jsdhash.h portable, extensible hash tables. these use multiplicative hash for strength reduction over division hash, yet with very good key distribution over power of two table sizes. jshash resolves collisions via chaining, so each entry burns a malloc and can fragment the heap. jsdhash uses open addressing. jslong.cpp, jslong.h 64-bit integer emulation, and compatible macros that use intrinsic c types, like long long, on platforms where they exist (most everywhere, these days). jsprf.* portable, buffer-overrun-resistant sprintf and friends. for no good reason save lack of time, the %e, %f, and %g formats cause your system's native sprintf, rather than js_dtoa(), to be used. this bug ...
SpiderMonkey 52
spidermonkey 52 is the javascript engine that shipped in firefox 52. it continues to improve performance over previous spidermonkey releases. ...
SpiderMonkey releases
rt to keep the tip of the gecko tree minimally working as an embeddable source package. we are very limited in our ability to support older versions, including those labeled as "releases" on this page. the easiest way to fetch the version corresponding to the current firefox release is to visit the treeherder page for the release repository and click on the first sm(pkg) link you see. that will open a small window in the bottom left with a line like "artifact uploaded: mozjs-57.0.1.tar.bz2". past releases spidermonkey 52 spidermonkey 45 spidermonkey 38 spidermonkey 31 spidermonkey 24 spidermonkey 17 spidermonkey 1.8.8 spidermonkey 1.8.7 spidermonkey 1.8.5 spidermonkey 1.8 ...
Setting up CDT to work on SpiderMonkey
f spidermonkey. still, there are a quite a few things that cdt does not pick up yet: for everything to be indexed, cdt has to be aware of the project's build details. step 3 - index all the code to let cdt know about the build, it has to invoke make itself (or, as is done in the guide for the whole mozilla codebase on mdn, read a log of the build), which can be setup with these simple steps: open the project's properties by selecting its root and clicking "properties" in the "file" menu and select "c/c++ build". under the "builder settings" group tab, deactivate "use default build command". instead, change "build command" to read make -w (this is required because cdt needs detailed information about which directories make operates on, which using -w causes make to provide). change the ...
TPS Tab Lists
tabs.verify - verifies that the specified tabs can be found in the specified profile. tabs.verifynot - verifies that the specified tabs cannot be found in the specified profile. there are a handful of static pages at http://hg.mozilla.org/services/tps/file/tip/pages which can be used for tab testing, and data: url's can be used as well. example see...
TPS Tests
allow tps to automatically do account confirmation steps for you. even if you opt not to use restmail, do not use your personal firefox account, as tps will delete and replace the data in it many times, not to mention the first run is very likely to fail, since it expects a clean start). note: be prepared not to use your computer for 15 or so minutes after starting a full run of tps, as it will open and close a fairly large number of firefox windows. steps get the source code clone mozilla-central (choose your flavor): hg clone hg.mozilla.org/mozilla-central or git clone github.com/mozilla/gecko-dev cd into the tps folder cd testing/tps create the environment i suggest the path to be outside of the mc source tree python create_ve...
Zest
ific language) developed by the mozilla security team and is intended to be used in web oriented security tools. the language is written in json, but we do not expect people to write zest in this format - it is designed to be a visual language. the core language does not define any graphical representation - that is expected to be defined by the tools that integrate zest. it is completely free, open source and can be included in any tool whether open or closed, free or commercial. zest is still at a very early stage of development, but is has been made available so that anyone can play around with it. all constructive feedback is very welcome. anyone can contribute to the onward development of zest, and teams or individuals who develop security tools are especially welcome to join and h...
Redis Tips
it is intended primarily for developers, and deliberately omits some topics that will be important in any redis deployment, like security and backups. some uses for redis data types you may have heard of redis referred to as a nosql database. technically, this is true: it's a database that doesn't use sql. but the statement is meaningless. it is also true that ice cream is a food that isn't made from whale meat. ...
The Rust programming language
it prevents segmentation faults and guarantees thread safety, all with an easy-to-learn syntax. in addition, rust offers zero-cost abstractions, move semantics, guaranteed memory safety, threads with no data races, trait-based generics, pattern matching, type inference, and efficient c bindings, with a minimum runtime size. to learn more about rust, you can: watch the videos below for a closer look at the power and benefits rust provides. read the book the rust programming language online. ...
Setting up an update server
ing updated will need to be built to allow un-signed mars. see building firefox for more information on building firefox locally. these changes will need to be made in order to use the locally built mar: put this line in the mozconfig file in root of the build directory (create it if it does not exist): ac_add_options --disable-verify-mar several files contain a line that must be uncommented. open them and find this line: #defines['disable_updater_authenticode_check'] = true. delete the # at the beginning of the line to uncomment it. these are the files that must be changed: toolkit/components/maintenanceservice/moz.build toolkit/mozapps/update/tests/moz.build firefox should otherwise be built normally. after building, you may want to copy the installation of firefox elsewh...
Animated PNG graphics
Mozilla › Tech › APNG
ave no other chunks in between them from 0.8 removed crcs for ihdr and plte from actl the actl fctl and adat are now not copy safe, renamed them to actl, fctl and adat from 0.9 split render_op into dispose_op and blend_op from 0.10 no changes test encoder and sample images sample images are available from the apng implementation page at http://littlesvr.ca/apng/ an encoder (open source) is available in versions of the gecko engine starting with version 1.9 alpha 4. an application (open source) using the mozilla encoder to assemble apngs available here: http://littlesvr.ca/apng/apngedit.html see also portable network graphics (png) specification (second edition) extensions to the png specification, version 1.2.0 graphics interchange format 89a ...
AT APIs Support
dgets. examples of xul applications: firefox - web-browser thunderbird - email client seamonkey - web-browser, advanced e-mail and newsgroup client, irc chat client, and html editing made simple sunbird - cross-platform calendar application kompozer - a complete web authoring system for linux desktop, microsoft windows and macintosh users to rival programs like frontpage and dreamweaver. open komodo - platform for building developer environments miro - a free, open source internet tv and video player any xulrunner application (songbird media player, etc.) extensions to other xul apps (e.g. firefox extensions) gecko version for firefox and all other gecko-based products: this documentation applies to up-to-date product builds based on gecko 1.9.2 -- currently not available on off...
Mork
Mozilla › Tech › Mork
starting with mozilla 1.9, it was phased out in favor of sqlite, a more widely-supported file format. the information on this page was constructed by reading the source code of the mork database in mozilla and attempting to codify what it parses as faithfully as possible. in a few cases, constructs that the parser supported but were never used in mozilla's code are left unspecified. ...
History Service Design
h storage apis. many queries can be executed and combined at the same time. an history container node is built (the so-called rootnode), this node will fill itself. finally the root node is assigned to a history result object, that can be furtherly modified setting for example a sorting mode. only the first level of a node is usually filled, internal nodes or queries will populate themselves when opened. an implementer working on a ui can then associate a viewer with the result, so that it will be notified when the result tree changes. queries can act on a variety of datas, coming from all dependant services, so it is possible to query history, bookmarks or both, also with values coming from other services like tags, annotations. result nodes can be simple uri nodes with page attributes or c...
Using the Places history service
ialized. break; case historyservice.database_status_corrupt: // database was corrupt, has been moved to a .corrupt file and a new one has been created and initialized. break; case historyservice.database_status_upgraded: // database had an old schema version and has been upgraded to a new one. break; } in case the database is locked by a third party process and cannot be opened, a "places-database-locked" notification is fired, in such a case the service won't be able to initialize. adding pages to history nsiglobalhistory2.adduri: this is the basic function for adding pages to history that is called by the docshell as you browse. the redirect flag is deprecated. see adddocumentredirect below. nsiglobalhistory3.adddocumentredirect: this is called by the docshell wh...
Avoiding leaks in JavaScript XPCOM components
ry in this case (and there's also no need to create a new function object for the filter each time this code is executed). this same problem can also happen if the function is inside of an object. consider the example of bug 170022 (which also demonstrates a leak via a global variable, fixed later in bug 231266): const observer = { observe: function(subject, topic, data) { if (topic != "open-new-tab-request" || subject != window) return; delayedopentab(data); } }; const service = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); service.addobserver(observer, "open-new-tab-request", false); in this example, there is a similar cycle between observe and service. (but since service is a global variable, just fixi...
Creating the Component Code
j rv = m->queryinterface(kimoduleiid, (void**)return_cobj); if (ns_failed(rv)) { delete m; } return rv; } note: non-null-out the createinstance method guarantees that if the out variable is non-null, it is valid. « previousnext » copyright (c) 2003 by doug turner and ian oeschger. this material may be distributed only subject to the terms and conditions set forth in the open publication license, v1.02 or later. distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder. ...
Finishing the Component
referred to as a "browser helper object" like weblock. the next chapter looks at how to tie this into the front end - specifically, how to use xpconnect to access and control this component from javascript in the user interface. « previousnext » copyright (c) 2003 by doug turner and ian oeschger. this material may be distributed only subject to the terms and conditions set forth in the open publication license, v1.02 or later. distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder. ...
Packaging WebLock
plied in the script below in the same way that the window object is implied in javascript manipulation of the dom of a web page. in other words, the fragment initinstall() from the script is equivalent to install.initinstall(). « previousnext » copyright (c) 2003 by doug turner and ian oeschger. this material may be distributed only subject to the terms and conditions set forth in the open publication license, v1.02 or later. distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder. ...
Resources
nline xpcom reference information on xpconnect and scriptable components the smart pointer guide xpidl xpidl compiler reference general development resources the world wide web consortium url specification at the w3 gnu make « previous copyright (c) 2003 by doug turner and ian oeschger. this material may be distributed only subject to the terms and conditions set forth in the open publication license, v1.02 or later. distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder. ...
Setting up the Gecko SDK
des) $< $(module).so: $(xpidlsrcs:%.idl=%.h) $(xpidlsrcs:%.idl=%.xpt) $(cppsrcs:%.cpp=%.o) $(cxx) -o $@ -wl,-soname=$(module).so $(cppsrcs:%.cpp=%.o) $(gecko_ldflags) chmod +x $@ build: $(module).so clean: rm $(module).so « previousnext » copyright (c) 2003 by doug turner and ian oeschger. this material may be distributed only subject to the terms and conditions set forth in the open publication license, v1.02 or later. distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder. ...
Using XPCOM Utilities to Make Things Easier
name of the interface being compiled. note: nulls-in-strings the string classes may also support embedded nulls. note: other-string-classes there are other abstract string classes, but they are outside the scope of this book. « previousnext » copyright (c) 2003 by doug turner and ian oeschger. this material may be distributed only subject to the terms and conditions set forth in the open publication license, v1.02 or later. distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder. ...
Creating XPCOM components
t creating a new project adding the gecko sdk to the project settings building a windows project a makefile for unix appendix b - resources weblock resources gecko resources xpcom resources general development resources next » copyright (c) 2003 by doug turner and ian oeschger. this material may be distributed only subject to the terms and conditions set forth in the open publication license, v1.02 or later. distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder. ...
How To Pass an XPCOM Object to a New Window
components/help/content/contexthelp.js#61 if you want to be able to call functions within an xpcom object from a xul window's code, you can do so if you pass the xpcom object as one of the arguments to the window creation method. for example: var ww = components.classes["@mozilla.org/embedcomp/window-watcher;1"]. getservice(components.interfaces.nsiwindowwatcher); var win = ww.openwindow(null, "chrome://myextension/content/debug.xul", "debug history", "chrome,centerscreen,resizable", myobject); note in this example that myobject is passed to the openwindow() method; you can pass any xpcom object (or any other value, for that matter) in this way. to access the xpcom object from the window's code, you can access the window.arguments[] array, as shown in the exa...
nsIRegistry
nsiregistry on mxr other documentation: libreg source, reg.h in particular okay! appreg. it works like this. var cc = components.classes; var ci = components.interfaces; var rc = cc["@mozilla.org/registry;1"]; var rs = rc.getservice(ci.nsiregistry); now you have the registry service. rs.openwellknownregistry(2); // 2 signifies the applicationregistry, if i understand right var st = rs.enumerateallsubtrees(2); // 2 signifies "common", see libreg source (reg.h) for info now you have an nsienumerator that can report the subtrees. try { st.first(); do { var data = st.currentitem(); if( data instanceof ci.nsiregistrynode ) print("nsiregistrynode: " + data.nameutf8 + " (" + data.key + ")"); st.next(); } while( components.lastresult == 0 ); } catch(e) {} now, the output...
imgILoader
ver; this prevents reference cycles. this means that callers of loadimagewithchannel should make sure to cancel() the resulting request before the observer goes away. imgirequest loadimagewithchannel( in nsichannel achannel, in imgidecoderobserver aobserver, in nsisupports cx, out nsistreamlistener alistener ); parameters achannel the channel to load the image from. this must already be opened before this method is called, and there must have been no ondataavailable calls for it yet. aobserver the observer (may be null) cx some random data. alistener a listener that you must send the channel's notifications and data to. can be null, in which case imagelib has found a cached image and is not interested in the data. achannel will be canceled for you in this case. return value support...
mozIRegistry
erface that provides the same level of function as is currently provided by the "netscape registry" implemented in libreg. nsrepository will be modified to use this interface, thereby enabling alternative registry implementations to be substituted at run/link time. there will be two registry interface implementations: one based solely on libreg (for "compatibility") and a fancier rdf-based one. open issues we have identified two open issues, neither of which appear to be so hard that it we won't be able to solve them in a timely fashion: if and when we remove what is currently a static binding of clsids, there will be the risk that required clsids won't be present. a corollary is that the build/install process will require updates to user "registry" to enable new class implementations to ...
mozIStorageAggregateFunction
the rest of your code. likewise, if you execute sql on a different thread, this callback will be executed on that thread. this callback should be reentrant if any of the above applies to your use of the storage apis! nsivariant onfinal() return value an nsivariant this is the return value of the function. sample code both of the following code samples assume that the variable dbconn is an opened mozistorageconnection. javascript // first, create our object that will represent our function. var standarddeviationfunc = { _numbers: [], onstep: function(aarguments) { this._numbers.push(aarguments.getint32(0)); }, onfinal: function() { let total = 0; let ilength = this._numbers.length; this._numbers.foreach(function(elt) { total += elt }); let mean = total / th...
mozIStorageFunction
the above applies to your use of the storage apis! nsivariant onfunctioncall( in mozistoragevaluearray afunctionarguments ); parameters afunctionarguments a mozistoragevaluearray holding the arguments passed in to the function. return value an nsivariant this is the return value of the function. sample code both of the following code samples assume that the variable dbconn is an opened mozistorageconnection. javascript starting in gecko 1.9.1.4 (firefox 3.0.15), you can directly pass your function into the mozistorageconnection method mozistorageconnection, like this: dbconn.createfunction("square", 1, function(aarguments) { let value = aarguments.getint32(0); return value * value; }); // run some query that uses the function. let stmt = dbconn.createstatement("se...
DefaultKeyBinding
« nsiaccessible page summary provides localized string of global keyboard accelerator for default action, such as ctrl+o for open file (ctrl + o). attribute astring defaultkeybinding; see also nsiaccessible.getkeybindings() nsiaccessible.keyboardshortcut ...
nsIAccessible
description -- long text associated with this node. keyboardshortcut provides localized string of accesskey name, such as alt+d. the modifier may be affected by user and platform preferences. usually alt+letter, or just the letter alone for menu items. defaultkeybinding provides localized string of global keyboard accelerator for default action, such as ctrl+o for open file. role enumerated accessible role for the associated element. help help text associated with node. focusedchild focused accessible child of node. attributes attributes of accessible. relationscount returns the number of accessible relations for this object. numactions the number of accessible actio...
nsIAccessibleEvent
event_acceleratorchange 0x8012 event_menustart 0x0004 event_menuend 0x0005 event_menupopupstart 0x0006 event_menupopupend 0x0007 event_capturestart 0x0008 event_captureend 0x0009 event_movesizestart 0x000a event_movesizeend 0x000b event_contexthelpstart 0x000c event_contexthelpend 0x000d event_dragdropstart 0x000e event_dragdropend 0x000f event_dialogstart 0x0010 event_dialogend 0x0011 event_scrollingstart 0x0012 event_scrollingend 0x0013 event_minimizestart 0x0016 event_minimizeend 0x0017 event_atk_property_change 0x0100 event_atk_selection_change 0x0101 event_atk_text_change 0x0102 event_atk_text_selection_change 0x0103 event_atk_text_caret_move 0x0104 ...
nsIApplicationCacheChannel
overview void markofflinecacheentryasforeign(); attributes attribute type description chooseapplicationcache boolean when true, the channel will choose an application cache if one was not explicitly provided and none is available from the notification callbacks. the default value is false. this attribute will not be transferred through a redirect. exceptions thrown ns_error_already_opened if set after calling asyncopen() on the channel. inheritapplicationcache boolean true if the channel will ask its notification callbacks for an application cache if one is not explicitly provided. the default value is true. exceptions thrown ns_error_already_opened if set after calling asyncopen() on the channel. loadedfromapplicationcache prbool true if the resource was loaded from t...
nsIAutoCompleteInput
matically completes to the default result whenever the user hits the enter key or the text field loses focus. maxrows unsigned long the maximum number of rows to display in the autocomplete suggestion popup. minresultsforpopup unsigned long specifies a minimum number of search results that must be available before the autocomplete popup will open. popup nsiautocompletepopup the view in which results will be displayed.read only. popupopen boolean indicates whether or not the popup view is already open. searchcount unsigned long the number of autocomplete sessions to search. read only. searchparam astring an additional parameter u...
nsIBadCertListener2
rameters socketinfo a network communication context that can be used to obtain more information about the active connection. this object usually supports nsisslsocketcontrol, nsitransportsecurityinfo, nsiidentityinfo, nsisslstatusprovider, nsiclientauthuserdecision and possibly other interfaces. status the ssl status object that describes the problem(s). targetsite the site name that was used to open the current connection. return value the consumer shall return true if it wants to suppress the error message related to the bad cert (the connection will still get canceled). see also nsisockettransport ...
nsICacheEntryInfo
string get the client id associated with this cache entry. read only. datasize unsigned long get the cache entry data size. read only. deviceid string get the id for the device that stores this cache entry. read only. expirationtime pruint32 get the expiration time of the cache entry (in seconds since the epoch). read only. fetchcount long get the number of times the cache entry has been opened. read only. key acstring get the key identifying the cache entry. read only. lastfetched pruint32 get the last time the cache entry was opened (in seconds since the epoch). read only. lastmodified pruint32 get the last time the cache entry was modified (in seconds since the epoch). read only. methods isstreambased() this method finds out whether or not the cache entry is stream based. ...
nsICacheService
ache sessions are equivalent. nsicachesession createsession( in string clientid, in nscachestoragepolicy storagepolicy, in boolean streambased ); parameters clientid specifies the name of the client using the cache. storagepolicy limits the storage policy for all entries accessed via the returned session. as a result, devices excluded by the storage policy will not be searched when opening entries from the returned session. streambased indicates whether or not the data being cached can be represented as a stream. the storagepolicy must be consistent with the value of this field. for example, a non-stream-based cache entry can only have a storage policy of store_in_memory. return value returns a new cache session. createtemporaryclientid() obsolete since gecko 1.9.2 (...
nsICommandLine
; nsifile resolvefile(in astring aargument); nsiuri resolveuri(in astring aargument); attributes attribute type description length long number of arguments in the command line. the application name is not part of the command line. read only. preventdefault boolean there may be a command-line handler which performs a default action if there was no explicit action on the command line (open a default browser window, for example). this flag allows the default action to be prevented. state unsigned long the type of command line being processed. see state constants. read only. windowcontext nsidomwindow a window to be targeted by this command line. in most cases, this will be null (xremote will sometimes set this attribute). read only. workingdirectory nsifile the working direc...
nsICommandLineHandler
played to the user (on stdout). the text should have embedded newlines which wrap at 76 columns, and should include a newline at the end. by convention, the right column which contains flag descriptions begins at the 24th character. read only. methods handle() processes a command line. if this handler finds arguments that it understands, it should perform the appropriate actions (such as opening a window), and remove the arguments from the command-line array. void handle( in nsicommandline acommandline ); parameters acommandline command line to process. see also nsicommandline chrome: command line xulrunner:commandline ...
nsICookiePromptService
the nsicookiepromptservice interface is to open a dialog to ask to permission to accept the cookie. extensions/cookie/nsicookiepromptservice.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview long cookiedialog(in nsidomwindow parent, in nsicookie cookie, in acstring hostname, in long cookiesfromhost, in boolean changingcookie, out boolean rememberdecision); constants constant value description deny_cookie 0 holds the value for a denying the cookie. accept_cookie 1 holds the value for accepting the cookie. accept_session_cookie 2 holds the value for accepting the session cookie. methods cookiedialog() opens a dialog that asks for permission to accept a cookie. long cookiedialog(...
nsIDBChangeListener
r change. astatus the storage location provided by calling routine for status. ainstigator the caller who added the header. this can be used to filter out events that you yourself started. ainstigator may also be null. onevent() generic notification for extensibility. common events should be documented here so we have a hope of keeping the documentation up to date. current events are: dbopened when a pending listener becomes real. this can happen when the existing db is force closed and a new one opened. only registered pending listeners are notified. void onevent(in nsimsgdatabase adb, in string aevent); parameters adb the nsimsgdatabase that is changing. astring the type of event. ...
nsIDOMWindowUtils
elements and anonymous boxes. throws ns_error_not_available if the count can't be provided. focusedinputtype string the type of the currently-focused html <input> element, if one is focused. imageanimationmode unsigned short returns the image animation mode of the window. the attribute's value must be one of the animationmode values from imgicontainer. imeisopen boolean returns the ime open state. true if it's open, otherwise false. this attribute only works when imestatus is ime_status_enabled. read only. imestatus unsigned long returns the current ime status. values correspond to the ime_status_* constants defined below. read only. ismozafterpaintpending boolean returns true if a mozafterpaint event has been queued...
nsIDocShell
w document. createloadinfo() creates a docshellloadinfo object that you can manipulate and then pass to loaduri(). void createloadinfo( out nsidocshellloadinfo loadinfo ); parameters loadinfo the new nsidocshellloadinfo object. violates the xpcom interface guidelines detacheditorfromwindow() disconnects this docshell's editor from its window, and stores the editor data in the open document's session history entry. this should be called only during page transitions. void detacheditorfromwindow(); parameters none. finishrestore() finish firing webprogresslistener notifications and dom events for restoring a page presentation. this should only be called via beginrestore(). void finishrestore(); parameters none. native code only!firepagehidenotification notify the associate...
nsIFileView
mn type is size unless an appropriate id is passed, nsifileview relies on the treecols section --> <treecol id="filenamecolumn" label="name" flex="1" primary="true"/> <treecol id="lastmodifiedcolumn" label="date" flex="1"/> <treecol id="size" label="size" flex="1"/> </treecols> <treechildren/> </tree> <script> var dir="/home/"; //the directory to be opened var ftree = document.getelementbyid("ftree"); //the xul tree element var lfile = components.classes["@mozilla.org/file/local;1"] .createinstance(components.interfaces.nsilocalfile); lfile.initwithpath(dir); // open the directory var fview = components.classes["@mozilla.org/filepicker/fileview;1"] .createinstance(components.interfaces.nsifileview); //create an instanc...
nsIHttpChannelInternal
in acstring aprotocolname, in nsihttpupgradelistener alistener); void setcookie(in string acookieheader); void setupfallbackchannel(in string afallbackkey); attributes attribute type description canceled boolean returns true if and only if the channel has been canceled. read only. channelisfordownload boolean external handlers may set this to true to notify the channel that it is open on behalf of a download. documenturi nsiuri an http channel can own a reference to the document uri. forceallowthirdpartycookie boolean force relevant cookies to be sent with this load even if normally they would not be. localaddress autf8string the local ip address to which the channel is bound, in the same format produced by pr_netaddrtostring(). this may be either an ipv4 or ipv6 addr...
nsILoginManagerPrompter
d(in nsilogininfo alogin); methods init() initialize the prompter. must be called before using other interfaces. void init( in nsidomwindow awindow ); parameters awindow the in which the user is doing some login-related action that is resulting in a need to prompt them for something. the prompt will be associated with this window (or, if a notification bar is being used, topmost opener in some cases). prompttochangepassword() ask the user if they want to change a login's password. if the user consents, modifylogin() will be called. void prompttochangepassword( in nsilogininfo aoldlogin, in nsilogininfo anewlogin ); parameters aoldlogin the existing login (with the old password). anewlogin the new login. prompttochangepasswordwithusernames() ask the user if ...
nsIMemoryReporter
uires gecko 7.0(firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) the amount reported by a memory reporter may use one of the following units. constant value description units_bytes 0 the amount is specified as a number of bytes. units_count 1 the amount is an instantaneous count of things currently in existence. for example, the number of tabs currently open. units_count_cumulative 2 the amount contains the number of times some event has occurred since the application started up. for example, the number of times the user has opened a new tab. the amount returned must never decrease over the lifetime of the application. units_percentage 3 the amount contains a fraction that should be expressed as a percentage. ...
nsIMsgAccount
nternal key identifying itself methods addidentity() adds a new identity to this account. void addidentity( in nsimsgidentity identity ); parameters identity the identity to add. clearallvalues() clear all user preferences associated with an account. void clearallvalues(); parameters none. init() initializes an account. void init(); parameters none. exceptions thrown ns_error_already_opened if it is called more then once removeidentity() removes an identity from this account. void removeidentity( in nsimsgidentity identity ); parameters identity the identity to remove. ...
nsIMsgWindow
gpane. statusfeedback nsimsgstatusfeedback this allows the backend code to send status feedback to the ui. msgheadersink nsimsgheadersink this allows the backend code to send message header information to the ui. transactionmanager nsitransactionmanager this is used to track undo/redo transactions. openfolder nsimsgfolder this is used to track the folder currently open in the ui. rootdocshell nsidocshell this is used to track the chrome window's nsidocshell object. you don't normally need to set this, instead set the domwindow property instead. messagewindowdocshell nsidocshell readonly: this retrieves the nsidocshell object for...
nsIMsgWindowCommands
cking a link to a newsgroup. void selectfolder( in acstring folderuri ); parameters folderuri the uri of the folder to select. selectmessage() this method is called by the backend to change the displayed message. for instance, when deleting attachments, this causes the message to be redisplayed. void selectmessage( in acstring messageuri ); parameters messageuri the uri of the message to open. clearmsgpane() this method is called by the backend when it wants to clear the message pane, for instance if you select the group header . void clearmsgpane(); paramters none. ...
nsINavHistoryQueryOptions
nsinavhistoryqueryoptions clone(); attributes attribute type description applyoptionstocontainers boolean if true, the query options are only applied to the containers. asyncenabled boolean when true, the root container node generated by these options and all of its descendant containers are opened asynchronously if they support doing so. by default, this is false. note: currently, only bookmark folder containers support being opened asynchronously. excludeitemifparenthasannotation obsolete since gecko 13.0 autf8string this option excludes items from a bookmarks query if the parent of the item has this annotation. an example is to excl...
nsINavHistoryResult
aobserver, in boolean aownsweak); void removeobserver(in nsinavhistoryresultobserver aobserver); attributes attribute type description root nsinavhistorycontainerresultnode the root of the results. this container gives you access to all the results in the tree. note: keep in mind that you need to open containers for their results to be valid. when a result goes out of scope it will continue to observe changes till it is cycle collected. while the result waits to be collected it will stay in memory, and continue to update itself, potentially causing unwanted additional work. when you close the root node the result will stop observing changes, so it is good practice to close the root nod...
nsINavHistoryService
rieves the original title of the page. astring getpagetitle( in nsiuri auri ); parameters auri the page whose title needs to be retrieved. return value returns the original title of the page. markpageasfollowedbookmark() this method is just like markpageastyped (in nsibrowserhistory, also implemented by the history service), but for bookmarks. it declares that the given uri is being opened as a result of following a bookmark. if this uri is loaded soon after this message has been received, that transition will be marked as following a bookmark. void markpageasfollowedbookmark( in nsiuri auri ); parameters auri the page that is to be marked as followed by a bookmark. markpageastyped() this method designates the url as having been explicitly typed in by the user, so it ...
nsIPushSubscription
key: string.fromcharcode.apply(null, btoa(subscription.getkey("p256dh"))), secret: string.fromcharc...
nsISHistory
a handle to the session history object can be obtained from nsiwebnavigation. ...
nsISSLErrorListener
se of an ssl error. boolean notifysslerror( in nsiinterfacerequestor socketinfo, in print32 error, in autf8string targetsite ); parameters socketinfo a network communication context that can be used to obtain more information about the active connection. error the code associated with the error. the ssl status object that describes the problem(s). targetsite the site name that was used to open the current connection. return value the consumer shall return true if it wants to suppress the error message related to the error (the connection will still get canceled). see also nsisockettransport ...
nsISearchEngine
. searchform astring a url string pointing to the engine's search form. read only. type long the search engine type. read only. constants search engine type constants constant value description type_mozsearch 1 type_sherlock 2 type_opensearch 3 search engine data type constants constant value description data_xml 1 data type is xml data_text 2 data type is text. methods addparam() adds a parameter to the search engine's submission data. this should only be called on engines created via nsibrowsersearchservice.addeng...
nsIServerSocketListener
the address of the client can be found by calling the nsisockettransport.getaddress() method or by inspecting nsisockettransport.gethost(), which returns a string representation of the client's ip address, which may be either an ipv4 or an ipv6 address. ...
nsISocketTransportService
the list of controlled sockets. this will fail with the error code ns_error_not_available if the maximum number of sockets is already reached. in this case, the notifywhencanattachsocket() method should be used. note: this function may only be called from an event dispatch on the socket thread. void attachsocket( in prfiledescptr afd, in nsasockethandlerptr ahandler ); parameters afd open file descriptor of the socket to control. ahandler socket handler that will receive notifications when the socket is ready or detached. createtransport() creates a transport for a specified host and port. note: this function can be called from any thread. nsisockettransport createtransport( in array<acstring> asockettypes, in autf8string ahost, in long aport, in nsiproxyinfo aproxy...
nsIUploadChannel
inherits from: nsisupports last changed in gecko 1.7 method overview void setuploadstream(in nsiinputstream astream, in acstring acontenttype, in long acontentlength); attributes attribute type description uploadstream nsiinputstream get the stream (to be) uploaded by this channel. read only. ...
nsIWebBrowserChrome
chrome_window_popup 32768 represent special cases. chrome_window_raised 33554432 represent special cases. chrome_window_lowered 67108864 represent special cases. chrome_center_screen 134217728 represent special cases. chrome_dependent 268435456 make the new window dependent on the parent. this flag is only meaningful if chrome_openas_chrome is set; content windows should not be dependent. chrome_modal 536870912 the modal style bit just affects the way the window looks and does not mean it's actually modal. chrome_openas_dialog 1073741824 represent special cases. chrome_openas_chrome 2147483648 represent special cases. chrome_all 4094 represent special cases. ...
nsIWebBrowserPersist
sic set, accented letters, greek letters and certain special markup symbols. methods cancelsave() cancels the current operation. the caller is responsible for cleaning up partially written files or directories. this has the same effect as calling cancel with an argument of ns_binding_aborted. void cancelsave(); parameters none. savechannel() save a channel to a file. it must not be opened yet. void savechannel( in nsichannel achannel, in nsisupports afile ); parameters achannel the nsichannel to save to a file. afile target local file. this may be a nsilocalfile object or an nsiuri object with a file scheme. savedocument() save the specified dom document to file and optionally all linked files (for example images, css, js & subframes). do not call this method unt...
nsIWebContentHandlerRegistrar
f the document to be handled. otherwise ns_error_dom_syntax_err will be thrown. this string must also be of either the http or https schemes. title the title of the handler presented to the user as a string. contentwindow the dom content window from which the method has been called. note: script must execute from same domain as uri or else it will throw permission error. can bypass this by opening about:config and setting preference of gecko.handlerservice.allowregisterfromdifferenthost to true. examples register a webmail service as mailto handler the following code aims to add "outlook.com live mail" to list of webservice handlers. in the image below "gmail" and "yahoo! mail" already exist as webservice handlers. cu.import('resource://gre/modules/services.jsm'); var nsiwchr = ...
nsIWebSocketListener
netwerk/protocol/websocket/nsiwebsocketlistener.idlscriptable implement this interface to receive websocket traffic events asynchronously after calling nsiwebsocketchannel.asyncopen(). 1.0 66 introduced gecko 8.0 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) method overview void onacknowledge(in nsisupports acontext, in pruint32 asize); void onbinarymessageavailable(in nsisupports acontext, in acstring amsg); void onmessageavailable(in nsisupports acontext, in autf8string amsg); void onserverclose(in nsisupports acontext, in unsigned short acode, in autf8string areason); void onstart(in nsisupports acontext); void onstop(in nsisupports acontext, in nsresul...
nsIXULRuntime
ozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsixulruntime); method overview void invalidatecachesonrestart(); attributes attribute type description accessibilityenabled boolean if true, the accessibility service is running. read only. browsertabsremoteautostart boolean if true, browser tabs may be opened by default in a different process from the main browser ui. read only. insafemode boolean whether the application was launched in safe mode. read only. is64bit boolean indicates whether the current firefox build is 64-bit. read only. logconsoleerrors boolean whether to write console errors to a log file. if a component encounters startup err...
nsIXULTemplateBuilder
by a xul element that needs its child content built. [noscript] void createcontents( in nsicontent aelement, in boolean aforcecreation ); parameters aelement the element whose contents need to be built. aforcecreation if true, the contents of the element are generated even if the element is closed; this behavior is used with menus. if false, the element's contents are only generated if it's open. addlistener() adds a listener to this template builder. the template builder holds a strong reference to the listener. void addlistener( in nsixulbuilderlistener alistener ); parameters alistener an nsixulbuilderlistener object representing the listener to add to the template builder. removelistener() removes a listener from this template builder. void removelistener( in nsixulbuilderlis...
nsIZipReaderCache
der for a zip inside another zip. nsizipreader getinnerzip( in nsifile zipfile, in autf8string zipentry ); parameters zipfile the zip file. zipentry the zip entry. return value the nsizipreader for the given zip file. getzip() returns a (possibly shared) cached nsizipreader for a zip file. if the zip reader for the given file is not in the cache, a new nsizipreader is opened (see nsizipreader.open()). otherwise the previously created nsizipreader is returned. note: if nsizipreader.close has been called on the shared nsizipreader, this method will return the closed nsizipreader nsizipreader getzip( in nsifile zipfile ); parameters zipfile the zip file. return value the nsizipreader for the given zip file. init() initializes a new zip reader cache. void ...
NS_ASSERTION
the behavior of an assertion failure can be controlled using the xpcom_debug_break environment variable. an assertion failure should be thrown on critical program errors only. a triggered assertion failure is equivalent to crashing in tinderbox tests. note on terminology: "assertion" is the condition to test. ...
Setting HTTP request headers
http is one of the core technologies behind the web. in addition to the actual content, some important information is passed with http headers for both http requests and responses. you can add your own http headers to any request the application makes, whether the request is initiated by your code explicitly opening an http channel, because of xmlhttprequest activity, an <img> element in content, or even from css. http channels when you deal with http requests and responses, typically you are doing this with an nsihttpchannel. the nsihttpchannel interface has a number of properties and methods, but the method that is of interest to us is setrequestheader. this method allows us to set an http request header. below is some sample code where we set an http header. // adds "x-hello: world"...
Performance
ou can see an example of setting the maximum cache size to be a percentage of memory in nsnavhistory::initdb in toolkit/components/places/src/nsnavhistory.cpp. sharding the cache between connections by default, storage enables the sqlite shared-cache mode which makes multiple connections to the same database share the same cache. the cache is threadsafe. all you need to do is use services.storage.opendatabase(file). some features (virtual tables, full text indexes) are not compatible with shared cache - then you need to use services.storage.openunshareddatabase(file), which doesn't share the cache. see mozistorageservice.opendatabase(). disk writes sqlite provides the basic acid rules of database theory: atomicity: each transaction is atomic and cannot be "partially" committed. consistenc...
XPCOM ABI
compiler gcc2 - gnu c++ compiler 2.x gcc3 - gnu c++ compiler 3.x or 4.x sunc - sun c++ compiler ibmc - ibm c++ compiler for example: firefox built with the gnu c++ compiler 4.0.0 for the intel pentium processor would have xpcom abi of x86-gcc3 the xpcom abi string can be retrieved programmatically by using the nsixulruntime interface. ...
XPIDL
built-in or interface types, and within classes that are marked with builtinclass. the latter restriction is because c++ implementations of fallible getters can be audited for infallibility, but js implementations cannot. the must_use property is useful if the result of a method call or an attribute get/set should always (or usually) be checked, which is frequently the case. (e.g. a method that opens a file should almost certainly have its result checked.) this property will cause moz_must_use to be added to the generated function declarations, which means certain compilers (e.g. clang and gcc) will reports errors if these results are not used. source and binary compatibility some consumers of idl interfaces create binary plugins that expect the interfaces to be stored in a specific way in...
Mozilla technologies
starting with mozilla 1.9, it was phased out in favor of sqlite, a more widely-supported file format.placesplaces is the bookmarks and history management system introduced in firefox 3. it offers increased flexibility and complex querying to make handling the places the user goes easier and more convenient. it also includes new features including favicon storage and the ability to annotat...
Cached compose window FAQ
d to create a new compose window on every new mail message or reply. but we noticed that the common usage pattern is to compose, send, compose, send, compose send. we decided it would be worth the trouble to cache the compose window. if the user has this usage pattern, we wouldn't have to create a new window. we could just hide it on send, and then show it on the next compose. if the user opens (but never sends or closes compose windows), this trick will not apply to them. but this is not a common usage model. how do i test it? on window and mac, the cached compose window is on by default. to test it start mozilla do new message. this is a new compose window. notice how long it took. close or send the window. (the compose window is now cached) do new message again. this...
Events
ers are internal to gecko or other parts of mozilla application code. this reference will help you track those events down and learn how to use them. composition event name event type fired when... compose-send-message a message gets sent compose-window-close a compose window gets closed compose-window-init a compose window has been opened compose-window-reopen a cached compose window has been reopened. no load event is fired in this case. folders event name event type fired when... msgcreatedbview onactivecreatedview onactivemessagesloaded the active messages in the folder have been loaded oncreatedview a folder view has been...
Mail event system
n the nsifolder interface, and nsimsgmailsession interface. onitem*<event> - in the nsifolderlistener interface. the mail session implements this interface. where <event> is the type of event, such as boolpropertychanged or the generic event . sample control flow here is an example of a possible flow of control when a new message is added to a folder. in this example, there is a dialog open that shows properties for this folder including the message count. this dialog is a listener on this particular folder. a message is added to an nsimapmailfolder containing 4 messages. because the number of messages in the folder have increased, this change in total message count needs to be broadcast to the world. the folder calls notifyintpropertychanged on itself with the atom that represe...
Building a Thunderbird extension 1: introduction
it shares many of the technologies used by mozilla firefox, including javascript, the gecko layout engine, the xul xml user interface language and the xpcom cross-platform component object model. similar to firefox, thunderbird functionality can be enhanced and customized via extensions. warning: this content is for older versions of thunderbird. much of it may no longer be relevant. see developer.thunderbird.net for newer information. this tutorial will introduce you to the components of a thunderbird extension and will show you how to build your own. ...
Building a Thunderbird extension 3: install manifest
warning: this content is for older versions of thunderbird. much of it may no longer be relevant. see developer.thunderbird.net for newer information. the install.rdf file is an xml file that provides general information about the extension. ...
Access Thunderbird Window Areas
to access particular parts of the thunderbird window you can use these helper methods. an alternative to these methods is to directly access the element by it's id as in the detect when a folder opens example. var foldertree = getfoldertree(); var searchinput = getsearchinput(); var messagepane = getmessagepane(); var messagepaneframe = getmessagepaneframe(); var mailtoolbox = getmailtoolbox(); var currentmsgfolder = getloadedmsgfolder(); see the msgmail3panewindow.js for other helper methods ...
Access Window
you can do many things with the window object, such as accessing the height or width of the window/tab or setting its title, registering timer events and much more. the window api will give you the complete details. since window is a global variable you can use it directly from your javascript file. ...
Add New Tab
var aurl = "chrome://myext/mytab.xul"; let tabmail = getmail3pane().document.getelementbyid("tabmail"); tabmail.opentab("chrometab", { chromepage: aurl }); ...
Tips and Tricks from the newsgroups
scripts from an extension (for example, to create a symlink) get extension metadata call java from thunderbird extensions (also an example here, written for firefox but compatible with thunderbird 3.x) define a custom protocol handler to call an external program save attachment and send it repeat image display using css sprites messages use reminderfox to open a message in the default thunderbird message window (when messageuri, folderuri and gdbview are unknown) determine whether a message has been flagged as junk imap: getting message key of copied message by nsimsgcopyservice::copyfilemessage access the plain text content of the email body get information about attachment without selecting message repeat image display using css sprites ...
Using the Multiple Accounts API
hould not be imap-specific) - should we empty this server's trash when we quit? preference: mail.server.server.offline_download - boolean, is this server marked for offline download? preference: mail.server.server.override_namespaces - boolean, should we override namespaces on this server? ...
Thunderbird
thunderbird is a mail/messaging application managed and developed by the thunderbird community. these pages document thunderbird and the mailnews backend which is also used in other projects such as seamonkey and postbox. thunderbird is built on the same technical platform as the firefox web browser. currently one of the most popular open source email clients, it is used by tens of millions of people around the world to bring together all their email accounts, chat, newsgroup and feed reading in a familiar high-productivity environment. (from early 2007 to early 2011 thunderbird was developed by mozilla messaging, a subsidiary owned by mozilla.) documentation building thunderbird information about building thunderbird with the comm-central repository. th...
Using tab-modal prompts
/* exception: prompt aborted by user undefined:425 */ ...
Using the Mozilla source server
er. using the source server in windbg in the windbg command line, type .srcfix and hit enter. this enables source server support. now, when you click on a frame in the "calls" window, windbg will prompt you about running cvs to download the associated source code. if you click "yes", windbg will display *busy* in the status bar while it downloads the source, and then it will automatically open the file and highlight the current line. using the source server in visual studio note: source server support does not work correctly out of the box in visual studio 2005. if you install windbg, and copy srcsrv.dll from the windbg install dir to the visual studio install dir (replacing the existing copy) it will work. enable source server support under tools -> options. also, disable (unchec...
js-ctypes reference
t is obtained by by loading the ctypes module: components.utils.import("resource://gre/modules/ctypes.jsm"); you can use the ctypes object to load libraries, construct types, and perform miscellaneous tasks such as type casting. the ctypes object also provides numerous predefined types that correspond to primitives and common typedefs in c. working with libraries to load a library, use ctypes.open(). the library object is used mostly to declare native functions provided by the library so that js-ctypes knows how to call them. see library.declare() for instructions on how to declare these functions. once you have finished working with a library, call library.close(). calling conventions see abi. types and data to use js-ctypes effectively, it is important to understand the different k...
Blocking By Domain - Plugins
ormance and reduce the number of plugin prompts that users see, popular sites that show unnecessary plugin prompts or slow the browser down with unnecessary plugins will be added to the plugin block list. list contents and updates the plugin block lists are freely-licensed lists maintained by mozilla in github. the initial contents of the third-party plugin block list are based on disconnect's open source blocklist. subsequent updates to the list will be made using telemetry from firefox experiments. in general, sites will not be removed from the list unless there is an error that renders a site in a seriously defective manner. any concerns or questions about the plugin block lists should be directed to plugin-blocking-by-domain@mozilla.com. ...
Flash Activation: Browser Comparison - Plugins
t: a user can click the plugin element to show a prompt for allowing flash: if the site provides fallback content for an object element, chrome will display that content and will not prompt the user to enable flash. if a flash element is not visible to the user, the user will not get a visible prompt. a user can click the information icon on the left side of the location bar on any site to open the site information and allow flash on that site: microsoft edge in-page ui is displayed when the site attempts to use flash. an icon also appears on the right side of the location bar. the user can click the flash object to show activation options: users have the choice to allow flash just for the current session, or to remember their choice: site authoring tips if a flash element is...
Initialization and Destruction - Plugins
unction tables. however, because np_initialize is called at the end of the initialization process, you can call other methods, such as npn_memalloc and npn_status, from np_initialize. instance creation after initialization, the plug-in instance is created. more than one instance of the same plug-in can exist if a single page contains multiple embedded plug-ins, or if several browser windows are open and display the same data type. at this point, a plug-in can call the npn_setvalue function to specify whether it is windowed (the default) or windowless. plug-in instances are created with npp_new and destroyed with npp_destroy. npp_new informs the plug-in of the creation of a new instance with the specified mime type. you can allocate instance-specific private data at this time. nperror npp_n...
Plugin Roadmap for Firefox - Plugins
te. 2020 in december 2020, flash support will be completely removed from consumer versions of firefox. adobe will stop shipping security updates for flash at the end of 2020. ...
DOM Inspector - Firefox Developer Tools
inspector for thunderbird 2 is available from thunderbird add-ons. or, build thunderbird yourself with the following options: ac_add_options --enable-extensions="default inspector" ac_add_options --enable-inspector-apis mozilla suite and seamonkey select tools > web development > dom inspector. you can install the sidebar panel via edit > preferences > advanced > dom inspector, then simply open up the inspector panel and visit a website. report a bug in dom inspector use the conveniently named "dom inspector" component in bugzilla. to find out who knows dom inspector code and where it lives, see the dom inspector module listing. ...
Inspecting web app manifests - Firefox Developer Tools
in this article we will look at inspecting app manifests using the firefox devtools application panel. when you open the application panel’s manifest view on a page that doesn't have an app manifest successfully deployed, you'll get the following output shown: deploying a manifest to get a manifest deployed successfully, you need to include a <link> element in the <head> of your document that points to your .webmanifest file: <link rel="manifest" href="/manifest.webmanifest"> the .webmanifest extension is recommended in the spec, and should be served with an application/manifest+json mime type, although browsers generally tend to support manifests with other appropriate extensions like .json (mime type: application/json). you also need to make sure the json inside the file is of the...
Debugging service workers - Firefox Developer Tools
getting your service worker to register before you can look at your service worker in action in the applications panel, you need to successfully register it. ...
DOM Property Viewer - Firefox Developer Tools
the dom property viewer is new in firefox 48. it is disabled by default. enable it in the developer tools settings. the dom property viewer lets you inspect the properties of the dom as an expandable tree structure, starting from the window object of the current page or the selected iframe. enabling the dom property viewer the dom property viewer is not enabled by default. to enable it, open the developer tool settings and check the "dom" box under "default firefox developer tools". opening the dom property viewer once enabled, you can open the dom property viewer by selecting "dom" from the web developer submenu in the firefox menu panel (or tools menu if you display the menu bar or are on macos), or by pressing its ctrl + shift + w keyboard shortcut. the toolbox will appear at the b...
Debug worker threads - Firefox Developer Tools
inspecting worker code for example, see the selected item worker.js below — it is listed in a separate thread in the sources list, but appears in the source pane in the same way as main thread code when selected. setting breakpoints, etc. ...
Debug eval sources - Firefox Developer Tools
the name of the source will also appear in stack traces appearing in the web console. the debugger will also stop at debugger; statements in unnamed eval sources. ...
Use watchpoints - Firefox Developer Tools
t, set, and get or set. a get watchpoint pauses whenever a property is read; a set watchpoint pauses whenever a property value changes; a get or set watchpoint pauses whenever a property value is accessed in either way. set a watchpoint run and then pause the debugger. in the scopes pane on the right side of the debugger user interface, find an object you want to watch, and right-click it to open its context menu. choose break on, and then one of property set property get property get or set a watchpoint icon appears to the right of the property in the scopes pane. set watchpoint icons are blue, get watchpoint icons are reddish, and get or set watchpoint icons are dark yellow. click play or press f8 to resume execution. view a watchpoint when the watched proper...
How to - Firefox Developer Tools
these articles describe how to use the debugger. ...
Debugger keyboard shortcuts - Firefox Developer Tools
oint on the currently selected line ctrl + shift + b cmd + shift + b ctrl + shift + b 1. by default, on some macs, the function key is remapped to use a special feature: for example, to change the screen brightness or the volume. see this guide to using these keys as standard function keys. to use a remapped key as a standard function key, hold the function key down as well (so to open the profiler, use shift + function + f5). note: before firefox 66, the combination ctrl + shift + s on windows and linux or cmd + opt + s on macos would open/close the debugger. from firefox 66 and later, this is no longer the case. global shortcuts these shortcuts work in all tools that are hosted in the toolbox. command windows macos linux increase font size ...
Set a logpoint - Firefox Developer Tools
le in the current scope. working with logpoints when you set a logpoint, the indicator is purple, rather than the blue of an unconditional breakpoint or the orange of a conditional breakpoint. you can view the list of logpoints in the breakpoints side panel. when execution hits a logpoint, the message you have defined is logged to the console. you can make it easier to see the message by opening a split console under the debugger. (either press esc or select the elipsis menu (...) and then click show split console.) when should you use logpoints? when you want to know that a specific line in your code has executed, but you don’t want to break code execution, set a logpoint. logpoints are useful to log the value of a variable at a specific point in the code. it’s faster than...
Set an XHR breakpoint - Firefox Developer Tools
an xhr (xmlhttprequest) breakpoint breaks code execution when an xhr request is dispatched so that you can examine the current state of the program. you can break on all requests or on those that include a specific url. to turn on the feature: open the debugger click on "pause on any url" which acts as a wild card, causing the code to pause on any call, or, click the plus sign next to the xhr breakpoints header, enter the url in which you are interested, and press enter. note: if you enter a key word instead of a url, code execution will pause on any call to a url that contains that keyword. when your code breaks on an xhr request, the righthand pane will have two additional sections: call stack the list of functions that were executed in order ot get to the currently executin...
Set event listener breakpoints - Firefox Developer Tools
starting with firefox 69, debugging an application that includes event handlers is simplified because the debugger now includes the ability to automatically break when the code hits an event handler. this article explains how to use it. using a standard event breakpoint to use an event breakpoint, you open up the javascript debugger, and find and expand the event listener breakpoints section in the right hand column. to break when event listeners are hit, check the boxes next the events you are interested in. all of the standard events supported in your version of firefox are listed, arranged by which api or api area they're part of. now when a keydown, keyup, keypress, or input event occurs, execution will pause as soon as it enters the listener code. when execution pauses, the sour...
Source map errors - Firefox Developer Tools
browser invalid source map the source map data can be invalid — either simply not a json file at all, or with an incorrect structure. typical error messages here are: syntaxerror: json.parse: unexpected character at line 1 column 1 of the json data error: "version" is a required argument original source missing an original source may be missing. you may encounter this when trying to open one of the original sources in the debugger. the message looks a little different in this case: in this case, the error will also be displayed in the source tab in the debugger: networkerror when attempting to fetch resource a bug in firefox prevents it from loading source maps for web extensions. see bug 1437937: webextensions doesn't find source maps for details. source-map-fehler: typ...
The Firefox JavaScript Debugger - Firefox Developer Tools
down bugs. you can use it to debug code running locally in firefox or running remotely, for example on an android device running firefox for android. see remote debugging to learn how to connect the debugger to a remote target. to find your way around the debugger, here's a quick tour of the ui. how to to find out what you can do with the debugger, refer to the following how-to guides. open the debugger pretty-print a minified file search use a source map pause execution you probably want to pause the execution of your code, in order to see what is going on at various points. there are multiple ways to tell the debugger how and when to pause: set a breakpoint set a conditional breakpoint set an xhr breakpoint set event listener breakpoints break on exceptions use wat...
Deprecated tools - Firefox Developer Tools
functionality. when we deprecate a panel, we begin by getting feedback from the community to determine the impact of removing that panel. once we have decided to remove the panel, we will provide a warning message, and finally, we will remove the panel from the codebase. you may see a warning message, as in the following image, when trying to activate a deprecated panel: in addition, if you open the panel for one of these tools, you will also see a warning message about its removal. scratchpad scratchpad is deprecated as of firefox 70 (bug 1565380), and will be removed as of firefox 72 (bug 1519103). description scratchpad provided an environment for experimenting with javascript code. you can write, run, and examine the result of code that interacts with the web page. alternati...
Eyedropper - Firefox Developer Tools
on. underneath the magnifying glass it shows the color value for the current pixel using whichever scheme you've selected in settings > inspector > default color unit: you can use it in one of two ways: to select a color from the page and copy it to the clipboard to change a color value in the inspector's rules view to a color you've selected from the page copying a color to the clipboard open the eyedropper in one of these two ways: select "eyedropper" under the "web developer" menu open the page inspector tab and click the eyedropper button in its toolbar as you move the mouse around the page you'll see the current color value in the eyedropper change. clicking copies the current color value to the clipboard. changing a color value in the rules view color values appearing i...
JSON viewer - Firefox Developer Tools
is new in firefox 44. before firefox 53, the json viewer is enabled by default only in firefox developer edition and firefox nightly. to enable this feature in other release channels, set the devtools.jsonview.enabled preference to true. from firefox 53 onwards, the json viewer is also enabled by default in beta and the normal release version of firefox. firefox includes a json viewer. if you open a json file in the browser, or view a remote url with the content-type set to application/json, it is parsed and given syntax highlighting. arrays and objects are shown collapsed, and you can expand them using the "+" icons. the json viewer provides a search box that you can use to filter the json. you can also view the raw json and pretty-print it. finally, if the document was the result of...
Aggregate view - Firefox Developer Tools
an use the disclosure triangle to drill down the call tree, to find the exact place your code made those allocations. it's easier to explain this with reference to a simple example. for this we'll use the dom allocation example. this page simply runs a script that creates a large number of dom nodes (200 htmldivelement objects and 4000 htmlspanelement objects). let's get an allocation trace: open the memory tool check "record call stacks" load https://mdn.github.io/performance-scenarios/dom-allocs/alloc.html take a snapshot select "view/aggregate" select "group by/call stack" you should see something like this: this is telling us that 93% of the total heap snapshot was allocated in functions called from "alloc.js", line 35 (our initial createtoolbars() call). we can use the d...
Basic operations - Firefox Developer Tools
taking a heap snapshot to take a snapshot of the heap, click the "take snapshot" button, or the camera icon on the left: the snapshot will occupy the large pane on the right-hand side. on the left, you'll see an entry for the new snapshot, including its timestamp, size, and controls to save or clear this snapshot: clearing a snapshot to remove a snapshot, click the "x" icon: saving and loading snapshots if you close the memory tool, all unsaved snapshots will be discarded. ...
Dominators view - Firefox Developer Tools
the other two path. example let's see how some simple code is reflected in the dominators view. we'll use the monster allocation example, which creates three arrays, each containing 5000 monsters, each monster having a randomly-generated name. taking a snapshot to see what it looks like in the dominators view: load the page enable the memory tool in the settings, if you haven't already open the memory tool check "record call stacks" press the button labeled "make monsters!" take a snapshot switch to the "dominators" view analyzing the dominators tree you'll see the three arrays as the top three gc roots, each retaining about 23% of the total memory usage: if you expand an array, you'll see the objects (monsters) it contains. each monster has a relatively small shallow si...
Memory - Firefox Developer Tools
the memory tool lets you take a snapshot of the current tab's memory heap. it then provides a number of views of the heap that can show you which objects account for memory usage and exactly where in your code you are allocating memory. the basics opening the memory tool taking a heap snapshot comparing two snapshots deleting snapshots saving and loading snapshots recording call stacks analyzing snapshots the tree map view is new in firefox 48, and the dominators view is new in firefox 46. once you've taken a snapshot, there are three main views the memory tool provides: the tree map view shows memory usage as a treemap. the aggregate view shows memory usage as a table of allocated types. the dominators view shows the "retained size" of objects: that is, the s...
Performance Analysis - Firefox Developer Tools
the network monitor includes a performance analysis tool, to help show you how long the browser takes to download the different parts of your site. using the performance analysis tool to run the performance analysis tool click the stopwatch icon in the toolbar. (alternatively, if you have only just opened the network monitor, so it's not yet populated with the list of requests, you'll get a stopwatch icon in the main window.) the network monitor then loads the site twice: once with an empty browser cache, and once with a primed browser cache. this simulates the first time a user visits your site, and subsequent visits. it displays the results for each run side by side, or vertically if the browser window is narrow: the results for each run are summarised in a table and a pie chart. the...
Network monitor toolbar - Firefox Developer Tools
ts a checkbox that allows you to disable caching. throttling menu, to simulate various connection types a menu of other actions: persist logs: by default, the network monitor is cleared each time you navigate to a new page or reload the current page. when you select persist logs, the log is not cleared on page load. import har imports a har (http archive) file. save all as har opens a file dialog box so you can save the current contents of the network log as a har file with the extension .har. copy all as har copies the current contents of the network log to the clipboard in har format. a second toolbar area at the bottom of the network monitor provides: an icon to launch performance analysis. a summary of this page, including the number of requests, total s...
Network request details - Firefox Developer Tools
r. http response headers http request headers each section has a disclosure triangle to expand the section to show more information. headers toolbar using the headers toolbar, you can: filter the headers in the response headers and request headers sections. block the domain involved in this request. the domain is added to the blocking sidebar. resend the request. the resend button opens a menu with two items: resend: simply resends the request. edit and resend: enables an editing mode, where you can modify the method, url, request headers, or request body of the request. click send to send the modified request, or cancel to cancel editing. request information the following information is shown only when the section is expanded: scheme: the scheme used in the...
Page inspector 3-pane mode - Firefox Developer Tools
s on the right hand side, as usual. note: at narrower browser window widths, the tabs appear below the css rules pane. having the css rules in their own pane is very useful because it allows you to not only inspect your html and edit the css applied to it, but also see the effect this has on css features such as computed styles and grids in real time. you just need to have the relevant tab open to see the effect. a brief walkthrough the 3-pane inspector is disabled by default. it is enabled via a toggle control found in the tabs pane on the left hand side. press the toggle control to toggle between the 2- and 3-pane views. with the 3-pane mode enabled, you can observe live changes in css features as you edit the rules applied to the page. for example, you could edit a css grid...
Edit CSS filters - Firefox Developer Tools
you can edit these lines, remove them individually, or drag the effects to change the order in which they are applied. you can also add new effects by selecting an effect from the dropdown list at the bottom of the dialog. once you have selected the effect you want to add, click the plus sign (+) to the right of the dropdown list. once you have added an effect, enter the settings you want and then press enter to update the effect. ...
Edit Shape Paths in CSS - Firefox Developer Tools
the shape path editor is a tool that helps you see and edit shapes created using clip-path and also the css shape-outside property and <basic-shape> values. this guide walks you through all of the available options. activate / deactivate the shape path editor the shape path editor is accessed via the css rules panel, which can be opened as described in the guide to opening the inspector. once you have selected your element, you should see the shape icon alongside any valid value, e.g. one for shape-outside. clicking the icon will cause the editor to highlight the shape. to deactivate the shape path editor click on the icon again, or select another element or a different editor. note that the shape path editor does not persist between page reloads — if you reload your page you will n...
Select an element - Firefox Developer Tools
the selected element is the element in the page that the inspector is currently focused on. the selected element is shown in the html pane and its css is displayed in the css pane. the highlighted element is the element that's overlaid in the page with a graphic showing the box model, and a tooltip showing its tag and size: with the context menu to open the inspector and select an element immediately, activate the context menu over the element in the page and select "inspect element": with the html pane when the inspector is open, as you move the mouse around the elements listed in the html pane, the corresponding elements are highlighted in the page. click an element in the html pane to select it: you can also use the arrow keys to move around the dom with the keyboard. w...
Select and highlight elements - Firefox Developer Tools
the selected element is the element in the page that the inspector is currently focused on. the selected element is shown in the html pane and its css is displayed in the css pane. the highlighted element is the element that's overlaid in the page with a graphic showing the box model, and a tooltip showing its tag and size: with the context menu to open the inspector and select an element immediately, activate the context menu over the element in the page and select "inspect element": with the html pane when the inspector is open, as you move the mouse around the elements listed in the html pane, the corresponding elements are highlighted in the page. click an element in the html pane to select it: you can also use the arrow keys to move around the dom with the keyboard. w...
Animation inspector example: CSS transitions - Firefox Developer Tools
e">firefox developer edition</span> </div> css content .channel { padding: 2em; margin: 0.5em; box-shadow: 1px 1px 5px #808080; margin: 1.5em; } .channel > * { vertical-align: middle; line-height: normal; } .icon { width: 50px; height: 50px; filter: grayscale(100%); transition: transform 750ms ease-in, filter 750ms ease-in-out; } .note { margin-left: 1em; font: 1.5em "open sans",arial,sans-serif; overflow: hidden; white-space: nowrap; display: inline-block; opacity: 0; width: 0; transition: opacity 500ms 150ms, width 500ms 150ms; } .icon#selected { filter: grayscale(0%); transform: scale(1.5); } .icon#selected+span { opacity: 1; width: 300px; } javascript content function toggleselection(e) { if (e.button != 0) { return; } if (e.
Animation inspector example: Web Animations API - Firefox Developer Tools
ipple.com/samples/e6/a96484b5c3.png" id="icon"/> <span id="note">firefox developer edition</span> </div> css content .channel { padding: 2em; margin: 0.5em; box-shadow: 1px 1px 5px #808080; margin: 1.5em; } .channel > * { vertical-align: middle; line-height: normal; } #icon { width: 50px; height: 50px; filter: grayscale(100%); } #note { margin-left: 1em; font: 1.5em "open sans",arial,sans-serif; overflow: hidden; white-space: nowrap; display: inline-block; opacity: 0; width: 0; } javascript content var iconkeyframeset = [ { transform: 'scale(1)', filter: 'grayscale(100%)'}, { filter: 'grayscale(100%)', offset: 0.333}, { transform: 'scale(1.5)', offset: 0.666 }, { transform: 'scale(1.5)', filter: 'grayscale(0%)'} ]; var notekeyframeset = [ ...
How to - Firefox Developer Tools
links for various how to's can be found here. these links describe in depth the how to techniques. ...
Page inspector keyboard shortcuts - Firefox Developer Tools
up arrow from firefox 60 onwards.) decrement selected value by 0.1 alt + down arrow (ctrl + down arrow from firefox 60 onwards). alt + down arrow alt + down arrow (ctrl + down arrow from firefox 60 onwards). show/hide more information about current property (computed view only, when a property is selected) enter or space return or space enter or space open mdn reference page about current property (computed view only, when a property is selected) f1 f1 f1 open current css file in style editor (computed view only, when more information is shown for a property and a css file reference is focused). enter return enter global shortcuts these shortcuts work in all tools that are hosted in the toolbox. command ...
UI Tour - Firefox Developer Tools
e would return.): compatibility view starting with firefox developer edition version 77, the compatibility view shows css compability issues, if any, for properties applied to the selected element, and for the current page as a whole. it shows icons for the browsers that do support the properties, and notes properties that are experimental or deprecated. click the name of the property to open the reference article for that property on mdn web docs. the "browser compatibility" section of the article gives details of browser support for the property. in the all issues section, click the name of the element that uses the property to select that element in the inspector. if more than one element has a given property applied to it, click the triangle to show all the occurences. to config...
Page Inspector - Firefox Developer Tools
remote debugging to learn how to connect the developer tools to a remote target. user interface tour to find your way around the inspector, here's a quick tour of the ui. you can split the rules view out into its own pane, separate from the other tabs on the css pane — this is called 3-pane mode. ...
Paint Flashing Tool - Firefox Developer Tools
the browser here, causing it to trigger more repaints, and for more of the screen, than necessary. this can then cause a site to be slow responding to user input (also known as "janky"). that's where the paint flashing tool helps: by showing you the areas that the browser repaints in response to an event, you can see whether it is repainting more than it needs to. using the paint flashing tool open the toolbox, then click the icon labeled "highlight painted area": then try using the page. after moving the mouse around and scrolling a bit, the above page looks like this: in this example, there are two main sources of repaints: moving the mouse over links makes the browser repaint them, because they have a style applied using the :hover pseudo-class scrolling makes the browser repaint...
How to - Firefox Developer Tools
to stop, press it again: you can also start and stop recording from the web console, using console.profile() and console.profileend(). save a profile to save a profile, click the link labeled "save" in the recordings pane: load a profile to load a profile, click "import..." and choose the file: clear all loaded profiles to clear all loaded profiles, click "clear". ...
Animating CSS properties - Firefox Developer Tools
ation, and a radio group to choose to animate using margin, or to animate using transform. there are a number of elements, and we've added a linear-gradient background and a box-shadow to each element, because they are both relatively expensive effects to paint. there's also a video version of this walkthrough: animating using margin leaving the "use margin" option set, start the animation, open the performance tool, and make a recording. you'll only need to record a few seconds. open up the first recording. exactly what you'll see depends a lot on your machine and system load, but it will be something like this: this is showing three distinct views: (a) an overview of the waterfall, (b) the frame rate, and (c) the timeline details. waterfall overview this is showing a compressed...
Performance - Firefox Developer Tools
ows the javascript call stack over the course of the recording the allocations view shows the heap allocations made by your code over the course of the recording. this view only appears if you checked "record allocations" in the performance tool settings. getting started ui tour to find your way around the performance tool, here's a quick tour of the ui. how to basic tasks: open the tool, create, save, load, and configure recordings components of the performance tool frame rate understand your site's overall responsiveness. call tree find bottlenecks in your site's javascript. allocations see the allocations made by your code over the course of the recording. waterfall understand the work the browser's doing as the user interacts with your site. fl...
Responsive Design Mode - Firefox Developer Tools
nt simulation is enabled, mouse events are translated into touch events; this includes (starting in firefox 79) translating a mouse-drag event into a touch-drag event. (note that when touch simulation is enabled, this toolbar icon is blue; when simulation is disabled, it is black. ...
IndexedDB - Firefox Developer Tools
databases have the following details: database name — the name of the database. storage — the storage type specified for the database. origin — the origin of the database. version — the database version. ...
Taking screenshots - Firefox Developer Tools
type description --clipboard boolean when present, this parameter will cause the screenshot to be copied to the clipboard. prevents saving to a file unless you use the --file option to force file writing. --delay number the number of seconds to delay before taking the screenshot; you can use an interger or floating point number. this is useful if you want to pop open a menu or invoke a hover state for the screenshot. --dpr number the device pixel ratio to use when taking the screenshot. values above 1 yield "zoomed-in" images, whereas values below 1 create "zoomed-out" images. --file boolean when present, the screenshot will be saved to a file, even if other options (e.g. --clipboard) are included. --filename string ...
View Source - Firefox Developer Tools
view source features view source has three additional features, which can be accessed from the context menu in the view source tab: go to line scrolls to the specified line. if the number is higher than the lines in a file, you receive an error message. ...
Web Audio Editor - Firefox Developer Tools
and edit the audioparam properties for each node in the graph. some non-audioparam properties, like an oscillatornode's type property, are displayed, and you can edit these as well. this tool is still experimental. if you find bugs, we'd love it if you filed them in bugzilla. if you have feedback or suggestions for new features, dev-developer-tools or twitter are great places to register them. opening the web audio editor the web audio editor is not enabled by default in firefox 32. to enable it, open the developer tool settings and check "web audio". now there should be an extra tab in the toolbox toolbar labeled "web audio". click the tab and load a page that constructs an audio context. two good demos are: the voice-change-o-matic, which can apply various effects to the microphone in...
Web Console Helpers - Firefox Developer Tools
please refer to the console api for more information about logging from content. variables tempn the "use in console" option in the inspector generates a variable for a node named temp0, temp1, temp2, etc. referencing the node. examples looking at the contents of a dom node let's say you have a dom node with the id "title". in fact, this page you're reading right now has one, so you can open up the web console and try this right now. let's take a look at the contents of that node by using the $() and inspect() functions: inspect($("#title")) this automatically generates rich output for the object, showing you the contents of the dom node that matches the css selector "#title", which is of course the element with id "title". you can use the up- and down-arrow keys to navigate throu...
Rich output - Firefox Developer Tools
object properties when an object is logged to the console it has a right-pointing triangle next to it, indicating that it can be expanded. click on the triangle, and the object will be expanded to show its contents: starting with firefox 67 (available now in firefox developer) you can use the arrow keys on your keyboard to navigate through objects displayed in the console. the right-arrow key opens the details of an object and the left-arrow key closes open objects. examining request details similar to examining object details, you can see the details about a network request directly in the console. click on the arrow next to the request and a details panel will open that is equivalent to the headers panel in the network monitor tool. export output to the clipboard once you have outp...
Web Console UI Tour - Firefox Developer Tools
s can contain. note: you can clear the contents of the console by entering the keyboard command ctrl + shift + l (windows, macos, and linux) or cmd + k on macos. command line the command line starts with double angle brackets (>>). use it to enter javascript expressions. in firefox 71 onwards, there is a new "split pane" icon on the right hand side of the command line — clicking this will open the new console multi-line mode. ...
Web Console - Firefox Developer Tools
ui. the javascript input interpreter how to interact with a document using the console. split console use the console alongside other tools. console messages details of the messages that the console logs. helper commands commands you can use that are not part of javascript. rich output see and interact with objects logged by the console. keyboard shortcuts shortcut reference. opening the web console you open the web console from a menu or with a keyboard shortcut: choose web console from the web developer submenu in the firefox menu (or tools menu if you display the menu bar or are on mac os x) press the ctrl+shift+k (command+option+k on os x) keyboard shortcut. the toolbox appear at the bottom, left, or right of the browser window (depending on your docking setting...
AudioBufferSourceNode.playbackRate - Web APIs
ckrate property value on the fly. you can run the example live (or view the source.) play the song and alter the playback rate for some fun results. ...
AudioBufferSourceNode.start() - Web APIs
n the same time coordinate system as the audiocontext, to the time within the audio buffer that playback should begin. for example, to start playback halfway through a 10-second audio clip, offset should be 5. the default value, 0, will begin playback at the beginning of the audio buffer, and offsets past the end of the audio which will be played (based on the audio buffer's duration and/or the loopend property) are silently clamped to the maximum value allowed. the computation of the offset into the sound is performed using the sound buffer's natural sample rate, rather than the current playback rate, so even if the sound is playing at twice its normal speed, the midway point through a 10-second audio buffer is still 5. duration optional the duration of the sound to be played, specified in ...
AudioBufferSourceNode - Web APIs
must be replayed when the end of the audiobuffer is reached. its default value is false. audiobuffersourcenode.loopstart optional a floating-point value indicating the time, in seconds, at which playback of the audiobuffer must begin when loop is true. its default value is 0 (meaning that at the beginning of each loop, playback begins at the start of the audio buffer). audiobuffersourcenode.loopend optional a floating-point number indicating the time, in seconds, at which playback of the audiobuffer stops and loops back to the time indicated by loopstart, if loop is true. the default value is 0. audiobuffersourcenode.playbackrate an a-rate audioparam that defines the speed factor at which the audio asset will be played, where a value of 1.0 is the sound's natural sampling rate. since no...
AudioContext() - Web APIs
s the specification doesn't go into a lot of detail about things like how many audio contexts a user agent should support, or minimum or maximum latency requirements (if any), so these details can vary from browser to browser. be sure to check the values if they matter to you. in particular, the specification doesn't indicate a maximum or minimum number of audio contexts that must be able to be open at the same time, so this is left up to the browser implementations to decide. google chrome per-tab audio context limitation in chrome prior to version 66 google chrome only supported up to six audio contexts per tab at a time. non-standard exceptions in chrome if the value of the latencyhint property isn't valid, chrome throws a typeerror exception with the message "the provided value '..
AudioProcessingEvent - Web APIs
er source var audioctx = new audiocontext(); source = audioctx.createbuffersource(); // create a scriptprocessornode with a buffersize of 4096 and a single input and output channel var scriptnode = audioctx.createscriptprocessor(4096, 1, 1); console.log(scriptnode.buffersize); // load in 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 scri...
Background Tasks API - Web APIs
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. in addition, there's a "start" button (creatively given the id "startbutton"), which the user will use to start the data processing. ...
BaseAudioContext.createConvolver() - Web APIs
pplied is really deep and echoey. for applied examples/information, check out our voice-change-o-matic demo (see app.js for relevant code). var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var convolver = audioctx.createconvolver(); ... ...
BaseAudioContext.createScriptProcessor() - Web APIs
er source var audioctx = new audiocontext(); source = audioctx.createbuffersource(); // create a scriptprocessornode with a buffersize of 4096 and a single input and output channel var scriptnode = audioctx.createscriptprocessor(4096, 1, 1); console.log(scriptnode.buffersize); // load in 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 scri...
BaseAudioContext.decodeAudioData() - Web APIs
r('pre'); var myscript = document.queryselector('script'); var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); // use xhr to load an audio track, and // decodeaudiodata to decode it and stick it in a buffer. ...
Bluetooth.referringDevice - Web APIs
the bluetooth.referringdevice attribute of the bluetooth interface returns a bluetoothdevice if the current document was opened in response to an instruction sent by this device and null otherwise. syntax bluetooth.referringdevice value a bluetoothdevice, if the document was opened in response to an instruction sent by this device and null otherwise. specifications specification status comment web bluetooththe definition of 'referringdevice' in that specification. draft initial definition. ...
Bluetooth - Web APIs
Web › API › Bluetooth
es(); promise<bluetoothdevice> requestdevice(optional requestdeviceoptions options = {}); }; bluetooth includes bluetoothdeviceeventhandlers; bluetooth includes characteristiceventhandlers; bluetooth includes serviceeventhandlers; properties inherits properties from its parent eventtarget. bluetooth.referringdevice read only returns a reference to the device, if any, from which the user opened the current page. for example, an eddystone beacon might advertise a url, which the user agent allows the user to open. a bluetoothdevice representing the beacon would be available through navigator.bluetooth.referringdevice. events bluetooth.onavailabilitychanged an event handler that runs when an event of type availabilitychanged has fired. methods bluetooth.getavailability() retu...
CSSPseudoElement - Web APIs
tlistener() removes an event listener from the pseudo-element. examples basic example using element.pseudo using pseudo-elements, most modern browsers will automatically add quotation marks around text inside a <q> element. (a style rule may be needed to add quotation marks in older browsers.) the example below demonstrates the basic properties of the csspseudoelement object representing the opening quotation mark. const element = document.queryselector('q'); const csspseudoelement = element.pseudo('::before'); console.log(csspseudoelement.element); // outputs [object htmlquoteelement] console.log(csspseudoelement.type); // outputs '::before' specifications specification status comment css pseudo-elements level 4the definition of 'csspseudoelement' in that spec...
Using the CSS Typed Object Model - Web APIs
h units of measurement like 20px, 40%, 200ms, or 7. it is returned with two properties: a value and a unit. with this type we can access the numeric value — cssunitvalue.value — and its unit — cssunitvalue.unit. let's write a plain paragraph, apply no styles, and inspect a few of its css properties by returning a table with the unit and value: <p> this is a paragraph with some content. open up this example in codepen or jsfiddle, and change some features. try adding some css, such as a width for this paragraph, or adding a css property to the ofinterst array. </p> <table id="regurgitation"> <thead> <tr> <th>property</th> <th>value</th> <th>unit</th> </tr> </table> for each property of interest, we list the name of the property, use .get(propertynam...
Cache.add() - Web APIs
Web › API › Cache › add
is not in the 200 range (i.e., not a successful response.) this occurs if the request does not return successfully, but also if the request is a cross-origin no-cors request (in which case the reported status is always 0.) examples this code block waits for an installevent to fire, then calls waituntil() to handle the install process for the app. this consists of calling cachestorage.open to create a new cache, then using cache.add to add an asset to it. this.addeventlistener('install', function(event) { event.waituntil( caches.open('v1').then(function(cache) { return cache.add('/sw-test/index.html'); }) ); }); specifications specification status comment service workersthe definition of 'cache: add' in that specification. working dr...
Cache.delete() - Web APIs
Web › API › Cache › delete
matching. in other words, if the url matches you will get a match regardless of whether the response object has a vary header. it defaults to false. cachename: a domstring that represents a specific cache to search within. note that this option is ignored by cache.delete(). return value a promise that resolves to true if the cache entry is deleted, or false otherwise. examples caches.open('v1').then(function(cache) { cache.delete('/images/image.png').then(function(response) { someuiupdatefunction(); }); }) specifications specification status comment service workersthe definition of 'cache: delete' in that specification. working draft initial definition. ...
Cache.keys() - Web APIs
Web › API › Cache › keys
ration not to perform vary header matching. in other words, if the url matches you will get a match regardless of whether the response object has a vary header. it defaults to false. cachename: a domstring that represents a specific cache to search within. note that this option is ignored by cache.keys(). return value a promise that resolves to an array of cache keys. examples caches.open('v1').then(function(cache) { cache.keys().then(function(keys) { keys.foreach(function(request, index, array) { cache.delete(request); }); }); }) specifications specification status comment service workersthe definition of 'cache: keys' in that specification. working draft initial definition. ...
Cache.match() - Web APIs
Web › API › Cache › match
ndwith() if this is a get request for an html document. if (event.request.method === 'get' && event.request.headers.get('accept').indexof('text/html') !== -1) { console.log('handling fetch event for', event.request.url); event.respondwith( fetch(event.request).catch(function(e) { console.error('fetch failed; returning offline page instead.', e); return caches.open(offline_cache).then(function(cache) { return cache.match(offline_url); }); }) ); } }); specifications specification status comment service workersthe definition of 'cache match' in that specification. working draft initial definition. ...
Cache.matchAll() - Web APIs
Web › API › Cache › matchAll
onse object having a vary header or not. it defaults to false. return value a promise that resolves to an array of all matching responses in the cache object. note: cache.match() is basically identical to cache.matchall(), except that rather than resolving with an array of all matching responses, it resolves with the first matching response only (that is, response[0]). examples caches.open('v1').then(function(cache) { cache.matchall('/images/').then(function(response) { response.foreach(function(element, index, array) { cache.delete(element); }); }); }) specifications specification status comment service workersthe definition of 'cache: matchall' in that specification. working draft initial definition. ...
CacheStorage.has() - Web APIs
Web › API › CacheStorage › has
for in the cachestorage. return value a promise that resolves to true if the cache exists or false if not. examples the following example first checks whether a cache called 'v1' exists. if so, we add a list of assets to it. if not then we run some kind of cache set-up function. caches.has('v1').then(function(hascache) { if (!hascache) { somecachesetupfunction(); } else { caches.open('v1').then(function(cache) { return cache.addall(myassets); }); } }).catch(function() { // handle exception here. }); specifications specification status comment service workersthe definition of 'cachestorage: has' in that specification. working draft initial definition. ...
A basic ray-caster - Web APIs
this article provides an interesting real-world example of using the <canvas> element to do software rendering of a 3d environment using ray-casting. open in new window why? after realizing, to my delight, that the nifty <canvas> element i'd been reading about was not only soon to be supported in firefox, but was already supported in the current version of safari, i had to try a little experiment. the canvas overview and tutorial i found here at mdn are great, but nobody had written about animation yet, so i thought i'd try a port of a basic raycaster i'd worked on a while ago, and see what sort of performance we can expect from a javascript-controlled pixel buffer. how? the basic idea is to use setinterval() at some arbitrary delay that corresponds to a desired frame rate. after ev...
Basic usage of canvas - Web APIs
mpatible with all browsers that support canvas at all. the rendering context the <canvas> element creates a fixed-size drawing surface that exposes one or more rendering contexts, which are used to create and manipulate the content shown. in this tutorial, we focus on the 2d rendering context. other contexts may provide different types of rendering; for example, webgl uses a 3d context based on opengl es. the canvas is initially blank. to display something, a script first needs to access the rendering context and draw on it. the <canvas> element has a method called getcontext(), used to obtain the rendering context and its drawing functions. getcontext() takes one parameter, the type of context. for 2d graphics, such as those covered by this tutorial, you specify "2d" to get a canvasrenderi...
Clients.get() - Web APIs
Web › API › Clients › get
rvice worker client matching a given id and returns it in a promise. syntax self.clients.get(id).then(function(client) { // do something with your returned client }); parameters id a domstring representing the id of the client you want to get. return value a promise that resolves to a client object or undefined. examples self.clients.get(id).then(function(client) { self.clients.openwindow(client.url); }); specifications specification status comment service workersthe definition of 'get()' in that specification. working draft initial definition ...
Clients.matchAll() - Web APIs
Web › API › Clients › matchAll
d "all". the default is "all". return value a promise that resolves to an array of client objects. in chrome 46/firefox 54 and later, this method returns clients in most recently focused order, correct as per spec. examples clients.matchall(options).then(function(clientlist) { for (var i = 0 ; i < clientlist.length ; i++) { if (clientlist[i].url === 'index.html') { clients.openwindow(clientlist[i]); // or do something else involving the matching client } } }); specifications specification status comment service workersthe definition of 'clients: matchall' in that specification. working draft initial definition ...
CloseEvent - Web APIs
status code name description 0–999 reserved and not used. 1000 normal closure normal closure; the connection successfully completed whatever purpose for which it was created. 1001 going away the endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection. 1002 protocol error the endpoint is terminating the connection due to a protocol error. 1003 unsupported data the connection is being terminated because the endpoint received data of a type it cannot accept (for example, a text-only endpoint received binary data). 1004 reserved. a meaning might be defined in the future...
console.log() - Web APIs
Web › API › Console › log
ring representations of each of these objects are appended together in the order listed and output. please be warned that if you log objects in the latest versions of chrome and firefox what you get logged on the console is a reference to the object, which is not necessarily the 'value' of the object at the moment in time you call console.log(), but it is the value of the object at the moment you open the console. msg a javascript string containing zero or more substitution strings. subst1 ... substn javascript objects with which to replace substitution strings within msg. this gives you additional control over the format of the output. see outputting text to the console in the documentation of console for details. difference between log() and dir() you might ask yourself what's the di...
ConvolverNode.buffer - Web APIs
dioctx = new audiocontext(); var convolver = audioctx.createconvolver(); convolver.buffer = myaudiobuffer; value an audiobuffer. example var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var convolver = audioctx.createconvolver(); ... ...
ConvolverNode.normalize - Web APIs
ax var audioctx = new audiocontext(); var convolver = audioctx.createconvolver(); convolver.normalize = false; value a boolean. example var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var convolver = audioctx.createconvolver(); ... ...
Credential Management API - Web APIs
ethods to request credentials and notify the user agent when interesting events occur such as successful sign in or sign out. this interfaces is accessible from navigator.credentials. federatedcredential provides information about credentials from a federated identity provider, which is an entity that a website trusts to correctly authenticate a user, and which provides an api for that purpose. openid connect is an example of such a framework. passwordcredential provides information about a username/password pair. publickeycredential provides a credential for logging in using an un-phishable and data-breach resistant asymmetric key pair instead of a password. specifications specification status comment credential management level 1 working draft initial d...
CustomElementRegistry.get() - Web APIs
rn value the constructor for the named custom element, or undefined if there is no custom element definition with that name. examples customelements.define('my-paragraph', class extends htmlelement { constructor() { super(); let template = document.getelementbyid('my-paragraph'); let templatecontent = template.content; const shadowroot = this.attachshadow({mode: 'open'}) .appendchild(templatecontent.clonenode(true)); } }) // return a reference to the my-paragraph constructor let ctor = customelements.get('my-paragraph'); specifications specification status comment html living standardthe definition of 'customelements.get()' in that specification. living standard initial definition. ...
CustomElementRegistry - Web APIs
) { // always call super first in constructor super(); // count words in element's parent element var wcparent = this.parentnode; function countwords(node){ var text = node.innertext || node.textcontent return text.split(/\s+/g).length; } var count = 'words: ' + countwords(wcparent); // create a shadow root var shadow = this.attachshadow({mode: 'open'}); // create text node and add word count to it var text = document.createelement('span'); text.textcontent = count; // append it to the shadow root shadow.appendchild(text); // update count when element content changes setinterval(function() { var count = 'words: ' + countwords(wcparent); text.textcontent = count; }, 200) } } // define the new...
DOMException - Web APIs
ror provided data is inadequate (no legacy code value and constant name). transactioninactiveerror a request was placed against a transaction that is currently not active or is finished (no legacy code value and constant name). readonlyerror the mutating operation was attempted in a "readonly" transaction (no legacy code value and constant name). versionerror an attempt was made to open a database using a lower version than the existing version (no legacy code value and constant name). operationerror the operation failed for an operation-specific reason (no legacy code value and constant name). notallowederror the request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission (no legacy code value and constant n...
Detecting device orientation - Web APIs
warning: chrome and firefox do not handle the angles the same way, so on some axes the direction are reversed. processing motion events motion events are handled the same way as the orientation events except that they have their own event's name: devicemotion window.addeventl...
Document.close() - Web APIs
Web › API › Document › close
the document.close() method finishes writing to a document, opened with document.open(). syntax document.close(); example // open a document to write to it document.open(); // write the content of the document document.write("<p>the one and only content.</p>"); // close the document document.close(); specifications specification status comment html living standardthe definition of 'document.close()' in that specification. living standard document object model (dom) level 2 html specificationthe definition of 'document.close()' in that specification. obsolete ...
Document: drag event - Web APIs
ropzone") { event.target.style.background = "purple"; } }, false); document.addeventlistener("dragleave", function(event) { // reset background of potential drop target when the draggable element leaves it if (event.target.classname == "dropzone") { event.target.style.background = ""; } }, false); document.addeventlistener("drop", function(event) { // prevent default action (open as link for some elements) event.preventdefault(); // move dragged elem to the selected drop target if (event.target.classname == "dropzone") { event.target.style.background = ""; dragged.parentnode.removechild( dragged ); event.target.appendchild( dragged ); } }, false); specifications specification status comment html living standardthe defini...
Document.timeline - Web APIs
Web › API › Document › timeline
the timeline readonly property of the document interface represents the default timeline of the current document. this timeline is a special instance of documenttimeline that is automatically created on page load. this timeline is unique to each document and persists for the lifetime of the document including calls to document.open(). the time values for this timeline are calculated as a fixed offset from the global clock such that the zero time corresponds to the navigationstart moment plus a signed delta known as the origin time. prior to establishing the navigationstart moment, the document timeline is inactive. note: a document timeline that is associated with a non-active document is also considered to be inactive. syntax var pagetimeline = document.timeline; var thismoment = ...
Document.writeln() - Web APIs
Web › API › Document › writeln
line); parameters line is string containing a line of text. example document.writeln("<p>enter password:</p>"); notes document.writeln is the same as document.write but adds a newline. note: document.writeln (like document.write) does not work in xhtml documents (you'll get a "operation is not supported" (ns_error_dom_not_supported_err) error on the error console). this is the case if opening a local file with a .xhtml file extension or for any document served with an application/xhtml+xml mime type. more information is available in the w3c xhtml faq. specifications specification status comment html living standardthe definition of 'document.writeln()' in that specification. living standard document object model (dom) level 2 html spec...
Document - Web APIs
Web › API › Document
ions of firefox and internet explorer, this method does nothing. document.close() closes a document stream for writing. document.execcommand() on an editable document, executes a formating command. document.getelementsbyname() returns a list of elements with the given name. document.hasfocus() returns true if the focus is currently located anywhere inside the specified document. document.open() opens a document stream for writing. document.querycommandenabled() returns true if the formating command can be executed on the current range. document.querycommandindeterm() returns true if the formating command is in an indeterminate state on the current range. document.querycommandstate() returns true if the formating command has been executed on the current range. document.querycom...
How whitespace is handled by HTML, CSS, and in the DOM - Web APIs
s to not be created in the first place: <li></li><li></li><li></li><li></li><li></li> dom traversal and whitespace when trying to do dom manipulation in javascript, you can also encounter problems because of whitespace nodes. for example, if you have a reference to a parent node and want to affect its first element child using node.firstchild, if there is a rogue whitespace node just after the opening parent tag you will not get the result you are expecting. the text node would be selected instead of the element you want to affect. as another example, if you have a certain subset of elements that you want to do something to based on whether they are empty (have no child nodes) or not, you could check whether each element is empty using something like node.haschildnodes(), but again, if any...
EXT_shader_texture_lod - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method. for more information, see also using extensions in the webgl tutorial. availability: this extension is only available to webgl1 contexts. in webgl2, the functionality of this extension is available on the webgl2 context by default. it requires glsl #version 300 es. ...
EffectTiming.iterations - Web APIs
e infinity (run the animation indefinitely) is supported. defaults to 1, meaning the animation sequence plays through once then stops automatically. exceptions typeerror an attempt was made to set the value of this property to a negative number or nan. the property's value is left unchanged. ...
Element: contextmenu event - Web APIs
this event is typically triggered by clicking the right mouse button, or by pressing the context menu key. in the latter case, the context menu is displayed at the bottom left of the focused element, unless the element is a tree, in which case the context menu is displayed at the bottom left of the current row. any right-click event that is not disabled (by calling the event's preventdefault() method) will result in a contextmenu event being fired at the targeted element. ...
Element.getElementsByTagName() - Web APIs
is the qualified name to look for. the special string "*" represents all elements. for compatibility with xhtml, lower-case should be used. example // check the status of each data cell in a table const table = document.getelementbyid('forecast-table'); const cells = table.getelementsbytagname('td'); for (let cell of cells) { let status = cell.getattribute('data-status'); if (status === 'open') { // grab the data } } specifications specification status comment domthe definition of 'element.getelementsbytagname()' in that specification. living standard changed the return value from nodelist to htmlcollection document object model (dom) level 3 core specificationthe definition of 'element.getelementsbytagname()' in that specification. o...
EventSource: error event - Web APIs
the error event of the eventsource api is fired when a connection with an event source fails to be opened. bubbles no cancelable no interface event or errorevent event handler property eventsource.onerror examples var evtsource = new eventsource('sse.php'); // addeventlistener version evtsource.addeventlistener('error', (e) => { console.log("an error occurred while attempting to connect."); }); // onerror version evtsource.onerror = (e) => { console.log("an error occurred while attempting to connect."); }; specifications specification status html living standardthe definition of 'error event' in that specification. living standard ...
EventSource.readyState - Web APIs
the readystate read-only property of the eventsource interface returns a number representing the state of the connection. syntax var myreadystate = eventsource.readystate; value a number representing the state of the connection. possible values are: 0 — connecting 1 — open 2 — closed examples var evtsource = new eventsource('sse.php'); console.log(evtsource.readystate); note: you can find a full example on github — see simple sse demo using php. specifications specification status comment html living standardthe definition of 'readystate' in that specification. living standard initial definition ...
ExtendableEvent.waitUntil() - Web APIs
he promises passed to it settle. note: the behaviour described in the above paragraph was fixed in firefox 43 (see bug 1180274). syntax extendableevent.waituntil(promise); parameters a promise. return value undefined. example using waituntil() within a service worker's install event: addeventlistener('install', event => { const precache = async () => { const cache = await caches.open('static-v1'); return cache.addall([ '/', '/about/', '/static/styles.css' ]); }; event.waituntil(precache()); }); specifications specification status comment service workersthe definition of 'waituntil()' in that specification. working draft initial definition ...
ExtendableEvent - Web APIs
ent_caches = { prefetch: 'prefetch-cache-v' + cache_version }; self.addeventlistener('install', function(event) { var urlstoprefetch = [ './static/pre_fetched.txt', './static/pre_fetched.html', 'https://www.chromium.org/_/rsrc/1302286216006/config/customlogo.gif' ]; console.log('handling install event. ...
FederatedCredential.protocol - Web APIs
the protocol property of the federatedcredential interface returns a read-only domstring containing a credential's federated identity protocol. if this property is null, the protocol may be inferred from the federatedcredential.provider property. syntax var protocol = federatedcredential.protocol value a domstring containing a credential's federated identity protocol (e.g. openidconnect). examples // tbd specifications specification status comments credential management level 1the definition of 'protocol' in that specification. working draft initial definition. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn...
FederatedCredential - Web APIs
the federatedcredential interface of the the credential management api provides information about credentials from a federated identity provider. a federated identity provider is an entity that a website trusts to correctly authenticate a user, and that provides an api for that purpose. openid connect is an example of a federated identity provider framework. in browsers that support it, an instance of this interface may be passed in the credential member of the init object for global fetch. constructor federatedcredential() creates a new federatedcredential object. properties inherits properties from its ancestor, credential. federatedcredential.provider read only returns a usvstring containing a credential's federated identity provider. federatedcredential.protocol r...
FetchEvent - Web APIs
h in the cache, it asynchronously updates the cache for next time. self.addeventlistener('fetch', event => { // let the browser do its default thing // for non-get requests. if (event.request.method != 'get') return; // prevent the default, and handle the request ourselves. event.respondwith(async function() { // try to get the response from a cache. const cache = await caches.open('dynamic-v1'); const cachedresponse = await cache.match(event.request); if (cachedresponse) { // if we found a match in the cache, return it, but also // update the entry in the cache in the background. event.waituntil(cache.add(event.request)); return cachedresponse; } // if we didn't find a match in the cache, use the network. return fetch(event.req...
FileError - Web APIs
Web › API › FileError
mple, the state that was cached in an interface object has changed since it was last read from disk. no_modification_allowed_err 6 the state of the underlying file system prevents any writing to a file or a directory. not_found_err 1 a required file or directory could not be found at the time an operation was processed. for example, a file did not exist but was being opened. not_readable_err 4 the file or directory cannot be read, typically due to permission problems that occur after a reference to a file has been acquired (for example, the file or directory is concurrently locked by another application). path_exists_err 12 the file or directory with the same path already exists. quota_exceeded_err 10 either there's...
FileException - Web APIs
mple, the state that was cached in an interface object has changed since it was last read from disk. no_modification_allowed_err 6 the state of the underlying file system prevents any writing to a file or a directory. not_found_err 1 a required file or directory could not be found at the time an operation was processed. for example, a file did not exist but was being opened. not_readable_err 4 the file or directory cannot be read, typically due to permission problems that occur after a reference to a file has been acquired (for example, the file or directory is concurrently locked by another application). path_exists_err 12 the file or directory with the same path already exists. quota_exceeded_err 10 ...
FileSystemDirectoryEntry - Web APIs
ebkitrequestfilesystem; window.directoryentry = window.directoryentry || window.webkitdirectoryentry; ... function onfs(fs){ fs.root.getdirectory('documents', {create:true}, function(directoryentry){ //directoryentry.isfile === false //directoryentry.isdirectory === true //directoryentry.name === 'documents' //directoryentry.fullpath === '/documents' }, onerror); } // opening a file system with temporary storage window.requestfilesystem(temporary, 1024*1024 /*1mb*/, onfs, onerror); properties this interface has no properties of its own, but inherits properties from its parent interface, filesystementry. methods this interface inherits methods from its parent interface, filesystementry. createreader() creates a filesystemdirectoryreader object which can be u...
FileSystemEntrySync - Web APIs
es, but it also include a really handy method for getting a url of the entry: tourl(). it also introduces a new url scheme: filesystem:. you can use the filesystem: scheme on google chrome to see all the files and folders that are stored in the origin of your app. just use filesystem: scheme for the root directory of the origin of the app. for example, if your app is in http://ww.html5rocks.com, open filesystem:http://www.html5rocks.com/temporary/ in a tab. chrome shows a read-only list of all the files and folders stored the origin of your app. method overview metadata getmetadata () raises (fileexception); filesystementrysync moveto (in directoryentrysync parent, optional domstring newname) raises (fileexception); filesystementrysync copyto(in directoryentrysync...
FormDataEvent.formData - Web APIs
living standard ...
FormDataEvent - Web APIs
living standard ...
GlobalEventHandlers.oncontextmenu - Web APIs
ontextmenu = functionref; value functionref is a function name or a function expression. the function receives an event object as its sole argument. only one oncontextmenu handler can be assigned to an object at a time. you may prefer to use the eventtarget.addeventlistener() method instead, since it's more flexible. examples disabling context menus this snippet prevents context menus from opening in the window. the context menu typically appears upon a right click. html <p>try opening the context menu. is it disabled?<p> javascript window.oncontextmenu = (e) => { e.preventdefault(); } result pausing an animation this example pauses a spinning shape whenever you open the context menu. html <div class="shape">spinning</div> <p class="note" hidden>click to unpause.</p> css ...
GlobalEventHandlers.onformdata - Web APIs
living standard ...
GlobalEventHandlers.onpointerdown - Web APIs
tion, the event's preventdefault() method is called to ensure that the mouseup event isn't triggered unnecessarily. html the html is extremely simple: <div id="target"> tap me, click me, or touch me! </div> css the css simply sets up the appearance of the target, and doesn't affect its functionality at all. #target { width: 400px; height: 30px; text-align: center; font: 16px "open sans", "helvetica", sans-serif; color: white; background-color: blue; border: 2px solid darkblue; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; } result the resulting output is shown below. try tapping, clicking, or touching the box and see what happens. for full effect, try it with a variety of pointer types. s...
HTMLAreaElement - Web APIs
n mark '?'), if any, of the referenced url. htmlareaelement.shape is a domstring that reflects the shape html attribute, indicating the shape of the hot-spot, limited to known values. htmlelement.tabindex is a long containing the element's position in the tabbing order. htmlareaelement.target is a domstring that reflects the target html attribute, indicating the browsing context in which to open the linked resource. htmlareaelement.type is a domstring that reflects the type html attribute, indicating the mime type of the linked resource. htmlhyperlinkelementutils.username is a usvstring containing the username specified before the domain name. methods inherits methods from its parent, htmlelement, and implements those from htmlhyperlinkelementutils. htmlhyperlinkelementutils.to...
HTMLCanvasElement.getContext() - Web APIs
the drawing context associated to the canvas. possible values are: "2d", leading to the creation of a canvasrenderingcontext2d object representing a two-dimensional rendering context. "webgl" (or "experimental-webgl") which will create a webglrenderingcontext object representing a three-dimensional rendering context. this context is only available on browsers that implement webgl version 1 (opengl es 2.0). "webgl2" which will create a webgl2renderingcontext object representing a three-dimensional rendering context. this context is only available on browsers that implement webgl version 2 (opengl es 3.0). "bitmaprenderer" which will create an imagebitmaprenderingcontext which only provides functionality to replace the content of the canvas with a given imagebitmap. note: the i...
HTMLCanvasElement.mozFetchAsStream() - Web APIs
...
HTMLDetailsElement: toggle event - Web APIs
the toggle event fires when the open/closed state of a <details> element is toggled. bubbles no cancelable no interface event event handler property none default action toggles the open state of the <details> element. examples this example logs chapters that are open. chapters are removed from the log when they are closed. html <aside id="log"> <b>open chapters:</b> <div data-id="ch1" hidden>i</div> <div data-id="ch2" hidden>ii</div> <div data-id="ch3" hidden>iii</div> </aside> <section id="summaries"> <b>chapter summaries:</b> <details id="ch1"> <summary>chapter i</summary> philosophy reproves boethius for the foolishness of his complaints against fortune. her very nature is caprice. </details> <de...
HTMLDetailsElement - Web APIs
"50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="91" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmldetailselement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmldetailselement.open is a boolean reflecting the open html attribute, indicating whether or not the element’s contents (not counting the <summary>) is to be shown to the user. methods no specific method; inherits methods from its parent, htmlelement. events listen to this event using addeventlistener() or by assigning an event listener to the oneventname property of this interface. toggle fired when the o...
HTMLFormElement: formdata event - Web APIs
ject, which fires the formdata event new formdata(formelem); }); // formdata handler to retrieve data formelem.addeventlistener('formdata', (e) => { console.log('formdata fired'); // get the form data from the event object let data = e.formdata; for (var value of data.values()) { console.log(value); } // submit the data via xhr var request = new xmlhttprequest(); request.open("post", "/formhandler"); request.send(data); }); the onformdata version would look like this: formelem.onformdata = (e) => { console.log('formdata fired'); // get the form data from the event object let data = e.formdata; for (var value of data.values()) { console.log(value); } // submit the data via xhr var request = new xmlhttprequest(); request.open("post", "/formhand...
HTMLImageElement.alt - Web APIs
for this example simply sets up the styles for the layout as shown in the result below. they're not crucial to the concept shown in the html above, but you may expand the view below if you wish to read the css used. view the css editors: if you change the css below, please be sure to close the details box using the toggle at the top of the css view before saving. otherwise, readers will find it open by default, which is not the intent here. body { margin: 0; padding: 0; } p { margin-block-start: 0; margin-block-end: 1em; margin-top: 0; margin-bottom: 1em; } .container { width: 100vh; height: 95vh; font: 16px arial,helvetica,sans-serif; } .left-margin { background-color: rgb(241, 240, 237, 255); width: 9em; height: 100%; float: left; margin-right: 5px; paddin...
HTMLImageElement.complete - Web APIs
iously determined that the image is fully available and ready for use. the image is "broken;" that is, the image failed to load due to an error or because image loading is disabled. it's worth noting that due to the image potentially being received asynchronously, the value of complete may change while your script is running. examples consider a photo library app that provides the ability to open images into a lightbox mode for improved viewing as well as editing of the image. these photos may be very large, so you don't want to wait for them to load, so your code uses async/await to load the images in the background. but imagine that you have other code that needs to only run when the image has completed loading, such as a command that performs red-eye removal on the image in the lightb...
HTMLImageElement.sizes - Web APIs
dth: 30em) 20em"> <p>then there's even more amazing stuff to say down here. ...
In depth: Microtasks and the JavaScript runtime environment - Web APIs
the event loop so that their tasks take turns with the processor, one after another. keep in mind that web parlance, the word "window" actually means "browser-level container that web content runs within," including an actual window, a tab, or a frame. there are specific circumstances in which this sharing of an event loop among windows with a common origin is possible, such as: if one window opened the other window, they are likely to be sharing an event loop. if a window is actually a container within an <iframe>, it likely shares an event loop with the window that contains it. the windows happen to share the same process in a multi-process web browser implementation. the specifics may vary from browser to browser, depending on how they're implemented. tasks vs microtasks a task is...
Drag Operations - Web APIs
is has the effect of inserting the dragged text where it was dropped, assuming that the drop target is an area of text such as a p or div element. in a web page, you should call the preventdefault() method of the event if you have accepted the drop, so that the browser's default handling is not triggered by the dropped data as well. for example, when a link is dragged to a web page, firefox will open the link. by cancelling the event, this behavior will be prevented. you can retrieve other types of data as well. if the data is a link, it should have the type text/uri-list. you could then insert a link into the content. function dodrop(event) { const lines = event.datatransfer.getdata("text/uri-list").split("\n"); lines.filter(line => !line.startswith("#")) .foreach(line => { c...
IDBCursor.advance() - Web APIs
Web › API › IDBCursor › advance
that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. ...
IDBCursor.continue() - Web APIs
rab all of it. also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. ...
IDBCursor.continuePrimaryKey() - Web APIs
ion and this cursor's direction is prev or prevunique. invalidstateerror the cursor is currently being iterated or has iterated past its end. invalidaccesserror the cursor's direction is not prev or next. ...
IDBCursor.key - Web APIs
Web › API › IDBCursor › key
rab all of it. also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. ...
IDBCursor.primaryKey - Web APIs
rab all of it. also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. ...
IDBCursor.source - Web APIs
Web › API › IDBCursor › source
rab all of it. also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. ...
IDBCursor - Web APIs
Web › API › IDBCursor
rab all of it. also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. ...
IDBCursorWithValue.value - Web APIs
rab all of it. also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. ...
IDBCursorWithValue - Web APIs
rab all of it. also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. ...
IDBDatabase.createObjectStore() - Web APIs
ed in this case as well, which was misleading; this has now been fixed (see bug 1176165.) constrainterror an object store with the given name (based on case-sensitive comparison) already exists in the connected database. invalidaccesserror if autoincrement is set to true and keypath is either an empty string or an array containing an empty string. example // let us open our database var request = window.indexeddb.open("todolist", 4); // this handler is called when a new version of the database // is created, either when one has not been created before // or when a new version number is submitted by calling // window.indexeddb.open(). // this handler is only supported in recent browsers. request.onupgradeneeded = function(event) { var db = event.target.result;...
IDBDatabase.deleteObjectStore() - Web APIs
esn't exist (e.g. has been deleted or removed.) in firefox previous to version 41, an invalidstateerror was raised in this case as well, which was misleading; this has now been fixed (see bug 1176165.) notfounderror you are trying to delete an object store that does not exist. names are case sensitive. example var dbname = "sampledb"; var dbversion = 2; var request = indexeddb.open(dbname, dbversion); request.onupgradeneeded = function(e) { var db = request.result; if (e.oldversion < 1) { db.createobjectstore("store1"); } if (e.oldversion < 2) { db.deleteobjectstore("store1"); db.createobjectstore("store2"); } // etc. for version < 3, 4... }; specification specification status comment indexed database api 2.0the definitio...
IDBDatabase.onclose - Web APIs
the close event is fired after all transactions have been aborted and the connection has been closed. note: this feature is available in web workers. syntax idbdatabase.onclose = function(event) { ... ...
IDBEnvironment - Web APIs
functionality. it is the top level indexeddb interface implemented by the window and worker objects. note: this feature is available in web workers. properties idbenvironment.indexeddb read only provides a mechanism for applications to asynchronously access capabilities of indexed databases; contains an idbfactory object. example the following code creates a request for a database to be opened asychronously, after which the database is opened when the request's onsuccess handler is fired: var db; function opendb() { var dbopenrequest = window.indexeddb.open("todolist"); dbopenrequest.onsuccess = function(e) { db = dbopenrequest.result; }; } browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data,...
IDBLocaleAwareKeyRange - Web APIs
sn’t do the aforementioned check. developers should always use idblocaleawarekeyrange when dealing with locale-aware indexes. ...
IDBMutableFile - Web APIs
g the idbdatabase.createmutablefile method. properties mutablefile.name read only the name of the handled file. mutablefile.type read only the mime type of the handled file. events handler mutablefile.onabort the abort event is triggered each time the handled file is aborted. mutablefile.onerror the error event is triggered each time something goes wrong. methods mutablefile.open() returns a lockedfile object to read or write the associated file safely. mutablefile.getfile() returns a domrequest object. in case of success, the request's result is a file object representing a snapshot of the handled file. specifications not part of any specification at present. see also lockedfile file ...
IDBObjectStore.getAll() - Web APIs
ore matching the specified parameter or all objects in the store if no parameters are given. if a value is successfully found, then a structured clone of it is created and set as the result of the request object. this method produces the same result for: a record that doesn't exist in the database a record that has an undefined value to tell these situations apart, you either call the opencursor() method with the same key. that method provides a cursor if the record exists, and no cursor if it does not. the count() method with the same key, which will return 1 if the row exists and 0 if it doesn't. syntax var request = objectstore.getall(); var request = objectstore.getall(query); var request = objectstore.getall(query, count); parameters query optional a key or idbkeyrang...
IDBObjectStore.getAllKeys() - Web APIs
store matching the specified parameter or all objects in the store if no parameters are given. if a value is successfully found, then a structured clone of it is created and set as the result of the request object. this method produces the same result for: a record that doesn't exist in the database a record that has an undefined value to tell these situations apart, you need to call the opencursor() method with the same key. that method provides a cursor if the record exists, and no cursor if it does not. syntax var request = objectstore.getallkeys(); var request = objectstore.getallkeys(query); var request = objectstore.getallkeys(query, count); parameters query optional a value that is or resolves to an idbkeyrange. count optional specifies the number of values to return i...
IDBRequest.onerror - Web APIs
ated record from the idbobjectstore (made available as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store. also included at the bottom is an onerror function that reports what the error was if the request fails. ...
IDBRequest.onsuccess - Web APIs
(event) { ... }; example the following example requests a given record title, onsuccess gets the associated record from the idbobjectstore (made available as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store. ...
IDBRequest.readyState - Web APIs
gets the associated record from the idbobjectstore (made available as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store in another request. the readystate of the 2nd request is logged to the developer console. ...
IDBRequest.result - Web APIs
Web › API › IDBRequest › result
ult; value any example the following example requests a given record title, onsuccess gets the associated record from the idbobjectstore (made available as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store. ...
IDBVersionChangeEvent.oldVersion - Web APIs
the oldversion read-only property of the idbversionchangeevent interface returns the old version number of the database. when the opened database doesn't exist yet, the value of oldversion is 0. note: this feature is available in web workers. syntax var oldversion = idbversionchangeevent.oldversion value a 64-bit integer. example var dbname = "sampledb"; var dbversion = 2; var request = indexeddb.open(dbname, dbversion); request.onupgradeneeded = function(e) { var db = request.result; if (e.oldversion < 1) { db.createobjectstore("store1"); } if (e.oldversion < 2) { db.deleteobjectstore("store1"); db.createobjectstore("store2"); } // etc. for version < 3, 4... }; specifications specification status comment indexed database api 2.0t...
IDBVersionChangeRequest.setVersion() - Web APIs
database, returning immediately and running a versionchange transaction on the connected database in a separate thread. for older webkit browsers, call this method before creating or deleting an object store. warning: the latest draft of the specification has dropped this method. some not up-to-date browsers still implement this method. the new way is to define the version in the idbdatabase.open() method and create and delete object stores in the onupgradeneeded event handler associated with the returned request. syntax idbversionchangerequest setversion ([treatnullas=emptystring] in domstring version); example tbd parameters version the version to store in the database. returns idbversionchangerequest the request to change the version of a database. browser compatibili...
IDBVersionChangeRequest - Web APIs
the idbversionchangerequest interface the indexeddb api represents a request to change the version of a database. it is used only by the setversion() method of idbdatabase. ...
InstallEvent - Web APIs
rrent_caches = { prefetch: 'prefetch-cache-v' + cache_version }; self.addeventlistener('install', function(event) { var urlstoprefetch = [ './static/pre_fetched.txt', './static/pre_fetched.html', 'https://www.chromium.org/_/rsrc/1302286216006/config/customlogo.gif' ]; console.log('handling install event. ...
Timing element visibility with the Intersection Observer API - Web APIs
l be populated using script later. styling the site with css with the structure of the site defined, we turn to the styling for the site. let's look at the style for each component of the page individually. the basics we provide styles for the <body> and <main> elements to define the site's background as well as the grid the various parts of the site will be placed in. ...
Intersection Observer API - Web APIs
: 700px; height: 1725px; } .wrapper { position: relative; top: 600px; } .samplebox { position: relative; left: 175px; width: 150px; background-color: rgb(245, 170, 140); border: 2px solid rgb(201, 126, 17); padding: 4px; margin-bottom: 6px; } #box1 { height: 200px; } #box2 { height: 75px; } #box3 { height: 150px; } #box4 { height: 100px; } .label { font: 14px "open sans", "arial", sans-serif; position: absolute; margin: 0; background-color: rgba(255, 255, 255, 0.7); border: 1px solid rgba(0, 0, 0, 0.7); width: 3em; height: 18px; padding: 2px; text-align: center; } .topleft { left: 2px; top: 2px; } .topright { right: 2px; top: 2px; } .bottomleft { bottom: 2px; left: 2px; } .bottomright { bottom: 2px; right: 2px; } let ob...
LockedFile - Web APIs
do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. summary the lockedfile interface provides tools to deal with a given file with all the necessary locks. properties lockedfile.filehandle read only the filehandle object from which the lock was opened. lockedfile.mode read only the mode for accessing the file; can be readonly or readwrite. lockedfile.active read only a flag indicating if the file can be accessed (true) or not (false). lockedfile.location the position of the reading/writing pointer within the file. events handler lockedfile.oncomplete the complete event is triggered each time a read or write operation is success...
MSCandidateWindowShow - Web APIs
ime candidate window has been determined. you can obtain the positioning information using the getcandidatewindowclientrect method, and adjust your layout as needed to avoid any occlusions with the ime candidate window. web applications need only register for this event once per element (the handler will remain valid for the lifetime of the element). ...
MediaDevices.getUserMedia() - Web APIs
, how they are reflected in the context in which your code is running, and about how browsers manage user privacy and security issues, read on. user privacy as an api that may involve significant privacy concerns, getusermedia() is held by the specification to very specific requirements for user notification and permission management. first, getusermedia() must always get user permission before opening any media gathering input such as a webcam or microphone. browsers may offer a once-per-domain permission feature, but they must ask at least the first time, and the user must specifically grant ongoing permission if they choose to do so. of equal importance are the rules around notification. browsers are required to display an indicator that shows that a camera or microphone is in use, above...
MediaSource.isTypeSupported() - Web APIs
/ need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource; //console.log(mediasource.readystate); // closed video.src = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); video.play(); ...
Recording a media element - Web APIs
back the recorded video. notice that the playback panel doesn't have autoplay set (so the playback doesn't start as soon as media arrives), and it has controls set, which tells it to show the user controls to play, pause, and so forth. below the playback element is a button for downloading the recorded video. ...
Media Session API - Web APIs
the media session api provides a way to customize media notifications. it does this by providing metadata for display by the user agent of the media your web app is playing, and allows you to create event handlers, to define your own behaviors for a user-agent playback controls. the aim of this is allowing users to know what's playing, and to control it, without opening the specific page that launched it. media session concepts and usage the mediametadata interface lets a web site provide rich metadata to the platform ui for media that is playing. this metadata includes the title, artist (creator) name, album (collection), and artwork. the platform can show this metadata in media centers, notifications, device lockscreens, etc. the mediasession interface lets users control playback of medi...
Media Source API - Web APIs
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. it can however support significantly more client connections than webrtc. 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. interfaces mediasource represents a media source to be played via an htmlmediaelement object. sourcebuffer represents a chunk of media to be passed into an htmlmediaelement via a mediasource object. sourcebufferlist a simple container list for multi...
Capabilities, constraints, and settings - Web APIs
</div> <div class="rightside"> <h3>actual audio settings:</h3> <textarea id="audiosettingstext" cols=32 rows=8 disabled></textarea> </div> </div> <div class="button" id="applybutton"> apply constraints </div> </div> <video id="video" autoplay></video> <div class="button" id="stopbutton"> stop video </div> <div id="log"> </div> css content body { font: 14px "open sans", "arial", sans-serif; } video { margin-top: 20px; border: 1px solid black; } .button { cursor: pointer; width: 150px; border: 1px solid black; font-size: 16px; text-align: center; padding-top: 2px; padding-bottom: 4px; color: white; background-color: darkgreen; } .wrapper { margin-bottom: 10px; width: 600px; } .trackrow { height: 200px; } .leftside { float...
MouseEvent.metaKey - Web APIs
note: on macintosh keyboards, this key is the command key (⌘). ...
MouseEvent.pageX - Web APIs
Web › API › MouseEvent › pageX
is given the class "box". it has two <span> elements, one with the id "x" and one with the id "y". those will be updated each time an event occurs to contain the latest mouse coordinates relative to the page. css the css used for this example is shown below. .box { width: 400px; height: 250px; border: 2px solid darkblue; background-color: blue; color: white; font: 16px "zilla", "open sans", "helvetica", "arial", sans-serif; } result try this out here: specifications specification status comment css object model (cssom) view modulethe definition of 'pagex' in that specification. working draft redefined from long to double. touch eventsthe definition of 'pagex' in that specification. unknown initial definition. prior to...
Navigator.msLaunchUri() - Web APIs
. usage notes if a default protocol handler is available on the system that matches the uri, the successcallback is invoked, otherwise, the nohandlercallback is called. to help protect a user's privacy, windows displays a prompt for the user to allow the service or app to be launched. the user can choose to not see the prompt after the first instance for a particular protocol and automatically open the app or service without a user intervention. the mslaunchuri() method does not support http, secure hypertext transfer protocol (https), file transfer protocol (ftp), file, res, javascript, or microsoft visual basic scripting edition (vbscript) protocols. if the user's system does not have a program registered to handle a specific protocol, and a nohandlercallback is provided, windows interne...
Navigator.sendBeacon() - Web APIs
t page can do to avoid this, so the new page seems slow, even though it's the previous page's fault. the following example shows theoretical analytics code that attempts to submit data to a server with a synchronous xmlhttprequest in an unload handler. this results in the next page load to be delayed. window.addeventlistener("unload", function logdata() { var xhr = new xmlhttprequest(); xhr.open("post", "/log", false); // third parameter of `false` means synchronous xhr.send(analyticsdata); }); this is what sendbeacon() replaces. with the sendbeacon() method, the data is transmitted asynchronously when the user agent has an opportunity to do so, without delaying unload or the next navigation. this solves all of the problems with submission of analytics data: the data is sent relia...
Node.firstChild - Web APIs
Web › API › Node › firstChild
this example demonstrates the use of firstchild and how whitespace nodes might interfere with using this property. <p id="para-01"> <span>first span</span> </p> <script> var p01 = document.getelementbyid('para-01'); console.log(p01.firstchild.nodename); </script> in the above, the console will show '#text' because a text node is inserted to maintain the whitespace between the end of the opening <p> and <span> tags. any whitespace will create a #text node, from a single space to multiple spaces, returns, tabs, and so on. another #text node is inserted between the closing </span> and </p>tags. if this whitespace is removed from the source, the #text nodes are not inserted and the span element becomes the paragraph's first child. <p id="para-01"><span>first span</span></p> <script> ...
Node.getRootNode() - Web APIs
Web › API › Node › getRootNode
t> // works on chrome 54+,opera 41+ var parent = document.queryselector('.js-parent'), child = document.queryselector('.js-child'), shadowhost = document.queryselector('.js-shadowhost'); console.log(parent.getrootnode().nodename); // #document console.log(child.getrootnode().nodename); // #document // create a shadowroot var shadowroot = shadowhost.attachshadow({mode:'open'}); shadowroot.innerhtml = '<style>div{background:#2bb8aa;}</style>' + '<div class="js-shadowchild">content</div>'; var shadowchild = shadowroot.queryselector('.js-shadowchild'); // the default value of composed is false console.log(shadowchild.getrootnode() === shadowroot); // true console.log(shadowchild.getrootnode({composed:false}) === shadowroot); // true console.log(shado...
Node.isConnected - Web APIs
Web › API › Node › isConnected
s true if the node is connected to its relevant context object, and false if not. ...
Node.nextSibling - Web APIs
Web › API › Node › nextSibling
pend(); </script> /************************************************** the console displays the following: siblings of div-1 1. #text 2. div 3. #text 4. script **************************************************/ in the above example, #text nodes are inserted in the dom where whitespace occurs between tags (i.e. after the closing tag of an element and before the opening tag of the next). the possible inclusion of text nodes must be allowed for when traversing the dom using nextsibling. see the resources in the notes section. specifications specification status comment domthe definition of 'node.nextsibling' in that specification. living standard no change document object model (dom) level 2 core specificationthe d...
NotificationEvent.action - Web APIs
ray attribute and can't be modified unless the notification is replaced. returns a domstring object. example self.registration.shownotification("new articles available", { actions: [{action: "get", title: "get now."}] }); self.addeventlistener('notificationclick', function(event) { event.notification.close(); if (event.action === 'get') { synchronizereader(); } else { clients.openwindow("/reader"); } }, false); specifications specification status comment notifications apithe definition of 'action' in that specification. living standard living standard. ...
OfflineAudioContext.startRendering() - Web APIs
github repo (see the source code too.) // define online and offline audio context var audioctx = new audiocontext(); var offlinectx = new offlineaudiocontext(2,44100*40,44100); source = offlinectx.createbuffersource(); // use xhr to load an audio track, and // decodeaudiodata to decode it and offlineaudiocontext to render it 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; source.connect(offlinectx.destination); source.start(); //source.loop = true; offlinectx.startrendering().then(function...
OfflineAudioContext - Web APIs
github repo (see the source code too.) // define online and offline audio context var audioctx = new audiocontext(); var offlinectx = new offlineaudiocontext(2,44100*40,44100); source = offlinectx.createbuffersource(); // use xhr to load an audio track, and // decodeaudiodata to decode it and offlineaudiocontext to render it 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; source.connect(offlinectx.destination); source.start(); //source.loop = true; offlinectx.startrendering().then(function...
OffscreenCanvas.getContext() - Web APIs
a domstring containing the context identifier defining the drawing context associated to the canvas. possible values are: "2d" creates a canvasrenderingcontext2d object representing a two-dimensional rendering context. "webgl" creates a webglrenderingcontext object representing a three-dimensional rendering context. this context is only available on browsers that implement webgl version 1 (opengl es 2.0). "webgl2" creates a webgl2renderingcontext object representing a three-dimensional rendering context. this context is only available on browsers that implement webgl version 2 (opengl es 3.0). "bitmaprenderer" creates a imagebitmaprenderingcontext which only provides functionality to replace the content of the canvas with a given imagebitmap. note: the identifiers "expe...
PaymentRequestEvent - Web APIs
ing changes to payment details. paymentrequestidread only returns the id of the paymentrequest object. paymentrequestoriginread only returns the origin where the paymentrequest object was initialized. toporiginread only returns the top-level origin where the paymentrequest object was initialized. totalread only returns the total amount being requested for payment. methods openwindow() opens the specified url in a new window, if and only if the given url is on the same origin as the calling page. it returns a promise that resolves with a reference to a windowclient. respondwith() prevents the default event handling and allows you to provide a promise for a paymentresponse object yourself. specifications specification status comment paymen...
performance.clearResourceTimings() - Web APIs
size of the browser's performance data buffer, use the performance.setresourcetimingbuffersize() method. note: this feature is available in web workers. syntax performance.clearresourcetimings(); arguments void return value none this method has no return value. ...
PerformanceTiming.connectEnd - Web APIs
this interface of this property is deprecated in the navigation timing level 2 specification. please use the performancenavigationtiming interface instead. the legacy performancetiming.connectend read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, where the connection is opened network. if the transport layer reports an error and the connection establishment is started again, the last connection establisment end time is given. if a persistent connection is used, the value will be the same as performancetiming.fetchstart. a connection is considered as opened when all secure connection handshake, or socks authentication, is terminated. syntax time = performancetiming.connectend; specifications specification status ...
PerformanceTiming.connectStart - Web APIs
this interface of this property is deprecated in the navigation timing level 2 specification. please use the performancenavigationtiming interface instead. the legacy performancetiming.connectstart read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, where the request to open a connection is sent to the network. if the transport layer reports an error and the connection establishment is started again, the last connection establisment start time is given. if a persistent connection is used, the value will be the same as performancetiming.fetchstart. syntax time = performancetiming.connectstart; specifications specification status comment navigation timingthe definition of 'performancetiming.connectstart' i...
PerformanceTiming.requestStart - Web APIs
please use the performancenavigationtiming interface instead. the legacy performancetiming.requeststart read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, when the browser sent the request to obtain the actual document, from the server or from a cache. if the transport layer fails after the start of the request and the connection is reopened, this property will be set to the time corresponding to the new request. syntax time = performancetiming.requeststart; specifications specification status comment navigation timingthe definition of 'performancetiming.requeststart' in that specification. recommendation initial definition. ...
Pinch zoom gestures - Web APIs
buttons to enable logging and to clear the log. to prevent the browser's default touch behavior from overriding this application's pointer handling, the touch-action property is applied to the <body> element. ...
ProgressEvent - Web APIs
erits methods from its parent event. progressevent.initprogressevent() initializes a progressevent created using the deprecated document.createevent("progressevent") method. examples the following example adds a progressevent to a new xmlhttprequest and uses it to display the status of the request. var progressbar = document.getelementbyid("p"), client = new xmlhttprequest() client.open("get", "magical-unicorns") client.onprogress = function(pe) { if(pe.lengthcomputable) { progressbar.max = pe.total progressbar.value = pe.loaded } } client.onloadend = function(pe) { progressbar.value = pe.loaded } client.send() specifications specification status comment xmlhttprequestthe definition of 'progressevent' in that specification. living stand...
PushManager.subscribe() - Web APIs
key is not the same ecdh key that you use to encrypt the data. for more information, see "using vapid with webpush". note: this parameter is required in some browsers like chrome and edge. returns a promise that resolves to a pushsubscription object. example this.onpush = function(event) { console.log(event.data); // from here we can write the data to indexeddb, send it to any open // windows, display a notification, etc. } navigator.serviceworker.register('serviceworker.js'); // use serviceworker.ready to ensure that you can subscribe for push navigator.serviceworker.ready.then( function(serviceworkerregistration) { var options = { uservisibleonly: true, applicationserverkey: applicationserverkey }; serviceworkerregistration.pushmanager.subscr...
PushManager - Web APIs
xisting push subscriptions. replaced by pushmanager.getsubscription(). pushmanager.unregister() unregisters and deletes a specified subscription endpoint. in the updated api, a subscription is unregistered by calling the pushsubscription.unsubscribe() method. example this.onpush = function(event) { console.log(event.data); // from here we can write the data to indexeddb, send it to any open // windows, display a notification, etc. } navigator.serviceworker.register('serviceworker.js').then( function(serviceworkerregistration) { serviceworkerregistration.pushmanager.subscribe().then( function(pushsubscription) { console.log(pushsubscription.endpoint); // the push subscription details needed by the application // server are now available, and can...
Web Push API Notifications best practices - Web APIs
am to communicate, but today you’re happily working somewhere, and problem comes up. say your program manager found a hiccup in the approvals and wants to get your feedback on something before she proceeds. after a few failed attempts to get your attention, they send you an email, and your email app produces a push notification that successfully alerts you, even though your mail web app is not open. in this document, we’ll talk about the ethical use of web push notifications. sometimes they can eliminate frustration and annoyance, and sometimes they can cause them, and it’s up to you as a developer to make wise recommendations (and decisions) about the use of push notifications. what are you hoping to achieve with this push notification? as with everything, with great power comes gre...
RTCConfiguration.iceServers - Web APIs
formance and how many servers get used for negotiation before a connection is established. if the list of servers is changed while a connection is already active by calling the the rtcpeerconnection method setconfiguration(), no immediate effect occurs. however, the new list of servers is used for any future renegotiation, such as while handling an ice restart. examples the configuration below opens a new peer connection, specifying two servers for the ice agent to use for negotiation. the first one, stun:stun.services.mozilla.com, requires authentication, so the username and password are provided. the second server has two urls: stun:stun.example.com and stun:stun-1.example.com. var configuration = { iceservers: [{ urls: "stun:stun.services.mozilla.com", ...
RTCDTMFSender.toneBuffer - Web APIs
o throw an invalidcharactererror exception. using tone buffer strings for example, if you're writing code to control a voicemail system by sending dtmf codes, you might use a string such as "*,1,5555". in this example, we would send "*" to request access to the vm system, then, after a pause, send a "1" to start playback of voicemail messages, then after a pause, dial "5555" as a pin number to open the messages. settting the tone buffer to an empty string ("") cancels any pending dtmf codes. example tbd specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdtmfsender.tonebuffer' in that specification. candidate recommendation ...
RTCDataChannel.close() - Web APIs
tachannel until firefox 24, so this method was called datachannel.close(). syntax rtcdatachannel.close(); parameters none. return value undefined. example var pc = new rtcpeerconnection(); var dc = pc.createdatachannel("my channel"); dc.onmessage = function (event) { console.log("received: " + event.data); dc.close(); // we decided to close after the first received message }; dc.onopen = function () { console.log("datachannel open"); }; dc.onclose = function ( console.log("datachannel close"); }; // now negotiate the connection and so forth... specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdatachannel.close()' in that specification. candidate recommendation initial ...
RTCDataChannelEvent.channel - Web APIs
el linking the receiving rtcpeerconnection to its remote peer. example the first line of code in the datachannel event handler shown below takes the channel from the event object and saves it locally for use by the code handling data traffic. pc.ondatachannel = function(event) { inbounddatachannel = event.channel; inbounddatachannel.onmessage = handleincomingmessage; inbounddatachannel.onopen = handlechannelopen; inbounddatachannel.onclose = handlechannelclose; } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdatachannelevent.channel' in that specification. candidate recommendation initial specification. ...
RTCIceCandidate.protocol - Web APIs
usage notes here's an example candidate a-line from an ice transaction: a=candidate:4234997325 1 udp 2043278322 192.168.0.56 44323 typ host the third field, "udp", is the protocol type, indicating that the candidate would use the udp transport protocol. example this code snippet examines the value of protocol to decide if it should look at the value of tcptype to see if it's a simultaneous-open (s-o) candidate. if (candidate.protocol == "tcp") { if (candidate.tcptype == "so") { adjustforsimultaneousopen(candidate); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecandidate.protocol' in that specification. candidate recommendation initial definition. ...
RTCIceCandidatePairStats.currentRoundTripTime - Web APIs
the pair of candidates for which this rtcicecandidatepairstats object offers statistics. this value is computed by observing the time that elapsed between the most recent stun request being sent to the remote peer and the response to that request arriving. this information may come from ongoing stun connectivity checks as well as from consent requests made when the connection was initially being opened. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatepairstats.currentroundtriptime' in that specification. candidate recommendation initial specification. ...
RTCIceCandidatePairStats - Web APIs
esreceived is 0. consentrequestssent optional the total number of consent requests that have been sent on this candidate pair. currentroundtriptime optional a floating-point value indicating the total time, in seconds, that elapsed elapsed between the most recently-sent stun request and the response being received. this may be based upon requests that were involved in confirming permission to open the connection. firstrequesttimestamp optional a domhighrestimestamp value which specifies the time at which the first stun request was sent from the local peer to the remote peer for this candidate pair. lastpacketreceivedtimestamp optional a domhighrestimestamp value indicating the time at which the last packet was received by the local peer from the remote peer for this candidate pair. tim...
RTCPeerConnection.close() - Web APIs
nection before attempting to create a new one that connects to the same remote peer, as not doing so might result in some errors depending on the browser. example var pc = new rtcpeerconnection(); var dc = pc.createdatachannel("my channel"); dc.onmessage = function (event) { console.log("received: " + event.data); pc.close(); // we decided to close after the first received message }; dc.onopen = function () { console.log("datachannel open"); }; dc.onclose = function () { console.log("datachannel close"); }; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.close()' in that specification. candidate recommendation initial specification. ...
RTCPeerConnection.removeTrack() - Web APIs
he remote peer won't experience the change until this negotiation occurs. a negotiationneeded event is sent to the rtcpeerconnection to let the local end know this negotiation must occur. syntax pc.removetrack(sender); parameters mediatrack a rtcrtpsender specifying the sender to remove from the connection. return value undefined. exceptions invalidstateerror the connection is not open. example this example adds a video track to a connection and sets up a listener on a close button which removes the track when the user clicks the button. var pc, sender; navigator.getusermedia({video: true}, function(stream) { pc = new rtcpeerconnection(); var track = stream.getvideotracks()[0]; sender = pc.addtrack(track, stream); }); document.getelementbyid("closebutton").addeventli...
RTCPeerConnection.sctp - Web APIs
for any and all rtcdatachannels on the peer connection. syntax var sctp = rtcpeerconnection.sctp; value a rtcsctptransport object describing the sctp transport being used by the rtcpeerconnection for transmitting and receiving on its data channels, or null if sctp negotiation hasn't happened. ...
RTCPeerConnection.setLocalDescription() - Web APIs
ng for the actual setting to be done: in case of success, the successcallback will be called; in case of failure, the errorcallback will be called. deprecated exceptions when using the deprecated callback-based version of setlocaldescription(), the following exceptions may occur: invalidstateerror the connection's signalingstate is "closed", indicating that the connection is not currently open, so negotiation cannot take place. invalidsessiondescriptionerror the rtcsessiondescription specified by the sessiondescription parameter is invalid. examples implicit descriptions one of the advantages of the parameter-free form of setlocaldescription() is that it lets you simplify your negotiation code substantially. this is all your negotiationneeded event handler needs to look like, f...
RTCPeerConnection.setRemoteDescription() - Web APIs
hout waiting for the actual setting to be done: in case of success, the successcallback will be called; in case of failure, the errorcallback will be called. exceptions when using the deprecated callback-based version of setremotedescription(), the following exceptions may occur: invalidstateerror the connection's signalingstate is "closed", indicating that the connection is not currently open, so negotiation cannot take place. invalidsessiondescriptionerror the rtcsessiondescription specified by the sessiondescription parameter is invalid. example here we see a function which handles an offer received from the remote peer. this code is derived from the example and tutorial in the article signaling and video calling; take a look at that for more details and a more in-depth expla...
RTCPeerConnection - Web APIs
nges value. a track is isolated if its content cannot be accessed by the owning document due to lack of authentication or if the track comes from a cross-origin source. also available through the onisolationchange event handler property. negotiationneeded sent to the rtcpeerconnection when negotiation or renegotiation of the ice connection needs to be performed; this can happen both when first opening a connection as well as when it's neccessary to adapt to changing network conditions. the receiver should respond by creating an offer and sending it to the other peer. also available as the onnegotiationneeded event handler property. signalingstatechange the signalingstatechange event is sent to the rtcpeerconnection when the connection's ice signaling state changes. also available throug...
RTCPeerConnectionIceErrorEvent.address - Web APIs
network interfaces available: the cellular connection and a wifi connection. if the local ip address isn't exposed as part of a local candidate, the value of address is null. examples this example creates a handler for icecandidateerror events which creates human readable messages describing the local network interface for the connection as well as the ice server that was being used to try to open the connection, then calls a function to display those as well as the event's errortext property's contents. pc.addeventlistener("icecandidateerror", (event) => { let networkinfo = `[local interface: ${event.address}:${event.port}`; let iceserverinfo = `[ice server: ${event.url}`; showmessage(errortext, iceserverinfo, networkinfo); }); specifications specification status ...
RTCRtpTransceiver.setCodecPreferences() - Web APIs
the rtcrtptransceiver method setcodecpreferences() configures the transceiver's codecs given a list of rtcrtpcodeccapability objects specifying the new preferences for each codec. the specified set of codecs and configurations will be used for all future connections including this transceiver until this method is called again. when preparing to open an rtcpeerconnection, you can change the codec parameters from the user agent's default configuration by calling setcodecparameters() before calling either rtcpeerconnection.createoffer() or createanswer(). a guide to codecs supported by webrtc—and each codec's positive and negative characteristics—can be found in codecs used by webrtc. syntax rtcrtptransceiver.setcodecpreferences(codecs) parameters codecs an array of rtcrtpcodeccap...
RTCSctpTransport.state - Web APIs
e rtcsctptransport interface provides information which describes a stream control transmission protocol (sctp) transport state. syntax var mystate = sctptransport.state; value a string whose value is taken from the rtcsctptransportstate enumerated type. its value is one of the following: connecting the initial state when the connection is being estabilished. connected the connection is open for data transmission. closed the connection is closed and can no longer be used. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcsctptransport.state' in that specification. candidate recommendation initial definition. ...
RTCSctpTransport - Web APIs
property. possibly the most useful property on this interface is its maxmessagesize property, which you can use to determine the upper limit on the size of messages you can send over a data channel on the peer connection. properties also inherits properties from: eventtarget rtcsctptransport.maxchannelsread only an integer value indicating the maximum number of rtcdatachannels that can be open simultaneously. rtcsctptransport.maxmessagesizeread only an integer value indicating the maximum size, in bytes, of a message which can be sent using the rtcdatachannel.send() method. rtcsctptransport.stateread only a domstring enumerated value indicating the state of the sctp transport. rtcsctptransport.transportread only an rtcdtlstransport object representing the dtls transport used f...
Using the Resource Timing API - Web APIs
s full. the following code example sets a onresourcetimingbufferfull event callback in the init() function. ...
SVGAElement.target - Web APIs
the svgaelement.target read-only property of svgaelement returns an svganimatedstring object that specifies the portion of a target window, frame, pane into which a document is to be opened when a link is activated. this property is used when there are multiple possible targets for the ending resource, like when the parent document is a mlti-frame html or xhtml document. syntax mylink.target = 'value'; value an svganimatedstring indicating the ending resource target that opens the document when the link is activated. sample values can be found here example the code is taken from the "svgaelement example code" ... var linkref = document.queryselector('a'); linkref.target ='_blank'; ... specifications specification status comment scalable vector graphics (sv...
ScriptProcessorNode.bufferSize - Web APIs
er source var audioctx = new audiocontext(); source = audioctx.createbuffersource(); // create a scriptprocessornode with a buffersize of 4096 and a single input and output channel var scriptnode = audioctx.createscriptprocessor(4096, 1, 1); console.log(scriptnode.buffersize); // load in 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 scriptn...
ScriptProcessorNode.onaudioprocess - Web APIs
er source var audioctx = new audiocontext(); source = audioctx.createbuffersource(); // create a scriptprocessornode with a buffersize of 4096 and a single input and output channel var scriptnode = audioctx.createscriptprocessor(4096, 1, 1); console.log(scriptnode.buffersize); // load in 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 scri...
ScriptProcessorNode - Web APIs
er source var audioctx = new audiocontext(); source = audioctx.createbuffersource(); // create a scriptprocessornode with a buffersize of 4096 and a single input and output channel var scriptnode = audioctx.createscriptprocessor(4096, 1, 1); console.log(scriptnode.buffersize); // load in 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 scriptn...
Selection.rangeCount - Web APIs
s the click within an element with display: table-cell). syntax value = sel.rangecount example the following example will show the rangecount every second. select text in the browser to see it change. html <table> <tr><td>a.1<td>a.2 <tr><td>b.1<td>b.2 <tr><td>c.1<td>c.2 javascript window.setinterval(function () { console.log(window.getselection().rangecount); }, 1000); result open your console to see how many ranges are in the selection. in gecko browsers, you can select multiple ranges across table cells by holding down ctrl while dragging with the mouse. specifications specification status comment selection apithe definition of 'selection.rangecount' in that specification. working draft current ...
ServiceWorkerGlobalScope: contentdelete event - Web APIs
ent via the user agent. bubbles no cancelable no interface contentindexevent event handler property oncontentdelete examples the following example uses a contentdelete event handler to remove cached content related to the deleted index item. self.addeventlistener('contentdelete', event => { event.waituntil( caches.open('cache-name').then(cache => { return promise.all([ cache.delete(`/icon/${event.id}`), cache.delete(`/content/${event.id}`) ]) }) ); }); you can also set up the event handler using the serviceworkerglobalscope.ondelete property: self.oncontentdelete = (event) => { ... }; specifications specification status comment unknownthe defini...
ServiceWorkerGlobalScope: install event - Web APIs
celable no interface extendableevent event handler property serviceworkerglobalscope.oninstall examples the following snippet shows how an install event handler can be used to populate a cache with a number of responses, which the service worker can then use to serve assets offline: this.addeventlistener('install', function(event) { event.waituntil( caches.open('v1').then(function(cache) { return cache.add( '/sw-test/', '/sw-test/index.html', '/sw-test/style.css', '/sw-test/app.js', '/sw-test/image-list.js', '/sw-test/star-wars-logo.jpg', '/sw-test/gallery/', '/sw-test/gallery/bountyhunters.jpg', '/sw-test/gallery/mylittlevader.jpg', '/sw-test/gallery/snowtroopers.j...
ServiceWorkerGlobalScope.oncontentdelete - Web APIs
lscope interface is an event handler fired when an item is removed from the indexed content via the user agent. syntax serviceworkerglobalscope.oncontentdelete = function(event) { ... }; examples the following example uses a contentdelete event handler to remove cached content related to the deleted index item. self.addeventlistener('contentdelete', event => { event.waituntil( caches.open('cache-name').then(cache => { return promise.all([ cache.delete(`/icon/${event.id}`), cache.delete(`/content/${event.id}`) ]) }) ); }); specifications specification status comment unknownthe definition of 'contentdelete' in that specification. unknown initial definition. ...
ServiceWorkerGlobalScope.oninstall - Web APIs
rvice worker installs). this happens before activation. syntax serviceworkerglobalscope.oninstall = function(event) { ... ...
ServiceWorkerRegistration.pushManager - Web APIs
he pushmanager interface for managing push subscriptions; this includes support for subscribing, getting an active subscription, and accessing push permission status. syntax var pushmanager = serviceworkerregistration.pushmanager; value a pushmanager object. examples this.onpush = function(event) { console.log(event.data); // from here we can write the data to indexeddb, send it to any open // windows, display a notification, etc. } navigator.serviceworker.register('serviceworker.js').then( function(serviceworkerregistration) { serviceworkerregistration.pushmanager.subscribe().then( function(pushsubscription) { console.log(pushsubscription.subscriptionid); console.log(pushsubscription.endpoint); // the push subscription details needed by the ap...
Service Worker API - Web APIs
rker is run in a worker context: it therefore has no dom access, and runs on a different thread to the main javascript that powers your app, so it is non-blocking. it is designed to be fully async; as a consequence, apis such as synchronous xhr and localstorage can't be used inside a service worker. service workers only run over https, for security reasons. having modified network requests, wide open to man in the middle attacks would be really bad. in firefox, service worker apis are also hidden and cannot be used when the user is in private browsing mode. note: service workers win over previous attempts in this area such as; appcache because they don't make assumptions about what you are trying to do, and then break when those assumptions are not exactly right; you have granular control o...
ShadowRoot.innerHTML - Web APIs
e inside the shadowroot. syntax var domstring = shadowroot.innerhtml shadowroot.innerhtml = domstring value a domstring. examples let customelem = document.queryselector('my-shadow-dom-element'); let shadow = customelem.shadowroot; shadow.innerhtml = '<strong>this element should be more important!</strong>'; specifications this property is not defined by any specifications yet; see this open spec issue to specify it. ...
ShadowRoot - Web APIs
the shadowroot interface of the shadow dom api is the root node of a dom subtree that is rendered separately from a document's main dom tree. you can retrieve a reference to an element's shadow root using its element.shadowroot property, provided it was created using element.attachshadow() with the mode option set to open. properties shadowroot.delegatesfocus read only returns a boolean that indicates whether delegatesfocus was set when the shadow was attached (see element.attachshadow()). shadowroot.host read only returns a reference to the dom element the shadowroot is attached to. shadowroot.innerhtml sets or returns a reference to the dom tree inside the shadowroot. shadowroot.mode read only the mode of the shadowroot — either open or closed. this defines whether or n...
SharedWorkerGlobalScope.onconnect - Web APIs
syntax onconnect = function() { ... }; examples this example shows a shared worker file — when a connection to the worker occurs from a main thread via a messageport, the onconnect event handler fires. the event object is a messageevent. ...
SharedWorkerGlobalScope - Web APIs
ilable. event handlers this interface inherits event handlers from the workerglobalscope interface, and its parent eventtarget, and therefore implements event handlers from windowtimers, windowbase64, and windoweventhandlers. sharedworkerglobalscope.onconnect is an eventhandler representing the code to be called when the connect event is raised — that is, when a messageport connection is opened between the associated sharedworker and the main thread. methods this interface inherits methods from the workerglobalscope interface, and its parent eventtarget, and therefore implements methods from windowtimers, windowbase64, and windoweventhandlers. sharedworkerglobalscope.close() discards any tasks queued in the sharedworkerglobalscope's event loop, effectively closing this particul...
Storage Access API - Web APIs
irst-party storage. document.requeststorageaccess() returns a promise that resolves if the access to first-party storage was granted, and rejects if access was denied. note: user interaction propagates to the promise returned by both of these methods, allowing the callers to take actions that require user interaction without requiring a second click from the user. for example, a caller could open a pop-up window from the resolved promise without triggering firefox’s pop-up blocker. extensions to <iframe> sandbox the <iframe> element's sandbox attribute has a new token, allow-storage-access-by-user-activation, which permits sandboxed <iframe>s to use the storage access api to request storage access. specifications the api is currently only at the proposal stage — the standardizati...
USBDevice.claimInterface() - Web APIs
for exclusive access. syntax var promise = usbdevice.claiminterface(interfacenumber) parameters interfacenumber the index of one of the interfaces supported by the device. interfaces are device-specific. return value a promise. example the following example shows claiminterface() in the context of connecting to a usb device. async function connectdevice(usbdevice) { await usbdevice.open(); if (usbdevice.configuration === null) await usbdevice.selectconfiguration(1); await usbdevice.claiminterface(0); } specifications specification status comment webusbthe definition of 'claiminterface()' in that specification. draft initial definition. ...
USBDevice.close() - Web APIs
Web › API › USBDevice › close
syntax var promise = usbdevice.close() parameters none. return value a promise. ...
USBDevice.configuration - Web APIs
bconfiguration object for the currently selected interface for a paired usb device. syntax var usbconfiguration = usbdevice.configuration value a usbconfiguration object. example the following example uses this property to test for the existence of a usbconfiguration property to select a configuration before claiming an interface. async function connectdevice(usbdevice) { await usbdevice.open(); if (usbdevice.configuration === null) await usbdevice.selectconfiguration(1); await usbdevice.claiminterface(0); } specifications specification status comment webusbthe definition of 'configuration' in that specification. draft initial definition. ...
VTTCue - Web APIs
Web › API › VTTCue
embed live sample can not show subtitles in chrome. specifications specification status comment webvtt: the web video text tracks format candidate recommendation ...
WebGL2RenderingContext.beginQuery() - Web APIs
ten to transform feedback buffers. query a webglquery object for which to start the querying. return value none. examples var query = gl.createquery(); gl.beginquery(gl.any_samples_passed, query); // ... specifications specification status comment webgl 2.0the definition of 'beginquery' in that specification. editor's draft initial definition. opengl es 3.0the definition of 'glbeginquery' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.bindBufferBase() - Web APIs
uint specifying the index of the target. buffer a webglbuffer which to bind to the binding point (target). return value none. examples gl.bindbufferbase(gl.transform_feedback_buffer, 0, buffer); specifications specification status comment webgl 2.0the definition of 'bindbufferbase' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glbindbufferbase' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.bindBufferRange() - Web APIs
starting offset. size a glsizeiptr specifying the amount of data that can be read from the buffer. return value none. examples gl.bindbufferrange(gl.transform_feedback_buffer, 1, buffer, 0, 4); specifications specification status comment webgl 2.0the definition of 'bindbufferrange' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glbindbufferrange' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.bindSampler() - Web APIs
uint specifying the index of the texture unit to which to bind the sampler to. sampler a webglsampler object to bind. return value none. examples var sampler = gl.createsampler(); gl.bindsampler(0, sampler); specifications specification status comment webgl 2.0the definition of 'bindsampler' in that specification. editor's draft initial definition. opengl es 3.0the definition of 'glbindsampler' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.bindTransformFeedback() - Web APIs
webgltransformfeedback object to bind. return value none. examples var transformfeedback = gl.createtransformfeedback(); gl.bindtransformfeedback(gl.transform_feedback, transformfeedback); specifications specification status comment webgl 2.0the definition of 'bindtransformfeedback' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glbindtransformfeedback' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.bindVertexArray() - Web APIs
o) object to bind. return value none. examples var vao = gl.createvertexarray(); gl.bindvertexarray(vao); // ... // calls to bindbuffer or vertexattribpointer // which will be "recorded" in the vao // ... specifications specification status comment webgl 2.0the definition of 'bindvertexarray' in that specification. editor's draft initial definition. opengl es 3.0the definition of 'glbindvertexarray' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.blitFramebuffer() - Web APIs
ar return value none. examples gl.blitframebuffer(0, 0, canvas.width, canvas.height, 0, 0, canvas.width, canvas.height, gl.color_buffer_bit, gl.nearest); specifications specification status comment webgl 2.0the definition of 'blitframebuffer' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glblitframebuffer' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.clientWaitSync() - Web APIs
meout expired. gl.wait_failed: indicates that an error occurred during the execution. examples var sync = gl.fencesync(gl.sync_gpu_commands_complete, 0); var status = gl.clientwaitsync(sync, 0, 0); specifications specification status comment webgl 2.0the definition of 'clientwaitsync' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glclientwaitsync' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.compressedTexSubImage3D() - Web APIs
as a data store for the compressed image data in memory. return value none. examples gl.compressedtexsubimage3d(gl.texture_3d, 0, 0, 0, 512, 512, 512, gl.compressed_r11_eac, texturedata); specifications specification status comment webgl 2.0the definition of 'compressedtexsubimage3d' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glcompressedtexsubimage3d' in that specification. standard man page of the (similar) opengl es 3.0 api. ...
WebGL2RenderingContext.copyTexSubImage3D() - Web APIs
width a glsizei specifying the width of the texture. height a glsizei specifying the height of the texture. return value none. examples gl.copytexsubimage3d(gl.texture_3d, 0, 0, 0, 0, 0, 0, 16, 16); specifications specification status comment webgl 2.0the definition of 'copytexsubimage3d' in that specification. editor's draft initial definition. opengl es 3.0the definition of 'glcopytexsubimage3d' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.createQuery() - Web APIs
webglquery gl.createquery(); parameters none. return value a webglquery object. examples gl must be a webgl2renderingcontext. webglquery objects are not available in webgl 1. var query = gl.createquery(); specifications specification status comment webgl 2.0the definition of 'createquery' in that specification. editor's draft initial definition. opengl es 3.0the definition of 'glgenqueries' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.createSampler() - Web APIs
gl.createsampler(); parameters none. return value a webglsampler object. examples gl must be a webgl2renderingcontext. webglsampler objects are not available in webgl 1. var sampler = gl.createsampler(); specifications specification status comment webgl 2.0the definition of 'createsampler' in that specification. editor's draft initial definition. opengl es 3.0the definition of 'glgensamplers' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.createTransformFeedback() - Web APIs
bgltransformfeedback object. examples gl must be a webgl2renderingcontext. webgltransformfeedback objects are not available in webgl 1. var transformfeedback = gl.createtransformfeedback(); specifications specification status comment webgl 2.0the definition of 'createtransformfeedback' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glgentransformfeedbacks' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.createVertexArray() - Web APIs
ao) which points to vertex array data. examples var vao = gl.createvertexarray(); gl.bindvertexarray(vao); // ... // calls to bindbuffer or vertexattribpointer // which will be "recorded" in the vao // ... specifications specification status comment webgl 2.0the definition of 'createvertexarray' in that specification. editor's draft initial definition. opengl es 3.0the definition of 'glgenvertexarrays' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.deleteQuery() - Web APIs
a webglquery object to delete. return value none. examples gl must be a webgl2renderingcontext. webglquery objects are not available in webgl 1. var query = gl.createquery(); // ... gl.deletequery(query); specifications specification status comment webgl 2.0the definition of 'deletequery' in that specification. editor's draft initial definition. opengl es 3.0the definition of 'gldeletequeries' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.deleteSampler() - Web APIs
er object to delete. return value none. examples gl must be a webgl2renderingcontext. webglsampler objects are not available in webgl 1. var sampler = gl.createsampler(); // ... gl.deletesampler(sampler); specifications specification status comment webgl 2.0the definition of 'deletesampler' in that specification. editor's draft initial definition. opengl es 3.0the definition of 'gldeletesamplers' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.deleteSync() - Web APIs
return value none. examples gl must be a webgl2renderingcontext. webglsync objects are not available in webgl 1. var sync = gl.fencesync(gl.sync_gpu_commands_complete, 0); // ... gl.deletesync(sync); specifications specification status comment webgl 2.0the definition of 'deletesync' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'gldeletesync' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.deleteTransformFeedback() - Web APIs
gl2renderingcontext. webgltransformfeedback objects are not available in webgl 1. var transformfeedback = gl.createtransformfeedback(); // ... gl.deletetransformfeedback(transformfeedback); specifications specification status comment webgl 2.0the definition of 'deletetransformfeedback' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'gldeletetransformfeedbacks' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.deleteVertexArray() - Web APIs
); parameters vertexarray a webglvertexarrayobject (vao) object to delete. return value none. examples var vao = gl.createvertexarray(); gl.bindvertexarray(vao); // ... gl.deletevertexarray(vao); specifications specification status comment webgl 2.0the definition of 'deletevertexarray' in that specification. editor's draft initial definition. opengl es 3.0the definition of 'gldeletevertexarrays' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.drawArraysInstanced() - Web APIs
dices to be rendered. instancecount a glsizei specifying the number of instances of the range of elements to execute. return value none. examples gl.drawarraysinstanced(gl.points, 0, 8, 4); specifications specification status comment webgl 2.0the definition of 'drawarraysinstanced' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'gldrawarraysinstanced' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.drawBuffers() - Web APIs
nt framebuffer. return value none. exceptions if buffers contains not one of the accepted values, a gl.invalid_enum error is thrown. examples gl.drawbuffers([gl.none, gl.color_attachment1]); specifications specification status comment webgl 2.0the definition of 'drawbuffers' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'gldrawbuffers' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.drawElementsInstanced() - Web APIs
a gl.invalid_operation error is thrown. if count or instancecount are negative, a gl.invalid_value error is thrown. examples gl.drawelementsinstanced(gl.points, 2, gl.unsigned_short, 0, 4); specifications specification status comment webgl 2.0the definition of 'drawelementsinstanced' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'gldrawelementsinstanced' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.drawRangeElements() - Web APIs
size of the given type, a gl.invalid_operation error is thrown. if count is negative, a gl.invalid_value error is thrown. examples gl.drawrangeelements(gl.points, 0, 7, 8, gl.unsigned_byte, 0); specifications specification status comment webgl 2.0the definition of 'drawrangeelements' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'gldrawrangeelements' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.endQuery() - Web APIs
f primitives that are written to transform feedback buffers. return value none. examples var query = gl.createquery(); gl.beginquery(gl.any_samples_passed, query); // ... gl.endquery(gl.any_samples_passed); specifications specification status comment webgl 2.0the definition of 'endquery' in that specification. editor's draft initial definition. opengl es 3.0the definition of 'glendquery' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.fenceSync() - Web APIs
ensions only). return value a webglsync object. examples gl must be a webgl2renderingcontext. webglsync objects are not available in webgl 1. var sync = gl.fencesync(gl.sync_gpu_commands_complete, 0); specifications specification status comment webgl 2.0the definition of 'fencesync' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glfencesync' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.framebufferTextureLayer() - Web APIs
pecifying the layer of the texture image to attach. return value none. examples gl.framebuffertexturelayer(gl.framebuffer, gl.color_attachment0, texture, 0, 8); specifications specification status comment webgl 2.0the definition of 'framebuffertexturelayer' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glframebuffertexturelayer' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.getActiveUniformBlockName() - Web APIs
ndex of the uniform block to whose name to retrieve. return value a domstring indicating the active uniform block name. examples var blockname = gl.getactiveuniformblockname(program, 0); specifications specification status comment webgl 2.0the definition of 'getactiveuniformblockname' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glgetactiveuniformblockname' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.getActiveUniformBlockParameter() - Web APIs
name parameter. if an error occurs, null is returned. examples var blocksize = gl.getactiveuniformblockparameter(program, blockindex, gl.uniform_block_data_size); specifications specification status comment webgl 2.0the definition of 'getactiveuniformblockparameter' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glgetactiveuniformblockiv' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.getActiveUniforms() - Web APIs
ame parameter. examples var uniformindices = gl.getuniformindices(program, ['ubored', 'ubogreen', 'uboblue']); var uniformoffsets = gl.getactiveuniforms(program, uniformindices, gl.uniform_offset); specifications specification status comment webgl 2.0the definition of 'getactiveuniforms' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glgetactiveuniformsiv' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.getFragDataLocation() - Web APIs
ined varying out variable. return value a glint indicating the assigned color number binding, or -1 otherwise. examples // program is a linked webglprogram gl.getfragdatalocation(program, 'fragcolor'); specifications specification status comment webgl 2.0the definition of 'getfragdatalocation' in that specification. editor's draft initial definition. opengl es 3.0the definition of 'glgetfragdatalocation' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.getIndexedParameter() - Web APIs
e target that is queried. return value depends on the requested information (as specified with target). examples var binding = gl.getindexedparameter(gl.transform_feedback_buffer_binding, 0); specifications specification status comment webgl 2.0the definition of 'getindexedparameter' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glget' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.getInternalformatParameter() - Web APIs
name). it is an int32array if pname is gl.samples. examples var samples = gl.getinternalformatparameter(gl.renderbuffer, gl.rgba8, gl.samples); specifications specification status comment webgl 2.0the definition of 'getinternalformatparameter' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glgetinternalformativ' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.getQuery() - Web APIs
back buffers. pname a glenum specifying the query object target. must be gl.current_query. return value a webglquery object. examples var currentquery = gl.getquery(gl.any_samples_passed, gl.current_query); specifications specification status comment webgl 2.0the definition of 'getquery' in that specification. editor's draft initial definition. opengl es 3.0the definition of 'glgetqueryiv' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.getQueryParameter() - Web APIs
epends on the pname parameter, either a gluint or a glboolean. examples var query = gl.createquery(); gl.beginquery(gl.any_samples_passed, query); var result = gl.getqueryparameter(query, gl.query_result); specifications specification status comment webgl 2.0the definition of 'getqueryparameter' in that specification. editor's draft initial definition. opengl es 3.0the definition of 'glgetqueryobjectuiv' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.getSamplerParameter() - Web APIs
texture coordinate t. return value depends on the pname parameter, either a glenum or a glfloat. examples var sampler = gl.createsampler(); gl.getsamplerparameter(sampler, gl.texture_compare_func); specifications specification status comment webgl 2.0the definition of 'getsamplerparameter' in that specification. editor's draft initial definition. opengl es 3.0the definition of 'glgetsamplerparameter' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.getSyncParameter() - Web APIs
. return value depends on the pname parameter, either a glenum or a glbitfield. examples var sync = gl.fencesync(gl.sync_gpu_commands_complete, 0); gl.getsyncparameter(sync, gl.sync_status); specifications specification status comment webgl 2.0the definition of 'getsyncparameter' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glgetsynciv' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.getTransformFeedbackVarying() - Web APIs
nt specifying the index of the varying variable whose information to retrieve. return value a webglactiveinfo object. examples activeinfo = gl.gettransformfeedbackvarying(program, 0); specifications specification status comment webgl 2.0the definition of 'gettransformfeedbackvarying' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glgettransformfeedbackvarying' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.getUniformIndices() - Web APIs
e names of the uniforms to query. return value an array of gluint containing the uniform indices. examples var uniformindices = gl.getuniformindices(program, ['ubored', 'ubogreen', 'uboblue']); specifications specification status comment webgl 2.0the definition of 'getuniformindices' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glgetuniformindices' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.invalidateFramebuffer() - Web APIs
framebuffer's depth and stencil buffer. return value none. examples gl.invalidateframebuffer(gl.read_framebuffer, [gl.color_attachment0, gl.color_attachment1]); specifications specification status comment webgl 2.0the definition of 'invalidateframebuffer' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glinvalidateframebuffer' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.invalidateSubFramebuffer() - Web APIs
value none. examples gl.invalidatesubframebuffer(gl.read_framebuffer, [gl.color_attachment0, gl.color_attachment1], 0, 0, 256, 256); specifications specification status comment webgl 2.0the definition of 'invalidatesubframebuffer' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glinvalidatesubframebuffer' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.isQuery() - Web APIs
ven object is a valid webglquery object (true) or not (false). examples gl must be a webgl2renderingcontext. webglquery objects are not available in webgl 1. var query = gl.createquery(); // ... gl.isquery(query); specifications specification status comment webgl 2.0the definition of 'isquery' in that specification. editor's draft initial definition. opengl es 3.0the definition of 'glisquery' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.isSampler() - Web APIs
a valid webglsampler object (true) or not (false). examples gl must be a webgl2renderingcontext. webglsampler objects are not available in webgl 1. var sampler = gl.createsampler(); // ... gl.issampler(sampler); specifications specification status comment webgl 2.0the definition of 'issampler' in that specification. editor's draft initial definition. opengl es 3.0the definition of 'glissampler' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.isSync() - Web APIs
bglsync object (true) or not (false). examples gl must be a webgl2renderingcontext. webglsync objects are not available in webgl 1. var sync = gl.fencesync(gl.sync_gpu_commands_complete, 0); // ... gl.issync(sync); specifications specification status comment webgl 2.0the definition of 'issync' in that specification. editor's draft initial definition. opengl es 3.0the definition of 'glissync' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.isTransformFeedback() - Web APIs
be a webgl2renderingcontext. webgltransformfeedback objects are not available in webgl 1. var transformfeedback = gl.createtransformfeedback(); // ... gl.istransformfeedback(transformfeedback); specifications specification status comment webgl 2.0the definition of 'istransformfeedback' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glistransformfeedback' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.isVertexArray() - Web APIs
glboolean indicating whether the given object is a valid webglvertexarrayobject object (true) or not (false). examples var vao = gl.createvertexarray(); gl.bindvertexarray(vao); // ... gl.isvertexarray(vao); specifications specification status comment webgl 2.0the definition of 'isvertexarray' in that specification. editor's draft initial definition. opengl es 3.0the definition of 'glisvertexarray' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.pauseTransformFeedback() - Web APIs
back, transformfeedback); gl.begintransformfeedback(gl.triangles); gl.pausetransformfeedback(); //... gl.resumetransformfeedback(); gl.drawarrays(gl.triangles, 0, 3); gl.endtransformfeedback(); specifications specification status comment webgl 2.0the definition of 'pausetransformfeedback' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glpausetransformfeedback' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.readBuffer() - Web APIs
olor buffer. gl.none: reads from no color buffer. gl.color_attachment{0-15}: reads from one of the 16 color attachment buffers. return value none. examples gl.readbuffer(gl.color_attachment0); specifications specification status comment webgl 2.0the definition of 'readbuffer' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glreadbuffer' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.renderbufferStorageMultisample() - Web APIs
ls. height a glsizei specifying the height of the renderbuffer in pixels. return value none. examples gl.renderbufferstoragemultisample(gl.renderbuffer, 4, gl.rbga4, 256, 256); specifications specification status comment webgl 2.0the definition of 'glrenderbufferstoragemultisample' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glrenderbufferstoragemultisample' in that specification. standard man page of the (similar) opengl es 3 api. ...
WebGL2RenderingContext.resumeTransformFeedback() - Web APIs
ack, transformfeedback); gl.begintransformfeedback(gl.triangles); gl.pausetransformfeedback(); //... gl.resumetransformfeedback(); gl.drawarrays(gl.triangles, 0, 3); gl.endtransformfeedback(); specifications specification status comment webgl 2.0the definition of 'resumetransformfeedback' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glresumetransformfeedback' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.texStorage3D() - Web APIs
height a glsizei specifying the height of the texture. depth a glsizei specifying the depth of the texture. return value none. examples gl.texstorage3d(gl.texture_3d, 1, gl.rgb8, 256, 256, 256); specifications specification status comment webgl 2.0the definition of 'texstorage3d' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'gltexstorage3d' in that specification. standard man page of the (similar) opengl es 3.0 api. ...
WebGL2RenderingContext.texSubImage3D() - Web APIs
webglbuffer bound to the pixel_unpack_buffer target. return value none. examples gl.texsubimage3d(gl.texture_3d, 0, 0, 0, 0, image.width, image.height, 1, gl.rgba, gl.unsigned_byte, image); specifications specification status comment webgl 2.0the definition of 'texsubimage3d' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'gltexsubimage2d' in that specification. standard man page of the (similar) opengl es 3.0 api. ...
WebGL2RenderingContext.uniform[1234][uif][v]() - Web APIs
unsigned integer values (methods with ui), for integer values (methods with i), or for floats (methods with f). a uint32array for unsigned integer vector methods (methods with uiv). return value none. specifications specification status comment webgl 2.0the definition of 'uniform' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'gluniform' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.uniformBlockBinding() - Web APIs
orm block within the program. uniformblockbinding a gluint specifying the binding point to which to bind the uniform block. return value none. examples gl.uniformblockbinding(program, 0, 1); specifications specification status comment webgl 2.0the definition of 'uniformblockbinding' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'gluniformblockbinding' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.uniformMatrix[234]x[234]fv() - Web APIs
pose a glboolean specifying whether to transpose the matrix. must be false. data a float32array of float values. return value none. examples gl.uniformmatrix2x3fv(loc, false, [1, 2, 3, 4, 5, 6]); specifications specification status comment webgl 2.0the definition of 'uniformmatrix' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'gluniformmatrix' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.vertexAttribDivisor() - Web APIs
ric vertex attributes. divisor a gluint specifying the number of instances that will pass between updates of the generic attribute. return value none. examples gl.vertexattribdivisor(0, 2); specifications specification status comment webgl 2.0the definition of 'vertexattribdivisor' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glvertexattribdivisor' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.vertexAttribI4[u]i[v]() - Web APIs
e vertex attribute value. value a uint32array/int32array or sequences of gluint/ glint for integer vector vertex attribute values. return value none. examples gl.vertexattribi4i(a_foobar, 10); specifications specification status comment webgl 2.0the definition of 'vertexattribi' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glvertexattribi' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.waitSync() - Web APIs
out the server should wait before continuing. must be gl.timeout_ignored. return value none. examples var sync = gl.fencesync(gl.sync_gpu_commands_complete, 0); gl.waitsync(sync, 0, gl.timeout_ignored); specifications specification status comment webgl 2.0the definition of 'waitsync' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glwaitsync' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext - Web APIs
to get an object of this interface, call getcontext() on a <canvas> element, supplying "webgl2" as the argument: var canvas = document.getelementbyid('mycanvas'); var gl = canvas.getcontext('webgl2'); webgl 2 is an extension to webgl 1. the webgl2renderingcontext interface implements all members of the webglrenderingcontext interface. some methods of the webgl 1 context can accept additional values when used in a webgl 2 context. you will find this info noted on the webgl 1 reference pages. ...
WebGLRenderingContext.activeTexture() - Web APIs
mbined_texture_image_units); to get the active texture, query the active_texture constant. gl.activetexture(gl.texture0); gl.getparameter(gl.active_texture); // returns "33984" (0x84c0, gl.texture0 enum value) specifications specification status comment webgl 1.0the definition of 'activetexture' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glactivetexture' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.bindAttribLocation() - Web APIs
the generic vertex index. this name cannot start with "webgl_" or "_webgl_", as these are reserved for use by webgl. return value none. examples gl.bindattriblocation(program, colorlocation, 'vcolor'); specifications specification status comment webgl 1.0the definition of 'bindattriblocation' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glbindattriblocation' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.blendEquation() - Web APIs
ct, or if the ext_blend_minmax is enabled: ext.min_ext or ext.max_ext. gl.getparameter(gl.blend_equation_rgb) === gl.func_add; // true gl.getparameter(gl.blend_equation_alpha) === gl.func_add; // true specifications specification status comment webgl 1.0the definition of 'blendequation' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glblendequation' in that specification. standard man page of the opengl es 2.0 api. opengl es 3.0the definition of 'glblendequation' in that specification. standard man page of the opengl es 3.0 api. ...
WebGLRenderingContext.blendEquationSeparate() - Web APIs
f the ext_blend_minmax is enabled: ext.min_ext or ext.max_ext. gl.getparameter(gl.blend_equation_rgb) === gl.func_add; // true gl.getparameter(gl.blend_equation_alpha) === gl.func_add; // true specifications specification status comment webgl 1.0the definition of 'blendequationseparate' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glblendequationseparate' in that specification. standard man page of the opengl es 2.0 api. opengl es 3.0the definition of 'glblendequationseparate' in that specification. standard man page of the opengl es 3.0 api. ...
WebGLRenderingContext.bufferData() - Web APIs
r, gl.buffer_usage); getting size of a typed array to calculate size parameter for a typed array. var dataarray = new float32array([1, 2, 3, 4]); var sizeinbytes = dataarray.length * dataarray.bytes_per_element; specifications specification status comment webgl 1.0the definition of 'bufferdata' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glbufferdata' in that specification. standard man page of the opengl api. opengl es 3.0the definition of 'glbufferdata' in that specification. standard man page of the (similar) opengl es 3 api. adds new target buffers: gl.copy_read_buffer, gl.copy_write_buffer, gl.transform_feedback_buffer, gl.uniform_buffer, gl.pixel_pack_buf...
WebGLRenderingContext.bufferSubData() - Web APIs
= canvas.getcontext('webgl'); var buffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, buffer); gl.bufferdata(gl.array_buffer, 1024, gl.static_draw); gl.buffersubdata(gl.array_buffer, 512, data); specifications specification status comment webgl 1.0the definition of 'buffersubdata' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glbuffersubdata' in that specification. standard man page of the opengl es 2 api. opengl es 3.0the definition of 'glbuffersubdata' in that specification. standard man page of the (similar) opengl es 3 api. adds new target buffers: gl.copy_read_buffer, gl.copy_write_buffer, gl.transform_feedback_buffer, gl.uniform_buffer, ...
WebGLRenderingContext.clear() - Web APIs
ent clear values, query the color_clear_value, depth_clear_value, and stencil_clear_value constants. gl.getparameter(gl.color_clear_value); gl.getparameter(gl.depth_clear_value); gl.getparameter(gl.stencil_clear_value); specifications specification status comment webgl 1.0the definition of 'clear' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glclear' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.clearDepth() - Web APIs
h buffer is cleared. default value: 1. return value none. examples gl.cleardepth(0.5); to get the current depth clear value, query the depth_clear_value constant. gl.getparameter(gl.depth_clear_value); // 0.5 specifications specification status comment webgl 1.0the definition of 'cleardepth' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glcleardepthf' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.clearStencil() - Web APIs
er is cleared. default value: 0. return value none. examples gl.clearstencil(1); to get the current stencil clear value, query the stencil_clear_value constant. gl.getparameter(gl.stencil_clear_value); // 1 specifications specification status comment webgl 1.0the definition of 'clearstencil' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glclearstencil' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.colorMask() - Web APIs
none. examples gl.colormask(true, true, true, false); to get the current color mask, query the color_writemask constant which returns an array. gl.getparameter(gl.color_writemask); // [true, true, true, false] specifications specification status comment webgl 1.0the definition of 'colormask' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glcolormask' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.compileShader() - Web APIs
oid gl.compileshader(shader); parameters shader a fragment or vertex webglshader. examples var shader = gl.createshader(gl.vertex_shader); gl.shadersource(shader, shadersource); gl.compileshader(shader); specifications specification status comment webgl 1.0the definition of 'compileshader' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glcompileshader' in that specification. standard opengl man page. ...
WebGLRenderingContext.copyTexImage2D() - Web APIs
a glsizei specifying the height of the texture. border a glint specifying the width of the border. must be 0. return value none. examples gl.copyteximage2d(gl.texture_2d, 0, gl.rgba, 0, 0, 512, 512, 0); specifications specification status comment webgl 1.0the definition of 'copyteximage2d' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glcopyteximage2d' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.copyTexSubImage2D() - Web APIs
ing. width a glsizei specifying the width of the texture. height a glsizei specifying the height of the texture. return value none. examples gl.copytexsubimage2d(gl.texture_2d, 0, 0,0, 0, 0, 16, 16); specifications specification status comment webgl 1.0the definition of 'copytexsubimage2d' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glcopytexsubimage2d' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.createBuffer() - Web APIs
turn value a webglbuffer storing data such as vertices or colors. examples creating a buffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var buffer = gl.createbuffer(); specifications specification status comment webgl 1.0the definition of 'createbuffer' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glgenbuffers' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.createFramebuffer() - Web APIs
ne. return value a webglframebuffer object. examples creating a frame buffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var framebuffer = gl.createframebuffer(); specifications specification status comment webgl 1.0the definition of 'createframebuffer' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glgenframebuffers' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.createProgram() - Web APIs
us) ) { var info = gl.getprograminfolog(program); throw 'could not compile webgl program. \n\n' + info; } see webglshader for information on creating the vertexshader and fragmentshader in the above example. specifications specification status comment webgl 1.0the definition of 'createprogram' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glcreateprogram' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.createRenderbuffer() - Web APIs
urce or target of an rendering operation. examples creating a render buffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var renderbuffer = gl.createrenderbuffer(); specifications specification status comment webgl 1.0the definition of 'createrenderbuffer' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glgenrenderbuffers' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.createShader() - Web APIs
ource() and webglrenderingcontext.compileshader(). syntax webglshader gl.createshader(type); parameters type either gl.vertex_shader or gl.fragment_shader examples see webglshader for usage and examples. specifications specification status comment webgl 1.0the definition of 'createshader' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glcreateshader' in that specification. standard opengl man page. ...
WebGLRenderingContext.createTexture() - Web APIs
d to. examples see also the webgl tutorial on using textures in webgl. creating a texture var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var texture = gl.createtexture(); specifications specification status comment webgl 1.0the definition of 'createtexture' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glgentextures' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.cullFace() - Web APIs
ment gl.cull_face. gl.enable(gl.cull_face); gl.cullface(gl.front_and_back); to check the current cull face mode, query the cull_face_mode constant. gl.getparameter(gl.cull_face_mode) === gl.front_and_back; // true specifications specification status comment webgl 1.0the definition of 'cullface' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glcullface' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.deleteBuffer() - Web APIs
to delete. return value none. examples deleting a buffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var buffer = gl.createbuffer(); // ... gl.deletebuffer(buffer); specifications specification status comment webgl 1.0the definition of 'deletebuffer' in that specification. recommendation initial definition. opengl es 2.0the definition of 'gldeletebuffers' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.deleteFramebuffer() - Web APIs
e. examples deleting a frame buffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var framebuffer = gl.createframebuffer(); // ... gl.deleteframebuffer(framebuffer); specifications specification status comment webgl 1.0the definition of 'deleteframebuffer' in that specification. recommendation initial definition. opengl es 2.0the definition of 'gldeleteframebuffers' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.deleteProgram() - Web APIs
lete. return value none. examples deleting a program var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var program = gl.createprogram(); // ... gl.deleteprogram(program); specifications specification status comment webgl 1.0the definition of 'deleteprogram' in that specification. recommendation initial definition. opengl es 2.0the definition of 'gldeleteprogram' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.deleteShader() - Web APIs
it is destroyed by the garbage collector. syntax void gl.deleteshader(shader); parameters shader a webglshader object to delete. return value none. examples deleting a shader gl.deleteshader(shader); specifications specification status comment webgl 1.0the definition of 'deleteshader' in that specification. recommendation initial definition. opengl es 2.0the definition of 'gldeleteshader' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.deleteTexture() - Web APIs
lete. return value none. examples deleting a texture var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var texture = gl.createtexture(); // ... gl.deletetexture(texture); specifications specification status comment webgl 1.0the definition of 'deletetexture' in that specification. recommendation initial definition. opengl es 2.0the definition of 'gldeletetextures' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.depthFunc() - Web APIs
methods with the argument gl.depth_test. gl.enable(gl.depth_test); gl.depthfunc(gl.never); to check the current depth function, query the depth_func constant. gl.getparameter(gl.depth_func) === gl.never; // true specifications specification status comment webgl 1.0the definition of 'depthfunc' in that specification. recommendation initial definition. opengl es 2.0the definition of 'gldepthfunc' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.depthMask() - Web APIs
at writing is enabled. return value none. examples gl.depthmask(false); to get the current depth mask, query the depth_writemask constant which returns a boolean. gl.getparameter(gl.depth_writemask); // false specifications specification status comment webgl 1.0the definition of 'depthmask' in that specification. recommendation initial definition. opengl es 2.0the definition of 'gldepthmask' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.depthRange() - Web APIs
1. return value none. examples gl.depthrange(0.2, 0.6); to check the current depth range, query the depth_range constant which returns a float32array gl.getparameter(gl.depth_range); // float32array[0.2, 0.6] specifications specification status comment webgl 1.0the definition of 'depthrange' in that specification. recommendation initial definition. unlike opengl, webgl requires znear and zfar values to be clamped to the range 0 to 1. additionally, znear must be less than or equal to zfar. opengl es 2.0the definition of 'gldepthrangef' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.detachShader() - Web APIs
of the webgl api detaches a previously attached webglshader from a webglprogram. syntax void gl.detachshader(program, shader); parameters program a webglprogram. shader a fragment or vertex webglshader. specifications specification status comment webgl 1.0the definition of 'detachshader' in that specification. recommendation initial definition. opengl es 2.0the definition of 'gldetachshader' in that specification. standard opengl man page. ...
WebGLRenderingContext.disable() - Web APIs
nds are ignored. return value none. examples gl.disable(gl.dither); to check if a capability is disabled, use the webglrenderingcontext.isenabled() method: gl.isenabled(gl.dither); // false specifications specification status comment webgl 1.0the definition of 'disable' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'gldisable' in that specification. standard man page of the (similar) opengl es 2.0 api. opengl es 3.0the definition of 'gldisable' in that specification. standard man page of the (similar) opengl es 3.0 api. ...
WebGLRenderingContext.drawArrays() - Web APIs
.invalid_enum error is thrown. if first or count are negative, a gl.invalid_value error is thrown. if gl.current_program is null, a gl.invalid_operation error is thrown. examples gl.drawarrays(gl.points, 0, 8); specifications specification status comment webgl 1.0the definition of 'drawarrays' in that specification. recommendation initial definition. opengl es 2.0the definition of 'gldrawarrays' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.drawElements() - Web APIs
ot a valid multiple of the size of the given type, a gl.invalid_operation error is thrown. if count is negative, a gl.invalid_value error is thrown. examples gl.drawelements(gl.points, 8, gl.unsigned_byte, 0); specifications specification status comment webgl 1.0the definition of 'drawelements' in that specification. recommendation initial definition. opengl es 2.0the definition of 'gldrawelements' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.enable() - Web APIs
ommands are ignored. return value none. examples gl.enable(gl.dither); to check if a capability is enabled, use the webglrenderingcontext.isenabled() method: gl.isenabled(gl.dither); // true specifications specification status comment webgl 1.0the definition of 'enable' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glenable' in that specification. standard man page of the opengl es 2.0 api. opengl es 3.0the definition of 'glenable' in that specification. standard man page of the opengl es 3.0 api. ...
WebGLRenderingContext.framebufferRenderbuffer() - Web APIs
. a gl.invalid_enum error is thrown if attachment is not one of the allowed enums. examples gl.framebufferrenderbuffer(gl.framebuffer, gl.color_attachment0, gl.renderbuffer, renderbuffer); specifications specification status comment webgl 1.0the definition of 'framebufferrenderbuffer' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glframebufferrenderbuffer' in that specification. standard man page of the (similar) opengl api. opengl es 3.0the definition of 'glframebufferrenderbuffer' in that specification. standard man page of the (similar) opengl es 3 api. ...
WebGLRenderingContext.framebufferTexture2D() - Web APIs
. a gl.invalid_operation error is thrown if texture isn't 0 or the name of an existing texture object. examples gl.framebuffertexture2d(gl.framebuffer, gl.color_attachment0, gl.texture_2d, texture, 0); specifications specification status comment webgl 1.0the definition of 'framebuffertexture2d' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glframebuffertexture2d' in that specification. standard man page of the (similar) opengl es 2 api. opengl es 3.0the definition of 'glframebuffertexture2d' in that specification. standard man page of the (similar) opengl es 3 api. ...
WebGLRenderingContext.frontFace() - Web APIs
mode a glenum type winding orientation. the default value is gl.ccw. possible values: gl.cw: clock-wise winding. gl.ccw: counter-clock-wise winding. return value none. examples gl.frontface(gl.cw); specifications specification status comment webgl 1.0the definition of 'frontface' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glfrontface' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.generateMipmap() - Web APIs
additionally: gl.texture_3d: a three-dimensional texture. gl.texture_2d_array: a two-dimensional array texture. return value none. examples gl.generatemipmap(gl.texture_2d); specifications specification status comment webgl 1.0the definition of 'generatemipmap' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glgeneratemipmap' in that specification. standard man page of the (similar) opengl es 2.0 api. opengl es 3.0the definition of 'glgeneratemipmap' in that specification. standard man page of the (similar) opengl es 3.0 api. adds: gl.texture_3d and gl.texture_2d_array ...
WebGLRenderingContext.getAttribLocation() - Web APIs
of the attribute variable whose location to get. return value a glint number indicating the location of the variable name if found. returns -1 otherwise. examples gl.getattriblocation(program, 'vcolor'); specifications specification status comment webgl 1.0the definition of 'getattriblocation' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glgetattriblocation' in that specification. standard main page of the opengl api. ...
WebGLRenderingContext.getError() - Web APIs
d on the first call to geterror. afterwards and until the context has been restored, it returns gl.no_error. examples gl.geterror(); // gl.no_error (0) gl.enable(gl.foobar); gl.geterror(); // gl.invalid_enum; specifications specification status comment webgl 1.0the definition of 'geterror' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glgeterror' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.getProgramParameter() - Web APIs
er of uniform blocks containing active uniforms. return value returns the requested program information (as specified with pname). examples gl.getprogramparameter(program, gl.delete_status); specifications specification status comment webgl 1.0the definition of 'getprogramparameter' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glgetprogramiv' in that specification. standard man page of the (similar) opengl api. webgl 2.0the definition of 'getprogramparameter' in that specification. editor's draft adds new pname values: gl.transform_feedback_buffer_mode, gl.transform_feedback_varyings, gl.active_uniform_blocks ...
WebGLRenderingContext.getShaderInfoLog() - Web APIs
shadercode); /* compile shader source code. */ gl.compileshader(shader); var message = gl.getshaderinfolog(shader); if (message.length > 0) { /* message may be an error or a warning */ throw message; } specifications specification status comment webgl 1.0the definition of 'getshaderinfolog' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glgetshaderinfolog' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.getShaderParameter() - Web APIs
ertex_shader) or fragment shader (gl.fragment_shader) object. return value returns the requested shader information (as specified with pname). examples gl.getshaderparameter(shader, gl.shader_type); specifications specification status comment webgl 1.0the definition of 'getshaderparameter' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glgetshaderiv' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.getShaderSource() - Web APIs
return value a domstring containing the source code of the shader. examples var shader = gl.createshader(gl.vertex_shader); gl.shadersource(shader, originalsource); var source = gl.getshadersource(shader); specifications specification status comment webgl 1.0the definition of 'getshadersource' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glgetshadersource' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.getUniform() - Web APIs
y (with 8 elements) mat4x3 float32array (with 12 elements) any sampler type glint examples var loc = gl.getuniformlocation(program, 'u_foobar'); gl.getuniform(program, loc); specifications specification status comment webgl 1.0the definition of 'getuniform' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glgetuniform' in that specification. standard man page of the (similar) opengl es 2 api. webgl 2.0the definition of 'getuniform' in that specification. editor's draft updated definition for webgl. opengl es 3.0the definition of 'glgetuniform' in that specification. standard man page of the (similar) opengl es 3 api. ...
WebGLRenderingContext.getUniformLocation() - Web APIs
ively. having done this, the next time the shading functions are called, their own variables named uscalingfactor, uglobalcolor, and urotationvector will all have the values provided by the javascript code. specifications specification status comment webgl 1.0the definition of 'getuniformlocation' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glgetuniformlocation' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.getVertexAttrib() - Web APIs
r instanced rendering. return value returns the requested vertex attribute information (as specified with pname). examples gl.getvertexattrib(0, gl.vertex_attrib_array_buffer_binding); specifications specification status comment webgl 1.0the definition of 'getvertexattrib' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glgetvertexattrib' in that specification. standard man page of the opengl es 2 api. webgl 2.0the definition of 'getvertexattrib' in that specification. editor's draft updated definition for webgl 2. opengl es 3.0the definition of 'glgetvertexattrib' in that specification. standard man page of the opengl es 3 api. ...
WebGLRenderingContext.getVertexAttribOffset() - Web APIs
e a glenum which must be gl.vertex_attrib_array_pointer. return value a glintptr indicating the address of the vertex attribute. examples gl.getvertexattriboffset(i, gl.vertex_attrib_array_pointer); specifications specification status comment webgl 1.0the definition of 'getvertexattriboffset' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glgetvertexattribpointerv' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.hint() - Web APIs
return value none. examples the following example hints that the quality of filtering when generating mipmap images should be most efficient instead of best quality. gl.hint(gl.generate_mipmap_hint, gl.fastest); specifications specification status comment webgl 1.0the definition of 'hint' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glhint' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.isBuffer() - Web APIs
n indicating whether or not the buffer is valid. examples creating a buffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var buffer = gl.createbuffer(); gl.isbuffer(buffer); specifications specification status comment webgl 1.0the definition of 'isbuffer' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glisbuffer' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.isEnabled() - Web APIs
t); // false to activate or deactivate a specific capability, use the webglrenderingcontext.enable() and webglrenderingcontext.disable() methods: gl.enable(gl.stencil_test); gl.disable(gl.stencil_test); specifications specification status comment webgl 1.0the definition of 'isenabled' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glisenabled' in that specification. standard man page of the (similar) opengl es 2.0 api. webgl 2.0the definition of 'isenabled' in that specification. editor's draft updated definition for webgl 2. opengl es 3.0the definition of 'glisenabled' in that specification. standard man page of the (similar) opengl es 3.0 api. ...
WebGLRenderingContext.isFramebuffer() - Web APIs
buffer is valid. examples checking a frame buffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var framebuffer = gl.createframebuffer(); gl.isframebuffer(framebuffer); specifications specification status comment webgl 1.0the definition of 'isframebuffer' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glisframebuffer' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.isProgram() - Web APIs
ether or not the program is valid. examples checking a program var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var program = gl.createprogram(); // ... gl.isprogram(program); specifications specification status comment webgl 1.0the definition of 'isprogram' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glisprogram' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.isRenderbuffer() - Web APIs
er is valid. examples checking a renderbuffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var renderbuffer = gl.createrenderbuffer(); gl.isrenderbuffer(renderbuffer); specifications specification status comment webgl 1.0the definition of 'isrenderbuffer' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glisrenderbuffer' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.isShader() - Web APIs
not the shader is valid. examples checking a shader var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var shader = gl.createshader(gl.vertex_shader); // ... gl.isshader(shader); specifications specification status comment webgl 1.0the definition of 'isshader' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glisshader' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.isTexture() - Web APIs
ating whether or not the texture is valid. examples checking a texture var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var texture = gl.createtexture(); gl.istexture(texture); specifications specification status comment webgl 1.0the definition of 'istexture' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glistexture' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.polygonOffset() - Web APIs
eck the current polygon offset factor or units, query the polygon_offset_factor and polygon_offset_units constants. gl.getparameter(gl.polygon_offset_factor); // 2 gl.getparameter(gl.polygon_offset_units); // 3 specifications specification status comment webgl 1.0the definition of 'polygonoffset' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glpolygonoffset' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.sampleCoverage() - Web APIs
to check the sample coverage values, query the sample_coverage_value and sample_coverage_invert constants. gl.getparameter(gl.sample_coverage_value); // 0.5 gl.getparameter(gl.sample_coverage_invert); // false specifications specification status comment webgl 1.0the definition of 'samplecoverage' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glsamplecoverage' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.shaderSource() - Web APIs
domstring containing the glsl source code to set. return value none. examples var shader = gl.createshader(gl.vertex_shader); gl.shadersource(shader, originalsource); var source = gl.getshadersource(shader); specifications specification status comment webgl 1.0the definition of 'shadersource' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glshadersource' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.stencilMask() - Web APIs
e stencil_writemask, stencil_back_writemask, or stencil_bits constants. gl.getparameter(gl.stencil_writemask); // 110101 gl.getparameter(gl.stencil_back_writemask); // 110101 gl.getparameter(gl.stencil_bits); // 0 specifications specification status comment webgl 1.0the definition of 'stencilmask' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glstencilmask' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.stencilMaskSeparate() - Web APIs
l_writemask, stencil_back_writemask, or stencil_bits constants. gl.getparameter(gl.stencil_writemask); // 110101 gl.getparameter(gl.stencil_back_writemask); // 110101 gl.getparameter(gl.stencil_bits); // 0 specifications specification status comment webgl 1.0the definition of 'stencilmaskseparate' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glstencilmaskseparate' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.texImage2D() - Web APIs
rrently bound webgltexture from the webglbuffer bound to the pixel_unpack_buffer target. return value none. examples gl.teximage2d(gl.texture_2d, 0, gl.rgba, gl.rgba, gl.unsigned_byte, image); specifications specification status comment webgl 1.0the definition of 'teximage2d' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glteximage2d' in that specification. standard man page of the (similar) opengl es 2.0 api. webgl 2.0the definition of 'teximage2d' in that specification. editor's draft updated definition for webgl. opengl es 3.0the definition of 'glteximage2d' in that specification. standard man page of the (similar) opengl es 3.0 api. ...
WebGLRenderingContext.texParameter[fi]() - Web APIs
ored_repeat. return value none. examples gl.texparameterf(gl.texture_2d, gl.texture_mag_filter, gl.linear); gl.texparameteri(gl.texture_2d, gl.texture_min_filter, gl.linear_mipmap_nearest); specifications specification status comment webgl 1.0the definition of 'texparameter[fi]' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'gltexparameter' in that specification. standard man page of the (similar) opengl es 2.0 api. webgl 2.0the definition of 'texparameter[fi]' in that specification. editor's draft updated definition for webgl. opengl es 3.0the definition of 'gltexparameter' in that specification. standard man page of the (similar) opengl es 3.0 api. ...
WebGLRenderingContext.texSubImage2D() - Web APIs
ntly bound webgltexture from the webglbuffer bound to the pixel_unpack_buffer target. return value none. examples gl.texsubimage2d(gl.texture_2d, 0, 0, 0, gl.rgba, gl.unsigned_byte, image); specifications specification status comment webgl 1.0the definition of 'texsubimage2d' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'gltexsubimage2d' in that specification. standard man page of the (similar) opengl es 2.0 api. webgl 2.0the definition of 'texsubimage2d' in that specification. editor's draft updated definition for webgl. opengl es 3.0the definition of 'gltexsubimage2d' in that specification. standard man page of the (similar) opengl es 3.0 api. ...
WebGLRenderingContext.uniform[1234][fi][v]() - Web APIs
or methods (methods with "fv"). an integer number for integer values (methods with "i"). an int32array for integer vector methods (methods with "iv"). return value none. examples gl.uniform1f(u_alpha, 0.8); specifications specification status comment webgl 1.0the definition of 'uniform' in that specification. recommendation initial definition. opengl es 2.0the definition of 'gluniform' in that specification. standard main page of the opengl api. ...
WebGLRenderingContext.uniformMatrix[234]fv() - Web APIs
st be false. value a float32array or sequence of glfloat values. the values are assumed to be supplied in column major order. return value undefined examples gl.uniformmatrix2fv(loc, false, [2,1, 2,2]); specifications specification status comment webgl 1.0the definition of 'uniformmatrix' in that specification. recommendation initial definition. opengl es 2.0the definition of 'gluniform' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.useProgram() - Web APIs
none. examples var program = gl.createprogram(); // attach pre-existing shaders gl.attachshader(program, vertexshader); gl.attachshader(program, fragmentshader); gl.linkprogram(program); gl.useprogram(program); specifications specification status comment webgl 1.0the definition of 'useprogram' in that specification. recommendation initial definition. opengl es 2.0the definition of 'gluseprogram' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.viewport() - Web APIs
rns an int32array. gl.getparameter(gl.max_viewport_dims); // e.g. int32array[16384, 16384] to get the current viewport, query the viewport constant. gl.getparameter(gl.viewport); // e.g. int32array[0, 0, 640, 480] specifications specification status comment webgl 1.0the definition of 'viewport' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glviewport' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext - Web APIs
the webglrenderingcontext interface provides an interface to the opengl es 2.0 graphics rendering context for the drawing surface of an html <canvas> element. to get an access to a webgl context for 2d and/or 3d graphics rendering, call getcontext() on a <canvas> element, supplying "webgl" as the argument: var canvas = document.getelementbyid('mycanvas'); var gl = canvas.getcontext('webgl'); once you have the webgl rendering context for a canvas, you can render within it. the webgl tutorial has more information, examples, and resources on how to get started with webgl. if you require a webgl 2.0 context, see webgl2renderingcontext; this supplies access to an implementation of opengl es 3.0 graphics. constants see the webgl constants page. the webgl context the following properties ...
Basic scissoring - Web APIs
ing graphics operations, by applying color masking. in other cases, the fragments may be discarded altogether (so the pixel value is not updated), or it may interact with the already existing pixel value (such as when doing color blending for non-opaque elements in the scene). here we see another example of the distinction between fragments and pixels. scissoring is a distinct stage in the webgl/opengl graphics pipeline (it occurs after color clearing, but before color masking). before the actual pixels are updated, fragments must go through the scissor test. if the fragments pass the scissor test, they continue down the graphics pipeline, and the corresponding pixels are updated on the screen. if they fail the test, they are immediately discarded, no further processing occurs, and pixels are...
Clearing with colors - Web APIs
the clear() method. this is typical of how drawing is done with webgl. there is only a handful of methods for actual drawing (clear() is one of them). all other methods are for setting and querying webgl state variables (such as the clear color). there are many "dials" and "switches" that affect drawing with webgl. the clear color is just the first of many you will get to know. this is why webgl/opengl is often called a state machine. by tweaking those "dials" and "switches" you can modify the internal state of the webgl machine, which in turn changes how input (in this case, a clear command) translates into output (in this case, all pixels are set to green). finally, we note that color in webgl is usually in rgba format, that is four numerical components for red, green, blue and alpha (opac...
Animating objects with WebGL - Web APIs
then subtract from it the last time to compute deltatime which is the number of second since the last frame was rendered. at the end of drawscene we add the code to update squarerotation. squarerotation += deltatime; this code uses the amount of time that's passed since the last time we updated the value of squarerotation to determine how far to rotate the square. view the complete code | open this demo on a new page « previousnext » ...
Animating textures in WebGL - Web APIs
w the scene repeatedly function render(now) { now *= 0.001; // convert to seconds const deltatime = now - then; then = now; if (copyvideo) { updatetexture(gl, texture, video); } drawscene(gl, programinfo, buffers, texture, deltatime); requestanimationframe(render); } requestanimationframe(render); that's all there is to it! view the complete code | open this demo on a new page ...
Creating 3D objects using WebGL - Web APIs
er side, or 36 total vertices in the cube, even though many of them are duplicates. finally, let's replace our variable squarerotation by cuberotation and add a second rotation around the x axis: mat4.rotate(modelviewmatrix, modelviewmatrix, cuberotation * .7, [0, 1, 0]); at this point, we now have an animated cube rotating, its six faces rather vividly colored. view the complete code | open this demo on a new page « previousnext » ...
Lighting in WebGL - Web APIs
...
Using shaders to apply color in WebGL - Web APIs
onst normalize = false; const stride = 0; const offset = 0; gl.bindbuffer(gl.array_buffer, buffers.color); gl.vertexattribpointer( programinfo.attriblocations.vertexcolor, numcomponents, type, normalize, stride, offset); gl.enablevertexattribarray( programinfo.attriblocations.vertexcolor); } view the complete code | open this demo on a new page « previousnext » ...
Using textures in WebGL - Web APIs
it 0. we then tell the shader that for the usampler use texture unit 0. lastly, add texture as a parameter to the drawscene() function, both where it is defined and where it is called. drawscene(gl, programinfo, buffers, texture, deltatime); ... function drawscene(gl, programinfo, buffers, texture, deltatime) { at this point, the rotating cube should be good to go. view the complete code | open this demo on a new page cross-domain textures loading of webgl textures is subject to cross-domain access controls. in order for your content to load a texture from another domain, cors approval needs to be be obtained. see http access control for details on cors. because webgl now requires textures to be loaded from secure contexts, you can't use textures loaded from file:/// urls in webgl. t...
WebGL tutorial - Web APIs
webgl programs consist of control code written in javascript and special effects code (shader code) that is executed on a computer's graphics processing unit (gpu). webgl elements can be mixed with other html elements and composited with other parts of the page or page background. this tutorial describes how to use the <canvas> element to draw webgl graphics, starting with the basics. the examples provided should give you some clear ideas what you can do with webgl and will provide code snippets that may get you started in building your own content. ...
WebRTC connectivity - Web APIs
remote peer. the stun server then replies to the initiator's request with a candidate whose ip address is unrelated to the remote peer. relay a relay candidate is generated just like a server reflexive candidate ("srflx"), but using turn instead of stun. tcp candidate types tcp candidates (that is, candidates whose protocol is tcp) can be of these types: active the transport will try to open an outbound connection but won't receive incoming connection requests. this is the most common type, and the only one that most user agents will gather. passive the transport will receive incoming connection attempts but won't attempt a connection itself. so the transport will try to simultaneously open a connection with its peer. choosing a candidate pair the ice layer selects one of the ...
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
le that implements the perfect negotiation pattern. the code assumes that there's a signalingchannel class defined that is used to communicate with the signaling server. your own code, of course, can use any signaling technique you like. note that this code is identical for both peers involved in the connection. create the signaling and peer connections first, the signaling channel needs to be opened and the rtcpeerconnection needs to be created. the stun server listed here is obviously not a real one; you'll need to replace stun.myserver.tld with the address of a real stun server. const constraints = { audio: true, video: true }; const config = { iceservers: [{ urls: "stun:stun.mystunserver.tld" }] }; const selfvideo = document.queryselector("video.selfview"); const remotevideo = docum...
Taking still photos with WebRTC - Web APIs
ng mediadevices.getusermedia() and requesting a video stream (without audio). it returns a promise which we attach success and failure callbacks to. the success callback receives a stream object as input. it is the <video> element's source to our new stream. once the stream is linked to the <video> element, we start it playing by calling htmlmediaelement.play(). the error callback is called if opening the stream doesn't work. this will happen for example if there's no compatible camera connected, or the user denied access. listen for the video to start playing after calling htmlmediaelement.play() on the <video>, there's a (hopefully brief) period of time that elapses before the stream of video begins to flow. to avoid blocking until that happens, we add an event listener to video for the...
Using DTMF with WebRTC - Web APIs
didate object from the event.candidate string and "transmit" it to the receiver by calling receiverpc.addicecandidate(), providing the new rtcicecandidate as its input. if addicecandidate() fails, the catch() clause outputs the error to our log box. if event.candidate is null, that indicates that there are no more candidates available, and we log that information. dialing once the connection is open our design requires that when the connection is established, we immediately send the dtmf string. to accomplish that, we watch for the caller to receive an iceconnectionstatechange event. this event is sent when one of a number of changes occurs to the state of the ice connection process, including the successful establishment of a connection. function handlecallericeconnectionstatechange() { ...
WebSocket: close event - Web APIs
when a connection with a websocket is closed. bubbles no cancelable no interface closeevent event handler property onclose examples you might want to know when the connection has been closed so that you can update the ui or, perhaps, save data about the closed connection. given that you have a variable called examplesocket that refers to an opened websocket, this handler would handle the situation where the socket has been closed. examplesocket.addeventlistener('close', (event) => { console.log('the connection has been closed successfully.'); )}; you can perform the same actions using the event handler property, like this: examplesocket.onclose = function (event) { console.log('the connection has been closed successfully.'); }; s...
WebSocket.readyState - Web APIs
the websocket.readystate read-only property returns the current state of the websocket connection. syntax var readystate = awebsocket.readystate; value one of the following unsigned short values: value state description 0 connecting socket has been created. the connection is not yet open. 1 open the connection is open and ready to communicate. 2 closing the connection is in the process of closing. 3 closed the connection is closed or couldn't be opened. specifications specification status comment html living standardthe definition of 'websocket: readystate' in that specification. living standard initial definition ...
WebSocket.send() - Web APIs
Web › API › WebSocket › send
o be transmitted in a binary frame. the value of bufferedamount is increased by the byte size of that raw data. arraybufferview you can send any javascript typed array object as a binary frame; its binary data contents are queued in the buffer, increasing the value of bufferedamount by the requisite number of bytes. exceptions thrown invalid_state_err the connection is not currently open. syntax_err the data is a string that has unpaired surrogates. note: gecko's implementation of the send() method differs somewhat from the specification in gecko 6.0; gecko returns a boolean indicating whether or not the connection is still open (and, by extension, that the data was successfully queued or transmitted); this is corrected in gecko 8.0. as of gecko 11.0, support for arraybuffe...
Writing a WebSocket server in C# - Web APIs
pt> // http://www.websocket.org/echo.html var button = document.queryselector("button"), output = document.queryselector("#output"), textarea = document.queryselector("textarea"), // wsuri = "ws://echo.websocket.org/", wsuri = "ws://127.0.0.1/", websocket = new websocket(wsuri); button.addeventlistener("click", onclickbutton); websocket.onopen = function (e) { writetoscreen("connected"); dosend("websocket rocks"); }; websocket.onclose = function (e) { writetoscreen("disconnected"); }; websocket.onmessage = function (e) { writetoscreen("<span>response: " + e.data + "</span>"); }; websocket.onerror = function (e) { writetoscreen("<span class=error>error:</span> " + e.data...
The WebSocket API (WebSockets) - Web APIs
with this api, you can send messages to a server and receive event-driven responses without having to poll the server for a reply. note: while a websocket connection is functionally somewhat similar to standard unix-style sockets, they are not related. interfaces websocket the primary interface for connecting to a websocket server and then sending and receiving data on the connection. closeevent the event sent by the websocket object when the connection closes. messageevent the event sent by the websocket object when a message is received from the server. ...
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
a up, while negative values will move it down. canting (rolling left and right) cant (or roll) is a rotation of the camera around its roll axis; that is, the camera remains fixed in space, and remains pointed at the same location, but rotates around so that the top of the camera is pointed in a different direction. you can visualize this by holding your arm out in front of you with your hand open, palm down. imagine that your hand is the camera and the back of your hand represents the top of the camera. now rotate your hand so that the "camera" is upside-down. you have just canted your hand around the roll axis. in cinematography, cant can be used to simulate various types of unsteady motion such as waves or turbulence, but can also be used for dramatic effect. to accomplish this rotatio...
Fundamentals of WebXR - Web APIs
mplex tasks, it's unlikely that you'll directly use webgl to render your scene in most cases. instead, you'll probably do most of your work making use of one of the frameworks or libraries that are built atop webgl to make it more convenient to use. a particular benefit to using a framework rather than directly using the webgl api is that libraries tend to implement virtual camera functionality. opengl (and thus webgl by extension) does not directly offer a camera view, using a library that simulates one on your behalf can make your job much, much easier, especially when building code that allows free movement through your virtual world. since webgl is used for rendering the 3d world into the webxr session, you should first be familiar with webgl's general usage, and with the basics of 3d gr...
Inputs and input sources - Web APIs
s changed by applying a delta to its rotation around the three axes, updating its orientation vector, then recomputing its reference space. action the avatar performs an action, such as using an object or weapon, jumping, or any other activity not related to basic movement and rotation. some inputs are instead used to control the application rather than the avatar. for example, a button might open an options menu used to configure the application. while that menu is open, inputs that would otherwise control the avatar might be instead applied to controlling the menu's interface. using keyboard and mouse events capturing input from the keyboard and mouse is done just like it is in any web application. set up handlers for the events that you need to handle in order to obtain the inputs you...
WebXR permissions and security - Web APIs
's fulfillment handler. if the document making the request isn't the one which is responsible for the script, the request is denied. if the document making the request isn't trustworthy, the request is denied and false is returned through the promise's fulfillment routine. a trustworthy document is one which is both responsible and active, and which currently has focus. if the user's intent to open an inline xr presentation is not well understood, the request is denied. understanding of the user's intent may be either implicit or explicit. note: additional requirements may be put into effect due to the specific features requested by the options object when calling requestsession(). user intent user intent is the concept of whether or not an action being performed by code is being perf...
Starting up and shutting down a WebXR session - Web APIs
er javascript features your target browsers include. webxr api emulator extension the mozilla webxr team has created a webxr api emulator browser extension, compatible with both firefox and chrome, which emulates the webxr api, simulating a variety of compatible devices such as the htc vive, the oculus go and oculus quest, samsung gear, and google cardboard. with the extension in place, you can open up a developer tools panel that lets you control the position and orientation of the headset and any hand controllers, as well as button presses on the controllers. emulator usage while somewhat awkward compared to using an actual headset, this makes it possible to experiment with and developer webxr code on a desktop computer, where webxr isn't normally available. it also lets you perform some...
Controlling multiple parameters with ConstantSourceNode - Web APIs
, and the volume control to change the volume of the notes e and g in the chord.</p> css .controls { width: 400px; position: relative; vertical-align: middle; height: 44px; } .button { font-size: 32px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -o-user-select: none; } .right { width: 50%; font: 14px "open sans", "lucida grande", "arial", sans-serif; position: absolute; right: 0; display: table-cell; vertical-align: middle; } .right span { vertical-align: middle; } .right input { vertical-align: baseline; } .left { width: 50%; position: absolute; left: 0; display: table-cell; vertical-align: middle; } .left span, .left input { vertical-align: middle; } javascript now ...
Using the Web Storage API - Web APIs
'#a4509b'); note: it's recommended to use the web storage api (setitem, getitem, removeitem, key, length) to prevent the pitfalls associated with using plain objects as key-value stores. the two mechanisms within web storage are as follows: sessionstorage maintains a separate storage area for each given origin that's available for the duration of the page session (as long as the browser is open, including page reloads and restores). localstorage does the same thing, but persists even when the browser is closed and reopened. these mechanisms are available via the window.sessionstorage and window.localstorage properties (to be more precise, in supporting browsers the window object implements the windowlocalstorage and windowsessionstorage objects, which the localstorage and sessionstor...
Web Storage API - Web APIs
the web storage api provides mechanisms by which browsers can store key/value pairs, in a much more intuitive fashion than using cookies. web storage concepts and usage the two mechanisms within web storage are as follows: sessionstorage maintains a separate storage area for each given origin that's available for the duration of the page session (as long as the browser is open, including page reloads and restores) stores data only for a session, meaning that the data is stored until the browser (or tab) is closed. data is never transferred to the server. storage limit is larger than a cookie (at most 5mb). localstorage does the same thing, but persists even when the browser is closed and reopened. stores data with no expiration date, and gets cleared only through...
Functions and classes available to Web Workers - Web APIs
ming enables retrieval and analysis of detailed data regarding various aspects of an application's network performance. (yes) (yes) (yes) (yes) promise javascript objects that allow you to write asynchronous functions. 28 (28) (yes) (yes) (yes) server-sent events allows a server to push data to a web page at any point, after a connection has been opened to it. 53 (53) (currently only available in dedicated and shared workers; not service workers.) ? (yes) ? serviceworkerregistration you can register a service worker from inside a standard worker, and use associated functionality. 40 (40) no support (yes) no support textencoder and textdecoder create and return a new textencoder, or respectively t...
Window.confirm() - Web APIs
Web › API › Window › confirm
message and two buttons: ok and cancel. syntax result = window.confirm(message); parameters message a string you want to display in the alert dialog. return value a boolean indicating whether ok (true) or cancel (false) was selected. if a browser is ignoring in-page dialogs, then the returned value is always false. example if (window.confirm("do you really want to leave?")) { window.open("exit.html", "thanks for visiting!"); } produces: notes the following text is shared between this article, dom:window.prompt and dom:window.alert dialog boxes are modal windows — they prevent the user from accessing the rest of the program's interface until the dialog box is closed. for this reason, you should not overuse any function that creates a dialog box (or modal window). regard...
Window.customElements - Web APIs
specification specification status comment html living standardthe definition of 'window.customelements' in that specification. living standard initial definition. browser compatibility the compatibility table in this page is gener...
Window.defaultStatus - Web APIs
window. syntax var smsg = window.defaultstatus; window.defaultstatus = smsg; parameters smsg is a string containing the text to be displayed by default in the statusbar. example <html> <body onload="window.defaultstatus='hello!';"/> <button onclick="window.confirm('are you sure you want to quit?');">confirm</button> </body> </html> notes to set the status once the window has been opened, use window.status. specification html5 ...
window.dump() - Web APIs
Web › API › Window › dump
it by setting the preference browser.dom.window.dump.enabled to true. you can set the preference in about:config or in a user.js file. note: this preference is not listed in about:config by default, you may need to create it (right-click the content area -> new -> boolean). on windows, you will need a console to actually see anything. if you don't have one already, closing the application and re-opening it with the command line parameter -console should create the console or use -attach-console to use the existing console. on other operating systems, it's enough to launch the application from a terminal. to redirect the console output to a file, run firefox without the -console option and use the syntax to redirect stderr and stdout to a file, i.e.: firefox > console.txt 2>&1 if you woul...
Window.pageYOffset - Web APIs
of the target element. this will automatically set the scrolling position to the maximum possible value if the attempted scroll would exceed the maximum. this prevents us from falling off the edge of the document. nobody wants to know what's out there. there might be dragons. css iframe { width: 620px; height: 450px; border: 1px solid black; } #info { margin-top: 20px; font: 16px "open sans", "helvetica", "arial"; } result the result follows. note that the frame's contents have been scrolled to show the section named "overview", and that the value of the pageyoffset property is shown with the corresponding value. specification specification status comment css object model (cssom) view modulethe definition of 'window.pageyoffset' in that specif...
Window: pageshow event - Web APIs
try loading new pages into this tab, then navigating forward and backward through history, noting the events’ output to the log.</p> results specifications specification status comment html living standardthe definition of 'pageshow' in that specification. living standard initial spec...
Window.print() - Web APIs
Web › API › Window › print
however in more recent versions of safari, it may return immediately. syntax window.print() specification specification status comment html living standardthe definition of 'print()' in that specification. living standard browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
Window.prompt() - Web APIs
Web › API › Window › prompt
e that in internet explorer 7 and 8, if you do not provide this parameter, the string "undefined" is the default value. return value a string containing the text entered by the user, or null. example let sign = prompt("what's your sign?"); if (sign.tolowercase() == "scorpio") { alert("wow! i'm a scorpio too!"); } // there are many ways to use the prompt feature sign = window.prompt(); // open the blank prompt window sign = prompt(); // open the blank prompt window sign = window.prompt('are you feeling lucky'); // open the window with text "are you feeling lucky" sign = window.prompt('are you feeling lucky', 'sure'); // open the window with text "are you feeling lucky" and default value "sure" when the user clicks the ok button, text entered in the input field is returned. if t...
Window.sessionStorage - Web APIs
the read-only sessionstorage property accesses a session storage object for the current origin. sessionstorage is similar to localstorage; the difference is that while data in localstorage doesn't expire, data in sessionstorage is cleared when the page session ends. a page session lasts as long as the browser is open, and survives over page reloads and restores. opening a page in a new tab or window creates a new session with the value of the top-level browsing context, which differs from how session cookies work. opening multiple tabs/windows with the same url creates sessionstorage for each tab/window. closing a tab/window ends the session and clears objects in sessionstorage. data stored in sessionstorage is specific to the protocol of the page. in particular, data stored by a scri...
Window.sidebar - Web APIs
Web › API › Window › sidebar
specification mozilla-specific. not part of any standard. ...
Window: unload event - Web APIs
resource is being unloaded. bubbles no cancelable no interface event event handler property onunload it is fired after: beforeunload (cancelable event) pagehide the document is in the following state: all the resources still exist (img, iframe etc.) nothing is visible anymore to the end user ui interactions are ineffective (window.open, alert, confirm, etc.) an error won't stop the unloading workflow please note that the unload event also follows the document tree: parent frame unload will happen before child frame unload (see example below). examples <!doctype html> <html> <head> <title>parent frame</title> <script> window.addeventlistener('beforeunload', function(event) { console.log('i am the 1st...
Window.window - Web APIs
Web › API › Window › window
sing window.settimeout. alert(window === window.window); // displays "true" the point of having the window property refer to the object itself, was likely to make it easy to refer to the global object. otherwise, you'd have to do a manual var window = this; assignment at the top of your script. another reason, is that without this property you wouldn't be able to write, for example, "window.open('http://google.com/')". you'd have to use "open('http://google.com/')" instead. yet another reason to use this property, is for libraries which wish to offer oop-versions, and non-oop versions (especially javascript modules). for example, if we refer to "this.window.location.href", a javascript module could define a property called "window" inside of a class it defined (since no global "window" ...
WindowClient.visibilityState - Web APIs
(see document.visibilitystate for values). example event.waituntil(clients.matchall({ type: "window" }).then(function(clientlist) { for (let i = 0; i < clientlist.length; i++) { let client = clientlist[i]; if (client.url == '/' && 'focus' in client) { if (client.visibilitystate === 'hidden') return client.focus(); } } } if (clients.openwindow) { return clients.openwindow('/'); } })); }); specifications specification status comment service workersthe definition of 'visibilitystate' in that specification. working draft initial definition. ...
WindowEventHandlers.onbeforeprint - Web APIs
the beforeprint and afterprint events allow pages to change their content before printing starts (perhaps to remove a banner, for example) and then revert those changes after printing has completed. in general, you should prefer the use of an @media print css at-rule, but it may be necessary to use these events in some cases. syntax window.addeventlistener("beforeprint", function(event) { ... ...
WindowEventHandlers.onunload - Web APIs
syntax window.addeventlistener("unload", function(event) { ... }); window.onunload = function(event) { ... ...
WindowOrWorkerGlobalScope.caches - Web APIs
ject enables functionality such as storing assets for offline use, and generating custom responses to requests. syntax var mycachestorage = self.caches; // or just caches value a cachestorage object. example the following example shows how you'd use a cache in a service worker context to store assets offline. ...
WindowOrWorkerGlobalScope.crossOriginIsolated - Web APIs
the crossoriginisolated read-only property of the windoworworkerglobalscope interface returns a boolean value that indicates whether a sharedarraybuffer can be sent via a window.postmessage() call. this value is dependant on any cross-origin-opener-policy and cross-origin-embedder-policy headers present in the response. syntax var mycrossoriginisolated = self.crossoriginisolated; // or just crossoriginisolated value a boolean value examples if(crossoriginisolated) { // post sharedarraybuffer } else { // do something else } specifications specification status comment html living standardthe definition of 'crossoriginisolated' in that specification. living standard initial definition. ...
WindowOrWorkerGlobalScope.indexedDB - Web APIs
the indexeddb read-only property of the windoworworkerglobalscope mixin provides a mechanism for applications to asynchronously access the capabilities of indexed databases. syntax var idbfactory = self.indexeddb; value an idbfactory object. example the following code creates a request for a database to be opened asychronously, after which the database is opened when the request's onsuccess handler is fired: var db; function opendb() { var dbopenrequest = window.indexeddb.open('todolist'); dbopenrequest.onsuccess = function(e) { db = dbopenrequest.result; } } specifications specification status comment indexed database api draftthe definition of 'indexeddb' in that specification. recommendation defined in a windoworworkerglobalscope partial in the ...
XDomainRequest.abort() - Web APIs
aborts an xdomainrequest. syntax xdr.abort(); example var xdr = new xdomainrequest(); xdr.open("get", "http://example.com/api/method"); xdr.send(); xdr.abort(); specification not part of any specification. ...
XDomainRequest.onerror - Web APIs
an event handler which is called when an xdomainrequest encounters an error. note: there is no way to determine the cause of the error from the xdomainrequest interface. syntax xdr.onerror = funcref; parameters funcref a function to call when an error occurs. example var xdr = new xdomainrequest(); xdr.open("post", "http://example.com/api/method"); xdr.onerror = function(){ //handle error } xdr.onload = function(){ //handle response with xdr.responsetext } xdr.send("param1=value1&param2=value2"); specification not part of any specification. ...
XDomainRequest.onload - Web APIs
an event handler for when an xdomainrequest has finished receiving the response from the server. you can find the entire server response in the xdomainrequest.responsetext property. syntax xdr.onload = funcref; example var xdr = new xdomainrequest(); xdr.open("post", "http://example.com/api/method"); xdr.onload = function(){ //handle response with xdr.responsetext } xdr.send("param1=value1&param2=value2"); specification not part of any specification. ...
XDomainRequest.onprogress - Web APIs
, so that code can monitor progress while loading content. note: while handling this event, you can look at xdomainrequest.responsetext to get the response so far. once loading is complete, the xdomainrequest.onload event handler gets called. syntax xdr.onprogress = funcref; parameters funcref a function to call when progress events occur. example var xdr = new xdomainrequest(); xdr.open("post", "http://example.com/api/method"); xdr.onprogress = function(){ //handle partial response with xdr.responsetext } xdr.onload = function(){ //handle response with xdr.responsetext } xdr.send("param1=value1&param2=value2"); specification not part of any specification. ...
XDomainRequest.ontimeout - Web APIs
an event handler which is called when a pending xdomainrequest times out. syntax xdr.ontimeout = funcref; parameters funcref a function to be called when the event times out. example var xdr = new xdomainrequest(); xdr.open("post", "http://example.com/api/method"); xdr.ontimeout = function(){ //handle timeout } xdr.onload = function(){ //handle response with xdr.responsetext } xdr.send("param1=value1&param2=value2"); specification not part of any specification. ...
XDomainRequest.send() - Web APIs
sends an xdomainrequest which has previously been opened calling xdomainrequest.open(). syntax xdr.send(data); parameters data the form data to be sent with the request. this parameter is optional for get requests. example var xdr = new xdomainrequest(); xdr.open("post", "http://example.com/api/method"); xdr.onload = function(){ //handle response with xdr.responsetext } xdr.send("param1=value1&param2=value2"); specification not part of any specification. ...
How to check the security state of an XMLHTTPRequest over SSL - Web APIs
fingerprint = " + cert.sha1fingerprint + "\n"); var validity = cert.validity.queryinterface(ci.nsix509certvalidity); dump("\tvalid from " + validity.notbeforegmt + "\n"); dump("\tvalid until " + validity.notaftergmt + "\n"); } } catch(err) { alert(err); } } function test(url) { var req = cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createinstance(); req.open('get', url, true); req.addeventlistener("error", function(e) { var error = createtcperrorfromfailedxhr(req); dumpsecurityinfo(req, error); }, false); req.onload = function(e) { dumpsecurityinfo(req); }; req.send(); } then test("https://addons.mozilla.org"); produced the following output in my console: connection status: succeeded security info: ...
XMLHttpRequest() - Web APIs
the xmlhttprequest() constructor creates a new xmlhttprequest. for details about how to use xmlhttprequest, see using xmlhttprequest. syntax const request = new xmlhttprequest(); parameters none. return value a new xmlhttprequest object. the object must be prepared by at least calling open() to initialize it before calling send() to send the request to the server. non-standard firefox syntax firefox 16 added a non-standard parameter to the constructor that can enable anonymous mode (see bug 692677). setting the mozanon flag to true effectively resembles the anonxmlhttprequest() constructor described in older versions of the xmlhttprequest specification. const request = new xmlhttprequest(paramsdictionary); parameters (non-standard) objparameters there are two flags ...
XMLHttpRequest.abort() - Web APIs
e is changed to xmlhttprequest.unsent (0) and the request's status code is set to 0. syntax xmlhttprequest.abort() parameters none. ...
XMLHttpRequest: abort event - Web APIs
stener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); addlisteners(xhr); xhr.open("get", url); xhr.send(); return xhr; } xhrbuttonsuccess.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbuttonerror.addeventlistener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonabort.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipw...
XMLHttpRequest: error event - Web APIs
stener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); addlisteners(xhr); xhr.open("get", url); xhr.send(); return xhr; } xhrbuttonsuccess.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbuttonerror.addeventlistener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonabort.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipw...
XMLHttpRequest.getAllResponseHeaders() - Web APIs
s per the latest spec. example this example examines the headers in the request's readystatechange event handler, xmlhttprequest.onreadystatechange. the code shows how to obtain the raw header string, as well as how to convert it into an array of individual headers and then how to take that array and create a mapping of header names to their values. ...
XMLHttpRequest.getResponseHeader() - Web APIs
esponse. example in this example, a request is created and sent, and a readystatechange handler is established to look for the readystate to indicate that the headers have been received; when that is the case, the value of the content-type header is fetched. if the content-type isn't the desired value, the xmlhttprequest is canceled by calling abort(). ...
XMLHttpRequest: load event - Web APIs
stener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); addlisteners(xhr); xhr.open("get", url); xhr.send(); return xhr; } xhrbuttonsuccess.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbuttonerror.addeventlistener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonabort.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipw...
XMLHttpRequest: loadend event - Web APIs
stener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); addlisteners(xhr); xhr.open("get", url); xhr.send(); return xhr; } xhrbuttonsuccess.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbuttonerror.addeventlistener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonabort.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipw...
XMLHttpRequest: loadstart event - Web APIs
stener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); addlisteners(xhr); xhr.open("get", url); xhr.send(); return xhr; } xhrbuttonsuccess.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbuttonerror.addeventlistener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonabort.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipw...
XMLHttpRequest.mozBackgroundRequest - Web APIs
...
XMLHttpRequest.onreadystatechange - Web APIs
adystate property of the xmlhttprequest changes. warning: this should not be used with synchronous requests and must not be used from native code. syntax xmlhttprequest.onreadystatechange = callback; values callback is the function to be executed when the readystate changes. ...
XMLHttpRequest.overrideMimeType() - Web APIs
nt-type header, xmlhttprequest assumes that the mime type is "text/xml". if the content isn't valid xml, an "xml parsing error: not well-formed" error occurs. you can avoid this by calling overridemimetype() to specify a different type. // interpret the received data as plain text req = new xmlhttprequest(); req.overridemimetype("text/plain"); req.addeventlistener("load", callback, false); req.open("get", url); req.send(); specifications specification status comment xmlhttprequestthe definition of 'overridemimetype()' in that specification. living standard whatwg living standard ...
XMLHttpRequest: progress event - Web APIs
stener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); addlisteners(xhr); xhr.open("get", url); xhr.send(); return xhr; } xhrbuttonsuccess.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbuttonerror.addeventlistener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonabort.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipw...
XMLHttpRequest.responseText - Web APIs
know the entire content has been received when the value of readystate becomes xmlhttprequest.done (4), and status becomes 200 ("ok"). exceptions invalidstateerror the xmlhttprequest.responsetype is not set to either the empty string or "text". since the responsetext property is only valid for text content, any other value is an error condition. ...
XMLHttpRequest.responseType - Web APIs
cept when the request belongs to a worker. this restriction is designed in part to help ensure that synchronous operations aren't used for large transactions that block the browser's main thread, thereby bogging down the user experience. xmlhttprequests are asynchronous by default; they are only placed in synchronous mode by passing false as the value of the optional async parameter when calling open(). restrictions in workers attempts to set the value of responsetype to document are ignored in a worker. specifications specification status comment xmlhttprequest living standard whatwg living standard ...
XMLHttpRequest.responseURL - Web APIs
the read-only xmlhttprequest.responseurl property returns the serialized url of the response or the empty string if the url is null. if the url is returned, any url fragment present in the url will be stripped away. the value of responseurl will be the final url obtained after any redirects. ...
XMLHttpRequest.responseXML - Web APIs
parse it as xml anyway. this property isn't available to workers. syntax var data = xmlhttprequest.responsexml; value a document from parsing the xml or html received using xmlhttprequest, or null if no data was received or if the data is not xml/html. exceptions invalidstateerror the responsetype isn't either "document" or an empty string. ...
XMLHttpRequest.setRequestHeader() - Web APIs
if this method is called several times with the same header, the values are merged into one single request header. each time you call setrequestheader() after the first time you call it, the specified text is appended to the end of the existing header's content. if no accept header has been set using this, an accept header with the type "*/*" is sent with the request when send() is called. ...
XMLHttpRequest.timeout - Web APIs
ldn't be used for synchronous xmlhttprequests requests used in a document environment or it will throw an invalidaccesserror exception. when a timeout happens, a timeout event is fired. note: you may not use a timeout for synchronous requests with an owning window. using a timeout with an asynchronous request in internet explorer, the timeout property may be set only after calling the open() method and before calling the send() method. example var xhr = new xmlhttprequest(); xhr.open('get', '/server', true); xhr.timeout = 2000; // time in milliseconds xhr.onload = function () { // request finished. do processing here. }; xhr.ontimeout = function (e) { // xmlhttprequest timed out. do something here. }; xhr.send(null); specifications specification status co...
XMLHttpRequest: timeout event - Web APIs
the timeout event is fired when progression is terminated due to preset time expiring. bubbles no cancelable no interface progressevent event handler property ontimeout examples const client = new xmlhttprequest(); client.open('get', 'http://www.example.org/example.txt'); client.ontimeout = () => { console.error('timeout!!') }; client.send(); you could also set up the event handler using the addeventlistener() method: client.addeventlistener('timeout', () => { console.error("timeout!!"); }); specifications specification status comment xmlhttprequestthe definition of 'timeout event' in that specification. living standard ...
XMLHttpRequest.withCredentials - Web APIs
not be accessed by the requesting script through document.cookie or from response headers. note: this never affects same-site requests. ...
XMLHttpRequestEventTarget.onabort - Web APIs
equesteventtarget.onabort is the function called when an xmlhttprequest transaction is aborted, such as when the xmlhttprequest.abort() function is called. syntax xmlhttprequest.onabort = callback; values callback is the function to be executed when the transaction is aborted. example var xmlhttp = new xmlhttprequest(), method = 'get', url = 'https://developer.mozilla.org/'; xmlhttp.open(method, url, true); xmlhttp.onabort = function () { console.log('** the request was aborted'); }; xmlhttp.send(); //.. xmlhttp.abort(); // this will invoke our onabort handler above specifications specification status comment xmlhttprequest living standard whatwg living standard ...
XMLHttpRequestEventTarget.onerror - Web APIs
the xmlhttprequesteventtarget.onerror is the function called when an xmlhttprequest transaction fails due to an error. syntax xmlhttprequest.onerror = callback; values callback is the function to be executed when the request fails. ...
XMLHttpRequestEventTarget.onload - Web APIs
yntax xmlhttprequest.onload = callback; values callback is the function to be executed when the request completes successfully. it receives a progressevent object as its first argument. the value of this (i.e. the context) is the same xmlhttprequest this callback is related to. ...
XMLHttpRequestEventTarget.onloadstart - Web APIs
the xmlhttprequesteventtarget.onloadstart is the function called when an xmlhttprequest transaction starts transferring data. ...
XMLHttpRequestEventTarget.onprogress - Web APIs
ck is the function to be called periodically before the request is completed. event event.loaded the amount of data currently transfered. event.total the total amount of data to be transferred. ...
XRSession - Web APIs
Web › API › XRSession
with xrsession methods, you can poll the viewer's position and orientation (the xrviewerpose), gather information about the user's environment, and present imagery to the user. xrsession supports both inline and immersive virtual and augmented reality modes. ...
XRSessionInit - Web APIs
ort. these values currently must come from the enumerated type xrreferencespacetype. more features may be added in future updates to the webxr standard. default features immersive sessions all immersive (both immersive-vr and immersive-ar) sessions support both the viewer and local reference spaces. because immersive sessions are required to support the local reference space, any request to open an immersive xrsession is required to obtain explicit or implicit user consent. inline sessions all inline webxr sessions support the viewer reference space. security requirements each reference space or feature type has minimum safety requirements. by session type, those are: reference space type user consent rquirement feature policy requirement bounded-floor ...
XRSessionMode - Web APIs
t have viewer tracking available. inline sessions don't require special hardware and should be avalable on any user agent offering webxr api support. usage notes the xrsessionmode type indicates the values that can be specified when calling xr.issessionsupported() to determine whether or not the specified session type is supported and available to be used, and by requestsession() to attempt to open a new webxr session. the immersive-ar mode supports all the same features and reference spaces that immersive-vr does, since both are immersive sessions. browsers may support either or both of these modes, but if webxr is available, the inline mode is always supported. specifications specification status comment webxr device apithe definition of 'xrsessionmode' in t...
Web APIs
Web › API
nownelement htmlvideoelement hashchangeevent headers history hkdfparams hmacimportparams hmackeygenparams i idbcursor idbcursorsync idbcursorwithvalue idbdatabase idbdatabaseexception idbdatabasesync idbenvironment idbenvironmentsync idbfactory idbfactorysync idbindex idbindexsync idbkeyrange idblocaleawarekeyrange idbmutablefile idbobjectstore idbobjectstoresync idbopendbrequest idbrequest idbtransaction idbtransactionsync idbversionchangeevent idbversionchangerequest iirfilternode idledeadline imagebitmap imagebitmaprenderingcontext imagecapture imagedata index inputdevicecapabilities inputevent installevent installtrigger intersectionobserver intersectionobserverentry interventionreportbody k keyboard keyboardevent keyboardlayoutmap keyf...
ARIA Screen Reader Implementors Guide - Accessibility
the following is intended to provide implementation guidance that respects screen readers developers' need to try different things. the intention is to strike a balance between providing useful guidance on how to use the markup's intended meaning while supporting live regions as an area for screen readers to innovate and compete. ...
Using the aria-labelledby attribute - Accessibility
</div> ... </div> notes the most common accessibility api mapping for a label is the accessible name property used by aria roles all elements of the base markup related aria techniques using the aria-label attribute using the aria-describedby attribute compatibility tbd:...
ARIA: dialog role - Accessibility
tent outside the dialog. in other words, the main application ui or page content is considered to be temporarily disabled as long as the modal dialog is showing. for non-modal dialogs it is still possible to interact with content outside of the dialog while the dialog is showing. note that for non-modal dialogs there will have to be a global keyboard shortcut that allows focus to be moved between opened dialogs and the main page. for more information see the managing modal and non modal dialogs guide. associated aria roles, states, and properties aria-labelledby use this attribute to label the dialog. often, the value of the aria-labelledby attribute will be the id of the element used to title the dialog. aria-describedby use this attribute to describe the contents of the dialog. pos...
Web applications and ARIA FAQ - Accessibility
to their equivalents on the desktop. how do i test my use of aria? are there any tools available for free? several inspecting and debugging tools exist to help you test aria in action: object inspector on windows accessibility inspector on os x accprobe on linux firebug's dom inspector the accessibility inspector for firebug the audits tab in chrome devtools there are several free or open source screen readers that can be used to do hands-on testing with aria. they include: orca for linux nvda for windows voiceover is built into os x when you're testing with a screen reader, keep two key points in mind: casual testing with a screen reader user can never replace feedback, testing, and help from real users. there's more to accessibility than just supporting screen readers...
HTML To MSAA - Accessibility
xt nodes n/a state_system_ selected if option is selected n/a "select" event_object_ selectionwithin event_object_ selectionadd if selected event_object_ selectionremove if unselected select @size > 1 role_system_ list n/a n/a state_system_ multiselectable if multiselectable n/a n/a n/a select @size = 1 role_system_ combobox n/a name of focused option state_system_ expanded if combobox open state_system_ collapsed if combobox is collapsed state_system_ haspopup state_system_ focusable n/a "open"/"close" depending on state event_object_ valuechange when selected option is changed table role_system_ table from @summary attribute n/a described_by (0x100e) points to caption element n/a n/a td, th role_system_ cell n/a n/a n/a n/a n/a n/a thead role_system_ columnheader ...
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
event_system_menustart [important] event_system_menuend [important] event_system_menupopupstart [important] event_system_menupopupend [important] event_system_capturestart event_system_captureend event_system_movesizestart event_system_movesizeend event_system_contexthelpstart event_system_contexthelpend event_system_dragdropstart event_system_dragdropend event_system_dialogstart event_system_dialogend event_system_scrollingstart event_system_scrollingend [possibly important, talk to at vendor] event_system_switchstart event_system_switchend event_system_minimizestart event_system_minimizeend event_object_create [don't implement, watching system generated versions of this event causes assistive technology crashe...
Accessibility documentation index - Accessibility
content and web applications (especially those developed with javascript) more accessible to people with disabilities. it supplements html so that interactions and widgets commonly used in applications can be passed to assistive technologies 3 aria screen reader implementors guide aria, accessibility this is just a guide. live region markup is a complex area which is somewhat open to interpretation. the following is intended to provide implementation guidance that respects screen readers developers' need to try different things. the intention is to strike a balance between providing useful guidance on how to use the markup's intended meaning while supporting live regions as an area for screen readers to innovate and compete. 4 aria test cases aria, accessibi...
Accessibility Information for Web Authors - Accessibility
see a text-only view and and outline view of the document. you can install a custom wave toolbar in firefox for a quick, easy and convenient evaluation of web pages directly within firefox. you can also add a wave bookmarklet in firefox or even wave direct links for checking a webpage. html advanced validator (firefox extension) by marc gueury this html validator (based on w3c tidy and on opensp for sgml validation) is a powerful, versatile, extended html validator. it's free. it works off-line and that is a major advantage over other accessibility checkers. no document upload needed and no additional application to launch; everything is accessible within the firefox browser. this html advanced validator firefox extension is very resourceful and highly customizable. it's an extensio...
Operable - Accessibility
ng through form controls), and you should only build in custom functionality where needed. see ui controls and building keyboard accessibility back in 2.1.2 no keyboard trap (a) when entering a section of functionality using the keyboard, you should be able to get out of that section again using *only* the keyboard. for example, if you press enter/return on a focused button to open an options window, you should be able to close that window again and return to the main content using the keyboard. this is very important so that keyboard users do not get trapped on specific sections of your apps. 2.1.3 keyboard — all functionality (aaa) this is a further step beyond criterion 2.1.1. to achieve aaa conformance, all functionality should be accessible u...
::backdrop - CSS: Cascading Style Sheets
neath any element being presented in full-screen mode. this includes both elements which have been placed in full-screen mode using the fullscreen api and <dialog> elements. when multiple elements have been placed into full-screen mode, the backdrop is drawn immediately beneath the frontmost such element, and on top of the older full-screen elements. /* backdrop is only displayed when dialog is opened with dialog.showmodal() */ dialog::backdrop { background: rgba(255,0,0,.25); } all full-screen elements are placed in a last-in/first out (lifo) stack in the top layer, which is a special layer in the viewport which is always rendered last (and therefore on top) before drawing the viewport's contents to the screen. the ::backdrop pseudo-element makes it possible to obscure, style, or complet...
::first-letter (:first-letter) - CSS: Cascading Style Sheets
block-level element, but only when not preceded by other content (such as images or inline tables). /* selects the first letter of a <p> */ p::first-letter { font-size: 130%; } the first letter of an element is not always trivial to identify: punctuation that precedes or immediately follows the first letter is included in the match. punctuation includes any unicode character defined in the open (ps), close (pe), initial quote (pi), final quote (pf), and other punctuation (po) classes. some languages have digraphs that are always capitalized together, like the ij in dutch. in these cases, both letters of the digraph should be matched by the ::first-letter pseudo-element. (this is poorly supported by browsers; see the browser compatibility table below.) a combination of the ::before pse...
::part() - CSS: Cascading Style Sheets
Web › CSS › ::part
working draft initial definition. ...
::slotted() - CSS: Cascading Style Sheets
Web › CSS › ::slotted
tion">occupation missing</slot></li> </ul> </div> </template> a custom element — <person-details> — is defined like so: customelements.define('person-details', class extends htmlelement { constructor() { super(); let template = document.getelementbyid('person-template'); let templatecontent = template.content; const shadowroot = this.attachshadow({mode: 'open'}); let style = document.createelement('style'); style.textcontent = 'div { padding: 10px; border: 1px solid gray; width: 200px; margin: 10px; }' + 'h2 { margin: 0 0 10px; }' + 'ul { margin: 0; }' + 'p { margin: 10px 0; }' + '::slotted(*) { color: gray; font-family: sans-serif;...
:defined - CSS: Cascading Style Sheets
Web › CSS › :defined
g snippets are taken from our defined-pseudo-class demo (see it live also). ...
:host() - CSS: Cascading Style Sheets
Web › CSS › :host()
href="#"><context-span>example</context-span></a></h1> inside the element's constructor, we create style and span elements, fill the span with the content of the custom element, and fill the style element with some css rules: let style = document.createelement('style'); let span = document.createelement('span'); span.textcontent = this.textcontent; const shadowroot = this.attachshadow({mode: 'open'}); shadowroot.appendchild(style); shadowroot.appendchild(span); style.textcontent = 'span:hover { text-decoration: underline; }' + ':host-context(h1) { font-style: italic; }' + ':host-context(h1):after { content: " - no links in headers!" }' + ':host-context(article, aside) { color: gray; }' + ':host(.footer) { colo...
:host-context() - CSS: Cascading Style Sheets
href="#"><context-span>example</context-span></a></h1> inside the element's constructor, we create style and span elements, fill the span with the content of the custom element, and fill the style element with some css rules: let style = document.createelement('style'); let span = document.createelement('span'); span.textcontent = this.textcontent; const shadowroot = this.attachshadow({mode: 'open'}); shadowroot.appendchild(style); shadowroot.appendchild(span); style.textcontent = 'span:hover { text-decoration: underline; }' + ':host-context(h1) { font-style: italic; }' + ':host-context(h1):after { content: " - no links in headers!" }' + ':host-context(article, aside) { color: gray; }' + ':host(.footer) { colo...
:host - CSS: Cascading Style Sheets
Web › CSS › :host
href="#"><context-span>example</context-span></a></h1> inside the element's constructor, we create style and span elements, fill the span with the content of the custom element, and fill the style element with some css rules: let style = document.createelement('style'); let span = document.createelement('span'); span.textcontent = this.textcontent; const shadowroot = this.attachshadow({mode: 'open'}); shadowroot.appendchild(style); shadowroot.appendchild(span); style.textcontent = 'span:hover { text-decoration: underline; }' + ':host-context(h1) { font-style: italic; }' + ':host-context(h1):after { content: " - no links in headers!" }' + ':host-context(article, aside) { color: gray; }' + ':host(.footer) { colo...
@counter-style - CSS: Cascading Style Sheets
style thumbs { system: cyclic; symbols: "\1f44d"; suffix: " "; } ul { list-style: thumbs; } the initial version of css defined a set of useful counter styles. however, although more styles were added to this set of predefined styles over the years, this system proved too restrictive to fulfill the needs of worldwide typography. the @counter-style at-rule addresses this shortcoming in an open-ended manner, by allowing authors to define their own counter styles when the pre-defined styles aren't fitting their needs. syntax descriptors each @counter-style is identified by a name and has a set of descriptors. system specifies the algorithm to be used for converting the integer value of a counter to a string representation. negative lets the author specify symbols to be append...
display-mode - CSS: Cascading Style Sheets
etc. in this mode, the user agent will exclude ui elements for controlling navigation, but can include other ui elements such as a status bar. minimal-ui minimal-ui the application will look and feel like a standalone application, but will have a minimal set of ui elements for controlling navigation. the elements will vary by browser. browser browser the application opens in a conventional browser tab or new window, depending on the browser and platform. (none) examples @media all and (display-mode: fullscreen) { body { margin: 0; border: 5px solid black; } } specifications specification status comment web app manifestthe definition of 'display-mode' in that specification. working draft initial definition...
orientation - CSS: Cascading Style Sheets
syntax the orientation feature is specified as a keyword value chosen from the list below. keyword values portrait the viewport is in a portrait orientation, i.e., the height is greater than or equal to the width. ...
At-rules - CSS: Cascading Style Sheets
Web › CSS › At-rule
t stage) @counter-style — defines specific counter styles that are not part of the predefined set of styles. (at the candidate recommendation stage, but only implemented in gecko as of writing) @font-feature-values (plus @swash, @ornaments, @annotation, @stylistic, @styleset and @character-variant) — define common names in font-variant-alternates for feature activated differently in opentype. (at the candidate recommendation stage, but only implemented in gecko as of writing) conditional group rules much like the values of properties, each at-rule has a different syntax. nevertheless, several of them can be grouped into a special category named conditional group rules. these statements share a common syntax and each of them can include nested statements—either rulesets ...
CSS Animations tips and tricks - CSS: Cascading Style Sheets
content now we'll define the animation itself using css. some css that's not important (the style of the "run" button itself) isn't shown here, for brevity. .runbutton { cursor: pointer; width: 300px; border: 1px solid black; font-size: 16px; text-align: center; margin-top: 12px; padding-top: 2px; padding-bottom: 4px; color: white; background-color: darkgreen; font: 14px "open sans", "arial", sans-serif; } @keyframes colorchange { 0% { background: yellow } 100% { background: blue } } .box { width: 100px; height: 100px; border: 1px solid black; } .changing { animation: colorchange 2s; } there are two classes here. the "box" class is the basic description of the box's appearance, without any animation information included. the animation details are inclu...
Box-shadow generator - CSS: Cascading Style Sheets
} var outputclass = function outputclass(node) { var topic = node.getattribute('data-topic'); var prop = node.getattribute('data-prop'); var name = node.getattribute('data-name'); var properties = prop.split(' '); classes[topic] = {}; classes[topic].node = node; classes[topic].prop = []; classes[topic].line = []; classes[topic].button = new button(topic); var open_decl = document.createelement('div'); var end_decl = document.createelement('div'); open_decl.textcontent = name + ' {'; end_decl.textcontent = '}'; node.appendchild(open_decl); for (var i in properties) crateoutputnode(topic, properties[i]); node.appendchild(end_decl); } var button = function button(topic) { var button = document.createelement('div'); button.
Realizing common layouts using CSS Grid Layout - CSS: Cascading Style Sheets
way to learn to use grid layout is to continue to build examples like the ones we have covered here. pick something that you normally build using your framework of choice, or using floats, and see if you can build it using grid. don’t forget to find examples that are impossible to build with current methods. that might mean taking inspiration from magazines or other non-web sources. grid layout opens up possibilities that we have not had before, we don’t need to be tied to the same old layouts to use it. for inspiration see the layout labs from jen simmons, she has been creating layouts based on a range of sources. for additional common layout patterns see grid by example, where there are many smaller examples of grid layout and also some larger ui patterns and full page layouts. ...
Mozilla CSS extensions - CSS: Cascading Style Sheets
border-style and outline-style -moz-bg-insetobsolete since gecko 1.9 -moz-bg-...
Syntax - CSS: Cascading Style Sheets
Web › CSS › Syntax
rent properties in css and a nearly infinite number of different values. not all pairs of properties and values are allowed and each property defines what are the valid values. when a value is not valid for a given property, the declaration is deemed invalid and is wholly ignored by the css engine. css declaration blocks declarations are grouped in blocks, that is in a structure delimited by an opening brace, '{' (u+007b left curly bracket), and a closing one, '}' (u+007d right curly bracket). blocks sometimes can be nested, so opening and closing braces must be matched. such blocks are naturally called declaration blocks and declarations inside them are separated by a semi-colon, ';' (u+003b semicolon). a declaration block may be empty, that is containing null declaration. white spaces a...
Viewport concepts - CSS: Cascading Style Sheets
s, will stick to the top and bottom of the layout viewport respectively. body > header { position: fixed; top: 0; } body > footer { position: fixed; bottom: 0; } we got the 800 x 533 measurement when we zoomed in using the keyboard. the header and footer stayed flush against the top and bottom of the window. but what if we had pinched-zoomed on a tablet? what if a dynamic keyboard pops open on a phone? the web contains two viewports, the layout viewport and the visual viewport. the visual viewport is the part of the web page that is currently visible in the browser and can change. when the user pinch-zooms the page, pops open a dynamic keyboard, or when a previously hidden address bar becomes visible, the visual viewport shrinks but the layout viewport is unchanged. sticky headers...
background-attachment - CSS: Cascading Style Sheets
e walked sadly down the middle, wondering how she was ever to get out again. suddenly she came upon a little three-legged table, all made of solid glass; there was nothing on it except a tiny golden key, and alice's first thought was that it might belong to one of the doors of the hall; but, alas! either the locks were too large, or the key was too small, but at any rate it would not open any of them. however, on the second time round, she came upon a low curtain she had not noticed before, and behind it was a little door about fifteen inches high: she tried the little golden key in the lock, and to her great delight it fitted! </p> css p { background-image: url("https://mdn.mozillademos.org/files/12057/starsolid.gif"), url("https://mdn.mozillademos.org/files/12059...
<custom-ident> - CSS: Cascading Style Sheets
grid-row-start grid-row-end grid-column-start grid-column-end forbids the span value. will-change forbids the global css values (unset, initial, and inherit), as well as the values will-change, auto, scroll-position, and contents. examples valid identifiers nono79 a mix of alphanumeric characters and numbers ground-level a mix of alphanumeric char...
font-family - CSS: Cascading Style Sheets
ust not be quoted. a generic font family should be the last item in the list of font family names. the following keywords are defined: serif glyphs have finishing strokes, flared or tapering ends, or have actual serifed endings. e.g. lucida bright, lucida fax, palatino, "palatino linotype", palladio, "urw palladio", serif. sans-serif glyphs have stroke endings that are plain. e.g. "open sans", "fira sans", "lucida sans", "lucida sans unicode", "trebuchet ms", "liberation sans", "nimbus sans l", sans-serif. monospace all glyphs have the same fixed width. e.g. "fira mono", "dejavu sans mono", menlo, consolas, "liberation mono", monaco, "lucida console", monospace. cursive glyphs in cursive fonts generally have either joining strokes or other cursive characteristics beyon...
font-language-override - CSS: Cascading Style Sheets
he font-language-override property is specified as the keyword normal or a <string>. values normal tells the browser to use font glyphs that are appropriate for the language specified by the lang attribute. this is the default value. <string> tells the browser to use font glyphs that are appropriate for the language specified by the string. the string must match a language tag found in the opentype language system. for example, "eng" is english, and "kor" is korean. formal definition initial valuenormalapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | <string> examples using danish glyphs html <p class="para1">default language setting.</p> <p class="para2">this is a stri...
font-style - CSS: Cascading Style Sheets
g. in general, for a requested angle of 14 degrees or greater, larger angles are prefered; otherwise, smaller angles are preferred (see the spec's font matching section for the precise algorithm). variable fonts variable fonts can offer a fine control over the degree to which an oblique face is slanted. you can select this using the <angle> modifier for the oblique keyword. for truetype or opentype variable fonts, the "slnt" variation is used to implement varying slant angles for oblique, and the "ital" variation with a value of 1 is used to implement italic values. see font-variation-settings. for the example below to work, you'll need a browser that supports the css fonts level 4 syntax in which font-style: oblique can accept an <angle>. html <header> <input type="range" id=...
opacity - CSS: Cascading Style Sheets
Web › CSS › opacity
heavy">this is very easy to see.</div> css div { background-color: yellow; } .light { opacity: 0.2; /* barely see the text over the background */ } .medium { opacity: 0.5; /* see the text more clearly over the background */ } .heavy { opacity: 0.9; /* see the text very clearly over the background */ } result setting opacity on hover html <img src="//developer.mozilla.org/static/img/opengraph-logo.png" alt="mdn logo" width="128" height="146" class="opacity"> css img.opacity { opacity: 1; filter: alpha(opacity=100); /* ie8 and lower */ zoom: 1; /* triggers "haslayout" in ie 7 and lower */ } img.opacity:hover { opacity: 0.5; filter: alpha(opacity=50); zoom: 1; } result specifications specification status comment css color module...
unicode-bidi - CSS: Cascading Style Sheets
ide; unicode-bidi: isolate-override; unicode-bidi: plaintext; /* global values */ unicode-bidi: inherit; unicode-bidi: initial; unicode-bidi: unset; syntax values normal the element does not offer an additional level of embedding with respect to the bidirectional algorithm. for inline elements, implicit reordering works across element boundaries. embed if the element is inline, this value opens an additional level of embedding with respect to the bidirectional algorithm. the direction of this embedding level is given by the direction property. bidi-override for inline elements this creates an override. for block container elements this creates an override for inline-level descendants not within another block container element. this means that inside the element, reordering is strictl...
CSS: Cascading Style Sheets
Web › CSS
cascading style sheets (css) is a stylesheet language used to describe the presentation of a document written in html or xml (including xml dialects such as svg, mathml or xhtml). css describes how elements should be rendered on screen, on paper, in speech, or on other media. css among the core languages of the open web and is standardized across web browsers according to the w3c specification. previously development of various parts of css specification was done synchronously, which allowed versioning of the latest recommendation. you might have heard about css1, css2.1, css3. however, css4 has never become an official version. from css3, the scope of the specification increased significantly and the progress on different css modules started to differ so much, that it became more effective...
WAI ARIA Live Regions/API Support - Developer guides
mozilla engine exposes live changes in a document. these features will help screen reader developers improve the quality and performance of live region support, both for pages that are marked up with aria live region markup, and for pages where the author did not add any additional markup. please read the aria spec or the live region report to learn about aria live region markup. as always, we're open to questions and suggestions for changes in community forums. events fired for web page mutations what changed in document? atk/at-spi event iaccessible2 event object about to be hidden or removed children_changed::remove (fired on the parent, with event data pointing to the child index of the accessible object to be removed) event_object_hide* (fired on the actual ...
Adding captions and subtitles to HTML5 video - Developer guides
ss browser video player using the htmlmediaelement and window.fullscreen apis, and also at how to style the player. this article will take the same player and show how to add captions and subtitles to it, using the webvtt format and the <track> element. captioned video example in this article, we will refer to the video player with captions example. this example uses an excerpt from the sintel open movie, created by the blender foundation. note: you can find the source on github, and also view the example live. html5 and video captions before diving into how to add captions to the video player, there are a number of things that we will first mention, which you should be aware of before we start. captions versus subtitles captions and subtitles are not the same thing: they have sign...
Creating a cross-browser video player - Developer guides
d works across most major desktop and mobile browsers. as well as working fullscreen, the player features custom controls rather than just using the browser defaults. the player controls themselves won't be styled beyond the basics required to get them working; full styling of the player will be taken care of in a future article. working example our example video player displays a clip from an open source movie called tears of steel, and includes typical video controls. note: you can see the example running live, or check out the source code on github. html markup to start off with, let's take a look at the html that makes up the player. the video first of all the <video> element is defined, contained within a <figure> element that acts as the video container. to anyone familiar wi...
Overview of events and handlers - Developer guides
the mouse pointer over the html button and clicking on the left mouse button or by placing a finger or stylus of some kind on the screen above the html button; when that happens, the buttondomelement javascript object would call the example_click_handler function with an event object as an argument. the function, in turn, would perform whatever action was chosen by the programmer, in this case to open an html alert dialog. note that the handler has access to the ev object since it is passed as an argument; the object has information about the event, notably the time at which the event occurred. as a second example, much modern javascript integrated into web pages is wrapped into an event function call to ensure that the code is only executed when the html has been processed and is available f...
Graphics on the Web - Developer guides
e <canvas> element provides apis to draw 2d graphics using javascript. svg scalable vector graphics (svg) lets you use lines, curves, and other geometric shapes to render graphics. with vectors, you can create images that scale cleanly to any size. view all... 3d graphics webgl a guide to getting started with webgl, the 3d graphics api for the web. this technology lets you use standard opengl es in web content. video using html5 audio and video embedding video and/or audio in a web page and controlling its playback. webrtc the rtc in webrtc stands for real-time communications, a technology that enables audio/video streaming and data sharing between browser clients (peers). ...
Rich-Text Editing in Mozilla - Developer guides
nt); odoc.appendchild(opre); } else { if (document.all) { odoc.innerhtml = odoc.innertext; } else { ocontent = document.createrange(); ocontent.selectnodecontents(odoc.firstchild); odoc.innerhtml = ocontent.tostring(); } odoc.contenteditable = true; } odoc.focus(); } function printdoc() { if (!validatemode()) { return; } var oprntwin = window.open("","_blank","width=450,height=470,left=400,top=100,menubar=yes,toolbar=no,location=no,scrollbars=yes"); oprntwin.document.open(); oprntwin.document.write("<!doctype html><html><head><title>print<\/title><\/head><body onload=\"print();\">" + odoc.innerhtml + "<\/body><\/html>"); oprntwin.document.close(); } </script> <style type="text/css"> .intlink { cursor: pointer; } img.intlink { border:...
Making content editable - Developer guides
agraphseparator", false, "div"); } else { if (document.all) { odoc.innerhtml = odoc.innertext; } else { ocontent = document.createrange(); ocontent.selectnodecontents(odoc.firstchild); odoc.innerhtml = ocontent.tostring(); } odoc.contenteditable = true; } odoc.focus(); } function printdoc() { if (!validatemode()) { return; } var oprntwin = window.open("","_blank","width=450,height=470,left=400,top=100,menubar=yes,toolbar=no,location=no,scrollbars=yes"); oprntwin.document.open(); oprntwin.document.write("<!doctype html><html><head><title>print<\/title><\/head><body onload=\"print();\">" + odoc.innerhtml + "<\/body><\/html>"); oprntwin.document.close(); } </script> <style type="text/css"> .intlink { cursor: pointer; } img.intlink { border:...
Introduction to Web development - Developer guides
rials from google's expert web developers cover the basics of html, css and javascript. csstutorial.net beginner tutorials a broad range of useful text and video tutorials that cover the basics through to intermediate aspects of css. tizag css tutorials an easy-to-follow reference for those wishing to learn css through short, concise tutorials. jquery fundamentals an open-source reference book featuring detailed introductions to both javascript and jquery for beginners. javascript from null: a video series a video series on javascript for absolute beginners looking for more 'visual'-based learning ...
Parsing and serializing XML - Developer guides
if the document is html, the code shown above will return a document. if the document is xml, the resulting object is actually a xmldocument. the two types are essentially the same; the difference is largely historical, althoug...
<area> - HTML: Hypertext Markup Language
Web › HTML › Element › area
: show the resource in the topmost browsing context (the browsing context that is an ancestor of the current one and has no parent). if there is no parent, acts the same as _self. use this attribute only if the href attribute is present. note: in newer browser versions (e.g. firefox 79+) setting target="_blank" on <area> elements implicitly provides the same rel behavior as setting rel="noopener". deprecated attributes name define a names for the clickable area so that it can be scripted by older browsers. nohref indicates that no hyperlink exists for the associated area. note: since html5, omitting the href attribute is sufficient. tabindex a numeric value specifying the position of the defined area in the browser tabbing order. this attribute is global in h...
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
Web › HTML › Element › audio
nd send us a pull request. the above example shows simple usage of the <audio> element. in a similar manner to the <img> element, we include a path to the media we want to embed inside the src attribute; we can include other attributes to specify information such as whether we want it to autoplay and loop, whether we want to show the browser's default audio controls, etc. the content inside the opening and closing <audio></audio> tags is shown as a fallback in browsers that don't support the element. attributes this element's attributes include the global attributes. autoplay a boolean attribute: if specified, the audio will automatically begin playback as soon as it can do so, without waiting for the entire audio file to finish downloading. note: sites that automatically play audio (...
<base>: The Document Base URL element - HTML: Hypertext Markup Language
Web › HTML › Element › base
target are obeyed — all others are ignored. in-page anchors links pointing to a fragment in the document — e.g. <a href="#some-id"> — are resolved with the <base>, triggering an http request to the base url with the fragment attached. for example: given <base href="https://example.com"> ...and this link: <a href="#anchor">anker</a> ...the link points to https://example.com/#anchor. open graph open graph tags do not acknowledge <base>, and should always have full absolute urls. for example: <meta property="og:image" content="https://example.com/thumbnail.jpg"> examples <base href="https://www.example.com/"> <base target="_blank"> <base target="_top" href="https://example.com/"> specifications specification status comment html living standardthe ...
<frame> - HTML: Hypertext Markup Language
Web › HTML › Element › frame
uch as performance problems and lack of accessibility for users with screen readers. instead of the <frame> element, <iframe> may be preferred. attributes like all other html elements, this element supports the global attributes. src this attribute specifies the document that will be displayed by the frame. name this attribute is used for labeling frames. without labeling, every link will open in the frame that it’s in – the closest parent frame. see the target attribute for more information. noresize this attribute prevents resizing of frames by users. scrolling this attribute defines the existence of a scrollbar. if this attribute is not used, the browser adds a scrollbar when necessary. there are two choices: "yes" for forcing a scrollbar even when it is not necessary and "n...
<input type="button"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › button
example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: while <input> elements of type button are still perfectly valid html, the newer <button> element is now the favored way to create buttons. given that a <button>’s label text is inserted between the opening and closing tags, you can include html in the label, even images. value a domstring used as the button's label events click supported common attributes type, and value idl attributes value methods none value an <input type="button"> elements' value attribute contains a domstring that is used as the button's label. <input t...
<input type="color"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › color
ery time an adjustment is made to the value (for example, if the brightness of the color is increased), these will happen repeatedly as the color picker is used. function updatefirst(event) { var p = document.queryselector("p"); if (p) { p.style.color = event.target.value; } } when the color picker is dismissed, indicating that the value will not be changing again (unless the user re-opens the color picker), a change event is sent to the element. we handle that event using the updateall() function, using event.target.value to obtain the final selected color: function updateall(event) { document.queryselectorall("p").foreach(function(p) { p.style.color = event.target.value; }); } this sets the color of every <p> block so that its color attribute matches the current value...
<input type="week"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › week
era and microsoft edge supporting it at this time. in non-supporting browsers, the control degrades gracefully to function identically to <input type="text">. in chrome/opera the week control provides slots to fill in week and year values, a pop-up calendar interface to select them more visually, and an "x" button to clear the control's value. the edge week control is somewhat more elaborate, opening up week and year pickers with sliding reels. value a domstring representing a week and year, or empty events change and input supported common attributes autocomplete, list, readonly, and step idl attributes value, valueasdate, valueasnumber, and list. methods select(), stepdown(), and stepup() value a domstring representin...
<nextid>: The NeXT ID element (Obsolete) - HTML: Hypertext Markup Language
Web › HTML › Element › nextid
section name</a></h2>. this continues for the next three sections, z5, z6, and z7 (and table of contents entries named z1, z2, and z3), each automatically given anchors with these names. the user then saves and closes the document. next would then add, within the header of the html document, a special tag, <nextid n="z8">, to inform where to continue its naming convention. imagine the web author opens the document for further editing. they want to add a couple new sections after the second section, appending four more sections at the end. when opening the document, the next editor finds and reads this <nextid n="z8"> tag, and now knows to give the first of these new sections the name of z8 in the table of contents, and z14 to the content body. this might look like this: <html> <head> ...
<noembed>: The Embed Fallback element (Obsolete) - HTML: Hypertext Markup Language
Web › HTML › Element › noembed
the <noembed> element is an obsolete, non-standard way to provide alternative, or "fallback", content for browsers that do not support the <embed> element or do not support the type of embedded content an author wishes to use. this element was deprecated in html 4.01 and above in favor of placing fallback content between the opening and closing tags of an <object> element. while this element currently still works in many browsers, it is obsolete and should not be used. use <object> instead, with fallback content between the opening and closing tags of the element. examples the message inside <noembed> tag will appear only when your browser does not support <embed> tag. show an alternative content <embed type="vide/webm" src="/media/examples/flower.mp4" width="200" height="20...
<rb>: The Ruby Base element - HTML: Hypertext Markup Language
Web › HTML › Element › rb
interface htmlelement attributes this element only includes the global attributes. usage notes ruby annotations are for showing pronunciation of east asian characters, like using japanese furigana or taiwanese bopomofo characters. the <rb> element is used to separate out each segment of the ruby base text. even though <rb> is not an empty element, it is common to just include the opening tag of each element in the source code, so that the ruby markup is less complex and easier to read. the browser can then fill in the full element in the rendered version. you need to include one <rt> element for each base segment/<rb> element that you want to annotate. examples in this example, we provide an annotation for the original character equivalent of "kanji": <ruby> <rb>漢<rb>...
<rp>: The Ruby Fallback Parenthesis element - HTML: Hypertext Markup Language
Web › HTML › Element › rp
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
<rtc>: The Ruby Text Container element - HTML: Hypertext Markup Language
Web › HTML › Element › rtc
red in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories none. permitted content phrasing content or <rt> elements. tag omission the closing tag can be omitted if it is immediately followed by a <rb>, <rtc> or <rt> element opening tag or by its parent closing tag. permitted parents a <ruby> element. permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes. examples <div class="info"> <ruby> <rbc> <rb>旧</rb><rt>jiù</rt> <rb>金</rb><rt>jīn</rt> <rb>山</rb><rt>shān</rt> </rbc> <rtc>san ...
<slot> - HTML: Hypertext Markup Language
Web › HTML › Element › slot
phrasing content implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlslotelement attributes this element includes the global attributes. name the slot's name. a named slot is a <slot> element with a name attribute. ...
<textarea> - HTML: Hypertext Markup Language
Web › HTML › Element › textarea
<textarea> to be associated with a <label> element for accessibility purposes a name attribute to set the name of the associated data point submitted to the server when the form is submitted. rows and cols attributes to allow you to specify an exact size for the <textarea> to take. setting these is a good idea for consistency, as browser defaults can differ. default content entered between the opening and closing tags. <textarea> does not support the value attribute. the <textarea> element also accepts several attributes common to form <input>s, such as autocomplete, autofocus, disabled, placeholder, readonly, and required. attributes this element includes the global attributes. autocapitalize this is a non-standard attribute supported by webkit on ios (therefore nearly all browse...
<title>: The Document Title element - HTML: Hypertext Markup Language
Web › HTML › Element › title
the html title element (<title>) defines the document's title that is shown in a browser's title bar or a page's tab. it only contains text; tags within the element are ignored. <title>grandma's heavy metal festival journal</title> content categories metadata content. permitted content text that is not inter-element whitespace. tag omission both opening and closing tags are required. note that leaving off </title> should cause the browser to ignore the rest of the page. permitted parents a <head> element that contains no other <title> element. implicit aria role no corresponding role permitted aria roles no role permitted. dom interface htmltitleelement attributes this element only includes the globa...
accesskey - HTML: Hypertext Markup Language
what may work for one combination of operating system, ass...
contextmenu - HTML: Hypertext Markup Language
he "change image" action in your context menu.<br /> <img src="https://udn.realityripple.com/samples/a2/b601bdfc0c.png" contextmenu="changeimage" id="promobutton" /> <menu type="context" id="changeimage"> <menuitem label="change image" onclick="changeimage()"></menuitem> </menu> </li> </ol> </body> javascript function shareviatwitter() { window.open("https://twitter.com/intent/tweet?text=" + "hurray! i am learning contextmenu from mdn via mozilla"); } function shareviafacebook() { window.open("https://facebook.com/sharer/sharer.php?u=" + "https://developer.mozilla.org/en/html/element/using_html_context_menus"); } function incfont() { document.getelementbyid("fontsizing").style.fontsize = "larger"; } function decfont() { ...
Link types: noreferrer - HTML: Hypertext Markup Language
specifications specification status comment html living standardthe definition of 'noreferrer' in that specification. living standard ...
Microformats - HTML: Hypertext Markup Language
ows them to understand the information on web pages and provide more relevant results to users. in addition to being machine-readable, their format is designed to be easily read by humans. to create a microformats object, h-* class names are used in the class attribute. to add a property to an object, the p-*, u-*, dt-*, e-* class names are used on one of the object's descendants. there are open source parsing libraries for most languages for microformats2. how microformats work an author of a webpage can add microformats to their html. for example if they wanted to identify themselves they could use an h-card such as: html example <a class="h-card" href="http://alice.example.com">alice blogger</a> when a parser encounters this data, it will know that this page contains a "card" wh...
Evolution of HTTP - HTTP
e of the diverse implementations of http/1.0, and since 1995, well before the publication of http/1.0 document the next year, proper standardization was in progress. the first standardized version of http, http/1.1 was published in early 1997, only a few months after http/1.0. http/1.1 clarified ambiguities and introduced numerous improvements: a connection can be reused, saving the time to reopen it numerous times to display the resources embedded into the single original document retrieved. pipelining has been added, allowing to send a second request before the answer for the first one is fully transmitted, lowering the latency of the communication. chunked responses are now also supported. additional cache control mechanisms have been introduced. content negotiation, including langu...
Identifying resources on the Web - HTTP
cation 7230, hypertext transfer protocol (http/1.1): message syntax and routing. syntax of uniform resource identifiers (uris) scheme or protocol http:// is the protocol. it indicates which protocol the browser must use. usually it is the http protocol or its secured version, https. the web requires one of these two, but browsers also know how to handle other protocols such as mailto: (to open a mail client) or ftp: to handle file transfer, so don't be surprised if you see such protocols. common schemes are: scheme description data data uris file host-specific file names ftp file transfer protocol http/https hyper text transfer protocol (secure) javascript url-embedded javascript code mailto elect...
Resource URLs - HTTP
ng resource: uris in bug 863246, which landed in firefox 57 (quantum). in the past, web content was able to access whatever resource: uris were desired — not only firefox’s internal resources, but also extensions’ assets. now this behavior is prohibited by default. it is however still necessary for firefox to load resources in web content under certain circumstances. for example, if you open the view source page (view page source or view selection source), you will find it requires viewsource.css through a resource: uri. resources that have to be exposed to web content have been moved to a new location named resource://content-accessible/, which is isolated and only contains non-sensitive resources. in this way we can keep essential resources exposed and have most threats eliminate...
Browser detection using the user agent - HTTP
mn. next, always make your code dynamic. the user can flip their mobile device on its side, changing the width and height of the page. or, there might be some weird flip-phone-like device thing in the future where flipping it out extends the screen. do not be the developer having a headache over how to deal with the flip-phone-like device thing. never be satisfied with your webpage until you can open up the dev tools side panel and resize the screen while the webpage looks smooth, fluid, and dynamically resized. the simplest way to do this is to separate all the code that moves content around based on screen size to a single function that is called when the page is loaded and at each resize event thereafter. if there is a lot calculated by this layout function before it determines the new lay...
Reason: CORS request not HTTP - HTTP
https url scheme, but the url specified by the request is of a different type. this often occurs if the url specifies a local file, using a file:/// url. to fix this problem, simply make sure you use https urls when issuing requests involving cors, such as xmlhttprequest, fetch apis, web fonts (@font-face), and webgl textures, and xsl stylesheets. local file security in firefox 68 when a user opened a page using a file:/// uri in firefox 67 and earlier, the origin of the page was defined as the directory from which the page was opened. resources in the same directory and its subdirectories were treated as having the same origin for purposes of the cors same-origin rule. in response to cve-2019-11730, firefox 68 and later define the origin of a page opened using a file:/// uri as unique. t...
Access-Control-Allow-Credentials - HTTP
bidden header name no syntax access-control-allow-credentials: true directives true the only valid value for this header is true (case-sensitive). if you don't need credentials, omit this header entirely (rather than setting its value to false). examples allow credentials: access-control-allow-credentials: true using xhr with credentials: var xhr = new xmlhttprequest(); xhr.open('get', 'http://example.com/', true); xhr.withcredentials = true; xhr.send(null); using fetch with credentials: fetch(url, { credentials: 'include' }) specifications specification status comment fetchthe definition of 'access-control-allow-credentials' in that specification. living standard initial definition ...
Authorization - HTTP
tax authorization: <type> <credentials> directives <type> authentication type. a common type is "basic". other types: iana registry of authentication schemes authentification for aws servers (aws4-hmac-sha256) <credentials> if the "basic" authentication scheme is used, the credentials are constructed like this: the username and the password are combined with a colon (aladdin:opensesame). the resulting string is base64 encoded (ywxhzgrpbjpvcgvuc2vzyw1l). note: base64 encoding does not mean encryption or hashing! this method is equally secure as sending the credentials in clear text (base64 is a reversible encoding). prefer to use https in conjunction with basic authentication. examples authorization: basic ywxhzgrpbjpvcgvuc2vzyw1l see also http authenticat...
CSP: connect-src - HTTP
fe inline script for an example. in csp 2.0, this applied only to inline scripts. csp 3.0 allows it in the case of script-src for external scripts. examples violation cases given this csp header: content-security-policy: connect-src https://example.com/ the following connections are blocked and won't load: <a ping="https://not-example.com"> <script> var xhr = new xmlhttprequest(); xhr.open('get', 'https://not-example.com/'); xhr.send(); var ws = new websocket("https://not-example.com/"); var es = new eventsource("https://not-example.com/"); navigator.sendbeacon("https://not-example.com/", { ... }); </script> specifications specification status comment content security policy level 3the definition of 'connect-src' in that specification. wo...
CSP: navigate-to - HTTP
this is an enforcement on what navigations this document initiates not on what this document is allowed to navigate to. note: if the form-action directive is present, the navigate-to directive will not act on navigations that are form submissions. ...
CSP: sandbox - HTTP
syntax content-security-policy: sandbox; content-security-policy: sandbox <value>; where <value> can optionally be one of the following values: allow-downloads-without-user-activation allows for downloads to occur without a gesture from the user. allow-forms allows the page to submit forms. if this keyword is not used, this operation is not allowed. allow-modals allows the page to open modal windows. allow-orientation-lock allows the page to disable the ability to lock the screen orientation. allow-pointer-lock allows the page to use the pointer lock api. allow-popups allows popups (like from window.open, target="_blank", showmodaldialog). if this keyword is not used, that functionality will silently fail. allow-popups-to-escape-sandbox allows a sandboxed document to op...
Content-Security-Policy - HTTP
rm-action restricts the urls which can be used as the target of a form submissions from a given context. frame-ancestors specifies valid parents that may embed a page using <frame>, <iframe>, <object>, <embed>, or <applet>. navigate-to restricts the urls to which a document can initiate navigation by any means, including <form> (if form-action is not specified), <a>, window.location, window.open, etc. reporting directives reporting directives control the reporting process of csp violations. see also the content-security-policy-report-only header. report-uri instructs the user agent to report attempts to violate the content security policy. these violation reports consist of json documents sent via an http post request to the specified uri. though the report-to directive is int...
Cross-Origin-Embedder-Policy - HTTP
cross-origin-resource-policy header must be used to load it without being blocked by coep. examples certain features depend on cross-origin isolation you can only access certain features like sharedarraybuffer objects or performance.now() with unthrottled timers, if your document has a coep header with the value require-corp value set. cross-origin-embedder-policy: require-corp cross-origin-opener-policy: same-origin see also the cross-origin-opener-policy header which you'll need to set as well. to check if cross origin isolation has been successful, you can test against the crossoriginisolated property available to window and worker contexts: if (crossoriginisolated) { // post sharedarraybuffer } else { // do something else } avoiding coep blockage with cors if you enable coe...
Keep-Alive - HTTP
ntains them. header type general header forbidden header name yes syntax keep-alive: parameters directives parameters a comma-separated list of parameters, each consisting of an identifier and a value separated by the equal sign ('='). the following identifiers are possible: timeout: indicating the minimum amount of time an idle connection has to be kept opened (in seconds). note that timeouts longer than the tcp timeout may be ignored if no keep-alive tcp message is set at the transport level. max: indicating the maximum number of requests that can be sent on this connection before closing it. unless 0, this value is ignored for non-pipelined connections as another request will be sent in the next response. an http pipeline can use it to limit the ...
Proxy-Authorization - HTTP
icate header. header type request header forbidden header name no syntax proxy-authorization: <type> <credentials> directives <type> authentication type. a common type is "basic". see also the iana registry of authentication schemes. <credentials> the credentials are constructed like this: the username and the password are combined with a colon (aladdin:opensesame). the resulting string is base64 encoded (ywxhzgrpbjpvcgvuc2vzyw1l). note: base64 encoding does not mean encryption or hashing! this method is equally secure as sending the credentials in clear text (base64 is a reversible encoding). prefer to use https in conjunction with basic authentication. examples proxy-authorization: basic ywxhzgrpbjpvcgvuc2vzyw1l specifications ...
Sec-Fetch-Site - HTTP
examples todo specifications specification title fetch metadata request headers the sec-fetch-site http request header ...
Sec-WebSocket-Accept - HTTP
it would appear in the response headers. that is, this is header is sent from server to client to inform that server is willing to initiate a websocket connection. header type response header forbidden header name no syntax sec-websocket-accept: <hashed key> directives <hashed key> the server takes the value of the sec-websocket-key sent in the handshake request, appends 258eafa5-e914-47da-95ca-c5ab0dc85b11, takes sha-1 of the new value, and is then base64 encoded. ...
Firefox user agent string reference - HTTP
it is strongly discouraged by mozilla, some handset manufacturers unfortunately include a token in their device's ua string that represents their device id. if this is the case, the firefox os ua string will look like the device-specific string in the table above, where nnnn; is the manufacturer's code for the device (see guidelines). some of them we have noticed are of the form "nexusone;", "zteopen;", or "open c;" (note that putting space is also discouraged). we provide this information to assist with your ua detection logic, but mozilla discourages the detection of a device id in ua strings. here is a javascript regular expression that will detect all mobile devices, including devices with a device id in their ua string: /mobi/i the i makes it case-insensitive, and mobi matches all mob...
Link prefetching FAQ - HTTP
prefetched document for real, the remaining portion of the document will be fetched using a http byte-range request. what if i'm downloading something in the background? will link prefetching compete for bandwidth? yes and no. if you are downloading something using mozilla, link prefetching will be delayed until any background downloads complete. for example, if you load a bookmark group (which opens several tabs), any prefetch requests initiated by one of the bookmarked pages will not begin until all of the tabs finish loading. if you are using another application which uses the network, link prefetching in mozilla may compete for bandwidth with the other application. this is a problem that we hope to address in the future by leveraging operating system services to monitor network idle time...
CONNECT - HTTP
Web › HTTP › Methods › CONNECT
for example, the connect method can be used to access websites that use ssl (https). the client asks an http proxy server to tunnel the tcp connection to the desired destination. the server then proceeds to make the connection on behalf of the client. once the connection has been established by the server, the proxy server continues to proxy the tcp stream to and from the client. connect is a hop-by-hop method. ...
Proxy Auto-Configuration (PAC) file - HTTP
nctions that don't require the use of a dns server. if a proxy is used, the proxy will perform its dns lookup which would double the impact on the dns server. most of the time these functions are not necessary to achieve the desired result. history and implementation proxy auto-config was introduced into netscape navigator 2.0 in the late 1990s, at the same time when javascript was introduced. open-sourcing netscape eventually lead to firefox itself. the most "original" implementation of pac and its javascript libraries is, therefore, nsproxyautoconfig.js found in early versions of firefox. these utilities are found in many other open-source systems including chromium. firefox later integrated the file into proxyautoconfig.cpp as a c++ string literal. to extract it into its own file, it su...
A typical HTTP session - HTTP
Web › HTTP › Session
est, sending back its answer, providing a status code and appropriate data. as of http/1.1, the connection is no longer closed after completing the third phase, and the client is now granted a further request: this means the second and third phases can now be performed any number of times. establishing a connection in client-server protocols, it is the client which establishes the connection. opening a connection in http means initiating a connection in the underlying transport layer, usually this is tcp. with tcp the default port, for an http server on a computer, is port 80. other ports can also be used, like 8000 or 8080. the url of a page to fetch contains both the domain name, and the port number, though the latter can be omitted if it is 80. see identifying resources on the web for ...
HTTP
Web › HTTP
http is a stateless protocol, meaning that the server does not keep any data (state) between two requests. ...
A re-introduction to JavaScript (JS tutorial) - JavaScript
uage in a host environment, and it is up to the host environment to provide mechanisms for communicating with the outside world. the most common host environment is the browser, but javascript interpreters can also be found in a huge list of other places, including adobe acrobat, adobe photoshop, svg images, yahoo's widget engine, server-side environments such as node.js, nosql databases like the open source apache couchdb, embedded computers, complete desktop environments like gnome (one of the most popular guis for gnu/linux operating systems), and others. overview javascript is a multi-paradigm, dynamic language with types and operators, standard built-in objects, and methods. its syntax is based on the java and c languages — many structures from those languages apply to javascript as w...
Inheritance and the prototype chain - JavaScript
ok at what happens behind the scenes in a bit more detail. in javascript, as mentioned above, functions are able to have properties. all functions have a special property named prototype. please note that the code below is free-standing (it is safe to assume there is no other javascript on the webpage other than the below code). for the best learning experience, it is highly recommended that you open a console, navigate to the "console" tab, copy-and-paste in the below javascript code, and run it by pressing the enter/return key. (the console is included in most web browser's developer tools. more information is available for firefox developer tools, chrome devtools, and edge devtools.) function dosomething(){} console.log( dosomething.prototype ); // it does not matter how you declare the ...
SyntaxError: unterminated string literal - JavaScript
erminated string literal (firefox) error type syntaxerror what went wrong? there is an unterminated string somewhere. string literals must be enclosed by single (') or double (") quotes. javascript makes no distinction between single-quoted strings and double-quoted strings. escape sequences work in strings created with either single or double quotes. to fix this error, check if: you have opening and closing quotes (single or double) for your string literal, you have escaped your string literal correctly, your string literal isn't split across multiple lines. examples multiple lines you can't split a string across multiple lines like this in javascript: var longstring = 'this is a very long string which needs to wrap across multiple lines because ...
Array.prototype.sort() - JavaScript
specifications specification ecmascript (ecma-262)the definition of 'array.prototype.sort' in that specification. ...
FinalizationRegistry.prototype.unregister() - JavaScript
he \`release\` method was never called for the \`thingy\` for the file "${file.name}"` ); }; #registry = new finalizationregistry(this.#cleanup); /** * constructs a `thingy` instance for the given file. be sure to call `release` when you're done with it. * * @param filename the name of the file. */ constructor(filename) { this.#file = file.open(filename); // vvvvv−−−−− held value this.#registry.register(this, label, this.#file); // target −−−−−^^^^ ^^^^^^^^^^−−−−− unregister token } /** * releases resources held by this `thingy` instance. */ release() { if (this.#file) { this.#registry.unregister(t...
JSON.parse() - JavaScript
safe, we want to reject all unexpected forms. // we split the second stage into 4 regexp operations in order to work around // crippling inefficiencies in ie's and safari's regexp engines. first we // replace the json backslash pairs with "@" (a non-json character). second, we // replace all simple value tokens with "]" characters. third, we delete all // open brackets that follow a colon or comma or that begin the text. finally, // we look to see that the remaining characters are only whitespace or "]" or // "," or ":" or "{" or "}". if that is so, then the text is safe for eval. if ( rx_one.test( text .replace(rx_two, "@") .replace(rx_three, "]") .rep...
Promise() constructor - JavaScript
...
import - JavaScript
}); this form also supports the await keyword. let module = await import('/modules/my-module.js'); examples standard import the code below shows how to import from a secondary module to assist in processing an ajax json request. ...
JavaScript shells - JavaScript
javascript shells the following javascript shells work with mozilla. firefox has a built-in javascript console, which support multi-line editing. javascript shell (js) - a command line interpreter for javascript xpcshell is an xpconnect - enabled shell, sometimes useful for mozilla development. babel repl - a browser-based repl for experimenting with future javascript. es6console.com - an open-source javascript console to test ecmascript 2015 code inside the browser. jsconsole.com -- an open-source javascript console with the ability to easily link to particular expressions javascript shell (web page) - also available as part of the extension developer's extension jash: javascript shell - a dhtml based shell that gives you command line access to a web page. mozrepl - connect to fir...
JavaScript
browse javascript's feature history and implementation status. jsfiddle edit javascript, css, html and get live results. use external resources and collaborate with your team online. plunker plunker is an online community for creating, collaborating on and sharing your web development ideas. edit your javascript, css, html files and get live results and file structure. jsbin js bin is an open-source collaborative web development debugging tool. codepen codepen is another collaborative web development tool used as a live result playground. stackblitz stackblitz is another online playground/debugging tool, which can host and deploy full-stack applications using react, angular, etc. ...
display - Web app manifests
etc. in this mode, the user agent will exclude ui elements for controlling navigation, but can include other ui elements such as a status bar. minimal-ui minimal-ui the application will look and feel like a standalone application, but will have a minimal set of ui elements for controlling navigation. the elements will vary by browser. browser browser the application opens in a conventional browser tab or new window, depending on the browser and platform. this is the default. (none) example "display": "standalone" specification specification status comment feedback web app manifestthe definition of 'display' in that specification. working draft initial definition. web app manifes...
<mo> - MathML
Web › MathML › Element › mo
visual effect for this attribute, but it specifies whether the operator is a fence (such as parentheses). allowed values are true or false. form specifies the role of the operator in an enclosed expression, which affects spacing and other default properties. for ordinary operators (+, -, etc. ) you usually do not need to specify this attribute explicitly. possible values are: prefix, for opening fences. (it is the default value if the operator is the first argument in a <mrow> element with more than one argument.) infix, for separators. (it is the default value if the operator is not included in a <mrow> element.) postfix, closing fences. (it is the default value if the operator is the last argument in a <mrow> element with more than one argument.) href used to set a hyperli...
<ms> - MathML
Web › MathML › Element › ms
quotation marks should not be specified unless they are part of the string literal. the content of an <ms> element is not an ascii string per se, but rather a sequence of characters and <mglyph> and <malignmark> elements. attributes class, id, style provided for use with stylesheets. dir the text direction. possible values are either ltr (left to right) or rtl (right to left). lquote the opening quote character (depends on dir) to enclose the content. the default value is "&quot;". href used to set a hyperlink to a specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. mathsize the size of the content. see length for possible values. deprecated values are: sm...
MathML documentation index - MathML
Web › MathML › Index
r is not thrown when your mathml markup is wrong or not well-formed xml. you will still get an xml parsing error (in case of the xhtml notation of mathml), which has nothing to do with <merror>. 14 <mfenced> deprecated, mathml, mathml reference, mathml:element, mathml:general layout schemata the deprecated mathml <mfenced> element used to provide the possibility to add custom opening and closing parentheses (such as brackets) and separators (such as commas or semicolons) to an expression. it has been removed from the latest mathml standard and modern browsers no longer support it. 15 <mfrac> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <mfrac> element is used to display fractions. 16 <mglyph> mathml...
Autoplay guide for media and Web Audio APIs - Web media technologies
yback of the media has successfully started, instead of when it fails to start. you can do this easily, by listening for the play event to be fired on the media element. the play event is sent both when the media is resumed after being paused and when autoplay occurs. that means that the first time the play event is fired, you know your media is being started for the first time after the page is opened. consider this html for a media element: <video src="myvideo.mp4" autoplay onplay=handlefirstplay(event)"> here we have a <video> element whose autoplay attribute is set, with an onplay event handler set up; the event is handled by a function called handlefirstplay(), which receives as input the play event. handlefirstplay() looks like this: function handlefirstplay(event) { let vid = ev...
Animation performance and frame rate - Web Performance
ation, and a radio group to choose to animate using margin, or to animate using transform. there are a number of elements, and we've added a linear-gradient background and a box-shadow to each element, because they are both relatively expensive effects to paint. there's also a video version of this walkthrough: animating using margin leaving the "use margin" option set, start the animation, open the performance tool, and make a recording. you'll only need to record a few seconds. open up the first recording. exactly what you'll see depends a lot on your machine and system load, but it will be something like this: this is showing three distinct views: (a) an overview of the waterfall, (b) the frame rate, and (c) the timeline details. waterfall overview this is showing a compressed...
Recommended Web Performance Timings: How long is too long? - Web Performance
the acknowledgment of user interaction should often feel immediate, such as a hover or button press, but that doesn't mean the completed response should be instantaneous. while a slower than 100ms reaction may create a disconnect between the user interaction and the response, a 100 to 200ms transition for a response may help the user notice the response their interaction initiated, such as a menu opening. if a response takes longer than 100ms to complete, provide some form of feedback to inform the user the interaction has occurred. ...
Using dns-prefetch - Web Performance
link target a user tries to follow. why use dns-prefetch? when a browser requests a resource from a (third party) server, that cross-origin’s domain name must be resolved to an ip address before the browser can issue the request. this process is known as dns resolution. while dns caching can help to reduce this latency, dns resolution can add significant latency to requests. for websites that open connections to many third parties, this latency can significantly reduce loading performance. dns-prefetch helps developers mask dns resolution latency. the html <link> element offers this functionality by way of a rel attribute value of dns-prefetch. the cross-origin domain is then specified in the href attribute: syntax <link rel="dns-prefetch" href="https://fonts.gstatic.com/" > examples ...
Web Performance
code in a single event handler on the app's main thread.performance budgetsa performance budget is a limit to prevent regressions. it can apply to a file, a file type, all files loaded on a page, a specific metric (e.g. time to interactive), a custom metric (e.g. time to hero element), or a threshold over a period of time. performance fundamentalsperformance means efficiency. in the context of open web apps, this document explains in general what performance is, how the browser platform helps improve it, and what tools and processes you can use to test and improve it.performance monitoring: rum vs synthetic monitoringsynthetic monitoring and real user monitoring (rum) are two approaches for monitoring and providing insight into web performance. in this article we define and compare these t...
Privacy, permissions, and information security
ecure itself and the data the user entrusts to it. there are several web technologies and features at play to manage privacy and security. the following list includes features affecting both, since many of these features are used for both. ...
Installing and uninstalling web apps - Progressive web apps (PWAs)
upon clicking "add," the app is included on the home screen. the installed web application regardless of which browser and device you're using, when you choose to add the app to your home screen or app launcher, it'll show up there looking just like any application. typically this means you'll see the app's icon along with a short title. when you tap the web app's icon on the home screen, it opens up in a full screen web environment, without the browser's ui around it. ...
How to make PWAs installable - Progressive web apps (PWAs)
, but we can go even further and allow users to install the web app on mobile and desktop browers that support doing so. the installed web app can then be launched by users just as if it were any native app. this article explains how to achieve this using the web app's manifest. these technologies allow the app to be launched directly from the device's home screen, rather than the user having to open the browser and then navigate to the site by using a bookmark or typing the url. your web app can sit next to native applications as first class citizens. this makes the web app easier to access; additionally, you can specify that the app be launched in fullscreen or standalone mode, thus removing the default browser user interface that would otherwise be present, creating an even more seamless a...
Responsive Navigation Patterns - Progressive web apps (PWAs)
navigation items rearrange for smaller widths until there is not enough space. at that point, some items move from the top navigation to a drop-down menu. you could rank the item priorities to ensure the most important items always appear in the top navigation. in the smallest screen, several items stay on the bottom of the screen, and the rest of the items are hidden. the user can flip the menu open and select from the rest of the navigation items. you could select the items that remain on the bottom. pros: expandable menu is easy to discover important items are always visible and you decide the item priorities legibility of navigation items is maintained with adequate spacing, by automatically hiding items that don't fit cons: one more step is needed to access the navigation...
Web technology reference
below you'll find links to a selection of key documentation for each. if you're new to web development, consider starting with our learning area, which is filled with step-by-step tutorials that will guide you from total webdev newbie to at least semi-pro! html — structuring the web hypertext markup language is used to define and describe semantically the content (markup) of a web page in a well-structured format. html provides a means to create structured documents made up of blocks called html elements that are delineated by tags, written using angle brackets. ...
SVG Presentation Attributes - SVG: Scalable Vector Graphics
to paint the outline of the shape. value: <paint>; animatable: yes stroke-dasharray defines the pattern of dashes and gaps used to paint the outline of the shape. value: none|<dasharray>; animatable: yes stroke-dashoffset defines an offset on the rendering of the associated dash array. value: <percentage>|<length>; animatable: yes stroke-linecap defines the shape to be used at the end of open subpaths when they are stroked. value: butt|round|square; animatable: yes stroke-linejoin defines the shape to be used at the corners of paths when they are stroked. value: arcs|bevel|miter|miter-clip|round; animatable: yes stroke-miterlimit defines a limit on the ratio of the miter length to the stroke-width used to draw a miter join. value: <number>; animatable: yes stroke-opacity defi...
string - SVG: Scalable Vector Graphics
Web › SVG › Attribute › string
ent <font-face-uri> element supports. only one element is using this attribute: <font-face-format> usage notes value <anything> default value none animatable no <anything> this value specifies a list of formats that are supported by the font referenced by the parent <font-face-uri> element. the available types are: "woff", "woff2", "truetype", "opentype", "embedded-opentype", and "svg". see the src descriptor of the @font-face at-rule for more information. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'string' in that specification. recommendation initial definition ...
stroke-linecap - SVG: Scalable Vector Graphics
note: as a presentation attribute stroke-linecap can be used as a css property. ...
textLength - SVG: Scalable Vector Graphics
yes <length-percentage> this value specifies the width of the space the text will be adjusted to occupy as absolute length or percentage. <number> a numeric value outlines a length referring to the units of the current coordinate system. example let's create a simple example that presents text you can resize using an <input> element of type "range". css .controls { font: 16px "open sans", "arial", sans-serif; } svg let's start with the svg. it's pretty basic, with a 1000-by-300 pixel space mapped into a 10 centimeter by 3 centimeter box. <svg width="10cm" height="3cm" viewbox="0 0 1000 300" xmlns="http://www.w3.org/2000/svg"> <rect x="1" y="1" width="998" height="298" fill="none" stroke="green" stroke-width="2"/> <text id="hello" x="10" y="150" fon...
xlink:show - SVG: Scalable Vector Graphics
the xlink:show attribute indicates how a linked resource should be opened and is meant for xlink-aware processors. in case of a conflict, the target attribute has priority, since it can express a wider range of values. only one element is using this attribute: <a> usage notes value new | replace | embed | other | none default value replace animatable no new this value specifies that the referenced resource is opened in a new window or tab. this is similar to the effect achieved by an html <a> element with target set to _blank. replace this value specifies that the referenced resource is opened in the same window or tab. this is similar to the effect achieved by an html <a> element with target set to _self. embed this value specifies that i...
<clipPath> - SVG: Scalable Vector Graphics
Web › SVG › Element › clipPath
iginal black heart, for reference --> <path id="heart" d="m10,30 a20,20,0,0,1,50,30 a20,20,0,0,1,90,30 q90,60,50,90 q10,60,10,30 z" /> <!-- only the portion of the red heart inside the clip circle is visible. --> <use clip-path="url(#myclip)" xlink:href="#heart" fill="red" /> </svg> /* with a touch of css for browsers who * * implemented the r geometry property. */ @keyframes openyourheart {from {r: 0} to {r: 60px}} #myclip circle { animation: openyourheart 15s infinite; } a clipping path is conceptually equivalent to a custom viewport for the referencing element. thus, it affects the rendering of an element, but not the element's inherent geometry. the bounding box of a clipped element (meaning, an element which references a <clippath> element via a clip-path prope...
<polygon> - SVG: Scalable Vector Graphics
Web › SVG › Element › polygon
the <polygon> element defines a closed shape consisting of a set of connected straight line segments. the last point is connected to the first point. for open shapes, see the <polyline> element. html,body,svg { height:100% } <svg viewbox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <!-- example of a polygon with the default fill --> <polygon points="0,100 50,25 50,75 100,0" /> <!-- example of the same polygon shape with stroke and no fill --> <polygon points="100,100 150,25 150,75 200,0" fill="none" stroke="black" /> </svg> attributes points this attribute defines the list of points (pairs of x,y absolute coordinates) required to draw the polygon. value type: <number>+ ; default value: ""; animatable: yes pathlength this attribute lets specify the to...
<polyline> - SVG: Scalable Vector Graphics
Web › SVG › Element › polyline
for closed shapes see the <polygon> element. ...
SVG and CSS - SVG: Scalable Vector Graphics
move your mouse pointer over the graphic to see what happens. result notes about this demonstration: the svg document links the stylesheet in the usual way. svg has its own css properties and values. some of them are similar to css properties for html. challenge change the stylesheet so that the inner petals all turn pink when the mous...
SVG: Scalable Vector Graphics
Web › SVG
svg is, essentially, to graphics what html is to text. ...
Certificate Transparency - Web security
newly issued certificates are 'logged' to publicly run, often independent ct logs which maintain an append-only, cryptographically assured record of issued tls certificates. in this way, certificate authorities (cas) can be subject to much greater public scrutiny and oversight. potentially malicious certificates, such as those that violate the ca/b forum baseline requirements, can be detected and revoked much more quickly. browser vendors and root store maintainers are also empowered to make more informed decisions regarding problematic cas that they may decide to distrust. ...
How to fix a website with blocked mixed content - Web security
can set a preference to block this type of content, as well. note that since mixed content blocking already happens in chrome and internet explorer, it is very likely that if your website works in both of these browsers, it will work equally well in firefox with mixed content blocking. in any case, the best way to know if something is broken in firefox is to download the latest firefox edition, open different pages on your website with the web console open (enable the "security" messages) and see if anything related to mixed content is reported. or use a free online crawler like ssl-check or missing padlock, a desktop crawler like httpschecker, or a cli tool like mcdetect to check your website recursively and find links to insecure content. if nothing is said about mixed content, your websit...
Secure contexts - Web security
ent of a top-level browsing context (basically, a containing window or tab) that is a secure context. for example, even for a document delivered over tls within an <iframe>, its context is not considered secure if it has an ancestor that was not also delivered over tls. however, it’s important to note that if a non-secure context causes a new window to be created (with or without specifying noopener), then the fact that the opener was insecure has no effect on whether the new window is considered secure. that’s because the determination of whether or not a particular document is in a secure context is based only on considering it within the top-level browsing context with which it is associated — and not whether a non-secure context happened to be used to create it. locally-delivered ...
Securing your site - Web security
e. content security policy an added layer of security that helps to detect and mitigate certain types of attacks, including cross site scripting (xss) and data injection attacks. these attacks are used for everything from data theft to site defacement or distribution of malware. code is executed by the victims and lets the attackers bypass access controls and impersonate users. according to the open web application security project, xss was the seventh most common web app vulnerability in 2017. the x-frame-options response header the x-frame-options: http response header can be used to indicate whether or not a browser should be allowed to render a page in a <frame>. sites can use this to avoid clickjacking attacks, by ensuring that their content is not embedded into other sites. acce...
Subresource Integrity - Web security
sh. note: an integrity value's "hash" part is, strictly speaking, a cryptographic digest formed by applying a particular hash function to some input (for example, a script or stylesheet file). but it’s common to use the shorthand "hash" to mean cryptographic digest, so that's what's used in this article. tools for generating sri hashes you can generate sri hashes from the command-line with openssl using a command invocation such as this: cat filename.js | openssl dgst -sha384 -binary | openssl base64 -a or with shasum using a command invocation such as this: shasum -b -a 384 filename.js | awk '{ print $1 }' | xxd -r -p | base64 notes: the pipe-through-xxd step takes the hexadecimal output from shasum and converts it to binary. the pipe-through-awk step is necessary because sha...
Transport Layer Security - Web security
ther provide the negotiation of the shared secret, the means by which a server is authenticated, and the method that will be used to encrypt data. the cipher suite in tls 1.3 primarily governs the encryption of data, separate negotiation methods are used for key agreement and authentication. different software might use different names for the same cipher suites. for instance, the names used in openssl and gnutls differ from those in the tls standards. the cipher names correspondence table on the mozilla opsec team's article on tls configurations lists these names as well as information about compatibility and security levels. configuring your server correctly configuring your server is crucial. in general, you should try to limit cipher support to the newest ciphers possible which are com...
Tutorials
the links on this page lead to a variety of tutorials and training materials. whether you are just starting out, learning the basics, or are an old hand at web development, you can find helpful resources here for best practices. these resources are created by forward-thinking companies and web developers who have embraced open standards and best practices for web development and that provide or allow translations, through an open content license such as creative commons. for complete beginners to the web getting started with the web getting started with the web is a concise series introducing you to the practicalities of web development. you'll set up the tools you need to construct a simple webpage and publish your own simple code. html tutorials introductory level intr...
Introduction to using XPath in JavaScript - XPath
7925 0918</phonenumber> </person> </people> to make the contents of the xml document available within the extension, we create an xmlhttprequest object to load the document synchronously, the variable xmldoc will contain the document as an xmldocument object against which we can use the evaluate method javascript used in the extensions xul/js documents. ...
An Overview - XSLT: Extensible Stylesheet Language Transformations
the w3c document. this latter namespace is not compatible with the one that the w3c eventually adopted and is not supported by netscape. because typing "http://www.w3.org/1999/xsl/transform" repeatedly would be tedious and would render the markup difficult to read, there is a standard mechanism for assigning a shorthand name to the namespace in the stylesheet heading. thus a full example of the opening stylesheet element might look like this. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/xsl/transform" version="1.0"> the xmlns pseudo-attribute maps the shorthand name xsl onto the full namespace for use throughout the document that follows. thus the stylesheet element above is prefixed with xsl:. although xsl is the conventionally used shorthand name (called the prefix), it is not man...
Advanced Example - XSLT: Extensible Stylesheet Language Transformations
// importnode is used to clone the nodes we want to process ...
JavaScript/XSLT Bindings - XSLT: Extensible Stylesheet Language Transformations
ans that the .xsl file has to be loaded by the page before calling xsltprocessor.importstylesheet(). this can be done via xmlhttprequest or xmldocument.load(). figure 1 : instantiating an xsltprocessor var xsltprocessor = new xsltprocessor(); // load the xsl file using synchronous (third param is set to false) xmlhttprequest var myxmlhttprequest = new xmlhttprequest(); myxmlhttprequest.open("get", "example.xsl", false); myxmlhttprequest.send(null); var xslref = myxmlhttprequest.responsexml; // finally import the .xsl xsltprocessor.importstylesheet(xslref); for the actual transformation, xsltprocessor requires an xml document, which is used in conjunction with the imported xsl file to produce the final result. the xml document can be a separate xml file loaded as shown in...
Compiling from Rust to WebAssembly - WebAssembly
he variable we're passing is name, the argument to the function, so if we call greet("steve") we should see "hello, steve!". this is passed to alert(), so when we call this function we will see an alert box with "hello, steve!" in it. now that our library is written, let's build it. compiling our code to webassembly to compile our code correctly, we first need to configure it with cargo.toml. ...