Search completed in 1.50 seconds.
1652 results for "action":
Your results are loading. Please wait...
MediaSessionActionDetails.action - Web APIs
the action property is the only required property mediasessionactiondetails dictionary, specifying the type of media session action which the action handler callback is being executed for.
... syntax let mediasessionactiondetails = { action: actiontype }; let actiontype = mediasessionactiondetails.action; value a domstring specifying which of the action types the callback is being invoked for: nexttrack advances playback to the next track.
...this action may or may not be available, depending on the platform and user agent, or may be disabled due to subscription level or other circumstances.
... specifications specification status comment media session standardthe definition of 'mediasessionactiondetails.action' in that specification.
nsITransactionListener
editor/txmgr/idl/nsitransactionlistener.idlscriptable this interface is implemented by an object that tracks transactions.
... inherits from: nsisupports last changed in gecko 1.7 method overview void didbeginbatch(in nsitransactionmanager amanager, in nsresult aresult); void diddo(in nsitransactionmanager amanager, in nsitransaction atransaction, in nsresult adoresult); void didendbatch(in nsitransactionmanager amanager, in nsresult aresult); void didmerge(in nsitransactionmanager amanager, in nsitransaction atoptransaction, in nsitransaction atransactiontomerge, in boolean adidmerge, in nsresult amergeresult); void didredo(in nsitransactionmanager amanager, in nsitransaction atransaction, in nsresult aredoresult); void didundo(in nsitransactionmanager amanager, in nsitransaction atransaction, in nsresult aundoresult); boolean willbeginbatch(in nsitransactionmanager amanager); boolean willdo(in n...
...sitransactionmanager amanager, in nsitransaction atransaction); boolean willendbatch(in nsitransactionmanager amanager); boolean willmerge(in nsitransactionmanager amanager, in nsitransaction atoptransaction, in nsitransaction atransactiontomerge); boolean willredo(in nsitransactionmanager amanager, in nsitransaction atransaction); boolean willundo(in nsitransactionmanager amanager, in nsitransaction atransaction); methods didbeginbatch() called after a nsitransactionmanager begins a batch.
...And 38 more matches
nsITransactionManager
editor/txmgr/idl/nsitransactionmanager.idlscriptable this interface is implemented by an object that wants to manage/track transactions.
... inherits from: nsisupports last changed in gecko 1.7 method overview void addlistener(in nsitransactionlistener alistener); void beginbatch(); void clear(); void dotransaction(in nsitransaction atransaction); void endbatch(); nsitransactionlist getredolist(); nsitransactionlist getundolist(); nsitransaction peekredostack(); nsitransaction peekundostack(); void redotransaction(); void removelistener(in nsitransactionlistener alistener); void undotransaction(); attributes attribute type description maxtransactioncount long sets the maximum number of transaction items the transaction manager will maintain at any time.
...a value of zero means the transaction manager will execute each transaction, then immediately release all references it has to the transaction without pushing it on the undo stack.
...And 35 more matches
IDBTransaction - Web APIs
the idbtransaction interface of the indexeddb api provides a static, asynchronous transaction on a database using event handler attributes.
... all reading and writing of data is done within transactions.
... you use idbdatabase to start transactions, idbtransaction to set the mode of the transaction (e.g.
...And 31 more matches
IAccessibleAction
other-licenses/ia2/accessibleaction.idlnot scriptable this interface gives access to actions that can be executed for accessible objects.
... 1.0 66 introduced gecko 1.9 inherits from: iunknown last changed in gecko 1.9 (firefox 3) every accessible object that can be manipulated via the native gui beyond the methods available either in the msaa iaccessible interface or in the set of iaccessible2 interfaces (other than this iaccessibleaction interface) should support the iaccessibleaction interface in order to provide assistive technology access to all the actions that can be performed by the object.
... each action can be performed or queried for a name, description or associated key bindings.
...And 23 more matches
MediaSessionActionDetails - Web APIs
the media session api's mediasessionactiondetails dictionary is the type used by the sole input parameter into the callback which is executed when a media session action occurs.
... it specifies the type of action which needs to be performed as well as the data needed to perform the action.
... properties action a media session action type string taken from the mediasessionaction enumerated type, indicating which type of action needs to be performed.
...And 23 more matches
nsITransaction
editor/txmgr/idl/nsitransaction.idlscriptable please add a summary to this article.
... inherits from: nsisupports last changed in gecko 1.7 method overview void dotransaction(); boolean merge(in nsitransaction atransaction); void redotransaction(); void undotransaction(); attributes attribute type description istransient boolean the transaction's transient state.
... this attribute is checked by the transaction manager after the transaction's execute() method is called.
...And 18 more matches
IDBDatabase.transaction() - Web APIs
the transaction method of the idbdatabase interface immediately returns a transaction object (idbtransaction) containing the idbtransaction.objectstore method, which you can use to access your object store.
... syntax idbdatabase.transaction(storenames); idbdatabase.transaction(storenames, mode); parameters "durability" -- the durability constrints for the transction.
... storenames the names of object stores that are in the scope of the new transaction, declared as an array of strings.
...And 15 more matches
MediaSession.setActionHandler() - Web APIs
the setactionhandler() property of the mediasession interface sets an event handler for a media session action.
... these actions let a web app receive notifications when the user engages a device's built-in physical or onscreen media controls, such as play, stop, or seek buttons.
... syntax navigator.mediasession.setactionhandler(type, callback) parameters type a domstring representing an action type to listen for.
...And 15 more matches
Media Session action types - Web APIs
to support an action on a media session, such as seeking, pausing, or changing tracks, you need to call the mediasession interface's setactionhandler() method to establish a handler for that action.
... the specific type of media session action to be handled on a mediasession is identified using a string from the mediasessionaction enumerated type.
... syntax a media session action's type is specified using a string from the mediasessionaction enumerated type.
...And 15 more matches
ui/button/action - Archive of obsolete content
usage creating buttons to create a button you must give it an id, an icon, and a label: var { actionbutton } = require("sdk/ui/button/action"); var button = actionbutton({ id: "my-button", label: "my button", icon: { "16": "./firefox-16.png", "32": "./firefox-32.png" }, onclick: function(state) { console.log("button '" + state.label + "' was clicked"); } }); by default, the button appears in the firefox toolbar: however, users can move it to the firefox menu panel using the toolbar customization feature: badged buttons new in firefox 36.
...read more about specifying icons in the reference documentation for the actionbutton constructor.
...you can also add, or change, the listener afterwards: var { actionbutton } = require("sdk/ui/button/action"); var button = actionbutton({ id: "my-button", label: "my button", icon: { "16": "./firefox-16.png", "32": "./firefox-32.png" }, onclick: firstclick }); function firstclick(state) { console.log("you clicked '" + state.label + "'"); button.removelistener("click", firstclick); button.on("click", subsequentclicks); } function subsequentclicks(state) { console.log("you clicked '" + state.label + "' again"); } the listener is passed a state o...
...And 13 more matches
Actions - Archive of obsolete content
« previousnext » the content to generate in a template is specified using the <xul:action> element which should either be the next sibling of the <xul:query> element (if no rules need be specified) or be a direct child of a <xul:rule> element.
... the content to generate goes directly inside the action element.
...<vbox datasources="http://www.xulplanet.com/ds/sample.rdf" ref="http://www.xulplanet.com/rdf/a"> <template> <query> <content uri="?start"/> <triple subject="?start" predicate="http://www.xulplanet.com/rdf/relateditem" object="?relateditem"/> </query> <action> <button uri="?relateditem" label="?relateditem"/> </action> </template> </vbox> in this example, we omit the <xul:rule> element around the <xul:action> as it is optional when we want to generate content unconditionally.
...And 12 more matches
nsITransactionList
editor/txmgr/idl/nsitransactionlist.idlscriptable please add a summary to this article.
... inherits from: nsisupports last changed in gecko 1.7 method overview nsitransactionlist getchildlistforitem(in long aindex); nsitransaction getitem(in long aindex); long getnumchildrenforitem(in long aindex); boolean itemisbatch(in long aindex); attributes attribute type description numitems long the number of transactions contained in this list.
...the list returned is addref'd so it is up to the caller to release the transaction when it is done.
...And 10 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.
...And 10 more matches
IDBTransactionSync - Web APIs
the idbtransactionsync interface of the indexeddb api provides a synchronous transaction on a database.
... when an application creates an idbtransactionsync object, it blocks until the browser is able to reserve the require database objects.
... method overview void abort() raises (idbdatabaseexception); void commit() raises (idbdatabaseexception); idbobjectstoresync objectstore(in domstring name) raises (idbdatabaseexception); attributes attribute type description db idbdatabasesync the database connection that this transaction is associated with.
...And 10 more matches
touch-action - CSS: Cascading Style Sheets
the touch-action css property sets how an element's region can be manipulated by a touchscreen user (for example, by zooming features built into the browser).
... /* keyword values */ touch-action: auto; touch-action: none; touch-action: pan-x; touch-action: pan-left; touch-action: pan-right; touch-action: pan-y; touch-action: pan-up; touch-action: pan-down; touch-action: pinch-zoom; touch-action: manipulation; /* global values */ touch-action: inherit; touch-action: initial; touch-action: unset; by default, panning (scrolling) and pinching gestures are handled exclusively by the browser.
...applications using touch events disable the browser handling of gestures by calling preventdefault(), but should also use touch-action to ensure the browser knows the intent of the application before any event listeners have been invoked.
...And 9 more matches
nsIMsgFilterCustomAction
defined in comm-central/ mailnews/ base/ search/ public/ nsimsgfiltercustomaction.idl interface nsimsgfiltercustomaction : nsisupports { /* globally unique string to identify this filter action.
... * recommended form: extensionname@example.com#actionname */ readonly attribute acstring id; /* action name to display in action list.
...*/ readonly attribute astring name; /** * is this custom action valid for a particular filter type?
...And 8 more matches
IDBTransaction.oncomplete - Web APIs
the oncomplete event handler of the idbtransaction interface handles the complete event, fired when the transaction successfully completes.
... 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 was fired only when all data was guaranteed to have been flushed to disk.
...And 8 more matches
<maction> - MathML
the mathml <maction> element provides a possibility to bind actions to (sub-) expressions.
... the action itself is specified by the actiontype attribute, which accepts several values.
... to specify which child elements are addressed by the action, you can make use of the selection attribute.
...And 8 more matches
IDBTransaction.objectStore() - Web APIs
the objectstore() method of the idbtransaction interface returns an object store that has already been added to the scope of this transaction.
... every call to this method on the same transaction object, with the same name, returns the same idbobjectstore instance.
... if this method is called on a different transaction object, a different idbobjectstore instance is returned.
...And 7 more matches
IDBTransaction.error - Web APIs
the idbtransaction.error property of the idbtransaction interface returns one of several types of error when there is an unsuccessful transaction.
... syntax var myerror = transaction.error; value a domerror containing the relevant error.
...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).
...And 6 more matches
IDBTransaction.mode - Web APIs
the mode read-only property of the idbtransaction interface returns the current mode for accessing the data in the object stores in the scope of the transaction (i.e.
... syntax var mycurrentmode = idbtransaction.mode; value an idbtransactionmode object defining the mode for isolating access to data in the current object stores: value explanation readonly allows data to be read but not changed.
...this mode is for updating the version number of transactions that were started using idbdatabase.setversion().
...And 6 more matches
Multi-touch interaction - Web APIs
this additional feature can be used to provide richer user interaction models but at the cost of additional complexity in the multi-touch interaction handling.
... this document demonstrates via example code, using pointer events with different multi-touch interactions.
... example this example demonstrates using pointer events' various event types (pointerdown, pointermove, pointerup pointercancel, etc.) for different multi-touch interactions.
...And 6 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.
... 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().
...And 5 more matches
IDBTransaction.abort() - Web APIs
the abort() method of the idbtransaction interface rolls back all the changes to objects in the database associated with this transaction.
... all pending idbrequest objects created during this transaction have their idbrequest.error attribute set to aborterror.
... 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.
...And 5 more matches
IDBTransaction.onerror - Web APIs
the onerror event handler 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.
... syntax transaction.onerror = function(event) { ...
...And 5 more matches
Web accessibility for seizures and physical reactions - Accessibility
this article introduces concepts behind making web content accessibile for those with vestibular disorders, and how to measure and prevent content leading to seizures and / or other physical reactions.
...web technologies that use video, animated gifs, animated pngs, animated svgs, canvas, and css or javascript animations are all capable of content that can induce seizures or other incapacitating physical reactions.
... certain visual patterns, especially stripes, can also cause physical reactions even though they are not animated.
...And 5 more matches
IDBTransaction.commit() - Web APIs
the commit() method of the idbtransaction interface commits the transaction if it is called on an active transaction.
... note that commit() doesn't normally have to be called — a transaction will automatically commit when all outstanding requests have been satisfied and no new requests have been made.
... if it is called on a transaction that is not active, it throws an invalidstateerror domexception.
...And 4 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.
... 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.
...And 4 more matches
NotificationAction - Web APIs
the notificationaction interface of the notifications api is used to represent action buttons the user can click to interact with notifications.
... these buttons' appearance and specific functionality vary across platforms but generally they provide a way to asynchronously show actions to the user in a notification.
... notificationaction.action read only the name of the action, which can be used to identify the clicked action similar to input names.
...And 4 more matches
CSP: form-action - HTTP
the http content-security-policy (csp) form-action directive restricts the urls which can be used as the target of a form submissions from a given context.
... whether form-action should block redirects after a form submission is debated and browser implementations of this aspect are inconsistent (e.g.
... syntax one or more sources can be set for the form-action policy: content-security-policy: form-action <source>; content-security-policy: form-action <source> <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number.
...And 4 more matches
IDBTransaction.db - Web APIs
WebAPIIDBTransactiondb
the db read-only property of the idbtransaction interface returns the database connection with which this transaction is associated.
... 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.
...And 3 more matches
MediaSessionActionDetails.seekTime - Web APIs
the mediasessionactiondetails dictionary's seektime property is always included when a seekto action is sent to the action handler callback.
... to change the time by an offset rather than moving to an absolute time, the seekforward or seekbackward actions should be used instead.
... syntax let mediasessionactiondetails = { seektime: abstimeinseconds }; let abstime = mediasessionactiondetails.seektime; value a floating-point value indicating the absolute time in seconds into the media to which to move the current play position.
...And 3 more matches
Notification.actions - Web APIs
the actions read-only property of the notification interface returns the list of notificationaction objects set using the actions option when creating the notification using the notification() constructor.
... this is a list of the application-defined actions the user can choose to take immediately within the context of a notification.
... note: device and user agent might be able to display only a limited number of actions (due to, e.g., limited screen space).
...And 3 more matches
Notification.maxActions - Web APIs
the maxactions attribute of the notification interface returns the maximum number of actions supported by the device and the user agent.
... effectively, this is the maximum number of elements in notification.actions array which will be respected by the user agent.
... syntax notification.maxactions value an integer number which indicates the largest number of notification actions that can be presented to the user by the user agent and the device.
...And 2 more matches
MathML Demo: <mfrac> - fractions
fraction lines should align vertically with the math axis.
... inline fenced nested fractions [ ∥ sin ⁡ θ + 1 11 ∥ - x x 2 a 1 ] + [ 1.0 ] etc.
... latex renders continued fractions 1 2 + 1 3 + 1 4 + 1 5 + 1 6 + … normal size at all levels in all contexts 1 2 + 1 3 + 1 4 + 1 5 + 1 6 + … inline nested fracs 1 6 2 + 1 3 + 1 4 + 1 5 + 1 6 + … are script size at the first level and decrease to script script size for all more nested levels.
... displayed nested fractions are normal size at the first level, 1 6 2 + 1 3 + 1 4 + 1 5 + 1 6 + … script size at second level, and script-script size at all more nested levels.
DoAction
« nsiaccessible page summary this method performs the accessible action at the given zero-based index.
... action number 0 is the default action.
... void doaction( in pruint8 aindex ); parameters aindex[in] the zero-based index.
... see also nsiaccessible.numactions nsiaccessible.getactionname() nsiaccessible.getactiondescription() ...
GetActionDescription
« nsiaccessible page summary this method retrieves the description (localized name) of the accessible action at the given zero-based index.
... astring getactiondescription( in pruint8 aindex ); parameters aindex[in] the zero-based index.
... return value returns the description of the accessible action.
... see also nsiaccessible.numactions nsiaccessible.getactionname() nsiaccessible.doaction() ...
GetActionName
« nsiaccessible page summary this method retrieves the name of the accessible action at the given zero-based index.
... astring getactionname( in pruint8 aindex ); parameters aindex[in] the zero-based index.
... return value returns the name of the accessible action.
... see also nsiaccessible.numactions nsiaccessible.getactiondescription() nsiaccessible.doaction() ...
nsIMsgRuleAction
defined in comm-central/ mailnews/ base/ search/ public/ nsimsgfilter.idl [scriptable, uuid(190a2a18-d245-473a-a402-9f0814598c7f)] interface nsimsgruleaction : nsisupports { attribute nsmsgruleactiontype type; // target priority..
... throws an exception if the action is not priority attribute nsmsgpriorityvalue priority; // target folder..
... throws an exception if the action is not move to folder attribute acstring targetfolderuri; // target label.
... throws an exception if the action is not label attribute nsmsglabelvalue label; // junkscore throws an exception if the action type is not junkscore attribute long junkscore; attribute autf8string strvalue; // action id if type is custom attribute acstring customid; // custom action associated with customid // (which must be set prior to reading this attribute) readonly attribute nsimsgfiltercustomaction customaction; }; ...
IDBTransaction: abort event - Web APIs
the abort event is fired when an indexeddb transaction is aborted.
... 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.
...'hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = event => { const db = dbopenrequest.result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); // add a listener for `abort` transaction.addeventlistener('abort', () => { console.log('transaction was aborted'); }); // abort the transaction transaction.abort(); }; the same example, but assigning the event handler to the onabort property: // open the database const dbopenrequest = w...
...'hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = event => { const db = dbopenrequest.result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); // add a listener for `abort` transaction.onabort = (event) => { console.log('transaction was aborted'); }; // abort the transaction transaction.abort(); }; ...
MediaSessionActionDetails.fastSeek - Web APIs
the boolean property fastseek in the mediasessionactiondetails dictionary is an optional value which, when specified and true, indicates that the requested seekto operation is part of an ongoing series of seekto operations.
... once fastseek is false or not present, the repeating series of seekto actions is complete and you can finalize the state of your web app or content.
... syntax let mediasessionactiondetails = { fastseek: shouldfastseek }; let shouldfastseek = mediasessionactiondetails.fastseek; value a boolean which is true if the action is part of an ongoing series of seek actions which should be treated as part of an overall seek operation.
... specifications specification status comment media session standardthe definition of 'mediasessionactiondetails.fastseek' in that specification.
Notification.requireInteraction - Web APIs
the requireinteraction read-only property of the notification interface returns a boolean indicating that a notification should remain active until the user clicks or dismisses it, rather than closing automatically.
... note: this can be set when the notification is first created by setting the requireinteraction option to true in the options object of the notification.notification() constructor.
... syntax function spawnnotification(thetitle,thebody,shouldrequireinteraction) { var options = { body: thebody, requireinteraction: shouldrequireinteraction } var n = new notification(thetitle,options); } value a boolean.
... specifications specification status comment notifications apithe definition of 'requireinteraction' in that specification.
Actionscript Acceptance Tests - Archive of obsolete content
the majority of the acceptance tests are written in actionscript and located in test/acceptance.
...the most common tests are written in actionscript and end with .as.
... support files: there are a variety of support files available for non-standard actionscript tests.
action - Archive of obsolete content
the action should be contained within a query or rule element.
... one descendant of the action body should have a uri attribute set to the member variable.
...for more information, see actions.
Abstraction - MDN Web Docs Glossary: Definitions of Web-related terms
abstraction in computer programming is a way to reduce complexity and allow efficient design and implementation in complex software systems.
... advantages of data abstraction helps the user to avoid writing low level code.
... example class implementabstraction { // method to set values of internal members set(x, y) { this.a = x; this.b = y; } display() { console.log('a = ' + this.a); console.log('b = ' + this.b); } } const obj = new implementabstraction(); obj.set(10, 20); obj.display(); // a = 10 // b = 20 learn more general knowledge abstraction on wikipedia ...
HTMLFormElement.action - Web APIs
the htmlformelement.action property represents the action of the <form> element.
... the action of a form is the program that is executed on the server when the form is submitted.
... syntax var string = form.action; form.action = string; example form.action = '/cgi-bin/publish'; specifications specification status comment html living standardthe definition of 'htmlformelement: action' in that specification.
IDBTransaction: complete event - Web APIs
the complete handler is executed when a transaction successfully completed.
...'hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = event => { const db = dbopenrequest.result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); // add a listener for `complete` transaction.addeventlistener('complete', event => { console.log('transaction was competed'); }); const objectstore = transaction.objectstore('todolist'); const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2019 };...
...'hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = event => { const db = dbopenrequest.result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); // add a listener for `complete` transaction.oncomplete = event => { console.log('transaction was competed'); }; const objectstore = transaction.objectstore('todolist'); const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2019 }; const objectst...
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.
...ours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const db = dbopenrequest.result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); transaction.addeventlistener('error', () => { console.log(`error adding new item: ${newitem.tasktitle}`); }); const objectstore = transaction.objectstore('todolist'); const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2020 }; const objectstorer...
...ours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const db = dbopenrequest.result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); transaction.onerror = () => { console.log(`error adding new item: ${newitem.tasktitle}`); }; const objectstore = transaction.objectstore('todolist'); const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2020 }; const objectstorerequest = objectst...
MediaSessionActionDetails.seekOffset - Web APIs
the mediasessionactiondetails dictionary's seekoffset property is an optional value passed into the action handler callback to provide the number of seconds the seekforward and seekbackward actions should move the playback time by.
... syntax let mediasessionactiondetails = { seekoffset: deltatimeinseconds }; let deltatime = mediasessionactiondetails.seekoffset; value a floating-point value indicating the time delta in seconds by which to move the playback position relative to its current timestamp.
... specifications specification status comment media session standardthe definition of 'mediasessionactiondetails.seekoffset' in that specification.
NotificationEvent.action - Web APIs
this value returns an empty string if the user clicked the notification somewhere other than an action button, or the notification does not have a button.
... the notification id is set during the creation of the notification via the actions array attribute and can't be modified unless the notification is replaced.
... 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.
NumActions
« nsiaccessible page summary the number of accessible actions associated with this accessible.
... attribute unsigned long numactions; see also nsiaccessible.getactionname() nsiaccessible.getactiondescription() nsiaccessible.doaction() ...
IDBTransaction.objectStoreNames - Web APIs
the objectstorenames read-only property of the idbtransaction interface returns a domstringlist of names of idbobjectstore objects.
... syntax var mydatabase = transactionobj.objectstorenames; returns a domstringlist of names of idbobjectstore objects.
Multi-touch interaction - Web APIs
the touch event interfaces support application-specific single and multi-touch interactions.
...the application described in this guide shows how to use touch events for simple single and multi-touch interactions, the basics needed to build application-specific gestures.
Subtraction (-) - JavaScript
the subtraction operator (-) subtracts the two operands, producing their difference.
... syntax operator: x - y examples subtraction with numbers 5 - 3 // 2 3 - 5 // -2 subtraction with non-numbers 'foo' - 3 // nan specifications specification ecmascript (ecma-262)the definition of 'subtraction operator' in that specification.
Subtraction assignment (-=) - JavaScript
the subtraction assignment operator (-=) subtracts the value of the right operand from a variable and assigns the result to the variable.
... syntax operator: x -= y meaning: x = x - y examples using subtraction assignment // assuming the following variable // bar = 5 bar -= 2 // 3 bar -= 'foo' // nan specifications specification ecmascript (ecma-262)the definition of 'assignment operators' in that specification.
Interaction between privileged and non-privileged pages - Archive of obsolete content
* @see <https://developer.mozilla.org/docs/code_snippets/ * interaction_between_privileged_and_non-privileged_pages#security_notes> */ function geteventdata(event) { if (event.target.ownerdocument != targetdoc) throw "event from unexpected source"; return new xml(event.target.getattribute("eventdatafrompage")); } security notes never invoke the web page's javascript functions from your extension - doing this increases the chance of creating a security h...
userAction - Archive of obsolete content
« xul reference home useraction type: one of the values below this attribute will be set to the action the user is currently performing.
userAction - Archive of obsolete content
« xul reference useraction type: string gets and sets the value of the useraction attribute.
MathML In Action
mathml in action are you seeing nifty equations throughout this page?
nsMsgRuleActionType
defined in comm-central/ mailnews/ base/ search/ public/ nsmsgfiltercore.idl typedef long nsmsgruleactiontype; [scriptable, uuid(59af7696-1e28-4642-a400-fa327ae0b8d8)] interface nsmsgfilteraction { /* if you change these, you need to update filter.properties, look for filteractionx */ /* these longs are all actually of type nsmsgfilteractiontype */ const long custom=-1; /* see nsmsgfilteraction */ const long none=0; /* uninitialized state */ const long movetofolder=1; const long changepriority=2; const long delete=3; const long markread=4; const long killthread=5; const long watchthread=6; const long markflagged=7; const long label=8; const long reply=9; const long forward=10; const long stopexecution=11; ...
Index - Web APIs
WebAPIIndex
495 cssvaluelist api, cssvaluelist, dom, interface, reference the cssvaluelist interface derives from the cssvalue interface and provides the abstraction of an ordered collection of css values.
... 980 document: copy event event the copy event fires when the user initiates a copy action through the browser's user interface.
... 981 document: cut event event the cut event is fired when the user has initiated a "cut" action through the browser's user interface.
...And 100 more matches
Using IndexedDB - Web APIs
start a transaction and make a request to do some database operation, like adding or retrieving data.
...// moreover, you may need references to some window.idb* objects: window.idbtransaction = window.idbtransaction || window.webkitidbtransaction || window.msidbtransaction || {read_write: "readwrite"}; // this line should only be needed if it is needed to support the object's constants for older browsers window.idbkeyrange = window.idbkeyrange || window.webkitidbkeyrange || window.msidbkeyrange; // (mozilla has never prefixed these objects, so we don't need window.mozidb*) beware tha...
... the open request doesn't open the database or start the transaction right away.
...And 92 more matches
MathML Accessibility in Mozilla
mathml windows mac linux accessfu diagonal of a regular pentagon video video video / x+2 __________ x plus 2 __________ x+2 x plus 2 x + y ab __________ a over b __________ fraction start, a over b, end of fraction fraction start.
...fraction end.
... a numerator b denominator fraction ab\frac a b ab __________ a over b __________ fraction start, a over b, end of fraction.
...And 58 more matches
Inputs and input sources - Web APIs
inputs in webxr fundamentally, inputs in webxr fall into two basic categories: targeting and actions.
... actions include both selection actions, such as clicking on a button, and squeeze actions, such as pulling a trigger or tightening your grip while wearing haptic gloves.
... input device types webxr supports a variety of different types of devices to handle targeting and action inputs.
...And 48 more matches
Index
MozillaTechXPCOMIndex
71 monitoring http activity http gecko includes the nsihttpactivityobserver interface, which you can implement in your code to monitor http transactions in real time, receiving a callback as the transactions take place.
... 162 iaccessibleaction interfaces, xpcom, xpcom interface reference every accessible object that can be manipulated via the native gui beyond the methods available either in the msaa iaccessible interface or in the set of iaccessible2 interfaces (other than this iaccessibleaction interface) should support the iaccessibleaction interface in order to provide assistive technology access to all the actions that c...
...each action can be performed or queried for a name, description or associated key bindings.
...And 39 more matches
Basic concepts - Web APIs
overview of indexeddb indexeddb lets you store and retrieve objects that are indexed with a "key." all changes that you make to the database happen within transactions.
... indexeddb is built on a transactional database model.
... everything you do in indexeddb always happens in the context of a transaction.
...And 32 more matches
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
we will also learn about the action directive, which will allow us to extend the functionality of html elements in a reusable and declarative way.
... the following new components will be developed throughout the course of this article: moreactions: displays the check all and remove completed buttons, and emits the corresponding events required to handle their functionality.
... repl to code along with us using the repl, start at https://svelte.dev/repl/76cc90c43a37452e8c7f70521f88b698?version=3.23.2 working on the moreactions component now we'll tackle the check all and remove completed buttons.
...And 30 more matches
Index - Archive of obsolete content
118 ui/button/action add a button to the firefox user interface.
... 172 alerts and notifications code snippets non-modal notification and further interaction with users 173 autocomplete code snippets, form fill, satchel no summary!
... 224 communication between html and your extension add-ons, extensions, web development see also interaction between privileged and non-privileged pages.
...And 25 more matches
mozIStorageConnection
method overview void asyncclose([optional] in mozistoragecompletioncallback acallback); void begintransaction(); void begintransactionas(in print32 transactiontype); mozistoragestatement clone([optional] in boolean areadonly); void close(); void committransaction(); void createaggregatefunction(in autf8string afunctionname, in long anumarguments, in mozistorageaggregatefunction afunction); mozistorageasyncstatement createasyncstatement(in autf8stri...
...ed long anumstatements, [optional] in mozistoragestatementcallback acallback ); void executesimplesql(in autf8string asqlstatement); boolean indexexists(in autf8string aindexname); void preload(); obsolete since gecko 1.9 void removefunction(in autf8string afunctionname); mozistorageprogresshandler removeprogresshandler(); void rollbacktransaction(); void setgrowthincrement(in print32 aincrement, in autf8string adatabasename); mozistorageprogresshandler setprogresshandler(in print32 agranularity, in mozistorageprogresshandler ahandler); boolean tableexists(in autf8string atablename); attributes attribute type description connectionready boolean indicates if the connection i...
... transactioninprogress boolean returns true if there is a transaction in progress on the database.
...And 22 more matches
Sqlite.jsm
since sqlite.jsm manages statements for you, it can perform intelligent actions like purging all cached statements not in use, freeing memory in the process.
... simpler transactions.
... sqlite.jsm exposes a transaction api built on top of task.jsm that allows transactions to be written as procedural javascript functions (as opposed to a series of callback driven operations).
...And 19 more matches
Observer Notifications
user-interaction-active nsidomwindow null sent once every 5000ms while this chrome document sees some kind of user activity (for example, keyboard or mouse events), and at the exact moment of the state transition from idle to active.
... user-interaction-inactive nsidomwindow null sent when the chrome document has seen no user activity for a while.
... this topic indicates when the extension manager performs some action.
...And 16 more matches
How to convert an overlay extension to restartless - Archive of obsolete content
this article is a step-by-step tutorial on how to convert an old overlay-based extension into a restartless (bootstrapped) extension that is also extractionless.
...it's probably a good idea to do this even if you aren't going fully restartless / extractionless due to the previously mentioned exposure to content of resource mappings.
...if you want to also make your add-on extractionless then you may need "step 3" if you're loading files with nsifileinputstream or something similar, or a jar: uri might work.
...And 15 more matches
Storage
closing a connection to close a connection on which only synchronous transactions were performed, use the mozistorageconnection.close() method.
... if you performed any asynchronous transactions, you should instead use the mozistorageconnection.asyncclose() method.
... the latter will allow all ongoing transactions to complete before closing the connection, and will optionally notify you via callback when the connection is closed.
...And 15 more matches
Client-side storage - Learn web development
let's look at this in action.
...below your previous line: // define the adddata() function function adddata(e) { // prevent default - we don't want the form to submit in the conventional way e.preventdefault(); // grab the values entered into the form fields and store them in an object ready for being inserted into the db let newitem = { title: titleinput.value, body: bodyinput.value }; // open a read/write db transaction, ready for adding the data let transaction = db.transaction(['notes_os'], 'readwrite'); // call an object store that's already been added to the database let objectstore = transaction.objectstore('notes_os'); // make a request to add our newitem object to the object store let request = objectstore.add(newitem); request.onsuccess = function() { // clear the form, ready for adding...
... the next entry titleinput.value = ''; bodyinput.value = ''; }; // report on the success of the transaction completing, when everything is done transaction.oncomplete = function() { console.log('transaction completed: database modification finished.'); // update the display of data to show the newly added item, by running displaydata() again.
...And 14 more matches
nsIMessenger
method overview void setdisplaycharset(in acstring acharset); void setwindow(in nsidomwindow ptr, in nsimsgwindow msgwindow); void openurl(in acstring aurl); void loadurl(in nsidomwindow ptr, in acstring aurl); void launchexternalurl(in acstring aurl); boolean canundo(); boolean canredo(); unsigned long getundotransactiontype(); unsigned long 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...
... attributes attribute type description transactionmanager nsitransactionmanager readonly: the transaction manager for this nsimessenger instance.
... constants name value description eunknown 0 unknown transaction type.
...And 13 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
5 api codingscripting, glossary, infrastructure an api (application programming interface) is a set of features and rules that exist inside a software program (the application) enabling interaction with it through software - as opposed to a human user interface.
... 10 abstraction abstraction, coding, codingscripting, glossary, programming language abstraction in computer programming is a way to reduce complexity and allow efficient design and implementation in complex software systems.
... 63 callback function callback, callback function, codingscripting, glossary a callback function is a function passed into another function as an argument, which is then invoked inside the outer function to complete some kind of routine or action.
...And 11 more matches
PopupNotifications.jsm
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.
... notification show( browser, id, message, anchorid, mainaction, secondaryactions, options ); parameters browser the xul <xul:browser> element with which the notification is associated.
... mainaction a javascript object literal containing fields that define the button to draw in the notification panel.
...And 11 more matches
Necko walkthrough
ncopen nshttpchannel::beginconnect() creates nshttpconnectioninfo object for the channel checks if we're proxying or not fires off the dns prefetch request (dispatched to dns thread pool) some other things nshttpchannel::connect might to a speculativeconnect (pre open tcp socket) nshttpchannel::continueconnect some cache stuff nshttpchannel::setuptransaction creates new nshttptransaction, and inits it with mrequesthead (the request headers) and muploadstream (which was created from the request data in channel setup) gets an nsiasyncinputstream (for the response; corresponds to the nspipeinputstream for the response stream pipe) passes it to nsinputstreampump nshttpchannel::ghttphandler->initiatetransaction (called from connect) ...
... this is the global nshttphandler object, which adds the transaction to the nshttpconnectionmgr (one of these per nshttphandler).
... nshttpconnectionmgr::postevent creates an nsconnevent with params including the handler function, nshttpconnectionmgr::onmsgnewtransaction, and the recently created nshttptransaction.
...And 11 more matches
Performance
transactions there is overhead associated with each transaction.
... when you execute a sql statement in isolation, an implicit transaction is created around that statement.
... when transactions are committed, sqlite does journaling which requires syncing data to disk.
...And 10 more matches
XRInputSource - Web APIs
the device is specific to the platform being used, but provides the direction in which it is being aimed and optionally may generate events if the user triggers performs actions using the device.
... usage notes actions and the target ray if the device provides an indication of the direction in which it is pointed, this is done using a target ray.
... if the device includes a trigger or other squeezable input, such as a hand gesture device that recognizes when the user squeezes their fist, that action is called a primary squeeze action.
...And 10 more matches
Index
a cryptographic transaction, such as encryption or decryption related to a data exchange, usually involves working with the x.509 certs of your communication partners (peer).
...the usual follow up action is receiving a signed certificate from a ca.
...you must know which data you are expecting, and use the correct template for parsing, based on the context of your software's interaction.
...And 9 more matches
TPS Bookmark Lists
after: the title of the bookmark item expected to be found after this bookmark; used only in verify and modify actions.
... before: the title of the bookmark item expected to be found before this bookmark; used only in verify and modify actions.
... changes: an object containing new properties to be set for this bookmark when this asset list is used in a modify action.
...And 9 more matches
Places utilities for JavaScript
ince gecko 21 boolean nodeislivemarkitem(nsinavhistoryresultnode anode); obsolete since gecko 21 boolean isreadonlyfolder(nsinavhistoryresultnode anode); int getindexofnode(nsinavhistoryresultnode anode); string wrapnode(nsinavhistoryresultnode anode, string atype, nsiuri aoverrideuri); array unwrapnodes(string blob, string atype); nsitransaction maketransaction(string data, string type, nsinavhistoryresultnode container, int index, boolean copy); nsinavhistoryresult getfoldercontents(int afolderid, boolean aexcludeitems, boolean aexpandqueries); boolean showaddbookmarkui(nsiuri auri, string atitle, string adescription, int adefaultinsertionpoint, boolean ashowpicker, boolean aloadinsidebar, string akeyword, string apost...
... bookmarks nsinavbookmarksservice history nsinavhistoryservice globalhistory nsibrowserhistory livemarks nsilivemarkservice annotations nsiannotationservice favicons nsifaviconservice microsummaries nsimicrosummaryservice tagging nsitaggingservice rdf nsirdfservice ptm nsiplacestransactionsservice clipboard nsiclipboard urifixup nsiurifixup special places these are essentially references to the id's of special folders within places.
... maketransaction() constructs a transaction for the drop or paste of a blob of data into a container.
...And 9 more matches
IAccessibleHyperlink
1.0 66 introduced gecko 1.9 inherits from: iaccessibleaction last changed in gecko 1.9 (firefox 3) this interface represents a hyperlink associated with a single substring of text or single non-text object.
...this interface is derived from iaccessibleaction.
... iaccessibleaction.nactions() is one greater than the maximum value for the indices used with the methods of this interface.
...And 9 more matches
nsIDragService
nsidragsession getcurrentsession( ) ; void invokedragsession( in nsidomnode adomnode, in nsisupportsarray atransferables, in nsiscriptableregion aregion, in unsigned long aactiontype ); void invokedragsessionwithimage(in nsidomnode adomnode, in nsisupportsarray atransferablearray, in nsiscriptableregion aregion, in unsigned long aactiontype, in nsidomnode aimage, in long aimagex, in long aimagey, in nsidomdragevent adragevent, in nsidomdatatransfer adatatransfer); void invokedragsessionwithselection(in nsiselection aselection, in nsisupportsarray atrans...
...ferablearray, in unsigned long aactiontype, in nsidomdragevent adragevent, in nsidomdatatransfer adatatransfer); void startdragsession( ) ; void suppress(); void unsuppress(); constants constant value description dragdrop_action_none 0 no action.
... dragdrop_action_copy 1 the drag and drop operation should copy the object.
...And 9 more matches
nsIPermissionManager
constants permission type constants constant value description unknown_action 0 default permission when no entry is found for a host.
... allow_action 1 permission is allowed.
... deny_action 2 permission is denied.
...And 9 more matches
Index - Archive of obsolete content
ArchiveMozillaXULIndex
409 useraction xul attributes, xul reference no summary!
... 877 useraction xul properties, xul reference no summary!
... 918 template guide xul, xul_template_guide basics of xul templates 919 actions xul, xul_template_guide the content to generate in a template is specified using the action element which should either be the next sibling of the query element (if no rules need be specified) or be a direct child of a rule element.
...And 8 more matches
Sending form data - Learn web development
the two most important attributes are action and method.
... the action attribute the action attribute defines where the data gets sent.
... in this example, the data is sent to an absolute url — https://example.com: <form action="https://example.com"> here, we use a relative url — the data is sent to a different url on the same origin: <form action="/somewhere_else"> when specified with no attributes, as below, the <form> data is sent to the same page that the form is present on: <form> note: it's possible to specify a url that uses the https (secure http) protocol.
...And 8 more matches
Adobe Flash - Archive of obsolete content
the example below shows a detection heuristic in action.
...with fscommands, developers may choose to use macromedia's actionscript language to make a call back into the environment that contains the flash animation -- in this case, the html page.
... the example below shows both types of communication in action: example 3: javascript to flash communication and fscommands -- flash to javascript communication the example is missing.
...And 7 more matches
TPS Tests
the extension will read the test file and perform a series of actions specified therein, such as populating a set of bookmarks, syncing to the sync server, making bookmark modifications, etc.
...a phase runs in some firefox profile, and contains some set of actions to perform or check on that profile.
... bookmarks passwords history tabs form data prefs test phases the phase blocks are where the action happens!
...And 7 more matches
nsIAccessible
actions you can prepare actions on some accessibles (for example on button accessible).
... the following methods are intended for this nsiaccessible.actioncount, nsiaccessible.getactionname(), nsiaccessible.getactiondescription() and nsiaccessible.doaction().
...keyboard shortcuts some actions on accessibles can be performed by keyboard shortcuts.
...And 7 more matches
Media Session API - Web APIs
interaction with these elements even trigger handlers in the web page, playing the media.
... mediasession allows a web page to provide custom behaviors, for standard media playback interactions.
... mediasessionactiondetails provides information needed in order to perform the action which has been requested, including the type of action to perform and any other information needed, such as seek distances or times.
...And 7 more matches
XUL Migration Guide - Archive of obsolete content
for example, action buttons appear by default in the main firefox toolbar (although users may relocate them by toolbar customization) because it makes for a better user experience for add-ons to expose their interfaces in a consistent way.
... similarly, the supported apis expose only a small fraction of the full range of xpcom functionality.
... in this section we'll use low-level modules how to: modify the browser chrome using dynamic manipulation of the dom directly access the tabbrowser object modifying the browser chrome this example uses the action button api, which is only available from firefox 29 onwards.
...And 6 more matches
Adding Events and Commands - Archive of obsolete content
it's very useful because it represents the most common action for input controls such as menu items, buttons and checkboxes.
... for a button, it represents the action of the user clicking on it, or focusing it with the keyboard and then pressing the enter key.
... it's an abstraction of the main way to interact with a control element.
...And 6 more matches
More Event Handlers - Archive of obsolete content
prevent default action if no event handlers have been registered for an event, then after completing the capturing and bubbling phases, the element will handle the event in a default way.
...the default action is to display the popup.
... if the default action is prevented, the popup will not be displayed.
...And 6 more matches
Basics
</p> <div> <math display="block"> <mtable> <mtr> <mtd> <mtable align="axis" columnalign="left left left"> <mtr> <mtd> <maction id="a11" actiontype="toggle" selection="2"> <msup> <mrow> <mo>(</mo> <mrow> <mi>x</mi> <mo>+</mo> <mi>y</mi> </mrow> <mo>)</mo> </mrow> <mn>0</mn> </msup> <mn>1</mn> </maction> </mtd> <mtd> <maction id="a12" actiontype="toggle" selection="2"> <msup> <mrow> <mo>(</mo> <mrow> <mi>x</mi> <mo>+</mo> <mi>y</mi> </mrow> <mo>)</mo> </mrow> <mn>1</mn> </msup> <mrow> <mi>x</mi> <mo>+</mo> <mi>y</mi> </mro...
...w> </maction> </mtd> <mtd> <maction id="a13" actiontype="toggle" selection="2"> <msup> <mrow> <mo>(</mo> <mrow> <mi>x</mi> <mo>+</mo> <mi>y</mi> </mrow> <mo>)</mo> </mrow> <mn>2</mn> </msup> <mrow> <msup> <mi>x</mi> <mn>2</mn> </msup> <mo>+</mo> <mrow> <mn>2</mn> <mo>&invisibletimes;</mo> <mi>x</mi> <mo>&invisibletimes;</mo> <mi>y</mi> </mrow> <mo>+</mo> <msup> <mi>y</mi> <mn>2</mn> </msup> </mrow> </maction> </mtd> </mtr> <mtr> <mtd> <maction id="a21" actiontype="toggle" selection="2"> <msup> <mrow> <mo>(</mo> <mrow> <mi>x</mi> <mo>+</mo> <mi>y</mi> </mrow> <mo>)</mo> </mrow> <mn>1</mn> </msup> <mrow> <mi>x</mi> <mo>+</mo> <mi>y</mi> </mrow> </maction> </mtd> <mtd> <maction id="a22" actiontype="toggle" selection="2"> <msup> <mrow> <mo>(</mo> <mrow> <mi>x</mi> <mo>+</mo> <mi>y</mi> </mrow> <mo>)...
...</mo> </mrow> <mn>2</mn> </msup> <mrow> <msup> <mi>x</mi> <mn>2</mn> </msup> <mo>+</mo> <mrow> <mn>2</mn> <mo>&invisibletimes;</mo> <mi>x</mi> <mo>&invisibletimes;</mo> <mi>y</mi> </mrow> <mo>+</mo> <msup> <mi>y</mi> <mn>2</mn> </msup> </mrow> </maction> </mtd> <mtd> <maction id="a23" actiontype="toggle" selection="2"> <msup> <mrow> <mo>(</mo> <mrow> <mi>x</mi> <mo>+</mo> <mi>y</mi> </mrow> <mo>)</mo> </mrow> <mn>3</mn> </msup> <mrow> <msup> <mi>x</mi> <mn>3</mn> </msup> <mo>+</mo> <mrow> <mn>3</mn> <mo>&invisibletimes;</mo> <msup> <mi>x</mi> <mn>2</mn> </msup> <mo>&invisibletimes;</mo> <mi>y</mi> </mrow> <mo>+</mo> <mrow> <mn>3</mn> <mo>&invisibletimes;</mo> <mi>x</mi> <mo>&invisibletimes;</mo> <msup> <mi>y</mi> <mn>2</mn> </msup> </mrow> <mo>+</mo> <msup> <mi>y</mi> <mn>3</mn> </msup> </mrow> ...
...And 6 more matches
Web Replay
devtools.recordreplay.logging when enabled, firefox will log web replay's internal actions to the terminal, which is helpful when debugging hangs and crashes.
... intra-thread non-deterministic behaviors are non-deterministic even in the absence of actions by other threads, and inter-thread non-deterministic behaviors are those affected by interleaving execution with other threads, and which always behave the same given the same interleaving.
... to prevent this from having an effect on execution behavior, gc finalizers which can affect the recording are instrumented so that the finalizer action is performed at the same time in the replay as it was during the recording.
...And 6 more matches
nsINavBookmarksService
ng getitemindex(in long long aitemid); prtime getitemlastmodified(in long long aitemid); autf8string getitemtitle(in long long aitemid); unsigned short getitemtype(in long long aitemid); astring getkeywordforbookmark(in long long aitemid); obsolete since gecko 40.0 astring getkeywordforuri(in nsiuri auri); obsolete since gecko 40.0 nsitransaction getremovefoldertransaction(in long long aitemid); nsiuri geturiforkeyword(in astring keyword); obsolete since gecko 40.0 void importbookmarkshtml(in nsiuri url); obsolete since gecko 1.9 void importbookmarkshtmltofolder(in nsiuri url, in print64 folder); obsolete since gecko 1.9 print32 indexoffolder(in print64 parent, in print64 folder); obsolete since gecko 1...
... note: this does not restrict api calls, only ui actions.
... getremovefoldertransaction() this method retrieves an undo-able transaction for removing a folder from the bookmarks tree.
...And 6 more matches
nsINavHistoryResultViewObserver
isupports last changed in gecko 1.9.0 method overview boolean candrop(in long index, in long orientation); void ondrop(in long row, in long orientation); void ontoggleopenstate(in long index); void oncycleheader(in nsitreecolumn column); void oncyclecell(in long row, in nsitreecolumn column); void onselectionchanged(); void onperformaction(in wstring action); void onperformactiononrow(in wstring action, in long row); void onperformactiononcell(in wstring action, in long row, in nsitreecolumn column); constants constant value description drop_before -1 the drag operation wishes to insert the dragged item before the indicated row.
...onperformaction() this method provides a command api that can be used to invoke commands on the selection.
... void onperformaction( in wstring action ); parameters action a string identifying the action to be performed.
...And 6 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.
... 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.
...And 6 more matches
Using XMLHttpRequest - Web APIs
after the transaction completes, the object will contain useful information such as the response body and the http status of the result.
...2 : 1 : 0; this.receiver = otarget.action; this.status = 0; this.segments = []; var ffilter = this.technique === 2 ?
... multipart/form-data */ "content-disposition: form-data; name=\"" + ofield.name + "\"\r\n\r\n" + ofield.value + "\r\n" : /* enctype is application/x-www-form-urlencoded or text/plain or method is get */ ffilter(ofield.name) + "=" + ffilter(ofield.value) ); } } processstatus(this); } return function (oformelement) { if (!oformelement.action) { return; } new submitrequest(oformelement); }; })(); </script> </head> <body> <h1>sending forms with pure ajax</h1> <h2>using the get method</h2> <form action="register.php" method="get" onsubmit="ajaxsubmit(this); return false;"> <fieldset> <legend>registration example</legend> <p> first name: <input type="text" name="firstname" /><br /> last name: <input type=...
...And 6 more matches
Cognitive accessibility - Accessibility
guage numbers symbols and math understanding and making choices a solid approach to providing accessible solutions for people with cognitive impairments includes: delivering content in more than one way, such as by text-to-speech or by video; providing easily-understood content, such as text written using plain-language standards; focusing attention on important content; minimizing distractions, such as unnecessary content or advertisements; providing consistent web page layout and navigation; incorporating familiar elements, such as underlined links that are blue when not visited and purple when visited; dividing processes into logical, essential steps with progress indicators; making website authentication as easy as possible without compromising security; and making forms easy ...
... alerting the user and providing a buffer of at least 20 seconds to extend the timeout duration by a factor of 10 with a simple action, such as hitting the space bar.
... people with attention deficit disorders should be able to focus on content without distractions.
...And 6 more matches
<input type="image"> - HTML: Hypertext Markup Language
WebHTMLElementinputimage
supported common attributes alt, src, width, height, formaction, formenctype, formmethod, formnovalidate, formtarget idl attributes none.
... additional attributes in addition to the attributes shared by all <input> elements, image button inputs support the following attributes: attribute description alt alternate string to display when the image can't be shown formaction the url to which to submit the data formenctype the encoding method to use when submitting the form data formmethod the http method to use when submitting the form formnovalidate a boolean which, if present, indicates that the form shouldn't be validated before submission formtarget a string indicating a browsing context from where to load the re...
... formaction a string indicating the url to which to submit the data.
...And 6 more matches
Drag and Drop - Archive of obsolete content
the function invokedragsession takes four parameters, as described below: invokedragsession(element, transferablearray, region, actions) element a reference to the element that is being dragged.
... actions the actions that the drag uses.
...the action can be changed during the drag depending on what is being dragged over.
...And 5 more matches
XML Templates - Archive of obsolete content
here is an example: <listbox datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="person"/> <action> <listitem uri="?" label="?name"/> </action> </template> </listbox> the expr attribute is a very simple xpath expression which simply retrieves the person elements from within the datasource.
...the action element defines the content to generate for each result.
... the content of the action element will be generated and repeated for each result, which in this case, is a listitem.
...And 5 more matches
Adding Event Handlers to XBL-defined Elements - Archive of obsolete content
each will describe the action taken for a single event handler.
...the general handler syntax is as follows: <binding id="binding-name"> <handlers> <handler event="event-name" action="script"/> </handlers> </binding> place all of your handlers within the handlers element.
... each handler element defines the action taken for a particular event specified by its event attribute.
...And 5 more matches
Using the Editor from XUL - Archive of obsolete content
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.
...in addition, editor actions in the user interface are propagated via the xul and javascript, and call methods on the nseditorshell.
... nsautoplaceholderbatch is a utility class that wraps text insertion with calls to turn off selection and layout updating (to avoid flicker), and the maintenance of a placeholder transaction.
...And 5 more matches
TypeScript support in Svelte - Learn web development
now from todos.svelte, we will instantiate a todo component with a literal object as its parameter before the call to the moreactions component, like this: <hr /> <todo todo={ { name: 'a new task with no id!', completed: false } } /> <!-- moreactions --> <moreactions {todos} add the lang='ts' to the <script> tag of the todos.svelte component, so that it knows to use the type checking we have specified.
... moreactions.svelte now we'll do the same for the moreactions.svelte component.
... update your <script> section to look like this: <script lang='ts'> import filterbutton from './filterbutton.svelte' import todo from './todo.svelte' import moreactions from './moreactions.svelte' import newtodo from './newtodo.svelte' import todosstatus from './todosstatus.svelte' import { alert } from '../stores' import { filter } from '../types/filter.enum' import type { todotype } from '../types/todo.type' export let todos: todotype[] = [] let todosstatus: todosstatus // reference to todosstatus instance $: newtodoid =...
...And 5 more matches
IME handling guide
first of use, native ime handlers get the rights to use texteventdispatcher with a call of beginnativeinputtransaction().
...are available if beginnativeinputtransaction() return true.
... when texteditor receives an ecompositionchange (dom "text") event, it creates or modifies a text node which includes the composition string and mozilla::compositiontransaction (it was called imetexttxn) sets ime selections for representing the clauses of the composition string.
...And 5 more matches
nsITreeView
owindex, 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 wstring action, in long row); void selectionchanged(); void setcelltext(in long row, in nsitreecolumn col, in astring value); void setcellvalue(in long row, in nsitreecolumn col, in astring value); void settree(in nsi...
... performaction() a command api that can be used to invoke commands on the selection.
...for example, when the del key is pressed, performaction will be called with the delete string.
...And 5 more matches
MailNews Filters
mailnews filters consist of a set of search terms, and a set of filter actions.
...the protocol specific code will then apply all of the actions of the filter to the current msg header.
... if one of the actions is a move, or a stop filter execution action, we move on to the next header; otherwise, we move on to the next filter.
...And 5 more matches
IDBObjectStore.add() - Web APIs
to determine if the add operation has completed successfully, listen for the transaction’s complete event in addition to the idbobjectstore.add request’s success event, because the transaction may still fail after the success event fires.
... in other words, the success event is only triggered when the transaction has been successfully queued.
... 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.
...And 5 more matches
XRSession - Web APIs
WebAPIXRSession
select an event of type xrinputsourceevent which is sent to the session when one of the session's input sources has successfully completed a primary action.
...if select is not sent, then the select action was aborted before being completed.
... selectend an event of type xrinputsourceevent which gets sent to the session object when one of its input devices finishes its primary action or gets disconnected while in the process of handling a primary action.
...And 5 more matches
Box-shadow generator - CSS: Cascading Style Sheets
<div id="gradient" class="gradient"> <div id="gradient_picker"> </div> </div> <div id="hue" data-topic="hue" class="hue"> <div id="hue_selector"> </div> </div> <div class="info"> <div class="input" data-topic="hue" data-title='h:' data-action="hsv"></div> <div class="input" data-topic="saturation" data-title='s:' data-action="hsv"></div> <div class="input" data-topic="value" data-title='v:' data-action="hsv"></div> </div> <div class="alpha"> <div id="alpha" data-topic="alpha"> <div id="alpha_selec...
...tor"> </div> </div> </div> <div class="info"> <div class="input" data-topic="r" data-title='r:' data-action="rgb"></div> <div class="input" data-topic="g" data-title='g:' data-action="rgb"></div> <div class="input" data-topic="b" data-title='b:' data-action="rgb"></div> </div> <div class="preview block"> <div id="output_color"> </div> </div> <div class="block info"> <div class="input" data-topic="a" data-title='alpha:' data-action="alpha"></div> <div class="input" data-topic="hexa" data-title='' data-action="hexa...
...on); notify("value", color.value); notify("r", color.r); notify("g", color.g); notify("b", color.b); notify("a", color.a); notify("hexa", color.gethexa()); output_color.style.backgroundcolor = color.getrgba(); } var setinputcomponent = function setinputcomponent(node) { var topic = node.getattribute('data-topic'); var title = node.getattribute('data-title'); var action = node.getattribute('data-action'); title = title === null ?
...And 5 more matches
Event reference
events can represent everything from basic user interactions to automated notifications of things happening in the rendering model.
... abort event indexeddb a transaction has been aborted.
... blocked indexeddb an open connection to a database is blocking a versionchange transaction on the same database.
...And 5 more matches
MathML attribute reference - MathML
actiontype <maction> a string value specifying the action happening for this element.
... bevelled <mfrac> specifies the style how the fraction should be displayed.
...use u+2044 (fraction slash) instead.
...And 5 more matches
<mfrac> - MathML
WebMathMLElementmfrac
the mathml <mfrac> element is used to display fractions.
... syntax <mfrac>numerator denominator</mfrac> attributes bevelled specifies the way the fraction is displayed.
... if true, the fraction line is bevelled, which means that numerator and denominator are displayed side by side and separated by a slash (/).
...And 5 more matches
Enhanced Extension Installation - Archive of obsolete content
when changes are made to the extensions datasource - new items are installed, old items uninstalled, enabled or disabled, a .autoreg file is written to the profile directory as well, which tells the startup code that the system has been modified, so that it destroys the component registries, finishes pending transactions and regenerates metadata appropriately.
... uninstallation, disabling, enabling these functions work on the same principle as installation - the user requests an action through the ui while the application is running and metadata is written (tobeuninstalled, tobedisabled, tobeenabled) and a .autoreg file created in the profile so that on the subsequent startup the extension system's startup routine can remove files (in the uninstall case) and write a new extensions.ini file listing the directories for the currently "active" items.
... when an item's files are extracted, a special extraction routine known as a safeinstalloperation is performed.
...And 4 more matches
Static Content - Archive of obsolete content
nupopup> <menuitem label="all"/> </menupopup> <template> <query> <content uri="?start"/> <triple subject="?country" predicate="http://www.w3.org/1999/02/22-rdf-syntax-ns#type" object="?start"/> <triple subject="?country" predicate="http://purl.org/dc/elements/1.1/title" object="?countrytitle"/> </query> <action> <menupopup> <menuitem uri="?country" label="?countrytitle" value="?country"/> </menupopup> </action> </template> </menulist> the only difference between the previous example and this one is that the menulist element has some additional content added before the template.
...one interesting thing about this example is that only one menupopup will be created, even though there are two in the code, one outside the template and another one inside the action body.
...remember that only the content at the uri attribute or below inside the action are copied for each result.
...And 4 more matches
Advanced Rules - Archive of obsolete content
full rules contain three child tags, a conditions tag, a bindings tag and an action tag, although the bindings tag is not always needed.
...if the conditions match for a resource, the content placed within the actions tag is generated.
...if the conditions match for that resource, the content in the actions element is generated for that resource.
...And 4 more matches
Introduction to Public-Key Cryptography - Archive of obsolete content
in the context of network interactions, authentication involves the confident identification of one party by another party.
... network interactions typically take place between a client, such as browser software running on a personal computer, and a server, such as the software and hardware used to host a web site.
... as you can see by comparing figure 5 to figure 4, certificates replace the authentication portion of the interaction between the client and the server.
...And 4 more matches
Desktop mouse and keyboard controls - Game development
if the left arrow is pressed (⬅︎; key code 37), we can set the leftpressed variable to true and in the draw function perform the action assigned to it — move the ship left: function draw() { ctx.clearrect(0, 0, canvas.width, canvas.height); if(rightpressed) { playerx += 5; } else if(leftpressed) { playerx -= 5; } if(downpressed) { playery += 5; } else if(uppressed) { playery -= 5; } ctx.drawimage(img, playerx, playery); requestanimationframe(draw); } ...
... you can see this example in action online at end3r.github.io/javascript-game-controls and the full source code can be found at github.com/end3r/javascript-game-controls.
... mouse the mouse interactions in the game are focused on clicking the buttons.
...And 4 more matches
How to build custom form controls - Learn web development
if you consider that the active state and the open state are completely different, the answer is again "nothing will happen" because we did not define any keyboard interactions for the opened state.
... on the other hand, if you consider that the active state and the open state overlap a bit, the value may change but the option will definitely not be highlighted accordingly, once again because we did not define any keyboard interactions over options when the control is in its opened state (we have only defined what should happen when the control is opened, but nothing after that).
...when it comes to standardized elements, of which the <select> is one, the specification authors spent an inordinate amount of time specifying all interactions for every use case for every input device.
...And 4 more matches
Your first form - Learn web development
web forms are one of the main points of interaction between a user and a web site or application.
... the <form> element all forms start with a <form> element, like this: <form action="/my-handling-form-page" method="post"> </form> this element formally defines a form.
...all of its attributes are optional, but it's standard practice to always set at least the action and method attributes: the action attribute defines the location (url) where the form's collected data should be sent when it is submitted.
...And 4 more matches
Redis Tips
redis data types include: strings hashes lists sets ordered sets (called zsets in redis) transactions publishers and subscribers this table lists some common programming tasks and data structures, and suggests some redis functions or data structures for them: dictionary lookup set, get, setnx, etc.
... redis> del foo (integer) 1 redis> get foo (nil) redis> getset foo 3 (nil) redis> getset foo 4 "3" efficient multiple queries and transaction blocks you'll often want to do several queries together.
... redis has a solution for this: transaction blocks.
...And 4 more matches
nsIClipboardDragDropHooks
each hook can only be called once per user action/api.
...if there are multiple hooks set for a window, any of them has an opportunity to cancel the action so no further processing will occur.
... if any errors occur (without setting the boolean result) the default action will occur.
...And 4 more matches
Using Touch Events - Web APIs
the touch events interfaces support application specific single and multi-touch interactions such as a two-finger gesture.
... a multi-touch interaction starts when a finger (or stylus) first touches the contact surface.
...the interaction ends when the fingers are removed from the surface.
...And 4 more matches
XRInputSourceEvent() - Web APIs
event types select sent to an xrsession when the sending input source has fully completed a primary action.
... selectend sent to an xrsession when an ongoing primary action ends, or when an input source with an ongoing primary action has been disconnected from the system.
... selectstart sent to an xrsession when an input source begins its primary action, indicating that the user has begun a command-like input, such as pressing a trigger or button, issuing a spoken command, tapping on a touchpad, or the like.
...And 4 more matches
XRInputSourceEvent - Web APIs
event types select sent to an xrsession when the sending input source has fully completed a primary action.
... selectend sent to an xrsession when an ongoing primary action ends, or when an input source with an ongoing primary action has been disconnected from the system.
... selectstart sent to an xrsession when an input source begins its primary action, indicating that the user has begun a command-like input, such as pressing a trigger or button, issuing a spoken command, tapping on a touchpad, or the like.
...And 4 more matches
ARIA: application role - Accessibility
any sort of special interpretation of html structures and widgets should be suspended, and control should be completely handed over to the browser and web application to handle mouse, keyboard, or touch interaction.
... in this mode, the web author is completely responsible for handling any and all keyboard input, focus management, and other interactions and cannot assume assistive technologies would do any processing on their end.
...a keyboard interaction model is generated that is very similar to a word processor where users can read line by line, sentence by sentence, or paragraph by paragraph.
...And 4 more matches
ARIA: button role - Accessibility
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.
... 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.
...And 4 more matches
Accessibility documentation index - Accessibility
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.
... 7 aria live regions aria, accessibility, arialive using javascript, it is possible to dynamically change parts of a page without requiring the entire page to reload — for instance, to update a list of search results on the fly, or to display a discreet alert or notification which does not require user interaction.
...for a full list of roles, see using aria: roles, states, and properties 42 aria: comment role aria, aria role, comment, reference, annotations the comment landmark role semantically denotes a comment/reaction to some content on the page, or to a previous comment.
...And 4 more matches
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
WebHTMLElementinput
<input type="week" name="week"/> html5 obsolete values datetime a control for entering a date and time (hour, minute, second, and fraction of a second) based on utc time zone.
... media capture input method in file upload controls checked radio, checkbox whether the command or control is checked dirname text, search name of form field to use for sending the element's directionality in form submission disabled all whether the form control is disabled form all associates the control with a form element formaction image, submit url to use for form submission formenctype image, submit form data set encoding type to use for form submission formmethod image, submit http method to use for form submission formnovalidate image, submit bypass form control validation for form submission formtarget image, submit browsing context for form submission ...
... <form action="page.html" method="post"> <label>fruit: <input type="text" name="fruit" dirname="fruit.dir" value="cherry"></label> <input type="submit"/> </form> <!-- page.html?fruit=cherry&fruit.dir=ltr --> when the form above is submitted, the input cause both the name / value pair of fruit=cherry and the dirname / direction pair of fruit.dir=ltr to be sent.
...And 4 more matches
HTTP Index - HTTP
WebHTTPIndex
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.
... 69 connection http, headers, reference, web the connection general header controls whether or not the network connection stays open after the current transaction finishes.
... 83 csp: form-action csp, content-security-policy, directive, http, security, action, form, form-action the http content-security-policy (csp) form-action directive restricts the urls which can be used as the target of a form submissions from a given context.
...And 4 more matches
Promise - JavaScript
it allows you to associate handlers with an asynchronous action's eventual success value or failure reason.
... chained promises the methods promise.then(), promise.catch(), and promise.finally() are used to associate further action with a promise that becomes settled.
... const promisea = new promise(myexecutorfunc); const promiseb = promisea.then(handlefulfilled1, handlerejected1); const promisec = promisea.then(handlefulfilled2, handlerejected2); an action can be assigned to an already "settled" promise.
...And 4 more matches
Populating the page: how browsers work - Web Performance
for smooth interactions, the developer's goal is to ensure performant site interactions, from smooth scrolling to being responsive to touch.
... render time is key, with ensuring the main thread can complete all the work we throw at it and still always be available to handle user interactions.
... web performance can be improved by understanding the single-threaded nature of the browser and minimizing the main thread's responsibilities, where possible and appropriate, to ensure rendering is smooth and responses to interactions are immediate.
...And 4 more matches
Recommended Web Performance Timings: How long is too long? - Web Performance
there are different suggested times for initially loading the page versus loading additional assets, responding to user interaction, and ensuring smooth animations: idling goal browsers are single threaded (though background threads are supported for web workers).
... this means that user interaction, painting, and script execution are all on the same thread.
...this makes the thread available for user interactions.
...And 4 more matches
Multiple Rules - Archive of obsolete content
emplate-guide-photos3.rdf" ref="http://www.xulplanet.com/rdf/myphotos"> <template> <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> </query> <rule> <where subject="?title" rel="equals" value="canal"/> <action> <button uri="?photo" image="?photo" label="view" orient="vertical"/> </action> </rule> <rule> <action> <image uri="?photo" src="?photo"/> </action> </rule> </template> </hbox> this template contains a query with two rules.
...as the datasource has three photos, one of which has a title of 'canal', this photo will match the first rule and the content's of that rule's action body will be generated.
...for these two photos, the action body of the second rule will apply.
...And 3 more matches
SQLite Templates - Archive of obsolete content
<listbox datasources="profile:userdata.sqlite" ref="*" querytype="storage"> <template> <query> select name from myfriends </query> <action> <listitem uri="?" label="?name"/> </action> </template> </listbox> the query returns the list of values from the 'name' column in the table 'myfriends'.
... the action body, starting at the node with uri="?" is repeated for each result returned from the query.
... <vbox datasources="profile:userdata.sqlite" ref="*" querytype="storage"> <template> <query> select name, email from myfriends where age >= 30 </query> <action> <hbox uri="?"> <label value="?name"/> <label value="?email"/> </hbox> </action> </template> </vbox> this template displays the results of two columns.
...And 3 more matches
Broadcasters and Observers - Archive of obsolete content
for instance, let's say that we want the back action in a browser to be disabled.
...it also has the disadvantage that we would need to know all of the places where a back action could be.
...it is convenient to simply disable the back action and have all the elements that issue the back action disable themselves.
...And 3 more matches
Audio for Web games - Game development
using the playbackrate() method you can even adjust the speed of your music without affecting the pitch, to sync it up better with the action.
... background music with the web audio api although we can use the <audio> element to deliver linear background music that doesn't change in reaction to the game environment, the web audio api is ideal for implementing a more dynamic musical experience.
... element to deliver linear background music that doesn't change in reaction to the game environment, the web audio api is ideal for implementing a more dynamic musical experience.
...And 3 more matches
The "why" of web performance - Learn web development
web performance refers to how quickly site content loads and renders in a web browser, and how well it responds to user interaction.
... a conversion rate is the rate at which site visitors perform a measured or desired action.
...the action being measured as the conversion rate depends on the website's business goals.
...And 3 more matches
Ember interactivity: Events, classes and state - Learn web development
update the content to the following: import component from '@glimmer/component'; import { action } from '@ember/object'; export default class headercomponent extends component { @action onkeydown({ target, key }) { let text = target.value.trim(); let hasvalue = boolean(text); if (key === 'enter' && hasvalue) { alert(text); target.value = '' } } } the @action decorator is the only ember-specific code here (aside from extending from the component supercla...
...the @action decorator declares that the function is an "action", meaning it's a type of function that will be invoked from an event that occurred in the template.
... @action also binds the this of the function to the class instance.
...And 3 more matches
Componentizing our Svelte app - Learn web development
eventually, we will split up our app into the following components: alert.svelte: a general notification box for communicating actions that have occurred.
... moreactions.svelte: the check all and remove completed buttons at the bottom of the ui that allow you to perform mass actions on the todo items.
... next we'll create different functions to handle each user action.
...And 3 more matches
Monitoring HTTP activity
gecko includes the nsihttpactivityobserver interface, which you can implement in your code to monitor http transactions in real time, receiving a callback as the transactions take place.
...this is very simple, requiring you to implement a single method, nsihttpactivityobserver.observeactivity(), which gets called each time an action of interest takes place on the http channel.
... // define a reference to the interfacevar nsihttpactivityobserver = components.interfaces.nsihttpactivityobserver; var httpobserver = { observeactivity: function(ahttpchannel, aactivitytype, aactivitysubtype, atimestamp, aextrasizedata, aextrastringdata) { if (aactivitytype == nsihttpactivityobserver.activity_type_http_transaction) { switch(aactivitysubtype) { case nsihttpactivityobserver.activity_subtype_response_header: // received response header break; case nsihttpactivityobserver.activity_subtype_response_complete: // received complete http response break; } } } }; then you need to install your activity observer.
...And 3 more matches
nsIMsgFilter
defined in comm-central/ mailnews/ base/ search/ public/ nsimsgfilter.idl attributes type attribute nsmsgruleactiontype type; priority // target priority..
... throws an exception if the action is not priority attribute nsmsgpriorityvalue priority; targetfolderuri // target folder..
... throws an exception if the action is not move to folder attribute acstring targetfolderuri; label // target label.
...And 3 more matches
nsITextInputProcessor
createinstance(components.interfaces.nsitextinputprocessor); next, you need to get the rights to create composition or dispatch keyboard events with begininputtransaction() or begininputtransactionfortests(): if (!tip.begininputtransaction(window, callback)) { return; } if begininputtransaction() or begininputtransactionfortests() returns false, it means that another instance of nsitextinputprocessor has composition on the window or is dispatching an event.
... method overview void appendclausetopendingcomposition(in unsigned long alength, in unsigned long aattribute); boolean begininputtransaction(in nsidomwindow awindow, in nsitextinputprocessorcallback acallback); boolean begininputtransactionfortests(in nsidomwindow awindow, [optional] in nsitextinputprocessorcallback acallback); void cancelcomposition([optional] in nsidomkeyevent adomkeyevent, [optional] in unsigned long akeyflags); boolean commitcomposition([optional] in nsidomkeyevent adomkeyevent, [optiona...
... begininputtransaction() this must be called before starting composition every time.
...And 3 more matches
Element: cut event - Web APIs
WebAPIElementcut event
the cut event is fired when the user has initiated a "cut" action through the browser's user interface.
... if the user attempts a cut action on uneditable content, the cut event still fires but the event object contains no data.
... bubbles yes cancelable yes interface clipboardevent event handler property oncut the event's default action is to copy the current selection (if any) to the system clipboard and remove it from the document.
...And 3 more matches
HTMLFormElement - Web APIs
htmlformelement.action a domstring reflecting the value of the form's action html attribute, containing the uri of a program that processes the information submitted by the form.
...a form with an input named action will have its action property return that input instead of the form's action html attribute).
...this will be the case with any other form properties, such as <input name="action"> or <input name="post">.
...And 3 more matches
IDBDatabaseException - Web APIs
constant value description abort_err 8 a request was aborted, for example, through a call to idbtransaction.abort.
... constraint_err 4 a mutation operation in the transaction failed because a constraint was not satisfied.
... more specific variants of this error includes: transaction_inactive_err and read_only_err.
...And 3 more matches
IDBObjectStore.put() - Web APIs
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.
... 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.
...And 3 more matches
IndexedDB API - Web APIs
key concepts and usage indexeddb is a transactional database system, like an sql-based rdbms.
...you need to specify the database schema, open a connection to your database, and then retrieve and update data within a series of transactions.
...it's the only way to get a transaction on the database.
...And 3 more matches
Pointer events - Web APIs
</div> </body> </html> touch-action css property the touch-action css property is used to specify whether or not the browser should apply its default (native) touch behavior (such as zooming or panning) to a region.
... <html> <body> <div style="touch-action:none;">can't touch this ...
... button#tiny { touch-action: none; } in the following example, when the target element is touched, it will only pan in the horizontal direction.
...And 3 more matches
SVGGraphicsElement: cut event - Web APIs
the cut event is fired on an svggraphicselement when the user has initiated a "cut" action through the browserʼs user interface.
... if the user attempts a cut action on uneditable content, the cut event still fires but the event object contains no data.
... bubbles yes cancelable yes interface clipboardevent event handler property oncut the eventʼs default action is to copy the current selection (if any) to the system clipboard and remove it from the document.
...And 3 more matches
ServiceWorkerRegistration.showNotification() - Web APIs
it can have the following properties: actions: an array of actions to display in the notification.
...it may contain the following values: action: a domstring identifying a user action to be displayed on the notification.
... title: a domstring containing action text to be shown to the user.
...And 3 more matches
Service Worker API - Web APIs
they are intended, among other things, to enable the creation of effective offline experiences, intercept network requests and take appropriate action based on whether the network is available, and update assets residing on the server.
... note: service workers make heavy use of promises, as generally they will wait for responses to come through, after which they will respond with a success or failure action.
... you can listen for the installevent; a standard action is to prepare your service worker for usage when this fires, for example by creating a cache using the built in storage api, and placing assets inside it that you'll want for running your app offline.
...And 3 more matches
ARIA: grid role - Accessibility
even though both data grids and layout grids employ the same aria roles, states, and properties, differences in their content and purpose surface factors that are important to consider in keyboard interaction design.
... if the grid is used as an interactive widget, keyboard interactions need to be implemented.
... keyboard interactions when a keyboard user encounters a grid, they navigate the rows and columns using the left, right, top and down keys.
...And 3 more matches
font-variant-numeric - CSS: Cascading Style Sheets
the font-variant-numeric css property controls the usage of alternate glyphs for numbers, fractions, and ordinal markers.
...rmal; font-variant-numeric: ordinal; font-variant-numeric: slashed-zero; font-variant-numeric: lining-nums; /* <numeric-figure-values> */ font-variant-numeric: oldstyle-nums; /* <numeric-figure-values> */ font-variant-numeric: proportional-nums; /* <numeric-spacing-values> */ font-variant-numeric: tabular-nums; /* <numeric-spacing-values> */ font-variant-numeric: diagonal-fractions; /* <numeric-fraction-values> */ font-variant-numeric: stacked-fractions; /* <numeric-fraction-values> */ font-variant-numeric: oldstyle-nums stacked-fractions; /* global values */ font-variant-numeric: inherit; font-variant-numeric: initial; font-variant-numeric: unset; this property can take one of two forms: either the keyword value normal or one or more of the other values listed b...
... <numeric-fraction-values> these values controls the glyphs used to display fractions.
...And 3 more matches
<input type="submit"> - HTML: Hypertext Markup Language
WebHTMLElementinputsubmit
this label is likely to be something along the lines of "submit" or "submit query." here's an example of a submit button with a default label in your browser: <input type="submit"> additional attributes in addition to the attributes shared by all <input> elements, submit button inputs support the following attributes: attribute description formaction the url to which to submit the form's data; overrides the form's action attribute, if any formenctype a string specifying the encoding type to use for the form data formmethod the http method (get or post) to use when submitting the form.
... formnovalidate a boolean which, if present, means the form's fields will not be subjected to constraint validation before submitting the data to the server formtarget the browsing context into which to load the response returned by the server after submitting the form formaction a string indicating the url to which to submit the data.
... this takes precedence over the action attribute on the <form> element that owns the <input>.
...And 3 more matches
mimeTypes.rdf corruption - SVG: Scalable Vector Graphics
first, certain actions can cause the media types cache in mimetypes.rdf to associate a filename extension with the wrong media type.
... second, certain actions may cause the os to associate a filename extension with the wrong media type.
... actions that trigger this bug ...
...And 3 more matches
indexed-db - Archive of obsolete content
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.
... example this example uses the action button api, which is only available from firefox 29 onwards.
... var { indexeddb, idbkeyrange } = require('sdk/indexed-db'); var database = {}; database.onerror = function(e) { console.error(e.value) } function open(version) { var request = indexeddb.open("stuff", version); request.onupgradeneeded = function(e) { var db = e.target.result; e.target.transaction.onerror = database.onerror; if(db.objectstorenames.contains("items")) { db.deleteobjectstore("items"); } var store = db.createobjectstore("items", {keypath: "time"}); }; request.onsuccess = function(e) { database.db = e.target.result; }; request.onerror = database.onerror; }; function additem(name) { var db = database.db; var trans = db.transaction(["i...
...And 2 more matches
ui - Archive of obsolete content
this module exports constructors for the following: actionbutton togglebutton frame toolbar sidebar each object has its own reference page, linked above: for all the details please refer to the reference page.
... actionbutton an action button is a button in the main firefox toolbar.
... you give it an icon, a label, and a click handler: var ui = require("sdk/ui"); var action_button = ui.actionbutton({ id: "my-button", label: "action button!", icon: "./icon.png", onclick: function(state) { console.log("you clicked '" + state.label + "'"); } }); you can make a button standalone or add it to a toolbar.
...And 2 more matches
Tamarin build documentation - Archive of obsolete content
compiling and running applications currently the only compiler for tamarin is the adobe actionscript compiler.
... the source code for the actionscript compiler, asc, has been open sourced as part of adobe flex®.
... use the following steps to build and install the actionscript compiler.
...And 2 more matches
Bindings - Archive of obsolete content
the ?description variable would then be used in the action body.
... </query> <rule> <binding subject="?photo" predicate="http://purl.org/dc/elements/1.1/description" object="?description"/> <action> ...
... </action> </rule> </template> the description triple has been changed to a binding element, but the attributes are the same.
...And 2 more matches
Textbox (XPFE autocomplete) - Archive of obsolete content
oreblurwhilesearching, 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, issearching, iswaiting, label, maxlength, maxrows, minresultsforpopup, nomatch, open, popup, popupopen, resultspopup, searchcount, searchparam, searchsess...
...ions, selectionend, selectionstart, sessioncount, showcommentcolumn, showpopup, size, tabindex, tabscrolling, textlength, textvalue, timeout, type, useraction, value methods addsession, clearresults, getdefaultsession, getresultat, getresultcount, getresultvalueat, getsession, getsessionbyname, getsessionresultat, getsessionstatusat, getsessionvalueat, removesession, select, setselectionrange, syncsessions examples (example needed) attributes accesskey type: character this should be set to a character that is used as a shortcut key.
...if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
...And 2 more matches
XUL Event Propagation - Archive of obsolete content
events are used for different purposes, but they play a particularly important role in creating interactive xul-based user interfaces, since it is events that bring the information about user actions to the code behind the interface.
...this button responds to the user action by raising an event, a message meant to travel from one element within the interface to another.
...any element that is interested in the event -- any part of the interface, in other words, that needs to know about and respond to the user's click action on the button -- "handles" the event with an event handler, or chunk of code to be executed when the given event is "heard".
...And 2 more matches
Implementation Status - Archive of obsolete content
lculate supported 6.1.6 constraint supported 6.1.7 p3ptype unsupported 279049; 6.2.1 atomic datatype partial we will support simpletype's using length, minlength, maxlength, pattern, maxinclusive, mininclusive, maxexclusive, minexclusive, totaldigits, and fractiondigits 7.
...s, and dynamic dependencies partial we probably already do most of it due to our 1.0 work, but we haven't verified we meet the 1.1 standards, yet 7.4 expression categories supported 7.4.2 model binding expressions and computed expressions supported 7.4.3 expressions in actions and submissions partial 7.4.4 ui expressions partial scenarios exist where controls contained inside other controls inside a repeat won't be bound correctly 333638; 7.4.5 ui binding in other xml vocabularies unsupported not a compliance requirement for an xforms processor 7.4.6...
...peat module partial 264329; 273706; 9.3.1 repeat partial we do not support number attribute 302026; 9.3.2 nested repeats supported 9.3.3 repeat processing partial we currently obey the 1.0 rules for repeat 9.3.4 user interface interaction partial we currently obey the 1.0 rules for repeat, no support for @number 302026; 9.3.5 creating repeating structures via attributes partial does not work for html:tr, html:td, or xf:group elements 340515; 350617; 9.3.6 itemset supported performance problem with large itemsets 372197; ...
...And 2 more matches
Index - Learn web development
53 graceful asynchronous programming with promises beginner, codingscripting, guide, javascript, learn, promises, async, asynchronous, catch, finally, then promises are a comparatively new feature of the javascript language that allow you to defer further actions until after a previous action has completed, or respond to its failure.
... 94 introduction to events article, beginner, codingscripting, event handler, guide, javascript, learn, events, l10n:priority events are actions or occurrences that happen in the system you are programming, which the system tells you about so you can respond to them in some way if desired.
... for example, if the user selects a button on a webpage, you might want to respond to that action by displaying an information box.
...And 2 more matches
Introducing asynchronous JavaScript - Learn web development
an example of an async callback is the second parameter of the addeventlistener() method (as we saw in action above): btn.addeventlistener('click', () => { alert('you clicked me!'); let pelem = document.createelement('p'); pelem.textcontent = 'this is a newly-added paragraph.'; document.body.appendchild(pelem); }); the first parameter is the type of event to be listened for, and the second parameter is a callback function that is invoked when the event is fired.
...so you could have different actions to run on the response downloaded, such as processjson(), displaytext(), etc.
...in essence, it's the browser's way of saying "i promise to get back to you with the answer as soon as i can," hence the name "promise." this concept can take practice to get used to; it feels a little like schrödinger's cat in action.
...And 2 more matches
Introduction to client-side frameworks - Learn web development
none of this code actually handles user interactions, or addresses adding or deleting a task.
... if you want to see code samples from this section in action, you can check out a working version of the app on codepen, which also allows users to add and delete new tasks.
... larger code base and abstraction frameworks allow you to write more declarative code – and sometimes less code overall – by dealing with the dom interactions for you, behind the scenes.
...And 2 more matches
mach
however, its potential beyond just build system interaction was quickly realized and mach grew to fit those needs.
...generally speaking, if you have some piece of functionality or action that is useful to multiple people (especially if it results in productivity wins), then you should consider implementing a mach command for it.
...you essentially have a bunch of python functions saying "i provide command x" and mach hooks up command line argument parsing, terminal interaction, and dispatching.
...And 2 more matches
Displaying Places information using views
all places views implement or own an instance of interface nsinavhistoryresultviewer, which is the point of interaction between a view and its results.
... you therefore have four points of interaction with the built-in places tree view: the convenience methods and properties implemented directly on the view itself, the nsiplacesview interface of the view itself, the nsinavhistoryresulttreeviewer interface of the view's view, and the nsitreeview interface of the view's view.
...tasks sometimes require you to use more than one of these points of interaction, going from one layer of generality to another.
...And 2 more matches
Storage access policy: Block cookies from trackers
automatic storage access upon interaction in order to improve web compatibility, firefox currently includes some heuristics to grant storage access automatically to third parties that receive user interaction.
...if we discover that an origin is abusing this heuristic to gain tracking access, that origin will have the additional requirement that it must have received user interaction as a first party within the past 30 days.
...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.
...And 2 more matches
Animated PNG graphics
MozillaTechAPNG
20 delay_num unsigned short frame delay fraction numerator.
... 22 delay_den unsigned short frame delay fraction denominator.
... constraints on frame regions: x_offset >= 0 y_offset >= 0 width > 0 height > 0 x_offset + width <= 'ihdr' width y_offset + height <= 'ihdr' height the delay_num and delay_den parameters together specify a fraction indicating the time to display the current frame, in seconds.
...And 2 more matches
nsIDOMEvent
cancelable boolean used to indicate whether or not an event can have its default action prevented.
... if the default action can be prevented the value is true, else the value is false.
... cancelablearg specifies whether or not the event's default action can be prevented.
...And 2 more matches
nsIHttpActivityObserver
activity_type_http_transaction 0x0002 http transport activity has occurred.
... activity_subtype_transaction_close 0x5006 the http transaction has been closed.
...if the activity type is activity_type_http_transaction, this will be one of the constants specified in activity subtype constants above.
...And 2 more matches
nsILoginManager
asses["@mozilla.org/login-manager;1"] .getservice(components.interfaces.nsiloginmanager); method overview void addlogin(in nsilogininfo alogin); nsiautocompleteresult autocompletesearch(in astring asearchstring, in nsiautocompleteresult apreviousresult, in nsidomhtmlinputelement aelement); unsigned long countlogins(in astring ahostname, in astring aactionurl, in astring ahttprealm); boolean fillform(in nsidomhtmlformelement aform); void findlogins(out unsigned long count, in astring ahostname, in astring aactionurl, in astring ahttprealm, [retval, array, size_is(count)] out nsilogininfo logins); void getalldisabledhosts([optional] out unsigned long count, [retval, array, size_is(count)] out wstring hostnames); ...
... unsigned long countlogins( in astring ahostname, in astring aactionurl, in astring ahttprealm ); parameters ahostname the hostname to which to restrict searches, formatted as a url.
... aactionurl for form logins, this parameter should specify the url to which the form will be submitted.
...And 2 more matches
nsILoginManagerStorage
method overview void addlogin(in nsilogininfo alogin); unsigned long countlogins(in astring ahostname, in astring aactionurl, in astring ahttprealm); void findlogins(out unsigned long count, in astring ahostname, in astring aactionurl, in astring ahttprealm, [retval, array, size_is(count)] out nsilogininfo logins); void getalldisabledhosts([optional] out unsigned long count, [retval, array, size_is(count)] out wstring hostnames); void getallencryptedlogins([optional] out unsigned long count, [retval, array, si...
...unsigned long countlogins( in astring ahostname, in astring aactionurl, in astring ahttprealm ); parameters ahostname the hostname to which to restrict the search.
...aactionurl the url of the form to which the login will be submitted.
...And 2 more matches
nsIXULTemplateBuilder
the structure of a template is as follows: <rootnode datasources="" ref=""> <template> <queryset> <query></query> <rule> <conditions>...</conditions> <bindings>...</bindings> <action>...</action> </rule> </queryset> </template> </rootnode> the datasources attribute on the root node is used to identify the source of data to be used.
...if a result passes a rule's conditions, this is considered a match, and the content within the rule's <action> body is inserted as a sibling of the <template>, assuming the template builder creates real dom content.
...for a tree builder, for example, the content within the action body is used to create the tree rows instead.
...And 2 more matches
Using popup notifications
a popup notification can include a text message, a button action, and zero or more additional actions provided in a drop-down menu accessed through the notification's button.
...e popup notification at the appropriate time like this: popupnotifications.show(gbrowser.selectedbrowser, "sample-popup", "this is a sample popup notification.", null, /* anchor id */ { label: "do something", accesskey: "d", callback: function() { alert("doing something awesome!"); } }, null /* secondary action */ ); in this case, we aren't providing any secondary actions; that is, actions provided to the user through the drop-down menu.
...you can use this to style the icon, like this: .popup-notification-icon[popupid="sample-popup"] { list-style-image: url("chrome://popupnotifications/skin/mozlogo.png"); } with this css in place, the result is the look we want: adding secondary options to provide options in the drop-down menu, add an array of notification actions to the call to the show() method, like this: popupnotifications.show(gbrowser.selectedbrowser, "sample-popup", "this is a sample popup notification.", null, /* anchor id */ { label: "do something", accesskey: "d", callback: function() { alert("doing something awesome!"); } }, [ { la...
...And 2 more matches
IDBIndex.name - Web APIs
WebAPIIDBIndexname
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.
...And 2 more matches
IDBObjectStore.clear() - Web APIs
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.
... 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().
...And 2 more matches
IDBObjectStore.delete() - Web APIs
exceptions this method may raise a domexception of the following types: exception description transactioninactiveerror this object store's transaction is inactive.
... readonlyerror the object store's transaction mode is read-only.
... 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".
...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.
... 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().
...And 2 more matches
IDBObjectStore - Web APIs
idbobjectstore.transaction read only the idbtransaction object to which this object store belongs.
...this is for updating existing records in an object store when the transaction's mode is readwrite.
... objectstore.createindex("year", "year", { unique: false }); objectstore.createindex("notified", "notified", { unique: false }); note.innerhtml += '<li>object store created.</li>'; }; // create a new item to add in to the object store var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: 'december', year: 2013, notified: "no" } ]; // 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.
...And 2 more matches
Checking when a deadline is due - Web APIs
alidation (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 opened due to error.
... 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.
...And 2 more matches
Key Values - Web APIs
varies varies varies varies modifier keys modifiers are special keys which are used to generate special characters or cause special actions when used in combination with other keys.
... appcommand_paste gdk_key_paste (0x1008ff6d) qt::key_paste (0x010000e2) "redo" redo the last action.
... appcommand_redo gdk_key_redo (0xff66) "undo" undo the last action.
...And 2 more matches
MSSiteModeEvent - Web APIs
preventdefault cancels the default action of an event.
... properties property description actionurl gets the url of a jump list item that is removed.
... cancelable gets a value that indicates whether you can cancel an event's default action.
...And 2 more matches
Web-based protocol handlers - Web APIs
"http://www.google.co.uk/?uri=%s", "burger handler"); </script> </head> <body> <h1>web protocol handler sample</h1> <p>this web page will install a web protocol handler for the <code>web+burger:</code> protocol.</p> </body> </html> activating now, anytime the user activates a link that uses the registered protocol, the browser will route the action to the url supplied when the web application registered.
... firefox will, by default, prompt the user before handing off the action.
... example <!doctype html public "-//w3c//dtd html 4.01//en"> <html lang="en"> <head> <title>web protocol handler sample - test</title> </head> <body> <p>hey have you seen <a href="web+burger:cheeseburger">this</a> before?</p> </body> </html> handling the next phase is handling the action.
...And 2 more matches
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
cameras and relative movement when a classic live-action movie is filmed, the actors are on a set and move about the set as they perform, with one or more cameras watching their moves.
... 3d games might also provide the ability for non-players to observe the action, either by positioning an invisible avatar of sorts or by choosing a fixed virtual camera to watch from.
... in single-screen 2d games, the camera is not associated directly with the player or any other character in the game, but is instead either fixed above or next to the game play area, or follows the action as the action moves around a scrolling game world.
...And 2 more matches
XRSession.onsqueezeend - Web APIs
the xrsession interface's onsqueezeend event handler property is a function to be invokedn when the squeezeend event sent to an xrsession when a primary squeeze action ends.
... this is sent immediately after the squeeze event, which announces the successful completion of the squeeze action.
... the squeezeend event handler is where you handle closing out a squeeze action whether it was successfully completed or not.
...And 2 more matches
XRSession: squeeze event - Web APIs
the webxr event squeeze is sent to an xrsession when one of the session's input sources has completed a primary squeeze action.
... examples of comon kinds of primary action are users pressing triggers or buttons, tapping a touchpad, speaking a command, or performing a recognizable gesture when using a video tracking system or handheld controller with an accelerometer.
... bubbles yes cancelable no interface xrinputsourceevent event handler property onsqueeze for details on how the squeezestart, squeeze, and squeezeend events work, and how you should react to them, see primary squeeze actions in inputs and input sources.
...And 2 more matches
Operable - Accessibility
guideline 2.3 — seizures and physical reactions: do not design content in a way that is known to cause seizures or physical reactions this refers to content that, if not changed, could cause seizures in users with conditions such as epilepsy or could cause physical reactions (like dizziness) for users with conditions such as vestibular disorders.
... 2.3.3 animations from interactions (aaa) added in 2.1 allow users to disable animations from interactions (unless the animation is essential).
... understanding animations from interactions note: also see the wcag description for guideline 2.3 seizures and physical reactions: do not design content in a way that is known to cause seizures or physical reactions.
...And 2 more matches
OpenType font features guide - CSS: Cascading Style Sheets
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.
... fractions can make home improvement and recipe sites much easier to read and understand.
... there are two types of fractions supported through this property: diagonal slashed fractions.
...And 2 more matches
Realizing common layouts using CSS Grid Layout - CSS: Cascading Style Sheets
each item contains a heading, some text of varying height, and a call to action link.
... <ul class="listing"> <li> <h2>item one</h2> <div class="body"><p>the content of this listing item goes here.</p></div> <div class="cta"><a href="">call to action!</a></div> </li> <li> <h2>item two</h2> <div class="body"><p>the content of this listing item goes here.</p></div> <div class="cta"><a href="">call to action!</a></div> </li> <li class="wide"> <h2>item three</h2> <div class="body"><p>the content of this listing item goes here.</p> <p>this one has more text than the other items.</p> <p>quite a lot more</p> <p>perhaps we could do something different with it?</p></div> <div class="cta"><a href="">call to action!</a></div> </li> <li> <h2>item four</h2> <div class="body"><p>the content of this listing ...
...item goes here.</p></div> <div class="cta"><a href="">call to action!</a></div> </li> <li> <h2>item five</h2> <div class="body"><p>the content of this listing item goes here.</p></div> <div class="cta"><a href="">call to action!</a></div> </li> </ul> * {box-sizing: border-box;} img {max-width: 100%; display: block;} body { font: 1.2em helvetica, arial, sans-serif; } a:link, a:visited { text-decoration: none; color: #f08c00; } h2 { background-color: #f08c00; color: #fff; text-align: center; margin: 0; padding: 20px; } we are going to create a grid with a flexible number of flexible columns.
...And 2 more matches
Overview of events and handlers - Developer guides
event triggers include the completion of the loading of a resource on the network e.g., downloads an image that can now be drawn on the screen, the completion of parsing a resource by the browser e.g., processes the html content of a page, the interaction of a user with the contents of the page e.g., clicks a button.
...the innovation of the dynamic approach allows for a page to be partially rendered even when the browser has not finished retrieving all resources; this approach also allows for event driven actions, which javascript leverages.
... this code relies on the agreement that there is a kind of event called 'click' which will call any listener (or 'handler') function with an event object argument (actually, in this case a derivative mouseevent object) and which will be fired by html button elements after user interaction.
...And 2 more matches
Number.prototype.toExponential() - JavaScript
syntax numobj.toexponential([fractiondigits]) parameters fractiondigits optional.
... return value a string representing the given number object in exponential notation with one digit before the decimal point, rounded to fractiondigits digits after the decimal point.
... exceptions rangeerror if fractiondigits is too small or too large.
...And 2 more matches
Content type - SVG: Scalable Vector Graphics
the grammar for clock values is repeated here: clock-val ::= full-clock-val | partial-clock-val | timecount-val full-clock-val ::= hours ":" minutes ":" seconds ("." fraction)?
... partial-clock-val ::= minutes ":" seconds ("." fraction)?
... timecount-val ::= timecount ("." fraction)?
...And 2 more matches
panel - Archive of obsolete content
getting user input note: this example uses the action button api, which is only available from firefox 29 onwards.
...var textentrypanel = require("sdk/panel").panel({ contenturl: data.url("text-entry.html"), contentscriptfile: data.url("get-text.js") }); // create a button require("sdk/ui/button/action").actionbutton({ id: "show-panel", label: "show panel", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); // show the panel when the user clicks the button.
... scripting trusted panel content note: this example uses the action button api, which is only available from firefox 29 onwards.
...var textentrypanel = require("sdk/panel").panel({ contenturl: data.url("text-entry.html") }); // create a button require("sdk/ui/button/action").actionbutton({ id: "show-panel", label: "show panel", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); // show the panel when the user clicks the button.
ui/toolbar - Archive of obsolete content
you can supply three sorts of ui components: action buttons toggle buttons frames this add-on builds part of the user interface for a music player using action buttons for the controls and a frame to display art and the currently playing song: var { actionbutton } = require('sdk/ui/button/action'); var { toolbar } = require("sdk/ui/toolbar"); var { frame } = require("sdk/ui/frame"); var previous = actionbutton({ id: "previous", label: "p...
...revious", icon: "./icons/previous.png" }); var next = actionbutton({ id: "next", label: "next", icon: "./icons/next.png" }); var play = actionbutton({ id: "play", label: "play", icon: "./icons/play.png" }); var frame = new frame({ url: "./frame-player.html" }); var toolbar = toolbar({ title: "player", items: [previous, next, play, frame] }); the toolbar appears just above the content window: to destroy a toolbar call its destroy() method.
...this add-on creates a toolbar containing one button and a frame: var { actionbutton } = require('sdk/ui/button/action'); var { frame } = require("sdk/ui/frame"); var { toolbar } = require("sdk/ui/toolbar"); var button = actionbutton({ id: "my-button", label: "my-button", icon: "./my-button.png" }); var frame = new frame({ url: "./my-frame.html" }); var toolbar = toolbar({ title: "player", items: [button, frame] }); this add-on creates a toolbar with one fra...
...each item in items must be an action button, a toggle button, or a frame instance.
Adding a Button to the Toolbar - Archive of obsolete content
to add a button to the toolbar, use the action button or toggle button modules.
... create a directory called "data", mkdir data and save these three icon files to the "data" directory: icon-16.png icon-32.png icon-64.png then open the file called "index.js" in the root of your addon directory and add the following code to it: var buttons = require('sdk/ui/button/action'); var tabs = require("sdk/tabs"); var button = buttons.actionbutton({ id: "mozilla-link", label: "visit mozilla", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); function handleclick(state) { tabs.open("https://www.mozilla.org/"); } now run the add-on with jpm run.
...this is just like the action button api except it adds a boolean checked property which is toggled whenever the button is checked.
... learning more action button reference toggle button reference toolbar reference ...
Getting Started (jpm) - Archive of obsolete content
open it and add the following code: var buttons = require('sdk/ui/button/action'); var tabs = require("sdk/tabs"); var button = buttons.actionbutton({ id: "mozilla-link", label: "visit mozilla", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); function handleclick(state) { tabs.open("http://www.mozilla.org/"); } note that "entry point" defaults to "index.js" in jpm, meaning that your main fil...
...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.
...for example, we could change the page that gets loaded: var buttons = require('sdk/ui/button/action'); var tabs = require("sdk/tabs"); var button = buttons.actionbutton({ id: "mozilla-link", label: "visit mozilla", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); function handleclick(state) { tabs.open("https://developer.mozilla.org/"); } at the command prompt, execute jpm run again.
... the add-on code itself uses two sdk modules, action button and tabs.
Getting started (cfx) - Archive of obsolete content
open it and add the following code: var buttons = require('sdk/ui/button/action'); var tabs = require("sdk/tabs"); var button = buttons.actionbutton({ id: "mozilla-link", label: "visit mozilla", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); function handleclick(state) { tabs.open("https://www.mozilla.org/"); } save the file.
...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.
...for example, we could change the page that gets loaded: var buttons = require('sdk/ui/button/action'); var tabs = require("sdk/tabs"); var button = buttons.actionbutton({ id: "mozilla-link", label: "visit mozilla", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); function handleclick(state) { tabs.open("https://developer.mozilla.org/"); } at the command prompt, execute cfx run again.
... the add-on code itself uses two sdk modules, action button and tabs.
Modifying the Page Hosted by a Tab - Archive of obsolete content
here's a simple example: var button = require("sdk/ui/button/action").actionbutton({ id: "style-tab", label: "style tab", icon: "./icon-16.png", onclick: function() { require("sdk/tabs").activetab.attach({ contentscript: 'document.body.style.border = "5px solid red";' }); } }); to run this example, save an icon file named "icon-16.png" in add-on's "data" directory.
... for example, if we save the script above under the add-on's data directory in a file called my-script.js: var self = require("sdk/self"); var button = require("sdk/ui/button/action").actionbutton({ id: "style-tab", label: "style tab", icon: "./icon-16.png", onclick: function() { require("sdk/tabs").activetab.attach({ contentscriptfile: self.data.url("my-script.js") }); } }); you can load more than one script, and the scripts can interact directly with each other.
... // index.js var self = require("sdk/self"); var tabs = require("sdk/tabs"); require("sdk/ui/button/action").actionbutton({ id: "load-several", label: "load several scripts", icon: "./icon-16.png", onclick: function () { tabs.activetab.attach({ contentscriptfile: [self.data.url('first.js'), self.data.url('second.js')] }); } }); communicating with the content scripts your add-on script and content scripts can't directly access each other's variables ...
... // "self" is a global object in content scripts // listen for a "drawborder" self.port.on("drawborder", function(color) { document.body.style.border = "5px solid " + color; }); in the add-on script, we'll send the content script a "drawborder" message using the object returned from attach(): var self = require("sdk/self"); var tabs = require("sdk/tabs"); var button = require("sdk/ui/button/action").actionbutton({ id: "style-tab", label: "style tab", icon: "./icon-16.png", onclick: function() { var worker = tabs.activetab.attach({ contentscriptfile: self.data.url("my-script.js") }); worker.port.emit("drawborder", "red"); } }); the drawborder message isn't a built-in message, it's one that this add-on defines in the port.emit() call.
Adding windows and dialogs - Archive of obsolete content
modal windows block their parent window until action is taken on them.
...all you need to do is define which buttons you'll need and the actions associated with them.
...you'll see that you can choose from a wide variety of buttons, associate any action you need to them, override their labels, and even add completely customized extra buttons.
... attribute persistence user actions can change the state of your windows, such as selecting an option in a listbox, or entering text in a textbox.
Index of archived content - Archive of obsolete content
et/style stylesheet/utils system/child_process system/environment system/events system/runtime system/unload system/xul-app tabs/utils test/assert test/harness test/httpd test/runner test/utils ui/button/action ui/button/toggle ui/frame ui/id ui/sidebar ui/toolbar util/array util/collection util/deprecate util/list util/match-pattern util/object util/uuid window/utils release notes ...
... guidelines extension versioning, update and compatibility extensions support in seamonkey 2 firefox addons developer guide hiding browser chrome hotfix extension how to convert an overlay extension to restartless inline options install manifests installing extensions and themes from web pages interaction between privileged and non-privileged pages jetpack processes legacy add-ons legacy extensions for firefox for android api accounts.jsm browserapp addtab closetab deck getbrowserfor...
... panels homeprovider.jsm homestorage nativewindow contextmenus doorhanger menu toast notifications.jsm pageactions.jsm prompt.jsm runtimepermissions.jsm snackbars.jsm sound.jsm tab addons developer guide code snippets creating a user interface firefox hub walkthrough initialization and cleanup prerequisites walkthrough ...
...er-window private browsing supporting private browsing mode table cellmap table cellmap - border collapse table layout regression tests table layout strategy tamarin abcasm tamarin acceptance testing abc assembler tests actionscript acceptance tests tamarin acceptance test template actionscript performance tests cmdline tests running tamarin acceptance tests running tamarin performance tests tamarin build system documentation tamarin rele...
Drag and Drop JavaScript Wrapper - Archive of obsolete content
ondragstart(event, transferdata, action) define this function to have something happen when a drag starts.
... it takes three arguments, the event object as was originally passed to the event handler, the data to drag and the type of drag action.
...var textobserver = { ondragstart: function (event, transferdata, action) { var htmltext = "<strong>cabbage</strong>"; var plaintext = "cabbage"; transferdata.data = new transferdata(); transferdata.data.adddataforflavour("text/html",htmltext); transferdata.data.adddataforflavour("text/unicode",plaintext); } } here, an observer has been declared and stored in the variable textobserver.
... var txt1 = 'hello'; var txt2 = 'there'; transferdata.data = new transferdataset(); var tmp = new transferdata(); tmp.adddataforflavour("text/unicode",txt1); transferdata.data.push(tmp); new transferdata(); tmp.adddataforflavour("text/unicode",txt2); transferdata.data.push(tmp); } } you will need to add an observer to each element that can either start a drag action or can accept dropped objects.
Supporting per-window private browsing - Archive of obsolete content
you can then take action based on this value, as any data or actions originating from this window should be considered private.
...if some action triggered by a chrome element (such as a button) requires an api that takes a privacy context, the most relevant window is the one that contains the chrome element.
... in some cases, there is no logical window object to use (such as when data or an action originate from some other source than web content).
...function pbobserver() { /* clear private data */ } var os = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); os.addobserver(pbobserver, "last-pb-context-exited", false); preventing a private session from ending if there are unfinished transactions involving private data, where the transactions will be terminated by the ending of a private session, an add-on can vote to prevent the session from ending (prompting the user is recommended).
Event Handlers - Archive of obsolete content
the most basic handler specifies the event to listen for and an action to take when the handler fires.
... this action can be specified either using an action attribute or by specifying the script as a child of the handler element.
...this means that <handler event="click" action="foo()"/> is analogous to onclick="foo()" defined on the bound element.
...since xbl handlers usually constitute the default actions for a widget, this allows authors in the bound document to write events that potentially suppress the default actions taken by the xbl handlers.
A XUL Bestiary - Archive of obsolete content
events are messages that are sent from an object when that object performs some action.
...documents will load, buttons will be clicked, and links will be hovered over, and events will be raised for all these actions behind closed doors.
... if, however, you write event handlers inside event listeners, as we will describe shortly, you can use these events to set off other actions.
... this using of events to prompt other, more explicit actions is loosely what is meant by an event model.
Menus - Archive of obsolete content
this is the manner in which an action can be associated with the menuitem.
... for instance, the action associated with a open menuitem might be to open a file picker to select a file to open.
... <menuitem label="open" accesskey="o" oncommand="alert('open a file!');"/> another way to associate an action with a menu item is to use a command element.
...this is useful when you wish to have several elements performing the same action, for example a menuitem on a menubar, a context menu, and a toolbar button, because you can place the code to execute only once on the command and hook each element up to the command.
OpenClose - Archive of obsolete content
when an menu item is selected, it fires a command event so that code may be used to perform an action.
...there isn't a means of replicating this action with the keyboard, so you should always provide an alternate means of accessing the functionality of the menu.
... popups attached using the context attribute are opened when the user performs an action that attempts to open a context menu.
... this action will vary on each platform, but it general it involves clicking on the element with the right mouse button.
Building Menus With Templates - Archive of obsolete content
here is an example using an xml source: <button type="menu" datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="person"/> <action> <menupopup> <menuitem uri="?" label="?name"/> </menupopup> </action> </template> </button> <button label="children" oncommand="alert(this.previoussibling.childnodes.length);"/> in this example, the datasources attribute has been placed on a menu-type button.
... the query generates a list of the person tags within the datasource and outputs the action body for each one.
... the uri attribute has not been placed on the menupopup element which is the direct child of the action element but has instead been placed on the menuitem element.
...you might be wondering why we couldn't just put the datasources attribute on the menupopup instead and not have a menupopup inside the action body.
Building Trees - Archive of obsolete content
however, the tree builder requires a very specific form to the action body.
... specifically, the action body should be a single treeitem with its rows and cells.
...g an sqlite datasource: <tree datasources="profile:messages.sqlite" ref="*" querytype="storage" flags="dont-build-content"> <treecols> <treecol id="subject" label="subject" flex="3"/> <treecol id="sender" label="sender" flex="2"/> <treecol id="date" label="date" flex="1"/> </treecols> <template> <query> select subject, sender, date from messages </query> <action> <treechildren> <treeitem uri="?"> <treerow> <treecell label="?subject"/> <treecell label="?sender"/> <treecell label="?date"/> </treerow> </treeitem> </treechildren> </action> </template> </tree> features of the tree builder besides the label of a cell, there are several other cell properties you can set w...
...<rule> <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://www.xulplanet.com/rdf/country" object="?country"/> <triple subject="?country" predicate="http://purl.org/dc/elements/1.1/title" object="?countrytitle"/> </query> <action> <treechildren> <treeitem uri="?photo"> <treerow properties="?countrytitle"> <treecell src="?photo"/> </treerow> </treeitem> </treechildren> </action> </rule> you might use the following css to change the border around rows listing a particular country: treechildren::-moz-tree-row(netherlands) { border: green 1px solid; } the result of this exam...
Using Recursive Templates - Archive of obsolete content
<groupbox type="menu" datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="*"/> <action> <vbox uri="?" class="indent"> <label value="?name"/> </vbox> </action> </template> </groupbox> in this simplified example, the xpath expression just gets the list of child elements of the reference node.
...the content of the action body is again generated for each result, but instead of being inserted inside the outermost groupbox, this new content is inserted inside the content generated from the previous iteration.
...></vbox> <vbox id="row6" class="indent"><label value="ferdinand magellan"/></vbox> </vbox> <vbox id="row3" container="true" empty="false" class="indent"> <label value="female"/> <vbox id="row7" class="indent"><label value="cleopatra"/></vbox> <vbox id="row8" class="indent"><label value="laura secord"/></vbox> </vbox> </groupbox> note how similar content corresponding to the action body is created for both the groups as well as the people.
...<vbox datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="*"> <assign var="?type" expr="local-name(.)"/> </query> <rule> <where subject="?type" rel="equals" value="group"/> <action> <groupbox uri="?"> <caption label="?name"/> </groupbox> </action> </rule> <rule> <action> <label uri="?" value="?name"/> </action> </rule> </template> </vbox> the first rule contains a where clause which matches only those results that have a type of group.
XML Assignments - Archive of obsolete content
here is an example: <vbox datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="person"> <assign var="?namelength" expr="string-length(@name)"/> <assign var="?siblings" expr="count(../*) - 1"/> </query> <action> <hbox uri="?" align="center"> <button label="?name"/> <label value="?gender"/> <label value="?namelength"/> <label value="?siblings"/> </hbox> </action> </template> </vbox> two assign elements are placed as children of the query element.
... it allows us to declare additional variables that may be used in the action body.
...the two variable assignments may then be used in the action body to replace attributes in the generated content.
... if a variable is used in the action that doesn't correspond to one declared in an assign element, the default behaviour is to take the corresponding attribute on the result node.
XUL accessibility guidelines - Archive of obsolete content
human computer interaction as you use an application you expect a certain amount of control and feedback.
... testing human computer interaction ensure that help documentation is up to date.
...ensure the user is informed of any user based errors and that instruction and opportunity for reperforming error causing actions is allowed.
... human computer interaction checkpoint pass fail instruction help documentation is provided including a description of keyboard shortcuts.
XForms Repeat Element - Archive of obsolete content
actions you can use xforms action module elements to modify the nodeset that the repeat element is bound to.
... the most useful actions for altering the contents of a repeat are the insert (see the spec), delete (see the spec) and setindex (see the spec) elements.
...0</my:price> </my:line> <my:line name="b"> <my:price>32.25</my:price> </my:line> </my:lines> </instance> </model> <repeat id="lineset" nodeset="/my:lines/my:line"> <input ref="my:price"> <label>line item</label> </input> <input ref="@name"> <label>name</label> </input> </repeat> <trigger> <label>insert a new item after the current one</label> <action ev:event="domactivate"> <insert nodeset="/my:lines/my:line" at="index('lineset')" position="after"/> <setvalue ref="/my:lines/my:line[index('lineset')]/@name"/> <setvalue ref="/my:lines/my:line[index('lineset')]/price">0.00</setvalue> </action> </trigger> <trigger> <label>remove current item</label> <delete ev:event="domactivate" nodeset="/my:lines/my:line" ...
...to accommodate this, xforms 1.0 defines an alternative syntax that is functionally equivalent to the repeat element, using the following attributes: repeat-model repeat-bind repeat-nodeset repeat-startindex repeat-number additionally, when using xforms action setindex, its repeat attribute (which contains an idref) can point to any element carrying these repeat attributes.
Introduction to game development for the Web - Game development
we're talking about kick-ass 3d action shooters, rpgs, and more.
...here's a thorough list to give you a taste of what the web can do for you: full screen api this simple api lets your game take over the entire screen, thereby immersing the player in action.
... pointer lock api the pointer lock api lets you lock the mouse or other pointing device within your game's interface so that instead of absolute cursor positioning you receive coordinate deltas that give you more precise measurements of what the user is doing, and prevent the user from accidentally sending their input somewhere else, thereby missing important action.
...perfect for multiplayer gaming action, chat services, and so forth.
Mobile touch controls - Game development
phaser starts two pointers by default, so two fingers can perform an action at once.
... this approach uses the generally available this.game.input object, but you can also detect the actions on any game objects like sprites or buttons by using oninputover, oninputout, oninputdown, oninputup, ondragstart, or ondragstop: this.button.events.oninputover.add(itemtouched, this); function itemtouched(button, pointer) { // do something } that way you'll be able to attach an event to any object in the game, like the player's ship, and react to the actions performed by the user.
... for the actual gameplay, instead of creating more buttons and covering the small mobile screen with them, we can use something a little bit different: we'll create invisible areas which respond to the given action.
...you can assign functions on input down and input up separately if you'd like to perform more complicated actions, but in this game touching the right side of the screen will simply fire the bullets to the right — this is all we need in this case.
CSS values and units - Learn web development
<number> a <number> represents a decimal number — it may or may not have a decimal point with a fractional component, for example 0.255, 128, or -1.2.
... <percentage> a <percentage> represents a fraction of some other value, for example 50%.
...to see this in action you'll have to try the example after opening it in its own browser tab.
...we've already seen functions in action in the colors section — rgb(), hsl(), etc.
How do I start to design my website? - Learn web development
such a website is the best way to aggregate all the stuff we want to publish in a single place (good for goals 3, 5, and 6) and promote interaction between us and the public (good for goals 2 and 4).
... now that you know what you want to accomplish, it's time to turn those goals into actionable steps.
... second, setting out actionable steps leads to new questions you'll need to answer.
...break down big tasks into small, actionable steps.
Graceful asynchronous programming with Promises - Learn web development
previous overview: asynchronous next promises are a comparatively new feature of the javascript language that allow you to defer further actions until after a previous action has completed, or respond to its failure.
...we're able to chain multiple asynchronous actions to occur one after another this way because each .then() block returns a new promise that resolves when the .then() block is done running.
...add this now: let errorcase = promise3.catch(e => { console.log('there has been a problem with your fetch operation: ' + e.message); }); to see this in action, try misspelling the url to the image and reloading the page.
... let's build another example to show this in action.
Introduction to events - Learn web development
previous overview: building blocks next events are actions or occurrences that happen in the system you are programming, which the system tells you about so you can respond to them in some way if desired.
... for example, if the user selects a button on a webpage, you might want to respond to that action by displaying an information box.
... a series of fortunate events as mentioned above, events are actions or occurrences that happen in the system you are programming — the system produces (or "fires") a signal of some kind when an event occurs, and provides a mechanism by which an action can be automatically taken (that is, some code running) when the event occurs.
...plus, this allows you to have the same button performing different actions in different circumstances — all you have to do is add or remove event handlers as appropriate.
Perceived performance - Learn web development
perceived performance the perception of how fast your site loads and how responsive feels to user interaction is vitally important; even more important that actual download time but difficult to quantify.
...for this, time to interactive, is a good metric; it is the moment when the last long task of the load process finishes and the ui is available for user interaction with delay.
... improving perceived performance understanding networking, how the browser works, user perception of time, etc., can help you better understand how to improve the user interaction.
...content reflowing is especially bad for user experience when not initiated by user interaction.
Introduction to the server side - Learn web development
it can even allow interaction with users of the site, sending notifications and updates via email or through other channels.
... the request includes a url identifying the affected resource, a method that defines the required action (for example to get, delete, or post the resource), and may include additional information encoded in url parameters (the field-value pairs sent via a query string), as post data (data sent by the http post method), or in associated cookies.
... banks use server-side programming to store account information and allow only authorized users to view and make transactions.
...here we'll take you through the main client-server interactions in just a little more detail.
Website security - Learn web development
cross-site request forgery (csrf) csrf attacks allow a malicious user to execute actions using the credentials of another user without that user’s knowledge or consent.
... if a user clicks the submit button, an http post request will be sent to the server containing the transaction details and any client-side cookies that the browser associated with the site (adding associated site cookies to requests is normal browser behavior).
... the server will check the cookies, and use them to determine whether or not the user is logged in and has permission to make the transaction.
... the result is that any user who clicks the submit button while they are logged in to the trading site will make the transaction.
Accessibility/LiveRegionDevGuide
filtering user actions this paragraph describes object properties and event naming schemes that are used to help an at determine if an event is an actual live region event or is the result of user action.
...these "non-live" events may be events originating from the chrome, user interaction in the chrome or document, document loading events, or real live region events from hidden tabs.
...the following is a list of potential filtering techniques: the "event-from-input" object attribute can be used to filter events that were triggered by user action.
...the following describes actions that should be taken for an event with the given politeness level: off: no action should be taken.
Accessibility information for UI designers and developers
this is specifically important in these cases: the user input is about legal commitments or financial transactions it updates or removes the user's data in a system when recording tests responses in those cases, ensure users can change submissions, automatically check for errors.
... 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).
... motion on pages with transitions and animations, note that some users could experience distraction, dizziness or nausea.
... 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.
Software accessibility: Where are we today?
some examples of these assistive devices and software include: screen reading software, which speaks text displayed on the screen using hardware or software text-to-speech, and which allows a blind person to use the keyboard to simulate mouse actions alternate input devices, which allow people with physical disabilities to use alternatives to a keyboard and mouse voice recognition software, which allows a person to simulate typing on a keyboard or selecting with a mouse by speaking into the computer screen magnification software, which allows a low-vision computer user to more easily read portions of the screen comprehension software...
...this is due to a simple problem of context - the idea that a user's interaction with a computer is governed by the situation in which this interaction takes place.
... when the user types something on the keyboard, or when an application displays text or images on the screen, the exact meaning of these actions is determined by the context in which they take place.
...similarly, voice recognition software often needs information about the context of a user's interaction, in order to make sense of what the user is speaking.
A bird's-eye view of the Mozilla framework
it examines what happens when the user performs a simple user interface (ui) action such as clicking a link in the contents panel of the help viewer window shown below.
... organization this article first covers some conceptual groundwork, then walks through a user scenario to illustrate how key mozilla architectural components work together to support a simplehelp viewer ui action.
... user interface (ui) widgets and services the x window system toolkit defines the termwidget as a pre-defined object that encapsulates both the command actions and data associated with a graphical user interface (gui) control.
... if nsirdfnode doesn't support nsirdfliteral, it returns null and it's up to the client to choose an alternate course of action.
How Mozilla's build system works
these sub-tiers roughly correspond to the actions of pre-build, main-build, and post-build.
... during build backend generation, all moz.build files relevant to the current build configuration are read and converted into files and actions used to build the tree (such as makefiles).
...moz.build files are limited to performing the following actions: calling functions that are explicitly made available to the moz.build environment.
... the most important actions of moz.build files are #1 and #2 from the above list.
Performance
function helper(window, action) { // ...
... function helper(window, action) { // ...
...if each framescript registers a seperate listener then the observed action will trigger the callbacks in all tabs.
... as long as it the action does not happen frequently the memory and startup savings should outstrip the added cost of script evaluation.
IPDL Tutorial
the following ipdl code defines a very basic interaction of browser and plugin actors: async protocol pplugin { child: async init(nscstring pluginpath); async shutdown(); parent: async ready(); }; this code declares the pplugin protocol.
... class pluginparent : public ppluginparent { public: pluginparent(const nscstring& pluginpath) { // launch child plugin process sendinit(pluginpath); } ~pluginparent() { sendshutdown(); } protected: bool recvready() { mobservers.notify("ready for action"); } }; here's how the ppluginchild might be used by a c++ implementor in the plugin process: class pluginchild : public ppluginchild { protected: void recvinit(const nscstring& pluginpath) { mpluginlibrary = pr_loadlibrary(pluginpath.get()); sendready(); } void recvshutdown() { pr_unloadlibrary(mpluginlibrary); } private: prlibrary* mpluginlibrary; }; launching the ...
... however, overridden implementations are encouraged when some action should happen on protocol destruction in lieu of using the deallocpprotocol function.
...in this case, the alloc/dealloc pairs can perform different actions.
Localization content best practices
for example, it might seem ok in english to present the strings [username] says: to localizers simply as says: but this will cause serious issues in many other languages as the agent of an action often will not come in front of the verb, but some other position.
... another example, some locales use nouns for titles, and verbs for actions (for example button labels).
...these are generally not complete sentences, but instead, phrases that convey the idea of a concept or action.
... 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).
Mozilla DOM Hacking Guide
this is all possible thanks to the magic of the interaction between xpconnect and the dom.
...the actions that concern the dom are described below.
... before we start looking at the implementation of the nsixpcscriptable interface, the implementor needs the following information: which dom object is concerned what action does he want to override what should happen for our example, it is the window object.
... the action is setting a property.
Midas
redo this command will redo the previous undo action.
... if undo was not the most recent action, this command will have no effect.
... undo this command will undo the previous action.
... if no action has occurred in the document, then this command will have no effect.
NSS Developer Tutorial
curly braces: both of the following styles are allowed: if (condition) { action1(); } else { action2(); } or: if (condition) { action1(); } else { action2(); } the former style is more common.
... when a block of code consists of a single statement, nss doesn’t require curly braces, so both of these examples are fine: if (condition) { action(); } or: if (condition) action(); although the use of curly braces is more common.
... multiple-line comments should be formatted as follows: /* * line1 * line2 */ or /* ** line 1 ** line 2 */ the following styles are also common, because they conserve vertical space: /* line1 * line2 */ or /* line1 ** line2 */ or /* line1 * line2 */ naming public functions are named foo_dooneaction.
... global, but unexported functions, are usually named foo_dooneaction.
Rhino Debugger
this action will display a file-selection dialog box prompting you for the location of a script to load.
...this action will display a file-selection dialog box prompting you for the location of a script to execute.
...this action will display a pop-up menu.
...this action will display a pop-up menu.
Mork
MozillaTechMork
changesets a group is theoretically an atomic transaction à la sql's transactions.
... the equivalent of begin transaction is the '@$${hex{@' identify (the hex represents the id).
... commit transaction is '@$$}hex}@' and rollback transaction '@$$}~~}'.
... a brief survey of mozilla code implies that it an aborted transaction is only used if mork loses internal consistency.
Component Internals
the component is an abstraction sitting between the actual module in which it is implemented and the objects that its factory code creates for use by clients.
...the sequence of events that kicks off this xpcom initialization may be triggered by user action or by the application startup itself.
...the factory object provides a basic abstraction of the core xpcom object.
...the module interface provides yet another abstraction - this time of the factories - and allows for multiple factory objects.
GetKeyBindings
« nsiaccessible page summary this method provides array of localized string of global keyboard accelerator for the given action index supported by accessible.
... nsidomdomstringlist getkeybindings( in pruint8 aactionindex ); parameters aactionindex[in] index of the given action.
... exceptions thrown ns_error_invalid_arg the given index doesn't correspond to default action (not zero).
... remark key bindings are supported for default action only.
nsIHapticFeedback
underbird 3.3 / seamonkey 2.1) implemented by: @mozilla.org/widget/hapticfeedback;1 as a service: var hapticfeedback = components.classes["@mozilla.org/widget/hapticfeedback;1"] .getservice(components.interfaces.nsihapticfeedback); once you have the service, you can initiate haptic feedback (that is, cause the device to vibrate, if it's supported) by calling performsimpleaction(): hapticfeedback.performsimpleaction(components.interfaces.nsihapticfeedback.longpress); method overview void performsimpleaction(in long islongpress); constants press length constants constant value description shortpress 0 specify as the action type to perform a short vibration.
... longpress 1 specify as the action type to perform a long vibration.
... methods performsimpleaction() perform haptic feedback.
... void performsimpleaction( in long islongpress ); parameters islongpress the press length; this will determine how long the vibration should last.
XPCOM Interface Reference
component; nsiprefbranchextensionmanager (toolkit)iaccessible2iaccessibleactioniaccessibleapplicationiaccessiblecomponentiaccessibleeditabletextiaccessiblehyperlinkiaccessiblehypertextiaccessibleimageiaccessiblerelationiaccessibletableiaccessibletable2iaccessibletablecelliaccessibletextiaccessiblevalueidispatchijsdebuggeramiinstallcallbackamiinstalltriggeramiwebinstallinfoamiwebinstalllisteneramiwebinstallpromptamiwebinstallerimgicacheimgicontainerimgicontainerobserverimgidecoderimgidecoderobserverimgiencoderimgiloaderimgirequestinidomutilsjsdistackframemoziasyncfaviconsmoziasynchistorymozicoloranalyzermozijssubscriptloadermozipersonaldictionarymoziplaceinfomoziplacesautocompletemoziregistrymozirepresentativec...
...istenernsimessagelistenermanagernsimessagesendernsimessagewakeupservicensimessengernsimicrosummarynsimicrosummarygeneratornsimicrosummaryobservernsimicrosummaryservicensimicrosummarysetnsimimeconverternsimimeheadersnsimodulensimsgaccountnsimsgaccountmanagerextensionnsimsgcompfieldsnsimsgcustomcolumnhandlernsimsgdbhdrnsimsgdbviewnsimsgdbviewcommandupdaternsimsgdatabasensimsgfilternsimsgfiltercustomactionnsimsgfilterlistnsimsgfoldernsimsgheaderparsernsimsgidentitynsimsgincomingservernsimsgmessageservicensimsgprotocolinfonsimsgruleactionnsimsgsearchcustomtermnsimsgsearchnotifynsimsgsearchscopetermnsimsgsearchsessionnsimsgsearchtermnsimsgsearchvaluensimsgsendlaternsimsgthreadnsimsgwindownsimsgwindowcommandsnsimutablearraynsinavbookmarkobservernsinavbookmarksservicensinavhistorybatchcallbacknsinavhis...
...onnsitaskbarpreviewcontrollernsitaskbarprogressnsitaskbartabpreviewnsitaskbarwindowpreviewnsitelemetrynsitextinputprocessornsitextinputprocessorcallbacknsitextinputprocessornotificationnsithreadnsithreadeventfilternsithreadinternalnsithreadmanagernsithreadobservernsithreadpoolnsithreadpoollistenernsitimernsitimercallbacknsitoolkitnsitoolkitprofilensitoolkitprofileservicensitraceablechannelnsitransactionnsitransactionlistnsitransactionlistenernsitransactionmanagernsitransferablensitransportnsitransporteventsinknsitransportsecurityinfonsitreeboxobjectnsitreecolumnnsitreecolumnsnsitreecontentviewnsitreeselectionnsitreeviewnsiurinsiurifixupnsiurifixupinfonsiurlnsiurlformatternsiurlparsernsiutf8converterservicensiutf8stringenumeratornsiuuidgeneratornsiupdatensiupdatechecklistenernsiupdatecheckernsiup...
...ptionnsixsltprocessornsixsltprocessorobsoletensixulappinfonsixulbrowserwindownsixulbuilderlistenernsixulruntimensixulsortservicensixultemplatebuildernsixultemplatequeryprocessornsixultemplateresultnsixulwindownsixmlrpcclientnsixmlrpcfaultnsizipentrynsizipreadernsizipreadercachensizipwriternsmsgfilterfileattribvaluensmsgfolderflagtypensmsgjunkstatusnsmsgkeynsmsglabelvaluensmsgpriorityvaluensmsgruleactiontypensmsgsearchattribnsmsgsearchopnsmsgsearchscopensmsgsearchtermnsmsgsearchtypevaluensmsgsearchvaluensmsgsearchwidgetvaluenspipromptservice see also interfaces grouped by function ...
Address book sync client design
* * atransactionid - the id for this particular request * astatus - status code for the sync request * amsg - a text string describing the error (if any).
...this method is * called only once, at the beginning of a sync transaction * */ void onstartoperation(in print32 atransactionid, in pruint32 amsgsize); /** * notify the observer that progress as occurred for the ab sync operation */ void onprogress(in print32 atransactionid, in pruint32 aprogress, in pruint32 aprogressmax); /** * notify the observer with a status message for sync operation */ void onstatus(in print32 atransactionid, in wstring amsg); /** * notify the observer that the ab sync operation h...
... * * atransactionid - the id for this particular request * astatus - status code for the sync request * amsg - a text string describing the error (if any).
... */ void onstopoperation(in print32 atransactionid, in nsresult astatus, in wstring amsg); }; ...
DOMException - Web APIs
constrainterror a mutation operation in a transaction failed because a constraint was not satisfied (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).
...adds the notreadableerror, unknownerror, constrainterror, dataerror, transactioninactiveerror, readonlyerror, versionerror, operationerror, and notallowederror values.
DataTransfer.dropEffect - Web APIs
for the dragenter and dragover events, dropeffect will be initialized based on what action the user is requesting.
... how this is determined is platform specific, but typically the user can press modifier keys such as the alt key to adjust the desired action.
... within event handlers for dragenter and dragover events, dropeffect should be modified if a different action is desired than the action that the user is requesting.
... for the drop and dragend events, dropeffect will be set to the action that was desired, which will be the value dropeffect had after the last dragenter or dragover event.
Element - Web APIs
WebAPIElement
clipboard events copy fired when the user initiates a copy action through the browser's user interface.
... cut fired when the user initiates a cut action through the browser's user interface.
... paste fired when the user initiates a paste action through the browser's user interface.
... undomanager and domtransactionthe definition of 'element' in that specification.
FileHandle API - Web APIs
any attempt to perform a write action on a readonly lockedfile object will fail.
... var progress = document.queryselector('progress'); var myfile = myfilehandle.open('readonly'); // let's read a 1gb file var action = myfile.readasarraybuffer(1000000000); action.onprogress = function (event) { if (progress) { progress.value = event.loaded; progress.max = event.total; } } action.onsuccess = function () { console.log('yeah \o/ just read a 1gb file'); } action.onerror = function () { console.log('oups :( unable to read a 1gb file') } file storage when a file handle is created, the asso...
...e'); // if necessary, let's create a datastore for the files idbreq.onupgradeneeded = function () { this.result.createobjectstore('files'); } idbreq.onsuccess = function () { var db = this.result; // let's create a new file var handlereq = db.mozcreatefilehandle("test.txt", "plain/text"); handlereq.onsuccess = function () { var myfilehandle = this.result; var store = db.transaction(['files'], 'readwrite').objectstore('files'); // let's store the file permanently // hint: it could be handy to use the file name as the storage key var storereq = store.add(myfilehandle, myfilehandle.name); storereq.onsuccess = function () { console.log('the file has been successfully stored and can be retrieved anytime.') } } } a file stored that way is physicall...
...the outcome of this discussion is the filehandle api with its lockedfile and transaction mechanism.
HTMLInputElement - Web APIs
formaction string: returns / sets the element's formaction attribute, containing the uri of a program that processes information submitted by the element.
... this overrides the action attribute of the parent form.
... disabled boolean: returns / sets the element's disabled attribute, indicating that the control is not available for interaction.
... the following properties have been added: autocomplete, autofocus, dirname, files, formaction, formenctype, formmethod, formnovalidate, formtarget, height, indeterminate, labels, list, max, min, multiple, pattern, placeholder, required, selectiondirection, selectionend, selectionstart, step, validationmessage, validity, valueasdate, valueasnumber, width, and willvalidate.
IDBCursor.delete() - Web APIs
WebAPIIDBCursordelete
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.
... 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.
...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 ...
IDBCursor.source - Web APIs
WebAPIIDBCursorsource
this function never returns null or throws an exception, even if the cursor is currently being iterated, has iterated past its end, or its transaction is not active.
... 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.
... within each iteration we log the source of the cursor, which will log our idbobjectstore object to the console, something like this: idbobjectstore {autoincrement: false, transaction: idbtransaction, indexnames: domstringlist, keypath: "albumtitle", name: "rushalbumlist"…} the cursor does not require us to select the data based on a key; we can just grab all of it.
...for a complete working example, see our idbcursor example (view example live.) function displaydata() { var transaction = db.transaction(['rushalbumlist'], "readonly"); var objectstore = transaction.objectstore('rushalbumlist'); objectstore.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = cursor.value.albumtitle + ', ' + cursor.value.year; list.appendchild(listitem); console.log(cursor.source); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specifications ...
IDBCursor.update() - Web APIs
WebAPIIDBCursorupdate
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.
... 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.
...for a complete working example, see our idbcursor example (view example live.) function updateresult() { list.innerhtml = ''; const transaction = db.transaction(['rushalbumlist'], 'readwrite'); const objectstore = transaction.objectstore('rushalbumlist'); objectstore.opencursor().onsuccess = function(event) { const cursor = event.target.result; if (cursor) { if (cursor.value.albumtitle === 'a farewell to kings') { const updatedata = cursor.value; updatedata.year = 2050; const request = cursor.u...
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.
...e }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const db = dbopenrequest.result; db.addeventlistener('abort', () => { console.log('transaction aborted'); }); // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); // abort the transaction transaction.abort(); }; the same example, but assigning the event handler to the onabort property: // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (even...
..., { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const db = dbopenrequest.result; db.onabort = () => { console.log('transaction aborted'); }; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); // abort the transaction transaction.abort(); }; ...
IDBDatabaseSync - Web APIs
ectstore (in domstring name, in domstring keypath, in optional boolean autoincrement) raises (idbdatabaseexception); idbobjectstoresync openobjectstore (in domstring name, in optional unsigned short mode) raises (idbdatabaseexception); void removeobjectstore (in domstring storename) raises (idbdatabaseexception); void setversion (in domstring version); idbtransactionsync transaction (in optional domstringlist storenames, in optional unsigned int timeout) raises (idbdatabaseexception); attributes attribute type description description readonly domstring the human-readable description of the connected database.
... transaction() creates and returns a transaction, acquiring locks on the given database objects, within the specified timeout duration, if possible.
... idbtransactionsync transaction ( in optional domstringlist storenames, in optional unsigned int timeout ) raises (idbdatabaseexception); parameters storenames the names of object stores and indexes in the scope of the new transaction.
... returns idbtransactionsync an object to access the newly created transaction.
IDBObjectStore.get() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbobjectstore's transaction is inactive.
... 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".
... // this is used a lot below db = dbopenrequest.result; // run the getdata() function to get the data from the database getdata(); }; function getdata() { // open a read/write db transaction, ready for retrieving 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: ' + tran...
...saction.error + '</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todolist"); // make a request to get a record by key from the object store var objectstorerequest = objectstore.get("walk dog"); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; var myrecord = objectstorerequest.result; }; }; specifications specification status comment indexed database api 2.0the definition of 'get()' in that specification.
KeyboardEvent - Web APIs
keyboardevent objects describe a user interaction with the keyboard; each event describes a single interaction between the user and a key (or combination of a key with modifier keys) on the keyboard.
... note: keyboardevent events just indicate what interaction the user had with a key on the keyboard at a low level, providing no contextual meaning to that interaction.
... note: manually firing an event does not generate the default action associated with that event.
...in the case of ui events, this is important for security reasons, as it prevents scripts from simulating user actions that interact with the browser itself.
MediaSession - Web APIs
the mediasession interface of the media session api allows a web page to provide custom behaviors for standard media playback interactions, and to report metadata that can be sent by the user agent to the device or operating system for presentation in standardized user interface elements.
... methods setactionhandler() sets an event handler for a media session action, such as play or pause.
... examples the following example creates a new media session and assigns action handlers to it: if ('mediasession' in navigator){ navigator.mediasession.metadata = new mediametadata({ title: "podcast episode title", artist: "podcast host", album: "podcast name", artwork: [{src: "podcast.jpg"}] }); navigator.mediasession.setactionhandler('play', function() {}); navigator.mediasession.setactionhandler('pause', function() {}); navigator.mediasession.setactionhandler('seekbackward', function() {}); navigator.mediasession.setactionhandler('seekforward', function() {}); navigator.mediasession.setactionhandler('previoustrack', fu...
...nction() {}); navigator.mediasession.setactionhandler('nexttrack', function() {}); } the following example sets up event handlers for pausing and playing: var audio = document.queryselector("#player"); audio.src = "song.mp3"; navigator.mediasession.setactionhandler('play', play); navigator.mediasession.setactionhandler('pause', pause); function play() { audio.play(); navigator.mediasession.playbackstate = "playing"; } function pause() { audio.pause(); navigator.mediasession.playbackstate = "paused"; } specifications specification status comment media session standardthe definition of 'mediasession' in that specification.
Notification.Notification() - Web APIs
requireinteraction: indicates that a notification should remain active until the user clicks or dismisses it, rather than closing automatically.
... actions: an array of notificationactions representing the actions available to the user when the notification is presented.
... these are options the user can choose among in order to act on the action within the context of the notification itself.
... the action's name is sent to the service worker notification handler to let it know the action was selected by the user.
Notification - Web APIs
notification.maxactions read only instance properties these properties are available only on instances of the notification object.
... notification.actions read only the actions array of the notification as specified in the constructor's options parameter.
... notification.requireinteraction read only a boolean indicating that a notification should remain active until the user clicks or dismisses it, rather than closing automatically.
...to see a example in action, check out our to-do list example (also see the app running live.) note: in the above example we spawn notifications in response to a user gesture (clicking a button).
Using the Payment Request API - Web APIs
in the code above, you'll see that we've called the paymentresponse.complete() method to signal that the interaction has finished — you'd use this to carry out finishing steps, like updating the user interface to tell the user the transaction is complete, etc.
... pre-authorizing transactions some use cases (e.g., paying for fuel at a service station) involve pre-authorization of payment.
...paymentrequest.canmakepayment() .then(function(res) { if (res) { // the payment handler has pre-authorized a transaction // with some static amount, e.g., usd $1.00.
... note: see our pre-authorizing transactions demo for the full code.
Supporting both TouchEvent and MouseEvent - Web APIs
however, because the browser must emulate mouse events, there may be some interaction issues that need to be handled.
... below are some details about the interaction and the ramifications for application developers.
... event firing the touch events standard defines a few browser requirements regarding touch and mouse interaction (see the interaction with mouse events and click section for details), noting the browser may fire both touch events and mouse events in response to the same user input.
...reventdefault(); } event order although the specific ordering of touch and mouse events is implementation-defined, the standard indicates the following order is typical: for single input: touchstart zero or more touchmove events, depending on movement of the finger(s) touchend mousemove mousedown mouseup click if the touchstart, touchmove or touchend event is canceled during an interaction, no mouse or click events will be fired, and the resulting sequence of events would just be: touchstart zero or more touchmove events, depending on movement of the finger(s) touchend community touch events community group mail list w3c #touchevents irc channel related topics and resources touch events overview using touch events touch and mouse (together again for the first tim...
Touch events - Web APIs
the touch events interfaces are relatively low-level apis that can be used to support application-specific multi-touch interactions such as a two-finger gesture.
... a multi-touch interaction starts when a finger (or stylus) first touches the contact surface.
...the interaction ends when the fingers are removed from the surface.
... during this interaction, an application receives touch events during the start, move, and end phases.
WebGL by example - Web APIs
the examples are sorted according to topic and level of difficulty, covering the webgl rendering context, shader programming, textures, geometry, user interaction, and more.
... clearing by clicking how to combine user interaction with graphics operations.
... raining rectangles a simple game that demonstrates clearing with solid colors, scissoring, animation, and user interaction.
... hello vertex attributes combining shader programming and user interaction through vertex attributes.
XRSession: selectend event - Web APIs
the webxr event selectend is sent to an xrsession when one of its input sources ends its primary action or when an input source that's in the process of handling an ongoing primary action is disconnected without successfully completing the action.
... primary actions include things like users pressing triggers or buttons, tapping a touchpad, speaking a command, or performing a recognizable gesture when using a video tracking system or handheld controller with an accelerometer.
... bubbles yes cancelable no interface xrinputsourceevent event handler property onselectend for details on how the selectstart, select, and selectend events work, and how you should react to them, see primary actions in inputs and input sources.
...only after completing those tasks does the onselectionevent() function below dispatch the action out to a specialized function to handle things.
XRSession: selectstart event - Web APIs
the webxr event selectstart is sent to an xrsession when the user begins a primary action on one of its input sources.
... primary actions include things like users pressing triggers or buttons, tapping a touchpad, speaking a command, or performing a recognizable gesture when using a video tracking system or handheld controller with an accelerometer.
... bubbles yes cancelable no interface xrinputsourceevent event handler property onselectstart for details on how the selectstart, select, and selectend events work, and how you should react to them, see primary actions in inputs and input sources.
...only after completing those tasks does the onselectionevent() function below dispatch the action out to a specialized function to handle things.
XRSession: squeezeend event - Web APIs
the webxr event squeezeend is sent to an xrsession when one of its input sources ends its primary action or when an input source that's in the process of handling an ongoing primary action is disconnected without successfully completing the action.
... primary squeeze actions include things like users pressing triggers or buttons, tapping a touchpad, speaking a command, or performing a recognizable gesture when using a video tracking system or handheld controller with an accelerometer.
... bubbles yes cancelable no interface xrinputsourceevent event handler property onsqueezeend for details on how the squeezestart, squeeze, and squeezeend events work, and how you should react to them, see primary squeeze actions in inputs and input sources.
...only after completing those tasks does the onsqueezeevent() function below dispatch the action out to a specialized function to handle things.
XRSession: squeezestart event - Web APIs
the webxr event squeezestart is sent to an xrsession when the user begins a primary squeeze action on one of its input sources.
... primary squeeze actions are actions which are meant to represent gripping or squeezing using your hands, and may be simulated using triggers on hand controllers.
... bubbles yes cancelable no interface xrinputsourceevent event handler property onsqueezestart for details on how the squeezestart, squeeze, and squeezeend events work, and how you should react to them, see primary squeeze actions in inputs and input sources.
...only after completing those tasks does the onsqueezeevent() function below dispatch the action out to a specialized function to handle things.
ARIA Test Cases - Accessibility
as such, they are used to test a variety of features, such as styling, behavior, mouse, and keyboard interactions, to name few.
...if the drag and drop operation caused a menu to open, focus should be tracked in that menu, and the user should be able to complete further interaction via the keyboard as usual.
...actions in this dialogor list such as "activate link" or "move to link" should perform the same as they do with regular links.
... (al) optional but desired: the screen reader should announce updates to a live region where the region changes are the result of a user action.
ARIA: feed role - Accessibility
the list establishes an interoperability contract between the web page and assistive technologies that governs scroll interactions so that assistive technology users can read articles, jump forward and backward by article, and reliably trigger new articles to load while in reading mode.
...see keyboard interactions below.
... the feed pattern enables reliable assistive technology reading mode interaction by establishing the following interoperability agreement between the web page and assistive technologies: in the context of a feed, the web page code is responsible for: appropriate visual scrolling of the content based on which article contains dom focus.
... keyboard interaction supporting the following, or a similar, interface is recommended when focus is inside the feed: page down: move focus to next article.
Border-image generator - CSS: Cascading Style Sheets
ass="image" src="https://udn.realityripple.com/samples/7b/dd37c1d691.png" data-stateid="border4"/> <img class="image" src="https://udn.realityripple.com/samples/a9/b9fff72dab.png" data-stateid="border5"/> <img class="image" src="https://udn.realityripple.com/samples/fb/c0b285d3da.svg" data-stateid="border6"/> </div> </div> <div id="load-actions" class="group section"> <div id="toggle-gallery" data-action="hide"> </div> <div id="load-image" class="button"> upload image </div> <input id="remote-url" type="text" placeholder="load an image from url"/> <div id="load-remote" class="button"> </div> </div> <div id="general-controls" class="group section"> <div class="...
...80px; float: left; margin: 10px; opacity: 0.5; background-color: #fff; box-shadow: 0px 0px 3px 1px #bababa; } #image-gallery .image[selected="true"] { box-shadow: 0px 0px 3px 1px #3bba52; opacity: 1; } #image-gallery .image:hover { cursor: pointer; box-shadow: 0px 0px 3px 1px #30ace5; opacity: 1; } #image-gallery[data-collapsed='true'] { margin-top: -100px; } /* load menu */ #load-actions { margin: 10px 0; } #toggle-gallery { width: 30px; height: 25px; margin: 10px; color: #fff; background-image: url('https://mdn.mozillademos.org/files/6005/arrow-up-white.png'); background-repeat: no-repeat; background-position: top 4px center; background-color: #888888 !important; border-radius: 2px; float: left; } #toggle-gallery:hover { cursor: pointer; } #toggle-gallery[data-...
...action='show'] { background-image: url('https://mdn.mozillademos.org/files/6001/arrow-down-white.png'); background-color: #888888 !important; } #toggle-gallery[data-action='hide'] { background-image: url('https://mdn.mozillademos.org/files/6005/arrow-up-white.png'); } .button { width: 100px; height: 25px; margin: 10px; color: #fff; text-align: center; font-size: 12px; line-height: 25px; background-color: #379b4a; border-radius: 2px; float: left; } .button:hover { cursor: pointer; background-color: #3380c4; } #load-image { float: left; } #load-remote { width: 30px; background-image: url('https://mdn.mozillademos.org/files/6003/arrow-right-white.png'); background-repeat: no-repeat; background-position: center center; } #remote-url { width: 200px; height: 23px; margin: ...
...etscale = function getscale() { return scale/100; }; var togglegallery = function togglegallery() { var gallery = getelembyid('image-gallery'); var button = getelembyid('toggle-gallery'); var state = 1; button.addeventlistener('click', function() { state = 1 ^ state; if (state === 0) { gallery.setattribute('data-collapsed', 'true'); button.setattribute('data-action', 'show'); } else { gallery.removeattribute('data-collapsed'); button.setattribute('data-action', 'hide'); } }); }; var init = function init() { var gallery = getelembyid('image-gallery'); var browse = getelembyid('load-image'); var remote = getelembyid('remote-url'); var load_remote = getelembyid('load-remote'); remote.addeventlistener('change', func...
font-variant - CSS: Cascading Style Sheets
<numeric-figure-values>, <numeric-spacing-values>, <numeric-fraction-values>, ordinal, slashed-zero specifies the keywords related to the font-variant-numeric longhand property.
... the possible values are: lining-nums, oldstyle-nums, proportional-nums, tabular-nums, diagonal-fractions, stacked-fractions, ordinal, and slashed-zero.
...> | stylistic( <feature-value-name> ) | historical-forms | styleset( <feature-value-name># ) | character-variant( <feature-value-name># ) | swash( <feature-value-name> ) | ornaments( <feature-value-name> ) | annotation( <feature-value-name> ) | [ small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps ] | <numeric-figure-values> | <numeric-spacing-values> | <numeric-fraction-values> | ordinal | slashed-zero | <east-asian-variant-values> | <east-asian-width-values> | ruby ]where <common-lig-values> = [ common-ligatures | no-common-ligatures ]<discretionary-lig-values> = [ discretionary-ligatures | no-discretionary-ligatures ]<historical-lig-values> = [ historical-ligatures | no-historical-ligatures ]<contextual-alt-values> = [ contextual | no-contextual ]<feature-valu...
...e-name> = <custom-ident><numeric-figure-values> = [ lining-nums | oldstyle-nums ]<numeric-spacing-values> = [ proportional-nums | tabular-nums ]<numeric-fraction-values> = [ diagonal-fractions | stacked-fractions ]<east-asian-variant-values> = [ jis78 | jis83 | jis90 | jis04 | simplified | traditional ]<east-asian-width-values> = [ full-width | proportional-width ] examples setting the small-caps font variant html <p class="normal">firefox rocks!</p> <p class="small">firefox rocks!</p> css p.normal { font-variant: normal; } p.small { font-variant: small-caps; } result specifications specification status comment css fonts module level 3the definition of 'font-variant' in that specification.
<button>: The Button element - HTML: Hypertext Markup Language
WebHTMLElementbutton
formaction html5 the url that processes the information submitted by the button.
... overrides the action attribute of the button's form owner.
... get: the form data are appended to the form's action url, with a ?
... notes a submit button with the attribute formaction set, but without an associated form does nothing.
MIME types (IANA media types) - HTTP
a multipart type is one which represents a document that's comprised of multiple component parts, each of which may have its own individual mime type; or, a multipart type may encapsulate multiple files being sent together in one transaction.
... multipart types multipart types indicate a category of document broken into pieces, often with different mime types; they can also be used — especially in email scenarios — to represent multiple, separate files which are all part of the same transaction.
...tent-type: multipart/form-data; boundary=aboundarystring (other headers associated with the multipart document as a whole) --aboundarystring content-disposition: form-data; name="myfile"; filename="img.jpg" content-type: image/jpeg (data) --aboundarystring content-disposition: form-data; name="myfield" (data) --aboundarystring (more subparts) --aboundarystring-- the following <form>: <form action="http://localhost:8000/" method="post" enctype="multipart/form-data"> <label>name: <input name="mytextfield" value="test"></label> <label><input type="checkbox" name="mycheckbox"> check</label> <label>upload file: <input type="file" name="myfile" value="test.txt"></label> <button>send the file</button> </form> will send this message: post / http/1.1 host: localhost:8000 user-agent: mozi...
...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.
CSP: navigate-to - HTTP
the http content-security-policy (csp) navigate-to directive restricts the urls to which a document can initiate navigations by any means including <form> (if form-action is not specified), <a>, window.location, window.open, etc.
... note: if the form-action directive is present, the navigate-to directive will not act on navigations that are form submissions.
... examples meta tag configuration <meta http-equiv="content-security-policy" content="navigate-to 'none'"> violation case using a <form> element with an action set to inline javascript will result in a csp violation.
... <meta http-equiv="content-security-policy" content="navigate-to 'none'"> <form action="javascript:alert('foo')" id="form1" method="post"> <input type="text" name="fieldname" value="fieldvalue"> <input type="submit" id="submit" value="submit"> </form> specifications specification status comment content security policy level 3the definition of 'navigate-to' in that specification.
HTTP Messages - HTTP
WebHTTPMessages
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.
... web developers, or webmasters, rarely craft these textual http messages themselves: software, a web browser, proxy, or web server, perform this action.
... http requests start line http requests are messages sent by the client to initiate an action on the server.
... their start-line contain three elements: an http method, a verb (like get, put or post) or a noun (like head or options), that describes the action to be performed.
Network Error Logging - HTTP
success_fraction floating point value between 0 and 1 which specifies the proportion of successful network requests to report.
... failure_fraction floating point value between 0 and 1 which specifies the proportion of failed network requests to report.
... http 400 (bad request) response { "age": 20, "type": "network-error", "url": "https://example.com/previous-page", "body": { "elapsed_time": 338, "method": "post", "phase": "application", "protocol": "http/1.1", "referrer": "https://example.com/previous-page", "sampling_fraction": 1, "server_ip": "137.205.28.66", "status_code": 400, "type": "http.error", "url": "https://example.com/bad-request" } } dns name not resolved note that the phase is set to dns in this report and no server_ip is available to include.
... { "age": 20, "type": "network-error", "url": "https://example.com/previous-page", "body": { "elapsed_time": 18, "method": "post", "phase": "dns", "protocol": "http/1.1", "referrer": "https://example.com/previous-page", "sampling_fraction": 1, "server_ip": "", "status_code": 0, "type": "dns.name_not_resolved", "url": "https://example-host.com/" } } the type of the network error may be one of the following pre-defined values from the specification, but browsers can add and send their own error types: dns.unreachable the user's dns server is unreachable dns.name_not_resolved the user's dns server responded but was unable to resolve an ip address for the requested uri.
Expressions and operators - JavaScript
there are also compound assignment operators that are shorthand for the operations listed in the following table: compound assignment operators name shorthand operator meaning assignment x = y x = y addition assignment x += y x = x + y subtraction assignment x -= y x = x - y multiplication assignment x *= y x = x * y division assignment x /= y x = x / y remainder assignment x %= y x = x % y exponentiation assignment x **= y x = x ** y left shift assignment x <<= y x = x << y right shift assignment x >>= y x = x >> y unsigned right shift...
...the standard arithmetic operators are addition (+), subtraction (-), multiplication (*), and division (/).
...~ - + ++ -- typeof void delete multiply/divide * / % addition/subtraction + - bitwise shift << >> >>> relational < <= > >= in instanceof equality == != === !== bitwise-and & bitwise-xor ^ bitwise-or | logical-and && logical-or || conditional ?: assignment = += -= *= /= %= <<= >>= >>>= &= ^= |= &&= ||= ??= comma , a more detailed...
...for example, you can override multiplication and division first, then addition and subtraction to evaluate addition first.
Intl.NumberFormat() constructor - JavaScript
the following properties fall into two groups: minimumintegerdigits, minimumfractiondigits, and maximumfractiondigits in one group, minimumsignificantdigits and maximumsignificantdigits in the other.
... minimumfractiondigits the minimum number of fraction digits to use.
... maximumfractiondigits the maximum number of fraction digits to use.
... possible values are from 0 to 20; the default for plain number formatting is the larger of minimumfractiondigits and 3; the default for currency formatting is the larger of minimumfractiondigits and the number of minor unit digits provided by the iso 4217 currency code list (2 if the list doesn't provide that information); the default for percent formatting is the larger of minimumfractiondigits and 0.
Intl.PluralRules() constructor - JavaScript
the following properties fall into two groups: minimumintegerdigits, minimumfractiondigits, and maximumfractiondigits in one group, minimumsignificantdigits and maximumsignificantdigits in the other.
... minimumfractiondigits the minimum number of fraction digits to use.
... maximumfractiondigits the maximum number of fraction digits to use.
... possible values are from 0 to 20; the default for plain number formatting is the larger of minimumfractiondigits and 3; the default for currency formatting is the larger of minimumfractiondigits and the number of minor unit digits provided by the iso 4217 currency code list (2 if the list doesn't provide that information); the default for percent formatting is the larger of minimumfractiondigits and 0.
Types of attacks - Web security
for endpoints that require a post request, it's possible to programmatically trigger a <form> submit (perhaps in an invisible <iframe>) when the page is loaded: <form action="https://bank.example.com/withdraw" method="post"> <input type="hidden" name="account" value="bob"> <input type="hidden" name="amount" value="1000000"> <input type="hidden" name="for" value="mallory"> </form> <script>window.addeventlistener('domcontentloaded', (e) => { document.queryselector('form').submit(); }</script> there are a few techniques that should be used to prevent this from ...
...happening: get endpoints should be idempotent—actions that enact a change and do not simply retrieve data should require sending a post (or other http method) request.
...for all non-get requests that have the potential to perform an action, this input field should be compared against the expected value.
... cookies that are used for sensitive actions (such as session cookies) should have a short lifetime with the samesite attribute set to strict or lax.
Working with Events - Archive of obsolete content
if you do this, the listener will be called for any event emitted by that object, and its argument will be the name of the event: var ui = require("sdk/ui"); var panels = require("sdk/panel"); var self = require("sdk/self"); var panel = panels.panel({ contenturl: self.data.url("panel.html") }); panel.on("*", function(e) { console.log("event " + e + " was emitted"); }); var button = ui.actionbutton({ id: "my-button", label: "my button", icon: "./icon-16.png", onclick: handleclick }); function handleclick(state) { panel.show({ position: button }); } this wildcard feature does not yet work for the tabs or windows modules.
... for example: the actionbutton object emits an event when the button is clicked.
...the listener loads https://developer.mozilla.org/: require("sdk/ui/button/action").actionbutton({ id: "visit-mozilla", label: "visit mozilla", icon: "./icon-16.png", onclick: function() { require("sdk/tabs").open("https://developer.mozilla.org/"); } }); this is exactly equivalent to constructing the button and then calling the button's on() method: var button = require("sdk/ui/button/action").actionbutton({ id: "visit-mozilla", label: "visit mozilla", icon: "./icon-16.png" }); button.on("click", function() { require("sdk/tabs").open("https://developer.mozilla.org/"); }); removing event listeners event listeners can be rem...
context-menu - Archive of obsolete content
unction (node, data) {' + ' console.log("you clicked " + data);' + '});', items: [ cm.item({ label: "item 1", data: "item1" }), cm.item({ label: "item 2", data: "item2" }), cm.item({ label: "item 3", data: "item3" }) ] }); communicating with the add-on often you will need to collect some kind of information in the click listener and perform an action unrelated to content.
...nction(){self.postmessage(); return false;})', onmessage: function(){ var cmitems = getmostrecentbrowserwindow().document.queryselectorall(".addon-context-menu-item[value^='"+ uuidstr +"']"); for(var i=0; i < cmitems.length; i++) cmitems[i].tooltiptext = cmitems[i].value.substring(36); } }); globals constructors item(options) creates a labeled menu item that can perform an action when clicked.
... item a labeled menu item that can perform an action when clicked.
passwords - Archive of obsolete content
formsubmiturl the value of the form's "action" attribute.
...if the form doesn't contain an "action" attribute, this property should match the url property.
... so: given a form at http://www.example.com/login with the following html: <form action="http://login.example.com/foo/authenticate.cgi"> <div>please log in.</div> <label>username:</label> <input type="text" name="uname"> <label>password:</label> <input type="password" name="pword"> </form> the corresponding values for the credential (excluding username and password) should be: url: "http://www.example.com" formsubmiturl: "http://login.example.com" usernamefield: "uname" passwordfield: "pword" note that for both url and formsubmiturl, the portion of the url after the hostname is...
Overview - Archive of obsolete content
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.
... meanwhile the main module contains the application logic and mediates interactions between the different sdk objects.
... we could represent the basic interactions between the main module and the various content scripts like this: user interface the annotator's main user interface consists of a widget and three panels.
Display a Popup - Archive of obsolete content
in this tutorial we'll create an add-on that adds an action button to the toolbar that displays a panel when clicked.
...var text_entry = require("sdk/panel").panel({ contenturl: data.url("text-entry.html"), contentscriptfile: data.url("get-text.js") }); // create a button require("sdk/ui/button/action").actionbutton({ id: "show-panel", label: "show panel", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); // show the panel when the user clicks the button.
... to learn more about buttons, see the action button and toggle button api reference.
Finding window handles - Archive of obsolete content
var gdk = ctypes.open('libgdk-x11-2.0.so.0'); // types let guint32 = ctypes.uint32_t; let gdkwindow = ctypes.structtype('gdkwindow'); // https://developer.gnome.org/gdk3/stable/gdk3-windows.html#gdk-window-focus var gdk_window_focus = gdk.declare('gdk_window_focus', ctypes.default_abi, ctypes.void_t, gdkwindow.ptr, guint32); // https://developer.gnome.org/gdk2/stable/gdk2-x-window-system-interaction.html#gdk-x11-get-server-time var gdk_x11_get_server_time = gdk.declare('gdk_x11_get_server_time', ctypes.default_abi, guint32, gdkwindow.ptr); var browserwindow_madeintogdkwinptr = gdkwindow.ptr(ctypes.uint64(gdkwindowptrstring)); var rez_gst = gdk_x11_get_server_time(browserwindow_madeintogdkwinptr); console.info('rez_gst:', rez_gst, uneval(rez_gst)); // return is a number of ms since the comp...
...i, ctypes.void_t, gtkwindow.ptr); //https://developer.gnome.org/gtk3/stable/gtkwindow.html#gtk-window-present-with-time var gtk_window_present_with_time = gtk.declare('gtk_window_present_with_time', ctypes.default_abi, ctypes.void_t, gtkwindow.ptr, guint32); // gdk_x11_get_server_time is needed for gtk_window_present_with_time // https://developer.gnome.org/gdk2/stable/gdk2-x-window-system-interaction.html#gdk-x11-get-server-time var gdk_x11_get_server_time = gdk.declare('gdk_x11_get_server_time', ctypes.default_abi, guint32, gdkwindow.ptr); var browserwindow_madeintogdkwinptr = gdkwindow.ptr(ctypes.uint64(gdkwindowptrstring)); var gptr = gpointer(); var rez_gwgud = gdk_window_get_user_data(browserwindow_madeintogdkwinptr, gptr.address()); console.info('rez_gwgud:', rez_gwgud, /*rez_gwgud.to...
... // types let guint32 = ctypes.uint32_t; let gdkwindow = ctypes.structtype('gdkwindow'); let gdkdrawable = ctypes.structtype('gdkdrawable'); let card32; if (/^(alpha|hppa|ia64|ppc64|s390|x86_64)-/.test(services.appinfo.xpcomabi)) { card32 = ctypes.unsigned_int; } else { card32 = ctypes.unsigned_long; } let xid = card32; //https://developer.gnome.org/gdk2/stable/gdk2-x-window-system-interaction.html#gdk-x11-drawable-get-xid var gdk_x11_drawable_get_xid = gdk.declare('gdk_x11_drawable_get_xid', ctypes.default_abi, xid, gdkdrawable.ptr); var browserwindow_madeintogdkwinptr = gdkwindow.ptr(ctypes.uint64(gdkwindowptrstring)); var browserwindow_madeintogdkdrawable = ctypes.cast(browserwindow_madeintogdkwinptr, gdkdrawable.ptr); var browserwindow_madeintoxid = gdk_x11_drawable_get_xid(brow...
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
implement the subtraction operation now let’s add subtraction.
... create test case first, add the test case for the subtraction method.
... listing 4: test_calc.js (adding sample test case) '2 1 -': function() { var calc = new rpncalc.rpncalc(); calc.init(); calc.push(2); calc.push(1); calc.minus(); assert.equals(calc.pop(), 1); }, listing 5: calc.js (implementing subtraction operation) minus: function() { this._letfunc(this._minus); }, _minus: function(a, b) { return a - b; }, listing 6: calc.js (correcting mistake in implementation of subtraction) _letfunc: function(func) { // correct pop order b = this.pop(); a = this.pop(); this.push(func(a, b)); }, understanding source code in the open-source community, you can learn a lot about how software works by...
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
the action taken when pressing one of these buttons is defined by an event handler with the name ondialog<button name>.
... xul can also use these event handlers, but xul also offers the oncommand special event handler to deal with actions that often have specific meanings, such as selection by a left-click (or right-click on systems set up as left-handed) on the mouse or selection by the enter key.
... <hbox> <label flex="1"> proceeding with this action will send your personal information to a server.
User Notifications and Alerts - Archive of obsolete content
they interrupt the user's workflow, demanding immediate action before anything else can be done.
... this section lists a few alternatives that give you the possibility of notifying the user and requesting action without being too annoying.
...you can associate an action to the user clicking on the alert.
JavaScript crypto - Archive of obsolete content
overview of the new cert issuing process user fills out enrollment form user action initiates script script calls key generation method (generatecrmfrequest) signing and encryption keys are generated encryption private key is wrapped with public key of key recovery authority (kra) (passed in in the form of a certificate as part of the script, and checked against a pre-installed certificate copy in the local certificate database) the public keys, wrapped encryption private ke...
...signature on signed blob ca/ra validates identity of user ca/ra sends wrapped encryption private key to kra kra sends escrow verification back to ca ca creates and signs certificates ca sends certificates back to the user (importusercertificates) typical use the ca's enrollment page could look something like this: <!doctype html> <h2>request a cert</h2> <form name="reqform" method="post" action="http://your.ra.site.org"> <p><input type=hidden name=cert_request value=""> <p>name: <input type=text name=name value=""> <p>password: <input type=password name="password" value=""> <p><input type=submit name="send" value="submit"> </form> <script> /* the following values could be filled in by the server cgi */ var authenticator = "server_magic"; var keytransportcert = null; var crmfobject = nul...
... example of cryptomechanismflags and cipherflags pkcs11mechanismflags = pkcs11_mech_dsa_flag | pkcs11_mech_skipjack_flag | pkcs11_mech_random_flag; pkcs11cipherflags = 0; return values js_ok_add_module = 3 // successfully added a module js_err_other = -1 // errors other than the following js_err_user_cancel_action = -2 // user aborted an action js_err_incorrect_num_of_arguments = -3 // calling a method w/ incorrect # of // arguments js_err_add_module = -5 // error adding a module js_err_bad_module_name = -6 // the module name is invalid js_err_add_module_duplicate = -10 // the module being installed has the ...
Tamarin - Archive of obsolete content
it currently implements adobe actionscript™ 3 (a superset of ecmascript edition 3) and is embedded within the adobe® flash® player versions 9 and later.
... documentation adobe actionscript virtual machine 2 (avm2) overview (pdf, 400k) the instructions, architecture, and file format supported by the avm2.
... log a bug against tamarin tamarin-devel mailing list #tamarin channel on irc.mozilla.org blogroll mason chang david mandelin related topics javascript spidermonkey actionmonkey tamarin on mozilla.org ...
Elements - Archive of obsolete content
handler <!entity % handler-content "pcdata"> <!element handler %handler-content;> <!attlist handler id id #implied event nmref #required action cdata #implied phase (capturing|bubbling|target) #implied button (1|2|3) #implied modifiers cdata #implied keycode cdata #implied key cdata #implied charcode ...
... action - the action attribute contains script that is invoked when the handler fires.
... preventdefault - if set to true, the default action of the event is not performed.
XUL Events - Archive of obsolete content
the default action of the event can be prevented to prevent the popup to appear.popupshownthe popupshown event is executed when a <menupopup>, <panel> or <tooltip> has become visible.radiostatechangethe radiostatechange event is executed when the state of a <radio> element has changed.valuechangethe valuechange event is executed when the value of an element, <progress> for example, has changed.
...you should not use this event in xul to respond to user actions; the command event should be used instead.
...the action to do this varies by platform, but it will typically be a right click.
Additional Template Attributes - Archive of obsolete content
the container or starting node variable is specified in the <content> tag inside a query, while the member variable is determined by the value of the uri attribute inside the action body.
...this isn't particularly useful although there is a very slight optimization since the builder does not need to scan the action body looking for the member variable when compiling the queries and rules.
...we could use the container variable ?start in the action body also.
Filtering - Archive of obsolete content
you can view a complete example of this in action.
... <query> <content uri="?start"/> <triple subject="?country" predicate="http://www.w3.org/1999/02/22-rdf-syntax-ns#type" object="?start"/> <triple subject="?country" predicate="http://purl.org/dc/elements/1.1/title" object="?countrytitle"/> </query> the action body will need to generate a <menuitem> for each result.
... <action> <menupopup> <menuitem uri="?country" label="?countrytitle" value="?country"/> </menupopup> </action> the result will be two generated menuitems, one for each country, inside a menupopup.
Multiple Rule Example - Archive of obsolete content
« previousnext » the most common use of multiple rules is to apply different action bodies to different results.
... predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/description" object="?description"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/date" object="?date"/> </conditions> <action> <hbox uri="?photo" class="box-padded"> <vbox> <label value="?title"/> <image src="?photo"/> </vbox> <groupbox> <caption label="photo details"/> <label value="?description"/> <label value="date: ?date"/> </groupbox> </hbox> </action> </rule> <rule> <conditions> ...
... <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="?phototitle"/> </conditions> <action> <vbox uri="?photo" class="box-padded"> <label value="?phototitle"/> <image src="?photo"/> </vbox> </action> </rule> </template> </vbox> in this example, the first rule matches only those photos with title, description, and date properties.
Using Multiple Queries to Generate More Results - Archive of obsolete content
<template> <queryset> <query> <content uri="?start"/> <member container="?start" child="?item"/> </query> <rule> <binding subject="?item" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> <action> <label uri="?item" value="?title" class="header"/> </action> </rule> </queryset> <queryset> <query> <content uri="?start"/> <triple subject="?start" predicate="http://www.xulplanet.com/rdf/people" object="?people"/> <member container="?people" child="?item"/> </query> <rule> <binding subject="?item" predicate="http://purl.org/dc/elements/...
...1.1/title" object="?title"/> <action> <label uri="?item" value="?title"/> </action> </rule> </queryset> </template> you can view the example.
... <vbox datasources="people.xml" ref="*" querytype="xml"> <template> <queryset> <query expr="group[@name='male']/*"/> <action> <checkbox uri="?" label="?name"/> </action> </queryset> <queryset> <query expr="group[@name='female']/*"/> <action> <label uri="?" value="?name"/> </action> </queryset> </template> </vbox> « previousnext » ...
Using SOAP in XULRunner 1.9 - Archive of obsolete content
r ns = 'http://example.com/soap/namespace'; var method = 'foo'; var params = { 'foo': 'bar', 'baz': 'bang' }; var callback = function(obj) { components.utils.reporterror(obj.tosource()); }; soapclient.proxy = url; var body = new soapobject(method); body.ns = ns; for (var k in params) { body.appendchild(new soapobject(k).val(params[k])); } var req = new soaprequest(url, body); req.action = ns + '#' + method; soapclient.sendrequest(req, callback); diff between jqsoapclient.js and sasoapclient.js 42c42 < var jsout = $.xmltojson(xdata.responsexml); --- > var jsout = xmlobjectifier.xmltojson(xdata.responsexml); 46,60c46,62 < $.ajax({ < type: "post", < url: soapclient.proxy, < datatype: "xml", < processdata: false, < data: content, < complete...
...: getresponse, < contenttype: soapclient.contenttype + "; charset=\"" + soapclient.charset + "\"", < 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 + '"', > 'conten...
...t-length': soapclient.contentlength, > 'soapserver': soapclient.soapserver, > 'soapaction': soapreq.action > }; > for (var h in headers) { xhr.setrequestheader(h, headers[h]); } > xhr.send(content); ...
XForms Switch Module - Archive of obsolete content
introduction xforms switch module define a switch construct that allows the creation of user interfaces where the user interface can be varied based on user actions and events.
...the toggle element is an action that when triggered will make a case selected and visible and thereby hiding all other case elements contained by the same switch.
...a toggle can be designated as an event handler using xml events or may also be contained in an action element.
RDF in Mozilla FAQ - Archive of obsolete content
you may use any kind of tag (including html, or arbitrary xml) in the <action> section of a <rule>.
...or, it may need to add a datasource later based on some user action.
... <template> <rule> <query>...</query> <binding>...</binding> <action> <text value="?some-variable" /> </action> </rule> </template> the above template will create a content model that runs a series of text nodes together.
Anatomy of a video game - Game development
present, accept, interpret, calculate, repeat the goal of every video game is to present the user(s) with a situation, accept their input, interpret those signals into actions, and calculate a new situation resulting from those acts.
...these games present two images to the user; they accept their click (or touch); they interpret the input as a success, failure, pause, menu interaction, etc.; finally, they calculate an updated scene resulting from that input.
... window.cancelanimationframe( mygame.stopmain ); the key to programming a main loop, in javascript, is to attach it to whatever event should be driving your action and pay attention to how the different systems involved interplay.
Examples - Game development
dead trigger 2 classic zombie splatter action, made with unity3d.
... nutmeg cute retro scrolling platforming action.
... explosion and chain reaction exploding particles that set off other explosions.
Implementing controls using the Gamepad API - Game development
demo the full version of the hungry fridge game was built first, and then to showcase the gamepad api in action and show the javascript source code, a simple demo was created.
...if the api worked without any interaction from the user it could be used to fingerprint them without their knowledge.
...he single press if(!hold) { // loop through the cached states from the previous frame for(var j=0,p=gamepadapi.buttonscache.length; j<p; j++) { // if the button was already pressed, ignore new press if(gamepadapi.buttonscache[j] == button) { newpress = false; } } } } } return newpress; }, there are two types of action to consider for a button: a single press and a hold.
First input delay - MDN Web Docs Glossary: Definitions of Web-related terms
when they click a link, tap on a button, or use a custom, javascript-powered control) to the time when the browser is actually able to respond to that interaction.
... it is the length of time, in milliseconds, between the first user interaction on a web page and the browser’s response to that interaction.
... the time between when content is painted to the page and when all the functionality becomes responsive to human interaction often varies based on the the size and complexity of the javascript needing to be downloaded, parsed, and executed on the main thread, and on the device speed or lack thereof (think low end mobile devices).
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
active learning: a reaction game for the final section of this article, you'll create a 2-player reaction game.
... inside keyhandler(), the code includes the event object as a parameter (represented by e) — its key property contains the key that was just pressed, and you can use this to respond to specific key presses with specific actions.
... note: if you get stuck, check out our version of the reaction game (see the source code also).
JavaScript building blocks - Learn web development
guides making decisions in your code — conditionals in any programming language, code needs to make decisions and carry out actions accordingly depending on different inputs.
... introduction to events events are actions or occurrences that happen in the system you are programming, which the system tells you about so you can respond to them in some way if desired.
... for example if the user clicks a button on a webpage, you might want to respond to that action by displaying an information box.
Introduction to web APIs - Learn web development
every time you see a popup window appear on a page or some new content displayed, for example, that's the dom in action.
...tx = canvas.getcontext('2d'); anything that we want to do to the canvas is then achieved by calling properties and methods of the context object (which is an instance of canvasrenderingcontext2d), for example: ball.prototype.draw = function() { ctx.beginpath(); ctx.fillstyle = this.color; ctx.arc(this.x, this.y, this.size, 0, 2 * math.pi); ctx.fill(); }; note: you can see this code in action in our bouncing balls demo (see it running live also).
... 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).
Third-party APIs - Learn web development
requiring a key enables the api provider to hold users of the api accountable for their actions.
... when the developer has registered for a key, they are then known to the api provider, and action can be taken if they start to do anything malicious with the api (such as tracking people's location or trying to spam the api with loads of requests to stop it working, for example).
... the easiest action would be to just revoke their api privileges.
Basic math in JavaScript — numbers and operators - Learn web development
6 + 9 - subtraction subtracts the right number from the left.
...the most common are listed below: operator name purpose example shortcut for += addition assignment adds the value on the right to the variable value on the left, then returns the new variable value x += 4; x = x + 4; -= subtraction assignment subtracts the value on the right from the variable value on the left, and returns the new variable value x -= 3; x = x - 3; *= multiplication assignment multiplies the variable value on the left by the value on the right, and returns the new variable value x *= 3; x = x * 3; /= division assignment divides the variable value on the left by th...
... change the line that calculates y so the box is 150px high, but the 150 is calculated using three numbers and the subtraction and division operators.
Client-Server Overview - Learn web development
objective: to understand client-server interactions in a dynamic website, and in particular what operations need to be performed by server-side code.
... a method that defines the required action (for example, to get a file or to save or update some data).
... the different methods/verbs and their associated actions are listed below: get: get a specific resource (e.g.
Ember Interactivity: Footer functionality, conditional rendering - Learn web development
next, add the following action underneath the existing add(text) action: @action clearcompleted() { this.todos = this.incomplete; } this is rather nice for clearing the todos — we just need to set the todos array to equal the list of incomplete todos.
...t with this, which populates the incomplete number with the length of the incomplete array: <strong>{{this.todos.incomplete.length}}</strong> todos left next, replace this: <button type="button" class="clear-completed"> with this: <button type="button" class="clear-completed" {{on 'click' this.todos.clearcompleted}}> so now when the button is clicked, the clearcompleted() action we added earlier is run.
...ted todomvc/app/components/todo.js file and update the contents to look like so, to give the todo component access to the service: import component from '@glimmer/component'; import { inject as service } from '@ember/service'; export default class todocomponent extends component { @service('todo-data') todos; } next, go back again to our todo-data.js service file and add the following action just below the previous ones, which will allow us to toggle a completion state for each todo: @action togglecompletion(todo) { todo.iscompleted = !todo.iscompleted; } updating the template to show completed state finally, we will edit the todo.hbs template such that the checkbox's value is now bound to the iscompleted property on the todo, and so that on change, the togglecompletion()...
Adding a new todo form: Vue events, methods, and models - Learn web development
we'll use this to handle the submit action.
...to prevent the browser from posting to the server, we need to stop the event’s default action from bubbling up through the page (event.preventdefault(), in vanilla javascript).
... in this case, we need to use the .prevent handler to stop the browser’s default submit action.
Package management basics - Learn web development
you've already seen some in action, but lets look at the others.
... let’s review the common actions you’ll want to perform with package managers.
... installing dependencies npm install date-fns yarn add date-fns we also saw install in action above.
Eclipse CDT Manual Setup
(sadly, there is no auto-activation option to activate autocomplete suggestion., so as soon as you type any alphabetical character that may begin with a symbol name like there is in other ides.) select "c/c++ > editor > save actions" and deselect "ensure newline at the end of file".
...this prevents the (useless if not debugging) "searching for binaries" action from constantly interrupting everything.
...since such a non-parallel, full build would take a very long time, we're going to cheat and set eclipse's "build" action to run jwatt's just-print-mozilla-build.py script instead.
Error codes returned by Mozilla APIs
ns_error_abort (0x80004004) this error indicates that an operation failed and the caller should abort whatever action is being performed.
... ns_binding_failed (0x804b0001) ns_binding_aborted (0x804b0002) the asynchronous request failed because it was aborted by some user action.
... 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.
MathML Demo: <mo> - operator, fence, separator, or accent
fences that enclose fractions illustrate the symmetry issue as seen below.
...fixed sized fences are useful with nested fences as in the following example [ [ a b ] + [ b a ] ] + [ a b ] latex fences that are built into fractions (\binom, etc.) are not stretchy, but they are taller in displays.
...some examples of inline fractions ( 8 - 5 8 ) + [ 1 2 ] + ⌊ 1 2 2 ⌋ + ⌈ 1 x y x + 1 ⌉ + | e - 2 ⁢ π ⁢ t θ | with built in fences.
Introduction to NSPR
however, because of the multiple strategies to provide execution vehicles for threads on various host platforms, priorities are not a clearly defined abstraction in nspr.
...these systems can support local level thread abstractions that can be made preemptable, but run the risk of library corruption (libc).
... there is a subtle interaction between the thread(s) waiting on a condition and those notifying it.
An overview of NSS Internals
a cryptographic transaction, such as encryption or decryption related to a data exchange, usually involves working with the x.509 certs of your communication partners (peer).
...the usual follow up action is receiving a signed certificate from a ca.
...you must know which data you are expecting, and use the correct template for parsing, based on the context of your software's interaction.
Python binding for NSS
nss is built upon nspr because nspr provides an abstraction of common operating system services, particularly in the areas of networking and process management.
... python also provides an abstraction of common operating system services but because nss and nspr are tightly bound python-nss exposes elements of nspr.
...this documentation is available via the numerous python documentation extraction tools.
NSS tools : cmsutil
options and arguments options options specify an action.
... option arguments modify an action.
...arguments option arguments modify an action and are lowercase.
NSS tools : crlutil
options and arguments options options specify an action.
... option arguments modify an action.
... -g arguments option arguments modify an action and are lowercase.
NSS tools : cmsutil
MozillaProjectsNSStoolscmsutil
options and arguments options options specify an action.
... option arguments modify an action.
... arguments option arguments modify an action and are lowercase.
NSS tools : crlutil
MozillaProjectsNSStoolscrlutil
options and arguments options options specify an action.
... option arguments modify an action.
... -g arguments option arguments modify an action and are lowercase.
Necko Architecture
although the protocol handler creates channels, protocol interpretation doesn't begin until the user initiates the transaction using the nsichannel api.
...an nsistreamlistener is told when the uri transaction has "started," when data is available (in the case of reading data), and when it has "stopped." it is up to the nsistreamlistener implementation to decide what to do with these various notifications.
...the transaction is not complete until you receive an "stopped" notification.
Shell global objects
addpromisereactions(promise, onresolve, onreject) calls the js::addpromisereactions jsapi function with the given arguments.
...takes an optional options object which may contain the following properties: * nursery: bool, whether to allocate the object in the nursery setgccallback({action:"...", options...}) set the gc callback.
... action may be: minorgc run a nursery collection majorgc run a major collection, nesting up to a given depth getlcovinfo(global) generate lcov tracefile for the given compartment.
TPS Tab Lists
if specified, only used during verify actions.
...required for verify actions.
... for example: var tabs1 = [ { uri: "http://hg.mozilla.org/automation/crossweave/raw-file/2d9aca9585b6/pages/page1.html", title: "crossweave test page 1", profile: "profile1" }, { uri: "data:text/html,<html><head><title>hello</title></head><body>hello</body></html>", title: "hello", profile: "profile1" } ]; tab lists and phase actions tabs cannot be modified or deleted, only added or verified with the following functions: tabs.add - opens the specified tabs in the browser window.
An Overview of XPCOM
xpcom not only supports component software development, it also provides much of the functionality that a development platform provides, such as: component management file abstraction object message passing memory management we will 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.
... interfaces and encapsulation between component boundaries, abstraction is crucial for software maintainability and reusability.
...these services include a cross platform file abstraction which provides uniform and powerful access to files, directory services which maintain the location of application- and system-specific locations, memory management to ensure everyone uses the same memory allocator, and an event notification system that allows passing of simple messages.
Creating the Component Code
this object provides basic abstraction of the xpcom object itself.
...this interface provides yet another abstraction of the nsifactory object, and may allow for multiple nsifactory objects.
...this interface is xpcom's abstraction of files and directories.
nsIAccessibleEvent
event_defaction_change 0x000f 0x000c an object's default action has changed.
... event_action_change 0x0010 0x000d an object's action has changed.
... event_create 0x8000 event_destroy 0x8001 event_descriptionchange 0x800d event_parentchange 0x800f event_helpchange 0x8010 event_defactionchange 0x8011 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 0x000...
nsIEditor
rits from: nsisupports last changed in gecko 18.0 (firefox 18.0 / thunderbird 18.0 / seamonkey 2.15) method overview [noscript] void init(in nsidomdocument doc, in nsicontent aroot, in nsiselectioncontroller aselcon, in unsigned long aflags); void setattributeorequivalent(in nsidomelement element, in astring sourceattrname, in astring sourceattrvalue, in boolean asuppresstransaction); void removeattributeorequivalent(in nsidomelement element, in domstring sourceattrname, in boolean asuppresstransaction); void postcreate(); void predestroy(in boolean adestroyingframes); selected content removal void deleteselection(in short action, in short stripwrappers); document info and file methods void resetmodificationcou...
...nt(); long getmodificationcount(); void incrementmodificationcount(in long amodcount); void incrementmodificationcount(in long amodcount); transaction methods void dotransaction(in nsitransaction txn); void enableundo(in boolean enable); void undo(in unsigned long count); void canundo(out boolean isenabled, out boolean canundo); void redo(in unsigned long count); void canredo(out boolean isenabled, out boolean canredo); void begintransaction(); void endtransaction(); void beginplaceholdertransaction(in nsiatom name); void endplaceholdertransaction(); boolean shouldtxnsetselection(); void setshouldtxnsetselection(in boolean should); inline spellc...
...at do the same editorapi.outputtostring('text/xml', 2); // the body is not recognized, everything is printed void outputtostream(in nsioutputstream astream, in astring formattype, in acstring charsetoverride, in unsigned long flags); listener methods void addeditorobserver(in nsieditorobserver observer);obsolete since gecko 18 void seteditorobserver(in editactionlistener observer); void removeeditorobserver(in nsieditorobserver observer obsolete since gecko 18); void addeditactionlistener(in nsieditactionlistener listener); void removeeditactionlistener(in nsieditactionlistener listener); void adddocumentstatelistener(in nsidocumentstatelistener listener); void removedocumentstatelistener(in nsidocumentstatelis...
nsIEditorObserver
editor/idl/nsieditorobserver.idlscriptable used by applications wishing to be notified when the editor has completed a user action.
... 66 introduced gecko 1.0 obsolete gecko 18 inherits from: nsisupports last changed in gecko 1.7 method overview void editaction(); methods editaction() called after the editor completes a user action.
... void editaction(); parameters none.
nsILoginInfo
for logins obtained from html forms, this field is the action attribute from the form element, with the path removed (for example, "https://www.site.com").
... forms with no action attribute default to submitting to their origin url, so that is stored here.
... this field is null for logins attained from protocol authentications and "" means to match against any form action.
nsIMsgProtocolInfo
cangetincomingmessages boolean true if junk ui actions should be enabled for the account type.
... cangetmessages boolean true if "get messages" ui actions should be enabled for the account type.
... showcomposemsglink boolean true if compose ui actions should be enabled for the account type.
nsINavBookmarkObserver
onbeginupdatebatch() this method notifies this observer that a batch transaction has started.
...onendupdatebatch() this method notifies this observer that a batch transaction has ended.
...see nsinavbookmarksservice.transaction constants for a list of possible values.
nsIObserver
void observe( in nsisupports asubject, in string atopic, in wstring adata ); parameters asubject in general reflects the object whose change or action is being observed.
... atopic indicates the specific change or action.
... adata an optional parameter or other auxiliary data further describing the change or action.
nsISpeculativeConnect
method overview void speculativeconnect(in nsiuri auri, in nsiinterfacerequestor acallbacks, in nsieventtarget atarget); methods speculativeconnect() call this method to hint to the networking layer that 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.
...void speculativeconnect( in nsiuri auri, in nsiinterfacerequestor acallbacks, in nsieventtarget atarget ); parameters auri the uri of the hinted transaction.
nsIWebContentHandlerRegistrar
cu.import('resource://gre/modules/services.jsm'); var nsiwchr = cc["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"] .getservice(ci.nsiwebcontenthandlerregistrar); var htmlcontentwindow = undefined; var registeruri = 'http://mail.live.com/secure/start?action=compose&to=%s'; var myurihostname = services.io.newuri(registeruri, null, null).host; // this section here is long and daunting, but its just finding a suitable contentwindow var domwindows = services.wm.getenumerator(null); while (domwindows.hasmoreelements()) { var adomwindow = domwindows.getnext(); if (adomwindow.gbrowser) { if (adomwindow.gbrowser.tabcontainer) { ...
... permission denied to add http://mail.live.com/secure/start?action=compose&to=%s as a content or protocol handler'permission denied to add http://mail.live.com/secure/start?action=compose&to=%s as a content or protocol handler' when calling method: [nsiwebcontenthandlerregistrar::registerprotocolhandler] if the host names do match then a confirmation like this will be seen: this domain check can be bypassed by setting the preference of gecko.handlerservice.
...f('gecko.handlerservice.allowregisterfromdifferenthost', true); } var htmlcontentwindow = services.wm.getmostrecentwindow('navigator:browser'); //because we set the preference to true above, we need any window that has a browser, just pass the domwindow and the registerprotocolhandler will get the contentwindow from it nsiwchr.registerprotocolhandler("mailto", "http://mail.live.com/secure/start?action=compose&to=%s", "outlook.com live mail", htmlcontentwindow); if (!allowregisterfromdifferenthost) { //it this variable is false, than we had set the pref to true obviously.
nsIXULTemplateQueryProcessor
the member variable may be specified in a similar way using the "member" attribute, or it may be specified in the first <action> body in the template as the value of a uri attribute on an element.
... a breadth-first search of the first action is performed to find this element.
...the member variable is determined from the member attribute on the template, or from the uri in the first action's rule if that attribute is not present.
Index
38 mailnews filters mailnews, thunderbird mailnews filters consist of a set of search terms, and a set of filter actions.
...while xul provides the elements of the user interface, actions are written in javascript.
... 102 detect opening folder thunderbird some actions require execution every time you open a folder (for example, registering a custom column handler.
Introduction to DOM Inspector - Firefox Developer Tools
if you find that the browser pane takes up too much space, you may close it, but you will not be able to observe any of the visual consequences of your actions.
... basic actions of the dom nodes viewer selecting elements by click another powerful interactive feature of the dom inspector is that when you have the dom inspector open and have enabled this functionality by choosing edit > select element by click or by clicking the little magnifying glass icon in the upper left portion of the dom inspector application, you can click anywhere in a loaded web page or the the...
...you can perform actions on the individual items in this list from the context menu and the edit menu, both of which contain menutimes that allow you edit the values of those attributes.
Document: copy event - Web APIs
the copy event fires when the user initiates a copy action through the browser's user interface.
... bubbles yes cancelable yes interface clipboardevent event handler property oncopy the original target for this event is the element that was the intended target of the copy action.
... examples document.addeventlistener('copy', (event) => { console.log('copy action initiated') }); specifications specification status clipboard api and events working draft ...
Document: cut event - Web APIs
the cut event is fired when the user has initiated a "cut" action through the browser's user interface.
... bubbles yes cancelable yes interface clipboardevent event handler property oncut the original target for this event is the element that was the intended target of the cut action.
... examples document.addeventlistener('cut', (event) => { console.log('cut action initiated') }); specifications specification status clipboard api and events working draft ...
Document: paste event - Web APIs
the paste event is fired when the user has initiated a "paste" action through the browser's user interface.
... bubbles yes cancelable yes interface clipboardevent event handler property onpaste the original target for this event is the element that was the intended target of the paste action.
... examples document.addeventlistener('paste', (event) => { console.log('paste action initiated') }); specifications specification status clipboard api and events working draft ...
Document - Web APIs
WebAPIDocument
clipboard events copy fired when the user initiates a copy action through the browser's user interface.
... cut fired when the user initiates a cut action through the browser's user interface.
... paste fired when the user initiates a paste action through the browser's user interface.
DragEvent - Web APIs
WebAPIDragEvent
the dragevent interface is a dom event that represents a drag and drop interaction.
...applications are free to interpret a drag and drop interaction in an application-specific way.
... properties dragevent.datatransfer read only the data that is transferred during a drag and drop interaction.
Element: auxclick event - Web APIs
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.
...you also can see the two functions in action by trying the demo out with a multi-button mouse (see it live on github; also see the source code).
Element: copy event - Web APIs
the copy event fires when the user initiates a copy action through the browser's user interface.
... bubbles yes cancelable yes interface clipboardevent event handler property oncopy the event's default action is to copy the selection (if any) to the clipboard.
... a handler for this event can modify the clipboard contents by calling setdata(format, data) on the event's clipboardevent.clipboarddata property, and cancelling the event's default action using event.preventdefault().
Element: paste event - Web APIs
the paste event is fired when the user has initiated a "paste" action through the browser's user interface.
... bubbles yes cancelable yes interface clipboardevent event handler property onpaste if the cursor is in an editable context (for example, in a <textarea> or an element with contenteditable attribute set to true) then the default action is to insert the contents of the clipboard into the document at the cursor position.
... to override the default behavior (for example to insert some different data or a transformation of the clipboard contents) an event handler must cancel the default action using event.preventdefault(), and then insert its desired data manually.
Event.preventDefault() - Web APIs
the event interface's preventdefault() method tells the user agent that if the event does not get explicitly handled, its default action should not be taken as it normally would be.
... syntax event.preventdefault(); examples blocking default click handling toggling a checkbox is the default action of clicking on a checkbox.
...ut); } else { // insert warningbox after mytextbox mytextbox.parentnode.insertbefore(warningbox, mytextbox.nextsibling); } warningtimeout = window.settimeout(function() { warningbox.parentnode.removechild(warningbox); warningtimeout = -1; }, 2000); } result notes calling preventdefault() during any stage of event flow cancels the event, meaning that any default action normally taken by the implementation as a result of the event will not occur.
Event.returnValue - Web APIs
WebAPIEventreturnValue
the event property returnvalue indicates whether the default action for this event has been prevented or not.
... it is set to true by default, allowing the default action to occur.
... setting this property to false prevents the default action.
HTMLButtonElement - Web APIs
htmlbuttonelement.formaction is a domstring reflecting the uri of a resource that processes information submitted by the button.
... if specified, this attribute overrides the action attribute of the <form> element that owns this element.
... the following attributes have been added: autofocus, formaction, formenctype, formmethod, formnovalidate, formtarget, labels, validity, validationmessage, and willvalidate.
HTMLDialogElement - Web APIs
htmldialogelement.open a boolean reflecting the open html attribute, indicating whether the dialog is available for interaction.
...still allowing interaction with content outside of the dialog.
...interaction outside the dialog is blocked.
IDBCursor.advance() - Web APIs
WebAPIIDBCursoradvance
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbcursor's transaction is inactive.
... example in this simple fragment we create a transaction, retrieve an object store, then use a cursor to iterate through the records in the object store.
...for a complete working example, see our idbcursor example (view example live.) function advanceresult() { list.innerhtml = ''; var transaction = db.transaction(['rushalbumlist'], "readonly"); var objectstore = transaction.objectstore('rushalbumlist'); objectstore.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.albumtitle + '</strong>, ' + cursor.value.year; list.appendchild(...
IDBCursor.continue() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbcursor's transaction is inactive.
... 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.
...for a complete working example, see our idbcursor example (view example live.) function displaydata() { var transaction = db.transaction(['rushalbumlist'], "readonly"); var objectstore = transaction.objectstore('rushalbumlist'); objectstore.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = cursor.value.albumtitle + ', ' + cursor.value.year; list.appendchild(listitem); cursor.continue(); } else { console.log('entrie...
IDBCursor - Web APIs
WebAPIIDBCursor
this function never returns null or throws an exception, even if the cursor is currently being iterated, has iterated past its end, or its transaction is not active.
... examples 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.
...for a complete working example, see our idbcursor example (view example live.) function displaydata() { var transaction = db.transaction(['rushalbumlist'], "readonly"); var objectstore = transaction.objectstore('rushalbumlist'); objectstore.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = cursor.value.albumtitle + ', ' + cursor.value.year; list.appendchild(listitem); cursor.continue(); } else { console.log('entrie...
IDBDatabase.close() - Web APIs
WebAPIIDBDatabaseclose
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.
IDBDatabase.createObjectStore() - Web APIs
this method can be called only within a versionchange transaction.
... exceptions this method may raise a domexception with a domerror of one of the following types: exception description invalidstateerror occurs if the method was not called from a versionchange transaction callback.
... transactioninactiveerror occurs if a request is made on a source database that doesn't exist (e.g.
IDBDatabase.deleteObjectStore() - Web APIs
as with idbdatabase.createobjectstore, this method can be called only within a versionchange transaction.
... exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror occurs if the method was not called from a versionchange transaction callback.
... transactioninactiveerror occurs if a request is made on a source database that doesn't exist (e.g.
IDBIndex.count() - Web APIs
WebAPIIDBIndexcount
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive.
... example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database.
...for a complete working example, see our idbindex-example 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 tabler...
IDBIndex.get() - Web APIs
WebAPIIDBIndexget
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive.
... example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database.
...for a complete working example, see our idbindex-example 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 tabler...
IDBIndex.getKey() - Web APIs
WebAPIIDBIndexgetKey
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive.
... example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database.
...for a complete working example, see our idbindex-example 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 getkeyrequest = myindex.getkey('bungle'); getkeyrequest.onsuccess = function() { console.log(getkeyrequest.result); } myindex.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { ...
IDBIndex.objectStore - Web APIs
example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database.
... the current object store is logged to the console: it should be returned something like this: idbobjectstore { name: "contactslist", keypath: "id", indexnames: domstringlist[7], transaction: idbtransaction, autoincrement: false } finally, we iterate through each record, and insert the data into an html table.
... for a complete working example, see our idbindex-example 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'); console.log(myindex.objectstore); 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 + '</td>' ...
IDBIndex.openCursor() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive.
... example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database.
...for a complete working example, see our idbindex-example 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'); myindex.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tablerow = document.createelement('tr'); tablerow.innerhtml = '<td>' + cursor.value.id + '</td>' ...
IDBIndex.openKeyCursor() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive.
... example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database.
... function displaydatabyindex() { tableentry.innerhtml = ''; var transaction = db.transaction(['contactslist'], 'readonly'); var objectstore = transaction.objectstore('contactslist'); var myindex = objectstore.index('lname'); myindex.openkeycursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tablerow = document.createelement('tr'); tablerow.innerhtml = '<td>' + cursor.key + '</td>' ...
IDBObjectStore.autoIncrement - Web APIs
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().
... // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready to insert into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december", year: 2013, notified: "no" } ]; // 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.autoincrement); // make a request to add our newitem object to the object store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment indexed database api 2.0the definition of 'autoincrement' in that specification.
IDBObjectStore.count() - Web APIs
transactioninactiveerror this idbobjectstore's transaction is inactive.
... example in this simple fragment we create a transaction, retrieve an object store, then count the number of records in the store using count() — when the success handler fires, we log the count value (an integer) to the console.
... var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); var countrequest = objectstore.count(); countrequest.onsuccess = function() { console.log(countrequest.result); } specification specification status comment indexed database api 2.0the definition of 'count()' in that specification.
IDBObjectStore.createIndex() - Web APIs
note that this method must be called only from a versionchange transaction mode callback.
... invalidstateerror occurs if either: the method was not called from a versionchange transaction mode callback, i.e.
... transactioninactiveerror occurs if the transaction this idbobjectstore belongs to is not active (e.g.
IDBObjectStore.deleteIndex() - Web APIs
note that this method must be called only from a versionchange transaction mode callback.
... return value undefined exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror occurs if the method was not called from a versionchange transaction mode callback.
... transactioninactiveerror occurs if the transaction this idbobjectstore belongs to is not active (e.g.
IDBObjectStore.index() - Web APIs
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.
... example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database.
...for a complete working example, see our idbindex-example 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'); myindex.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tablerow = document.createelement('tr'); tablerow.innerhtml = '<td>' + cursor.value.id + '</td>' ...
IDBObjectStore.indexNames - Web APIs
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().
... // this is used a lot below db = this.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready to insert into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december", year: 2013, notified: "no" } ]; // 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 success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment indexed database api 2.0the definition of 'indexnames' in that specification.
IDBObjectStore.keyPath - Web APIs
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().
... // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready to insert into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december", year: 2013, notified: "no" } ]; // 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.keypath); // make a request to add our newitem object to the object store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment indexed database api 2.0the definition of 'keypath' in that specification.
IDBVersionChangeEvent - Web APIs
deprecated properties idbversionchangeevent.version read only the new version of the database in a versionchange transaction.
...// 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 data...
...this is used a lot later on, for opening transactions and suchlike.
Timing element visibility with the Intersection Observer API - Web APIs
we'll be using css grid to style and lay out the site, so we can be pretty straightforward here: <div class="wrapper"> <header> <h1>a fake blog</h1> <h2>showing intersection observer in action!</h2> </header> <aside> <nav> <ul> <li><a href="#link1">a link</a></li> <li><a href="#link2">another link</a></li> <li><a href="#link3">one more link</a></li> </ul> </nav> </aside> <main> </main> </div> this is the framework for the entire site.
... handling periodic actions our interval handler, handlerefreshinterval(), is called about once per second courtesy of the call to setinterval() made in the startup() function described above.
... updating an ad's visibility timer previously (see handling document visibility changes and handling periodic actions), we've seen that when we need to update an ad's "total visible time" counter, we call a function named updateadtimer() to do so.
MSManipulationEvent.initMSManipulationEvent() - Web APIs
cancelablearg [in] type: boolean indicates whether the event’s default action can be prevented.
... when true, the default action can be canceled.
... when false, the default action cannot be canceled.
NotificationEvent - Web APIs
notificationevent.action read only returns the string id of the notification button the user clicked.
... this value returns an empty string if the user clicked the notification somewhere other than an action button, or the notification does not have a button.
... samsung internet android full support 4.0action experimentalchrome full support 48edge full support ≤18firefox full support 44notes full support 44notes notes extended support releases (esr) before firefox 78 esr do not support service workers and the push api.ie ...
PaymentRequest.show() - Web APIs
it may only be called while handling events that represent user interactions, such as click, keyup, or the like.
... securityerror the promise rejects with a securityerror if the call to show() was not in response to a user action, such as a click or keyup event.
...the show() method returns a promise that resolves to a paymentresponse object when the user interaction is complete.
PaymentRequest - Web APIs
additionally, in some browsers, the parts of the address will be redacted for privacy until the user indicates they are ready to complete the transaction (i.e., they hit "pay").
... paymentrequest.shippingtype read only secure context returns the type of shipping used to fulfill the transaction.
... paymentrequest.show() secure context causes the user agent to begin the user interaction for the payment request.
Payment Request API - Web APIs
to request a payment, a web page creates a paymentrequest object in response to a user action that initiates a payment, such as clicking a "purchase" button.
... the paymentrequest allows the web page to exchange information with the user agent while the user provides input to complete the transaction.
... paymentrequestupdateevent enables the web page to update the details of the payment request in response to a user action.
Pinch zoom gestures - Web APIs
function pointerdown_handler(ev) { // the pointerdown event signals the start of a touch interaction.
... 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.
... <body onload="init();" style="touch-action:none"> <div id="target">touch and hold with 2 pointers, then pinch in or out.<br/> the background color will change to pink if the pinch is opening (zoom in) or changes to lightblue if the pinch is closing (zoom out).</div> <!-- ui for logging/debugging --> <button id="log" onclick="enablelog(event);">start/stop event logging</button> <button id="clearlog" onclick="clearlog(event);">clear the log</button> <p></p> <output></output> </body> miscellaneous functions these functions support the application but aren't directly involved in the event flow.
Web Push API Notifications best practices - Web APIs
in addition to the question of whether a push notification is required at all, there are many different types of push notifications, ranging from casual-and-disappearing to persistent-and-requiring-interaction.
... we caution you to use the interaction-requiring ones very sparingly, since they can be the most annoying.
... [1] in the case of firefox, see bug 1524619, in which we find that firefox 68 implements this, disabled by default, behind the preference dom.webnotifications.requireuserinteraction.
RTCIceCandidate.usernameFragment - Web APIs
the read-only usernamefragment property on the rtcicecandidate interface is a string indicating the username fragment ("ufrag") that uniquely identifies a single ice interaction session.
... syntax var ufrag = rtcicecandidate.usernamefragment; value a domstring containing the username fragment (usually referred to in shorthand as "ufrag" or "ice-ufrag") that, along with the ice password ("ice-pwd"), uniquely identifies a single ongoing ice interaction, including for any communication with the stun server.
...this avoids crosstalk among multiple ongoing ice sessions, but, more importantly, helps secure ice transactions (and all of webrtc by extension) against attacks that might try to inject themselves into an ice exchange.
SVGGraphicsElement: copy event - Web APIs
the copy event fires on svggraphicselements when the user initiates a copy action through the browser's user interface.
... bubbles yes cancelable yes interface clipboardevent event handler property oncopy the event's default action is to copy the selection (if any) to the clipboard.
... a handler for this event can modify the clipboard contents by calling setdata(format, data) on the event's clipboardevent.clipboarddata property, and cancelling the event's default action using event.preventdefault().
SVGGraphicsElement: paste event - Web APIs
the paste event is fired on an svggraphicselement when the user has initiated a "paste" action through the browser's user interface.
... bubbles yes cancelable yes interface clipboardevent event handler property onpaste if the cursor is in an editable context (for example, in a <textarea> or an element with contenteditable attribute set to true) then the default action is to insert the contents of the clipboard into the document at the cursor position.
... to override the default behavior (for example to insert some different data or a transformation of the clipboard contents) an event handler must cancel the default action using event.preventdefault(), and then insert its desired data manually.
Clearing by clicking - Web APIs
« previousnext » this example demonstrates how to combine user interaction with webgl graphics operations by clearing the rendering context with a random color when the user clicks.
... clearing the rendering context with random colors this example provides a simple illustration of how to combine webgl and user interaction.
... <p>a very simple webgl program that still shows some color and user interaction.</p> <p>you can repeatedly click the empty canvas or the button below to change color.</p> <canvas id="canvas-view">your browser does not seem to support html5 canvas.</canvas> <button id="color-switcher">press here to switch color</button> body { text-align : center; } canvas { display : block; width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } button { display : inline-block; font-size : inherit; margin : auto; padding : 0.6em; } window.
WebGL constants - Web APIs
func_subtract 0x800a passed to blendequation or blendequationseparate to specify a subtraction blend function (source - destination).
... func_reverse_subtract 0x800b passed to blendequation or blendequationseparate to specify a reverse subtraction blend function (destination - source).
... stencil actions constants passed to webglrenderingcontext.stencilop().
Web Authentication API - Web APIs
figure 1 - a diagram showing the sequence of actions for a web authentication registration and the essential data associated with each action.
...the authentication flow looks similar to the registration flow, and the illustration of actions in figure 2 may be recognizable as being similar to the illustration of registration actions in figure 1.
... figure 2 - similar to figure 1, a diagram showing the sequence of actions for a web authentication and the essential data associated with each action.
Using Web Workers - Web APIs
the event doesn't bubble and is cancelable; to prevent the default action from taking place, the worker can call the error event's preventdefault() method.
...they are intended to (amongst other things) enable the creation of effective offline experiences, intercepting network requests and taking appropriate action based on whether the network is available and updated assets reside on the server.
...you have to do it indirectly, by sending a message back to the main script via dedicatedworkerglobalscope.postmessage, then actioning the changes from there.
Window: copy event - Web APIs
WebAPIWindowcopy event
the copy event fires when the user initiates a copy action through the browser's user interface.
... bubbles yes cancelable yes interface clipboardevent event handler property oncopy the original target for this event is the element that was the intended target of the copy action.
... examples window.addeventlistener('copy', (event) => { console.log('copy action initiated') }); specifications specification status clipboard api and events working draft ...
Window: cut event - Web APIs
WebAPIWindowcut event
the cut event is fired when the user has initiated a "cut" action through the browser's user interface.
... bubbles yes cancelable yes interface clipboardevent event handler property oncut the original target for this event is the element that was the intended target of the cut action.
... examples window.addeventlistener('cut', (event) => { console.log('cut action initiated') }); specifications specification status clipboard api and events working draft ...
Window: paste event - Web APIs
the paste event is fired when the user has initiated a "paste" action through the browser's user interface.
... bubbles yes cancelable yes interface clipboardevent event handler property onpaste the original target for this event is the element that was the intended target of the paste action.
... examples window.addeventlistener('paste', (event) => { console.log('paste action initiated') }); specifications specification status clipboard api and events working draft ...
Window - Web APIs
WebAPIWindow
copy fired when the user initiates a copy action through the browser's user interface.
... cut fired when the user initiates a cut action through the browser's user interface.
... paste fired when the user initiates a paste action through the browser's user interface.
WindowOrWorkerGlobalScope.setInterval() - Web APIs
pellentesque a nisl eu sem vehicula egestas.</p> </div> </body> </html> view this demo in action.
...following is a minimal example of such an abstraction.
...'hidden' : 'visible'; } } var fadeinout = new minidaemon(document.getelementbyid('sample_div'), opacity, 300, 8); </script> </body> </html> view this example in action usage notes the setinterval() function is commonly used to set a delay for functions that are executed again and again, such as animations.
WritableStreamDefaultController.error() - Web APIs
the error() method of the writablestreamdefaultcontroller interface causes any future interactions with the associated stream to error.
...however, it can be useful for suddenly shutting down a stream in response to an event outside the normal lifecycle of interactions with the underlying sink.
... syntax writablestreamdefaultcontroller.error(e); parameters e a domstring representing the error you want future interactions to fail with.
XRSession.onselect - Web APIs
the onselect property of the xrsession object is the event handler for the select event, which is dispatched when a primary action is completed successfully by the user.
... the select event is sent after tracking of the primary action begins, as announced by the selectstart event, and immediately before the tracking of the primary action ends, which is announced by the selectend event.
... to learn more about how webxr actions work, see inputs and input sources.
XRSession.onsqueeze - Web APIs
the xrsession interface's onsqueeze event handler property can be set to a function which is then invoked to handle the squeeze event that's sent when the user successfully completes a primary squeeze action on a webxr input device.
... these actions represent the user squeezing or gripping an object or controller.
... xrsession.onsqueeze = event => { if (event.inputsource.handedness != user.handedness) { handleoffhandsqueeze(event.inputsource, event.frame); } }; finishing an ongoing squeeze action this example exapnds somewhat on the previous example by demonstrating a way to implement the ability for the user to drop an object that was previously picked up by the user..
XRSession: select event - Web APIs
the webxr event select is sent to an xrsession when one of the session's input sources has completed a primary action.
... examples of comon kinds of primary action are users pressing triggers or buttons, tapping a touchpad, speaking a command, or performing a recognizable gesture when using a video tracking system or handheld controller with an accelerometer.
... bubbles yes cancelable no interface xrinputsourceevent event handler property onselect for details on how the selectstart, select, and selectend events work, and how you should react to them, see primary actions in inputs and input sources.
Web APIs
WebAPI
changeevent 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 keyframeeffect keyframeeffectoptions ...
...nfiguration mediadeviceinfo mediadevices mediaelementaudiosourcenode mediaencodingconfiguration mediaerror mediaimage mediakeymessageevent mediakeysession mediakeystatusmap mediakeysystemaccess mediakeysystemconfiguration mediakeys medialist mediametadata mediapositionstate mediaquerylist mediaquerylistevent mediaquerylistlistener mediarecorder mediarecordererrorevent mediasession mediasessionactiondetails mediasettingsrange mediasource mediastream mediastreamaudiodestinationnode mediastreamaudiosourcenode mediastreamaudiosourceoptions mediastreamconstraints mediastreamevent mediastreamtrack mediastreamtrackaudiosourcenode mediastreamtrackaudiosourceoptions mediastreamtrackevent mediatrackconstraints mediatracksettings mediatracksupportedconstraints merchantvalidationevent messagechann...
...nobserver mutationobserverinit mutationrecord n ndefmessage ndefreader ndefreadingevent ndefrecord ndefwriter namelist namednodemap navigationpreloadmanager navigator navigatorconcurrenthardware navigatorid navigatorlanguage navigatoronline navigatorplugins navigatorstorage networkinformation node nodefilter nodeiterator nodelist nondocumenttypechildnode notation notification notificationaction notificationevent notifyaudioavailableevent o oes_element_index_uint oes_fbo_render_mipmap oes_standard_derivatives oes_texture_float oes_texture_float_linear oes_texture_half_float oes_texture_half_float_linear oes_vertex_array_object ovr_multiview2 offlineaudiocompletionevent offlineaudiocontext offscreencanvas orientationsensor oscillatornode overconstrainederror p pagetransitioneven...
ARIA: timer role - Accessibility
keyboard interactions keyboard interaction is xxx.
...set in response to keyboard or other application events that change focus or point of interaction.
...all aspects of interaction, including returning to the regular web content on other parts of the page, must be handled.
ARIA: document role - Accessibility
keyboard interactions the element should be made focusable by setting the tabindex="0" attribute / value pair on it.
...when in gmail, most user agent interactions are usurped by the application.
...once focus returns to the message list either by activating the back button or pressing an asociated keystroke, direct application interaction mode is invoked again, and the user can move to a different conversation in the list with the arrow keys.
ARIA: listbox role - Accessibility
(for further details and a full list of aria states and properties see the aria listbox (role) documentation.) keyboard interactions when a single-select listbox receives focus: if none of the options are selected before the listbox receives focus, the first option receives focus.
... multiple selection: authors may implement either of two interaction models to support multiple selection: a recommended model that does not require the user to hold a modifier key, such as shift or control, while navigating the list or an alternative model that does require modifier keys to be held while navigating in order to avoid losing selection states.
...the <select> element with descendant <option> elements handles all the needed interactions natively.
Web applications and ARIA FAQ - Accessibility
user interface library (yui) for more information about javascript toolkit accessibility: steve faulkner's wai-aria implementation in javascript ui libraries can you show me an example of aria in action?
...instead, use javascript to dynamically add aria to your page, as shown in the answer to can you show me an example of aria in action?
... 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.
Accessibility: What users can do to browse more safely - Accessibility
taking advantage of personalization settings can help prevent exposure to content leading to seizures and / or other physical reactions.
... use reader mode on browsers enable content blockers; gets rid of ads, reduces and/or removes distractions enables text-to-speech in certain browsers, enable fonts by choice enable page zoom turn off animated gifs in the browser browsers offer much power to their users; it's just a matter of knowing where to go.
...grayscale is enabled when the color filters button is toggled "on" see also accessibilty accessibility learning path web accessibility for seizures and physical reactions color blindness discussion: "what is the “grayscale” setting for in accessibility options?" contributors many, many thanks to eric eggert from knowbility; for his discussions and huge help on this topic.
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
get_accdefaultaction: get a description or name of the default action for this component, such as "jump" for links.
... accdodefaultaction: perform the action described by get_accdefaultaction.
... selection] event_object_selectionwithin [important for multiple selection] event_object_statechange [important for checkboxes and radio buttons] event_object_locationchange event_object_namechange event_object_descriptionchange event_object_valuechange [important for sliders and progress meters] event_object_parentchange event_object_helpchange event_object_defactionchange event_object_acceleratorchange msaa states cheat sheet for information on what each state does, see the msdn state constants page.
Linear-gradient Generator - CSS: Cascading Style Sheets
ve', callback); document.removeeventlistener('mouseup', up); endfunc(e); }); }); elem.addeventlistener('click', function(e) { e.stoppropagation(); }); } var color = uicolorpicker.color; var hsvcolor = uicolorpicker.hsvcolor; var uicomponent = (function uicomponent() { function makeresizable(elem, axis, callback, endfunc) { var valuex = 0; var valuey = 0; var action = 0; var callback = typeof callback === "function" ?
...(e) { e.stoppropagation(); e.preventdefault(); if (e.button !== 0) return; valuex = e.clientx - elem.clientwidth; valuey = e.clienty - elem.clientheight; document.body.setattribute('data-resize', axis); document.addeventlistener('mousemove', mousemove); document.addeventlistener('mouseup', resizeend); }; var mousemove = function mousemove(e) { if (action >= 0) elem.style.width = e.clientx - valuex + 'px'; if (action <= 0) elem.style.height = e.clienty - valuey + 'px'; if (callback) callback(); }; var resizeend = function resizeend(e) { if (e.button !== 0) return; document.body.removeattribute('data-resize', axis); document.removeeventlistener('mousemove', mousemove); document.removeeventlistener...
...('mouseup', resizeend); endfunc(); }; var handle = document.createelement('div'); handle.classname = 'resize-handle'; if (axis === 'width') action = 1; else if (axis === 'height') action = -1; else axis = 'both'; handle.classname = 'resize-handle'; handle.setattribute('data-resize', axis); handle.addeventlistener('mousedown', resizestart); elem.appendchild(handle); }; return { makeresizable : makeresizable }; })(); /** * gradient point */ var gradientpoint = function gradientpoint(axis) { var point = document.createelement('div'); point.classname = 'gradient-point'; this.position = 0; this.node = point; this.axis = axis; this.color = new hsvcolor(0, 0, 100); this.csscolor = this.color.getcolor(); this.cssposition = 0; th...
clamp() - CSS: Cascading Style Sheets
WebCSSclamp
as math expressions, so you can use addition, subtraction, multiplication and division without using the calc() function itself.
...the expressions are full math expressions, so you can use direct addition, subtraction, multiplication and division without using the calc() function itself.
... the expression can be values combining the addition ( + ), subtraction ( - ), multiplication ( * ) and division ( / ) operators, using standard operator precedence rules.
<number> - CSS: Cascading Style Sheets
WebCSSnumber
the <number> css data type represents a number, being either an integer or a number with a fractional component.
...a fractional value is represented by a .
...4.01 positive fraction -456.8 negative fraction 0.0 zero +0.0 zero, with a leading + -0.0 zero, with a leading - .60 fractional number without a leading zero 10e3 scientific notation -3.4e-2 complicated scientific notation invalid numbers 12.
Event developer guide - Developer guides
WebGuideEvents
the user interaction with the web page contents can trigger events.
... the events triggered by user interaction evolved during the early years of browser design and include a complicated system defining the sequence in which events will be called and the manner in which that sequence can be controlled.
... the different types of user interaction-driven events include: the original 'click' event, mouse events, mouse gesture events, and both touch events and the earlier mozilla experimental touch events, now deprecated.
HTML attribute reference - HTML: Hypertext Markup Language
action <form> the uri of a program that processes the information submitted via the form.
... enterkeyhint <textarea>, contenteditable the enterkeyhint specifies what action label (or icon) to present for the enter key on virtual keyboards.
... formaction <input>, <button> indicates the action of the element, overriding the action defined in the <form>.
<form> - HTML: Hypertext Markup Language
WebHTMLElementform
action the url that processes the form submission.
... this value can be overridden by a formaction attribute on a <button>, <input type="submit">, or <input type="image"> element.
... get: the get method; form data appended to the action url with a ?
<input type="url"> - HTML: Hypertext Markup Language
WebHTMLElementinputurl
mozactionhint a string indicating the type of action that will be taken when the user presses the enter or return key while editing the field; this is used to determine an appropriate label for that key on a virtual keyboard.
... mozactionhint a mozilla extension, supported by firefox for android, which provides a hint as to what sort of action will be taken if the user presses the enter or return key while editing the field.
...you must verify the url on the server-side of any transaction in which the provided text may have any security implications of any kind.
<menu> - HTML: Hypertext Markup Language
WebHTMLElementmenu
toolbar: indicates the toolbar state, which represents a toolbar consisting of a series of commands for user interaction.
... examples context menu html <!-- a <div> element with a context menu --> <div contextmenu="popup-menu"> right-click to see the adjusted context menu </div> <menu type="context" id="popup-menu"> <menuitem>action</menuitem> <menuitem>another action</menuitem> <hr/> <menuitem>separated action</menuitem> </menu> css div { width: 300px; height: 80px; background-color: lightgreen; } result menu button menu buttons haven't been implemented in any known browsers yet.
...--> <button type="menu" menu="popup-menu"> dropdown </button> <menu type="context" id="popup-menu"> <menuitem>action</menuitem> <menuitem>another action</menuitem> <hr/> <menuitem>separated action</menuitem> </menu> result toolbar toolbar menus haven't been implemented in any known browsers yet.
HTML documentation index - HTML: Hypertext Markup Language
WebHTMLIndex
123 <input type="datetime"> element, html, html forms, input, input element, input type, obsolete, reference, datetime the html <input type="datetime"> was a control for entering a date and time (hour, minute, second, and fraction of a second) as well as a timezone.
... 160 <meter>: the html meter element element, html, html forms, html5, reference, web the html <meter> element represents either a scalar value within a known range or a fractional value.
... 172 <output>: the output element element, html, html forms, html5, html:flow content, reference, web the html output element (<output>) is a container element into which a site or app can inject the results of a calculation or the outcome of a user action.
Content-Location - HTTP
indicating the url of a transaction's result say you have a <form> for sending money to another user of a site.
... <form action="/send-payment" method="post"> <p> <label>who do you want to send the money to?
... <input type="number" name="amount"> </label> </p> <button type="submit">send money</button> </form> when the form is submitted, the site generates a receipt for the transaction.
Content-Security-Policy - HTTP
form-action restricts the urls which can be used as the target of a form submissions from a given context.
... 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.
... content security policy level 2 recommendation adds base-uri, child-src, form-action, frame-ancestors, plugin-types, referrer, and report-uri.
Index - HTTP
WebHTTPHeadersIndex
21 connection http, headers, reference, web the connection general header controls whether or not the network connection stays open after the current transaction finishes.
... 35 csp: form-action csp, directive, http, security the http content-security-policy (csp) form-action directive restricts the urls which can be used as the target of a form submissions from a given context.
...it applies restrictions to a page's actions including preventing popups, preventing the execution of plugins and scripts, and enforcing a same-origin policy.
DELETE - HTTP
WebHTTPMethodsDELETE
body may successful response has body may safe no idempotent yes cacheable no allowed in html forms no syntax delete /file.html http/1.1 example request delete /file.html http/1.1 responses if a delete method is successfully applied, there are several response status codes possible: a 202 (accepted) status code if the action will likely succeed but has not yet been enacted.
... a 204 (no content) status code if the action has been enacted and no further information is to be supplied.
... a 200 (ok) status code if the action has been enacted and the response message includes a representation describing the status.
A re-introduction to JavaScript (JS tutorial) - JavaScript
the standard arithmetic operators are supported, including addition, subtraction, modulus (or remainder) arithmetic, and so forth.
...'yes' : 'no'; the switch statement can be used for multiple branches based on a number or string: switch (action) { case 'draw': drawit(); break; case 'eat': eatit(); break; default: donothing(); } if you don't add a break statement, execution will "fall through" to the next level.
... closures this leads us to one of the most powerful abstractions that javascript has to offer — but also the most potentially confusing.
Using Promises - JavaScript
a catch, which is useful to accomplish new actions even after an action failed in the chain.
...by adding a handler for the unhandledrejection event, like this: window.addeventlistener("unhandledrejection", event => { /* you might start here by adding code to examine the promise specified by event.promise and the reason in event.reason */ event.preventdefault(); }, false); by calling the event's preventdefault() method, you tell the javascript runtime not to do its default action when rejected promises go unhandled.
... that default action usually involves logging the error to console, and this is indeed the case for node.
BigInt - JavaScript
however, since these are bigints and not bigdecimals, this operation will round towards 0 (which is to say, it will not return any fractional digits).
... an operation with a fractional result will be truncated when used with a bigint.
...mber and a bigint may be compared as usual: 1n < 2 // ↪ true 2n > 1 // ↪ true 2 > 2 // ↪ false 2n > 2 // ↪ false 2n >= 2 // ↪ true they may be mixed in arrays and sorted: const mixed = [4n, 6, -12n, 10, 4, 0, 0n] // ↪ [4n, 6, -12n, 10, 4, 0, 0n] mixed.sort() // default sorting behavior // ↪ [ -12n, 0, 0n, 10, 4n, 4, 6 ] mixed.sort((a, b) => a - b) // won't work since subtraction will not work with mixed types // typeerror: can't convert bigint to number // sort with an appropriate numeric comparator mixed.sort((a, b) => (a < b) ?
Intl.DateTimeFormat.prototype.formatToParts() - JavaScript
fractionalsecond the string used for the fractional seconds, for example "0" or "00" or "000".
... examples datetimeformat outputs localized, opaque strings that cannot be manipulated directly: var date = date.utc(2012, 11, 17, 3, 0, 42); var formatter = new intl.datetimeformat('en-us', { weekday: 'long', year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric', fractionalseconddigits: 3, hour12: true, timezone: 'utc' }); formatter.format(date); // "monday, 12/17/2012, 3:00:42.000 am" however, in many user interfaces there is a desire to customize the formatting of this string.
... }, { type: 'day', value: '17' }, { type: 'literal', value: '/' }, { type: 'year', value: '2012' }, { type: 'literal', value: ', ' }, { type: 'hour', value: '3' }, { type: 'literal', value: ':' }, { type: 'minute', value: '00' }, { type: 'literal', value: ':' }, { type: 'second', value: '42' }, { type: 'fractionalsecond', value: '000' }, { type: 'literal', value: ' ' }, { type: 'dayperiod', value: 'am' } ] now the information is available separately and it can be formatted and concatenated again in a customized way.
Math.round() - JavaScript
description if the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value.
... if the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞.
... note that this differs from many languages' round() functions, which often round this case to the next integer away from zero, instead giving a different result in the case of negative numbers with a fractional part of exactly 0.5.
Performance fundamentals - Web Performance
users prefer, say, a responsive, smooth app that only processes 1,000 database transactions per second, over a choppy, unresponsive app that processes 100,000,000 per second.
...for this interaction, the responsiveness metric is the time elapsed between the tap and the pixel change.
...the reason is that these don’t have a delay that makes the interaction with the app appear sluggish.
Example - SVG: Scalable Vector Graphics
</div> <form action="" onsubmit="return false;"> <p> <label>number of motes:</label> <input id='num_motes' value='5'/> <br/> <label>max.
... velocity:</label> <input id='max_velocity' value='15'/> <br/> <label>attraction to cursor:</label> <input id='attract_cursor' value='6'/> <br/> <label>repulsion from peers:</label> <input id='repel_peer' value='5'/> <br/> </p> </form> <script type='text/javascript'> <![cdata[ // array of motes var motes; // get the display element.
... mote.prototype.move = function() { // apply attraction to cursor.
Same-origin policy - Web security
cross-origin network access the same-origin policy controls interactions between two different origins, such as when you use xmlhttprequest or an <img> element.
... these interactions are typically placed into three categories: cross-origin writes are typically allowed.
...for example, you can read the dimensions of an embedded image, the actions of an embedded script, or the availability of an embedded resource.
Caching compiled WebAssembly modules - WebAssembly
caching via indexeddb indexeddb is a transactional database system that allows you to store and retrieve structured data on the client-side.
... function lookupindatabase(db) { return new promise((resolve, reject) => { var store = db.transaction([storename]).objectstore(storename); var request = store.get(url); request.onerror = reject.bind(null, `error getting wasm module ${url}`); request.onsuccess = event => { if (request.result) resolve(request.result); else reject(`module ${url} was not found in wasm cache`); } }); } storing and instantiating modules next, we define...
... function storeindatabase(db, module) { var store = db.transaction([storename], 'readwrite').objectstore(storename); var request = store.put(module, url); request.onerror = err => { console.log(`failed to store in wasm cache: ${err}`) }; request.onsuccess = err => { console.log(`successfully stored ${url} in wasm cache`) }; } using our helper functions with all the promise-based helper functions defined, we can now express the core logic of an indexeddb cache lookup.
Reddit Example - Archive of obsolete content
this example uses the action button api, which is only available from firefox 29 onwards.
... this is the complete add-on script: var data = require("sdk/self").data; var button = require("sdk/ui/button/action").actionbutton({ id: "reddit-panel", label: "reddit panel", icon: "./icon-16.png", onclick: function() { reddit_panel.show(); } }); var reddit_panel = require("sdk/panel").panel({ width: 240, height: 320, contenturl: "http://www.reddit.com/.mobile?keep_extension=true", contentscriptfile: [data.url("jquery-2.1.0.min.js"), data.url("panel.js")] }); redd...
Communicating using "port" - Archive of obsolete content
this example uses the action button api, which is only available from firefox 29 onwards.
...the button sends the content script a message called "get-first-para" when it is clicked: pageworker = require("sdk/page-worker").page({ contentscriptfile: require("sdk/self").data.url("listener.js"), contenturl: "http://en.wikipedia.org/wiki/chalk" }); require("sdk/ui/button/action").actionbutton({ id: "get-first-para", label: "get-first-para", icon: "./icon-16.png", onclick: function() { console.log("sending 'get-first-para'"); pageworker.port.emit("get-first-para"); } }); the content script "listener.js" listens for "get-first-para".
simple-storage - Archive of obsolete content
for example, this add-on tries to store the urls of pages the user visits: var ss = require("sdk/simple-storage"); ss.storage.pages = []; require("sdk/tabs").on("ready", function(tab) { ss.storage.pages.push(tab.url); }); require("sdk/ui/button/action").actionbutton({ id: "read", label: "read", icon: "./read.png", onclick: function() { console.log(ss.storage.pages); } }); but this isn't going to work, because it empties the array each time the add-on runs (for example, each time firefox is started).
...here's an add-on that adds three buttons to write, read, and delete a value: var ss = require("sdk/simple-storage"); require("sdk/ui/button/action").actionbutton({ id: "write", label: "write", icon: "./write.png", onclick: function() { ss.storage.value = 1; console.log("setting value"); } }); require("sdk/ui/button/action").actionbutton({ id: "read", label: "read", icon: "./read.png", onclick: function() { console.log(ss.storage.value); } }); require("sdk/ui/button/action").actionbutton({ id: "delete", label: "delete", icon: "./delete.png"...
widget - Archive of obsolete content
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.
...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.
ui/button/toggle - Archive of obsolete content
toggle buttons have all the same features as action buttons: they can display icons and respond to click events.
... like action buttons, you can control their state on a per-window or per-tab basis as well as globally.
Creating Reusable Modules - Archive of obsolete content
} return path; } require("sdk/ui/button/action").actionbutton({ id: "show-panel", label: "show panel", icon: { "16": "./icon-16.png" }, onclick: function() { console.log(md5file(promptforfile())); } }); this works , but index.js is now getting longer and its logic is harder to understand.
... var s = array.from(hash, (c, i) => tohexstring(hash.charcodeat(i))).join(""); return s; } exports.hashfile = md5file; index.js finally, update index.js to import these two new modules and use them: var filepicker = require("./filepicker.js"); var md5 = require("./md5.js"); require("sdk/ui/button/action").actionbutton({ id: "show-panel", label: "show panel", icon: { "16": "./icon-16.png" }, onclick: function() { console.log(md5.hashfile(filepicker.promptforfile())); } }); distributing modules with jpm, we use npm as the package manager for sdk modules that don't ship inside firefox.
List Open Tabs - Archive of obsolete content
the following add-on adds an action button that logs the urls of open tabs when the user clicks it: require("sdk/ui/button/action").actionbutton({ id: "list-tabs", label: "list tabs", icon: "./icon-16.png", onclick: listtabs }); function listtabs() { var tabs = require("sdk/tabs"); for (let tab of tabs) console.log(tab.url); } note: to get this working, you will need to save an icon for the button to your add-on's "data" directory as "icon-16.png".
...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 solid red';" }); } learning more to learn more about working with tabs in the sdk, see ...
Localization - Archive of obsolete content
using localized strings in html this example uses the action button api, which is only available from firefox 29 onwards.
... to reference localized strings from html, add a data-l10n-id attribute to the html tag where you want the localized string to appear, and assign the identifier to it: <html> <body> <h1 data-l10n-id="hello_id"></h1> </body> </html> then you can use this html file to build your interface, for example inside a panel: var button = require("sdk/ui/button/action").actionbutton({ id: "localized-hello", label: "localized hello", icon: "./icon-16.png", onclick: function() { hello.show(); } }); var hello = require("sdk/panel").panel({ height: 75, width: 150, contenturl: require("sdk/self").data.url("my-panel.html") }); given locale files for "en-us" and "fr" which provide translations of hello_id, the panel will now display "hello!" or "bonjour !", according to the cur...
Miscellaneous - Archive of obsolete content
ntbyid("scrollarea"); elm.addeventlistener("dommousescroll", function scroll(event){ //event.detail is positive for a downward scroll, negative for an upward scroll alert("scrolling " + event.detail + " lines"); }, false); </script> if you do not receive a dommousescroll event while holding any of the modifier keys (ctrl,shift,alt,meta) you should check the mousewheel.withcontrolkey.action and related preferences.
... the meaning of the action preference is shown in the following table mousewheel.withxxxkey.action result 0 scroll by lines.
JavaScript timers - Archive of obsolete content
clearinterval() cancels repeated action which was set up using setinterval().
... clearimmediate() cancels the immediate actions, just like cleartimeout() for settimeout().
Communication between HTML and your extension - Archive of obsolete content
see also interaction between privileged and non-privileged pages.
...i set the onblur action to a little javascript function that performed a standard ajax request to get a result.
Displaying web content in an extension without security issues - Archive of obsolete content
it won’t harm disabling everything else as well unless it is really required: frame.docshell.allowauth = false; frame.docshell.allowimages = false; frame.docshell.allowjavascript = false; frame.docshell.allowmetaredirects = false; frame.docshell.allowplugins = false; frame.docshell.allowsubframes = false; but what about interactivity, for example if you want a certain reaction to mouse clicks?
... this can be done as well, by placing the event handler on the frame tag (meaning that it is outside the restricted document and can execute without restrictions): <iframe type="content" onclick="handleclick(event);"/> and the event handler would look like that: function handlebrowserclick(event) { // only react to left mouse clicks if (event.button != 0) return; // default action on link clicks is to go to this link, cancel it event.preventdefault(); if (event.target instanceof htmlanchorelement && event.target.href) openlinkinbrowser(event.target.href); } safe html manipulation functions when it comes to displaying the data, it is tempting to generate some html code and to insert it into the document via innerhtml.
Downloading JSON and JavaScript in extensions - Archive of obsolete content
the practice is dangerous because the decoded javascript has full chrome privileges and could perform some nasty actions.
... how could the javascript an extension downloads perform nasty actions?
Appendix C: Avoiding using eval in Add-ons - Archive of obsolete content
gbrowser.addtab = function() { // execute some action before the original function call.
... var rv = _original.apply(gbrowser, arguments); // execute some action afterwards.
Observer Notifications - Archive of obsolete content
for example, you might want to notify that a task is completed, and then several different actions must be performed.
... an observer is an object that is responsible to observe (wait for) notifications and then to carry out subsequent actions.
Promises - Archive of obsolete content
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.
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
the single-page context and abstraction of data from the presentation can give your web applications new continuity, precision and control.
...this class is just an abstraction layer that encapsulates the xmlhttprequest interface, and provides cross-browser support for recent ie versions and gecko-based browsers.
MMgc - Archive of obsolete content
finalizers may not perform any of the following actions: fire any write barriers dereference a pointer to any gc object, including member variables (except see below about rcobject references) allocate any gc memory (gc::alloc), explicitly free gc memory (gc::free) change the set of gc roots (create a gcroot object or derivative) cause itself to become reachable if a finalized object holds a reference to an rcobject, it may safely call decrementref...
...currently we make the decision on when to do a collection based on how much memory has been allocated since the last collection, if its over a certain fraction of the the total heap size we do a collection and if its not we expand.
Notes on HTML Reflow - Archive of obsolete content
some reflows are immediate in response to user or script actions; for example, resizing the window or changing the document's default font.
...html and xul interaction as mentioned above, html and xul have fundamentally different layout models, the former being a flow-based model, and the latter being a constraint based model.
Drag and Drop Example - Archive of obsolete content
var listobserver = { ondragstart: function (event, transferdata, action) { var txt = event.target.getattribute("elem"); transferdata.data = new transferdata(); transferdata.data.adddataforflavour("text/unicode", txt); } } one function has been defined, ondragstart, which will be called by the nsdraganddrop object when necessary.
...nsdraganddrop.startdrag(event, listobserver)"/> <button label="check box" elem="checkbox" ondraggesture="nsdraganddrop.startdrag(event, listobserver)"/> <button label="text box" elem="textbox" ondraggesture="nsdraganddrop.startdrag(event, listobserver)"/> </vbox> </window> var listobserver = { ondragstart: function (event, transferdata, action) { var txt = event.target.getattribute("elem"); transferdata.data = new transferdata(); transferdata.data.adddataforflavour("text/unicode", txt); } }; var boardobserver = { getsupportedflavours : function () { var flavours = new flavourset(); flavours.appendflavour("text/unicode"); return flavours; }, ondragover: function (event, flavour, session) {}, ondrop: ...
Firefox Sync - Archive of obsolete content
these include: an http api for client-server interaction storage formats used by the the clients cryptographic model for encrypting client data the definitive source for these specifications is http://docs.services.mozilla.com/.
...related info javascript client api (useful for interacting with sync from mozilla applications, including developing extensions against sync) syncing custom preferences (useful for extension developers) code snippets (demonstrates common actions with the javascript api) ...
HTTP Class Overview - Archive of obsolete content
nshttphandler implements nsiprotocolhandler manages preferences owns the authentication cache holds references to frequently used services nshttpchannel implements nsihttpchannel talks to the cache initiates http transactions processes http response codes intercepts progress notifications nshttpconnection implements nsistreamlistener & nsistreamprovider talks to the socket transport service feeds data to its transaction object routes progress notifications nshttpconnectioninfo identifies a connection nshttptransaction implements nsirequest encapsulates a http request and response parses incoming...
... data nshttpchunkeddecoder owned by a transaction strips chunked transfer encoding nshttprequesthead owns a nshttpheaderarray knows how to fill a request buffer nshttpresponsehead owns a nshttpheaderarray knows how to parse response lines performs common header manipulations/calculations nshttpheaderarray stores http "<header>:<value>" pairs nshttpauthcache stores authentication credentials for http auth domains nshttpbasicauth implements nsihttpauthenticator generates basic auth credentials from user:pass nshttpdigestauth implements nsihttpauthenticator generates digest auth credentials from user:pass original document information author(s): darin fisher last updated date: august 5, 2002 copyright information: portions of this content are © 1998...
Mozilla Application Framework in Detail - Archive of obsolete content
the following architectural diagram depicts necko and its interaction with subsystems: necko is powerful, stable and robust, with current development focused on performance and standards-compliance.
...it is a development environment that provides the following features for the cross-platform software developer: component management file abstraction object message passing memory management this component object model makes virtually all of the functionality of gecko available as a series of components, or reusable cross-platform libraries, that can be accessed from the browser or scripted from any mozilla application.
Abc Assembler Tests - Archive of obsolete content
the tests are run using the same runtests.py script that is used for the actionscript tests.
...compare_numbereq(name:string, expected:*, actual:*, fractiondigits:int=-1):void - compare 2 numbers up to fractiondigits this is to be used for high precision numbers that may vary slightly due to platform differences.
Anonymous Content - Archive of obsolete content
whenever events flow from an anonymous element in a bound element's scope to the bound element itself, one of two actions occurs.
... the action taken (retarget vs.
Install Wizards (aka: Stub Installers) - Archive of obsolete content
it contains some files to be installed and the install script, usually named install.js, which contains javascript directives for actions to take during an install including adding files and directories, removing old or obsolete files and directories, executing command line tools, etc.
... the xpinstall engine processes installer packages by reading instructions from their install scripts to extract files and take other install actions.
popupshowing - Archive of obsolete content
the default action of the event can be prevented to prevent the popup to appear.
... general info specification xul interface popupevent bubbles yes cancelable yes target element default action a popup is displayed properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
Introduction to XUL - Archive of obsolete content
mozilla applications will be built of "small" components like dialog buttons and mail inbox folders, which we collectively term "widgets." within a widget, drawing and user interactions are completely under control of the individual widget, and set when the widget was built.
... relative placement of widgets, their interactions with each other, and optionally some of their configuration, will be controlled by a ui layout specified in a script whose structure is defined in this and related documents.
MenuItems - Archive of obsolete content
this can be useful if there's a possibility that whatever action is carried out could fail.
... disabling a menuitem to have an item initially disabled, set the disabled attribute to true as in the following example: <menuitem label="undo" accesskey="u" disabled="true"/> when disabled, the item will appear greyed out and the action associated with the item cannot be carried out.
PopupEvents - Archive of obsolete content
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 reason for this is if, as is quite common, the menu item's action is to open a modal dialog.
Attribute Substitution - Archive of obsolete content
« previousnext » so far, attribute replacement in an action body has been used to replace an entire attribute with the value of a variable.
...you can include multiple variables in one attribute if desired: <label value="my name is ?name and my age is ?age"/> this technique will work for any variable replacement in the action body, except for the uri attribute since that wouldn't be meaningful.
Namespaces - Archive of obsolete content
le"> <person name="napoleon bonaparte" gender="male"/> <person name="cleopatra" gender="female"/> <person name="julius caesar" gender="male"/> <person name="ferdinand magellan" gender="male"/> <person name="laura secord" gender="female"/> </people> <listbox datasources="people.xml" ref="*" querytype="xml"> <template xmlns:ns="www.example.com/people"> <query expr="ns:person"/> <action> <listitem uri="?" label="?ns:name"/> </action> </template> </listbox> once added to the template element the namespaces can then be referenced inside temple rule elements too, this works both in rdf and xml templates.
... <listbox datasources="people.xml" ref="*" querytype="xml"> <template xmlns:ns="www.example.com/people"> <query expr="ns:person"/> <rule ns:gender="male"> <label uri="?" label="?ns:name"/> </action> </template> </listbox> ...
Recursive Generation - Archive of obsolete content
here is the content that was generated after one iteration: <vbox datasources="http://www.xulplanet.com/ds/sample.rdf" ref="http://www.xulplanet.com/rdf/a"> <template> <query> <content uri="?start"/> <triple subject="?start" predicate="http://www.xulplanet.com/rdf/relateditem" object="?relateditem"/> </query> <action> <hbox uri="?relateditem"> <button label="?start"/> <button label="?relateditem"/> </hbox> </action> </template> <hbox id="http://www.xulplanet.com/rdf/b"> <button label="http://www.xulplanet.com/rdf/a"/> <button label="http://www.xulplanet.com/rdf/b"/> </hbox> <hbox id="http://www.xulplanet.com/rdf/c"> <button label="http://www.xulplanet.com/rd...
...however, for item c, the triple does match an item, so the data will be added to the potential result: (?start = http://www.xulplanet.com/rdf/c, ?relateditem = http://www.xulplanet.com/rdf/d) a match has occured, so the content within the action body will be created and added inside item c.
Simple Example - Archive of obsolete content
the action body might look like the following, which displays the image using its url and title in a label.
... you might note that the image's src attribute uses the member variable ?photo <action> <vbox uri="?photo" align="start"> <image src="?photo"/> <label value="?title"/> </vbox> </action> it shouldn't be too difficult to tell what would appear in the window in this example.
Simple Query Syntax - Archive of obsolete content
here is what it might look like: <template> <vbox class="box-padded" uri="rdf:*"> <image src="rdf:*"/> <label value="rdf:http://purl.org/dc/elements/1.1/title"/> </vbox> </template> there is no <query> or <action> element used.
... instead, the builder uses a default query, and the action is placed directly inside the <template> element.
Special Condition Tests - Archive of obsolete content
here is a previous example, rewritten to use the parent matching syntax: <vbox datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="*"/> <rule parent="vbox"> <action> <groupbox uri="?"> <caption label="?name"/> </groupbox> </action> </rule> <rule> <action> <label uri="?" value="?name"/> </action> </rule> </template> </vbox> previously, an assign element was used to assign the tagname of the result to a variable, which was then compared in a rule condition.
...e example using the extended template syntax: <vbox datasources="template-guide-streets.rdf" ref="http://www.xulplanet.com/rdf/myneighbourhood"> <template> <query> <content uri="?start"/> <member container="?start" child="?item"/> </query> <rule parent="vbox"> <binding subject="?item" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> <action> <groupbox uri="?item"> <caption label="?title"/> </groupbox> </action> </rule> <rule> <binding subject="?item" predicate="http://www.xulplanet.com/rdf/address" object="?address"/> <action> <label uri="?item" value="?address"/> </action> </rule> </template> </vbox> containment tests for rdf sources, the simple rule syntax su...
Template Logging - Archive of obsolete content
action body should have an element with uri attribute the member variable could not be determined.
... you should specify an element inside the first <action> body with a uri attribute.
The Joy of XUL - Archive of obsolete content
since xul provides an abstraction of user interface components, it delivers on the promise of write-once, run-anywhere.
...similarly, since the ui code is written in javascript, the interaction logic worked with no effort.
Adding Event Handlers - Archive of obsolete content
when an action occurs that would trigger an event, such as the user moving the mouse, an event object is created corresponding to that event type.
...once the event has finished propagating, any default action will occur, which is the built in behaviour of the element.
XUL Accesskey FAQ and Policies - Archive of obsolete content
for example, here's how we add an accesskey to a xul button: <button label="apply instantly" accesskey="a" /> apply instantly - or - <button label="apply instantly" accesskey="a" /> apply instantly in mozilla, we use dtd's for one more layer of abstraction, for purposes of internationalization.
... finally, use any non-silent letter in an action word (do these after the rest of the dialog has accesskeys chosen).
XUL Reference - Archive of obsolete content
« xul reference « alphabetical list of all xul elements action arrowscrollbox assign bbox binding bindings box broadcaster broadcasterset button browser checkbox caption clicktoscroll colorpicker column columns commandset command conditions content datepicker deck description dialog dialogheader dropmarker editor grid grippy groupbox hbox iframe image key keyset label listbox listcell listcol listcols listhead listheader listitem member menu menubar menuitem menulist menupopup menuseparator notification notificationbox observes overlay page panel param popupset preference preferences prefpane prefwindow progressmeter query queryset radio radiogroup resizer richlistbox richlistitem row rows rule scale script...
...diogroup scale splitter textbox textbox (firefox autocomplete) textbox (mozilla autocomplete) timepicker description label image listbox listitem listcell listcol listcols listhead listheader richlistbox richlistitem tree treecell treechildren treecol treecols treeitem treerow treeseparator box hbox vbox bbox deck stack grid columns column rows row scrollbox action assign binding bindings conditions content member param query queryset rule template textnode triple where script commandset command broadcaster broadcasterset observes key keyset stringbundle stringbundleset arrowscrollbox dropmarker grippy scrollbar scrollcorner spinbuttons all attributes all properties all methods attributes defined for all xul elements style...
XUL Template Primer - Bindings - Archive of obsolete content
df#name" object="?name"/> </conditions> <bindings> <binding subject="?friend" predicate="http://home.netscape.com/nc-rdf#address" object="?addr"/> <binding subject="?addr" predicate="http://home.netscape.com/nc-rdf#street" object="?street"/> </bindings> <action> <hbox uri="?friend"> <label value="?name"/> <label value="?street"/> </hbox> </action> </rule> </template> </vbox> </window> the xul template primer covers the <conditions> and <action> elements, so we won't discuss those here.
... the <bindings> element the <bindings> element is optional in a xul template, but if present, must appear as a sibling of the <conditions> and <action> elements in a rule.
XUL controls - Archive of obsolete content
unlike with the 'menu' type, a separate action may be performed when the main part of the button is pressed.
...unlike with the 'menu' type, a separate action may be performed when the main part of the button is pressed.
preference - Archive of obsolete content
if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
... for a textbox it also clears the undo transaction list (gecko 1.9).
rule - Archive of obsolete content
ArchiveMozillaXULrule
a rule may contain where, binding and/or action elements.
...for each result that matches all of the conditions, content within the rule's action body is generated.
textbox - Archive of obsolete content
if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
... for a textbox it also clears the undo transaction list (gecko 1.9).
NPP_URLNotify - Archive of obsolete content
npres_user_break: user canceled stream directly by clicking the stop button or indirectly by some action such as deleting the instance or initiating higher-priority network operations.
...other possible reason codes are npres_user_break, indicating that the request was halted due to a user action (for example, clicking the stop button), and npres_network_err, indicating that the request could not be completed, perhaps because the url could not be found.
Introduction to SSL - Archive of obsolete content
confidentiality is important for both parties to any private transaction.
...this exchange of messages is designed to facilitate the following actions: authenticate the server to the client.
Building a Theme - Archive of obsolete content
user actions are bound to functionality using javascript.
... note: your theme will be passed faster and downloaded more if you have a good description and some screenshots of the theme in action.
XForms Trigger Element - Archive of obsolete content
introduction allows the user to initiate actions (see the spec).
... actions are described by the xforms action module (see the spec).
Choosing Standards Compliance Over Proprietary Practices - Archive of obsolete content
interchangeability if a user experiences consistent behavior across a range of products, they can predict how a particular action or function will work or respond.
...technical support is costly not only in regard to support staff costs, but also in respect to customer dissatisfaction.
Desktop gamepad controls - Game development
you can see a live demo in action — try connecting your gamepad and pressing the buttons.
...it works smooth on mobile and desktop, and adding gamepad controls is just as straightforward — in the update() function, we check to see if the current state status is paused — if so, the relevant actions are enabled: if(gamepadapi.buttons.pressed('start')) { this.managepause(); } if(gamepadapi.buttons.pressed('back')) { this.stateback(); } similarly, when the gameover state status is active, then we can allow the user to restart the game instead of continuing it: if(gamepadapi.buttons.pressed('start')) { this.staterestart(); } if(gamepadapi.buttons.pressed('back')) { this.stat...
Paddle and keyboard controls - Game development
so let's add some user interaction: a controllable paddle.
...add the following just below your drawball() function: function drawpaddle() { ctx.beginpath(); ctx.rect(paddlex, canvas.height-paddleheight, paddlewidth, paddleheight); ctx.fillstyle = "#0095dd"; ctx.fill(); ctx.closepath(); } allowing the user to control the paddle we can draw the paddle wherever we want, but it should respond to the user's actions.
2D maze game with device orientation - Game development
when the start button is pressed, instead of jumping directly into the action the game will show the screen with the information on how to play the game.
...you can even implement achievements, leaderboards and medals for different actions in the game.
Visual typescript game engine - Game development
npm install npm run build navigate in browser /build/app.html to see client app in action -the client part is a browser web application.
... create examples demos in minimum 20 gameplay variants (table games, actions, platformers, basic demo throw the api doc etc.).
API - MDN Web Docs Glossary: Definitions of Web-related terms
an api (application programming interface) is a set of features and rules that exist inside a software program (the application) enabling interaction with it through software - as opposed to a human user interface.
...gps), which can then be used in conjunction with the google maps apis to for example plot the user's location on a custom map and show them what tourist attractions are in their area.
High-level programming language - MDN Web Docs Glossary: Definitions of Web-related terms
a high-level programming language has a significant abstraction from the details of computer operation.
...the amount of abstraction provided defines how "high-level" a programming language is.
Navigation directive - MDN Web Docs Glossary: Definitions of Web-related terms
list of csp navigation directives form-action restricts the urls which can be used as the target of a form submissions from a given context.
... 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.
RAIL - MDN Web Docs Glossary: Definitions of Web-related terms
the performance mantra of rail is "focus on the user; the end goal isn't to make your site perform fast on any specific device, it's to make users happy." there are 4 stages of interaction: page load, idle, response to input, and scrolling and animation.
... idle when using the main javascript thread, work in chunks for less than 50ms to free up the thread for user interactions.
State machine - MDN Web Docs Glossary: Definitions of Web-related terms
a state machine is a mathematical abstraction used to design algorithms.
...a transition is a set of actions to execute when a condition is fulfilled or an event received.
jQuery - MDN Web Docs Glossary: Definitions of Web-related terms
jquery uses a format, $(selector).action() to assign an element(s) to an event.
... to explain it in detail, $(selector) will call jquery to select selector element(s), and assign it to an event api called .action().
Mobile accessibility - Learn web development
tap with two fingers to perform a context-relevant action — for example, taking a photo while in the camera app.
...you can see a simple example of this idea in action in common-job-types.html (see the common jobs example live).
Pseudo-classes and pseudo-elements - Learn web development
user-action pseudo classes some pseudo-classes only apply when the user interacts with the document in some way.
... these user-action pseudo-classes, sometimes referred to as dynamic pseudo-classes, act as if a class had been added to the element when the user interacts with it.
Responsive design - Learn web development
on mobile the heading is smaller: on desktop, however, we see the larger heading size: note: see this example in action: example, source code.
... see an example of this in action: example, source code.
Basic native form controls - Learn web development
due to the on-off nature of checkboxes, the checkbox is considered a toggle button, with many developers and designers expanding on the default checkbox styling to create buttons that look like toggle switches you can see an example in action here (also see the source code).
...forms are able to send files to a server (this specific action is also detailed in the sending form data article).
HTML forms in legacy browsers - Learn web development
make things simple because html forms involves complex interaction, there is one rule of thumb: keep it simple, also known as the "kiss principal".
...rather, it's about simplicity, intuitivess, and ease of user interaction.
Other form controls - Learn web development
previous overview: forms next we now look at the functionality of non-<input> form elements in detail, from other control types such as drop-down lists and multi-line text fields, to other useful form features such as the <output> element (which we saw in action in the previous article), and progress bars.
...in both cases the interaction is the same — once the control is activated, the browser displays a list of values the user can select between.
UI pseudo-classes - Learn web development
you can see the example in action below (also see it live here, and see the source code): read-only and read-write in a similar manner to :disabled and :enabled, the :read-only and :read-write pseudo-classes target two states that form inputs toggle between.
... the :focus-visible pseudo-class matches focused elements that received focus via keyboard interaction (rather than touch or mouse) — useful if you want to show a different style for keyboard focus compared to mouse (or other) focus.
Tips for authoring fast-loading HTML pages - Learn web development
javascript files for functions required during the loading of the page, but not any interaction related javascript that can only run after page loads.
...interaction scripts typically can only run after the page has completely loaded and all necessary objects have been initialized.
Use JavaScript within a webpage - Learn web development
you can hardly ever predict just how long it will take for users or browsers to complete an process (especially asynchronous actions such as loading resources).
... let users initiate interactions.
A first splash into JavaScript - Learn web development
upon looking at this brief, the first thing we can do is to start breaking it down into simple actionable tasks, in as much of a programmer mindset as possible: generate a random number between 1 and 100.
... first let's look at arithmetic operators, for example: operator name example + addition 6 + 9 - subtraction 20 - 15 * multiplication 3 * 7 / division 10 / 5 you can also use the + operator to join text strings together (in programming, this is called concatenation).
Inheritance in JavaScript - Learn web development
prototypal inheritance so far we have seen some inheritance in action — we have seen how prototype chains work, and how members are inherited going up a chain.
... the example below shows the two features in action: // check the default value console.log(snape.subject) // returns "dark arts" // change the value snape.subject = "balloon animals" // sets _subject to "balloon animals" // check it again and see if it matches the new value console.log(snape.subject) // returns "balloon animals" note: you can find this example on github as es2015-getters-setters.html (see it live also).
Working with JSON - Learn web development
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.
...try entering the following lines into your browser's javascript console one by one to see it in action: let myjson = { "name": "chris", "age": "38" }; myjson let mystring = json.stringify(myjson); mystring here we're creating a javascript object, then checking what it contains, then converting it to a json string using stringify() — saving the return value in a new variable — then checking it again.
Web performance - Learn web development
part of good user experience is ensuring the content is quick to load and responsive to user interaction.
...these perceptions are impacted by actual page load time, idling, responsiveness to user interaction, and the smoothness of scrolling and other animations.
Server-side web frameworks - Learn web development
this abstraction layer is referred to as an object-relational mapper (orm).
...usually multiple applications run in parallel talking to each other, with some providing user interaction and others doing back end work (e.g.
Ember app structure and componentization - Learn web development
later on we'll add the required dynamic functionality such as data bindings, responding to user interaction, etc.
...ate component todo-list ember generate component todo ember generate component footer you’ll now see the following inside your todomvc/app/components directory: now that we have all of our component structure files, we can cut and paste the html for each component out of the application.hbs file and into each of those components, and then re-write the application.hbs to reflect our new abstractions.
Framework main features - Learn web development
all of the frameworks follow the same general model: they allow developers to perform certain actions when the component mounts, when it renders, when it unmounts, and at many phases in between these.
...this abstraction away from the dom is more complex and more memory-intensive than updating the dom yourself, but without it, frameworks could not allow you to program in the declarative way they’re known for.
Beginning our React todo list - Learn web development
our app's user stories in software development, a user story is an actionable goal from the perspective of the user.
... top: -2px; left: -2px; width: 44px; height: 44px; } .c-cb > input[type="checkbox"] { -webkit-font-smoothing: antialiased; cursor: pointer; position: absolute; z-index: 1; margin: 0; opacity: 0; } .c-cb > label { font-size: inherit; font-family: inherit; line-height: inherit; display: inline-block; margin-bottom: 0; padding: 8px 15px 5px; cursor: pointer; touch-action: manipulation; } .c-cb > label::before { content: ""; position: absolute; border: 2px solid currentcolor; background: transparent; } .c-cb > input[type="checkbox"]:focus + label::before { border-width: 4px; outline: 3px dashed #228bec; } .c-cb > label::after { box-sizing: content-box; content: ""; position: absolute; top: 11px; left: 9px; width: 18px; height: 7px; tran...
Starting our Svelte Todo list app - Learn web development
utton type="button" class="btn"> edit <span class="visually-hidden">complete the rest of the tutorial</span> </button> <button type="button" class="btn btn__danger"> delete <span class="visually-hidden">complete the rest of the tutorial</span> </button> </div> </div> </li> </ul> <hr /> <!-- moreactions --> <div class="btn-group"> <button type="button" class="btn btn__primary">check all</button> <button type="button" class="btn btn__primary">remove completed</button> </div> </div> check the rendered out again, and you'll see something like this: it's current not very nicely styled, and also functionally useless.
... top: -2px; left: -2px; width: 44px; height: 44px; } .c-cb > input[type="checkbox"] { -webkit-font-smoothing: antialiased; cursor: pointer; position: absolute; z-index: 1; margin: 0; opacity: 0; } .c-cb > label { font-size: inherit; font-family: inherit; line-height: inherit; display: inline-block; margin-bottom: 0; padding: 8px 15px 5px; cursor: pointer; touch-action: manipulation; } .c-cb > label::before { content: ""; position: absolute; border: 2px solid currentcolor; background: transparent; } .c-cb > input[type="checkbox"]:focus + label::before { border-width: 4px; outline: 3px dashed #228bec; } .c-cb > label::after { box-sizing: content-box; content: ""; position: absolute; top: 11px; left: 9px; width: 18px; height: 7px; tran...
Getting started with Svelte - Learn web development
highly interactive pages or complex visualizations: if you are building data-visualizations that need to display a large number of dom elements, the performance gains that come from a framework with no runtime overhead will ensure that user interactions are snappy and responsive.
... you can see this in action by opening localhost:5000 in a new browser tab, right/ctrl-clicking on the hello world!
Handling common JavaScript problems - Learn web development
you can see this code in action in fetch-polyfill-only-when-needed.html (see the source code also).
... note: this is called "transpiling" — you are not compiling code into a lower level to be run on a computer (like you would say with c code); instead, you are changing it into a syntax that exists at a similar level of abstraction so it can be used in the same way, but in slightly different circumstances (in this case, transforming one flavor of javascript into another).
Setting up your own test automation environment - Learn web development
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.
... below the block where you define the driver variable (just below the build() line), add the following block — this gets the correct driver sessionid that we need to write data to the job (you can see it action in the next code block): driver.getsession().then(function (sessionid){ driver.sessionid = sessionid.id_; }); finally, replace the driver.sleep(2000) ...
Deploying our app - Learn web development
the only action we need to perform is that initial "push".
...also see our cross browser testing module for a bunch of useful testing information remember also that tests are not limited to javascript; tests can be run against the rendered dom, user interactions, css, and even how a page looks.
Client-side tooling overview - Learn web development
this stage of the development process is one that you want the least amount of active interaction with so that once it is configured, it runs mostly automatically, only popping up to say hello if something has gone wrong.
...you'll see this tool in action and learn more about package managers in general in chapter 3 of this module.
Gecko info for Windows accessibility vendors
ajax: asynchronous javascript and xml ajax is a method of building interactive web applications that process user requests, user actions immediately in real time, unlike an http request, during which users must wait for a whole page to reload or for a new page to load.
... iaccessible methods that we support: get_accparent get_accchildcount get_accchild get_accname get_accvalue get_accdescription get_accrole get_accstate get_accfocus get_accdefaultaction acclocation accselect acchittest accdodefaultaction accnavigate get_acckeyboardshortcut msaa support: iaccessible events and unique id's what msaa events do we support?
Mozilla's Section 508 Compliance
(i) color coding shall not be used as the only means of conveying information, indicating an action, prompting a response, or distinguishing a visual element.
...does not require speech input f) at least one mode of operation and information retrieval that does not require fine motor control or simultaneous actions and that is operable with limited reach and strength shall be provided complete.
Adding a new event
a dom event which represents a native event like a user action such as keyboard or mouse input.
... contentevents.h this header file should be used for defining internal event classes which are dispatched in content and do not represent user action.
HTTP logging
note: the web console also offers the ability to peek at http transactions within firefox.
... turning off logging of socket-level transactions if you're not interested in socket-level log information, either because it's not relevant to your bug or because you're debugging something that includes a lot of noise that's hard to parse through, you can do that.
Creating Custom Events That Can Pass Data
for example, if you want firefox to perform an action whenever something happens (i.e., something other than the standard mouse/keyboard events) and, depending on the data passed along with this event, you want firefox to react differently.
... prbool defaultactionenabledwin; prbool defaultactionenableddoc; nscomptr<nsiprivatedomevent> privevt(do_queryinterface(event)); privevt->settrusted(pr_true); //make the event trusted twindow->dispatchevent(event, &defaultactionenabledwin); //dispatch it (i.e.
mozbrowsercaretstatechanged
this is used by the embedder to show a context menu for clipboard actions.
... 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.
mozbrowsercontextmenu
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.
... action a domstring representing the action of a form, in the case of a form context menu.
Download
a download object represents a single download, with associated state and actions.
... you can use this property for scheduling download completion actions in the current session, for downloads that are controlled interactively.
FxAccountsOAuthClient.jsm
fxaccountsoauthclient fxaccountsoauthclient( object options object parameters string client_id string state string oauth_uri string content_uri [optional] string scope [optional] string action [optional] string authorizationendpoint ); parameters client_id - oauth id returned from client registration.
... [optional] action - if provided, should be either "signup" or "signin".
Mozilla MathML Status
maction implemented.
... maction - tooltip not implemented.
Mozilla Web Developer FAQ
some of the reactions are due to unknown and unintentional interactions within a complex program.
... even if you had the source code for browser x, you couldn’t change anything without risking changing one or more of the unknown and unintentional interactions within the program.
Reporting a Performance Problem
note that while it's possible to strip profiles of potentially privacy sensitive information, the less information a profile contains, the harder it is to analyze and turn into actionable data.
...try to give some context about what you were doing when the performance problem arose such as the url you were viewing and what actions were you doing (ex.
L20n
complete with use cases and examples of l20n in action.
...complete with use cases and examples of l20n in action.
AsyncTestUtils extended framework
messagegenerator.js: provides the syntheticmessage abstraction and messagegenerator class that can generate one or more syntheticmessages at a time.
... messagemodifier.js: slightly misnamed, this provides the syntheticmessageset abstraction that is a set abstraction for syntheticmessages that also tracks what folders they got injected into and provides code to directly manipulate or aid other code that wants to directly manipulate them.
NSPR's Position On Abrupt Thread Termination
the process abstraction is then responsible for closing all open files and reclaiming all storage that may have been allocated during the process' lifetime.
...threads run within the confines of a process (or similar abstractions in other environments).
Utilities for nss samples
* * this function supports password extraction from files with * multipe passwords, one for each token.
... * * this function supports password extraction from files with * multipe passwords, one for each token.
NSS Tools certutil
options and arguments options specify an action and are uppercase.
... option arguments modify an action and are lowercase.
NSS Tools cmsutil
options and arguments options specify an action.
... option arguments modify an action.
NSS Tools crlutil
options and arguments options specify an action and are uppercase.
... option arguments modify an action and are lowercase.
NSS Tools modutil
options and arguments options specify an action.
... option arguments modify an action.
NSS Tools pk12util
options and arguments options specify an action.
... option arguments modify an action.
certutil
options options specify an action and are uppercase.
... arguments option arguments modify an action and are lowercase.
Rhino overview
when javascript code attempts a restricted action, the security domain can be retrieved in the following manner.
...then, the class of the code that called to request the restricted action can be obtained by looking an appropriate index into the class context array.
GCIntegration - SpiderMonkey Redirect 1
at a high level, there are three issues to be aware of: interactions between the garbage collector and the cycle collector incremental garbage collection moving garbage collection the apis for gc/cc interaction and incremental gc are already in place.
... gc/cc interaction <to be done later.> incremental gc incremental gc divides gc marking into time slices.
JS_GetGCParameter
_limit, jsgc_high_frequency_time_limit, jsgc_high_frequency_low_limit, jsgc_high_frequency_high_limit, jsgc_high_frequency_heap_growth_max, jsgc_high_frequency_heap_growth_min, jsgc_low_frequency_heap_growth, jsgc_dynamic_heap_growth, jsgc_dynamic_mark_slice, jsgc_allocation_threshold, jsgc_min_empty_chunk_count, jsgc_max_empty_chunk_count, jsgc_compaction_enabled, jsgc_allocation_threshold_factor, jsgc_allocation_threshold_factor_avoid_interrupt, jsgc_nursery_free_threshold_for_idle_collection, jsgc_pretenure_threshold, jsgc_pretenure_group_threshold, jsgc_nursery_free_threshold_for_idle_collection_percent, jsgc_min_nursery_bytes, jsgc_min_last_ditch_gc_period, } jsgcparamkey; value (c++/js shell) desc...
... jsgc_compaction_enabled / "compactingenabled" non-zero to enable compacting, zero to disable.
TPS Formdata Lists
for example: var formdata1 = [ { fieldname: "testing", value: "success", date: -1 }, { fieldname: "testing", value: "failure", date: -2 }, { fieldname: "username", value: "joe" } ]; formdata lists and phase actions you can use the following functions in phase actions for formdata lists: formdata.add formdata.delete formdata.verify formdata.verifynot for an example, see the tps formdata unittest: http://hg.mozilla.org/services/tps/f...st_formdata.js notes note 1, tps supports the delete action for formdata, but sync currently does not correctly sync deleted form data, see bug 564296.
... note 2, sync currently does not sync formdata dates, so the date field is ignored when performing verify and verify-not actions.
TPS Password Lists
changes: an object containing any of the above properties, which are applied during a modify action.
... password lists and phase actions following are the functions that can be used in phase actions related to passwords: passwords.add passwords.delete passwords.modify passwords.verify passwords.verifynot ...
Gecko object attributes
action 0 is named either "check" or "uncheck".
...in this case action 0 is called "cycles", which moves to the next option in the same way a manual click does.
Gecko events
is supported: no event_defaction_change an object's default action has changed.
... is supported: no event_action_change an object's action has changed.
History Service Design
since places is actually not thread-safe and doing most of the work in the main-thread, adding visits (the most common action usually executed on user interaction) could end up locking the ui till the database i/o to save data is complete.
... expiration expiration is an important part of data management for two reasons: privacy: expiring data based on user interaction is important, nothing must be left behind on a page removal database maintenance: having cleaner and smaller tables helps queries performances expiration is done at certain moments, but in future will most likely be moved to async queries, to be executed on a separate thread.
Places Developer Guide
however, firefox developers can take advantage of several helper apis that are browser-specific: fuel - a collection of wrapper apis for easing access to a number of firefox utilities and services nsiplacestransactionsservice - a firefox service for modifying bookmarks in a transactional manner, providing facilities for undo/redo places utilities for javascript - accessors and helper functions for firefox and extensions creating bookmarks, folders and other items creating a bookmark // create an nsiuri for the url to be bookmarked.
... var title = childnode.title; var id = childnode.itemid; var type = childnode.type; // some type-specific actions.
Building the WebLock UI
the xul document the first thing to do is create the actual xul document in which the user interface for the dialog and the events that initiate interaction with the web locking are defined.
... the xul that defines the radiogroup in the web lock manager dialog is this: <radiogroup> <radio label="lock"/> <radio label="unlock" selected="true"/> </radiogroup> since the weblock component always starts up in the unlocked position, you can add the selected="true" attribute and value on the unlock radio button and reset it dynamically as the user takes action.
Starting WebLock
what, in other words, is the interaction of clients with the weblock component?
...as a layer of abstraction above the operating system, the nspr allows gecko applications to be platform independent by providing the following system-level facilities: threads thread synchronization file and network i/o timing and intervals memory management shared library linking the nspr is included in the gecko sdk.
nsIAlertsService
toolkit/components/alerts/nsialertsservice.idlscriptable this interface can be used to notify the user of something that does not require an immediate reaction.
...used for ipc security checks, and to determine whether the alert is actionable.
nsIAnnotationService
otherwise, uris can exist in history as annotations but the user has no way of knowing it, potentially violating their privacy expectations about actions such as clear history.
...otherwise, uris can exist in history as annotations but the user has no way of knowing it, potentially violating their privacy expectations about actions such as clear history.
nsIAuthPromptWrapper
the nsiauthpromptwrapper interface is an override of nsiauthprompt which performs some action on the data going through nsiauthprompt methods.
... persisting data from the prompts and using it to pre-fill subsequent prompts would be one such action.
nsICommandLine
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.
nsIDocShell
layouthistorystate nsilayouthistorystate loadedtransindex long keeps track of the previous shtransaction index and the current shtransaction index at the time that the doc shell begins to load.
... previoustransindex long keeps track of the previous shtransaction index and the current shtransaction index at the time that the doc shell begins to load.
nsIMemoryReporter
units_percentage 3 the amount contains a fraction that should be expressed as a percentage.
...this allows a fractional percentage to be shown even though amount is an integer.
nsINavHistoryObserver
toolkit/components/places/nsinavhistoryservice.idlscriptable this interface is similar to the nsirdfobserver class, but is used to observe interactions on the global history.
... 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 21.0 (firefox 21.0 / thunderbird 21.0 / seamonkey 2.18) warning: if you are in the middle of a batch transaction, there may be a database transaction active.
nsISecurityCheckedComponent
inherits from: nsisupports last changed in gecko 1.7 capability strings in gecko, a "capability" is a string identifying a set of actions that code is allowed to perform.
...code that has the "universalbrowserread" capability is allowed to perform certain actions that allow it to read information from the local system.
nsISelectionPrivate
void startbatchchanges(); wstring tostringwithformat(in string formattype, in unsigned long flags, in print32 wrapcolumn); attributes attribute type description cancacheframeoffset boolean frame offset cache can be used just during calling nseditor::endplaceholdertransaction.
... endplaceholdertransaction will give rise to reflow/refreshing view/scroll, and call times of nstextframe::getpointfromoffset whose return value is to be cached.
nsIXULTemplateResult
this string will be used in the action body from a template as the replacement text.
... for instance, if the text ?name appears in an attribute within the action body, it will be replaced with the result of this method.
XPCOM Interface Reference by grouping
content nsicontentpolicy credentials nsilogininfo nsiloginmanager using nsiloginmanager nsiloginmanagerstorage nsiloginmetainfo history nsiglobalhistory nsiglobalhistory2 nsiglobalhistory3 ssl nsibadcertlistener2 system action nsicancelable application application nsiapplicationupdateservice nsiappshell nsiappshellservice nsiappstartup xul nsixulappinfo nsixulruntime nsixultemplatebuilder nsixultemplatequeryprocessor ...
... nsisearchengine nsisearchsubmission nsiwebbrowserchrome nsiwindowcreator nsiwindowmediator nsiwindowwatcher clipboard nsiclipboard nsiclipboardcommands nsiclipboarddragdrophooklist nsiclipboarddragdrophooks nsiclipboardhelper nsiclipboardowner core action nsitransactionmanager process nsiprocess nsiprocess2 thread nsithread nsithreadeventfilter nsithreadinternal nsithreadmanager nsithreadobserver nsithreadpool nsithreadpoollistener nsitoolkit ...
MailNews fakeserver
server.start(port); // set up a nsimsgincomingserver locally localserver.someactionrequiringconnection(); server.performtest(); // nothing will be executed until the connection is closed // localserver.closecachedconnections() is generally a good way to do so server.resettest(); // set up second test server.performtest(); transaction = server.playtransaction(); // finished with tests server.stop(); } currently, fakeserver provides no means to keep a persiste...
...the server provides the following api to xpcshell tests: <caption> nsmailserver xpcshell api </caption> name arguments returns description performtest none nothing runs until the test is forcibly aborted or stopped normally isstopped none if the server is stopped helper for performtest istestfinished none if the test is finished helper for performtest playtransaction none the transaction the transaction is an object with two properties: us, and them; us is an array of responses we sent, them an array of commands received resettest none nothing prepares the server for the next test without closing the connection start port number nothing starts the server listening stop none nothing stops the server and closes the connection using fakeserver in qa te...
Examine and edit HTML - Firefox Developer Tools
whitespace nodes are represented with a dot: and you get an explanatory tooltip when you hover over them: to see this in action, see the demo at https://mdn.github.io/devtools-examples/whitespace-only-demo/index.html.
... pressing ctrl + c (or cmd + c on a mac) also performs this action.
Basic animations - Web APIs
if you don't want any user interaction you can use the setinterval() function which repeatedly executes the supplied code.
...by setting eventlisteners, we catch any user interaction and execute our animation functions.
Document: drag event - Web APIs
bubbles yes cancelable yes default action continue the drag & drop operation.
...me == "dropzone") { 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 ...
Element.requestFullscreen() - Web APIs
note: this method must be called while responding to a user interaction or a device orientation change; otherwise it will fail.
... you can see this example in action or view or remix the code on glitch.
Element: webkitmouseforcewillbegin event - Web APIs
this offers the opportunity to tell the system not to trigger any default force touch actions if and when the click turns into a force touch event.
... to instruct macos not to engage any default force touch actions if the user apply enough pressure to activate a force touch event, call preventdefault() on the webkitmouseforcewillbegin event object.
Event - Web APIs
WebAPIEvent
an event can be triggered by the user action e.g.
... animationevent audioprocessingevent beforeinputevent beforeunloadevent blobevent clipboardevent closeevent compositionevent cssfontfaceloadevent customevent devicelightevent devicemotionevent deviceorientationevent deviceproximityevent domtransactionevent dragevent editingbeforeinputevent errorevent fetchevent focusevent gamepadevent hashchangeevent idbversionchangeevent inputevent keyboardevent mediastreamevent messageevent mouseevent mutationevent offlineaudiocompletionevent overconstrainederror pagetransitionevent paymentrequestupdateevent pointerevent popstateevent progressevent relatedevent rtcdatachannelevent rtc...
Fetch API - Web APIs
WebAPIFetch API
instead, these are more likely to be created as results of other api actions (for example, fetchevent.respondwith() from service workers).
... headers represents response/request headers, allowing you to query them and take different actions depending on the results.
GlobalEventHandlers.onpointerdown - Web APIs
var targetbox = document.getelementbyid("target"); targetbox.onpointerdown = handledown; function handledown(evt) { var action; switch(evt.pointertype) { case "mouse": action = "clicking"; break; case "pen": action = "tapping"; break; case "touch": action = "touching"; break; default: action = "interacting with"; break; } targetbox.innerhtml = "<strong>thanks for " + action + " me!</strong>"; evt.preventdefault(); } this simply uses onpointerdown ...
... we also have a handler for pointerup events: targetbox.onpointerup = handleup; function handleup(evt) { targetbox.innerhtml = "tap me, click me, or touch me!"; evt.preventdefault(); } this code's job is to just restore the original text into the target box after the user's interaction with the element ends (for example, when they release the mouse button, or when they lift the stylus or finger from the screen).
HTMLElement: pointermove event - Web APIs
the pointermove event is fired when a pointer changes coordinates, and the pointer has not been canceled by a browser touch-action.
... bubbles yes cancelable yes interface pointerevent event handler property onpointermove usage notes the event, which is of type pointerevent, provides all the information you need to know about the user's interaction with the pointing device, including the position, movement distance, button states, and much more.
HTMLFormElement: submit event - Web APIs
however, the submitevent which is sent to indicate the form's submit action has been triggered includes a submitter property, which is the button that was invoked to trigger the submit request.
... examples this example uses eventtarget.addeventlistener() to listen for form submit, and logs the current event.timestamp whenever that occurs, then prevents the default action of submitting the form.
The HTML DOM API - Web APIs
event handlers for events that can be delivered to both elements and documents; these presently include only copy, cut, and paste actions.
...items marked with "*" are required.</p> <form action="" method="get"> <p> <label for="username" required>your name:</label> <input type="text" id="username"> (*) </p> <p> <label for="email">email:</label> <input type="email" id="useremail"> </p> <input type="submit" value="send" id="sendbutton"> </form> result specifications specification status comment html living standard living stand...
Headers - Web APIs
WebAPIHeaders
the headers interface of the fetch api allows you to perform various actions on http request and response headers.
... these actions include retrieving, setting, adding to, and removing headers from the list of the request's headers.
History - Web APIs
WebAPIHistory
back() this asynchronous method goes to the previous page in session history, the same action as when the user clicks the browser's back button.
... forward() this asynchronous method goes to the next page in session history, the same action as when the user clicks the browser's forward button; this is equivalent to history.go(1).
IDBCursor.direction - Web APIs
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.
...for a complete working example, see our idbcursor example (view example live.) function backwards() { list.innerhtml = ''; var transaction = db.transaction(['rushalbumlist'], 'readonly'); var objectstore = transaction.objectstore('rushalbumlist'); objectstore.opencursor(null,'prev').onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.albumtitle + '</strong>, ' + cursor.value.year; ...
IDBCursor.key - Web APIs
WebAPIIDBCursorkey
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.
...for a complete working example, see our idbcursor example (view example live.) function displaydata() { var transaction = db.transaction(['rushalbumlist'], "readonly"); var objectstore = transaction.objectstore('rushalbumlist'); objectstore.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = cursor.value.albumtitle + ', ' + cursor.value.year; list.appendchild(listitem); cons...
IDBCursor.primaryKey - Web APIs
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.
...for a complete working example, see our idbcursor example (view example live.) function displaydata() { var transaction = db.transaction(['rushalbumlist'], "readonly"); var objectstore = transaction.objectstore('rushalbumlist'); objectstore.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = cursor.value.albumtitle + ', ' + cursor.value.year; list.appendchild(listitem); cons...
IDBCursorWithValue.value - Web APIs
example in this example we create a transaction, retrieve an object store, then use a cursor to iterate through all the records in the object store.
...for a complete working example, see our idbcursor example (view example live.) function displaydata() { var transaction = db.transaction(['rushalbumlist'], "readonly"); var objectstore = transaction.objectstore('rushalbumlist'); objectstore.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = cursor.value.albumtitle + ', ' + cursor.value.year; list.appendchild(listitem); cons...
IDBCursorWithValue - Web APIs
example in this example we create a transaction, retrieve an object store, then use a cursor to iterate through all the records in the object store.
...for a complete working example, see our idbcursor example (view example live.) function displaydata() { var transaction = db.transaction(['rushalbumlist'], "readonly"); var objectstore = transaction.objectstore('rushalbumlist'); objectstore.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = cursor.value.albumtitle + ', ' + cursor.value.year; list.appendchild(listitem); cursor.continue(); } else { console.log('entrie...
IDBDatabase: error event - Web APIs
false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2020 }; const db = dbopenrequest.result; db.addeventlistener('error', () => { console.log(`error adding new item: ${newitem.tasktitle}`); }); // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); const objectstore = transaction.objectstore('todolist'); const objectstorerequest = objectstore.add(newitem); }; the same example, using the onerror property instead of addeventlistener(): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded...
...month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2020 }; const db = dbopenrequest.result; db.onerror = () => { console.log(`error adding new item: ${newitem.tasktitle}`); }; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); const objectstore = transaction.objectstore('todolist'); const objectstorerequest = objectstore.add(newitem); }; ...
IDBFactory.open() - Web APIs
WebAPIIDBFactoryopen
// 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 ...
...this is used a lot later on, for opening // transactions and suchlike.
IDBFactory - Web APIs
// 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 data...
...this is used a lot later on, for opening transactions and suchlike.
IDBIndex.isAutoLocale - Web APIs
example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database.
... function displaydatabyindex() { tableentry.innerhtml = ''; var transaction = db.transaction(['contactslist'], 'readonly'); var objectstore = transaction.objectstore('contactslist'); var myindex = objectstore.index('lname'); console.log(myindex.isautolocale); myindex.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tablerow = document.createelement('tr'); tablerow.innerhtml = '<td>' + cursor.value.id + '</td>' ...
IDBIndex.keyPath - Web APIs
WebAPIIDBIndexkeyPath
example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database.
...for a complete working example, see our idbindex-example 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'); console.log(myindex.keypath); myindex.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tablerow = document.createelement('tr'); tablerow.innerhtml = '<td>' + cursor.value.id...
IDBIndex.locale - Web APIs
WebAPIIDBIndexlocale
example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database.
... function displaydatabyindex() { tableentry.innerhtml = ''; var transaction = db.transaction(['contactslist'], 'readonly'); var objectstore = transaction.objectstore('contactslist'); var myindex = objectstore.index('lname'); console.log(myindex.locale); myindex.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tablerow = document.createelement('tr'); tablerow.innerhtml = '<td>' + cursor.value.id + '</td>' ...
IDBIndex.multiEntry - Web APIs
example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database.
...for a complete working example, see our idbindex-example 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'); console.log(myindex.multientry); myindex.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tablerow = document.createelement('tr'); tablerow.innerhtml = '<td>' + cursor.value...
IDBIndex.unique - Web APIs
WebAPIIDBIndexunique
example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database.
...for a complete working example, see our idbindex-example 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'); console.log(myindex.unique); myindex.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tablerow = document.createelement('tr'); tablerow.innerhtml = '<td>' + cursor.value.id ...
IDBIndex - Web APIs
WebAPIIDBIndex
example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database.
...for a complete working example, see our idbindex-example 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'); myindex.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tablerow = document.createelement('tr'); tablerow.innerhtml = '<td>' + cursor.value.id + '</td>' ...
IDBKeyRange.bound() - Web APIs
WebAPIIDBKeyRangebound
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.
... note: for a more complete example allowing you to experiment with key range, have a look at the idbkeyrange directory in the indexeddb-examples repo (view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.bound("a", "f"); 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.appe...
IDBKeyRange.lower - Web APIs
WebAPIIDBKeyRangelower
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.
... note: for 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.appen...
IDBKeyRange.lowerBound() - Web APIs
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.
... note: for 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.lowerbound("f"); 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.appe...
IDBKeyRange.lowerOpen - Web APIs
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.
... note: for 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.loweropen); 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.appe...
IDBKeyRange.only() - Web APIs
WebAPIIDBKeyRangeonly
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.
... 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.) function displaydata() { var keyrangevalue = idbkeyrange.only("a"); 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...
IDBKeyRange.upper - Web APIs
WebAPIIDBKeyRangeupper
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.
... note: for 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.appen...
IDBKeyRange.upperBound() - Web APIs
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.
... note: for 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.upperbound("f"); 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); cur...
IDBKeyRange.upperOpen - Web APIs
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.
... note: for 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.upperopen); 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.appe...
IDBKeyRange - Web APIs
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.
... note: for 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("a", "f"); 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(...
IDBObjectStore.getKey() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbobjectstore's transaction is inactive.
... example let openrequest = indexeddb.open("telemetry"); openrequest.onsuccess = (event) => { let db = event.target.result; let store = db.transaction("netlogs").objectstore("netlogs"); let today = new date(); let yesterday = new date(today); yesterday.setdate(today.getdate() - 1); let request = store.getkey(idbkeyrange(yesterday, today)); request.onsuccess = (event) => { let when = event.target.result; alert("the 1st activity in last 24 hours was occurred at " + when); }; }; specifications specification status comment indexed database api draftthe definition of 'getkey()...
IDBObjectStore.openCursor() - Web APIs
transactioninactiveerror this idbobjectstore's transaction is inactive.
... 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: var transaction = db.transaction("name", "readonly"); var objectstore = transaction.objectstore("name"); var request = objectstore.opencursor(); request.onsuccess = function(event) { var cursor = event.target.result; if(cursor) { // cursor.value contains the current record being iterated through // this is where you'd do something with the result cursor.continue(); } else { // no more results } }; specification specification status comment indexed database api 2.0the definition of 'opencursor()' in that speci...
IDBObjectStore.openKeyCursor() - Web APIs
transactioninactiveerror this idbobjectstore's transaction is inactive.
... 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: var transaction = db.transaction("name", "readonly"); var objectstore = transaction.objectstore("name"); var request = objectstore.openkeycursor(); request.onsuccess = function(event) { var cursor = event.target.result; if(cursor) { // cursor.key contains the key of the current record being iterated through // note that there is no cursor.value, unlike for opencursor // this is where you'd do something with the result cursor.continue(); } else { // no more results } }; specifications specification status comment ...
IDBRequest.error - Web APIs
WebAPIIDBRequesterror
the following error codes are returned under certain conditions: error explanation aborterror if you abort the transaction, then all requests still in progress receive this error.
...for a full working example, see our to-do notifications app (view example live.) var title = "walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist'); // get the do-do list with the specified title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objectstoretitlerequest.result; // update the notified value in the object to "yes" da...
IDBRequest: error event - Web APIs
{ unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }); dbopenrequest.addeventlistener('success', event => { const db = dbopenrequest.result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); const objectstore = transaction.objectstore('todolist'); const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2020 }; const objectstorerequest = objectstore.add(newitem); objectstorerequest.addeventlistener('error', () => { console.log(`error adding ...
...'hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = event => { const db = dbopenrequest.result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); const objectstore = transaction.objectstore('todolist'); const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2020 }; const objectstorerequest = objectstore.add(newitem); objectstorerequest.onerror = () => { console.log(`error adding new item: ${newi...
IDBRequest - Web APIs
idbrequest.transaction read only the transaction for the request.
...(you're just connecting to a database, so there is no transaction to return).
IDBVersionChangeEvent.newVersion - Web APIs
// 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 ...
... // this is used a lot later on, for opening transactions and suchlike.
InputDeviceCapabilities API - Web APIs
this can lead to instances where the same action triggers multiple event handlers.
...it would be useful to know if a touchstart event were also triggered so that we don't take the same action twice.
KeyboardEvent.keyCode - Web APIs
example window.addeventlistener("keydown", function (event) { if (event.defaultprevented) { return; // should do nothing if the default action has been cancelled } var handled = false; if (event.key !== undefined) { // handle the event with keyboardevent.key and set handled true.
... } if (handled) { // suppress "double action" if event handled event.preventdefault(); } }, true); specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'keyboardevent.keycode' in that specification.
LockManager.request() - Web APIs
this shared/exclusive lock pattern is common in database transaction architecture, for example to allow multiple simultaneous readers (each requests a "shared" lock) but only one writer (a single "exclusive" lock).
...in the indexeddb api, this is exposed as "readonly" and "readwrite" transactions which have the same semantics.
MediaDevices.getDisplayMedia() - Web APIs
invalidstateerror the call to getdisplaymedia() was not made from code running due to a user action, such as an event handler.
... the call to getdisplaymedia() must be made from code which is running in response to a user action, such as in an event handler.
MediaMetadata.MediaMetadata() - Web APIs
example the following example creates a new media session and assigns action handlers to it: if ('mediasession' in navigator){ navigator.mediasession.metadata = new mediametadata({ title: "podcast episode title", artist: "podcast host", album: "podcast name", artwork: [{src: "podcast.jpg"}] }); navigator.mediasession.setactionhandler('play', function() {}); navigator.mediasession.setactionhandler('pause', function() {}); navigator.mediasession.s...
...etactionhandler('seekbackward', function() {}); navigator.mediasession.setactionhandler('seekforward', function() {}); navigator.mediasession.setactionhandler('previoustrack', function() {}); navigator.mediasession.setactionhandler('nexttrack', function() {}); } specifications specification status comment media session standardthe definition of 'mediametadata()' in that specification.
MediaSession.metadata - Web APIs
example the following example creates a new media session and assigns action handlers to it: if ('mediasession' in navigator){ navigator.mediasession.metadata = new mediametadata({ title: "podcast episode title", artist: "podcast host", album: "podcast name", artwork: [{src: "podcast.jpg"}] }); navigator.mediasession.setactionhandler('play', function() {}); navigator.mediasession.setactionhandler('pause', function() {}); navigator.mediasession.s...
...etactionhandler('seekbackward', function() {}); navigator.mediasession.setactionhandler('seekforward', function() {}); navigator.mediasession.setactionhandler('previoustrack', function() {}); navigator.mediasession.setactionhandler('nexttrack', function() {}); } specifications specification status comment media session standardthe definition of 'mediasession.metadata' in that specification.
MediaStream - Web APIs
event handlers mediastream.onaddtrack an eventhandler containing the action to perform when an addtrack event is fired when a new mediastreamtrack object is added.
... mediastream.onremovetrack an eventhandler containing the action to perform when a removetrack event is fired when a mediastreamtrack object is removed from it.
Navigator.mediaSession - Web APIs
in addition, the mediasession interface provides the setactionhandler() method, which lets you receive events when the user engages device controls such as either onscreen or physical play, pause, seek, and other similar controls.
... an internet radio app, for example, can use setactionhandler() to let fhe media controls on a keyboard or elsehwere on the user's device be used to control the app's media playback.
PaymentResponse.complete() - Web APIs
the paymentrequest method complete() of the payment request api notifies the user agent that the user interaction is over, and causes any remaining user interface to be closed.
... unknown the success or failure status of the transaction is unknown or irrelevant, and the user agent should not present any notification, even if it normally would.
PaymentResponse - Web APIs
properties paymentresponse.details read only secure context returns a json-serializable object that provides a payment method specific message used by the merchant to process the transaction and determine successful fund transfer.
... paymentresponse.complete() secure context notifies the user agent that the user interaction is over.
Payment processing concepts - Web APIs
verify that the information provided by the user results in a valid transaction.
... this results in the creation and returning of a payment method-specific object that contains the information needed to handle the transaction.
PointerEvent.isPrimary - Web APIs
authors who desire only single-pointer interaction can achieve that by ignoring non-primary pointers.
...if there are multiple primary pointers, these pointers will all produce compatibility mouse events (see pointer_events for more information about pointer, mouse and touch interaction).
Using Pointer Events - Web APIs
create a canvas the touch-action property is set to none to prevent the browser from applying its default touch behavior to the application.
... <canvas id="canvas" width="600" height="600" style="border:solid black 1px; touch-action:none"> your browser does not support canvas element.
PublicKeyCredentialRequestOptions.extensions - Web APIs
txauthsimple usvstring simple transaction authorization.
... txauthgeneric an object with two properties: contenttype (usvstring) content (arraybuffer) generic transaction authorization.
RTCIceCandidate.protocol - Web APIs
this is the preferred protocol for media interactions because of its better performance profile.
... 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.
RTCRtpSender.getParameters() - Web APIs
examples this example gets the sender's current transaction id; the transaction id uniquely identifies the current set of parameters, to ensure that calls to setparameters() are always handled in the correct order, avoiding inadvertently overwriting parameters with older parameters.
... function getsendertransactionid(sender) { let parameters = sender.getparameters(); return parameters.transactionid; } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'getparameters()' in that specification.
ReadableByteStreamController.error() - Web APIs
the error() method of the readablebytestreamcontroller interface causes any future interactions with the associated stream to error.
... syntax readablebytestreamcontroller.error(e); parameters e the error you want future interactions to fail with.
ReadableStreamDefaultController.error() - Web APIs
the error() method of the readablestreamdefaultcontroller interface causes any future interactions with the associated stream to error.
... syntax readablestreamdefaultcontroller.error(e); parameters e the error you want future interactions to fail with.
Storage Access API - Web APIs
in firefox, the storage access grants are phased out after 30 calendar days passing, whereas in safari the storage access grants are phased out after 30 days of browser usage passed without user interaction.
... 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.
TextTrack.mode - Web APIs
WebAPITextTrackmode
however, that means that if you wish to perform any actions involving the track's cues while handling, for example, the load event—in order to process some aspect of the cues upon page load—and the track mode was initially disabled, you'll have to change the mode to either hidden or showing in order to trigger loading of the cues.
... tracks whose kind is "descriptions" are presented in a non-visual form (for example, the text might be spoken to describe the action in the video).
sourceCapabilities - Web APIs
when a single user interaction with an input device generates a series of different input events, the sourcecapabilities property for all of them will point to the same instance of inputdevicecapabilities.
... a device is considered "responsible" for an event only when that interaction is part of the abstraction provided by the web platform.
VTTCue() - Web APIs
WebAPIVTTCueVTTCue
this is the time, given in seconds and fractions of a second, denoting the beginning of the range of the media data to which this cue applies.
...this is the time at which the cue should stop being presented to the user, given in seconds and fractions thereof.
VTTCue - Web APIs
WebAPIVTTCue
param starttime the time, in seconds and fractions of a second, that describes the beginning of the range of the media data to which the cue applies.
... endtime the time, in seconds and fractions of a second, that describes the end of the range of the media data to which the cue applies.
WebGLRenderingContext - Web APIs
webglrenderingcontext.stencilop() sets both the front and back-facing stencil test actions.
... webglrenderingcontext.stencilopseparate() sets the front and/or back-facing stencil test actions.
Raining rectangles - Web APIs
« previousnext » a simple webgl game that demonstrates clearing with solid colors, scissoring, animation, and user interaction.
... animation and user interaction with scissoring this is a simple game.
Simple color animation - Web APIs
color animation with clear this example provides a simple illustration of color animation with webgl, as well as user interaction.
...a click event handler additionally enables the basic user interaction of starting and stopping the animation.
Signaling and video calling - Web APIs
signaling transaction flow the signaling process involves this exchange of messages between two peers using an intermediary, the signaling server.
...} next steps you can now try out this example on glitch to see it in action.
Lighting a WebXR setting - Web APIs
the reflected light ray's color may, of course, be altered in intensity and/or hue due to the light's interaction with the surface, but the angle is always the same.
... realism in player interactions with light if your light source is located within the scene, you probably should try to ensure the viewer's avatar can't physically intersect with the light source.
WebXR permissions and security - Web APIs
user intent user intent is the concept of whether or not an action being performed by code is being performed because of something the user intends to do or not.
... explicit user intent (explicit user consent) is granted when the user has specifically and expressly been asked for permission to perform an action.
Spaces and reference spaces: Spatial tracking in WebXR - Web APIs
other hardware elements can be used similarly to represent other parts of the body, providing additional data to use when simulating the user's actions in their environment.
...for instance, it may be easier to implement the interactions with the objects in a single room in a house by switching to a bounded space representing the single room.
Web Audio API best practices - Web APIs
it provides advanced scheduling capabilities, synths, and effects, and intuitive musical abstractions built on top of the web audio api.
...here is a simple example of creating the context from inside a click event: const button = document.queryselector('button'); button.addeventlistener('click', function() { const audioctx = new audiocontext(); }, false); if however, you create the context outside of a user gesture, its state will be set to suspended and it will need to be started after user interaction.
Controlling multiple parameters with ConstantSourceNode - Web APIs
example let's take a look at this technique in action.
...let's see how the action plays out.
Using the Web Speech API - Web APIs
speech recognition speech recognition involves receiving speech through a device's microphone, which is then checked by a speech recognition service against a list of grammar (basically, the vocabulary you want to have recognised in a particular app.) when a word or phrase is successfully recognised, it is returned as a result (or list of results) as a text string, and further actions can be initiated as a result.
...we are using an onsubmit handler on the form so that the action happens when enter/return is pressed.
WindowOrWorkerGlobalScope.clearInterval() - Web APIs
the clearinterval() method of the windoworworkerglobalscope mixin cancels a timed, repeating action which was previously established by a call to setinterval().
... syntax scope.clearinterval(intervalid) parameters intervalid the identifier of the repeated action you want to cancel.
Synchronous and asynchronous requests - Web APIs
this handler looks at the request's readystate to see if the transaction is complete in line 4; if it is, and the http status is 200, the handler dumps the received content.
... line 5 checks the status code after the transaction is completed.
XMLHttpRequestEventTarget.onabort - Web APIs
the xmlhttprequesteventtarget.onabort is the function called when an xmlhttprequest transaction is aborted, such as when the xmlhttprequest.abort() function is called.
... syntax xmlhttprequest.onabort = callback; values callback is the function to be executed when the transaction is aborted.
XMLHttpRequestEventTarget.onerror - Web APIs
the xmlhttprequesteventtarget.onerror is the function called when an xmlhttprequest transaction fails due to an error.
... example var xmlhttp = new xmlhttprequest(), method = 'get', url = 'https://developer.mozilla.org/'; xmlhttp.open(method, url, true); xmlhttp.onerror = function () { console.log("** an error occurred during the transaction"); }; xmlhttp.send(); specifications specification status comment xmlhttprequest living standard whatwg living standard ...
XMLHttpRequestEventTarget.onloadstart - Web APIs
the xmlhttprequesteventtarget.onloadstart is the function called when an xmlhttprequest transaction starts transferring data.
... syntax xmlhttprequest.onloadstart = callback; values callback is the function to be called when the transaction begins to transfer data.
XRPose.transform - Web APIs
WebAPIXRPosetransform
if the source is a controller in the user's primary hand, a function is called on the targeted object called primaryaction(); otherwise, it calls the targeted object's offhandaction() function.
... xrsession.addeventlistener("select", event => { let source = event.inputsource; let frame = event.frame; let targetraypose = frame.getpose(source.targetrayspace, myrefspace); let targetobject = findtargetusingray(targetray.transform.matrix); if (source.targetraymode == "tracked-pointer") { if (source.handedness == user.handedness) { targetobject.primaryaction(); } else { targetobject.offhandaction(); } } }); specifications specification status comment webxr device apithe definition of 'xrpose.transform' in that specification.
XRSession.onsqueezestart - Web APIs
the xrsession interface's onsqueezestart event handler property can be set to a function which is then invoked to handle the squeezestart event that's sent when the user successfully begins a primary squeeze action on a webxr input device.
... these actions represent the user squeezing or tightly gripping an object or controller.
Using the link role - Accessibility
aria links should be included in the screen reader's “list links” function just like ordinary links, and actions in this dialogue list, such as “activate link” or “move to link”, should perform the same as they do with ordinary links.
...e.target : e.srcelement; if (ref) { window.open(ref.getattribute('data-href'), '_blank'); } } } spanelem.addeventlistener('click', navigatelink); spanelem.addeventlistener('keydown', navigatelink); result notes if pressing the link triggers an action but does not change browser focus or navigate to a new page, you might wish to consider using the button role instead of the link role.
ARIA annotations - Accessibility
below we'll introduce the new features associated with aria annotations, and have a look at some code examples that show them in action.
... role="comment" — semantically denotes a comment/reaction to some content on the page, or to a previous comment.
ARIA: alert role - Accessibility
they don't receive focus, and therefore focus does not need to be managed and no user interaction should be required.
... <p role="alert" style="display: none;">the alert will trigger when the element becomes visible.</p> while triggering an alert via css alone is possible, it is better to rely on javascript because it has more browser/screen reader support and is often more appropriate as part of a larger user interaction such as inside an event handler or form validation.
ARIA: row role - Accessibility
if the interaction provides for the selection state of individual cells, if left to right and top to botton navigation is provided, or if the user interface allows the rearranging of cell order or otherwise changing individual cell order such as through drag and drop, use grid or treegrid instead.
... keyboard interactions none required javascript features none.
ARIA: table role - Accessibility
if the interaction provides for the selection state of individual cells, if left to right and top to bottom navigation is provided, or if the user interface allows the rearranging of cell order or otherwise changing individual cell order such as through drag and drop, use grid or treegrid instead.
... keyboard interactions none required javascript features none.
Alerts - Accessibility
here is a simple form: <form method="post" action="post.php"> <fieldset> <legend>please enter your contact details</legend> <label for="name">your name (required):</label> <input name="name" id="name" aria-required="true"/> <br /> <label for="email">e-mail address (required):</label> <input name="email" id="email" aria-required="true"/> <br /> <label for="website">website (optional):</label> <input...
...also, letting the focus jump around without real user interaction too often is not a nice thing to do in general.
ARIA - Accessibility
it supplements html so that interactions and widgets commonly used in applications can be passed to assistive technologies when there is not otherwise a mechanism.
... wai-aria authoring practices the official best practices documents how best to aria-ify common widgets and interactions.
An overview of accessible web applications and widgets - Accessibility
states describe the current interaction state of an element, informing the assistive technology if it is busy, disabled, selected, or hidden.
... within a form, the spacebar key should select or activate the control, while the enter key should submit the form's default action.
Web Accessibility: Understanding Colors and Luminance - Accessibility
understaning color, luminance, and saturation is important in meeting wcag 2 accessibility guidelines in terms of ensuring enough color contrast for sighted users with color blindness or reduced vision and preventing seizures and other physical reactions in people with vestibular disorders.
... see also mdn accessibilty accessibility learning path color <color> web accessibility for seizures and physical reactions color blindness discussions (general) what is the “grayscale” setting for in accessibility options?
Keyboard - Accessibility
you can make it operable with the keyboard by defining an onkeydown event handler; in most cases, the action taken by event handler should be the same for both types of events.
...the keyboard event handlers should enable the effectively the same interaction as the touch or click handlers.
Understandable - Accessibility
for example, if pressing a button causes the application to exit the current view, the user should be asked to confirm this action, save their work if appropriate, etc.
... 3.3.4 error prevention (legal, financial, data) (aa) in the case of forms involved with entry of sensitive data (such as legal agreements, e-commerce transactions, or personal data), at least one of the following should be true: submissions are reversible.
Resizing background images with background-size - CSS: Cascading Style Sheets
try resizing the example below to see this in action.
...try resizing the example below to see this in action.
Color picker tool - CSS: Cascading Style Sheets
pickertool() { /*========== get dom element by id ==========*/ function getelembyid(id) { return document.getelementbyid(id); } function allowdropevent(e) { e.preventdefault(); } /*========== make an element resizable relative to it's parent ==========*/ var uicomponent = (function uicomponent() { function makeresizable(elem, axis) { var valuex = 0; var valuey = 0; var action = 0; var resizestart = function resizestart(e) { e.stoppropagation(); e.preventdefault(); if (e.button !== 0) return; valuex = e.clientx - elem.clientwidth; valuey = e.clienty - elem.clientheight; document.body.setattribute('data-resize', axis); document.addeventlistener('mousemove', mousemove); document.addeventlistener('mouseup', resizeend); }; ...
...var mousemove = function mousemove(e) { if (action >= 0) elem.style.width = e.clientx - valuex + 'px'; if (action <= 0) elem.style.height = e.clienty - valuey + 'px'; }; var resizeend = function resizeend(e) { if (e.button !== 0) return; document.body.removeattribute('data-resize', axis); document.removeeventlistener('mousemove', mousemove); document.removeeventlistener('mouseup', resizeend); }; var handle = document.createelement('div'); handle.classname = 'resize-handle'; if (axis === 'width') action = 1; else if (axis === 'height') action = -1; else axis = 'both'; handle.classname = 'resize-handle'; handle.setattribute('data-resize', axis); handle.addeventlistener('mousedown', resizestart); elem.appendchild(handle...
Basic Concepts of grid layout - CSS: Cascading Style Sheets
the new fr unit represents a fraction of the available space in the grid container.
... .wrapper { display: grid; grid-template-columns: 2fr 1fr 1fr; } in this final example, we mix absolute sized tracks with fraction units.
CSS values and units - CSS: Cascading Style Sheets
numbers a <number> represents a real number, which may or may not have a decimal point with a fractional component, for example 0.255, 128 or -1.2.
... percentages a <percentage> is a type that represents a fraction of some other value.
calc() - CSS: Cascading Style Sheets
WebCSScalc
- subtraction.
...for instance, calc(50% -8px) will be parsed as a percentage followed by a negative length — an invalid expression — while calc(50% - 8px) is a percentage followed by a subtraction operator and a length.
<color> - CSS: Cascading Style Sheets
mozilla system color extensions -moz-buttondefault the border color that goes around buttons that represent the default action for a dialog box.
...the wcag 2.0 recommendation strongly advises against using color as the only means of conveying a specific message, action, or result.
max() - CSS: Cascading Style Sheets
WebCSSmax
the expressions are full math expressions, so you can use direct addition, subtraction, multiplication and division without using the calc() function itself.
... the expression can be values combining the addition ( + ), subtraction ( - ), multiplication ( * ) and division ( / ) operators, using standard operator precedence rules.
min() - CSS: Cascading Style Sheets
WebCSSmin
the expressions are full math expressions, so you can use direct addition, subtraction, multiplication and division without using the calc() function itself.
... the expression can be values combining the addition ( + ), subtraction ( - ), multiplication ( * ) and division ( / ) operators, using standard operator precedence rules.
Audio and Video Delivery - Developer guides
adaptive streaming media means that the bandwidth and typically quality of the stream can change in real-time in reaction to the user's available bandwidth.
... you may detect click, touch and/or keyboard events to trigger actions such as play, pause and scrubbing.
Mouse gesture events - Developer guides
note: some operating systems, including mac os x and windows 7, provide default actions when gesture events occur.
... if you handle a gesture event and wish to prevent the default action from taking place as well, be sure to call the event's preventdefault() method.
Making content editable - Developer guides
</div> here's the above html in action: executing commands when an html element has contenteditable set to true, the document.execcommand() method is made available.
...r: pointer; } img.intlink { border: 0; } #toolbar1 select { font-size:10px; } #textbox { width: 540px; height: 200px; border: 1px #000000 solid; padding: 12px; overflow: scroll; } #textbox #sourcetext { padding: 0; margin: 0; min-width: 498px; min-height: 200px; } #editmode label { cursor: pointer; } </style> </head> <body onload="initdoc();"> <form name="compform" method="post" action="sample.php" onsubmit="if(validatemode()){this.mydoc.value=odoc.innerhtml;return true;}return false;"> <input type="hidden" name="mydoc"> <div id="toolbar1"> <select onchange="formatdoc('formatblock',this[this.selectedindex].value);this.selectedindex=0;"> <option selected>- formatting -</option> <option value="h1">title 1 &lt;h1&gt;</option> <option value="h2">title 2 &lt;h2&gt;</option> <option ...
User input and controls - Developer guides
when screen orientation matters for your application, through the screen orientation api you can read the screen orientation state and perform other actions.
...touch events can help you implement interactive elements and common interaction gestures on touchscreen devices.
The HTML autocomplete attribute - HTML: Hypertext Markup Language
"transaction-currency" the currency in which the transaction is to take place.
... "transaction-amount" the amount, given in the currency specified by "transaction-currency", of the transaction, for a payment form.
HTML attribute: readonly - HTML: Hypertext Markup Language
attribute interactions the difference between disabled and readonly is that read-only controls can still function and are still focusable, whereas disabled controls can not receive focus and are not submitted with the form and generally do not function as controls until they are enabled.
... because a read-only field cannot have it's value changed by a user interaction, required does not have any effect on inputs with the readonly attribute also specified.
Date and time formats used in HTML - HTML: Hypertext Markup Language
if a fraction of a second is included, it may be from one to three digits long, indicating the number of milliseconds.
...the space has been replaced with the "t" character and the trailing zero in the fraction of a second has been removed to make the string as short as possible.
<body>: The Document Body element - HTML: Hypertext Markup Language
WebHTMLElementbody
onredo function to call when the user has moved forward in undo transaction history.
... onundo function to call when the user has moved backward in undo transaction history.
<fieldset>: The Field Set element - HTML: Hypertext Markup Language
WebHTMLElementfieldset
<form action="#"> <fieldset> <legend>simple fieldset</legend> <input type="radio" id="radio"> <label for="radio">spirit of radio</label> </fieldset> </form> disabled fieldset this example shows a disabled <fieldset> with two controls inside it.
... <form action="#"> <fieldset disabled> <legend>disabled fieldset</legend> <div> <label for="name">name: </label> <input type="text" id="name" value="chris"> </div> <div> <label for="pwd">archetype: </label> <input type="password" id="pwd" value="wookie"> </div> </fieldset> </form> technical summary content categories flow content, sectioning root, listed, form-associated element, palpable content.
<input type="range"> - HTML: Hypertext Markup Language
WebHTMLElementinputrange
note: the following input attributes do not apply to the input range: accept, alt, checked, dirname, formaction, formenctype, formmethod, formnovalidate, formtarget, height, maxlength, minlength, multiple, pattern, placeholder, readonly, required, size, src, and width.
...mal places, you should set the value of step to 0.01: <input type="range" min="5" max="10" step="0.01"> if you want to accept any value regardless of how many decimal places it extends to, you can specify a value of any for the step attribute: <input type="range" min="0" max="3.14" step="any"> this example lets the user select any value between 0 and π without any restriction on the fractional part of the value selected.
<input type="search"> - HTML: Hypertext Markup Language
WebHTMLElementinputsearch
mozactionhint a string indicating the type of action that will be taken when the user presses the enter or return key while editing the field; this is used to determine an appropriate label for that key on a virtual keyboard.
... mozactionhint a mozilla extension, supported by firefox for android, which provides a hint as to what sort of action will be taken if the user presses the enter or return key while editing the field.
<input type="tel"> - HTML: Hypertext Markup Language
WebHTMLElementinputtel
mozactionhint a string indicating the type of action that will be taken when the user presses the enter or return key while editing the field; this is used to determine an appropriate label for that key on a virtual keyboard.
... mozactionhint a mozilla extension, supported by firefox for android, which provides a hint as to what sort of action will be taken if the user presses the enter or return key while editing the field.
<input type="text"> - HTML: Hypertext Markup Language
WebHTMLElementinputtext
mozactionhint a string indicating the type of action that will be taken when the user presses the enter or return key while editing the field; this is used to determine an appropriate label for that key on a virtual keyboard.
... mozactionhint a mozilla extension, supported by firefox for android, which provides a hint as to what sort of action will be taken if the user presses the enter or return key while editing the field.
<isindex> - HTML: Hypertext Markup Language
WebHTMLElementisindex
action this attribute determined the server url to which the query was sent.
... example <head> <isindex prompt="search document..." action="/search"> </head> in past browsers, this would generate, at parse time, a dom tree equivalent to the following html: <form action="/search"> <hr> <label> search document...
<output>: The Output element - HTML: Hypertext Markup Language
WebHTMLElementoutput
the html output element (<output>) is a container element into which a site or app can inject the results of a calculation or the outcome of a user action.
...assistive technology will thereby announce the results of ui interactions posted inside it without requiring that focus is switched away from the controls that produce those results.
HTML elements reference - HTML: Hypertext Markup Language
WebHTMLElement
<meter> the html <meter> element represents either a scalar value within a known range or a fractional value.
... <output> the html output element (<output>) is a container element into which a site or app can inject the results of a calculation or the outcome of a user action.
contextmenu - HTML: Hypertext Markup Language
a context menu is a menu that appears upon user interaction, such as a right-click.
... </li> <li contextmenu="changefont" id="fontsizing"> on this specific list element, you can change the size of the text by using the "increase/decrease font" actions from your context menu </li> <menu type="context" id="changefont"> <menuitem label="increase font" onclick="incfont()"></menuitem> <menuitem label="decrease font" onclick="decfont()"></menuitem> </menu> <li contextmenu="changeimage" id="changeimage"> on the image below, you can fire the "change image" action in your context menu.<br /> <img src="http...
Evolution of HTTP - HTTP
d by a response to that request): get /myimage.gif http/1.0 user-agent: ncsa_mosaic/2.0 (windows 3.1) 200 ok date: tue, 15 nov 1994 08:12:32 gmt server: cern/3.0 libwww/2.17 content-type: text/gif (image content) these novelties have not been introduced as concerted effort, but as a try-and-see approach over the 1991-1995 period: a server and a browser added one feature and it saw if it got traction.
...the actions induced by the api were no more conveyed by new http methods, but only by accessing specific uris with basic http/1.1 methods.
SyntaxError: JSON.parse: bad parsing - JavaScript
g literal syntaxerror: json.parse: bad character in string literal syntaxerror: json.parse: bad unicode escape syntaxerror: json.parse: bad escape character syntaxerror: json.parse: unterminated string syntaxerror: json.parse: no number after minus sign syntaxerror: json.parse: unexpected non-digit syntaxerror: json.parse: missing digits after decimal point syntaxerror: json.parse: unterminated fractional number syntaxerror: json.parse: missing digits after exponent indicator syntaxerror: json.parse: missing digits after exponent sign syntaxerror: json.parse: exponent part is missing a number syntaxerror: json.parse: unexpected end of data syntaxerror: json.parse: unexpected keyword syntaxerror: json.parse: unexpected character syntaxerror: json.parse: end of data while reading object contents s...
... json.parse('{"foo": 01}'); // syntaxerror: json.parse: expected ',' or '}' after property value // in object at line 1 column 2 of the json data json.parse('{"foo": 1.}'); // syntaxerror: json.parse: unterminated fractional number // at line 1 column 2 of the json data instead write just 1 without a zero and use at least one digit after a decimal point: json.parse('{"foo": 1}'); json.parse('{"foo": 1.0}'); ...
Array.prototype.slice() - JavaScript
syntax arr.slice([start[, end]]) parameters start optional zero-based index at which to start extraction.
... end optional zero-based index before which to end extraction.
Intl.NumberFormat.prototype.formatToParts() - JavaScript
fraction the fraction number.
...the formattoparts method enables locale-aware formatting of strings produced by numberformat formatters by providing you the string in parts: formatter.formattoparts(number); // return value: [ { type: "integer", value: "3" }, { type: "group", value: "." }, { type: "integer", value: "500" }, { type: "decimal", value: "," }, { type: "fraction", value: "00" }, { type: "literal", value: " " }, { type: "currency", value: "€" } ] now the information is available separately and it can be formatted and concatenated again in a customized way.
Intl.NumberFormat.prototype.resolvedOptions() - JavaScript
only one of the following two groups of properties is included: minimumintegerdigits minimumfractiondigits maximumfractiondigits the values provided for these properties in the options argument or filled in as defaults.
...resolvedoptions method var de = new intl.numberformat('de-de'); var usedoptions = de.resolvedoptions(); usedoptions.locale; // "de-de" usedoptions.numberingsystem; // "latn" usedoptions.notation; // "standard" usedoptions.signdisplay; // "auto" usedoption.style; // "decimal" usedoptions.minimumintegerdigits; // 1 usedoptions.minimumfractiondigits; // 0 usedoptions.maximumfractiondigits; // 3 usedoptions.usegrouping; // true specifications specification ecmascript internationalization api (ecma-402)the definition of 'intl.numberformat.prototype.resolvedoptions' in that specification.
Intl.PluralRules.prototype.resolvedOptions() - JavaScript
only one of the following two groups of properties is included: minimumintegerdigits minimumfractiondigits maximumfractiondigits the values provided for these properties in the options argument or filled in as defaults.
... examples using the resolvedoptions method var de = new intl.pluralrules('de-de'); var usedoptions = de.resolvedoptions(); usedoptions.locale; // "de-de" usedoptions.maximumfractiondigits; // 3 usedoptions.minimumfractiondigits; // 0 usedoptions.minimumintegerdigits; // 1 usedoptions.pluralcategories; // array [ "one", "other" ] usedoptions.type; // "cardinal" specifications specification ecmascript internationalization api (ecma-402)the definition of 'intl.pluralrules.prototype.resolvedoptions' in that specification.
Math.pow() - JavaScript
examples using math.pow() // simple math.pow(7, 2); // 49 math.pow(7, 3); // 343 math.pow(2, 10); // 1024 // fractional exponents math.pow(4, 0.5); // 2 (square root of 4) math.pow(8, 1/3); // 2 (cube root of 8) math.pow(2, 0.5); // 1.4142135623730951 (square root of 2) math.pow(2, 1/3); // 1.2599210498948732 (cube root of 2) // signed exponents math.pow(7, -2); // 0.02040816326530612 (1/49) math.pow(8, -1/3); // 0.5 // signed bases math.pow(-7, 2); // 49 (squares are positive) math.pow(-7, 3); // -343...
... (cubes can be negative) math.pow(-7, 0.5); // nan (negative numbers don't have a real square root) // due to "even" and "odd" roots laying close to each other, // and limits in the floating number precision, // negative bases with fractional exponents always return nan math.pow(-7, 1/3); // nan specifications specification ecmascript (ecma-262)the definition of 'math.pow' in that specification.
Number.prototype.toFixed() - JavaScript
the number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length.
... examples using tofixed let numobj = 12345.6789 numobj.tofixed() // returns '12346': note rounding, no fractional part numobj.tofixed(1) // returns '12345.7': note rounding numobj.tofixed(6) // returns '12345.678900': note added zeros (1.23e+20).tofixed(2) // returns '123000000000000000000.00' (1.23e-10).tofixed(2) // returns '0.00' 2.34.tofixed(1) // returns '2.3' 2.35.tofixed(1) // returns '2.4'.
Number - JavaScript
this means it can represent fractional values, but there are some limits to what it can store.
... instance methods number.prototype.toexponential(fractiondigits) returns a string representing the number in exponential notation.
SharedArrayBuffer.prototype.slice() - JavaScript
syntax sab.slice() sab.slice(begin) sab.slice(begin, end) parameters begin optional zero-based index at which to begin extraction.
... end optional zero-based index before which to end extraction.
String.prototype.slice() - JavaScript
syntax str.slice(beginindex[, endindex]) parameters beginindex the zero-based index at which to begin extraction.
... endindex optional the zero-based index before which to end extraction.
TypedArray.prototype.slice() - JavaScript
syntax typedarray.slice([begin[, end]]) parameters begin optional zero-based index at which to begin extraction.
... end optional zero-based index before which to end extraction.
Expressions and operators - JavaScript
- subtraction operator.
... -= subtraction assignment <<= left shift assignment.
switch - JavaScript
take a look at this example: const action = 'say_hello'; switch (action) { case 'say_hello': let message = 'hello'; console.log(message); break; case 'say_hi': let message = 'hi'; console.log(message); break; default: console.log('empty action received.'); break; } this example will output the error uncaught syntaxerror: identifier 'message' has already been declared which you were not probably expe...
... we can easily fix this by wrapping our case clauses with brackets: const action = 'say_hello'; switch (action) { case 'say_hello': { // added brackets let message = 'hello'; console.log(message); break; } // added brackets case 'say_hi': { // added brackets let message = 'hi'; console.log(message); break; } // added brackets default: { // added brackets console.log('empty action received.'); break; } // added brackets } this code ...
MathML element reference - MathML
mathml presentation elements a to z math <math> (top-level element) a <maction> (binded actions to sub-expressions) <maligngroup> (alignment group) <malignmark> (alignment points) e <menclose> (enclosed contents) <merror> (enclosed syntax error messages) f <mfenced> (parentheses) <mfrac> (fraction) g <mglyph> (displaying non-standard symbols) i <mi> (identifier) l <mlabeledtr> (labeled row in a table or a matrix) <mlongdiv> (long division not...
... <mpadded> <mphantom> <mroot> <mrow> <msqrt> <mstyle> script and limit elements <mmultiscripts> <mover> <mprescripts> <msub> <msubsup> <msup> <munder> <munderover> <none> tabular math <maligngroup> <malignmark> <mlabeledtr> <mtable> <mtd> <mtr> elementary math <mlongdiv> <mscarries> <mscarry> <msgroup> <msline> <msrow> <mstack> uncategorized elements <maction> semantic annotations <annotation> <annotation-xml> <semantics> ...
MathML documentation index - MathML
WebMathMLIndex
10 <maction> mathml, mathml reference, mathml:element, mathml:enlivening expressions the following example uses the "toggle" actiontype: 11 <math> mathml, mathml reference, mathml:element the top-level element in mathml is <math>.
... 15 <mfrac> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <mfrac> element is used to display fractions.
Animation performance and frame rate - Web Performance
users expect all interface interactions to be smooth and all user interfaces to be responsive.
...it's unlikely you'll see a smooth animation here, especially when you add in user interaction.
Lazy loading - Web Performance
lazy loading can occur on different moments in the application, but it typically happens on some user interactions such as scrolling and navigation.
...most of those images are off-screen (non-critical), requiring user interaction (an example being scroll) in order to view them.
Performance Monitoring: RUM vs synthetic monitoring - Web Performance
this technique monitors an application’s actual user interactions.
...as users interact with an application, all performance timings are captured, regardless of what actions are taken or pages viewed.
Web Performance
web performance is how long a site takes to load, become interactive and responsive, and how smooth the content is during user interactions - is the scrolling smooth?
...these perceptions are impacted by actual page load time, idling, responsiveness to user interaction, and the smoothness of scrolling and other animations.
Add to Home screen - Progressive web apps (PWAs)
tapping this will show a confirmation banner — pressing the big + add to home screen button completes the action, adding the app to the home screen.
... respond to the user's interaction with the prompt using the userchoice property, again available on the beforeinstallprompt event object.
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
but instead of relying only on user actions, we can do more, using push messages and notifications to automatically re-engage and deliver new content whenever it is available.
...the result of the user action can be default, granted or denied.
Media - Progressive web apps (PWAs)
there are five special selectors: selector selects e:hover any e element that has the pointer over it e:focus any e element that has keyboard focus e:active the e element that is involved in the current user action e:link any e element that is a hyperlink to a url that the user has not visited recently e:visited any e element that is a hyperlink to a url that the user has visited recently note: the information that can be obtained from the :visited selector is restricted in gecko 2.0.
... action: printing a document note: this snippet only works on firefox since it erroneously increments the css counter for fix-position elemnts.
Progressive web apps (PWAs)
being a secure site is not only a best practice, but it also establishes your web application as a trusted site especially if users need to make secure transactions.
...but instead of relying only on user actions, we can do more, using push messages and notifications to automatically re-engage and deliver new content whenever it is available.introduction to progressive web appsthis article provides an introduction to progressive web apps (pwas), discussing what they are and the advantages they offer over regular web apps.making pwas work offline with service workersin this article we took a simple look a...
repeatCount - SVG: Scalable Vector Graphics
it can include partial iterations expressed as fraction values.
... a fractional value describes a portion of the simple duration.
Tools for SVG - SVG: Scalable Vector Graphics
raphael js url: raphaeljs.com this is a javascript library, that acts as an abstraction layer between browser implementations.
... snap.svg url: snapsvg.io a newer javascript abstraction layer from the same author of raphael js.
SVG: Scalable Vector Graphics
WebSVG
svg dom interface reference details about the svg dom api, for interaction with javascript.
... other resources: xml, css, dom, canvas examples google maps (route overlay) & docs (spreadsheet charting) svg bubble menus svg authoring guidelines an overview of the mozilla svg project frequently asked questions regarding svg and mozilla svg as an image svg animation with smil svg art gallery animation and interactions like html, svg has a document model (dom) and events, and is accessible from javascript.
Loading and running WebAssembly code - WebAssembly
the newer webassembly.compilestreaming/webassembly.instantiatestreaming methods are a lot more efficient — they perform their actions directly on the raw stream of bytes coming from the network, cutting out the need for the arraybuffer step.
... 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.
Using the WebAssembly JavaScript API - WebAssembly
if you save your example code now and load it a browser that supports webassembly, you’ll see this in action!
... you can see multiplicity in action in our understanding text format article — see the mutating tables and dynamic linking section.
2015 MDN Fellowship Program - Archive of obsolete content
required skills and experience experienced web developer with expertise in javascript, css, html as well as with efficient network interaction (queuing resource fetching, etc.).
Window: deviceproximity event - Archive of obsolete content
bubbles no cancelable no interface deviceproximityevent target defaultview (window) default action none event handler property window.ondeviceproximity specification proximity sensor other properties property type description value read only double (float) the measured proximity of the distant device (distance in centimetres).
Window: userproximity event - Archive of obsolete content
bubbles no cancelable no interface userproximityevent target defaultview (window) default action none event handler property window.onuserroximity specification proximity sensor note: this event has been disabled by default in firefox 62, behind the device.sensors.proximity.enabled preference (bug 1462308).
Cross-domain Content Scripts - Archive of obsolete content
a "show" message when it is shown adds a button which shows the panel when it is clicked // main.js var data = require("sdk/self").data; var forecast_panel = require("sdk/panel").panel({ height: 50, contenturl: data.url("panel.html"), contentscriptfile: data.url("panel-script.js") }); forecast_panel.on("show", function(){ forecast_panel.port.emit("show"); }); require("sdk/ui/button/action").actionbutton({ id: "get-forecast", label: "get the forecast", icon: "./icon-16.png", onclick: function() { forecast_panel.show(); } }); the "panel.html" just includes a <div> block for the forecast: <!doctype html> <!-- panel.html --> <html> <head></head> <body> <div id="forecast_summary"></div> </body> </html> the "panel-script.js" uses xmlhttprequest to fetch the...
port - Archive of obsolete content
the button sends the content script a message called "get-first-para" when it is clicked: // main.js pageworker = require("sdk/page-worker").page({ contentscriptfile: require("sdk/self").data.url("listener.js"), contenturl: "http://en.wikipedia.org/wiki/chalk" }); require("sdk/ui/button/action").actionbutton({ id: "get-first-para", label: "get-first-para", icon: "./icon-16.png", onclick: function() { console.log("sending 'get-first-para'"); pageworker.port.emit("get-first-para"); } }); the content script listens for "get-first-para".
Content Scripts - Archive of obsolete content
this add-on adds a button to firefox: when the user clicks the button, the add-on attaches a content script to the active tab, sends the content script a message called "my-addon-message", and listens for a response called "my-script-response": //main.js var tabs = require("sdk/tabs"); var buttons = require("sdk/ui/button/action"); var self = require("sdk/self"); buttons.actionbutton({ id: "attach-script", label: "attach the script", icon: "./icon-16.png", onclick: attachscript }); function attachscript() { var worker = tabs.activetab.attach({ contentscriptfile: self.data.url("content-script.js") }); worker.port.on("my-script-response", function(response) { console.log(response); }); worker.po...
page-mod - Archive of obsolete content
the following add-on creates a button which, when clicked, highlights all the div elements in the document loaded into the active tab: require("sdk/ui/button/action").actionbutton({ id: "highlight-divs", label: "highlight divs", icon: "./icon-16.png", onclick: function() { require("sdk/tabs").activetab.attach({ contentscript: 'var divs = document.getelementsbytagname("div");' + 'for (var i = 0; i < divs.length; ++i) {' + 'divs[i].setattribute("style", "border: solid red 1px;");' + '}' }); } }); to ru...
windows - Archive of obsolete content
} }); returns the window that was opened: var windows = require("sdk/windows").browserwindows; var example = windows.open("http://www.example.com"); require("sdk/ui/button/action").actionbutton({ id: "read", label: "read", icon: "./read.png", onclick: function() { example.close(); } }); this example uses the action button api, which is only available from firefox 29 onwards.
content/loader - Archive of obsolete content
loader adds code to initialize and validate a set of properties for managing content scripts: contenturl contentscript contentscriptfile contentscriptwhen contentscriptoptions allow when certain of these properties are set, the loader emits a propertychange event, enabling its users to take the appropriate action.
core/promise - Archive of obsolete content
this can be used to perform an action that requires values from several promises, like getting user information and server status, for example: const { all } = require('sdk/core/promise'); all([getuser, getserverstatus]).then(function (result) { return result[0] + result[1] }); if one of the promises in the array is rejected, the rejection handler handles the first failed promise and remaining promises remain unfulfilled.
Low-Level APIs - Archive of obsolete content
ui/button/action add a button to the firefox user interface.
Release notes - Archive of obsolete content
firefox 29 highlights added new ui modules for australis: actionbutton, togglebutton, frame and toolbar.
Creating annotations - Archive of obsolete content
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.
Displaying annotations - Archive of obsolete content
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.
Implementing the widget - Archive of obsolete content
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.
Storing annotations - Archive of obsolete content
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.
Annotator - Archive of obsolete content
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.
Developing for Firefox Mobile - Archive of obsolete content
system/environment supported system/events supported system/runtime supported system/unload supported system/xul-app supported tabs/utils supported test/assert supported test/harness supported test/httpd supported test/runner supported test/utils supported ui/button/action not supported ui/button/toggle not supported ui/frame not supported ui/id supported ui/sidebar not supported ui/toolbar not supported util/array supported util/collection supported util/deprecate supported util/list supported util/match-pattern supported util/object ...
Unit Testing - Archive of obsolete content
to show the module in use, edit the "index.js" file as follows: var base64 = require("./base64"); var button = require("sdk/ui/button/action").actionbutton({ id: "base64", label: "base64", icon: "./icon-16.png", onclick: function() { encoded = base64.btoa("hello"); console.log(encoded); decoded = base64.atob(encoded); console.log(decoded); } }); to run this example you'll also have to have an icon file named "icon-16.png" saved in your add-ons "data" directory.
Alerts and Notifications - Archive of obsolete content
bedcomp/window-watcher;1'] .getservice(components.interfaces.nsiwindowwatcher) .openwindow(null, 'chrome://global/content/alerts/alert.xul', '_blank', 'chrome,titlebar=no,popup=yes', null); win.arguments = [image, title, msg, false, '']; } using notification box another way of non-modal notification and further interaction with users is using of xul elements notificationbox and notification (implicitly).
File I/O - Archive of obsolete content
there might be races between different processes and/or threads, e.g., a file could be immediately created or deleted after you check the existence but before you can perform any other actions such as opening the file for reading or writing.
Examples and demos from articles - Archive of obsolete content
here is a possible and minimalist example of such abstraction, which for this reason we named minidaemon.
Preferences - Archive of obsolete content
when a change is made to the preferences, you can take the appropriate action (such as reinitializing variables or toggling display properties in xul components).
JavaScript Daemons Management - Archive of obsolete content
advantages of this approch: abstraction passage of this object to javascript timers (both setinterval and settimeout) optimisation (avoiding closures) modularity the code the code of this framework is split into three files: daemon.js (the core) daemon-safe.js (an extension of the core which adds a replacement of setinterval with a recursive invocation of settimeout) daemon-methods.js (a wide and highly scalable collection o...
Code snippets - Archive of obsolete content
browser-oriented code tabbed browser code (firefox/seamonkey) basic operations, such as page loading, with the tabbed browser, which is the heart of mozilla's browser applications cookies reading, writing, modifying, and removing cookies page loading code used to load pages, reload pages, and listen for page loads interaction between privileged and non-privileged code how to communicate from extensions to websites and vice-versa.
Extension Etiquette - Archive of obsolete content
for example, "does an action in the browser." documentation assume that the vast majority of your users don't have inner working knowledge of mozilla.
Inline options - Archive of obsolete content
settings are tied to actual preferences, except the button setting, which is designed more for actions.
Appendix B: Install and Uninstall Scripts - Archive of obsolete content
the data parameter explains the action being performed.
Appendix D: Loading Scripts - Archive of obsolete content
// this is the default action.
Appendix F: Monitoring DOM changes - Archive of obsolete content
monkey patching in many instances, especially when dealing with chrome code, the best way to modify actions which result in dom mutations is by wrapping the functions that trigger those changes.
Getting Started with Firefox Extensions - Archive of obsolete content
the mozilla add-ons repository (amo) holds an extensive number of extensions with a wide variety of functions: content filtering (adblock plus, noscript), web application interaction (delicious bookmarks, ebay companion) and web development (dom inspector, firebug).
Intercepting Page Loads - Archive of obsolete content
asubject.cancel(components.results.ns_binding_aborted); } } } this example shows how you can obtain the url for the request, analyze it using regular expressions, and perform actions on it such as modifying http headers, or even canceling the request.
The Essentials of an Extension - Archive of obsolete content
the command event is the most frequently used in firefox, since it corresponds to the main action for most ui elements.
XPCOM Objects - Archive of obsolete content
this specifies that these are input parameters, values that the method will use to perform its actions.
Performance best practices in extensions - Archive of obsolete content
if there is anything that can be done even a fraction of a second later, you can use an nsitimer or the window.settimeout() method to schedule that work for later.
Security best practices in extensions - Archive of obsolete content
one way to do this is to use custom dom events; see interaction between privileged and non-privileged pages.
Updating addons broken by private browsing changes - Archive of obsolete content
internalsave: takes a new required document argument (prior to the optional boolean and string arguments) indicating the document that originated the save action.
Search Extension Tutorial (Draft) - Archive of obsolete content
other settings violations designed to restrict user choice will result in stronger action, such as blacklisting of the add-ons in question.
Add-ons - Archive of obsolete content
interaction between privileged and non-privileged pages an easy way to send data from a web page to an extension is by using custom dom events.
Creating reusable content with CSS and XBL - Archive of obsolete content
action: an xbl demonstration make a new html document, doc6.html.
XML data - Archive of obsolete content
action: an xml demonstration make a new xml file, doc9.xml.
XUL user interfaces - Archive of obsolete content
action: a xul demonstration make a new xul document as a plain text file, doc7.xul.
CSS3 - Archive of obsolete content
clarifies: interaction of media-dependent @import statements and style sheet loading requirements.
Creating a dynamic status bar extension - Archive of obsolete content
see it in action now you can install it and try it out.
MozAudioAvailable - Archive of obsolete content
general info specification dom l3 interface event bubbles no cancelable no target element default action none.
MozBeforeResize - Archive of obsolete content
general info specification mozilla specific interface event bubbles no cancelable no target window default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
cached - Archive of obsolete content
general info specification offline interface event bubbles no cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree).
chargingchange - Archive of obsolete content
general info specification battery interface event bubbles no cancelable no target batterymanager default action none properties the event callback doesn't receive any event objects, but properties can be read from the batterymanager object received from the navigator.getbattery method.
chargingtimechange - Archive of obsolete content
general info specification battery interface event bubbles no cancelable no target batterymanager default action none properties the event callback doesn't receive any event objects, but properties can be read from the batterymanager object received from the navigator.getbattery method.
checking - Archive of obsolete content
general info specification offline interface event bubbles no cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree).
dischargingtimechange - Archive of obsolete content
general info specification battery interface event bubbles no cancelable no target batterymanager default action none properties the event callback doesn't receive any event objects, but properties can be read from the batterymanager object received from the navigator.getbattery method.
downloading - Archive of obsolete content
general info specification offline interface event bubbles no cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree).
error - Archive of obsolete content
general info specification offline interface event bubbles no cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree).
levelchange - Archive of obsolete content
general info specification battery interface event bubbles no cancelable no target batterymanager default action none properties the event callback doesn't receive any event objects, but properties can be read from the batterymanager object received from the navigator.getbattery method.
noupdate - Archive of obsolete content
general info specification offline interface event bubbles no cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree).
obsolete - Archive of obsolete content
general info specification offline interface event bubbles no cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree).
progress - Archive of obsolete content
general info specification offline interface progressevent bubbles no cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree).
updateready - Archive of obsolete content
general info specification offline interface event bubbles no cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree).
JXON - Archive of obsolete content
right;", "keyvalue": "quantity:" }, "td": { "input": { "@type": "text", "@name": "myinput", "@onkeypress": "return numbersonly(this, event);", "@onpaste": "return false;" } } }] }, "p": { "input": { "@type": "submit", "@value": "purchase!" } }, "@action": "https://secure-test.worldpay.com/wcc/purchase", "@name": "buyform", "@method": "post" } }); will populate the previous element in the following way: <div id="form_container"> <form action="https://secure-test.worldpay.com/wcc/purchase" name="buyform" method="post"> <script type="text/javascript"> function numbersonly(otocheckfield, okeyevent) { return okeyevent.
List of Mozilla-Based Applications - Archive of obsolete content
browser for mac os 9 clines a clone of color lines (game) standalone version cloud web operating system cloud browse iphone/ipad/ipod touch browser seems to be firefox running remotely on servers that people access through device conkeror keyboard-oriented browser convertigo enterprise mashup server server tool for transactional web scraping and for web clipping cometbird another firefox mod modified version of firefox correo email couac (fr) web-based email and jabber app couchdb document-oriented database uses spidermonkey courtanet benefit (fr) underwriting software for french insurance brokers crosscheck browserless testin...
Source code directories overview - Archive of obsolete content
config contains scripts and programs used by mozilla developers to manipulate the code base and to perform special actions inside makefiles.
Autodial for Windows NT - Archive of obsolete content
mozilla 1.1 also includes a fix to bug 157733, which allows our interaction with the autodial service to work a little more reliably.
Automatically Handle Failed Asserts in Debug Builds - Archive of obsolete content
at the first match, it will take the action specified by the dword's value.
Getting Started - Archive of obsolete content
however, if your application doesn't detect classic.jar as a standard zip archive, rename the file classic.zip and continue extraction.
Creating a Skin for Firefox/Getting Started - Archive of obsolete content
however, if your application doesn't detect classic.jar as a standard zip archive, rename the file classic.zip and continue extraction.
Creating regular expressions for a microsummary generator - Archive of obsolete content
here is what the <pages> section might look like in a microsummary generator for ebay auction item pages: <pages> <include>^http://cgi\.ebay\.com/.*qqitemz.*qqcmdzviewitem</include> <include>^http://cgi\.ebay\.com/ws/ebayisapi\.dll\?viewitem&amp;.*item=</include> </pages> to see these regular expressions in action, install the ebay auction item microsummary generator available from this page of example generators.
Drag and drop events - Archive of obsolete content
you can see an example of these events in action here: view source view example see also ^: drag and drop html 5 working draft: drag and drop nsidragservice ...
Document Loading - From Load Start to Finding a Handler - Archive of obsolete content
dramatis personae this document focuses on the interaction of three classes with each other, but other mozilla components are also involved.
Layout FAQ - Archive of obsolete content
since the dragging action is involved, you might need to disable it.
Layout System Overview - Archive of obsolete content
the idea of formatting text and graphics to fit within a given screen area sounds simple, but the interaction of in-flow and out-of-flow elements, the considerations of incremental page rendering, and the performance concerns of dynamic content changes makes for a system that has a lot of work to do, and a lot of data to manage.
Code snippets - Archive of obsolete content
this page documents how to perform custom actions with firefox sync via javascript.
JavaScript Client API - Archive of obsolete content
when something of interest occurs, it interacts with the engine to let it know something has happened and it might want to take action store entity that serves as a data store/proxy for information in an engine.
System - Archive of obsolete content
clipboard interactions with the os clipboard system information get information about the platform on which jetpack is running visual effects os-level visual effects abilities devices methods for accessing and controlling devices (ex.
Menu - Archive of obsolete content
ArchiveMozillaJetpackUIMenu
multiple items in a menu may match a target, but action is only ever taken on the first matching item.
UI - Archive of obsolete content
styled content element to display jetpack content tabs adding events and interacting with browser tabs and their contained documents statusbar low-level functions and basic calls notifications a system for alerting users via provided ui mechanisms selection interacting with user-selected content window mitigates and eases interactions between different browser windows ...
jspage - Archive of obsolete content
put","delete"].each(function(b){a[b]=function(){var c=array.link(arguments,{url:string.type,data:$defined}); return this.send($extend(c,{method:b}));};});request.implement(a);})();element.properties.send={set:function(a){var b=this.retrieve("send");if(b){b.cancel(); }return this.eliminate("send").store("send:options",$extend({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")},a));},get:function(a){if(a||!this.retrieve("send")){if(a||!this.retrieve("send:options")){this.set("send",a); }this.store("send",new request(this.retrieve("send:options")));}return this.retrieve("send");}};element.implement({send:function(a){var b=this.get("send"); b.send({data:this,url:a||b.options.url});return this;}});request.html=new class({extends:request,options:{update:false,append:fals...
Message Summary Database - Archive of obsolete content
nsimsgdatabase is an abstraction on top of mdb, which is a set of db interfaces.
Microsummary XML grammar reference - Archive of obsolete content
fractional values (e.g.
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
returnvalue preventdefault() used to prevent the event's default action from occurring.
Mozilla Crypto FAQ - Archive of obsolete content
you do not need to provide such notification in any case, but you may need to take other actions to comply with laws and regulations in your own country concerning encryption technologies.
Plug-n-Hack Phase1 - Archive of obsolete content
for example: var manifest = {"detail":{"url":"http://localhost:8080/manifest"}}; var evt = new customevent('configuresectool', manifest); it is suggested that browsers wishing to support pnh restrict handling of customevents such that they’re ignored where the event happens outside of user initiated actions.
BlogPosts - Archive of obsolete content
just browsing: mozilla prism update thanscorner: mozilla prism - webrunner with pazzaz mozilla prism - a revolution in web apps thanscorner: mozilla webrunner 0.7 site specific browsers webrunner using webrunner webrunner + gears = offline desktop reader webrunner 0.5 webrunner 0.5 - mac support webrunner 0.5 - linux install webrunner, google reader, and google notebook distraction free gtd - 32+ web app files for online todo lists mozilla webrunner: a one-window, tabless browser with no url bar webrunner becomes prism - a mozilla labs project mozilla labs: prism alex faaborg: prism mozilla prism: bringing web apps to the desktop everyone should use site specific browsers mozilla prism portable (spanish) prism, l'avenir des applications web selon mozilla (french) mozilla prism : bundle c...
Prism - Archive of obsolete content
this also cuts down on ui clutter (hence the term distraction-free browser).
Remote XUL - Archive of obsolete content
the remote xul manager extension lets you manage this whitelist, which is maintained using nsipermissionmanager, by creating entries of type "allowxulxbl", like this: components.classes["@mozilla.org/permissionmanager;1"] .getservice(components.interfaces.nsipermissionmanager) .add(uri, 'allowxulxbl', components.interfaces.nsipermissionmanager.allow_action); see using remote xul.
Space Manager High Level Design - Archive of obsolete content
the primary classes that interact with the space manager are: nsblockreflowstate nsblockframe nsboxtoblockadaptor the general interaction model is to create a space manager for a block frame in the context of a reflow, and to associate it with the blockreflowstate so it is passed down to child frames' reflow methods.
Table Cellmap - Archive of obsolete content
a typical code segment to come from the table level down to the rowgroup level nscellmap* map = mfirstmap; while (map) { if (map->getrowcount() > rowindex) { // add your action here } rowindex -= map->getrowcount(); map = map->getnextsibling(); } data entry the usual way to populate the cellmap is via nstableframe::insertrows.
Tamarin Acceptance Test Template - Archive of obsolete content
* * ***** end license block ***** */ var section = "test"; // provide a document reference (ie, actionscript section) var version = "as3"; // version of ecmascript or actionscript var title = "test"; // provide ecma section title or a description var bugnumber = ""; starttest(); // leave this alone /** * calls to addtestcase here.
Tamarin Acceptance Testing - Archive of obsolete content
successfully build release and debug versions of the shell with the debugger enabled [info] successfully run the following test suites: acceptance test suite [info] self tests [info] submit a sandbox build request to test against platforms that you may not have locally [info] available tamarin acceptance test suites actionscript acceptance tests: actionscript acceptance tests running tamarin acceptance tests abc assembler tests cmdline tests performance tests actionscript performance tests running tamarin performance tests built-in self tests see instructions in doc/selftest.html in the tamarin repository.
Tamarin-central rev 703:2cee46be9ce0 - Archive of obsolete content
testing summary acceptance tests have passed on the following supported platforms: * windows, 32 & 64 bit * mac ox x ppc & intel, 32 bit * linux, 32 bit * windows mobile arm version asc-4200 of the actionscript compiler was used for all tests.
The Download Manager schema - Archive of obsolete content
preferredaction integer the action constant from nsimimeinfo representing the action to take upon completing the download.
Using Breakpoints in Venkman - Archive of obsolete content
for more information about the sorts of actions you can take in venkman when you're at a breakpoint, see the debugging basics section of the introductory venkman article.
Binding Implementations - Archive of obsolete content
should we attempt to define a language-independent abstraction, or specify that it must be possible to access base bindings' methods and properties?
Return Codes - Archive of obsolete content
package_folder_not_set -224 install folder not set in installation script extraction_failed -225 extraction of xpi file failed.
setValue - Archive of obsolete content
returns 0 if it succeeded; a nonzero number if it failed to schedule the action.
setValueNumber - Archive of obsolete content
returns 0 if it succeeded; a nonzero number if it failed to schedule the action.
setValueString - Archive of obsolete content
returns 0 if it succeeded; a nonzero number if it failed to schedule the action.
disabled - Archive of obsolete content
if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
member - Archive of obsolete content
if not specified, the variable specified in the uri attribute in the action body of the template's first rule is used.
reserved - Archive of obsolete content
keyboard shortcut for that is accel-t, then this code will not work as expected, as compared to when it is run from web content: document.addeventlistener("keydown", handlekey, true); function handlekey(event) { // listen for the "new tab" shortcut if (event.metakey && (event.key == "t")) { // log a message console.log("intercepted accel-t"); // prevent the default browser action event.preventdefault(); event.stoppropagation(); } } currently, this event handler as coded above runs and logs the message, but the default behavior persists.
Attribute (XUL) - Archive of obsolete content
type setfocus showcaret showcommentcolumn showpopup size sizemode sizetopopup smoothscroll sort sortactive sortdirection sortresource sortresource2 spellcheck src state statedatasource statusbar statustext style subject substate suppressonselect tabindex tabscrolling targets template timeout title toolbarname tooltip tooltiptext tooltiptextnew top type uri useraction validate value var visuallyselected wait-cursor width windowtype wrap wraparound ...
Building accessible custom components in XUL - Archive of obsolete content
we need to define a specific action that will trigger editing the currently focused cell.
Deprecated and defunct markup - Archive of obsolete content
elements <actions> (listed here by mistake or was it a container tag?) typo for <action> --neil 03 march 2011 <autorepeatbutton> (action occurs repeatedly on mouse hover--used to construct other elements; used in <arrowscrollbox> and large drop-down menus) so, not deprecated?
Dynamically modifying XUL-based user interface - Archive of obsolete content
they are the interfaces that are used in any interaction of a script and a document.
CheckboxStateChange - Archive of obsolete content
general info specification xul interface event bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
DOMMenuItemActive - Archive of obsolete content
general info specification xul interface event bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
DOMMenuItemInactive - Archive of obsolete content
general info specification xul interface event bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
RadioStateChange - Archive of obsolete content
general info specification xul interface event bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
ValueChange - Archive of obsolete content
general info specification xul interface event bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
broadcast - Archive of obsolete content
general info specification xul interface event bubbles no cancelable no target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
close - Archive of obsolete content
general info specification xul interface event bubbles no cancelable no target window default action the window is closed.
command - Archive of obsolete content
ArchiveMozillaXULEventscommand
general info specification xul interface xulcommandevent bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
commandupdate - Archive of obsolete content
general info specification xul interface event bubbles no cancelable no target element default action none.
popuphidden - Archive of obsolete content
general info specification xul interface popupevent bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
popuphiding - Archive of obsolete content
general info specification xul interface popupevent bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
popupshown - Archive of obsolete content
general info specification xul interface popupevent bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
Working With Directories - Archive of obsolete content
if the directory already exists, then no action is taken.
reset - Archive of obsolete content
ArchiveMozillaXULMethodreset
for a textbox it also clears the undo transaction list (gecko 1.9).
Floating Panels - Archive of obsolete content
the hidepopup method would be used if you wish to place your own close button on the panel, or wish to close the panel in response to a user action.
MenuButtons - Archive of obsolete content
<toolbarbutton type="menu" image="cookies.png"> <menupopup> <menuitem label="block cookies" type="checkbox"/> <menuitem label="clear cookies"/> </menupopup> </toolbarbutton> the 'menu-button' button the 'menu-button' type of button is used when you want to attach a menu to a button but want to have a default action carried out when the button is pressed by itself.
PopupKeys - Archive of obsolete content
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.
Property - Archive of obsolete content
sessioncount sessionhistory showcommentcolumn showpopup size smoothscroll spinbuttons src state statusbar statustext stringbundle strings style subject suppressonselect tabcontainer tabindex tabs tabscrolling tabpanels tag textlength textvalue timeout title toolbarname toolbarset tooltip tooltiptext top treeboxobject type uri useraction value valuenumber view webbrowserefind webnavigation webprogress width wizardpages wraparound year yearleadingzero related dom element properties dom:element.attributes dom:element.baseuri dom:element.childelementcount dom:element.childnodes dom:element.children dom:element.clientheight dom:element.clientleft dom:element.clienttop dom:element.clientwidth ...
Additional Navigation - Archive of obsolete content
we can then display these results using the following action body.
Building Hierarchical Trees - Archive of obsolete content
<tree datasources="people2.xml" ref="*" querytype="xml" rows="10" flags="dont-build-content"> <treecols> <treecol id="name" primary="true" label="name" flex="1"/> </treecols> <template> <query expr="*"/> <action> <treechildren> <treeitem uri="?"> <treerow> <treecell label="?name"/> </treerow> </treeitem> </treechildren> </action> </template> </tree> « previousnext » ...
Containment Properties - Archive of obsolete content
<vbox datasources="template-guide-ex3.rdf" ref="http://www.xulplanet.com/rdf/a" containment="http://www.xulplanet.com/rdf/relateditem"> <template> <query> <content uri="?start"/> <member container="?start" child="?child"/> </query> <action> <label uri="?child" value="?child"/> </action> </template> </vbox> try this example.
Multiple Queries - Archive of obsolete content
rce: <hbox id="photoslist" datasources="template-guide-photos3.rdf" ref="http://www.xulplanet.com/rdf/myphotos"> <template> <queryset> <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="canal"/> </query> <action> <button uri="?photo" image="?photo" label="view" orient="vertical"/> </action> </queryset> <queryset> <query> <content uri="?start"/> <member container="?start" child="?photo"/> </query> <action> <image uri="?photo" src="?photo"/> </action> </queryset> </template> </hbox> this template contains two queries, the first co...
RDF Modifications - Archive of obsolete content
since all the variables have been filled in, the action body can be processed and a new block of content generated and inserted into the output.
Sorting Results - Archive of obsolete content
<listbox datasources="people2.xml" ref="*" querytype="xml" sort="?name" sortdirection="ascending"> <template> <query expr="*/*"/> <action> <listitem uri="?" label="?name"/> </action> </template> </listbox> it will often be the case that multiple items have the same value, especially for larger amounts of data.
Template and Tree Listeners - Archive of obsolete content
listening for tree changes the second type of listener is used to handle particular actions related to trees.
Template Guide - Archive of obsolete content
basics of xul templates introduction rule compilation rdf template syntax result generation rdf query syntax actions recursive generation simple example bindings additional navigation filtering static content simple query syntax containment properties xml template syntax xml templates xml assignments sql template syntax sqlite templates common template syntax attribute substitution multiple rules using recursive templates building menus with templates special condition tests multiple queries using multiple queries to generate more results building trees with templates building trees building hierarchical trees template modifications template builder interface template and tree listeners rdf modifications additional topics sorting...
textbox (Toolkit autocomplete) - Archive of obsolete content
if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
Creating toolbar buttons (Customize Toolbar Window) - Archive of obsolete content
let button = doc.createelement("toolbarbutton"); button.setattribute("id", button_id); button.setattribute("label", "replace bookmark"); button.setattribute("class", "toolbarbutton-1 chromeclass-toolbar-additional"); button.setattribute("tooltiptext", "replace an existing bookmark"); button.style.liststyleimage = "url(" + icon + ")"; button.addeventlistener("command", main.action, false); toolbox.palette.appendchild(button); this code is thanks to dgutov and is seen in full context at his repository here at github: dgutov / bmreplace / bootstrap.js.
Complete - Archive of obsolete content
if you want to see these techniques in action, then you can download and install the complete allcustom extension: allcustom.xpi (the link is external only because this wiki does not support xpi files.) the extension does not contain any useful functions.
Adding Methods to XBL-defined Elements - Archive of obsolete content
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.
Commands - Archive of obsolete content
in this case, you just need to attach a controller to a listbox which will perform the action in its docommand method.
Custom Tree Views - Archive of obsolete content
: function(row){ return false; }, issorted: function(){ return false; }, getlevel: function(row){ return 0; }, getimagesrc: function(row,col){ return null; }, getrowproperties: function(row,props){}, getcellproperties: function(row,col,props){}, getcolumnproperties: function(colid,col,props){} }; the functions in the example not described above do not need to perform any action, but they must be implemented as the tree calls them to gather additional information.
Numeric Controls - Archive of obsolete content
values with additional fractional digits are rounded to two digits.
Simple Menu Bars - Archive of obsolete content
it does not associate a key action with the menuitem however.
Skinning XUL Files by Hand - Archive of obsolete content
in the meantime, however, skinning a file requires some manual interaction.
Tree View Details - Archive of obsolete content
+ 1, 0, [toinsert[i], false]); } this.treebox.rowcountchanged(idx + 1, toinsert.length); } this.treebox.invalidaterow(idx); }, getimagesrc: function(idx, column) {}, getprogressmode : function(idx,column) {}, getcellvalue: function(idx, column) {}, cycleheader: function(col, elem) {}, selectionchanged: function() {}, cyclecell: function(idx, column) {}, performaction: function(action) {}, performactiononcell: function(action, index, column) {}, getrowproperties: function(idx, prop) {}, getcellproperties: function(idx, column, prop) {}, getcolumnproperties: function(column, element, prop) {}, }; function init() { document.getelementbyid("elementlist").view = treeview; } ]]></script> </window> next, we'll look in more detail at the tree box objec...
Using Remote XUL - Archive of obsolete content
the remote xul manager extension lets you manage this whitelist, which is maintained using nsipermissionmanager, by creating entries of type "allowxulxbl", like this: components.classes["@mozilla.org/permissionmanager;1"] .getservice(components.interfaces.nsipermissionmanager) .add(uri, 'allowxulxbl', components.interfaces.nsipermissionmanager.allow_action); xul (pronounced like "zool"), which is short for xml-based user interface language, is an xml-based language for describing application interfaces.
Accessibility/XUL Accessibility Reference - Archive of obsolete content
see tree treecols see tree treeitem see tree treerow see tree elements that do not expose anything to screen readers/have no discovered accessibility issues yet: arrowscrollbox bbox box grippy hbox menuseparator overlay page script spacer splitter stringbundle stringbundleset vbox window elements not processed yet: action binding bindings broadcaster broadcasterset conditions content dialog dialogheader editor listcell member observes preference preferences prefpane prefwindow resizer richlistbox richlistitem resizer rule scrollbar scrollbox scrollcorner separator template textnode titlebar toolbar toolbarbutton toolbargrippy toolbaritem toolbarpalette toolbarseparator toolbarset...
The Implementation of the Application Object Model - Archive of obsolete content
it needs the ability to chain its nodes using a variety of distinct relationships in order to efficiently implement actions that permanently modify the data itself.
arrowscrollbox - Archive of obsolete content
if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
binding - Archive of obsolete content
that name can then be used within the action of a rule.
button - Archive of obsolete content
if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
checkbox - Archive of obsolete content
if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
colorpicker - Archive of obsolete content
if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
command - Archive of obsolete content
if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
datepicker - Archive of obsolete content
if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
description - Archive of obsolete content
if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
elements - Archive of obsolete content
a action arrowscrollbox b bbox binding bindings box broadcaster broadcasterset button browser c checkbox caption colorpicker column columns commandset command conditions content d deck description dialog dialogheader e editor grid grippy groupbox h hbox i iframe image k key keyset l label listbox listcell listcol listcols listhead listheader listitem m member menu menubar menuitem menulist menupopup menuseparator o observes overlay p page popup popupset preference preferences prefpane prefwindow progressmeter r radio radiogroup resizer richlistbox richlistitem resizer row rows rule s script scrollbar scrollbox scrollcorner ...
key - Archive of obsolete content
ArchiveMozillaXULkey
if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
keyset - Archive of obsolete content
if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
label - Archive of obsolete content
ArchiveMozillaXULlabel
if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
listbox - Archive of obsolete content
if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
listcell - Archive of obsolete content
if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
listhead - Archive of obsolete content
if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
listheader - Archive of obsolete content
if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
listitem - Archive of obsolete content
if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
menu - Archive of obsolete content
ArchiveMozillaXULmenu
if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
menubar - Archive of obsolete content
attributes grippyhidden, statusbar properties accessibletype, statusbar examples <menubar id="sample-menubar"> <menu id="action-menu" label="action"> <menupopup id="action-popup"> <menuitem label="new"/> <menuitem label="save" disabled="true"/> <menuitem label="close"/> <menuseparator/> <menuitem label="quit"/> </menupopup> </menu> <menu id="edit-menu" label="edit"> <menupopup id="edit-popup"> <menuitem label="undo"/> <menuitem label="redo"/> </menupopup> </m...
menuitem - Archive of obsolete content
if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
menulist - Archive of obsolete content
if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
menuseparator - Archive of obsolete content
if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
prefwindow - Archive of obsolete content
<prefwindow xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="my-config-dialog" title="my application: configuration" onunload="onunload(event.target)"> </prefwindow> function onunload(prefwindow) { // do actions there like saving values, password setting (that is not handled as a preference), etc.
radio - Archive of obsolete content
ArchiveMozillaXULradio
if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
radiogroup - Archive of obsolete content
if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
richlistbox - Archive of obsolete content
if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
richlistitem - Archive of obsolete content
if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
scale - Archive of obsolete content
ArchiveMozillaXULscale
if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
tab - Archive of obsolete content
ArchiveMozillaXULtab
if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
tabs - Archive of obsolete content
ArchiveMozillaXULtabs
if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
template - Archive of obsolete content
if not specified, the variable specified in the uri attribute in the action body of the template's first rule is used.
timepicker - Archive of obsolete content
if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
toolbarbutton - Archive of obsolete content
if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
tree - Archive of obsolete content
ArchiveMozillaXULtree
if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
where - Archive of obsolete content
ArchiveMozillaXULwhere
if the condition is true, the corresponding action body is generated; otherwise the result is ignored and no content is generated.
What XULRunner Provides - Archive of obsolete content
the following features are either already implemented or planned: gecko features xpcom networking gecko rendering engine dom editing and transaction support (no ui) cryptography xbl (xbl2 planned) xul svg xslt xml extras (xmlhttprequest, domparser, etc.) web services (soap) auto-update support (not yet complete) type ahead find toolbar history implementation (the places implementation in the 1.9 cycle) accessibility support ipc services for communication between gecko-based apps (not yet complete) storage/sqlite interfaces user interface features the following user interface is supplied by xulru...
calICalendarView - Archive of obsolete content
this link allows the calicalendarview to have a way of creating, modifying, and deleting events based on user interaction with the dom nodes it controls, often without requiring any other user interaction.
calICalendarViewController - Archive of obsolete content
implementing a calicalendarviewcontroller allows for these actions to be performed in a manner consistent with the rest of the application in which the calicalendarview is included.
Archived Mozilla and build documentation - Archive of obsolete content
implementing a calicalendarviewcontroller allows for these actions to be performed in a manner consistent with the rest of the application in which the calicalendarview is included.
Mozilla release FAQ - Archive of obsolete content
here are a few that are specific to the mozilla newsgroups: fe = front end -- the part of mozilla that handles the interface be = back end -- the part of mozilla that does all the behind-the-scenes stuff nspr = netscape portable runtime -- an abstraction layer over the local os gtk = a free gui toolkit native to unix qt = another gui toolkit xp = cross platform xpfe = cross-platform frontend based on nglayout m[number] = milestone release [number] (no longer used) i'm wondering how to do xxx with navigator 3.x...
2006-11-10 - Archive of obsolete content
summary: mozilla.dev.accessibility - oct 28-nov 10, 2006 announcements acm transactions on accessible computing "transactions on accessible computing (taccess) is a quarterly journal that publishes refereed articles addressing issues of computing as it impacts the lives of people with disabilities." read more...
2006-10-20 - Archive of obsolete content
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.
2006-12-01 - Archive of obsolete content
discussions nsicontentpolicy and user interaction the proper way to get user confirmation before trying to load certain file types.
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.
Logging Multi-Process Plugins - Archive of obsolete content
when multi-process plugins are enabled, firefox has the ability to dump additional information about interactions between the browser and a plugin.
Monitoring plugins - Archive of obsolete content
runtime data the runtime information reported is always in fractions of a second.
NPP_DestroyStream - Archive of obsolete content
npres_user_break: user canceled stream directly by clicking the stop button or indirectly by some action such as deleting the instance or initiating higher-priority network operations.
Getting Started - Archive of obsolete content
it guides you, step-by-step, through the basics of rss and shows you working examples in action.
Confidentiality, Integrity, and Availability - Archive of obsolete content
you should be able to access them, of course, and employees at the bank who are helping you with a transaction should be able to access them, but no one else should.
Vulnerabilities - Archive of obsolete content
another example is a race condition error that allows the attacker to perform a specific action with elevated privileges.
The Basics of Web Services - Archive of obsolete content
examples of web services in action as said before, rss and atom feeds are a simple example of how a web service works, most commonly, xml-rpc or soap are also used to communicate between a server and a client.
Theme changes in Firefox 2 - Archive of obsolete content
the following styles must be implemented to support the window that appears when the user browses to a suspected phishing site: #safebrowsing-dim-area-canvas #safebrowsing-page-canvas #safebrowsing-palm-close #safebrowsing-palm-close-container #safebrowsing-palm-google-logo #safebrowsing-palm-message #safebrowsing-palm-message-actionbox #safebrowsing-palm-message-content #safebrowsing-palm-message-tail #safebrowsing-palm-message-tail-container #safebrowsing-palm-message-titlebox .safebrowsing-palm-bigtext .safebrowsing-palm-fixed-width .safebrowsing-palm-paragraph .safebrowsing-palm-smalltext the following styles are used to display, in the url bar, an indicator of whether or not the site is safe: #safebrowsing-u...
-ms-content-zoom-chaining - Archive of obsolete content
starting with windows 8.1, this property is also supported for touchpad interaction.
-ms-content-zoom-limit-max - Archive of obsolete content
starting with windows 8.1, this property is also supported for touchpad interaction.
-ms-content-zoom-limit-min - Archive of obsolete content
starting with windows 8.1, this property is also supported for touchpad interaction.
-ms-content-zoom-limit - Archive of obsolete content
starting with windows 8.1, this property is also supported for touchpad interaction.
-ms-content-zoom-snap-points - Archive of obsolete content
starting with windows 8.1, this property is also supported for touchpad interaction.
-ms-content-zoom-snap-type - Archive of obsolete content
starting with windows 8.1, this property is also supported for touchpad interaction.
-ms-content-zoom-snap - Archive of obsolete content
starting with windows 8.1, this property is also supported for touchpad interaction.
-ms-content-zooming - Archive of obsolete content
starting with windows 8.1, this property is also supported for touchpad interaction.
-ms-overflow-style - Archive of obsolete content
auto-hiding scrollbars are displayed during scrolling or shortly after the pointer interacts with the page, and are hidden shortly after scrolling and pointer interaction stops.
-ms-scroll-rails - Archive of obsolete content
starting with windows 8.1, this property is also supported for touchpad interaction.
-ms-scroll-snap-points-x - Archive of obsolete content
starting with windows 8.1, this property is also supported for mouse, keyboard, and touchpad interaction.
-ms-scroll-snap-points-y - Archive of obsolete content
starting with windows 8.1, this property is also supported for mouse, keyboard, and touchpad interaction.
-ms-scroll-snap-x - Archive of obsolete content
starting with windows 8.1, this property is also supported for mouse, keyboard, and touchpad interaction.
-ms-scroll-snap-y - Archive of obsolete content
starting with windows 8.1, this property is also supported for mouse, keyboard, and touchpad interaction.
-ms-scroll-translation - Archive of obsolete content
this property has no effect on keyboard interaction.
-ms-touch-select - Archive of obsolete content
this property has no effect on mouse, keyboard, or touchpad interaction.
-ms-wrap-through - Archive of obsolete content
the inline flow content of a box is placed in the area that corresponds to the subtraction of its wrapping context from its own content area.
Displaying notifications (deprecated) - Archive of obsolete content
you should take some action.
Using JavaScript Generators in Firefox - Archive of obsolete content
function closegenerator() { settimeout(function() { generator.close(); }, 0); } // our main steps function databaseoperation() { mozindexeddb.open("mytestdatabase").onsuccess = grabevent; var event = yield; var db = event.target.result; if (db.version != "1.0") { db.setversion("1.0").onsuccess = grabevent; event = yield; var transaction = event.transaction; db.createobjectstore("stuff"); transaction.oncomplete = grabevent; yield; } db.transaction(["stuff"]).objectstore("stuff").get("foo").onsuccess = grabevent; event = yield; alert("got result: " + event.target.result); // we're all done.
Array comprehensions - Archive of obsolete content
even strings may be used as input; to achieve the filter and map actions (under array-like objects) above: var str = 'abcdef'; var consonantsonlystr = [for (c of str) if (!(/[aeiouaeiou]/).test(c)) c].join(''); // 'bcdf' var interpolatedzeros = [for (c of str) c + '0' ].join(''); // 'a0b0c0d0e0f0' again, the input form is not preserved, so we have to use join() to revert back to a string.
Debug.setNonUserCodeExceptions - Archive of obsolete content
syntax debug.setnonusercodeexceptions [= bool]; remarks if this property is set to true within a given scope, the debugger can then choose whether to take some specified action on exceptions thrown inside that scope: for instance, if the developer wishes to break on user-unhandled exceptions.
Writing JavaScript for XHTML - Archive of obsolete content
if (variable < 10 && variable >= 0) action(); ]]> </script> note that the cdata section is only necessary because of the < in the code; otherwise you could have ignored it.
XForms Custom Controls - Archive of obsolete content
through xf:setfocus action) and that the control needs to ensure that the proper widget is given focus.
Troubleshooting XForms Forms - Archive of obsolete content
on most webservers you cannot use <submission method="post" action="file.xml"> to a static xml file.
Mozilla XForms Specials - Archive of obsolete content
if you are wondering why we have this restriction, here is a simple example of why: <xforms:model> <xforms:instance src="http://intranetserver/addrbook.xml"/> <xforms:submission id="sub" action="http://megaspammer.com/gather" method="post"/> <xforms:send submission="sub" ev:event="xforms-ready"/> </xforms:model> this imaginary would fetch something that is only accessible for you (f.x.
XForms Range Element - Archive of obsolete content
this determines how much the value of the range will be changed upon user interaction.
Mozilla XForms User Interface - Archive of obsolete content
trigger allows the user to initiate actions (see the spec).
XForms Config Variables - Archive of obsolete content
for now it only enables the xforms 1.1 soap action feature, and only on trunk.
XForms - Archive of obsolete content
however, xforms never gained traction and is now considered obsolete.
Archived open Web documentation - Archive of obsolete content
however, xforms never gained traction and is now considered obsolete.
Popup Window Controls - Archive of obsolete content
any attempt to open a popup window that is the direct result of user action, such as clicking on a hyperlink, should succeed in opening popup windows even if the user has popup controls enabled on your site.
Using the Right Markup to Invoke Plugins - Archive of obsolete content
recommendation in order to overcome the shortcomings that you can't nest object elements in ie and that there isn't a way you can simply use one object element in a cross-browser way (with architecture specific obtainment mechanisms), the best course of action is to dynamically write object elements based on architecture.
Common causes of memory leaks in extensions - Extensions
failing to clean up event listeners extensions can be disabled and removed by user actions, but it also happens when an add-on is updated.
Index - Game development
so let's add some user interaction: a controllable paddle.
Game distribution - Game development
it's easy to prepare a game for them as such an action involves little to no modification of the game itself — usually adding a manifest file containing necessary information in a zipped package containing all the resources is enough.
Game monetization - Game development
remember that you need thousands of downloads of your game to make iaps effective — only a small fraction of players will actually pay for iaps.
3D collision detection - Game development
we have prepared a live collision detection demo (with source code) that you can take a look at to see such techniques in action — this uses the open-source 3d physics engine cannon.js.
Explaining basic 3D theory - Game development
if you want to move on to practice and see some demos in action, follow up with the tutorials below: building up a basic demo with three.js building up a basic demo with babylon.js building up a basic demo with playcanvas building up a basic demo with a-frame go ahead and create some cool cutting-edge 3d experiments yourself!
Building up a basic demo with the PlayCanvas engine - Game development
that's quite an impressive list of features — let's see some in action.
Building up a basic demo with PlayCanvas - Game development
that's quite an impressive list of features — let's see some in action, check out the building up a basic demo with playcanvas engine for details.
GLSL Shaders - Game development
demo let's build a simple demo to explain those shaders in action.
Async scripts for asm.js - Game development
putting async into action getting async compilation is easy: when writing your javascript, just use the async attribute like so: <script async src="file.js"></script> or, to do the same thing via script: var script = document.createelement('script'); script.src = "file.js"; document.body.appendchild(script); (scripts created from script default to async.) the default html shell emscripten generates produces the latte...
Unconventional controls - Game development
} }, this); you can see it in action by watching this video.
Implementing game control mechanisms - Game development
} it will be created once at the start of the game, and will execute this.clickenclave() action assigned to it when clicked, but you can also use the mouse's pointer value in the update() function to make an action: update: function() { // ...
Tiles and tilemaps overview - Game development
the most common case is to use this logic grid to handle collisions, but other uses are possible as well: character spawning points, detecting whether some elements are placed together in the right way to trigger a certain action (like in tetris or bejeweled), path-finding algorithms, etc.
WebRTC data channels - Game development
this article, however, will take advantage of some libraries that can help trivialize the work, and will demonstrate ways to use abstraction to work around implementation differences between browsers.
Plug-in Development Overview - Gecko Plugin API Reference
to see your plug-in in action, simply display the html page that calls it in the browser.
CSRF - MDN Web Docs Glossary: Definitions of Web-related terms
this can be done, for example, by including malicious parameters in a url behind a link that purports to go somewhere else: <img src="https://www.example.com/index.php?action=delete&id=123"> for users who have modification permissions on https://www.example.com, the <img> element executes action on https://www.example.com without their noticing, even if the element is not at https://www.example.com.
Callback function - MDN Web Docs Glossary: Definitions of Web-related terms
a callback function is a function passed into another function as an argument, which is then invoked inside the outer function to complete some kind of routine or action.
Gonk - MDN Web Docs Glossary: Definitions of Web-related terms
gonk is the lower-level operating system of firefox os and consists of a linux kernel (based on the android open source project (aosp)) and userspace hardware abstraction layer (hal).
IndexedDB - MDN Web Docs Glossary: Definitions of Web-related terms
like an sql-based rdbms, indexeddb is a transactional database system.
Inheritance - MDN Web Docs Glossary: Definitions of Web-related terms
data abstraction can be carried up several levels, that is, classes can have superclasses and subclasses.
MVC - MDN Web Docs Glossary: Definitions of Web-related terms
these actions require the model to be updated, so the input is sent to the controller, which then manipulates the model as appropriate, which then sends updated data to the view.
Perceived performance - MDN Web Docs Glossary: Definitions of Web-related terms
in terms of web performance, perceived performance is how fast a user interaction feels rather than how fast an interaction actually is, be that a button press or a page load.
REST - MDN Web Docs Glossary: Definitions of Web-related terms
a document, is transferred with its state and relationships via well-defined, standarized operations and formats or services call themselves restful when they directly modify type of document as opposed to triggering actions somewhere.
RGB - MDN Web Docs Glossary: Definitions of Web-related terms
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.
Real User Monitoring (RUM) - MDN Web Docs Glossary: Definitions of Web-related terms
this technique monitors an application’s actual user interactions.
Time to interactive - MDN Web Docs Glossary: Definitions of Web-related terms
tti, proposed by the web incubator community group in 2018, is intended to provide a metric that describes when a page or application contains useful content and the main thread is idle and free to respond to user interactions, including having event handlers registered.
UI - MDN Web Docs Glossary: Definitions of Web-related terms
user interface (ui) is anything that facilitates the interaction between a user and a machine.
UX - MDN Web Docs Glossary: Definitions of Web-related terms
it is the study of the interaction between users and a system.
Web performance - MDN Web Docs Glossary: Definitions of Web-related terms
it is the frames per second and times the main thread is not available for user interactions.
Routers - MDN Web Docs Glossary: Definitions of Web-related terms
they are distributed by retailers allowing user interaction to the internet.
MDN Web Docs Glossary: Definitions of Web-related terms
glossary of terms a abstraction accessibility accessibility tree (aom) adobe flash ajax algorithm alignment container alignment subject alpha (alpha channel) alpn api apple safari application context argument aria arpa arpanet array ascii asynchronous atag attribute b bandwidth base64 baseline beacon ...
CSS and JavaScript accessibility best practices - Learn web development
mouse-specific events as you will be aware, most user interactions are implemented in client-side javascript using event handlers, which allow us to run functions in response to certain events happening.
Test your skills: HTML accessibility - Learn web development
the given text is a simple information panel with action buttons, but the html is really bad.
WAI-ARIA basics - Learn web development
enhancing keyboard accessibility: there are built-in html elements that have native keyboard accessibility; when other elements are used along with javascript to simulate similar interactions, keyboard accessibility and screenreader reporting suffers as a result.
What is accessibility? - Learn web development
a good foundation of accessibility for people with cognitive impairments includes: delivering content in more than one way, such as by text-to-speech or by video; easily-understood content, such as text written using plain-language standards; focusing attention on important content; minimizing distractions, such as unnecessary content or advertisements; consistent webpage layout and navigation; familiar elements, such as underlined links blue when not visited and purple when visited; dividing processes into logical, essential steps with progress indicators; website authentication as easy as possible without compromising security; and making forms easy to complete, such as with clear error mes...
Backgrounds and borders - Learn web development
try adding a background-color property to the example above to see that in action.
Cascade and inheritance - Learn web development
total specificity h1 0 0 0 1 0001 h1 + p::first-letter 0 0 0 3 0003 li > a[href*="en-us"] > .inline-warning 0 0 2 2 0022 #identifier 0 1 0 0 0100 no selector, with a rule inside an element's style attribute 1 0 0 0 1000 before we move on, let's look at an example in action.
Grids - Learn web development
this unit represents one fraction of the available space in the grid container.
Beginner's guide to media queries - Learn web development
using pointer can help you to design better interfaces that respond to the type of interaction a user is having with a screen.
Fundamental text and font styling - Learn web development
font-variant-numeric: control the usage of alternate glyphs for numbers, fractions, and ordinal markers.
How do you make sure your website works properly? - Learn web development
in this article we go over various troubleshooting steps for a website and some basic actions to take in order to solve these issues.
How do you upload your files to a web server? - Learn web development
respectively, these are a log of messages showing the connection status between your computer and the sftp server, and a live log of every interaction between your sftp client and the server.
What is a URL? - Learn web development
nowadays, it is mostly an abstraction handled by web servers without any physical reality.
What is a Domain Name? - Learn web development
usually there is a prominent “get a domain name” call to action.
What is a web server? - Learn web development
for example, relying on http alone, a server can't remember a password you typed or remember your progress on an incomplete transaction.
Advanced form styling - Learn web development
take the following example, which shows a number of the "ugly" form features in action: this example has the following css applied to it: body { font-family: 'josefin sans', sans-serif; margin: 20px auto; max-width: 400px; } form > div { margin-bottom: 20px; } select { -webkit-appearance: none; appearance: none; } .select-wrapper { position: relative; } .select-wrapper::after { content: "▼"; font-size: 1rem; top: 6px; right: 10px; position: absolut...
The HTML5 input types - Learn web development
you can see this in action in the below screenshot.
How to structure a web form - Learn web development
add this to the bottom of your form now: <p> <button type="submit">validate the payment</button> </p> you can see the finished form in action below (also find it on github — see our payment-form.html source and running live): test your skills!
Example - Learn web development
a simple form html content <form action="/my-handling-form-page" method="post"> <div> <label for="name">name:</label> <input type="text" id="name" name="user_name"> </div> <div> <label for="mail">e-mail:</label> <input type="email" id="mail" name="user_email"> </div> <div> <label for="msg">message:</label> <textarea id="msg" name="user_message"></textarea> </div> <div class="button"> <button type="submit">send your message</button> </div> </form> css content form { /* just to center the form on the page */ margin: 0 auto; width: 400px; /* to see the limits of the form */ padding: 1em; border: 1px solid #ccc; border-radius: 1em; } div + div { margin-top: 1e...
JavaScript basics - Learn web development
+ 6 + 9; 'hello ' + 'world!'; subtraction, multiplication, division these do what you'd expect them to do in basic math.
What’s in the head? Metadata in HTML - Learn web development
adding a title we've already seen the <title> element in action — this can be used to add a title to the document.
Adding vector graphics to the Web - Learn web development
inlining svg is the only approach that lets you use css interactions (like :focus) and css animations on your svg image (even in your regular stylesheet.) you can make svg markup into a hyperlink by wrapping it in an <a> element.
Images in HTML - Learn web development
users have turned off images to reduce data transfer volume and distractions.
From object to iframe — other embedding technologies - Learn web development
clickjacking is one kind of common iframe attack where hackers embed an invisible iframe into your document (or embed your document into their own malicious website) and use it to capture users' interactions.
Video and audio content - Learn web development
similarly, in environments where having the audio playing would be a distraction or disruption (such as in a library or when a partner is trying to sleep), having captions can be very useful.
HTML table advanced features and accessibility - Learn web development
active learning: adding table structure let's put these new elements into action.
Making asynchronous programming easier with async and await - Learn web development
note: it is also possible to use a sync finally block within an async function, in place of a .finally() async block, to show a final report on how the operation went — you can see this in action in our live example (see also the source code).
General asynchronous programming concepts - Learn web development
you'd generally use a worker to run expensive processes off the main thread so that user interaction is not blocked.
Asynchronous JavaScript - Learn web development
handling async operations gracefully with promises promises are a comparatively new feature of the javascript language that allow you to defer further actions until after the previous action has completed, or respond to its failure.
Build your own function - Learn web development
but we probably want it to appear in response to user and system actions.
Function return values - Learn web development
we saw this in action recently in our random-canvas-circles.html example.
Making decisions in your code — conditionals - Learn web development
overview: building blocks next in any programming language, the code needs to make decisions and carry out actions accordingly depending on different inputs.
Drawing graphics - Learn web development
this became webgl, which gained traction among browser vendors, and was standardized around 2009–2010.
Handling text — strings in JavaScript - Learn web development
concatenation in context let's have a look at concatenation being used in action — here's an example from earlier in the course: <button>press me</button> const button = document.queryselector('button'); button.onclick = function() { let name = prompt('what is your name?'); alert('hello ' + name + ', nice to see you!'); } here we're using a window.prompt() function in line 4, which asks the user to answer a question via a popup dialog box then stores the text they...
Storing the information you need — Variables - Learn web development
again, you can return your variable values by simply typing their name into the console — try these again: myname; myage; you can declare and initialize a variable at the same time, like this: let mydog = 'rover'; this is probably what you'll do most of the time, as it is quicker than doing the two actions on two separate lines.
What is JavaScript? - Learn web development
every time you see a popup window appear on a page, or some new content displayed (as we saw above in our simple demo) for example, that's the dom in action.
JavaScript object basics - Learn web development
note: it is useful to think about the way objects communicate as message passing — when an object needs another object to perform some kind of action often it sends a message to another object via one of its methods, and waits for a response, which we know as a return value.
Object-oriented JavaScript for beginners - Learn web development
this is known as abstraction — creating a simple model of a more complex thing, which represents its most important aspects in a way that is easy to work with for our program's purposes.
Object prototypes - Learn web development
this pattern can be seen in action in piotr zalewa's school plan app example.
Aprender y obtener ayuda - Learn web development
don't try to work in a room with distractions — for example a television on, with your friends watching football!
Measuring performance - Learn web development
you can also use the performance monitor to measure the performance of a web app or site's user interface as you perform different actions.
What is web performance? - Learn web development
the browser follows a well-defined set of steps, and optimizing the critical rendering path to prioritize the display of content that relates to the current user action will lead to significant improvements in content rendering time.
The business case for web performance - Learn web development
here are some kpis to consider: conversion rate the percent of your traffic that takes an intended action, such as completing a purchase or signing up for a newsletter.
Properly configuring server MIME types - Learn web development
for this reason these mime types are usually restricted in terms of what actions a web browser will take when given content of that type.
Ember resources and troubleshooting - Learn web development
more concretely, using mut allows for template-only settings functions to be declared: <checkbox @value={{this.somedata}} @ontoggle={{fn (mut this.somedata) (not this.somedata)}} /> whereas, without mut, a component class would be needed: import component from '@glimmer/component'; import { tracked } from '@glimmer/tracking'; import { action } from '@ember/object'; export default class example extends component { @tracked somedata = false; @action setdata(newvalue) { this.somedata = newvalue; } } which would then be called in the template like so: <checkbox @data={{this.somedata}} @onchange={{this.setdata}} /> due to the conciseness of using mut, it may be desireable to reach for it.
Accessibility in React - Learn web development
let's see this in action; put the following useeffect() call just above the return statement in the body of todo(), and pass into it a function that logs the words "side effect" to your console: useeffect(() => { console.log("side effect"); }); to illustrate the difference between the main render process and code run inside useeffect(), add another log – put this one below the previous addition: console.log("main ...
React interactivity: Events and state - Learn web development
reading state you can see the name state in action right away.
Deployment and next steps - Learn web development
if you prefer to read books, there's svelte and sapper in action by mark volkman, expected to be published in september 2020, but which you can already preview online for free.
Working with Svelte stores - Learn web development
first of all, let's add the following console.log() statements to our app.svelte component to see the todos store and its content in action.
Styling Vue components with CSS - Learn web development
="checkbox"] { -webkit-font-smoothing: antialiased; cursor: pointer; position: absolute; z-index: 1; top: -2px; left: -2px; width: 44px; height: 44px; margin: 0; opacity: 0; } .custom-checkbox > .checkbox-label { font-size: inherit; font-family: inherit; line-height: inherit; display: inline-block; margin-bottom: 0; padding: 8px 15px 5px; cursor: pointer; touch-action: manipulation; } .custom-checkbox > label::before { content: ""; box-sizing: border-box; position: absolute; top: 0; left: 0; width: 40px; height: 40px; border: 2px solid currentcolor; background: transparent; } .custom-checkbox > input[type="checkbox"]:focus + label::before { border-width: 4px; outline: 3px dashed #228bec; } .custom-checkbox > label::after { box-sizing: c...
Handling common accessibility problems - Learn web development
here's an example: <p><span id="liveregion1" aria-live="polite" aria-atomic="false"></span></p> you can see an example in action at freedom scientific's aria (accessible rich internet applications) live regions example — the highlighted paragraph should update its content every 10 seconds, and a screenreader should read this out to the user.
Handling common HTML and CSS problems - Learn web development
if you view the example on a supporting browser like desktop/android chrome or ios safari, you'll see the special widgets/features in action as you try to input data.
Command line crash course - Learn web development
as part of continuous integration checks using tools like github actions.
Introducing a complete toolchain - Learn web development
git (not github) provides a system that lets us attach pre- and post- actions to the tasks you perform with git (such as committing your code).
Learn web development
web performance — making websites fast and responsive web performance is the art of making sure web applications download fast and are responsive to user interaction, regardless of a user's bandwidth, screen size, network, or device capabilities.
Accessibility API cross-reference
column n/a n/a n/a the heading of a table's column columnheader column_header column_header, table_column_header columnheader <th scope=col> edit control with drop down list box, different from droplist combobox combo_box combo_box combobox abstract role - a form of widget that performs an action but does not receive input data.
Accessibility Features in Firefox
in much the same way that user css lets you take control of a web page's style, user scripts let you easily control any aspect of a web page's design or interaction.
Mozilla accessibility architecture
common reasons for these mutations are web page scripts, and user actions in the editor.
CSUN Firefox Materials
in much the same way that user css lets you take control of a web page's style, user scripts let you easily control any aspect of a web page's design or interaction.
Links and Resources
accessibility information resource center for developers at adobe - flash mx accessibility, pdf document accessibility and actionscript accessibility.
Mozilla’s UAAG evaluation report
2.4 allow time-independent interaction.
Accessible Toolkit Checklist
[important, but no need to implement up/down/left/right] accdodefaultaction: perform the action described by get_accdefaultaction.
Benchmarking
add the following to your mozconfig in order to build with level 2: ac_add_options rustc_opt_level=2 gc poisoning many firefox builds have a diagnostic tool that causes crashes to happen sooner and produce much more actionable information, but also slow down regular usage substantially.
What to do and what not to do in Bugzilla
loss of function normal regular issue, some loss of functionality under specific circumstances minor minor loss of function, or other problem where easy workaround is present trivial cosmetic problem like misspelled words or misaligned text enhancement request for enhancement the blocker severity should be used very seldomly, because only a fraction of the hundreds of thousands bugs really block the development of mozilla and these are normally fixed very quickly.
Chrome registration
each line is parsed individually; if the line is parsable the chrome registry takes the action identified by that line, otherwise the chrome registry ignores that line (and prints a warning message in the runtime error console).
Command line options
command actions are case insensitive.
Continuous Integration
when sheriffs see a build or test has been broken, they are empowered to take one of several actions, including backing out a patch which caused the problem and closing the tree (i.e., preventing any additional commits).
Debugging on Mac OS X
# # note: this scripts actions take a few seconds to complete, so the custom # formatters, commands etc.
Eclipse CDT
be aware that when eclipse gives results for any of the actions that follow, it will not include results for sections of the code that are ifdef'ed out by the configuration used to create your object directory.
Multiple Firefox profiles
this action cannot be undone.
Performance best practices for Firefox front-end engineers
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.
Security best practices for Firefox front-end engineers
linter rules against unsanitized dom interaction the security assurance team maintains an eslint rule that disallows unsafe uses of innerhtml and similar dom apis.
Using the Browser API
MozillaGeckoChromeAPIBrowser APIUsing
other methods and events we've only covered a fraction of the new methods and events that the browser api adds.
mozbrowseractivitydone
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.
mozbrowserasyncscroll
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.
mozbrowseraudioplaybackchange
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.
mozbrowserclose
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 event target (the topmost target in the dom tree).
mozbrowserdocumentfirstpaint
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 event target (the topmost target in the dom tree).
mozbrowsererror
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.
mozbrowserfindchange
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.
mozbrowserfirstpaint
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 event target (the topmost target in the dom tree).
mozbrowsericonchange
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.
mozbrowserloadend
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.
mozbrowserloadstart
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 event target (the topmost target in the dom tree).
mozbrowserlocationchange
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.
mozbrowsermanifestchange
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.
mozbrowsermetachange
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.
mozbrowseropensearch
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.
mozbrowseropentab
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.
mozbrowseropenwindow
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.
mozbrowserresize
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.
mozbrowserscroll
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.
mozbrowserscrollareachanged
this can occur on resize and when the page size changes (while loading for example.) 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.
mozbrowserscrollviewchange
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.
mozbrowsersecuritychange
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.
mozbrowserselectionstatechanged
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.
mozbrowsershowmodalprompt
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.
mozbrowsertitlechange
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.
mozbrowserusernameandpasswordrequired
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.
mozbrowservisibilitychange
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.
MozScrolledAreaChanged
specification mozilla specific interface uievent bubbles yes cancelable yes target defaultview, document default action none properties property type description targetread only eventtarget the event target (the topmost target in the dom tree).
smartcard-insert
the smartcard-insert event is fired when the insertion of a smart card has been detected specification mozilla specific interface event bubbles no cancelable no target document default action none properties property type description targetread only eventtarget the event target (the topmost target in the dom tree).
smartcard-remove
specification mozilla specific interface event bubbles no cancelable no target document default action none properties property type description targetread only eventtarget the event target (the topmost target in the dom tree).
Overview of Mozilla embedding APIs
being reviewed interface definition: nsiweakreference.idl nsisimpleemunerator this interface provides a simple enumeration abstraction.
HTML parser threading
additionally, each nshtml5parser has an associated nshtml5treeopexecutor that turns the output (tree operations; discussed later) of the portable parser core into actions performed on the gecko dom.
AsyncShutdown.jsm
please make sure that the name respects the following model: "some service: some action in progress" - for instance "os.file: flushing all pending i/o".
CustomizableUI.jsm
anode is the dom node changed, anextnode the dom node (if any) before which a widget will be inserted, acontainer the actual dom container (could be an overflow panel in case of an overflowable toolbar), and awasremoval is true iff the action about to happen is the removal of the dom node.
Interfacing with the Add-on Repository
", prompt, null, /* anchor id */ { label: button, accesskey: "i", callback: function() { if (popupnotifications.install) { popupnotifications.install.install(); } else { popupnotifications.remove(box); } } }, null /* secondary action */ ); } the code here starts by stashing the passed-in addoninstall object for later use, then creates and displays the pop-up notification box with the text and button label passed into the method.
Promise
once you have a reference to a promise, you can call its then() method to execute an action when the value becomes available, or when an error occurs.
PromiseWorker.jsm
return new promiseworker.meta(abuf, {transfers: [abuf]}); if you want to return an object or an array and transfer only certain parts of this data, it would all have to be return wrapped in this meta object like so: return new promiseworker.meta({ thebuf: abuf, othernontrans: 'this string is not transfered but copied' }, {transfers: [abuf]}); a simple demo showing this in live action can be found here: github :: promiseworker transfer arraybuffer - worker side rejecting the promise to reject the promise from the worker, simply throw.
WebChannel.jsm
the webchannel.jsm javascript code module provides an abstraction that uses the message manager and custom events apis to create a two-way communication channel between chrome and content code for specific origins (using a specific origin passed to the constructor or a lookup with nsipermissionmanager while also ensuring the scheme is https).
Webapps.jsm
pp) canceldownload: function canceldownload(amanifesturl, aerror) startofflinecachedownload: function(amanifest, aapp, aprofiledir, aisupdate) computemanifesthash: function(amanifest) updateapphandlers: function(aoldmanifest, anewmanifest, aapp) checkforupdate: function(adata, amm) doinstall: function doinstall(adata, amm) doinstallpackage: function doinstallpackage(adata, amm) pushcontentaction: function(windowid) popcontentaction: function(windowid) actioncancelled: function(windowid) denyinstall: function(adata) _setupapp: function(adata, aid) _cloneapp: function(adata, anewapp, alocalemanifest, amanifest, aid, alocalid) _writemanifestfile: function(aid, aispackage, ajsonmanifest) _nextlocalid: function() _appidformanifesturl: function(auri) makeappid: function() _saveapps: ...
Mozilla Content Localized in Your Language
use verbs that precisely describe the button's action.
L10n testing with xcode
to perform the next steps, you'll need to be familiar with how user gestures and hardware interactions work in the simulator.
Localization sign-off reviews
the process is then repeated until the bug is fixed to satisfaction.
Localization technical reviews
the process is then repeated until the bug is fixed to satisfaction.
Creating localizable web applications
good: body.de foo, body.fr foo, body.pl foo { /* locale-specific rules for the foo element */ width: 10em; /* originally 8em */ } adapt the interaction to rtl locales right-to-left locales not only require good images handling (see images), but also should be taken into account when designing the interaction on the website.
Various MathML Tests
testing mathml <merror>, <mtext>: this is a text in mtext this is a text in merror testing <maction>: click to toggle between expressions, and watch the status line onmouseover/onmouseout: statusline#first expression first expression statusline#second expression second expression statusline#and so on...
Build Metrics
since perfherder alerts are calculated based on the mean value of a range, a regression may be reported as a fractional value.
BloatView
== bloatview: all (cumulative) leak and bloat statistics, tab process 1862 |<----------------class--------------->|<-----bytes------>|<----objects---->| | | per-inst leaked| total rem| 0 |total | 17 2484|253953338 38| 17 |asynctransactiontrackersholder | 40 40| 10594 1| 78 |compositorchild | 472 472| 1 1| 79 |condvar | 24 48| 3086 2| 279 |messagepump | 8 8| 30 1| 285 |mutex | 20 60| 89987 3| 302 |pcompo...
Gecko Profiler FAQ
how you identify a user action in the main thread we’re missing ui for this at the moment.
Leak-hunting strategies and tips
once you've done this, and it doesn't leak much, then try the action under trace-malloc or lsan or valgrind to find the leaks of smaller graphs of objects.
Power profiling overview
the fraction of time that a package or core spends in an idle c-state is called the c-state residency.
Profiling with Xperf
the stock windows crt allocator is horrible about fragmentation, and causes memory usage to rise drastically even if only a small fraction of that memory is in use.
Scroll-linked effects
call to action if you have thoughts or opinions on: any of the above proposals in the context of scroll-linked effects.
TraceMalloc
<script type="text/javascript"> var filename = window.prompt("filename to log: "); if (filename) tracemallocdumpallocations(filename); </script> one can then use the script tools/trace-malloc/diffbloatdump.pl to compare trace-malloc dumps before and after doing an action that might leak.
Phishing: a short definition
shifting blame to users some quick-to-implement, and cost-effective solutions, hold users accountable for their actions instead of restricting what’s technically possible.
browser.altClickSave
false (default) no action triggered (see bug 736985).
NSPR Contributor Guide
generally useful platform abstractions you agree to sustain, bug fix may rely on the nspr api may not rely on any other library api new platform ports all nspr api items must be implemented platform specific headers in pr/include/md/_platformname.[h!cfg] platform specific code in pr/src/md/platform/*.c make rules in config/_platform.mk documentation the files for nspr's documentation are maintained using a proprietary wo...
Optimizing Applications For NSPR
the nt version implements a mxn threading model, using native nt threads as the virtual processors and nt's fiber abstraction as the locally scheduled threads.
Interval Timing
conceptually, they are based on free-running counters that increment at a fixed rate without possibility of outside influence (as might be observed if one was using a time-of-day clock that gets reset due to some administrative action).
NSPR Types
variables of these types are suitable for storing a pointer or pointer subtraction.
PR_CWait
when the thread resumes execution, it is the caller's responsibility to test the state of the monitored data to determine the appropriate action.
PR_Open
if the file already exists, no action and null is returned.
HTTP delegation
now that we have explained the interaction between nss, the callback functions and the application, let's look at the steps required by the application to initially register the callbacks.
HTTP delegation
now that we have explained the interaction between nss, the callback functions and the application, let's look at the steps required by the application to initially register the callbacks.
Using JSS
MozillaProjectsNSSJSSUsing JSS
jss dependencies core library name description binary release location nspr4 nspr os abstraction layer http://ftp.mozilla.org/pub/mozilla.org/nspr/releases plc4 nspr standard c library replacement functions plds4 nspr data structure types nss3 nss crypto, pkcs #11, and utilities http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases ssl3 nss ssl library smime3 nss s/mime functi...
NSS Sample Code Sample1
// if there is one, no further action is required.
NSS Sample Code Utilities_1
* * this function supports password extraction from files with * multiple passwords, one for each token.
Notes on TLS - SSL 3.0 Intolerant Servers
problem a number of netscape 6.x/7.x and mozilla users have reported that some secure sites -- typically sites featuring online transactions or online banking over the https protocol -- do not display any content at all.
PKCS11 FAQ
MozillaProjectsNSSPKCS11FAQ
the motivation for this is that some hardware tokens will prevent extraction of symmetric keys by design.
PKCS11 Implement
signing and decryption tokens can be used for s/mime and for encrypted transactions over unsecured networks such as the internet.
NSPR functions
nspr is a platform abstraction library that provides a cross-platform api to common os services.
The Necko HTTP module
transaction model this document describes the lifetime of a http transaction, the threads involved, and the relevant objects.
Tutorial: Embedding Rhino
this removes the association between the context and the current thread and is an essential cleanup action.
Rhino Examples
the foo class - extending scriptableobject foo.java is a simple javascript host object that includes a property with an associated action and a variable argument method.
Scripting Java
we actually saw this feature in action on the call to the java.lang.string constructor in the preceding example.
Index
532 garbage collection guide, needscontent, spidermonkey spidermonkey has a mark-sweep garbage collection (gc) with incremental marking mode, generational collection, and compaction.
Garbage collection
design overview spidermonkey has a mark-sweep garbage collection (gc) with incremental marking mode, generational collection, and compaction.
SpiderMonkey Internals: Thread Safety
the jscontext can be thought of as a machine that knows how to run javascript code, or as an abstraction of the notion of a thread.
SpiderMonkey Internals
common cases are inlined in the interpreter loop, breaking any abstractions that stand in the way.
Introduction to the JavaScript shell
fractions of a second are supported.
JS_AlreadyHasOwnProperty
they are meant to be a transparent optimization; this is the only api that breaks the abstraction.) for non-native objects, this falls back on a complete search.
JS_MapGCRoots
perform some action for each object in a jsruntime's gc root set.
Split object
...and yet, there is special code in jsobj.h with a comment about fixing some kind of interaction between with an split objects.
TPS History Lists
specific host, use an object with a host property to delete all history in a certain time period, use an object with begin and end properties, which should have integer values that express time since the present in hours (see date above) for example: var history_to_delete = [ { uri: "http://www.cnn.com/" }, { begin: -24, end: -1 }, { host: "www.google.com" } ]; history lists and phase actions history lists cannot be modified, they can only be added, deleted, and verified, using the following functions: history.add history.delete history.verify history.verifynot ...
TPS Pref Lists
for example: var prefs1 = [ { name: "browser.startup.homepage", value: "http://www.getfirefox.com" }, { name: "browser.urlbar.maxrichresults", value: 20 }, { name: "browser.tabs.autohide", value: true } ]; pref lists and phase actions the only actions supported for preference asset lists are modify and verify: prefs.modify prefs.verify sync only syncs certain preferences.
The Rust programming language
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.
Exploitable crashes
do this before making comments or taking actions that expose exploitability publicly.
Secure Development Guidelines
careful when working with threads, the file system, or signals track down shared resources and lock them accordingly for signal handlers never use non-atomic operations longjmp() is a sign of badness even exit() could cause problems, but _exit() is okay deadlocks and locking issues locks are used when dealing with threads acquiring more than one lock to perform an action if a second thread acquires the same locks but in a different order, it causes denial of service since both threads will be waiting forever deadlocks and locking issues example func_a() { lock(locka); lock(lockb); ...
Handling Mozilla Security Bugs
(regarding this point, if all mozilla distributors have a representative on the security bug group, then even if a bug remains in the security-sensitive category, all affected distributors can still be informed and take appropriate action.) the security module owner will be the primary person responsible for ensuring that security bug reports are investigated and publicly disclosed in a timely manner, and that such bug reports do not remain in the bugzilla database uninvestigated and/or undisclosed.
Gecko Roles
role_menupopup represents a menu, which presents a list of options from which the user can make a selection to perform an action.
Gecko states
state_multiselectable supports multiple selection state_extselectable supports extended selection state_required indicates that user interaction is required.
XForms Accessibility
trigger allows the user to initiate actions (see the spec, the docs).
XUL Accessibility
<description value="it's label for control" control="control" /> <hbox role="grouping" id="control" /> get tooltiptext attribute value if the aria role is used and it allows to have accessible value then aria-valuetext or aria-valuenow are used if the element is xlink then value is generated from link location actions if the element is xlink then jump action is exposed if the element has registered click event handler then click action is exposed xul elements notification used to display an informative message.
Querying Places
this viewer will be called when the result tree changes, either as a result of user action or as a result of notifications from the bookmarks and history systems.
Using the Places keywords API
each keyword can be associated with post data, in such a case a post action will be executed when the given url is selected from the awesomebar.
places.sqlite Database Troubleshooting
this article describes troubleshooting actions to deal with a broken places.sqlite database.
Accessing the Windows Registry Using XPCOM
reading registry values probably the most common action associated with the windows registry is reading values.
Fun With XBL and XPConnect
the basic model of interaction is as follows: binding to the xpcom object the widget holds onto an xpcom object that is the auto complete engine that will perform our auto complete lookups.
XPCOM changes in Gecko 2.0
category registration prior to gecko 2, extensions could listen for the xpcom-startup and app-startup notifications during startup, and perform actions during those.
Components.Constructor
laces): var bis = components.classes["@mozilla.org/binaryinputstream;1"] .createinstance(components.interfaces.nsibinaryinputstream); bis.setinputstream(someinputstream); // assumes binaryinputstream was initialized previously var bis = new binaryinputstream(someinputstream); components.constructor() is purely syntactic sugar (albeit speedy and pretty syntactic sugar) for actions that can be accomplished using other common methods.
Components.utils
this should only be used to write tests of the interaction of the gc and cc with weak maps.
IAccessibleImage
some examples are: the accessible name and description() are not enough to fully describe the image, for example when the accessible description() is used to define the behavior of an actionable image and the image itself conveys semantically significant information.
DefaultKeyBinding
« nsiaccessible page summary provides localized string of global keyboard accelerator for default action, such as ctrl+o for open file (ctrl + o).
nsIAccessibleRole
role_menupopup 11 represents a menu, which presents a list of options from which the user can make a selection to perform an action.
nsIApplicationCacheChannel
see the 'cache selection algorithm' and cache_selection_reload action handling in nscontentsink.
nsIBrowserSearchService
this is not an issue if your code is executed in reaction to a user interaction, as initialization is complete by then, but this is an issue if your code is executed during startup.
nsIChannel
for example, queryinterfacing to nsihttpchannel allows response headers to be retrieved for the corresponding http transaction.
nsICommandLineHandler
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.
nsIContentViewer
if it is non-null, the document will not be destroyed, and the following actions will happen when destroy() is called: sanitize() will be called on the viewer's document the content viewer will set the contentviewer property on the history entry, and release its reference (ownership reversal).
nsIDOMChromeWindow
on other systems, this method doesn't have any reaction currently.
nsIDOMMozTouchEvent
this lets you process multi-finger touch gestures and actions.
nsIDOMSimpleGestureEvent
client coordinates contain the center pivot point of the action.
nsIDOMWindowInternal
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(in domstring action) boolean find([optional] in domstring str,[optional] in boolean casesensitive, [optional] in boolean backwards, [optional] in boolean wraparound, [optional] in boolean wholeword, [optional] in boolean searchinframes, [optional] in boolean showdialog) domstring atob(in domstring aasciistring) domstring btoa(in domstring abase64data) nsivariant showmodaldialog(i...
nsIDOMWindowUtils
in other words, true if and only if the default action was taken.
nsIDOMXULElement
returns an nsicontrollers object that additional controllers may be appended to so as to provide focus-specific actions for commands.
nsIDragSession
dragaction unsigned long sets the action (copy, move, link and so on) for the current drag.
nsIEditorIMESupport
obsolete since gecko 2.0 attributes attribute type description composing boolean whether this editor has active ime transaction.
nsIEditorMailSupport
editor/idl/nsieditormailsupport.idlscriptable provides simple editing actions for the thunderbird mail editor.
nsIEventListenerService
so, system-group eventlisteners can implement the default action of the event.
nsIFocusManager
void contentremoved( in nsidocument adocument, in nsicontent aelement ); parameters adocument aelement native code only!firedelayedevents fire any events that have been delayed due to synchronized actions.
nsIFrameLoader
apreventdefault whether or not to prevent default actions from being performed.
nsIHttpChannel
igin same as the default; only send the origin of the referring uri for cross-origin requests referrer_policy_unsafe_url always send the referrer, even when downgrading from https to http attributes attribute type description allowpipelining boolean this attribute is a hint to the channel to indicate whether or not the underlying http transaction should be allowed to be pipelined with other transactions.
nsIJumpListBuilder
constants constant value description jumplist_category_tasks 0 tasks are common actions performed by users within the application.
nsILocalFile
if the file already exists, no action and null is returned.
Using nsILoginManager
.nsilogininfo, "init" ); var logininfo = new nslogininfo( hostname, formsubmiturl, httprealm, username, password, usernamefield, passwordfield ); examples creating a login for a web page var formlogininfo = new nslogininfo( 'http://www.example.com', 'http://login.example.com', null, 'joe', 'secret123', 'uname', 'pword' ); this login would correspond to a html form such as: <form action="http://login.example.com/foo/authenticate.cgi"> <div>please log in.</div> <label>username:</label> <input type="text" name="uname"> <label>password:</label> <input type="password" name="pword"> </form> creating a site authentication login var authlogininfo = new nslogininfo( 'http://www.example.com', null, 'exampleco login', 'alice', 'secret321', "", "" ); this would correspond to...
nsILoginManagerPrompter
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.
nsIMsgFilterList
lterfileattribvalue nsimsgfilterlist::attribname = 3 const nsmsgfilterfileattribvalue nsimsgfilterlist::attribenabled = 4 const nsmsgfilterfileattribvalue nsimsgfilterlist::attribdescription = 5 const nsmsgfilterfileattribvalue nsimsgfilterlist::attribtype = 6 const nsmsgfilterfileattribvalue nsimsgfilterlist::attribscriptfile = 7 const nsmsgfilterfileattribvalue nsimsgfilterlist::attribaction = 8 const nsmsgfilterfileattribvalue nsimsgfilterlist::attribactionvalue = 9 const nsmsgfilterfileattribvalue nsimsgfilterlist::attribcondition = 10 ...
nsIMsgIncomingServer
incomingduplicateaction long isdeferredto boolean read only.
nsIMsgWindow
transactionmanager nsitransactionmanager this is used to track undo/redo transactions.
nsINavHistoryResult
you can use nsinavhistoryresulttreeviewer as the viewer; this provides a prepackaged interaction with a nsitreeboxobject.
nsINavHistoryResultObserver
this method is called after the item has been removed from the parent, but before any other action is taken (including zeroing out the item's parent reference).
nsINavHistoryResultViewer
remarks this method is called after the item has been removed from the parent, but before any other action is taken (including zeroing out the item's parent reference).
nsIParserUtils
in that case, <a> links (and similar) to other content are preserved, so an explicit user action (following a link) after the content has been loaded can still leak information.
nsISHistoryListener
the listener can prevent any action (except adding a new session history entry) from happening by returning false from the corresponding callback method.
nsISessionStartup
defer_session 3 the previous session is viable but shouldn't be restored without explicit action (with the exception of app tabs, which are always restored in this case).
nsISupports proxies
xpinstall installation scripts are sometimes very complex and can require long execution time due to unzipping or native file system actions.
nsITaskbarPreview
the controller provides the behavior and appearance for the taskbar preview, and is responsible for determining the size and contents of the preview, which buttons are displayed, and how the application responds to user actions on the preview.
nsITextInputProcessorCallback
createinstance(components.interfaces.nsitextinputprocessor); } if (!this._tip.begininputtransaction(window, this._callback)) { return false; } ...
nsIThread
this interface provides a high-level abstraction for an operating system thread.
nsIUpdatePatch
selected boolean true if this patch is currently selected as the patch to be downloaded and installed for this update transaction.
nsIXFormsModelElement
note: script invocation is not necessarily equivalent to performing the recalculate action handler.
nsIZipReader
the entry must be stored in the zip in either uncompressed or deflate-compressed format for the extraction to be successful.
nsMsgFilterFileAttribValue
t nsmsgfilterfileattribvalue attribversion = 1; const nsmsgfilterfileattribvalue attriblogging = 2; const nsmsgfilterfileattribvalue attribname = 3; const nsmsgfilterfileattribvalue attribenabled = 4; const nsmsgfilterfileattribvalue attribdescription = 5; const nsmsgfilterfileattribvalue attribtype = 6; const nsmsgfilterfileattribvalue attribscriptfile = 7; const nsmsgfilterfileattribvalue attribaction = 8; const nsmsgfilterfileattribvalue attribactionvalue = 9; const nsmsgfilterfileattribvalue attribcondition = 10; const nsmsgfilterfileattribvalue attribcustomid = 11; ...
Working with Multiple Versions of Interfaces
fortunately there is a plan of action that we can follow to rectify this.
XPCOM
ingsan xpcom language binding is a bridge between a particular language and xpcom to provide access to xpcom objects from that language, and to let modules written in that language be used as xpcom objects by all other languages for which there are xpcom bindings.monitoring http activitygecko includes the nsihttpactivityobserver interface, which you can implement in your code to monitor http transactions in real time, receiving a callback as the transactions take place.nscomptr versus refptrgecko code uses both nscomptr and refptr as smart pointers.
Xray vision
for example: window.confirm() is a dom api that's supposed to ask the user to confirm an action, and return a boolean depending on whether they clicked "ok" or "cancel".
DB Views (message lists)
view interaction with nsitreeview the nsitreeview methods in nsmsgdbview.cpp control the appearance of the thread pane.
Spam filtering
initial state user action table changes unknown (user can't see this, looks like "not junk") mark as junk add tokens to bad unknown (user can't see this, looks like "not junk") mark as not junk add tokens to good not junk mark as junk remove tokens from good, add tokens to bad not junk mark as not junk no op junk mark as junk no op junk...
Building a Thunderbird extension 5: XUL
while xul provides the elements of the user interface, actions are written in javascript.
Finding the code for a feature
i look at the last occurrence, and see it is just an enable item with no real action involved.
Access Window
register a timer window.setinterval( function() { alert('foobar'); }, 60000); //execute the function once very minute if you periodically need to perform a certain action then you can use the setinterval function, it will then call this function every x milliseconds, in this case every 60000ms or one minute.
Detect Opening Folder
some actions require execution every time you open a folder (for example, registering a custom column handler.
Use SQLite
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")'); msg = '<p>log message created and row inserted.</p>'; document.queryselector('#status').innerhtml = msg; }); db.transaction(function (tx) { tx.executesql('select * from l...
Working with windows in chrome code
see interaction between privileged and non-privileged pages if you need to interact with the content page.
Using COM from js-ctypes
the windows api mostly concerns itself with the interaction between the operating system and an application.
Using Objective-C from js-ctypes
isa: ctypes.voidptr_t }, { flags: ctypes.int32_t }, { reserved: ctypes.int32_t }, { invoke: ctypes.voidptr_t }, { descriptor: block_descriptor_1.ptr } ]); var block_const = { block_has_copy_dispose: 1 << 25, block_has_ctor: 1 << 26, block_is_global: 1 << 28, block_has_stret: 1 << 29, block_has_signature: 1 << 30 }; // based on work from here: https://github.com/trueinteractions/tint2/blob/f6ce18b16ada165b98b07869314dad1d7bee0252/modules/bridge/core.js#l370-l394 var bl = block_literal_1(); // set the class of the instance bl.isa = _nsconcreteglobalblock; // global flags bl.flags = block_const.block_has_stret; bl.reserved = 0; bl.invoke = afunctypeptr; // create descriptor var desc = block_descriptor_1(); desc.reserved = 0; desc.size = block_literal_1.size; ...
Constants - Plugins
npres_user_break 2 user canceled stream directly by clicking the stop button or indirectly by some action such as deleting the instance or initiating higher-priority network operations.
Plug-in Basics - Plugins
when the user opens a page that contains embedded data of a media type that invokes a plug-in, the browser responds with the following sequence of actions: check for a plug-in with a matching mime type load the plug-in code into memory initialize the plug-in create a new instance of the plug-in gecko can load multiple instances of the same plug-in on a single page, or in several open windows at the same time.
Plug-in Development Overview - Plugins
to see your plug-in in action, simply display the html page that calls it in the browser.
Streams - Plugins
npres_user_break: the user canceled the stream directly by clicking the stop button or indirectly by some action, such as by deleting the instance or initiating higher-priority network operations.
Accessibility Inspector - Firefox Developer Tools
actions — a list of actions that can be performed on the item, for example, a pushbutton would have "press" listed, while a link would have "jump" listed.
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.
Ignore a source - Firefox Developer Tools
however, a library’s abstraction leaks during debugging sessions when you are forced to step through its stack frames in order to reach your own code.
Set a logpoint - Firefox Developer Tools
to create a logpoint: right click on a line number in the debugger panel and pick add log action from the context menu.
Set event listener breakpoints - Firefox Developer Tools
use event breakpoints to stop execution at the triggering event for the action that fails, then step through the code or watch the console to see what happens.
Index - Firefox Developer Tools
however, a library’s abstraction leaks during debugging sessions when you are forced to step through its stack frames in order to reach your own code.
Network monitor toolbar - Firefox Developer Tools
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.
Network request list - Firefox Developer Tools
other actions you can take with request blocking: to turn all request blocking off or on: toggle the checkbox next to enable request blocking.
Network Monitor - Firefox Developer Tools
the just opened tool looks like this: either action causes the network monitor to begin monitoring network activity.
Frame rate - Firefox Developer Tools
in general, a high and consistent frame rate will make the user's interaction with the site more enjoyable and engaging.
Animating CSS properties - Firefox Developer Tools
it's unlikely you'll see a smooth animation here, especially when you add in user interaction.
Console messages - Firefox Developer Tools
password fields present in a form with an insecure (http://) form action.
about:debugging (before Firefox 68) - Firefox Developer Tools
this does what it says: reloading any persistent scripts, such as background scripts parsing the manifest.json file again, so changes to permissions, content_scripts, browser_action or any other keys will take effect.
about:debugging - Firefox Developer Tools
this does what it says: reloads any persistent scripts, such as background scripts parses the manifest.json file again, so changes to permissions, content_scripts, browser_action or any other keys take effect installed extensions the permanently installed extensions are listed in the next section, extensions.
Firefox Developer Tools
the ellipsis menu on the right-hand side of developer tools contains several commands that let you perform actions or change tool settings.
Animation - Web APIs
WebAPIAnimation
you can see this in action in our simple replace indefinite animations demo.
AnimationEvent.initAnimationEvent() - Web APIs
cancelablearg a boolean flag indicating if the event associated action can be avoided (true) or not (false).
AudioContextLatencyCategory - Web APIs
"interactive" the audio is involved in interactive elements, such as responding to user actions or needing to coincide with visual cues such as a video or game action.
AudioContextOptions - Web APIs
"interactive" the audio is involved in interactive elements, such as responding to user actions or needing to coincide with visual cues such as a video or game action.
AudioTrack.kind - Web APIs
WebAPIAudioTrackkind
"descriptions" an audio track providing audible descriptions of the action depicted in a video track.
AudioWorkletGlobalScope - Web APIs
as the global execution context is shared across the current baseaudiocontext, it's possible to define any other variables and perform any actions allowed in worklets — apart from defining audioworkletprocessor-derived classes.
Background Tasks API - Web APIs
in addition, the event loop handles interactions with the operating system, updates to the browser's own user interface, and so forth.
BeforeUnloadEvent - Web APIs
some implementations only show the dialog box if the frame or any embedded frame receives a user gesture or user interaction.
Broadcast Channel API - Web APIs
it can be used to detect user actions in other tabs within a same origin, like when the user logs in or out.
CSSValueList - Web APIs
the cssvaluelist interface derives from the cssvalue interface and provides the abstraction of an ordered collection of css values.
Cache - Web APIs
WebAPICache
note: in chrome, visit chrome://inspect/#service-workers and click on the "inspect" link below the registered service worker to view logging statements for the various actions the service-worker.js script is performing.
CanvasRenderingContext2D.stroke() - Web APIs
, 20); ctx.lineto(160, 20); ctx.stroke(); // second sub-path ctx.linewidth = 14; ctx.strokestyle = 'green'; ctx.moveto(20, 80); ctx.lineto(220, 80); ctx.stroke(); // third sub-path ctx.linewidth = 4; ctx.strokestyle = 'pink'; ctx.moveto(20, 140); ctx.lineto(280, 140); ctx.stroke(); result stroking and filling if you want to both stroke and fill a path, the order in which you perform these actions will determine the result.
Advanced animations - Web APIs
to do so, we add the following checks to the draw method: if (ball.y + ball.vy > canvas.height || ball.y + ball.vy < 0) { ball.vy = -ball.vy; } if (ball.x + ball.vx > canvas.width || ball.x + ball.vx < 0) { ball.vx = -ball.vx; } first demo let's see how it looks in action so far.
Basic usage of canvas - Web APIs
here is how a template would look in action.
Optimizing canvas - Web APIs
for example, let's say you have a game with a ui on top, the gameplay action in the middle, and a static background on the bottom.
Using channel messaging - Web APIs
when these act as standalone units, things are ok, but the difficulty comes when you want interaction between the main site and the iframes, or the different iframes.
CloseEvent.initCloseEvent() - Web APIs
cancelable whether or not the event's default action can be prevented.
console - Web APIs
WebAPIConsole
note: it's important to note that if you're using this to log the timing for network traffic, the timer will report the total time for the transaction, while the time listed in the network panel is just the amount of time required for the header.
ConstantSourceNode - Web APIs
to see this example in action, as well as to read the rest of the code from which these snippets were derived, see controlling multiple parameters with constantsourcenode.
ContentIndexEvent - Web APIs
the contentdelete event is only fired when the deletion happens due to interaction with the browser's built-in user interface.
Content Index API - Web APIs
self.addeventlistener('contentdelete', (event) => { console.log(event.id); // logs content index id, which can then be used to determine what content to delete from your cache }); the contentdelete event is only fired when the deletion happens due to interaction with the browser's built-in user interface.
DOMHighResTimeStamp - Web APIs
the time, given in milliseconds, should be accurate to 5 µs (microseconds), with the fractional part of the number indicating fractions of a millisecond.
DirectoryEntrySync - Web APIs
this specification is pretty much abandoned, having failed to reach any substantial traction.
DirectoryReaderSync - Web APIs
this specification is pretty much abandoned, having failed to reach any substantial traction.
Document: dragend event - Web APIs
bubbles yes cancelable no default action varies interface dragevent event handler property ondragend examples see the drag event for example code or this jsfiddle demo.
Document: dragenter event - Web APIs
bubbles yes cancelable yes default action reject immediate user selection as potential target element.
Document: dragexit event - Web APIs
bubbles yes cancelable no default action none.
Document: dragleave event - Web APIs
bubbles yes cancelable no default action none.
Document: dragover event - Web APIs
bubbles yes cancelable yes default action reset the current drag operation to "none".
Document: dragstart event - Web APIs
bubbles yes cancelable yes default action initiate the drag-and-drop operation.
Document: drop event - Web APIs
bubbles yes cancelable yes default action varies interface dragevent event handler property ondrop examples see the drag event for example code or this jsfiddle demo.
Document.execCommand() - Web APIs
note: only returns true if part of a user interaction.
Document: keypress event - Web APIs
interface keyboardevent bubbles yes cancelable yes default action varies: keypress event; launch text composition system; blur and focus events; domactivate event; other event examples addeventlistener keypress example this example logs the keyboardevent.code value whenever you press a key.
Document.onfullscreenerror - Web APIs
since requestfullscreen() can only be called in response to user action, for security reasons, this will fail, causing the fullscreenerror to be sent to the document.
Document: pointercancel event - Web APIs
the touch-action css property prevents the input from continuing.
Document: pointermove event - Web APIs
the pointermove event is fired when a pointer changes coordinates, and the pointer has not been canceled by a browser touch-action.
Document.queryCommandEnabled() - Web APIs
the 'paste' command return false not only if the feature is unavailable, but also if the script calling it has insufficient privileges to perform the action.
Document.queryCommandSupported() - Web APIs
notes the 'paste' command return false not only if the feature is unavailable, but also if the script calling it has insufficient privileges to perform the action [1] example var flg = document.querycommandsupported("selectall"); if(flg) { // ...do something } specifications specification status comment execcommand ...
Document.requestStorageAccess() - Web APIs
if the user clicks “don’t allow”, the storage access request is rejected and the requesting origin can re-request once it receives another user interaction.
Document: wheel event - Web APIs
the default action of a wheel event is implementation-specific, and doesn't necessarily dispatch a scroll event.
Examples of web and XML development using the DOM - Web APIs
= w_style; var txtbackgroundcolor = document.getelementbyid("t3"); var b_style = document.defaultview.getcomputedstyle(refdiv, null).getpropertyvalue("background-color"); txtbackgroundcolor.value = b_style; } </script> <style> #d1 { margin-left: 10px; background-color: rgb(173, 216, 230); height: 20px; max-width: 20px; } </style> </head> <body> <div id="d1">&nbsp;</div> <form action=""> <p> <button type="button" onclick="cstyles();">getcomputedstyle</button> height<input id="t1" type="text" value="1" /> max-width<input id="t2" type="text" value="2" /> bg-color<input id="t3" type="text" value="3" /> </p> </form> </body> </html> example 7: displaying event object properties this example uses dom methods to display all the properties of the window.onload...
Element: DOMMouseScroll event - Web APIs
bubbles yes cancelable yes interface mousescrollevent if you want to prevent the default action of mouse wheel events, it's not enough to handle only this event on gecko because if scroll amount by a native mouse wheel event is less than 1 line (or less than 1 page when the system setting is by page scroll), other mouse wheel events may be fired without this event.
Element.attributes - Web APIs
ttributes()) { var attrs = paragraph.attributes; var output = ""; for(var i = attrs.length - 1; i >= 0; i--) { output += attrs[i].name + "->" + attrs[i].value; } result.value = output; } else { result.value = "no attributes to show"; } } </script> </head> <body> <p id="paragraph" style="color: green;">sample paragraph</p> <form action=""> <p> <input type="button" value="show first attribute name and value" onclick="listattributes();"> <input id="result" type="text" value=""> </p> </form> </body> </html> specifications specification status comment domthe definition of 'element.attributes' in that specification.
Element.classList - Web APIs
WebAPIElementclassList
however, such actions would not work in ie6-ie8 and, in ie9, slow the performance of the entire webpage to a snail's crawl, making these modifications completely impractical for this polyfill.
Element.clientHeight - Web APIs
if you need a fractional value, use element.getboundingclientrect().
Element.clientLeft - Web APIs
if you need a fractional value, use element.getboundingclientrect().
Element.clientTop - Web APIs
WebAPIElementclientTop
if you need a fractional value, use element.getboundingclientrect().
Element.clientWidth - Web APIs
if you need a fractional value, use element.getboundingclientrect().
Element: contextmenu event - Web APIs
bubbles yes cancelable yes interface mouseevent event handler property oncontextmenu examples in this example, the default action of the contextmenu event is canceled using preventdefault() when the contextmenu event is fired at the first paragraph.
Element.getClientRects() - Web APIs
fractional pixel offsets are possible.
Element: keypress event - Web APIs
interface keyboardevent bubbles yes cancelable yes default action varies: keypress event; launch text composition system; blur and focus events; domactivate event; other event examples addeventlistener keypress example this example logs the keyboardevent.code value whenever you press a key after focussing the <input> element.
Element: mousedown event - Web APIs
note: this differs from the click event in that click is fired after a full click action occurs; that is, the mouse button is pressed and released while the pointer remains inside the same element.
Element.name - Web APIs
WebAPIElementname
syntax htmlelement.name = string let elname = htmlelement.name let fcontrol = htmlformelement.elementname let controlcollection = htmlformelement.elements.elementname example <form action="" name="forma"> <input type="text" value="foo"> </form> <script type="text/javascript"> // get a reference to the first element in the form let formelement = document.forms['forma'].elements[0] // give it a name formelement.name = 'inputa' // show the value of the input alert(document.forms['forma'].elements['inputa'].value) </script> notes in internet explorer (ie), the na...
Element.scrollHeight - Web APIs
if you need a fractional value, use element.getboundingclientrect().
Element.scrollWidth - Web APIs
if you need a fractional value, use element.getboundingclientrect().
Element: wheel event - Web APIs
the default action of a wheel event is implementation-specific, and doesn't necessarily dispatch a scroll event.
Event.cancelable - Web APIs
WebAPIEventcancelable
this keeps the implementation from executing the default action that is associated with the event.
Event.defaultPrevented - Web APIs
syntax var defaultwasprevented = event.defaultprevented; value a boolean, where true indicates that the default user agent action was prevented, and false indicates that it was not.
Event.explicitOriginalTarget - Web APIs
function mycommand(ev) { alert(ev.explicitoriginaltarget.nodename); // returns 'menuitem' } <xul:command id="my-cmd-anaction" oncommand="mycommand(event);"/> <xul:menulist> <xul:menupopup> <xul:menuitem label="get my element name!" command="my-cmd-anaction"/> </xul:menupopup> </menulist> specifications this is a mozilla-specific property.
Event.isTrusted - Web APIs
WebAPIEventisTrusted
the istrusted read-only property of the event interface is a boolean that is true when the event was generated by a user action, and false when the event was created or modified by a script or dispatched via eventtarget.dispatchevent().
EventTarget.removeEventListener() - Web APIs
notes if an eventlistener is removed from an eventtarget while it is processing an event, it will not be triggered by the current actions.
ExtendableMessageEvent.data - Web APIs
var port; self.addeventlistener('push', function(e) { var obj = e.data.json(); if(obj.action === 'subscribe' || obj.action === 'unsubscribe') { port.postmessage(obj); } else if(obj.action === 'init' || obj.action === 'chatmsg') { port.postmessage(obj); } }); self.onmessage = function(e) { console.log(e.data); port = e.ports[0]; } specifications specification status comment service workersthe definition of 'extendablemessageevent.data' in that s...
ExtendableMessageEvent.lastEventId - Web APIs
var port; self.addeventlistener('push', function(e) { var obj = e.data.json(); if(obj.action === 'subscribe' || obj.action === 'unsubscribe') { port.postmessage(obj); } else if(obj.action === 'init' || obj.action === 'chatmsg') { port.postmessage(obj); } }); self.onmessage = function(e) { console.log(e.lasteventid); port = e.ports[0]; } specifications specification status comment service workersthe definition of 'extendablemessageevent.lasteven...
ExtendableMessageEvent.origin - Web APIs
var port; self.addeventlistener('push', function(e) { var obj = e.data.json(); if(obj.action === 'subscribe' || obj.action === 'unsubscribe') { port.postmessage(obj); } else if(obj.action === 'init' || obj.action === 'chatmsg') { port.postmessage(obj); } }); self.onmessage = function(e) { console.log(e.origin); port = e.ports[0]; } specifications specification status comment service workersthe definition of 'extendablemessageevent.origin' in th...
ExtendableMessageEvent.ports - Web APIs
var port; self.addeventlistener('push', function(e) { var obj = e.data.json(); if(obj.action === 'subscribe' || obj.action === 'unsubscribe') { port.postmessage(obj); } else if(obj.action === 'init' || obj.action === 'chatmsg') { port.postmessage(obj); } }); self.onmessage = function(e) { port = e.ports[0]; } specifications specification status comment service workersthe definition of 'extendablemessageevent.ports' in that specification.
ExtendableMessageEvent.source - Web APIs
var port; self.addeventlistener('push', function(e) { var obj = e.data.json(); if(obj.action === 'subscribe' || obj.action === 'unsubscribe') { port.postmessage(obj); } else if(obj.action === 'init' || obj.action === 'chatmsg') { port.postmessage(obj); } }); self.onmessage = function(e) { console.log(e.source); port = e.ports[0]; } specifications specification status comment service workersthe definition of 'extendablemessageevent.source' in th...
Fetch basic concepts - Web APIs
in a nutshell at the heart of fetch are the interface abstractions of http requests, responses, headers, and body payloads, along with a global fetch method for initiating asynchronous resource requests.
Using files from web applications - Web APIs
they just stop propagation of the event and prevent the default action from occurring: function dragenter(e) { e.stoppropagation(); e.preventdefault(); } function dragover(e) { e.stoppropagation(); e.preventdefault(); } the real magic happens in the drop() function: function drop(e) { e.stoppropagation(); e.preventdefault(); const dt = e.datatransfer; const files = dt.files; handlefiles(files); } here, we retrieve the datatransfer field fr...
FileEntrySync - Web APIs
this specification is more or less abandoned as it didn't get significant traction among browser makers.
FileSystemSync - Web APIs
the specification is abandonned for the moment, failing to get significant traction.
Introduction to the File and Directory Entries API - Web APIs
the drawback of synchronous api has to do with its interactions with web workers, which has some limitations.
Force Touch events - Web APIs
force touch events are a proprietary, apple-specific feature which makes possible (where supported by the input hardware) new interactions based on how hard the user clicks or presses down on the touchscreen or trackpad.
Using the Frame Timing API - Web APIs
firefox performance tool firefox's performance tool allows the developer to record a piece of the user's interaction and the data obtained during the recording is used to create a profile of the browser's activity.
GlobalEventHandlers.onauxclick - Web APIs
you can see the two functions in action by trying the demo out with a multi-button mouse (see it live on github; also see the source code).
GlobalEventHandlers.onclick - Web APIs
note: when using the click event to trigger an action, also consider adding this same action to the keydown event, to allow the use of that same action by people who don't use a mouse or a touch screen.
GlobalEventHandlers.onmousemove - Web APIs
tion() { node.setattribute('hidden', ''); }; })(); const links = document.queryselectorall('a'); links.foreach(link => { link.onmouseover = tooltip.show; link.onmousemove = tooltip.follow; link.onmouseout = tooltip.hide; }); result draggable elements we also have an example available showing the use of the onmousemove event handler with draggable objects — view the example in action.
GlobalEventHandlers.ontransitioncancel - Web APIs
this could also be used to trigger animations or other effects, to allow chaining of reactions.
GlobalEventHandlers.ontransitionend - Web APIs
this could also be used to trigger animations or other effects, to allow chaining of reactions.
HTMLDetailsElement: toggle event - Web APIs
bubbles no cancelable no interface event event handler property none default action toggles the open state of the <details> element.
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.
HTMLDialogElement.show() - Web APIs
still allowing interaction with content outside of the dialog.
HTMLDialogElement.showModal() - Web APIs
interaction outside the dialog is blocked and the content outside it is rendered inert.
HTMLElement: beforeinput event - Web APIs
bubbles yes cancelable yes interface inputevent event handler property none sync / async sync composed yes default action update the dom element examples this example logs current value of the element immediately before replacing that value with the new one applied to the <input> element.
inert - Web APIs
WebAPIHTMLElementinert
according to the spec: when a node is inert, then the user agent must act as if the node was absent for the purposes of targeting user interaction events, may ignore the node for the purposes of text search user interfaces (commonly known as "find in page"), and may prevent the user from selecting text in that node.
HTMLElement.offsetHeight - Web APIs
if you need a fractional value, use element.getboundingclientrect().
HTMLElement.offsetWidth - Web APIs
if you need a fractional value, use element.getboundingclientrect().
HTMLElement: pointercancel event - Web APIs
the touch-action css property prevents the input from continuing.
HTMLElement - Web APIs
htmlelement.inert is a boolean indicating whether the user agent must act as though the given node is absent for the purposes of user interaction events, in-page text searches ("find in page"), and text selection.
HTMLFormElement.target - Web APIs
the target property of the htmlformelement interface represents the target of the form's action (i.e., the frame in which to render its output).
HTMLInputElement: invalid event - Web APIs
html <form action="#"> <ul> <li><label>enter an integer between 1 and 10: <input type="number" min="1" max="10" required></label></li> <li><input type="submit" value="submit"></li> </ul> </form><p id="log"></p> javascript const input = document.queryselector('input') const log = document.getelementbyid('log') input.addeventlistener('invalid', logvalue) function logvalue(e) { log.textcontent += e.
HTMLMediaElement: canplay event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.oncanplay specification html5 media examples these examples add an event listener for the htmlmediaelement's canplay event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: canplaythrough event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.oncanplaythrough specification html5 media examples these examples add an event listener for the htmlmediaelement's canplaythrough event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: durationchange event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.ondurationchange specification html5 media examples these examples add an event listener for the htmlmediaelement's durationchange event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: emptied event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.onemptied specification html5 media examples these examples add an event listener for the htmlmediaelement's emptied event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: ended event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.onended specification html5 media this event is also defined in media capture and streams and web audio api examples these examples add an event listener for the htmlmediaelement's ended event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: loadeddata event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.onloadeddata specification html5 media note that this event will not fire in mobile/tablet devices if data-saver is on in browser settings.
HTMLMediaElement: loadedmetadata event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.onloadedmetadata specification html5 media additional properties property type description mozchannels read only int the number of channels.
HTMLMediaElement: pause event - Web APIs
general info bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.onpause specification html5 media examples these examples add an event listener for the htmlmediaelement's pause event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: play event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.onplay specification html5 media examples these examples add an event listener for the htmlmediaelement's play event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: playing event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.onplaying specification html5 media examples these examples add an event listener for the htmlmediaelement's playing event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: ratechange event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.onratechange specification html5 media examples these examples add an event listener for the htmlmediaelement's ratechange event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: seeked event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.onseeked specification html5 media examples these examples add an event listener for the htmlmediaelement's seeked event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: seeking event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.onseeking specification html5 media examples these examples add an event listener for the htmlmediaelement's seeking event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: stalled event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.onstalled specification html5 media examples these examples add an event listener for the htmlmediaelement's stalled event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: suspend event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.onsuspend specification html5 media examples these examples add an event listener for the htmlmediaelement's suspend event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: timeupdate event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.ontimeupdate specification html5 media examples these examples add an event listener for the htmlmediaelement's timeupdate event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: volumechange event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.onvolumechange specification html5 media examples these examples add an event listener for the htmlmediaelement's volumechange event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: waiting event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.onwaiting specification html5 media examples these examples add an event listener for the htmlmediaelement's waiting event, then post a message when that event handler has reacted to the event firing.
HTMLOutputElement - Web APIs
when the problem is reported, the user agent may focus the element and change the scrolling position of the document or perform some other action that brings the element to the user's attention.
HTMLSelectElement.form - Web APIs
syntax edit aform = aselectelement.form.selectname; example html <form action="http://www.google.com/search" method="get"> <label>google: <input type="search" name="q"></label> <input type="submit" value="search..."> </form> javascript a property available on all form elements, "type" returns the type of the calling form element.
HTMLSelectElement.selectedOptions - Web APIs
result the resulting content looks like this in action: specifications specification status comment html living standardthe definition of 'htmlselectelement.selectedoptions' in that specification.
HTMLTextAreaElement - Web APIs
disabled boolean: returns / sets the element's disabled attribute, indicating that the control is not available for interaction.
In depth: Microtasks and the JavaScript runtime environment - Web APIs
the event loop, then, drives everything that happens in the browser as it pertains to the interaction with the user, but more importantly for our purposes here, it is responsible for the scheduling and execution of every piece of code that runs within its thread.
Using microtasks in JavaScript with queueMicrotask() - Web APIs
this lets the given function run without the risk of interfering with another script's execution, yet also ensures that the microtask runs before the user agent has the opportunity to react to actions taken by the microtask.
History.replaceState() - Web APIs
this method is particularly useful when you want to update the state object or url of the current history entry in response to some user action.
Working with the History API - Web APIs
replacestate() is particularly useful when you want to update the state object or url of the current history entry in response to some user action.
IDBCursor.continuePrimaryKey() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbcursor's transaction is inactive.
IDBCursor.request - Web APIs
WebAPIIDBCursorrequest
for example: function displaydata() { list.innerhtml = ''; var transaction = db.transaction(['rushalbumlist'], 'readonly'); var objectstore = transaction.objectstore('rushalbumlist'); var request = objectstore.opencursor(); request.onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.albumtitle + '</strong>, ' + cursor.val...
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.
IDBDatabase.onclose - Web APIs
the close event is fired after all transactions have been aborted and the connection has been closed.
IDBDatabase.onversionchange - Web APIs
this is different from the versionchange transaction (but it is related).
IDBIndex.getAll() - Web APIs
WebAPIIDBIndexgetAll
exceptions this method may raise a domexception of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive.
IDBIndex.getAllKeys() - Web APIs
exceptions this method may raise a domexception of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive.
IDBLocaleAwareKeyRange - Web APIs
examples function displaydata() { var keyrangevalue = idblocaleawarekeyrange.bound("a", "f"); var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); var myindex = objectstore.index('lname'); myindex.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tablerow = document.createelement('tr'); tablerow.innerhtml = '&lt;td&gt;' + cursor.value.id + '&lt;/td&gt;' ...
IDBObjectStore.getAll() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbobjectstore's transaction is inactive.
IDBObjectStore.getAllKeys() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbobjectstore's transaction is inactive.
IDBObjectStoreSync - Web APIs
openindex() opens the index with the given name, using the mode of the current transaction.
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.
IDBOpenDBRequest.onupgradeneeded - Web APIs
var bookstore = request.transaction.objectstore("books"); var yearindex = bookstore.createindex("by_year", "year"); } if (event.oldversion < 3) { // version 3 introduces a new object store for magazines with two indexes.
IDBOpenDBRequest - Web APIs
blocked fired when an open connection to a database is blocking a versionchange transaction on the same database.
IDBRequest.onerror - Web APIs
for a full working example, see our to-do notifications app (view example live.) var title = "walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as it's title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objectstoretitlerequest.result; // update the notified value in the obje...
IDBRequest.onsuccess - Web APIs
for a full working example, see our to-do notifications app (view example live.) var title = "walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as it's title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objectstoretitlerequest.result; // update the notified value in the obje...
IDBRequest.readyState - Web APIs
for a full working example, see our to-do notifications app (view example live.) var title = "walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as it's title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objectstoretitlerequest.result; // update the notified value in the obje...
IDBRequest.result - Web APIs
WebAPIIDBRequestresult
for a full working example, see our to-do notifications app (view example live.) var title = "walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as it's title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objectstoretitlerequest.result; // update the notified value in the obje...
IDBRequest.source - Web APIs
WebAPIIDBRequestsource
for a full working example, see our to-do notifications app (view example live.) var title = "walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as its title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objectstoretitlerequest.result; // update the notified value in the objec...
IDBVersionChangeEvent.version - Web APIs
the version property of the idbversionchangeevent interface returns the new version of the database in a versionchange transaction.
IDBVersionChangeRequest.setVersion() - Web APIs
the idbversionchangerequest.setversion method updates the version of the database, returning immediately and running a versionchange transaction on the connected database in a separate thread.
IDBVersionChangeRequest - Web APIs
returns immediately and runs a versionchange transaction on the connected database in a separate thread.
IdleDeadline.didTimeout - Web APIs
your callback will typically check the value of didtimeout if it needs to perform an action even if the browser is too busy to grant you the time; you should react by performing the needed task or, ideally, a minimal amount of work that can be done to keep things moving along, then schedule a new callback to try again to get the rest of the work done.
firesTouchEvents - Web APIs
you can use this property to detect mouse events that represent an action that may already have been handled by touch event handlers.
InstallEvent - Web APIs
the parameter passed into the oninstall handler, the installevent interface represents an install action that is dispatched on the serviceworkerglobalscope of a serviceworker.
KeyboardEvent.key - Web APIs
WebAPIKeyboardEventkey
} // cancel the default action to avoid it being handled twice event.preventdefault(); }, true); specification specification status comment ui eventsthe definition of 'keyboardevent.key' in that specification.
LayoutShift - Web APIs
properties layoutshift.value returns the impact fraction (fraction of the viewport that was shifted) times the distance fraction (distance moved as a fraction of viewport).
LocalFileSystemSync - Web APIs
this specification is more or less abandonned, failing to get significant traction.
LockedFile.abort() - Web APIs
WebAPILockedFileabort
note: when an ongoing operation is canceled, there is no rollback (it is not a database transaction), therefore the file can be corrupted if the canceled operation was performing some writing.
MediaError.message - Web APIs
result you can try out this example below, and can see the example in action outside this page here.
expiration - Web APIs
this value may change during a session lifetime, such as when an action triggers the start of a window.
MediaKeySession - Web APIs
this value may change during a session lifetime, such as when an action triggers the start of a window.
MediaSession.playbackState - Web APIs
example the following example sets up event handlers, for pausing and playing: var audio = document.queryselector("#player"); audio.src = "song.mp3"; navigator.mediasession.setactionhandler('play', play); navigator.mediasession.setactionhandler('pause', pause); function play() { audio.play(); navigator.mediasession.playbackstate = "playing"; } function pause() { audio.pause(); navigator.mediasession.playbackstate = "paused"; } specifications specification status comment media session standardthe definition of 'playbackstate' in that spe...
Recording a media element - Web APIs
background-color: darkgreen; text-decoration: none; } h2 { margin-bottom: 4px; } .left { margin-right: 10px; float: left; width: 160px; padding: 0px; } .right { margin-left: 10px; float: left; width: 160px; padding: 0px; } .bottom { clear: both; padding-top: 10px; } javascript content now let's have a look at the javascript code; this is where the majority of the action happens, after all!
Capabilities, constraints, and settings - Web APIs
function log(msg) { logelement.innerhtml += (msg + "<br>"); } function handleerror(reason) { log("error <code>" + reason.name + "</code> in constraint <code>" + reason.constraint + "</code>: " + reason.message); } result here you can see the complete example in action.
MerchantValidationEvent.validationURL - Web APIs
this data should be passed into the complete() method to let the user agent complete the transaction.
MessageEvent - Web APIs
the action triggered by this event is defined in a function set as the event handler for the relevant message event (e.g.
MouseEvent.button - Web APIs
WebAPIMouseEventbutton
a mouse configured for left-handed use may have the button actions reversed.
MouseEvent.initMouseEvent() - Web APIs
cancelable whether or not the event's default action can be prevented.
MouseEvent.which - Web APIs
WebAPIMouseEventwhich
syntax var buttonpressed = instanceofmouseevent.which return value a number representing a given button: 0: no button 1: left button 2: middle button (if present) 3: right button for a mouse configured for left-handed use, the button actions are reversed.
NameList - Web APIs
WebAPINameList
namelist has been removed, effective with gecko 10.0 the namelist interface provides an abstraction for an ordered collection of name and namespace value pairs.
Navigator.msLaunchUri() - Web APIs
if a handler doesn't exist, and the developer doesn't provide a nohandlercallback, then internet explorer displays a dialog that asks the user if they want to allow the action.
Navigator.share() - Web APIs
WebAPINavigatorshare
return value a promise that will be fulfilled once a user has completed a share action (usually the user has chosen an application to share to).
Notification.requestPermission() - Web APIs
to see a example in action, check out our to-do list example (also see the app running live.) note: in the above example we spawn notifications in response to a user gesture (clicking a button).
OfflineAudioContext: complete event - Web APIs
bubbles no cancelable no default action none interface offlineaudiocompletionevent event handler property offlineaudiocontext.oncomplete examples when processing is complete, you might want to use the oncomplete handler the prompt the user that the audio can now be played, and enable the play button: let offlineaudioctx = new offlineaudiocontext(); offlineaudioctx.addeventlistener('complete', () => { console.log('offline audio processing now complete'); showmodaldialog('song processed and ready to play'); playbtn.disabled = false; }) you can also set up the event handler using the offlineaudioco...
Page Visibility API - Web APIs
you can detect the event and perform some actions or behave differently.
PaymentCurrencyAmount.value - Web APIs
this must be a valid decimal number, with an optional leading minus sign ("-"), then one or more decimal digits 0 through 9, optionally with a decimal point (".") with at least one digit following it to represent fractional units.
PaymentDetailsBase - Web APIs
this can be delivered to the payment interface using either paymentdetailsupdateevent.updatewith() or by returning it from the optional detailsupdate promise provided to the paymentrequest.show() call that begins the user interaction.
PaymentRequest.PaymentRequest() - Web APIs
details provides information about the requested transaction.
PaymentRequest.onpaymentmethodchange - Web APIs
the paymentmethodchange event is triggered by a user-agent controlled interaction (i.e., the end-user switches from a debit to a credit card in the payment ui).
PaymentRequest.onshippingaddresschange - Web APIs
}; examples the shippingaddresschange event is triggered by a user-agent controlled interaction.
PaymentRequest.onshippingoptionchange - Web APIs
}; examples the shippingoptionchange event is triggered by a user-agent controlled interaction.
PaymentRequest: paymentmethodchange event - Web APIs
= calculateservicefee(event.methoddetails); object.assign(detailsupdate, servicefeeinfo); } event.updatewith(detailsupdate); }, false); this begins by looking at the event's methodname property; if that indicates that the user is trying to use apple pay, we pass the methoddetails into a function called calculateservicefee(), which we might create to take the information about the transaction, such as the underlying credit card being used to service the apple pay request, and compute and return an paymentdetailsupdate object that specifies changes to be applied to the paymentrequest in order to add any service fees that the payment method might require.
PaymentRequestUpdateEvent.PaymentRequestUpdateEvent() - Web APIs
the paymentrequestupdateevent constructor creates a new paymentrequestupdateevent object which enables a web page to update the details of a paymentrequest in response to a user action.
PaymentResponse.details - Web APIs
the details read-only property of the paymentresponse interface returns a json-serializable object that provides a payment method specific message used by the merchant to process the transaction and determine a successful funds transfer.
Pointer Lock API - Web APIs
the buttons are then freed up for other actions.
PopStateEvent - Web APIs
the popstate event is only triggered by doing a browser action such as a clicking on the back button (or calling history.back() in javascript).
ProgressEvent.initProgressEvent() - Web APIs
cancelablearg is a boolean flag indicating if the event associated action can be avoided (true) or not (false).
PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable() - Web APIs
a user-verifying platform authenticator is a kind of multi-factor authenticator that is part of the client device (it is generally not removable) and that involves an action from the user in order to identify them.
PublicKeyCredentialCreationOptions.authenticatorSelection - Web APIs
(as part of the authenticatordata property of authenticatorattestationresponse.attestationobject) "preferred": user verification is prefered, the operation will not fail if the response does not have the uv flag (as part of the authenticatordata property of authenticatorattestationresponse.attestationobject) "discouraged": user verification should not be employed as to minimize the user interaction during the process.
PublicKeyCredentialRequestOptions.userVerification - Web APIs
equired, the operation will fail if the response does not have the uv flag (as part of authenticatorassertionresponse.authenticatordata) "preferred": user verification is prefered, the operation will not fail if the response does not have the uv flag (as part of authenticatorassertionresponse.authenticatordata) "discouraged": user verification should not be employed as to minimize the user interaction during the process.
PushMessageData - Web APIs
examples self.addeventlistener('push', function(event) { var obj = event.data.json(); if(obj.action === 'subscribe' || obj.action === 'unsubscribe') { firenotification(obj, event); port.postmessage(obj); } else if(obj.action === 'init' || obj.action === 'chatmsg') { port.postmessage(obj); } }); specifications specification status comment push apithe definition of 'pushmessagedata' in that specification.
Push API - Web APIs
WebAPIPush API
interfaces pushevent represents a push action, sent to the global scope of a serviceworker.
RTCIceCandidateInit.usernameFragment - Web APIs
value a domstring containing the username fragment (usually referred to in shorthand as "ufrag" or "ice-ufrag") that, along with the ice password ("ice-pwd"), uniquely identifies a single ongoing ice interaction, including for any communication with the stun server.
RTCIceCandidatePairStats.retransmissionsReceived - Web APIs
note: retransmissions are connectivity check requests with a transaction_transmit_counter attribute whose req field is greater than 1 (indicating that the request has been transmitted more than once).
RTCIceCandidatePairStats.retransmissionsSent - Web APIs
note: retransmissions are connectivity check requests with a transaction_transmit_counter attribute whose req field is greater than 1 (indicating that the request has been transmitted more than once).
RTCIceCandidatePairStats - Web APIs
a retransmission is a connectivity check request whose transaction_transmit_counter attribute's req field is greater than 1.
RTCIceCandidateStats.protocol - Web APIs
this is the preferred protocol for media interactions because of its better performance profile.
RTCIceProtocol - Web APIs
this is the preferred protocol for media interactions because of its better performance profile.
RTCIceTransport.state - Web APIs
a value of "disconnected" means that a transient issue has occurred that has broken the connection, but that should resolve itself automatically without your code having to take any action.
RTCIceTransportState - Web APIs
a value of "disconnected" means that a transient issue has occurred that has broken the connection, but that should resolve itself automatically without your code having to take any action.
RTCPeerConnection: icecandidate event - Web APIs
if you need to perform any special actions when there are no further candidates expected, you're much better off watching the ice gathering state by watching for icegatheringstatechange events: pc.addeventlistener("icegatheringstatechange", ev => { switch(pc.icegatheringstate) { case "new": /* gathering is either just starting or has been reset */ break; case "gathering": /* gathering has begun or is ongoing ...
RTCPeerConnection: negotiationneeded event - Web APIs
see signaling transaction flow in signaling and video calling for a description of the signaling process that begins with a negotiationneeded event.
RTCPeerConnection.oniceconnectionstatechange - Web APIs
example the example below watches the state of the ice agent for a failure or unexpected closure and takes appropriate action, such as presenting an error message or attempting to restart the ice agent.
RTCRtpSendParameters - Web APIs
transactionid a string containing a unique id for the last set of parameters applied; this value is used to ensure that setparameters() can only be called to alter changes made by a specific previous call to getparameters().
RTCRtpSender.setParameters() - Web APIs
transactionid a string containing a unique id for the last set of parameters applied; this value is used to ensure that setparameters() can only be called to alter changes made by a specific previous call to getparameters().
RTCStatsIceCandidatePairState - Web APIs
in-progress a check has been initiated for this pair, but the check's transaction is still in progress.
Range.extractContents() - Web APIs
event listeners added using dom events are not retained during extraction.
ReadableByteStreamController - Web APIs
readablebytestreamcontroller.error() causes any future interactions with the associated stream to error.
ReadableStreamDefaultController - Web APIs
readablestreamdefaultcontroller.error() causes any future interactions with the associated stream to error.
SVGElement: zoom event - Web APIs
the zoom event occurs when the user initiates an action which causes the current view of the svg document fragment to be rescaled.
SVGSVGElement - Web APIs
to suspend redraw actions as a collection of svg dom changes occur, precede the changes to the svg dom with a method call similar to: const suspendhandleid = suspendredraw(maxwaitmilliseconds) and follow the changes with a method call similar to: unsuspendredraw(suspendhandleid) note that multiple suspendredraw() calls can be used at once, and that each such method call is treated independently of the other suspe...
ScriptProcessorNode: audioprocess event - Web APIs
bubbles no cancelable no default action none interface audioprocessingevent event handler property scriptprocessornode.onaudioprocess examples scriptnode.addeventlistener('audioprocess', function(audioprocessingevent) { // the input buffer is a song we loaded earlier var inputbuffer = audioprocessingevent.inputbuffer; // the output buffer contains the samples that will be modified and played var outputbuffer = audioprocessingevent.outputbuffer; // loop through the output channels (in this case there is only one) for (var channel = 0; channel < outputbuffer.numberofchannels; c...
Using server-sent events - Web APIs
you can take action on this programmatically by implementing the onerror callback on the eventsource object: evtsource.onerror = function(err) { console.error("eventsource failed:", err); }; closing event streams by default, if the connection between the client and server closes, the connection is restarted.
ServiceWorkerGlobalScope.skipWaiting() - Web APIs
self.skipwaiting(); // perform any other actions required for your // service worker to install, potentially inside // of event.waituntil(); }); specifications specification status comment service workersthe definition of 'skipwaiting()' in that specification.
SourceBuffer.abort() - Web APIs
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.
StorageManager.persist() - Web APIs
example if (navigator.storage && navigator.storage.persist) navigator.storage.persist().then(function(persistent) { if (persistent) console.log("storage will not be cleared except by explicit user action"); else console.log("storage may be cleared by the ua under storage pressure."); }); specifications specification status comment storagethe definition of 'persist' in that specification.
StorageManager.persisted() - Web APIs
example if (navigator.storage && navigator.storage.persist) navigator.storage.persisted().then(function(persistent) { if (persistent) console.log("storage will not be cleared except by explicit user action"); else console.log("storage may be cleared by the ua under storage pressure."); }); specifications specification status comment storagethe definition of 'persisted' in that specification.
Streams API concepts - Web APIs
this serves as an abstraction over the top of an underlying sink — a lower-level i/o sink into which raw data is written.
Using writable streams - Web APIs
this currently only has one method available on it — writablestreamdefaultcontroller.error(), which when invoked causes future interactions with the stream to error.
Streams API - Web APIs
writable streams writablestream provides a standard abstraction for writing streaming data to a destination, known as a sink.
SubmitEvent - Web APIs
this event is fired at the <form> when the form's submit action is invoked.
SyncEvent - Web APIs
WebAPISyncEvent
the syncevent interface represents a sync action that is dispatched on the serviceworkerglobalscope of a serviceworker.
TouchEvent - Web APIs
there are several possible reasons why this might happen (and the exact reasons will vary from device to device, as well as browser to browser): an event of some kind occurred that canceled the touch; this might happen if a modal alert pops up during the interaction.
TransitionEvent.initTransitionEvent() - Web APIs
cancelablearg is a boolean flag indicating if the event associated action can be avoided (true) or not (false).
Vibration API - Web APIs
continued vibrations some basic setinterval and clearinterval action will allow you to create persistent vibration: var vibrateinterval; // starts vibration at passed in level function startvibrate(duration) { navigator.vibrate(duration); } // stops vibration function stopvibrate() { // clear interval and stop persistent vibrating if(vibrateinterval) clearinterval(vibrateinterval); navigator.vibrate(0); } // start persistent vibration at given ...
WakeLockSentinel - Web APIs
the sentinel can be acquired or released via appropriate interactions.
WebGLRenderingContext.enableVertexAttribArray() - Web APIs
tion(shaderprogram, "avertexposition"); gl.enablevertexattribarray(avertexposition); gl.vertexattribpointer(avertexposition, vertexnumcomponents, gl.float, false, 0, 0); gl.drawarrays(gl.triangles, 0, vertexcount); this code snippet is taken from the function animatescene() in "a basic 2d webgl animation example." see that article for the full sample and to see the resulting animation in action.
WebGLRenderingContext.getUniformLocation() - Web APIs
rotationvector = gl.getuniformlocation(shaderprogram, "urotationvector") gl.uniform2fv(uscalingfactor, currentscale); gl.uniform2fv(urotationvector, currentrotation); gl.uniform4fv(uglobalcolor, [0.1, 0.7, 0.2, 1.0]); this code snippet is taken from the function animatescene() in "a basic 2d webgl animation example." see that article for the full sample and to see the resulting animation in action.
WebGLRenderingContext.stencilOp() - Web APIs
the webglrenderingcontext.stencilop() method of the webgl api sets both the front and back-facing stencil test actions.
WebGLRenderingContext.stencilOpSeparate() - Web APIs
the webglrenderingcontext.stencilopseparate() method of the webgl api sets the front and/or back-facing stencil test actions.
Hello vertex attributes - Web APIs
« previousnext » this webgl example demonstrates how to combine shader programming and user interaction by sending user input to the shader using vertex attributes.
Matrix math for the web - Web APIs
plymatrixandpoint(matrixa, row2); let result3 = multiplymatrixandpoint(matrixa, row3); // turn the result rows back into a single matrix return [ result0[0], result0[1], result0[2], result0[3], result1[0], result1[1], result1[2], result1[3], result2[0], result2[1], result2[2], result2[3], result3[0], result3[1], result3[2], result3[3] ]; } let's look at this function in action: let somematrix = [ 4, 0, 0, 0, 0, 3, 0, 0, 0, 0, 5, 0, 4, 8, 4, 1 ] let identitymatrix = [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]; // returns a new array equivalent to somematrix let somematrixresult = multiplymatrices(identitymatrix, somematrix); important: these matrix functions are written for clarity of explanation, not for speed or memory management.
WebGL best practices - Web APIs
that is, it's the first js run after raf callbacks and the browser content (transaction) presentation step.
WebGL: 2D and 3D graphics for the web - Web APIs
WebAPIWebGL API
the examples are sorted according to topic and level of difficulty, covering the webgl rendering context, shader programming, textures, geometry, user interaction, and more.
WebRTC connectivity - Web APIs
aborting the call would be an excessive reaction in that situation.
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
that's the impolite peer in action.
A simple RTCDataChannel sample - Web APIs
if the state has changed to "closed", the opposite set of actions occurs: the input box and "send" button are disabled, the "connect" button is enabled so that the user can open a new connection if they wish to do so, and the "disconnect" button is disabled, since it's not useful when no connection exists.
WebSocket() - Web APIs
these strings are used to indicate sub-protocols, so that a single server can implement multiple websocket sub-protocols (for example, you might want one server to be able to handle different types of interactions depending on the specified protocol).
WebSocket: close event - Web APIs
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.'); }; specifications specification status html living standardthe definition of 'websocket close' in that specification.
Writing WebSocket client applications - Web APIs
these strings are used to indicate sub-protocols, so that a single server can implement multiple websocket sub-protocols (for example, you might want one server to be able to handle different types of interactions depending on the specified protocol).
Fundamentals of WebXR - Web APIs
in webxr, the primary select and squeeze actions are directly supported using events, while other controls are available through a special webxr-specific implementation of the gamepad object.
Geometry and reference spaces in WebXR - Web APIs
as such the time is typically in alignment with the refresh rate of the display, or some fraction thereof if the frame rate needs to be constrained due to performance issues.
Movement, orientation, and motion: A WebXR example - Web APIs
screenshot of this example in action the core of this example—the spinning, textured, lighted cube—is taken from our webgl tutorial series; namely, the penultimate article in the series, covering lighting in webgl.
WebXR performance guide - Web APIs
that means that for every frame, the javascript runtime has to allocate memory for those and set them up—possibly triggering garbage collection—and then when each interaction of the loop is completed, the memory is released.
Starting up and shutting down a WebXR session - Web APIs
if you use xr input controllers, watch the inputsourceschange event to detect the addition or removal of xr input controllers, and the various select and squeeze action events.
WebXR Device API - Web APIs
xrinputsource represents any input device the user can use to perform targeted actions within the same virtual space as the viewer.
Advanced techniques: Creating and sequencing audio - Web APIs
let's create another async function to set up the sample — we can combine the two async functions in a nice promise pattern to perform further actions when this file is loaded and buffered: async function setupsample() { const filepath = 'dtmf.mp3'; const sample = await getfile(audioctx, filepath); return sample; } note: you can easily modify the above function to take an array of files and loop over them to load more than one sample.
Web Workers API - Web APIs
they are intended, among other things, to enable the creation of effective offline experiences, intercept network requests and take appropriate action based on whether the network is available, and update assets residing on the server.
WheelEvent - Web APIs
do not confuse the wheel event with the scroll event: the default action of a wheel event is implementation-defined.
Window.clearImmediate() - Web APIs
this method clears the action specified by window.setimmediate.
window.location - Web APIs
WebAPIWindowlocation
} alert(alog.join("\n")); } // in html: <button onclick="showloc();">show location properties</button> example #5: send a string of data to the server by modifying the search property: function senddata (sdata) { location.search = sdata; } // in html: <button onclick="senddata('some data');">send data</button> the current url with "?some%20data" appended is sent to the server (if no action is taken by the server, the current document is reloaded with the modified search string).
Window.open() - Web APIs
WebAPIWindowopen
the purpose of the return false in the code is to cancel default action of the link: if the onclick event handler is executed, then there is no need to execute the default action of the link.
Window: popstate event - Web APIs
the popstate event will be triggered by doing a browser action such as a click on the back or forward button (or calling history.back() or history.forward() in javascript).
Window.setImmediate() - Web APIs
notes the clearimmediate method can be used to clear the immediate actions, just like cleartimeout for settimeout.
Window: storage event - Web APIs
console.log(json.parse(window.localstorage.getitem('samplelist'))); }); the same action can be achieved using the onstorage event handler property: window.onstorage = () => { // when local storage changes, dump the list to // the console.
Window: unload event - Web APIs
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).
WindowEventHandlers.onpopstate - Web APIs
the popstate event is only triggered by performing a browser action, such as clicking on the back button (or calling history.back() in javascript), when navigating between two history entries for the same document.
self.createImageBitmap() - Web APIs
options optional an object that sets options for the image's extraction.
WritableStream - Web APIs
the writablestream interface of the the streams api provides a standard abstraction for writing streaming data to a destination, known as a sink.
WritableStreamDefaultController - Web APIs
methods writablestreamdefaultcontroller.error() causes any future interactions with the associated stream to error.
XMLHttpRequest: load event - Web APIs
the load event is fired when an xmlhttprequest transaction completes successfully.
XMLHttpRequest.open() - Web APIs
if true, notification of a completed transaction is provided using event listeners.
XMLHttpRequest.responseType - Web APIs
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.
XMLHttpRequest - Web APIs
load fired when an xmlhttprequest transaction completes successfully.
XMLHttpRequestEventTarget.onload - Web APIs
the xmlhttprequesteventtarget.onload is the function called when an xmlhttprequest transaction completes successfully.
XRInputSourceEvent.inputSource - Web APIs
this event indicates an action the user has taken using a webxr input controller, such as a hand controller, motion sensing device, or other input apparatus.
XRSession.onselectend - Web APIs
} example xrsession.onselectend = function(event) { console.log("the user has completed a primary action.") } specifications specification status comment webxr device apithe definition of 'xrsession.onselectend' in that specification.
XRSession.onselectstart - Web APIs
} example xrsession.onselectstart = function(event) { console.log("the user has started a primary action, but might not have completed it.") } specifications specification status comment webxr device apithe definition of 'xrsession.onselectstart' in that specification.
XRSystem: requestSession() - Web APIs
adding controls is a necessary step because entering xr requires a user action.
XRView - Web APIs
WebAPIXRView
there might also be views representing observers watching the action, or other viewspoints not direclty associated with a player's eye.
ARIA live regions - Accessibility
using javascript, it is possible to dynamically change parts of a page without requiring the entire page to reload — for instance, to update a list of search results on the fly, or to display a discreet alert or notification which does not require user interaction.
Using the aria-activedescendant attribute - Accessibility
possible effects on user agents and assistive technology the user agent, which is any software that retrieves, renders and facilitates end user interaction with web content, uses the aria-activedescendant property to inform the assistive technology about the active child which has focus.
Using the aria-required attribute - Accessibility
examples example 1: a simple form <form action="post"> <label for="firstname">first name:</label> <input id="firstname" type="text" aria-required="true" /> <br/> <label for="lastname">last name:</label> <input id="lastname" type="text" aria-required="true" /> <br/> <label for="streetaddress">street address:</label> <input id="streetaddress" type="text" /> </form> working examples: tooltip example (i...
Using the progressbar role - Accessibility
a progressbar indicates that the user's request has been received and the application is making progress toward completing the requested action.
Using the slider role - Accessibility
arrow keys should operate as follows (localization for right-to-left languages should reverse the direction of the arrows): key(s) action right and up arrows increase the selected value left and down arrows decrease the selected value page up and page down optionally increase and decrease the value by a set amount (e.g.
ARIA: tabpanel role - Accessibility
the aria tabpanel role indicates description an element with the tabpanel role associated roles and attributes aria- keyboard interaction key action tab → ← delete required javascript features include note about semantic alternatives to using this role or attribute.
ARIA: article role - Accessibility
keyboard interactions this role does not support any specific keyboard interaction.
ARIA: banner role - Accessibility
associated aria roles, states, and properties none keyboard interactions none required javascript features none examples here's a fake simple banner with a skip to navigation link, a logo, a title and a subtitle.
ARIA: cell role - Accessibility
keyboard interactions none required javascript features the first rule of aria use is if you can use a native feature with the semantics and behavior you require already built in, instead of repurposing an element and adding an aria role, state or property to make it accessible, then do so.
ARIA: Comment role - Accessibility
the comment landmark role semantically denotes a comment/reaction to some content on the page, or to a previous comment.
ARIA: figure role - Accessibility
keyboard interactions no role specific keyboard interactions.
ARIA: form role - Accessibility
keyboard interactions no role specific keyboard interactions required javascript features onsubmit the onsubmit event handler handles the event raised when the form is submitted.
ARIA: List role - Accessibility
keyboard interactions none.
ARIA: Listitem role - Accessibility
keyboard interactions none.
ARIA: Navigation Role - Accessibility
keyboard interactions none.
ARIA: Region role - Accessibility
keyboard interactions none.
ARIA: img role - Accessibility
an aria-label attribute keyboard interactions required javascript features examples star rating role="img" example specifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'img' in that specification.
ARIA: rowgroup role - Accessibility
keyboard interactions none required javascript features none.
ARIA: tab role - Accessibility
associated roles and attributes aria-selected boolean aria-controls id of element with tabpanel role id content keyboard interaction key action tab when focus is outside of the tablist moves focus to the active tab.
ARIA: checkbox role - Accessibility
keyboard interactions key function space activates the checkbox required javascript required event handlers onclick handle mouse clicks that will change the state of the checkbox by changing the value of the aria-checked attribute and the appearance of the checkbox so it appears checked or unchecked to the sighted user onkeypress handle the case where the user presses the space ...
ARIA: dialog role - Accessibility
if the dialog can be moved or resized, ensure that these actions must be performable by keyboard users as well as mouse users.
ARIA: heading role - Accessibility
keyboard interactions this role does not require any special keyboard navigation.
ARIA: textbox role - Accessibility
keyboard interactions in a single-line use (when aria-multiline is false or not used), the return or enter key submits the form.
WAI-ARIA Roles - Accessibility
elements containing role="checkbox" must also include the aria-checked attribute to expose the checkbox's state to assistive technology.aria: comment rolethe comment landmark role semantically denotes a comment/reaction to some content on the page, or to a previous comment.aria: complementary rolethe complementary landmark role is used to designate a supporting section that relates to the main content, yet can stand alone when separated.
overview - Accessibility
general resources dhtml style guide provides keyboard interaction recommendations wai-aria authoring practices guide checkbox aria toggle button and tri-state checkbox examples (from "the paciello group blog") aria example checkbox widgets from the university of illinois menu using wai-aria roles and states with the yui menu control slider from the paciello group blog: aria slider, part one, part two, part threet (example) creating an accessible, internationalized dojo rating widget tabs enhancing tabview accessibility with wai-aria roles and states, from the yui blog enhancing the jquery ui tabs accordingly to wcag 2.0 and ari...
Accessibility and Spacial Patterns - Accessibility
see also mdn accessibiltity: what users can do to browse more safely web accessibiltity for seizures and physical reactions web accessibility: understanding colors and luminance braille part 3: a step-by-step guide to typesetting ada braille correctly in adobe illustrator spatial math in brailleblaster (4 of 5) government literature nasa: designing with blue math spatial reasoning: why math talk is about more than numbers scientific literature colour constancy in context: roles for local ad...
HTML To MSAA - Accessibility
map html element role name value states relations actions events notes a role_system_ link n/a value of @href attribute state_system_ selectable if @name attribute is presented state_system_ linked if @href attribute is presented or click event listener is registered state_system_ traversed if link is traversed n/a "jump" if @href is valid n/a br role_system_ whitespace '\n' (new line char) state_system_ readonly n/a n/a n/a button role...
Keyboard-navigable JavaScript widgets - Accessibility
for example: <span tabindex="-1" onkeydown="return handlekeydown();"> if handlekeydown() returns false, the event will be consumed, preventing the browser from performing any action based on the keystroke.
Mobile accessibility checklist - Accessibility
for touch events, at least one of the following must be true (wcag 2.1: pointer cancellation): the down-event should not be used to trigger any action the action is triggered on the up event and an option to abort the action before its completion is available or an option to undo the action after its completion the up-event will undo any action that was triggered on a down event it is essential to trigger the action on the down event.
Perceivable - Accessibility
s (aa) added in 2.1 while additional content may appear and disappear in coordination with hover and keyboard focus, this success criterion specifies three conditions that must be met: dismissable (can be closed/removed) hoverable (the additional content does not disappear when the pointer is over it) persistent (the additional content does not disappear without user action) understanding content on hover or focus note: also see the wcag description for guideline 1.4: distinguishable: make it easier for users to see and hear content including separating foreground from background..
Text labels and names - Accessibility
see also <area> h24: providing text alternatives for the area elements of image maps dialogs should be labeled for any container whose contents act as a dialog box (for example, a modal dialog asking the user to make a choice or respond to an action being taken), give it a descriptive label or name, so that assistive technology users can easily discover what its purpose is.
-moz-user-focus - CSS: Cascading Style Sheets
you can stop the textbox from taking keyboard focus by setting its tab index to -1, and from taking mouse focus by preventing the default action of mousedown events.
::backdrop - CSS: Cascading Style Sheets
you can see this example in action or view or remix the code on glitch.
:disabled - CSS: Cascading Style Sheets
WebCSS:disabled
html <form action="#"> <fieldset id="shipping"> <legend>shipping address</legend> <input type="text" placeholder="name"> <input type="text" placeholder="address"> <input type="text" placeholder="zip code"> </fieldset> <br> <fieldset id="billing"> <legend>billing address</legend> <label for="billing-checkbox">same as shipping address:</label> <input type="checkbox" id="billing-ch...
:enabled - CSS: Cascading Style Sheets
WebCSS:enabled
html <form action="url_of_form"> <label for="firstfield">first field (enabled):</label> <input type="text" id="firstfield" value="lorem"><br> <label for="secondfield">second field (disabled):</label> <input type="text" id="secondfield" value="ipsum" disabled="disabled"><br> <input type="button" value="submit"> </form> css input:enabled { color: #2b2; } input:disabled { color: #aaa; } result ...
:in-range - CSS: Cascading Style Sheets
WebCSS:in-range
in the absence of such a limitation, the element can neither be "in-range" nor "out-of-range." syntax :in-range examples html <form action="" id="form1"> <ul>values between 1 and 10 are valid.
:out-of-range - CSS: Cascading Style Sheets
in the absence of such a limitation, the element can neither be "in-range" nor "out-of-range." syntax :out-of-range examples html <form action="" id="form1"> <p>values between 1 and 10 are valid.</p> <ul> <li> <input id="value1" name="value1" type="number" placeholder="1 to 10" min="1" max="10" value="12"> <label for="value1">your value is </label> </li> </ul> </form> css li { list-style: none; margin-bottom: 1em; } input { border: 1px solid black; } input:in-range { background-color: rgba(0, 255, 0,...
font-variation-settings - CSS: Cascading Style Sheets
the <number> can be fractional or negative.
aspect-ratio - CSS: Cascading Style Sheets
resize the <iframe> to see aspect-ratio in action.
Coordinate systems - CSS: Cascading Style Sheets
x; background-color: red; } .inner { position: relative; width: 500px; height: 150px; top: 25px; left: 100px; background-color: blue; color: white; cursor: crosshair; user-select: none; -moz-user-select: none; -ms-user-select: none; -webkit-user-select: none; } .log { position: relative; width: 100%; text-align: center; } result here you can see the results in action.
Using CSS animations - CSS: Cascading Style Sheets
</p> <p> in addition, we output some text each time an animation event fires, so you can see them in action.
Variable fonts guide - CSS: Cascading Style Sheets
the practice of designing different grades of a typeface was often done in reaction to intended use and printing technique.
CSS Fonts - CSS: Cascading Style Sheets
WebCSSCSS Fonts
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.
Auto-placement in CSS Grid Layout - CSS: Cascading Style Sheets
you can see auto-placement in action in the simplest of ways by creating a grid on a set of items.
Box alignment in CSS Grid Layout - CSS: Cascading Style Sheets
in the next guide, we will look further into this interaction between css grid layout, box alignment and writing modes.
CSS Grid Layout and Accessibility - CSS: Cascading Style Sheets
for more information about this interaction see the guide on the relationship of grid layout to other layout methods and the section on display: contents.
CSS Grid Layout and Progressive Enhancement - CSS: Cascading Style Sheets
nothing that i am describing here should be seen as a "hack", we are taking advantage of the fact that the grid specification details the interaction between different layout methods.
Line-based placement with CSS Grid - CSS: Cascading Style Sheets
we will learn more about the interaction between writing modes and grids in a later guide.
Relationship of grid layout to other layout methods - CSS: Cascading Style Sheets
mns: repeat(4,1fr); grid-auto-rows: 200px; grid-gap: 20px; } .box3 { grid-column-start: 2; grid-column-end: 4; grid-row-start: 1; grid-row-end: 3; position: relative; } .abspos { position: absolute; top: 40px; left: 40px; background-color: rgba(255,255,255,.5); border: 1px solid rgba(0,0,0,0.5); color: #000; padding: 10px; } grid and display: contents a final interaction with another layout specification that is worth noting is the interaction between css grid layout and display: contents.
Overview of CSS Shapes - CSS: Cascading Style Sheets
you can see the threshold in action if we use a gradient as the image on which to define our shape.
Layout mode - CSS: Cascading Style Sheets
positioned layout, designed for positioning elements without much interaction with other elements.
CSS reference - CSS: Cascading Style Sheets
WebCSSReference
prighttext-decorationtext-decoration-colortext-decoration-linetext-decoration-skip-inktext-decoration-styletext-decoration-thicknesstext-emphasistext-emphasis-colortext-emphasis-positiontext-emphasis-styletext-indenttext-justifytext-orientationtext-overflowtext-renderingtext-shadowtext-transformtext-underline-offsettext-underline-position<time><time-percentage><timing-function>top@top-centertouch-actiontransformtransform-box<transform-function>transform-origintransform-styletransitiontransition-delaytransition-durationtransition-propertytransition-timing-functiontranslatetranslate()translate3d()translatex()translatey()translatez()turnuunicode-bidiunicode-range (@font-face)unset<url>url()user-zoom (@viewport)v:validvar()vertical-alignvh@viewportviewport-fit (@viewport)visibility:visitedvmaxvminvw...
Value definition syntax - CSS: Cascading Style Sheets
the definition syntax describes which values are allowed and the interactions between them.
Visual formatting model - CSS: Cascading Style Sheets
the interactions between block-level and inline-level boxes are described in the mdn documentation for display.
WebKit CSS extensions - CSS: Cascading Style Sheets
ebkit-grid-columns (see grid-column) -webkit-grid-rows (see grid-row) -webkit-hyphenate-charset -webkit-image-set (see image-set()) -webkit-mask-attachment -webkit-match-nearest-mail-blockquote-color -webkit-overflow-scrolling -webkit-region-break-after -webkit-region-break-before -webkit-region-break-inside -webkit-region-fragment -webkit-shape-inside -webkit-touch-callout (see touch-action) background-origin-x (unprefixed!) background-origin-y (unprefixed!) * still supported in the safari technology preview, but not in a generally released browser.
cursor - CSS: Cascading Style Sheets
WebCSScursor
not-allowed the requested action will not be carried out.
display - CSS: Cascading Style Sheets
WebCSSdisplay
global /* global values */ display: inherit; display: initial; display: unset; description the individual pages for the different types of value that display can have set on it feature multiple examples of those values in action — see the syntax section.
<flex> - CSS: Cascading Style Sheets
the fr unit represents a fraction of the leftover space in the grid container.
font-feature-settings - CSS: Cascading Style Sheets
/* use zeros with a slash through them to differentiate from "o" */ .nicezero { font-feature-settings: "zero"; } /* enable historical forms */ .hist { font-feature-settings: "hist"; } /* disable common ligatures, usually on by default */ .noligs { font-feature-settings: "liga" 0; } /* enable tabular (monospaced) figures */ td.tabular { font-feature-settings: "tnum"; } /* enable automatic fractions */ .fractions { font-feature-settings: "frac"; } /* use the second available swash character */ .swash { font-feature-settings: "swsh" 2; } /* enable stylistic set 7 */ .fancystyle { font-family: gabriola; /* available on windows 7, and on mac os */ font-feature-settings: "ss07"; } specifications specification status comment css fonts module level 3the defini...
font-variation-settings - CSS: Cascading Style Sheets
the <number> can be fractional or negative, depending on the value range available in your font, as defined by the font designer.
font - CSS: Cascading Style Sheets
WebCSSfont
</p> <form action="createshorthand()"> <div class="cf"> <div class="setpropcont"> font-style<br/> <input type="radio" id="font-style-none" name="font_style" checked="" value="" onchange="setcss()"> <label for="font-style-none">none</label><br/> <input type="radio" id="font-style-normal" name="font_style" value="normal" onchange="setcss()"> <label for="font-style-norm...
image-rendering - CSS: Cascading Style Sheets
scaling may also occur due to user interaction (zooming).
max-block-size - CSS: Cascading Style Sheets
see the example in writing-mode, which shows the different writing modes in action.
scroll-snap-type-x - CSS: Cascading Style Sheets
that means it snaps on that point when the scroll action finished, if possible.
scroll-snap-type-y - CSS: Cascading Style Sheets
that means it snaps on that point when the scroll action finished, if possible.
scroll-snap-type - CSS: Cascading Style Sheets
that means it snaps on that point when the scroll action finished, if possible.
transition-timing-function - CSS: Cascading Style Sheets
step-start equal to steps(1, jump-start) step-end equal to steps(1, jump-end) accessibility concerns some animations can be helpful such as to guide users to understand what actions are expected, to show relationships within the user interface, and to inform users as to what actions have occurred.
white-space - CSS: Cascading Style Sheets
formal definition initial valuenormalapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | pre | nowrap | pre-wrap | pre-line | break-spaces examples basic example code { white-space: pre; } line breaks inside <pre> elements pre { word-wrap: break-word; /* ie 5.5-7 */ white-space: pre-wrap; /* modern browsers */ } in action html <div id="css-code" class="box"> p { white-space: <select> <option>normal</option> <option>nowrap</option> <option>pre</option> <option>pre-wrap</option> <option>pre-line</option> <option>break-spaces</option> </select> } </div> <div id="results" class="box"> <p> lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut ...
will-change - CSS: Cascading Style Sheets
chrome currently takes two actions, given particular css property idents: establish a new compositing layer or a new stacking context.
Demos of open web technologies
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 svg (or use the local download) summer html image map creator (source code) video video 3d animation "mozilla constantly evolving" video 3d animation "floating dance" streaming anime, movie trailer and interview...
Index - Event reference
WebEventsIndex
events can represent everything from basic user interactions to automated notifications of things happening in the rendering model.
Getting Started - Developer guides
alternatively, instead of giving 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.
Ajax - Developer guides
WebGuideAJAX
this makes the application faster and more responsive to user actions.
Cross-browser audio basics - Developer guides
autoplay specifying autoplay will cause the audio to start playing as soon as possible and without any user interaction — in short, the audio will autoplay.
Video player styling basics - Developer guides
the example in action you can find the code for the updated, styled example on github, and view it live.
Media buffering, seeking, and time ranges - Developer guides
without any user interaction there is usually only one time range, but if you jump about in the media more than one time range can appear, as illustrated by the below visualization.
Creating a cross-browser video player - Developer guides
support for the different prefixed versions of the relevant action are checked in order to call the correct one.
Creating and triggering events - Developer guides
view the example in action.
DOM onevent handlers - Developer guides
events are actions like: being clicked detecting pressed keys getting focus the onevent handler is usually named with the event it reacts to, like onclick, onkeypress, onfocus, etc.
Touch events (Mozilla experimental) - Developer guides
types of touch events moztouchdown sent when the user begins a screen touch action.
Content categories - Developer guides
interactive content interactive content includes elements that are specifically designed for user interaction.
Rich-Text Editing in Mozilla - Developer guides
r: pointer; } img.intlink { border: 0; } #toolbar1 select { font-size:10px; } #textbox { width: 540px; height: 200px; border: 1px #000000 solid; padding: 12px; overflow: scroll; } #textbox #sourcetext { padding: 0; margin: 0; min-width: 498px; min-height: 200px; } #editmode label { cursor: pointer; } </style> </head> <body onload="initdoc();"> <form name="compform" method="post" action="sample.php" onsubmit="if(validatemode()){this.mydoc.value=odoc.innerhtml;return true;}return false;"> <input type="hidden" name="mydoc"> <div id="toolbar1"> <select onchange="formatdoc('formatblock',this[this.selectedindex].value);this.selectedindex=0;"> <option selected>- formatting -</option> <option value="h1">title 1 &lt;h1&gt;</option> <option value="h2">title 2 &lt;h2&gt;</option> <option ...
HTML5 - Developer guides
WebGuideHTMLHTML5
xmlhttprequest level 2 allows fetching asynchronously some parts of the page, allowing it to display dynamic content, varying according to the time and user actions.
Separate sites for mobile and desktop - Developer guides
if you’d like to see the source code behind an example of this approach in action, feel free to check out the github repository for amo or sumo.
Writing forward-compatible websites - Developer guides
here's an example that works in browsers without html5 support but breaks in a browser supporting html5: <form action="http://www.example.com"> <input type="submit" value="submit the form" </form> due to the missing > on the input tag.
Developer guides
this makes the application faster and more responsive to user actions.
disabled - HTML: Hypertext Markup Language
attribute interactions the difference between disabled and readonly is that read-only controls can still function and are still focusable, whereas disabled controls can not receive focus and are not submitted with the form and generally do not function as controls until they are enabled.
HTML attribute: multiple - HTML: Hypertext Markup Language
<form method="get" action="#"> <p> <label for="dwarfs">select the woodsmen you like:</label> <select multiple name="drawfs" id="drawfs"> <option>grumpy@woodworkers.com</option> <option>happy@woodworkers.com</option> <option>sleepy@woodworkers.com</option> <option>bashful@woodworkers.com</option> <option>sneezy@woodworkers.com</option> <option>dopey@woodworkers.com</option> <option>doc@woodwo...
HTML attribute: rel - HTML: Hypertext Markup Language
WebHTMLAttributesrel
while this attribute defines the link as being a stylesheet, the interaction with other attributes and other keyterms within the rel value impact whether the stylesheet is downloaded and / or used.
HTML attribute: required - HTML: Hypertext Markup Language
attribute interactions because a read-only field cannot have a value, required does not have any effect on inputs with the readonly attribute also specified.
<iframe>: The Inline Frame element - HTML: Hypertext Markup Language
WebHTMLElementiframe
examples a simple <iframe> an <iframe> in action.
<img>: The Image Embed element - HTML: Hypertext Markup Language
WebHTMLElementimg
<img src="/files/16864/clock-demo-200px.png" alt="clock" srcset="/files/16864/clock-demo-200px.png 200w, /files/16797/clock-demo-400px.png 400w" sizes="(max-width: 600px) 200px, 50vw"> to see the resizing in action, view the example on a separate page, so you can actually resize the content area.
<input type="button"> - HTML: Hypertext Markup Language
WebHTMLElementinputbutton
the example below shows this in action.
<input type="date"> - HTML: Hypertext Markup Language
WebHTMLElementinputdate
basic uses of date the simplest use of <input type="date"> involves one <input> combined with its <label>, as seen below: <form action="https://example.com"> <label> enter your birthday: <input type="date" name="bday"> </label> <p><button>submit</button></p> </form> this html submits the entered date under the key bday to https://example.com — resulting in a url like https://example.com/?bday=1955-06-08.
<input type="datetime"> - HTML: Hypertext Markup Language
WebHTMLElementinputdatetime
the html <input type="datetime"> was a control for entering a date and time (hour, minute, second, and fraction of a second) as well as a timezone.
<input type="email"> - HTML: Hypertext Markup Language
WebHTMLElementinputemail
you must verify the e-mail address on the server side of any transaction in which the provided text may have any security implications of any kind.
<input type="number"> - HTML: Hypertext Markup Language
WebHTMLElementinputnumber
you must verify on the server side any transaction in which the provided value may have any security implications of any kind.
<input type="password"> - HTML: Hypertext Markup Language
WebHTMLElementinputpassword
<label for="hexid">hex id: </label> <input id="hexid" type="password" pattern="[0-9a-fa-f]{4,8}" title="enter an id consisting of 4-8 hexadecimal digits" autocomplete="new-password"> disabled this boolean attribute indicates that the password field is not available for interaction.
<keygen> - HTML: Hypertext Markup Language
WebHTMLElementkeygen
disabled this boolean attribute indicates that the form control is not available for interaction.
<menuitem> - HTML: Hypertext Markup Language
WebHTMLElementmenuitem
command: a regular command with an associated action.
<meter>: The HTML Meter element - HTML: Hypertext Markup Language
WebHTMLElementmeter
the html <meter> element represents either a scalar value within a known range or a fractional value.
<multicol>: The HTML Multi-Column Layout element (Obsolete) - HTML: Hypertext Markup Language
WebHTMLElementmulticol
it never got any significant traction and is not implemented in any major browsers.
<slot> - HTML: Hypertext Markup Language
WebHTMLElementslot
</style> <details> <summary> <code class="name">&lt;<slot name="element-name">need name</slot>&gt;</code> <i class="desc"><slot name="description">need description</slot></i> </summary> <div class="attributes"> <h4>attributes</h4> <slot name="attributes"><p>none</p></slot> </div> </details> <hr> </template> note: you can see this complete example in action at element-details (see it running live).
<tr>: The Table Row element - HTML: Hypertext Markup Language
WebHTMLElementtr
html the html is where the action is here, and the action is pretty simple.
inputmode - HTML: Hypertext Markup Language
decimal fractional numeric input keyboard containing the digits and decimal separator for the user's locale (typically .
Microdata - HTML: Hypertext Markup Language
commonly used vocabularies: creative works: creativework, book, movie, musicrecording, recipe, tvseries embedded non-text objects: audioobject, imageobject, videoobject event health and medical types: notes on the health and medical types under medicalentity organization person place, localbusiness, restaurant product, offer, aggregateoffer review, aggregaterating action thing intangible major search engine operators like google, microsoft, and yahoo!
Identifying resources on the Web - HTTP
nowadays, it is mostly an abstraction handled by web servers without any physical reality.
CORS errors - HTTP
WebHTTPCORSErrors
now try to reproduce the failing transaction and check the console if you are seeing a cors violation error message.
Cross-Origin Resource Sharing (CORS) - HTTP
WebHTTPCORS
the previous section gives an overview of these in action.
Content Security Policy (CSP) - HTTP
WebHTTPCSP
for example, a page that uploads and displays images could allow images from anywhere, but restrict a form action to a specific endpoint.
Content negotiation - HTTP
they failed to get traction and got abandoned.
Cache-Control - HTTP
in firefox, immutable is only honored on https:// transactions.
Connection - HTTP
the connection general header controls whether or not the network connection stays open after the current transaction finishes.
CSP: sandbox - HTTP
it applies restrictions to a page's actions including preventing popups, preventing the execution of plugins and scripts, and enforcing a same-origin policy.
Content-Type - HTTP
<form action="/" method="post" enctype="multipart/form-data"> <input type="text" name="description" value="some text"> <input type="file" name="myfile"> <button type="submit">submit</button> </form> the request looks something like this (less interesting headers are omitted here): post /foo http/1.1 content-length: 68137 content-type: multipart/form-data; boundary=---------------------------974767299...
NEL - HTTP
WebHTTPHeadersNEL
header type response header forbidden header name no syntax nel: { "report_to": "name_of_reporting_group", "max_age": 12345, "include_subdomains": false, "success_fraction": 0.0, "failure_fraction": 1.0 } specifications specification network error logging ...
X-Frame-Options - HTTP
add this to your server configuration: const helmet = require('helmet'); const app = express(); app.use(helmet.frameguard({ action: 'sameorigin' })); alternatively, you can use frameguard directly: const frameguard = require('frameguard') app.use(frameguard({ action: 'sameorigin' })) specifications specification title rfc 7034 http header field x-frame-options ...
HTTP headers - HTTP
WebHTTPHeaders
connection management connection controls whether the network connection stays open after the current transaction finishes.
HTTP request methods - HTTP
WebHTTPMethods
http defines a set of request methods to indicate the desired action to be performed for a given resource.
Redirections in HTTP - HTTP
in this case, the response is a 303 (see other) redirect that links to a page indicating that the action has been scheduled, and eventually informs about its progress, or allows to cancel it.
A typical HTTP session - HTTP
WebHTTPSession
for example, sending the result of a form: post /contact_form.php http/1.1 host: developer.mozilla.org content-length: 64 content-type: application/x-www-form-urlencoded name=joe%20user&request=send%20me%20one%20of%20your%20catalogue request methods http defines a set of request methods indicating the desired action to be performed upon a resource.
200 OK - HTTP
WebHTTPStatus200
post: the resource describing the result of the action is transmitted in the message body.
451 Unavailable For Legal Reasons - HTTP
WebHTTPStatus451
the hypertext transfer protocol (http) 451 unavailable for legal reasons client error response code indicates that the user requested a resource that is not available due to legal reasons, such as a web page for which a legal action has been issued.
511 Network Authentication Required - HTTP
WebHTTPStatus511
network operators sometimes require some authentication, acceptance of terms, or other user interaction before granting access (for example in an internet café or at an airport).
HTTP response status codes - HTTP
WebHTTPStatus
put or post: the resource describing the result of the action is transmitted in the message body.
JavaScript data types and data structures - JavaScript
when representing complex data, parse strings, and use the appropriate abstraction.
Concurrency model and the event loop - JavaScript
a downside of this model is that if a message takes too long to complete, the web application is unable to process user interactions like click or scroll.
Functions - JavaScript
calling the function actually performs the specified actions with the indicated parameters.
Grammar and types - JavaScript
floating-point literals a floating-point literal can have the following parts: a decimal integer which can be signed (preceded by "+" or "-"), a decimal point ("."), a fraction (another decimal number), an exponent.
Indexed collections - JavaScript
// // this is equivalent to: let arr = [] arr.length = 42 calling array(n) results in a rangeerror, if n is a non-whole number whose fractional portion is non-zero.
Loops and iteration - JavaScript
console.log('walking east one step'); } there are many different kinds of loops, but they all essentially do the same thing: they repeat an action some number of times.
JavaScript modules - JavaScript
so for example: /js-examples/modules/basic-modules/modules/square.js becomes ./modules/square.js you can see such lines in action in main.js.
Regular expressions - JavaScript
</p> <form action="#"> <input id="phone"> <button onclick="testinfo(document.getelementbyid('phone'));">check</button> </form> javascript var re = /(?:\d{3}|\(\d{3}\))([-\/\.])\d{3}\1\d{4}/; function testinfo(phoneinput) { var ok = re.exec(phoneinput.value); if (!ok) { console.error(phoneinput.value + ' isn\'t a phone number with area code!'); } else { console.log('thanks, your phone number i...
Text formatting - JavaScript
const gasprice = new intl.numberformat('en-us', { style: 'currency', currency: 'usd', minimumfractiondigits: 3 }); console.log(gasprice.format(5.259)); // $5.259 const handecimalrmbinchina = new intl.numberformat('zh-cn-u-nu-hanidec', { style: 'currency', currency: 'cny' }); console.log(handecimalrmbinchina.format(1314.25)); // ¥ 一,三一四.二五 collation the collator object is useful for comparing and sorting strings.
JavaScript technologies overview - JavaScript
the w3c standardizes the core document object model, which defines language-agnostic interfaces that abstract html and xml documents as objects, and also defines mechanisms to manipulate this abstraction.
JavaScript language resources - JavaScript
implementations spidermonkey - the javascript engine used in various mozilla products, including firefox; rhino - the javascript engine is written in java; tamarin - the actionscript virtual machine (used in the adobe® flash® player); other implementations (wikipedia).
SyntaxError: missing ) after condition - JavaScript
in any programming language, code needs to make decisions and carry out actions accordingly depending on different inputs.
TypeError: "x" is not a constructor - JavaScript
message typeerror: object doesn't support this action (edge) typeerror: "x" is not a constructor typeerror: math is not a constructor typeerror: json is not a constructor typeerror: symbol is not a constructor typeerror: reflect is not a constructor typeerror: intl is not a constructor typeerror: atomics is not a constructor error type typeerror what went wrong?
RangeError: precision is out of range - JavaScript
message rangeerror: the number of fractional digits is out of range (edge) rangeerror: the precision is out of range (edge) rangeerror: precision {0} out of range (firefox) rangeerror: toexponential() argument must be between 0 and 20 (chrome) rangeerror: tofixed() digits argument must be between 0 and 20 (chrome) rangeerror: toprecision() argument must be between 1 and 21 (chrome) error type rangeerror what went wrong?
Functions - JavaScript
if so, it is used; otherwise, some other action is taken.
Intl.DateTimeFormat() constructor - JavaScript
possible values include: "full" "long" "medium" "short" fractionalseconddigits the number of fractional seconds to apply when calling format().
Intl.DateTimeFormat - JavaScript
meformat('en-us', options).format(date)); // → "thursday, december 20, 2012, gmt" // sometimes you want to be more precise options = { hour: 'numeric', minute: 'numeric', second: 'numeric', timezone: 'australia/sydney', timezonename: 'short' }; console.log(new intl.datetimeformat('en-au', options).format(date)); // → "2:00:00 pm aedt" // sometimes you want to be very precise options.fractionalseconddigits = 3; console.log(new intl.datetimeformat('en-au', options).format(date)); // → "2:00:00.200 pm aedt" // sometimes even the us needs 24-hour time options = { year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric', hour12: false, timezone: 'america/los_angeles' }; console.log(new intl.datetimeformat('en-us', options).format...
Math.trunc() - JavaScript
the math.trunc() function returns the integer part of a number by removing any fractional digits.
Math - JavaScript
math.trunc(x) returns the integer portion of x, removing any fractional digits.
Number.prototype.toLocaleString() - JavaScript
doesn't use a minor unit console.log(number.tolocalestring('ja-jp', { style: 'currency', currency: 'jpy' })) // → ¥123,457 // limit to three significant digits console.log(number.tolocalestring('en-in', { maximumsignificantdigits: 3 })); // → 1,23,000 // use the host default language with options for number formatting var num = 30000.65; console.log(num.tolocalestring(undefined, {minimumfractiondigits: 2, maximumfractiondigits: 2})); // → "30,000.65" where english is the default language, or // → "30.000,65" where german is the default language, or // → "30 000,65" where french is the default language specifications specification ecmascript (ecma-262)the definition of 'number.prototype.tolocalestring' in that specification.
WeakRef - JavaScript
notes on weakrefs some notes on weakrefs: if your code has just created a weakref for a target object, or has gotten a target object from a weakref's deref method, that target object will not be reclaimed until the end of the current javascript job (including any promise reaction jobs that run at the end of a script job).
Standard built-in objects - JavaScript
arraybuffer sharedarraybuffer atomics dataview json control abstraction objects control abstractions can help to structure code, especially async code (without using deeply nested callbacks, for example).
Grouping operator ( ) - JavaScript
examples using the grouping operator overriding multiplication and division first, then addition and subtraction to evaluate addition first.
Operator precedence - JavaScript
prefix decrement -- … typeof typeof … void void … delete delete … await await … 16 exponentiation right-to-left … ** … 15 multiplication left-to-right … * … division … / … remainder … % … 14 addition left-to-right … + … subtraction … - … 13 bitwise left shift left-to-right … << … bitwise right shift … >> … bitwise unsigned right shift … >>> … 12 less than left-to-right … < … less than or equal … <= … greater than … > … greater than or equal … >= … in … in … instanceof ...
import - JavaScript
et', url, true); xhr.send(); } export function getusefulcontents(url, callback) { getjson(url, data => callback(json.parse(data))); } the main program: main.js import { getusefulcontents } from '/modules/file.js'; getusefulcontents('http://www.example.com', data => { dosomethinguseful(data); }); dynamic import this example shows how to load functionality on to a page based on a user action, in this case a button click, and then call a function within that module.
Strict mode - JavaScript
this is a security hazard because it breaks the ability to hide privileged values via function abstraction; it also precludes most optimizations.
JavaScript reference - JavaScript
ath date text processing string regexp indexed collections array int8array uint8array uint8clampedarray int16array uint16array int32array uint32array float32array float64array bigint64array biguint64array keyed collections map set weakmap weakset structured data arraybuffer sharedarraybuffer atomics dataview json control abstraction promise generator generatorfunction asyncfunction reflection reflect proxy internationalization intl intl.collator intl.datetimeformat intl.displaynames intl.listformat intl.locale intl.numberformat intl.pluralrules intl.relativetimeformat webassembly webassembly webassembly.module webassembly.instance webassembly.memory webasse...
Authoring MathML - MathML
mathematical notations are even more complex with structures like fractions, square roots or matrices that are likely to require their own tags.
<merror> - MathML
WebMathMLElementmerror
mathcolor the text color and also the fraction line color.
<mfenced> - MathML
mathcolor the text color and also the fraction line color.
<mo> - MathML
WebMathMLElementmo
symmetric if stretchy is true, this attribute specifies whether the operator should be vertically symmetric around the imaginary math axis (centered fraction line).
<mstyle> - MathML
WebMathMLElementmstyle
actiontype on <maction> cannot be set on <mstyle>.
Autoplay guide for media and Web Audio APIs - Web media technologies
note: put another way, playback of any media that includes audio is generally blocked if the playback is programmatically initiated in a tab which has not yet had any user interaction.
Handling media support issues in web content - Web media technologies
in the case of an action movie, for example, the poster frame might be an iconic exemplar image from one of the film's best-known scenes.
Web video codec guide - Web media technologies
wagon-wheel effect the wagon-wheel effect (or stroboscopic effect) is the visual effect that's commonly seen in film, in which a turning wheel appears to rotate at the wrong speed, or even in reverse, due to an interaction between the frame rate and the compression algorithm.
Critical rendering path - Web Performance
understanding and optimizing the critical rendering path is important to ensure reflows and repaints can happen at 60 frames per second, to ensure performant user interactions and avoid jank.
Progressive web app structure - Progressive web apps (PWAs)
the website feels like a native app with instant interaction and solid performance while keeping all the benefits of the web.
Installing and uninstalling web apps - Progressive web apps (PWAs)
tapping this will show a confirmation banner—pressing the banner's big "+ add to home screen" button completes the action, adding the app to the home screen.
Introduction to progressive web apps - Progressive web apps (PWAs)
you can see this app in action online, and the source code is available on github.
Mobile first - Progressive web apps (PWAs)
you need to consider this, and again make sure your content/functionality is simple, legible and distraction-free as much as possible.
Structural overview of progressive web apps - Progressive web apps (PWAs)
the website feels like a native app with instant interaction and solid performance while keeping all the benefits of the web.
alignment-baseline - SVG: Scalable Vector Graphics
example <svg width="300" height="120" viewbox="0 0 300 120" xmlns="http://www.w3.org/2000/svg"> <!-- materialisation of anchors --> <path d="m60,10 l60,110 m30,10 l300,10 m30,65 l300,65 m30,110 l300,110 " stroke="grey" /> <!-- anchors in action --> <text alignment-baseline="hanging" x="60" y="10">a hanging</text> <text alignment-baseline="middle" x="60" y="65">a middle</text> <text alignment-baseline="baseline" x="60" y="110">a baseline</text> <!-- materialisation of anchors --> <circle cx="60" cy="10" r="3" fill="red" /> <circle cx="60" cy="65" r="3" fill="red" /> <circle cx=...
dominant-baseline - SVG: Scalable Vector Graphics
example svg <svg width="400" height="300" viewbox="0 0 300 300" xmlns="http://www.w3.org/2000/svg"> <!-- materialization of anchors --> <path d="m60,20 l60,270 m30,20 l400,20 m30,70 l400,70 m30,120 l400,120 m30,170 l400,170 m30,220 l400,220 m30,270 l400,270" stroke="grey" /> <!-- anchors in action --> <text dominant-baseline="auto" x="70" y="20">auto</text> <text dominant-baseline="middle" x="70" y="70">middle</text> <text dominant-baseline="baseline" x="70" y="120">baseline</text> <text dominant-baseline="hanging" x="70" y="170">hanging</text> <text dominant-baseline="mathematical" x="70" y="220">mathematical</text> <text dominant-baseline="text-top" x="70" y="270"...
filterUnits - SVG: Scalable Vector Graphics
objectboundingbox in that case, x, y, width and height represent fractions or percentages of the bounding box on the referencing element.
font-variant - SVG: Scalable Vector Graphics
tic( <feature-value-name> ) || historical-forms || styleset( <feature-value-name># ) || character-variant( <feature-value-name># ) || swash( <feature-value-name> ) || ornaments( <feature-value-name> ) || annotation( <feature-value-name> ) || [ small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps ] || <numeric-figure-values> || <numeric-spacing-values> || <numeric-fraction-values> || ordinal || slashed-zero || <east-asian-variant-values> || <east-asian-width-values> || ruby ] default value normal animatable yes for a description of the values, please refer to the css font-variant property.
glyph-orientation-vertical - SVG: Scalable Vector Graphics
the determination is based on a complex interaction between country, language, script, character properties, font, and character context.
lang - SVG: Scalable Vector Graphics
WebSVGAttributelang
candidate recommendation made the lang attribute (without namespace) available on all elements and defined the interaction between both.
maskUnits - SVG: Scalable Vector Graphics
objectboundingbox this value indicates that all coordinates for the geometry attributes represent fractions or percentages of the bounding box of the element to which the mask is applied.
patternUnits - SVG: Scalable Vector Graphics
objectboundingbox this value indicates that all coordinates for the geometry properties represent fractions or percentages of the bounding box of the element to which the mask is applied.
primitiveUnits - SVG: Scalable Vector Graphics
objectboundingbox this value indicates that any length values within the filter definitions represent fractions or percentages of the bounding box on the referencing element.
text-anchor - SVG: Scalable Vector Graphics
attribute, it can be applied to any element but it has effect only on the following five elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <!-- materialisation of anchors --> <path d="m60,15 l60,110 m30,40 l90,40 m30,75 l90,75 m30,110 l90,110" stroke="grey" /> <!-- anchors in action --> <text text-anchor="start" x="60" y="40">a</text> <text text-anchor="middle" x="60" y="75">a</text> <text text-anchor="end" x="60" y="110">a</text> <!-- materialisation of anchors --> <circle cx="60" cy="40" r="3" fill="red" /> <circle cx="60" cy="75" r="3" fill="red" /> <circle cx="60" cy="110" r="3" fill="red" /> <style><![cdata[ text { font: bold 36px verdana, helvet...
xml:lang - SVG: Scalable Vector Graphics
candidate recommendation made the lang attribute (without namespace) available on all elements and defined the interaction between both.
zoomAndPan - SVG: Scalable Vector Graphics
panning represents a translation (i.e., a shift) transformation on an svg document fragment in response to a user interface action.
How to turn off form autocompletion - Web security
disabling autocompletion to disable autocompletion in forms, you can set the autocomplete attribute to "off": autocomplete="off" you can do this either for an entire form, or for specific input elements in a form: <form method="post" action="/form" autocomplete="off"> […] </form> <form method="post" action="/form"> […] <div> <label for="cc">credit card:</label> <input type="text" id="cc" name="cc" autocomplete="off"> </div> </form> setting autocomplete="off" on fields has two effects: it tells the browser not to save data inputted by the user for later autocompletion on similar forms, though heuristics for com...
Web security
clickjacking protection in clickjacking, a user is fooled into clicking on a ui element that performs some action other than what the user expects.
Using custom elements - Web Components
libraries there are several libraries that are built on web components with the aim of increasing the level of abstraction when creating custom elements.
Using shadow DOM - Web Components
working through a simple example now let's walk through a simple example to demonstrate the shadow dom in action inside a custom element — <popup-info> (see a live example also).
<xsl:if> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementif
if the value is true, the template is processed; if it is not, no action is taken.
<xsl:otherwise> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:otherwise> element is used to define the action that should be taken when none of the <xsl:when> conditions apply.
Index - XSLT: Extensible Stylesheet Language Transformations
WebXSLTIndex
40 <xsl:otherwise> element, reference, xslt, otherwise the <xsl:otherwise> element is used to define the action that should be taken when none of the <xsl:when> conditions apply.
An Overview - XSLT: Extensible Stylesheet Language Transformations
the result of the processor's action is also a tree.
Understanding WebAssembly text format - WebAssembly
to see this in action, we’ll create a single import object containing a memory object and a table object, and pass this same import object to multiple instantiate() calls.