Search completed in 1.48 seconds.
Working with Svelte stores - Learn web development
in this article we will show another way to handle state management in svelte —
stores.
...
stores are global global data repositories that hold values.
... components can subscribe to
stores and receive notifications when their values change.
...And 88 more matches
IDBObjectStore - Web APIs
the idbobject
store interface of the indexeddb api represents an object
store in a database.
... records within an object
store are sorted according to their keys.
... properties idbobject
store.indexnames read only a list of the names of indexes on objects in this object
store.
...And 33 more matches
Session store API - Archive of obsolete content
session
store makes it possible for extensions to easily save and re
store data across firefox sessions.
... there is a simple api that lets extensions access the session
store feature.
...in order to properly re
store your extension's state when a tab is re
stored, it needs to use the session
store api's settabvalue() method to save any data it will need in order to re
store its state, and then call gettabvalue() to retrieve the previous setting when the tab is re
stored.
...And 30 more matches
nsISessionStore
browser/components/session
store/nsisession
store.idlscriptable provides a means for extensions and other code to
store data in association with browser sessions, tabs, and windows.
... 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.session
store.enabled must be true for these calls to be successful.
... astring getclosedwindowdata(); astring gettabstate(in nsidomnode atab); astring gettabvalue(in nsidomnode atab, in astring akey); astring getwindowstate(in nsidomwindow awindow); astring getwindowvalue(in nsidomwindow awindow, in astring akey); void init(in nsidomwindow awindow); void persisttabattribute(in astring aname); void re
storelastsession(); void setbrowserstate(in astring astate); void settabstate(in nsidomnode atab, in astring astate); void settabvalue(in nsidomnode atab, in astring akey, in astring astringvalue); void setwindowstate(in nsidomwindow awindow, in astring astate, in boolean aoverwrite); void setwindowvalue(in nsidomwindow awindow, in astring akey, in astring...
...And 23 more matches
IDBObjectStoreSync - Web APIs
the idbobject
storesync interface of the indexeddb api provides synchronous access to an object
store of a database.
... method overview any add (in any value, in optional any key) raises (idbdatabaseexception); idbindexsync createindex (in domstring name, in domstring
storename, in domstring keypath, in optional boolean unique); any get (in any key) raises (idbdatabaseexception); idbcursorsync opencursor (in optional idbkeyrange range, in optional unsigned short direction) raises (idbdatabaseexception); idbindexsync openindex (in domstring name) raises (idbdatabaseexception); any put (in any value, in optional any key) raises (idbdatabaseexception); void remove (in any key) raises (idbdatabaseexception); void removeindex (in domstring indexname) raises (idbdatabaseexception); attributes attribute type description...
... indexnames readonly domstringlist a list of the names of the indexes on this object
store.
...And 22 more matches
IDBObjectStore.put() - Web APIs
the put() method of the idbobject
store interface updates a given record in a database, or inserts a new record if the given item does not already exist.
... it returns an idbrequest object, and, in a separate thread, creates a structured clone of the value and
stores the cloned value in the object
store.
... this is for adding new records, or updating existing records in an object
store when the transaction's mode is readwrite.
...And 15 more matches
IDBObjectStore.add() - Web APIs
the add() method of the idbobject
store interface returns an idbrequest object, and, in a separate thread, creates a structured clone of the value, and
stores the cloned value in the object
store.
... this is for adding new records to an object
store.
... to determine if the add operation has completed successfully, listen for the transaction’s complete event in addition to the idbobject
store.add request’s success event, because the transaction may still fail after the success event fires.
...And 12 more matches
IDBDatabase.createObjectStore() - Web APIs
the createobject
store() method of the idbdatabase interface creates and returns a new object
store or index.
... the method takes the name of the
store as well as a parameter object that lets you define important optional properties.
... you can use the property to uniquely identify individual objects in the
store.
...And 11 more matches
IDBTransaction.objectStore() - Web APIs
the object
store() method of the idbtransaction interface returns an object
store that has already been added to the scope of this transaction.
... every call to this method on the same transaction object, with the same name, returns the same idbobject
store instance.
... if this method is called on a different transaction object, a different idbobject
store instance is returned.
...And 9 more matches
Stored value
in the jsapi, the
stored value of an object property is its last known value.
...the javascript engine sets aside a field of type jsval for the
stored value of most object properties, even properties that have getters.
... the
stored value is updated each time the program gets or sets the property.
...And 7 more matches
IDBObjectStore.clear() - Web APIs
the clear() method of the idbobject
store 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.
...And 7 more matches
IDBObjectStore.delete() - Web APIs
the delete() method of the idbobject
store 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 idbobject
store.clear.
...And 7 more matches
IDBIndex.objectStore - Web APIs
the object
store property of the idbindex interface returns the name of the object
store referenced by the current index.
... syntax var myidbobject
store = myindex.object
store; value an idbobject
store.
... example in the following example we open a transaction and an object
store, then get the index lname from a simple contacts database.
...And 6 more matches
IDBObjectStore.createIndex() - Web APIs
the createindex() method of the idbobject
store interface creates and returns a new idbindex object in the connected database.
... bear in mind that indexeddb indexes can contain any javascript data type; indexeddb uses the structured clone algorithm to serialize
stored objects, which allows for storage of simple and complex objects.
... syntax var myidbindex = object
store.createindex(indexname, keypath); var myidbindex = object
store.createindex(indexname, keypath, objectparameters); parameters indexname the name of the index to create.
...And 6 more matches
IDBObjectStore.get() - Web APIs
the get() method of the idbobject
store interface returns an idbrequest object, and, in a separate thread, returns the object
store selected by the specified key.
... this is for retrieving specific records from an object
store.
... syntax var request = object
store.get(key); parameters key the key or key range that identifies the record to be retrieved.
...And 6 more matches
IDBObjectStore.name - Web APIs
the name property of the idbobject
store interface indicates the name of this object
store.
... syntax idbobject
store.name = mynewname; var myobject
storename = idbobject
store.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.
...And 6 more matches
IDBDatabase.deleteObjectStore() - Web APIs
the deleteobject
store() method of the idbdatabase interface destroys the object
store with the given name in the connected database, along with any indexes that reference it.
... as with idbdatabase.createobject
store, this method can be called only within a versionchange transaction.
... syntax dbinstance.deleteobject
store(name); parameters name the name of the object
store you want to delete.
...And 5 more matches
IDBObjectStore.autoIncrement - Web APIs
the autoincrement read-only property of the idbobject
store interface returns the value of the auto increment flag for this object
store.
... note that every object
store has its own separate auto increment counter.
... syntax var myautoincrement = object
store.autoincrement; value a boolean: value meaning true the object
store auto increments.
...And 5 more matches
IDBObjectStore.deleteIndex() - Web APIs
the deleteindex() method of the idbobject
store interface destroys the index with the specified name in the connected database, used during a version upgrade.
...note that this method synchronously modifies the idbobject
store.indexnames property.
... syntax object
store.deleteindex(indexname); parameters indexname the name of the existing index to remove.
...And 5 more matches
IDBObjectStore.count() - Web APIs
the count() method of the idbobject
store interface 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.
... syntax var request = object
store.count(); var request = object
store.count(query); parameters query optional a key or idbkeyrange object that specifies a range of records you want to count.
...And 4 more matches
IDBObjectStore.openCursor() - Web APIs
the opencursor() method of the idbobject
store interface returns an idbrequest object, and, in a separate thread, returns a new idbcursorwithvalue object.
... used for iterating through an object
store with a cursor.
... syntax var request = object
store.opencursor(); var request = object
store.opencursor(query); var request = object
store.opencursor(query, direction); parameters query optional a key or idbkeyrange to be queried.
...And 4 more matches
IDBObjectStore.openKeyCursor() - Web APIs
the openkeycursor() method of the idbobject
store interface returns an idbrequest object whose result will be set to an idbcursor that can be used to iterate through matching results.
... used for iterating through the keys of an object
store with a cursor.
... syntax var request = object
store.openkeycursor(); var request = object
store.openkeycursor(query); var request = object
store.openkeycursor(query, direction); parameters query optional the key range to be queried.
...And 4 more matches
WebGLRenderingContext.pixelStorei() - Web APIs
the webglrenderingcontext.pixel
storei() method of the webgl api specifies the pixel storage modes.
... syntax void gl.pixel
storei(pname, param); parameters pname a glenum specifying which parameter to set.
... var tex = gl.createtexture(); gl.bindtexture(gl.texture_2d, tex); gl.pixel
storei(gl.pack_alignment, 4); to check the values for packing and unpacking of pixel data, you can query the same pixel storage parameters with webglrenderingcontext.getparameter().
...And 4 more matches
Atomics.store() - JavaScript
the static atomics.
store() method
stores a given value at the given position in the array and returns that value.
... the source for this interactive example is
stored in a github repository.
... syntax atomics.
store(typedarray, index, value) parameters typedarray an integer typed array.
...And 4 more matches
IDBDatabase.objectStoreNames - Web APIs
the object
storenames read-only property of the idbdatabase interface is a domstringlist containing a list of the names of the object
stores currently in the connected database.
... syntax var list[] = idbdatabase.object
storenames; value a domstringlist containing a list of the names of the object
stores currently in the connected database.
... example // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; //
store the result of opening the database in the db variable.
...And 3 more matches
IDBObjectStore.getKey() - Web APIs
the getkey() method of the idbobject
store interface returns an idbrequest object, and, in a separate thread, returns the key selected by the specified query.
... this is for retrieving specific records from an object
store.
... syntax var request = object
store.getkey(key); parameters key the key or key range that identifies the record to be retrieved.
...And 3 more matches
IDBObjectStore.index() - Web APIs
the index() method of the idbobject
store interface opens a named index in the current object
store, after which it can be used to, for example, return a series of records sorted by that index using a cursor.
... syntax var index = object
store.index(name); parameters name the name of the index to open.
... 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.
...And 3 more matches
IDBObjectStore.indexNames - Web APIs
the indexnames read-only property of the idbobject
store interface returns a list of the names of indexes on objects in this object
store.
... syntax var myindexnames = object
store.indexnames; value a domstringlist.
... example in the following code snippet, we open a read/write transaction on our database and add some data to an object
store using add().
...And 3 more matches
IDBObjectStore.keyPath - Web APIs
the keypath read-only property of the idbobject
store interface returns the key path of this object
store.
... syntax var mykeypath = object
store.keypath; value any value type.
... example in the following code snippet, we open a read/write transaction on our database and add some data to an object
store using add().
...And 3 more matches
IDBObjectStore.transaction - Web APIs
the transaction read-only property of the idbobject
store interface returns the transaction object to which this object
store belongs.
... syntax var mytransaction = object
store.transaction; value an idbtransaction object.
... example in the following code snippet, we open a read/write transaction on our database and add some data to an object
store using add().
...And 3 more matches
JS_RestoreExceptionState
re
stores the exception state from a jsexceptionstate object previously created using js_saveexceptionstate.
... syntax void js_re
storeexceptionstate(jscontext *cx, jsexceptionstate *state); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... state jsexceptionstate * pointer to the jsexceptionstate object to re
store exception state from.
...And 2 more matches
IDBObjectStore.getAll() - Web APIs
the getall() method of the idbobject
store interface returns an idbrequest object containing all objects in the object
store matching the specified parameter or all objects in the
store if no parameters are given.
... syntax var request = object
store.getall(); var request = object
store.getall(query); var request = object
store.getall(query, count); parameters query optional a key or idbkeyrange to be queried.
... if nothing is passed, this will default to a key range that selects all the records in this object
store.
...And 2 more matches
IDBTransaction.objectStoreNames - Web APIs
the object
storenames read-only property of the idbtransaction interface returns a domstringlist of names of idbobject
store objects.
... syntax var mydatabase = transactionobj.object
storenames; returns a domstringlist of names of idbobject
store objects.
... specification specification status comment indexed database api 2.0the definition of 'object
storenames' in that specification.
...And 2 more matches
HTMLCanvasElement: webglcontextrestored event - Web APIs
the webglcontextre
stored event of the webgl api is fired if the user agent re
stores the drawing buffer for a webglrenderingcontext object.
... once the context is re
stored, webgl resources such as textures and buffers that were created before the context was lost are no longer valid.
... bubbles yes cancelable yes interface webglcontextevent event handler property none example with the help of the webgl_lose_context extension, you can simulate the webglcontextre
stored event: var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); canvas.addeventlistener('webglcontextre
stored', function(e) { console.log(e); }, false); gl.getextension('webgl_lose_context').re
storecontext(); // "webglcontextre
stored" event is logged.
... specifications specification status comment webgl 1.0the definition of 'webglcontextre
stored' in that specification.
IDBObjectStore.getAllKeys() - Web APIs
the getallkeys() method of the idbobject
store interface returns an idbrequest object retrieves record keys for all objects in the object
store matching the specified parameter or all objects in the
store if no parameters are given.
... syntax var request = object
store.getallkeys(); var request = object
store.getallkeys(query); var request = object
store.getallkeys(query, count); parameters query optional a value that is or resolves to an idbkeyrange.
... exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbobject
store's transaction is inactive.
... invalidstateerror the idbobject
store has been deleted or removed.
CanvasRenderingContext2D.restore() - Web APIs
the canvasrenderingcontext2d.re
store() method of the canvas 2d api re
stores the most recently saved canvas state by popping the top entry in the drawing state stack.
... syntax void ctx.re
store(); examples restoring a saved state this example uses the save() method to save the default state and re
store() to re
store it later, so that you are able to draw a rect with the default state later.
... html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // save the default state ctx.save(); ctx.fillstyle = 'green'; ctx.fillrect(10, 10, 100, 100); // re
store the default state ctx.re
store(); ctx.fillrect(150, 40, 100, 100); result specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.re
store' in that specification.
WEBGL_lose_context.restoreContext() - Web APIs
the webgl_lose_context.re
storecontext() method is part of the webgl api and allows you to simulate restoring the context of a webglrenderingcontext object.
... syntax gl.getextension('webgl_lose_context').re
storecontext(); errors thrown invalid_operation if the context was not lost.
... examples with this method, you can simulate the webglcontextre
stored event: var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); canvas.addeventlistener('webglcontextre
stored', function(e) { console.log(e); }, false); gl.getextension('webgl_lose_context').re
storecontext(); specifications specification status comment webgl_lose_contextthe definition of 'webgl_lose_context.losecontext' in that specification.
CredentialsContainer.store() - Web APIs
the
store() method of the credentialscontainer
stores a set of credentials for the user inside a credential instance, returning this in a promise.
... syntax credentialscontainer.
store(credential).then(function(credential) { ...
norestorefocus - Archive of obsolete content
« xul reference home nore
storefocus type: boolean if false, the default value, then when the panel is hidden, the keyboard focus will be re
stored to whatever had the focus before the panel was opened.
Window.restore() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetre
storechrome no support noedge no support nofirefox no support noie ?
Using IndexedDB - Web APIs
indexeddb is a way for you to persistently
store data inside a user's browser.
... create an object
store in the database.
... creating and structuring the
store using an experimental version of indexeddb in case you want to test your code in browsers that still use a prefix, you can use the following code: // in the following line, you should include the prefixes of implementations you want to test.
...And 107 more matches
Index - Web APIs
109 audiobuffer.length api, audiobuffer, property, reference, web audio api, length the length property of the audiobuffer interface returns an integer representing the length, in sample-frames, of the pcm data
stored in the buffer.
... 112 audiobuffersourcenode api, audio, audiobuffersourcenode, interface, media, reference, web audio api the audiobuffersourcenode interface is an audioscheduledsourcenode which represents an audio source consisting of in-memory audio data,
stored in an audiobuffer.
...all pannernodes spatialize in relation to the audiolistener
stored in the baseaudiocontext.listener attribute.
...And 94 more matches
Client-side storage - Learn web development
previous overview: client-side web apis modern web browsers support a number of ways for web sites to
store data on the user's computer — with the user's permission — then retrieve it when necessary.
... prerequisites: javascript basics (see first steps, building blocks, javascript objects), the basics of client-side apis objective: to learn how to use client-side storage apis to
store application data.
...most major modern web sites are dynamic — they
store data on the server using some kind of database (server-side storage), then run server-side code to retrieve needed data, insert it into static page templates, and serve the resulting html to the client to be displayed by the user's browser.
...And 65 more matches
Basic concepts - Web APIs
indexeddb is a way for you to persistently
store data inside a user's browser.
...indexeddb is useful for applications that
store a large amount of data (for example, a catalog of dvds in a lending library) and applications that don't need persistent internet connectivity to work (for example, mail clients, to-do lists, and notepads).
... overview of indexeddb indexeddb lets you
store and retrieve objects that are indexed with a "key." all changes that you make to the database happen within transactions.
...And 41 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
here, helloworld is a package name, and content/ is a relative path to the folder where the source file is
stored.
... developing practical extensions: a session-management extension in this section, we will create an extension that uses a new feature: the session
store api.
... this will allow the user to save and re
store session snapshots (browser window states) at any time.
...And 40 more matches
Index
24 js::autosaveexceptionstate jsapi reference, reference, référence(2), spidermonkey js::autosaveexceptionstate saves and later re
stores the current exception state of a given jscontext.
...js::protokeytoid
stores a jsid to *idp.
... 89 jscheckaccessop jsapi reference, obsolete, reference, référence(2), spidermonkey check whether obj[id] may be accessed per mode, returning js_false on error/exception, js_true on success with obj[id]'s
stored value in *vp.
...And 28 more matches
JavaScript Client API - Archive of obsolete content
further, you agree (a) to maintain and link to (including on websites from which your third party client may be downloaded) a separate, conspicuous, and reasonably detailed privacy policy detailing how data collected or transmitted by your third party client is managed and protected; (b) that your third party client will only
store data in encrypted form on the firefox sync servers operated by mozilla; (c) that you and your third party client will use the firefox sync apis solely for their intended purpose; (d) that your third party client will not hide or mask its identity as it uses the services and/or firefox sync apis, including by failing to follow required identification conventions; and (e) that you and your third pa...
...when something of interest occurs, it interacts with the engine to let it know something has happened and it might want to take action
store entity that serves as a data
store/proxy for information in an engine.
... the name
store is somewhat of a misnomer, as
stores don't actually persistently
store anything, but rather serve as short-lived data
stores during the course of a single sync and act as proxies to other data
stores within the application (like the places database) outside of sync.
...And 27 more matches
Index
when the component starts up, it populates a list of urls read in from a file
stored next to the gecko binary on the local system.
... 113 detailed xpcom hashtable guide guide, xpcom a hashtable is a data construct that
stores a set of items.
... 122 xpcom hashtable guide a hashtable is a data construct that
stores a set of items.
...And 23 more matches
TypeScript support in Svelte - Learn web development
previous overview: client-side javascript frameworks next in the last article we learned about svelte
stores and even implemented our own custom
store to persist the app's information to web storage.
... update your <script> section to look like this: <script lang='ts'> import filterbutton from './filterbutton.svelte' import todo from './todo.svelte' import moreactions from './moreactions.svelte' import newtodo from './newtodo.svelte' import todosstatus from './todosstatus.svelte' import { alert } from '../
stores' import { filter } from '../types/filter.enum' import type { todotype } from '../types/todo.type' export let todos: todotype[] = [] let todosstatus: todosstatus // reference to todosstatus instance $: newtodoid = todos.length > 0 ?
...in each case it should end up like this: import { selectonfocus } from '../actions' migrating the
stores to typescript now we have to migrate the
stores.js and local
store.js files to typescript.
...And 22 more matches
IME handling guide
when this receives an ecompositionchange, ecompositioncommit or ecompositioncommitasis event, it dispatches the event to the
stored node which was the event target of ecompositionstart event.
... when this receives ecompositionchange or ecompositioncommit, this checks if new composition string (or committing string) is different from the last data
stored by the textcomposition.
... one of the other important jobs of this is, when a focused editor handles a dispatched ecompositionchange event, this modifies the
stored composition string and its clause information.
...And 21 more matches
Index
this strategy allows nss to work with many hardware devices (e.g., to speed up the calculations required for cryptographic operations, or to access smartcards that securely protect a secret key) and software modules (e.g., to allow to load such modules as a plugin that provides additional algorithms or
stores key or trust information) that implement the pkcs#11 interface.
... only nss is allowed to access and manipulate these database files directly; a programmer using nss must go through the apis offered by nss to manipulate the data
stored in these files.
... most of the time certificates and keys are supposed to be
stored in the nss database.
...And 21 more matches
Observer Notifications
session
store-windows-re
stored sent by the session re
store process to indicate that all initial browser windows have opened.
... note that while the window are open and the chrome loaded the tabs in the windows may still be being re
stored after this notification.
... session
store these topics are used when actions related to session
store occur.
...And 21 more matches
Index - Archive of obsolete content
27 modules add-ons, extensions a module is a self-contained unit of code, which is usually
stored in a file, and has a well defined interface.
... 52 passwords add-on sdk interact with firefox's password manager to add, retrieve and remove
stored credentials.
... 58 simple-prefs add-on sdk
store preferences across application restarts.
...And 19 more matches
IDBDatabaseSync - Web APIs
method overview idbobject
storesync createobject
store (in domstring name, in domstring keypath, in optional boolean autoincrement) raises (idbdatabaseexception); idbobject
storesync openobject
store (in domstring name, in optional unsigned short mode) raises (idbdatabaseexception); void removeobject
store (in domstring
storename) raises (idbdatabaseexception); void setversion (in domstring version); ...
... idbtransactionsync transaction (in optional domstringlist
storenames, in optional unsigned int timeout) raises (idbdatabaseexception); attributes attribute type description description readonly domstring the human-readable description of the connected database.
... object
stores readonly domstringlist the names of the object
stores that exist in the connected database.
...And 19 more matches
Game distribution - Game development
this includes hosting it yourself online, submitting it to open marketplaces, and submitting it to closed ones like google play or the ios app
store.
... direct link distribution and instant play you don't have to tell people to search for your game in an app
store with html5 games.
... publishing the game there are three main options when it comes to publishing a game: self-hosting publishers
stores remember that the name of your game should be unique enough to be quickly promoted later on, but also catchy enough, so people don't forget it.
...And 18 more matches
passwords - Archive of obsolete content
interact with firefox's password manager to add, retrieve and remove
stored credentials.
... using this module you can: search for credentials which have been
stored in the password manager.
...
store credentials in the password manager.
...And 12 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
arrays are used to
store multiple values in a single variable.
... this is compared to a variable that can
store only one value.
...these servers
store duplicate copies of data so that servers can fulfill data requests based on which servers are closest to the respective end-users.
...And 12 more matches
Bytecode Descriptions
resumekind is the generatorresumekind
stored as an int32 value.
...it's treated as jump target op so that the baseline interpreter can efficiently re
store the frame's interpretericentry when resuming a generator.
...resumekind must be a generatorresumekind
stored as an int32 value.
...And 12 more matches
nsILoginManagerStorage
note: extensions that simply want to access/
store logins should use the login manager service and nsiloginmanager interface instead.
... methods addlogin() called by the login manager to
store a new login.
...findlogins() implement this method to search the login
store for logins matching the specified criteria.
...And 12 more matches
simple-prefs - Archive of obsolete content
experimental
store preferences across application restarts.
... you can
store booleans, integers, and string values, and users can configure these preferences in the add-ons manager.
... type description example specification bool displayed as a checkbox and
stores a boolean.
...And 11 more matches
Mozilla internal string guide
all strings are
stored as a single contiguous buffer of characters.
...nsliteral[c]string is trivially constructible and destructible, and therefore does not emit construction/destruction code when
stored in statics, as opposed to the other string classes.
...for example: // when passing a string to a method, use const nsastring& nsfoo::printstring(const nsastring &str); // when getting a string from a method, use nsastring& nsfoo::getstring(nsastring &result); the abstract classes are also sometimes used to
store temporary references to objects.
...And 11 more matches
IDBDatabase - Web APIs
all objects in indexeddb — including object
stores, indexes, and cursors — are tied to a particular transaction.
... idbdatabase.object
storenames read only a domstringlist that contains a list of the names of the object
stores currently in the connected database.
... idbdatabase.createmutablefile() creates a file handle, allowing files to be
stored inside an indexeddb database.
...And 11 more matches
IDBIndex - Web APIs
an index is a kind of object
store for looking up records in another object
store, called the referenced object
store.
... you can retrieve records in an object
store through the primary key or by using an index.
... an index 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.
...And 11 more matches
Checking when a deadline is due - Web APIs
in this article we look at a complex example involving checking the current time and date against a deadline
stored via indexeddb.
... the main complication here is checking the
stored deadline info (month, hour, day, etc.) against the current time and date taken from a date object.
... the main example application we will be referring to in this article is to-do list notifications, a simple to-do list application that
stores task titles and deadline times and dates via indexeddb, and then provides users with notifications when deadline dates are reached, via the notification, and vibration apis.
...And 10 more matches
Key Values - Web APIs
vk_exit qt::key_exit (0x0102000a) "favoriteclear0" clears the program or content
stored in the first favorites list slot.
... vk_clear_favorite_0 "favoriteclear1" clears the program or content
stored in the second favorites list slot.
... vk_clear_favorite_1 "favoriteclear2" clears the program or content
stored in the third favorites list slot.
...And 10 more matches
Cache-Control - HTTP
cache-control: max-age=<seconds> cache-control: max-stale[=<seconds>] cache-control: min-fresh=<seconds> cache-control: no-cache cache-control: no-
store cache-control: no-transform cache-control: only-if-cached cache response directives standard cache-control directives that can be used by the server in an http response.
... cache-control: must-revalidate cache-control: no-cache cache-control: no-
store cache-control: no-transform cache-control: public cache-control: private cache-control: proxy-revalidate cache-control: max-age=<seconds> cache-control: s-maxage=<seconds> extension cache-control directives extension cache-control directives are not part of the core http caching standards document.
... cache-control: immutable cache-control: stale-while-revalidate=<seconds> cache-control: stale-if-error=<seconds> directives cacheability a response is normally cached by the browser if: it has a status code of 301, 302, 307, 308, or 410 and cache-control does not have no-
store, or if proxy, does not have private and authorization is unset either has a status code of 301, 302, 307, 308, or 410 or has public, max-age or s-maxage in cache-control or has expires set public the response may be
stored by any cache, even if the response is normally non-cacheable.
...And 10 more matches
Transformations - Web APIs
re
store() re
stores the most recently saved canvas state.
... canvas states are
stored on a stack.
...each time the re
store() method is called, the last saved state is popped off the stack and all saved settings are re
stored.
...And 9 more matches
IDBTransaction - Web APIs
is it readonly or readwrite), and you access an idbobject
store to make a request.
...ce" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">idbtransaction</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} transactions are started when the transaction is created, not when the first request is placed; for example consider this: var trans1 = db.transaction("foo", "readwrite"); var trans2 = db.transaction("foo", "readwrite"); var object
store2 = trans2.object
store("foo") var object
store1 = trans1.object
store("foo") object
store2.put("2", "key"); object
store1.put("1", "key"); after the code is executed the object
store should contain the value "2", since trans2 should run after trans1.
... idbtransaction.mode read only the mode for isolating access to data in the object
stores that are in the scope of the transaction.
...And 9 more matches
Caching compiled WebAssembly modules - WebAssembly
caching is useful for improving the performance of an app — we can
store compiled webassembly modules on the client so they don't have to be downloaded and compiled every time.
... caching via indexeddb indexeddb is a transactional database system that allows you to
store and retrieve structured data on the client-side.
...additionally, it handles creating a database to cache the compiled wasm modules in, attempts to
store new modules in the database, and retrieves previously cached modules from the database, saving you from having to download them again.
...And 9 more matches
JavaScript basics - Learn web development
you did this by using a function called queryselector() to grab a reference to your heading, and then
store it in a variable called myheading.
... variables variables are containers that
store values.
... let myvariable = true; array this is a structure that allows you to
store multiple values in a single reference.
...And 8 more matches
Introduction to the server side - Learn web development
most large-scale websites use server-side code to dynamically display different data when needed, generally pulled out of a database
stored on a server and sent to the client to be displayed via some code (e.g.
...it can also make sites easier to use by storing personal preferences and information — for example reusing
stored credit card details to streamline subsequent payments.
... a dynamic site can return different data for a url based on information provided by the user or
stored preferences and can perform other operations as part of returning a response (e.g.
...And 8 more matches
nsIFaviconService
toolkit/components/places/public/nsifaviconservice.idlscriptable
stores favicons for pages in bookmarks and history.
...for a normal page with a favicon we've
stored, this will be an annotation uri which will then cause the corresponding favicon data to be loaded from this service.
...for a normal page with a favicon we've
stored, this will be an annotation uri which will then cause the corresponding favicon data to be loaded from this service.
...And 8 more matches
WebIDL bindings
acallback.setsomenumber(2*number, rv, erethrowexceptions); if (rv.failed()) { // the exception is now
stored on rv.
...this guarantees that a void* can be
stored in the jsobject which can then be reinterpret_cast to any of the classes that correspond to interfaces the object implements.
... typed arrays
store a jsobject* and hence need to be rooted properly.
...And 8 more matches
IDBDatabase.transaction() - Web APIs
the transaction method of the idbdatabase interface immediately returns a transaction object (idbtransaction) containing the idbtransaction.object
store method, which you can use to access your object
store.
... syntax idbdatabase.transaction(
storenames); idbdatabase.transaction(
storenames, mode); parameters "durability" -- the durability constrints for the transction.
...
storenames the names of object
stores that are in the scope of the new transaction, declared as an array of strings.
...And 8 more matches
IDBIndexSync - Web APIs
storename readonly domstring this index's referenced object
store.
... methods add()
stores the given value into this index, optionally with the specified key.
... any add( in any value, in optional any key ) raises (idbdatabaseexception); parameters returns exceptions this method can raise a idbdatabaseexception with the following code: value the value to
store into the index.
...And 8 more matches
Understanding WebAssembly text format - WebAssembly
webassembly contains instructions like i32.load and i32.
store for reading and writing from linear memory.
... webassembly could add an anyfunc type ("any" because the type could hold functions of any signature), but unfortunately this anyfunc type couldn’t be
stored in linear memory for security reasons.
... linear memory exposes the raw contents of
stored values as bytes and this would allow wasm content to arbitrarily observe and corrupt raw function addresses, which is something that cannot be allowed on the web.
...And 8 more matches
JSAPI User Guide
all of these functions, classes, and variables are
stored as properties of the global object.
...the native function uses js_convertarguments to convert the arguments to c++ types and
store them in local variables.
... the native function uses js_set_rval(cx, vp, val) to
store its javascript return value.
...And 7 more matches
Browser storage limits and eviction criteria - Web APIs
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).
...opera mini (still presto-based, server-side rendering) doesn't
store any data on the client.
... in firefox, the following technologies make use of browser data storage to
store data when required.
...And 7 more matches
IndexedDB API - Web APIs
if you'd prefer a simple api, try libraries such as localforage, dexie.js, zangodb, pouchdb, idb, idb-keyval, js
store and lovefield that make indexeddb more programmer-friendly.
...indexeddb lets you
store and retrieve objects that are indexed with a key; any objects supported by the structured clone algorithm can be
stored.
...so while you can access
stored data within a domain, you cannot access data across different domains.
...And 7 more matches
HTTP caching - HTTP
different kinds of caches caching is a technique that
stores a copy of a given resource and serves it back when requested.
... when a web cache has a requested resource in its
store, it intercepts the request and returns its copy instead of re-downloading from the originating server.
...a shared cache is a cache that
stores responses for reuse by more than one user.
...And 7 more matches
DataView - JavaScript
dataview.prototype.setint8()
stores a signed 8-bit integer (byte) value at the specified byte offset from the start of the view.
... dataview.prototype.setuint8()
stores an unsigned 8-bit integer (unsigned byte) value at the specified byte offset from the start of the view.
... dataview.prototype.setint16()
stores a signed 16-bit integer (short) value at the specified byte offset from the start of the view.
...And 7 more matches
Storing annotations - Archive of obsolete content
now we are able to create annotations, let's
store them using the simple-storage module.
... first, import the simple-storage module with a declaration like: var simplestorage = require('sdk/simple-storage'); in the module scope, initialize an array which will contain the
stored annotations: if (!simplestorage.storage.annotations) simplestorage.storage.annotations = []; now we'll add a function to the module scope which deals with a new annotation.
... } this function calls a constructor for an annotation object, which we also need to supply: function annotation(annotationtext, anchor) { this.annotationtext = annotationtext; this.url = anchor[0]; this.ancestorid = anchor[1]; this.anchortext = anchor[2]; } now we need to link this code to the annotation editor, so that when the user presses the return key in the editor, we create and
store the new annotation: var annotationeditor = panels.panel({ width: 220, height: 220, contenturl: data.url('editor/annotation-editor.html'), contentscriptfile: data.url('editor/annotation-editor.js'), onmessage: function(annotationtext) { if (annotationtext) handlenewannotation(annotationtext, this.annotationanchor); annotationeditor.hide(); }, onshow: function() { t...
...And 6 more matches
Introduction to Public-Key Cryptography - Archive of obsolete content
proper implementation does not
store passwords in plaintext.
... instead it concatenates the password with a random per-user value (so called "salt") and
stores the hash value of the result along with the salt.
...(for a detailed discussion of the way this works, see "introduction to ssl.") at this point the server may optionally perform other authentication tasks, such as checking that the certificate presented by the client is
stored in the user's entry in an ldap directory.
...And 6 more matches
Fetching data from the server - Learn web development
to speed things up even further, some sites also
store assets and data on the user's computer when they are first requested, meaning that on subsequent visits they use the local versions instead of downloading fresh copies when the page is first loaded.
...this
stores a reference to the <select> and <pre> elements in constants and defines an onchange event handler function so that when the select's value is changed, its value is passed to an invoked function updatedisplay() as a parameter.
...note that you could also choose to
store your promise in a variable and chain .then() onto that instead.
...And 6 more matches
A first splash into JavaScript - Learn web development
the place where we'll be adding all our code is inside the <script> element at the bottom of the html: <script> // your javascript goes here </script> adding variables to
store our data let's get started.
...) + 1; const guesses = document.queryselector('.guesses'); const lastresult = document.queryselector('.lastresult'); const loworhi = document.queryselector('.loworhi'); const guesssubmit = document.queryselector('.guesssubmit'); const guessfield = document.queryselector('.guessfield'); let guesscount = 1; let resetbutton; this section of the code sets up the variables and constants we need to
store the data our program will use.
...constants are used to
store values that are immutable or can't be changed and are created with the keyword const.
...And 6 more matches
Arrays - Learn web development
here we look at why this is useful, then explore how to create an array, retrieve, add, and remove items
stored in an array, and more besides.
... arrays are generally described as "list-like objects"; they are basically single objects that contain multiple values
stored in a list.
... array objects can be
stored in variables and dealt with in much the same way as any other type of value, the difference being that we can access each value inside the list individually, and do super useful and efficient things with the list, like loop through it and do the same thing to every value.
...And 6 more matches
NSS Sample Code Sample1
this program shows the following: rsa key pair generation naming rsa key pairs looking up a previously generated key pair by name creating aes and mac keys (or encryption and mac keys in general) wrapping symmetric keys using your own rsa key pair so that they can be
stored on disk or in a database.
... as an alternative to token symmetric keys as a way to
store large numbers of symmetric keys wrapping symmetric keys using an rsa key from another server unwrapping keys using your own rsa key pair the main part of the program shows a typical sequence of events for two servers that are trying to extablish a shared key pair.
...(currently nss doesn't
store persistant keys.
...And 6 more matches
Detailed XPCOM hashtable guide
a hashtable is a data construct that
stores a set of items.
...you can
store entries with keys 1, 5, and 3000).
... lookup time: o(1): lookup time is a simple constant o(1): lookup time is mostly-constant, but the constant time can be larger than an array lookup sorting: sorted:
stored sorted; iterated over in a sorted fashion.
...And 6 more matches
nsIDocShell
method overview void addsessionstorage(in nsiprincipal principal, in nsidomstorage storage); void addstate(in nsivariant adata, in domstring atitle, in domstring aurl, in boolean areplace); void beginre
store(in nsicontentviewer viewer, in boolean top); void createaboutblankcontentviewer(in nsiprincipal aprincipal); void createloadinfo(out nsidocshellloadinfo loadinfo); void detacheditorfromwindow(); violates the xpcom interface guidelines void finishre
store(); void firepagehidenotification(in boolean isunload); native code only!
... beginre
store() begin firing webprogresslistener notifications for restoring a page presentation.
...void beginre
store( in nsicontentviewer viewer, in boolean top ); parameters viewer the content viewer whose document we are starting to load.
...And 6 more matches
WebGLRenderingContext.getParameter() - Web APIs
l.max_uniform_block_size glint64 gl.max_uniform_buffer_bindings glint gl.max_varying_components glint gl.max_vertex_output_components glint gl.max_vertex_uniform_blocks glint gl.max_vertex_uniform_components glint gl.min_program_texel_offset glint gl.pack_row_length glint see pixel
storei.
... gl.pack_skip_pixels glint see pixel
storei.
... gl.pack_skip_rows glint see pixel
storei.
...And 6 more matches
Using HTTP cookies - HTTP
the browser may
store it and send it back with later requests to the same server.
...while this was legitimate when they were the only way to
store data on the client, it is now recommended to use modern storage apis.
... to see
stored cookies (and other storage that a web page can use), you can enable the storage inspector in developer tools and select cookies from the storage tree.
...And 6 more matches
Keyed collections - JavaScript
objects allow you to set keys to values, retrieve those values, delete keys, and detect whether something is
stored at a key.
... use maps if there is a need to
store primitive values as keys because object treats each key as a string whether it's a number value, boolean value or any other primitive value.
... one use case of weakmap objects is to
store private data for an object, or to hide implementation details.
...And 6 more matches
Image file type and format guide - Web media technologies
theoretically, several compression algorithms are supported, and the image data can also be
stored in jpeg or png format within the bmp file.
... another popular feature of gif is support for interlacing, where rows of pixels are
stored out of order so that partially-received files can be displayed in lower quality.
... tiff (tagged image file format) tiff is a raster graphics file format which was created to
store scanned photos, although it can be any kind of image.
...And 6 more matches
simple-storage - Archive of obsolete content
lets an add-on
store data so that it's retained across firefox restarts.
... to
store a value, just assign it to a property on storage: var ss = require("sdk/simple-storage"); ss.storage.myarray = [1, 1, 2, 3, 5, 8, 13]; ss.storage.myboolean = true; ss.storage.mynull = null; ss.storage.mynumber = 3.1337; ss.storage.myobject = { a: "foo", b: { c: true }, d: null }; ss.storage.mystring = "o frabjous day!"; you can
store array, boolean, number, object, null, and string values.
... if you'd like to
store other types of values, you'll first have to convert them to strings or another one of these types.
...And 5 more matches
XUL Structure - Archive of obsolete content
by default, mozilla applications parse xul files and scripts, and
store a pre-compiled version in memory for the remainder of the application session.
...each part is
stored in a different directory.
...these are
stored in xul files, which have a .xul extension.
...And 5 more matches
Manipulating documents - Learn web development
imagine if a web site could get access to your
stored passwords or other sensitive information, and log into websites as if it were you?
...using methods available on this object you can do things like return the window's size (see window.innerwidth and window.innerheight), manipulate the document loaded into that window,
store data specific to that document on the client-side (for example using a local database or other storage mechanism), attach an event handler to the current window, and more.
... to manipulate an element inside the dom, you first need to select it and
store a reference to it inside a variable.
...And 5 more matches
PKCS11 FAQ
if no new sessions are available, the one read-only session is used, and the state is saved and re
stored after each multipart operation.
...nss itself uses two tokens internally--one that provides generic cryptographic services without authentication, and one that provides operations based on the keys
stored in the user's database and do need authentication.
...much of nss's token selection is based on where the key involved is currently
stored.
...And 5 more matches
NSS tools : certutil
some smart cards (for example, the litronic card) can
store only one key pair.
... creating new security databases certificates, keys, and security modules related to managing certificates are
stored in three related databases: * cert8.db or cert9.db * key3.db or key4.db * secmod.db or pkcs11.txt these databases must be created before certificates or keys can be generated.
...this can be done by specifying a ca certificate (-c) that is
stored in the certificate database.
...And 5 more matches
certutil
some smart cards (for example, the litronic card) can
store only one key pair.
... creating new security databases certificates, keys, and security modules related to managing certificates are
stored in three related databases: o cert8.db or cert9.db o key3.db or key4.db o secmod.db or pkcs11.txt these databases must be created before certificates or keys can be generated.
...this can be done by specifying a ca certificate (-c) that is
stored in the certificate database.
...And 5 more matches
Using the Places history service
differences from previous implementations the previous nsglobalhistory service
stored one entry for each page in history.
...the main url table
stores the information about the page: url, host name, title, visit count, hidden, and typed.
...
stored separately is the information specific to each visit.
...And 5 more matches
nsICache
store_anywhere 0 the storage policy of a cache entry determines the device(s) to which it belongs.
...allows the cache entry to be
stored in any device.
... the cache service decides which cache device to use based on "some resource management calculation."
store_in_memory 1 the storage policy of a cache entry determines the device(s) to which it belongs.
...And 5 more matches
nsISessionStartup
browser/components/session
store/nsisessionstartup.idlscriptable handles the session re
store process.
...to use this service, use: var sessionstartup = components.classes["@mozilla.org/browser/sessionstartup;1"] .getservice(components.interfaces.nsisessionstartup); method overview boolean dore
store(); attributes attribute type description sessiontype unsigned long the type of session being re
stored; this will be one of the session type constants.
...it will either be re
stored or about:sessionre
store will be displayed.
...And 5 more matches
Mail composition back end
a "sent" folder) as well as the ability to
store messages for features like "drafts" and "templates".
... const struct nsmsgattachedfile *preloaded_attachments, - attachments that are already locally
stored on disk (note: both attachments and preloaded_attachments cannot be specified on a single call void *relatedpart /* nsmsgsendpart */, - a related part for multipart related operations nsimsgsendlistener **alistenerarray) = 0; - an array of listeners for the send operation.
...the determiniation of which folder is the "sent" folder for the user is done by a call to getfolderswithflag() and the message
store will control this user defined preference.
...And 5 more matches
Working with windows in chrome code
of course, this doesn't matter if you just
store data in the component.
... you can
store arbitrary javascript objects in the component.
...of course, this doesn't matter if you just
store data in the component.
...And 5 more matches
FileHandle API - Web APIs
because the files manipulated through that api can be physically
stored on the device, the editing part uses a turn-based locking mechanism in order to avoid race issues.
...if you want a file to survive a page refresh/app relaunch, you need to
store the handle in a more permanent location, like the database itself.
...if you want a file to survive a page refresh/app relaunch, you need to
store the handle in a database (not necessarily the one used to create the filehandle object).
...And 5 more matches
IDBTransaction.mode - Web APIs
the mode read-only property of the idbtransaction interface returns the current mode for accessing the data in the object
stores in the scope of the transaction (i.e.
... is the mode to be read-only, or do you want to write to the object
stores?) the default value is readonly.
... syntax var mycurrentmode = idbtransaction.mode; value an idbtransactionmode object defining the mode for isolating access to data in the current object
stores: value explanation readonly allows data to be read but not changed.
...And 5 more matches
Using the Web Storage API - Web APIs
the web storage api provides mechanisms by which browsers can securely
store key/value pairs.
... basic concepts storage objects are simple key-value
stores, similar to objects, but they stay intact through page loads.
...these three lines all set the (same) colorsetting entry: localstorage.colorsetting = '#a4509b'; localstorage['colorsetting'] = '#a4509b'; localstorage.setitem('colorsetting', '#a4509b'); note: it's recommended to use the web storage api (setitem, getitem, removeitem, key, length) to prevent the pitfalls associated with using plain objects as key-value
stores.
...And 5 more matches
Using the WebAssembly JavaScript API - WebAssembly
memory in the low-level memory model of webassembly, memory is represented as a contiguous range of untyped bytes called linear memory that are read and written by load and
store instructions inside the module.
... in this memory model, any load or
store can access any byte in the entire linear memory, which is necessary to faithfully represent c/c++ concepts like pointers.
... while memory provides a resizable typed array of raw bytes, it is unsafe for references to be
stored in a memory since a reference is an engine-trusted value whose bytes must not be read or written directly by content for safety, portability, and stability reasons.
...And 5 more matches
jspage - Archive of obsolete content
"unload",n);l();};}else{h[this.uid]=this;}if(this.addeventlistener){this.addeventlistener(o,n,false);}else{this.attachevent("on"+o,n); }return this;},removelistener:function(m,l){if(this.removeeventlistener){this.removeeventlistener(m,l,false);}else{this.detachevent("on"+m,l);}return this; },retrieve:function(m,l){var o=c(this.uid),n=o[m];if(l!=undefined&&n==undefined){n=o[m]=l;}return $pick(n);},
store:function(m,l){var n=c(this.uid);n[m]=l; return this;},eliminate:function(l){var m=c(this.uid);delete m[l];return this;}});window.addlistener("unload",d);})();element.properties=new hash;element.properties.style={set:function(a){this.style.csstext=a; },get:function(){return this.style.csstext;},erase:function(){this.style.csstext="";}};element.properties.tag={get:function(){return this.tagname.tol...
...es(a);}};element.properties.opacity={set:function(a,b){if(!b){if(a==0){if(this.style.visibility!="hidden"){this.style.visibility="hidden"; }}else{if(this.style.visibility!="visible"){this.style.visibility="visible";}}}if(!this.currentstyle||!this.currentstyle.haslayout){this.style.zoom=1;}if(browser.engine.trident){this.style.filter=(a==1)?"":"alpha(opacity="+a*100+")"; }this.style.opacity=a;this.
store("opacity",a);},get:function(){return this.retrieve("opacity",1);}};element.implement({setopacity:function(a){return this.set("opacity",a,true); },getopacity:function(){return this.get("opacity");},setstyle:function(b,a){switch(b){case"opacity":return this.set("opacity",parsefloat(a));case"float":b=(browser.engine.trident)?"stylefloat":"cssfloat"; }b=b.camelcase();if($type(a)!="string"){var c=(ele...
...render(this.element,b,a,this.options.unit);return this;},start:function(c,e,d){if(!this.check(c,e,d)){return this; }var b=array.flatten(arguments);this.property=this.options.property||b.shift();var a=this.prepare(this.element,this.property,b);return this.parent(a.from,a.to); }});element.properties.tween={set:function(a){var b=this.retrieve("tween");if(b){b.cancel();}return this.eliminate("tween").
store("tween:options",$extend({link:"cancel"},a)); },get:function(a){if(a||!this.retrieve("tween")){if(a||!this.retrieve("tween:options")){this.set("tween",a);}this.
store("tween",new fx.tween(this,this.retrieve("tween:options"))); }return this.retrieve("tween");}};element.implement({tween:function(a,c,b){this.get("tween").start(arguments);return this;},fade:function(c){var e=this.get("tween"),d="opacit...
...And 4 more matches
Silly story generator - Learn web development
this gives you three variables that
store references to the "enter custom name" text field (customname), the "generate random story" button (randomize), and the <p> element at the bottom of the html body that the story will be copied into (story), respectively.
... in addition you've got a function called randomvaluefromarray() that takes an array, and returns one of the items
stored inside the array at random.
...we'd like you to contain these inside variables inside main.js:
store the first, big long, string of text inside a variable called storytext.
...And 4 more matches
Storing the information you need — Variables - Learn web development
the first line pops a box up on the screen that asks the reader to enter their name, and then
stores the value in a variable.
...this is obviously really inefficient (the code is a lot bigger, even for only five choices), and it just wouldn't work — you couldn't possibly
store all possible choices.
...you can think of them being like little cardboard boxes that you can
store things in.
...And 4 more matches
Working with JSON - Learn web development
objective: to understand how to work with data
stored in json, and create your own json objects.
... a json object can be
stored in its own file, which is basically just a text file with an extension of .json, and a mime type of application/json.
...at the moment it only contains two lines, which grab references to the <header> and <section> elements and
store them in variables: const header = document.queryselector('header'); const section = document.queryselector('section'); we have made our json data available on our github, at https://mdn.github.io/learning-area/javascript/oojs/json/superheroes.json.
...And 4 more matches
Server-side web frameworks - Learn web development
abstract and simplify database access websites use databases to
store information both to be shared with users, and about users.
...this makes it easier and safer to check that data is
stored in the correct type of database field, has the correct format (e.g.
...the model specifies the field types to be
stored, which may provide field-level validation on what information can be
stored (e.g.
...And 4 more matches
Componentizing our Svelte app - Learn web development
handling the events we'll need one variable to track whether we are in editing mode and another to
store the name of the task being updated.
... add the following set of functions below your previous function to handle these actions: function oncancel() { name = todo.name // re
stores name to its initial value and editing = false // and exit editing mode } function onsave() { update({ name: name }) // updates todo name editing = false // and exit editing mode } function onremove() { dispatch('remove', todo) // emit remove event } function onedit() { editing = true // en...
... the <input>'s value property will be bound to the name variable, and the buttons to cancel and save the changes call oncancel() and onsave() respectively (we added those functions earlier): when oncancel() is invoked, name is re
stored to its original value (when passed in as a prop) and we exit editing mode (by setting editing to false).
...And 4 more matches
CustomizableUI.jsm
note that customizableui won't re
store state in the area, allow the user to customize it in customize mode, or otherwise deal with it, until the area has been registered.
... furthermore, by default the placements of the area will be kept in the saved state (!) and re
stored if you re-register the area at a later point.
... if the area to which you try to add has not yet been re
stored from its legacy state (currentset attribute), this will postpone the addition.
...And 4 more matches
Web Replay
the rewind infrastructure allows a replaying process to re
store a previous state, while still maintaining communication with the chrome process.
... snapshot data may be
stored in memory or on disk.
... the dirty memory information computed since the last snapshot was taken is used to re
store the heap to the state at that last snapshot, and then the memory diffs can be used to re
store an earlier snapshot if necessary.
...And 4 more matches
Places utilities for JavaScript
description_anno - this annotation
stores description information about a bookmark.
... post_data_anno - i need to clarify here, but i think this is the name of the annotation that
stores information for keyword searches from a bookmark.
... tagsfolderid the folder that tags are
stored in.
...And 4 more matches
imgIContainer
as a service: var imgicontainer = components.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.imgicontainer); method overview void addre
storedata([array, size_is(acount), const] in char data, in unsigned long acount); native code only!
...in print32 aheight, in imgicontainerobserver aobserver); obsolete since gecko 2.0 void lockimage(); void removeframe(in gfxiimageframe item); obsolete since gecko 1.9.2 void requestdecode(); void requestdiscard(); void requestrefresh([const] in timestamp atime); violates the xpcom interface guidelines void resetanimation(); void re
storedatadone(); native code only!
... obsolete since gecko 2.0 kdisposere
storeprevious 3 re
store the previous(composited) frame.
...And 4 more matches
nsIAnnotationService
toolkit/components/places/public/nsiannotationservice.idlscriptable
stores arbitrary data about a web page.
...favicons are
stored in the favicon service, but are special cased in the protocol handler so they look like annotations.
...favicons are
stored in the favicon service, but are special cased in the protocol handler so they look like annotations.
...And 4 more matches
nsILoginManager
id modifylogin(in nsilogininfo oldlogin, in nsisupports newlogindata); void removealllogins(); void removelogin(in nsilogininfo alogin); void searchlogins(out unsigned long count, in nsipropertybag matchdata, [retval, array, size_is(count)] out nsilogininfo logins); void setloginsavingenabled(in astring ahost, in boolean isenabled); methods addlogin()
stores a new login in the login manager.
... void addlogin( in nsilogininfo alogin ); parameters alogin the login to
store.
... exceptions thrown an exception is thrown if the login information is already
stored in the login manager.
...And 4 more matches
nsIMsgFolder
ubfolder(in astring foldername); void createstorageifmissing(in nsiurllistener urllistener); void compact(in nsiurllistener alistener, in nsimsgwindow amsgwindow); void compactall(in nsiurllistener alistener, innsimsgwindow amsgwindow,in nsisupportsarray afolderarray, in boolean acompactofflinealso,in nsisupportsarray aofflinefolderarray); void compactalloffline
stores(in nsimsgwindow amsgwindow,in nsisupportsarray aofflinefolderarray); void emptytrash(in nsimsgwindow amsgwindow, in nsiurllistener alistener); void rename(in astring name, in nsimsgwindow msgwindow); void renamesubfolders( in nsimsgwindow msgwindow, in nsimsgfolder oldfolder); astring generateuniquesubfoldername(in astring prefix,in nsimsgfolder otherfolder); ...
...simsgthread thread); void setlabelformessages(in nsisupportsarray messages, in nsmsglabelvalue label); nsimsgdatabase getmsgdatabase(in nsimsgwindow msgwindow); void setmsgdatabase(in nsimsgdatabase msgdatabase); nsimsgdatabase getdbfolderinfoanddb(out nsidbfolderinfo folderinfo); nsimsgdbhdr getmessageheader(in nsmsgkey msgkey); boolean should
storemsgoffline(in nsmsgkey msgkey); boolean hasmsgoffline(in nsmsgkey msgkey); nsiinputstream getofflinefilestream(in nsmsgkey msgkey, out pruint32 offset, out pruint32 size); void downloadmessagesforoffline(in nsisupportsarray messages, in nsimsgwindow window); nsimsgfolder getchildwithuri(in acstring uri, in boolean deep, in boolean caseinsensitive); void...
... nsmsgkey akeystofetch, in unsigned long anumkeys, in boolean alocalonly, in nsiurllistener aurllistener); void addkeywordstomessages(in nsisupportsarray amessages, in acstring akeywords); void removekeywordsfrommessages(in nsisupportsarray amessages, in acstring akeywords); autf8string getmsgtextfromstream(in nsimsgdbhdr amsghdr, in nsiinputstream astream, in long abyte
storead, in long amaxoutputlen, in boolean acompressquotes); attributes attribute type description supportsoffline boolean readonly offline
storeoutputstream nsioutputstream readonly offline
storeinputstream nsiinputstream readonly retentionsettings nsimsgretentionsettings downloadsettings nsimsgdownloadsettin...
...And 4 more matches
nsITextInputProcessor
when this dispatches a normal modifier key event, the textinputprocessor instance activates the modifier state and
stores its code attribute value.
... activating normal modifier state when keydown() is called with normal modifier key (i.e., not lockable like capslock) event, the instance
stores the modifier key and code values.
...
stored modifier key information means that the modifier is active.
...And 4 more matches
IndexedDB - Firefox Developer Tools
object
stores — the number of object
stores in the database.
... when an indexeddb database is selected in the storage tree, details about all the object
stores are listed in the table.
... any object
store has the following details: object
store name — the name of the object
store.
...And 4 more matches
IDBCursor.update() - Web APIs
the update() method of the idbcursor interface returns an idbrequest object, and, in a separate thread, updates the value at the current position of the cursor in the object
store.
... syntax var anidbrequest = myidbcursor.update(value); parameters value the new value to be
stored at the current position.
... dataerror the underlying object
store uses in-line keys and the property in the value at the object
store's key path does not match the key in this cursor's position.
...And 4 more matches
IDBRequest.transaction - Web APIs
if a version upgrade is needed when opening a database then during the upgradeneeded event handler the transaction property will be an idbtransaction with mode equal to "versionchange", and can be used to access existing object
stores and indexes, or abort the the upgrade.
... example the following example requests a given record title, onsuccess gets the associated record from the idbobject
store (made available as object
storetitlerequest.result), updates one property of the record, and then puts the updated record back into the object
store in another request.
...for a full working example, see our to-do notifications app (view example live.) var title = "walk dog"; // open up a transaction as usual var object
store = db.transaction(['todolist'], "readwrite").object
store('todolist'); // get the to-do list object that has this title as it's title var object
storetitlerequest = object
store.get(title); object
storetitlerequest.onsuccess = function() { // grab the data object returned as the result var data = object
storetitlerequest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item back // into the database var updatetitlerequest = object
store.put(data);...
...And 4 more matches
Storage API - Web APIs
the storage standard defines a common, shared storage system to be used by all apis and technologies that
store content-accessible data for individual web sites.
... site storage—the data
stored for a web site which is managed by the storage standard—includes: indexeddb databases cache api data service worker registrations web storage api data managed using window.localstorage history state information saved using history.pushstate() application caches notification data other kinds of site-accessible, site-specific data that may be maintained site storage units the site storage system described by the storage standard and interacted wi...
...the diagram below shows a site storage pool with three storage units within, showing how storage units can have different data types
stored within and may have different quotas (maximum storage limits).
...And 4 more matches
WebGLRenderingContext.vertexAttribPointer() - Web APIs
first, we need to bind the webglbuffer we want to use to gl.array_buffer, then, with this method, gl.vertexattribpointer(), we specify in what order the attributes are
stored, and what data type they are in.
...this is independent from the location inside the array buffer, so your attributes can be sent in a different order than how they are
stored in the array buffer.
...keep in mind that these webgl functions have a slow performance and it is better to
store the state inside your javascript application.
...And 4 more matches
WebGL constants - Web APIs
less 0x0201 passed to depthfunction or stencilfunction to specify depth or stencil tests will pass if the new depth value is less than the
stored value.
... equal 0x0202 passed to depthfunction or stencilfunction to specify depth or stencil tests will pass if the new depth value is equals to the
stored value.
... lequal 0x0203 passed to depthfunction or stencilfunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the
stored value.
...And 4 more matches
Enhanced Extension Installation - Archive of obsolete content
c:\program files\mozilla firefox\extensions extension metadata the extension system
stores metadata in both of the two locations, in the following files: <location>/extensions/extensions.rdf - an xml/rdf datasource listing all the extensions installed at that location.
... in the profile directory, the file compatibility.ini
stores information about the version of the application (build info) that last started this profile - during startup this file is checked and if the version info held by the running app disagrees with the info held by this file, a compatibility check is run on all installed items.
...this boolean relationship itself is not
stored directly in the datasource.
...And 3 more matches
Inline options - Archive of obsolete content
here is an example of an options.xul file: <?xml version="1.0"?> <!doctype mydialog system "chrome://myaddon/locale/mydialog.dtd"> <vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <setting type="bool" pref="extensions.myaddon.bool" title="boolean" desc="
stored as a boolean preference" /> </vbox> note that it's limited to <setting> tags.
... setting types there are several types of <setting>s, each with a different type attribute: type attribute displayed as preference
stored as bool checkbox boolean boolint checkbox integer (use the attributes on and off to specify what values to
store) integer textbox integer string textbox string color colorpicker string (in the #123456 format) file browse button and label string directory browse button and label string menulist menulist dependent on the menu item values radio radio buttons dependent...
... on the radio values control button no pref
stored the pref attribute should have the full name of the preference to be
stored.
...And 3 more matches
Handling Preferences - Archive of obsolete content
preferences are used to
store settings and information to change their default behavior.
...the following files are used: default preferences: these are
stored in the directory defaults/pref in the firefox installation directory.
... current preferences: these are
stored in the profile directory with the name prefs.js.
...And 3 more matches
Drag and Drop JavaScript Wrapper - Archive of obsolete content
this drag and drop interface is
stored in the global package, in the file chrome://global/content/nsdraganddrop.js.
...<script src="chrome://global/content/nsdraganddrop.js" /> <script src="chrome://global/content/nstransferable.js" /> this drag and drop library creates an object
stored in the variable nsdraganddrop.
...in the above examples, this observer is
stored in the buttonobserver and textobserver variables.
...And 3 more matches
Table Cellmap - Border Collapse - Archive of obsolete content
introduction this document describes the additional information that is
stored for border collapse tables in the cellmap.
... information storage each cellmap entry
stores for tables in the border collapse mode additional information about its top and left edge and its top left corner.
... only the right most edge and the bottom most edge of a table need to be
stored in a different place.
...And 3 more matches
Adding Properties to XBL-defined Elements - Archive of obsolete content
the example below creates a button which generates and
stores a random number.
...box" class="randomizer"/> <button label="generate" oncommand="document.getelementbyid('random-box').number=math.random();"/> <button label="show" oncommand="alert(document.getelementbyid('random-box').number)"/> xbl: <binding id="randomizer"> <implementation> <field name="number"/> </implementation> </binding> a number field has been defined in the binding, which
stores the random number.
...this script should
store the value somewhere, or validate the value.
...And 3 more matches
Profile Manager
firefox and other xulrunner applications
store user settings and data in special folders, called profiles.
... this is the easiest way to backup and re
store profiles.
... the profile will be backed up, and the backup will appear under the backups column in the main display: to re
store a profile: select the backup in the main display, open the context menu, and choose "re
store".
...And 3 more matches
GC Rooting Guide
gc things on the stack js::rooted<t> all gc thing pointers
stored on the stack (i.e., local variables and parameters to functions) must use the js::rooted<t> class.
... these do not need to be wrapped in any of rooting classes, but they should be immediately used to initialize a js::rooted<t> if there is any code that could gc before the end of the containing function; a raw pointer must never be
stored on the stack during a gc.
...what will happen is that the return statement will pull the bare jsobject* out of the rooted obj variable and either put it in the stack or
store it in the return value register.
...And 3 more matches
Exact Stack Rooting
the method you should use to keep the gc up-to-date with this information will vary depending on where the gcpointer is being
stored.
... gcpointers can be
stored as a property of a gcthing, on the cheap, or in the cstack.
...if you see a gcpointer
stored as a private, please file a bug.
...And 3 more matches
XPCOM Stream Guide
on the other hand, we use streams to access files within a zip archive, to
store and provide data coming from websites, even to talk to other programs on the same computer through "pipes" (more on that later).
... nsmimeinputstream @mozilla.org/network/mime-input-stream;1 nsimimeinputstream .setdata(stream) similarly, there are complex output streams which build from primitive output streams: complex output stream types type purpose native class contract id interface how to bind to a primitive output stream buffered
store data in a buffer until the buffer is full or the stream closes.
.../scriptableinputstream;1", "nsiscriptableinputstream", "init"); function buildstream(data) { return new stringstream(data, data.length); } components.utils.import("resource://gre/modules/netutil.jsm"); function run_test() { var check = "we will rock you!"; var baseinputstream = buildstream(check); var
store = components.classes["@mozilla.org/storagestream;1"] .createinstance(components.interfaces.nsistoragestream); /* in practice, your storage streams shouldn't be this small.
...And 3 more matches
nsIDOMStorage
items
stored in session storage may be accessed by any interested party in the same browsing context.
...a storage object
stores an arbitrary set of key-value pairs, which may be retrieved, modified and removed as needed.
...keys are
stored in a particular order with the condition that this order not change by merely changing the value associated with a key, but the order may change when a key is added or removed.
...And 3 more matches
nsIMsgIncomingServer
calpath); void setfilevalue(in string relpref, in string abspref, in nsilocalfile avalue); void setfilterlist(in nsimsgfilterlist afilterlist); void setintattribute(in string name, in long value); void setintvalue(in string attr, in long value); void setunicharattribute(in string name, in astring value); void setunicharvalue(in string attr, in astring value); void shutdown(); void
storepassword(); astring tostring(); void writetofoldercache(in nsimsgfoldercache foldercache); attributes attribute type description accountmanagerchrome astring read only.
... limitofflinemessagesize boolean localpath nsilocalfile local
storetype acstring the schema for the local mail
store, such as "mailbox", "imap", or "news" used to construct uris.
... loginatstartup boolean logonfallback boolean maxmessagesize long offlinesupportlevel long password acstring passwordpromptrequired boolean if the password for the server is available either via authentication in the current session or from password manager
stored entries, return false.
...And 3 more matches
nsIPasswordManager
ng ahost, in astring auser, in astring apassword); void removeuser(in autf8string ahost, in astring auser); void addreject(in autf8string ahost); void removereject(in autf8string ahost); attributes attribute type description enumerator nsisimpleenumerator readonly: an enumeration of the
stored usernames and passwords as nsipassword objects.
... methods adduser()
stores a password.
... astring adduser(in autf8string ahost, in astring auser, in astring apassword); parameters ahost the hostname of the password to
store.
...And 3 more matches
nsIPlacesImportExportService
"bookmarks-re
store-begin" is fired just before the import is started.
... "bookmarks-re
store-success" is fired right after the bookmarks are successfully imported.
... "bookmarks-re
store-failed" is fired right after a failure occurs when importing the bookmarks.
...And 3 more matches
Drawing and Event Handling - Plugins
note: when a plug-in is drawn to a window, the plug-in is responsible for preserving state information and ensuring that the original state is re
stored.
... however, for the plug-in to draw at any other time, for example, to highlight on a mouse-down event or draw animation at idle time, it must save the current setting of the port, set up its drawing environment as appropriate, draw, and then re
store the port to the previous settings.
... in this case, the plug-in makes it unnecessary for the browser to save and re
store its port settings before and after every call into the plug-in.
...And 3 more matches
IDBCursor - Web APIs
the cursor has a source that indicates which index or object
store it is iterating over.
...operations are performed on the underlying index or object
store.
... idbcursor.source read only returns the idbobject
store or idbindex that the cursor is iterating.
...And 3 more matches
IDBTransactionSync - Web APIs
method overview void abort() raises (idbdatabaseexception); void commit() raises (idbdatabaseexception); idbobject
storesync object
store(in domstring name) raises (idbdatabaseexception); attributes attribute type description db idbdatabasesync the database connection that this transaction is associated with.
...when this method is called, the browser durably
stores all the changes performed to the objects of the database since this transaction was created.
... object
store() returns an object
store that has already been added to the scope of this transaction.
...And 3 more matches
WebGLRenderingContext.bufferData() - Web APIs
the webglrenderingcontext.bufferdata() method of the webgl api initializes and creates the buffer object's data
store.
... size a glsizeiptr setting the size in bytes of the buffer object's data
store.
... srcdata optional an arraybuffer, sharedarraybuffer or one of the arraybufferview typed array types that will be copied into the data
store.
...And 3 more matches
Web Storage API - Web APIs
the web storage api provides mechanisms by which browsers can
store key/value pairs, in a much more intuitive fashion than using cookies.
... web storage concepts and usage the two mechanisms within web storage are as follows: sessionstorage maintains a separate storage area for each given origin that's available for the duration of the page session (as long as the browser is open, including page reloads and re
stores)
stores data only for a session, meaning that the data is
stored until the browser (or tab) is closed.
...
stores data with no expiration date, and gets cleared only through javascript, or clearing the browser cache / locally
stored data.
...And 3 more matches
HTTP Index - HTTP
the browser may
store it and send it back with the next request to the same server.
...it allows web developers to have more control over the data
stored locally by a browser for their origins.
... 94 csp: report-to csp, content security policy, content-security-policy, http, reporting, security, report-to the content-security-policy report-to http response header field instructs the user agent to
store reporting endpoints for an origin.
...And 3 more matches
Atomics - JavaScript
atomics.compareexchange()
stores a value at the specified index of the array, if it equals a value.
... atomics.exchange()
stores a value at the specified index of the array.
... atomics.
store()
stores a value at the specified index of the array.
...And 3 more matches
WebAssembly.Table - JavaScript
the webassembly.table() object is a javascript wrapper object — an array-like structure representing a webassembly table, which
stores function references.
... note: tables can currently only
store function references, but this will likely be expanded in the future.
... instance methods table.prototype.get() accessor function — gets the element
stored at a given index.
...And 3 more matches
Web audio codec guide - Web media technologies
s audio codec mp4, ogg, flac g.711 pulse code modulation (pcm) of voice frequencies rtp / webrtc g.722 7 khz audio coding within 64 kbps (for telephony/voip) rtp / webrtc mp3 mpeg-1 audio layer iii mp4, adts, mpeg1, 3gp opus opus webm, mp4, ogg vorbis vorbis webm, ogg [1] when mpeg-1 audio layer iii codec data is
stored in an mpeg file, and there is no video track on the file, the file is typically referred to as an mp3 file, even though it's still an mpeg format file.
... lfe channels are specifically designed to
store low-frequency audio data, and are commonly used to provide audio data for subwoofers, for example.
... amr audio which is
stored in files may simply be typed .amr, but may also be encapsulated in .3gp files.
...And 3 more matches
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
persist the persist attribute is an easy way to record and
store a xul element’s state after it has been changed by a user operation.
... enter the names of the other attributes whose values you want to
store as a space-delimited ascii string into the value for persist; the next time that xul document is opened, the saved values will automatically be re
stored4.
... note: these values are
stored in local
store.rdf, inside the user profile.
...And 2 more matches
Promises - Archive of obsolete content
the json
store object must be instantiated with the base name of the storage file and, optionally, a json-compatible object to be used if the file does not yet exist.
... the contents of the file will be initially loaded into the json
store’s data property.
... * @optional * * @return {promise<json
store>} */ function json
store(name, default_={}) { return task.spawn(function* () { // determine the correct path for the file.
...And 2 more matches
MMgc - Archive of obsolete content
in order to be correct we must account for a new or unmarked object being
stored into an object we've already marked.
... in implementation terms this means a new or unmarked object is
stored in an object that has already been processed by the marking algorithm and is no longer in the queue.
...rked before we sweep white written to gray - the white object will be marked as reachable when the gray object is marked white written to white - the referant will either eventually become gray if its reachable or not in which case both objects will get marked black written to black/gray/white - its black, its already been marked so a write barrier needs to be inserted anywhere we could possibly
store a pointer to a white object into a black object.
...And 2 more matches
Using content preferences - Archive of obsolete content
site-specific content preferences are
stored in the profile folder, in the database file "content-prefs.sqlite".
... browser.upload.lastdir path of a filesystem directory this preference is
stored and retrieved automatically by file upload controls.
... spellcheck.lang language code (e.g., "en-us") private browsing requires gecko 9.0(firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) prior to gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6), the content preference service always
stores preferences on disk.
...And 2 more matches
The Implementation of the Application Object Model - Archive of obsolete content
the only way that one content node would know how to instantiate a content node of a completely different type is if it had additional information
stored for every child content node that it contained.
...a single content node could be initialized with its uri by its parent node, it could
store its uri in a member variable, and it could use that as a basis for resolving the pluggable data source from which it would obtain its information.
...but suppose that instead we could
store additional information about the tree's columns, namely in which order they occur, then the act of persistently saving a column reordering would take far less time (o(1) to swap two columns, as opposed to a worst case o(n) where n is the number of cells in the tree).
...And 2 more matches
preference - Archive of obsolete content
each preference element corresponds to a preference which is
stored in the user's preferences file.
...the file path will be
stored in the preferences.
...in pref dialogs with instantapply == true (default on mac os x) this value is kept in sync with the actual value
stored in the preferences (see valuefrompreferences).
...And 2 more matches
Index - Learn web development
here we look at why this is useful, then explore how to create an array, retrieve, add, and remove items
stored in an array, and more besides.
... 92 functions — reusable blocks of code api, article, beginner, browser, codingscripting, custom, functions, guide, javascript, learn, method, anonymous, invoke, l10n:priority, parameters another essential concept in coding is functions, which allow you to
store a piece of code that does a single task inside a defined block, and then call that code whenever you need it using a single short command — rather than having to type out the same code multiple times.
...data-* attributes allow us to
store extra information on standard, semantic html elements without other hacks such as non-standard attributes, extra properties on dom, or node.setuserdata().
...And 2 more matches
Test your skills: Math - Learn web development
add the first two variables together and
store the result in another variable.
... subtract the fourth variable from the third and
store the result in another variable.
...
store the result in a variable called evenoddresult.
...And 2 more matches
Useful string methods - Learn web development
a good way to do this is to: convert the whole of the string contained in the input variable to lower case and
store it in a new variable.
... grab the first letter of the string in this new variable and
store it in another variable.
...
store the result of this replace procedure in another new variable.
...And 2 more matches
Website security - Learn web development
a persistent xss vulnerability occurs when the malicious script is
stored on the website and then later redisplayed unmodified for other users to execute unwittingly.
... for example, a discussion board that accepts comments that contain unmodified html could
store a malicious script from an attacker.
...the browser of the user
stores this information and automatically includes it in all requests to the associated server.
...And 2 more matches
Performance
key points to keep in mind scripts registered during addon startup get executed during session re
store.
... frame scripts also get executed on non-re
stored tabs.
...
store heavyweight state once per process bad: // addon.js var main = new myaddonservice(); main.onchange(statechange); function statechange() { services.mm.broadcastasyncmessage("my-addon:update-configuration", {newconfig: main.serialize()}) } // framescript.js var maincopy; function onupdate(message) { maincopy = myaddonservice.deserialize(message.data.newconfig); } addmessagelistener("my...
...And 2 more matches
HTTP Cache
when there is no profile the new http cache works, but everything is
stored only in memory not obeying any particular limits.
... currently we have 3 types of storages, all the access methods return an nsicachestorage object: memory-only (memorycachestorage):
stores data only in a memory cache, data in this storage are never put to disk disk (diskcachestorage):
stores data on disk, but for existing entries also looks into the memory-only storage; when instructed via a special argument also primarily looks into application caches application cache (appcachestorage): when a consumer has a specific nsiapplicationcache (i.e.
... lifetime of a new entry such entry is initially empty (no data or meta data is
stored in it).
...And 2 more matches
JNI.jsm
return value this function has no return value, if you try to
store the return value in a variable, it will be undefined.
... return value this function has no return value, if you try to
store the return value in a variable, it will be undefined.
... return value this function has no return value, if you try to
store the return value in a variable, it will be undefined.
...And 2 more matches
An overview of NSS Internals
this strategy allows nss to work with many hardware devices (e.g., to speed up the calculations required for cryptographic operations, or to access smartcards that securely protect a secret key) and software modules (e.g., to allow to load such modules as a plugin that provides additional algorithms or
stores key or trust information) that implement the pkcs#11 interface.
... only nss is allowed to access and manipulate these database files directly; a programmer using nss must go through the apis offered by nss to manipulate the data
stored in these files.
... most of the time certificates and keys are supposed to be
stored in the nss database.
...And 2 more matches
FIPS Mode - an explanation
whether it is hardware or software, that device will have all the cryptographic engines in it, and also will
stores keys and perhaps certificates inside.
... it must generate or derive cryptographic keys and
store them internally.
... the user is only required to enter his master password to use his own private keys (if he has any) or to access his
stored web-site passwords.
...And 2 more matches
nss tech note1
this is where the decoder
stores its output.
...this information is
stored in the next lowest tag bit (number 5).
...it is
stored in the lower 5 tag bits (number 0 through 4).
...And 2 more matches
GCIntegration - SpiderMonkey Redirect 1
if there is a choice between storing a gc thing inside a c++ object or its js corresponding representation, prefer to
store it in the js representation.
... never
store gc things in a jsobject's private pointer (i.e., via js_setprivate()).
... it's better to
store them in reserved slots, since those will automatically be traced if the object is native.
...And 2 more matches
Garbage collection
instead, it must
store a wrapper for the other object.
... objects from different zones cannot be
stored in the same arena.
...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.
...And 2 more matches
Tracing JIT
the monitor then calls into the native code
stored in the fragment.
...a fragmento is a resource-management object that allocates and
stores a set of fragments and pages, and manages their lifecycle.
...a fragment's code is
stored in a set of associated pages and guardrecords allocated from the fragment's owning fragmento.
...And 2 more matches
JIT Optimization Strategies
unboxed property reads are possible on properties which satisfy all the characteristics of a definite slot, and additionally have been observed to only
store values of one kind of value.
... consider the following constructor: function point(x, y) { this.x = x; this.y = y; } if only integers are ever
stored in the x and y properties, then the instances of point will be represented in an "unboxed" mode - with the property values
stored as raw 4-byte values within the object.
...unboxed property writes are possible on properties which satisfy all the characteristics of a definite slot, and additionally have been observed to only
store values of one kind of value.
...And 2 more matches
JSPropertyOp
on entry, *vp contains the property's
stored value or undefined if the property doesn't have a
stored value.
...if the property has a
stored value, it is then updated to the value left in *vp after the callback.
...on success, the post-callback value of *vp becomes the initial
stored value of the new property.
...And 2 more matches
Shell global objects
when enabled, at every instruction a backtrace will be recorded and
stored in an array.
... disablespsprofiling() disables sps instrumentation islatin1(s) return true iff the string's characters are
stored as latin1.
... withsourcehook(hook, fun) set this js runtime's lazy source retrieval hook (that is, the hook used to find sources compiled with compileoptions::lazy_source) to hook; call fun with no arguments; and then re
store the runtime's original hook.
...And 2 more matches
Starting WebLock
the next set of functionality manages the white list where acceptable domains are
stored: void addsite(in string url); void removesite(in string url); attribute nsisimpleenumerator sites; operations in this set - add, remove, and enumerate - will be called from a user interface that manages the white list and adds the current website to the white list.
...this service, available as nsidirectoryservice,
stores the location of various common system locations, such as the the directory containing the running process, the user's home directory, and others.
... it can be expanded so that applications and components can define and
store their own special locations - an application plugin directory, for example, preference files and/or directories, or other application specific paths.
...And 2 more matches
XPCOM hashtable guide
a hashtable is a data construct that
stores a set of items.
...you can
store entries with keys 1, 5, and 3000).
... lookup time: o(1): lookup time is a simple constant o(1): lookup time is mostly-constant, but the constant time can be larger than an array lookup sorting: sorted:
stored sorted; iterated over in a sorted fashion.
...And 2 more matches
Components.utils.unwaiveXrays
it can then use unwaivexrays to re
store its xray vision for the object.
...the unwaivexrays operation undoes the operation, so xray vision is re
stored transitively as well.
... syntax xray = components.utils.unwaivexrays(obj); parameters obj the object for which we wish to re
store xrays.
...And 2 more matches
nsIMutableArray
weak whether or not to
store the element using a weak reference.
... clear() clear the entire array, releasing all
stored objects.
... weak whether or not to
store the element using a weak reference.
...And 2 more matches
XPCOM reference
in a big change from the original nsiabcard, properties are now
stored in a hash table instead of as attributes on the interface, allowing it to be more flexible.nsicookie2 mozilla 1 8 branchnsimsgsearchvaluedefined in comm-central/ mailnews/ base/ search/ public/ nsimsgsearchvalue.idl nsmsgmessageflagsthe nsmsgmessageflags interface describes possible flags for messages.
...it is only used to
store constants.
...it is only used to
store constants.
...And 2 more matches
PKCS #11 Netscape Trust Objects - Network Security Services
pkcs #11 is a standard that defines ways to
store certificates, keys and perform crypto operations.
... it does not specify a way to
store trust objects.
...this document outlines the way in which nss
stores trust objects via pkcs#11.
...And 2 more matches
AudioBuffer - Web APIs
if the audiobuffer has multiple channels, they are
stored in separate buffer.
... properties audiobuffer.samplerate read only returns a float representing the sample rate, in samples per second, of the pcm data
stored in the buffer.
... audiobuffer.length read only returns an integer representing the length, in sample-frames, of the pcm data
stored in the buffer.
...And 2 more matches
CanvasRenderingContext2D - Web APIs
the following methods help you to work with that state: canvasrenderingcontext2d.save() saves the current drawing style state using a stack so you can revert any change you make to it using re
store().
... canvasrenderingcontext2d.re
store() re
stores the drawing style state to the last element on the 'state stack' saved by save().
... webkit only canvasrenderingcontext2d.webkitbacking
storepixelratio the backing
store size in relation to the canvas element.
...And 2 more matches
Basic animations - Web APIs
re
store the canvas state if you've saved the state, re
store it before drawing a new frame.
...otate(((2 * math.pi) / 60) * time.getseconds() + ((2 * math.pi) / 60000) * time.getmilliseconds()); ctx.translate(105, 0); ctx.fillrect(0, -12, 40, 24); // shadow ctx.drawimage(earth, -12, -12); // moon ctx.save(); ctx.rotate(((2 * math.pi) / 6) * time.getseconds() + ((2 * math.pi) / 6000) * time.getmilliseconds()); ctx.translate(0, 28.5); ctx.drawimage(moon, -3.5, -3.5); ctx.re
store(); ctx.re
store(); ctx.beginpath(); ctx.arc(150, 150, 105, 0, math.pi * 2, false); // earth orbit ctx.stroke(); ctx.drawimage(sun, 0, 0, 300, 300); window.requestanimationframe(draw); } init(); <canvas id="canvas" width="300" height="300"></canvas> screenshotlive sample an animated clock this example draws an animated clock, showing your current time.
...tx.clearrect(0, 0, 150, 150); ctx.translate(75, 75); ctx.scale(0.4, 0.4); ctx.rotate(-math.pi / 2); ctx.strokestyle = 'black'; ctx.fillstyle = 'white'; ctx.linewidth = 8; ctx.linecap = 'round'; // hour marks ctx.save(); for (var i = 0; i < 12; i++) { ctx.beginpath(); ctx.rotate(math.pi / 6); ctx.moveto(100, 0); ctx.lineto(120, 0); ctx.stroke(); } ctx.re
store(); // minute marks ctx.save(); ctx.linewidth = 5; for (i = 0; i < 60; i++) { if (i % 5!= 0) { ctx.beginpath(); ctx.moveto(117, 0); ctx.lineto(120, 0); ctx.stroke(); } ctx.rotate(math.pi / 30); } ctx.re
store(); var sec = now.getseconds(); var min = now.getminutes(); var hr = now.gethours(); hr = hr >= 12 ?
...And 2 more matches
Credential Management API - Web APIs
the credential management api lets a website
store and retrieve user, federated, and public key credentials.
...to address these problems, the credential management api provides ways for a website to
store and retrieve different types of credentials.
...calls to get() and
store() within an <iframe> element will resolve without effect.
...And 2 more matches
IDBCursor.source - Web APIs
the source read-only property of the idbcursor interface returns the idbobject
store or idbindex that the cursor is iterating over.
... syntax var source = cursor.source; value the idbobject
store or idbindex that the cursor is iterating over.
... example in this simple fragment we create a transaction, retrieve an object
store, then use a cursor to iterate through all the records in the object
store.
...And 2 more matches
IDBCursorSync - Web APIs
operations are performed on the underlying index or object
store.
...setting this attribute can raise an idbdatabaseexception with the following codes: data_err if the underlying object
store uses in-line keys and the property at the key path does not match the key in this cursor's position.
... not_allowed_err if the underlying index or object
store does not support updating the record because it is open in the read_only or snapshot_read mode, or if an index record cannot be changed because the underlying index is auto-populated.
...And 2 more matches
Movement, orientation, and motion: A WebXR example - Web APIs
setup and utility functions next, we declare the variables and constants used throughout the application, starting with those used to
store webgl and webxr specific information: let polyfill = null; let xrsession = null; let xrinputsources = null; let xrreferencespace = null; let xrbutton = null; let gl = null; let animationframerequestid = 0; let shaderprogram = null; let programinfo = null; let buffers = null; let texture = null; let mouseyaw = 0; let mousepitch = 0; this is followed by a set of constants, mostly to contain vari...
...cubeorientation will
store the current orientation of the cube, while cubematrix and mousematrix are storage for matrices used during the rendering of the scene.
... next, we compile the shader programs; get references to its variables; initialize the buffers that
store the array of each position; the indexes into the position table for each vertex; the vertex normals; and the texture coordinates for each vertex.
...And 2 more matches
Web Authentication API - Web APIs
authenticator - the credentials are created and
stored in a device called an authenticator.
... this is a new concept in authentication: when authenticating using passwords, the password is
stored in a user's brain and no other device is needed; when authenticating using web authentication, the password is replaced with a key pair that is
stored in an authenticator.
...after the user verification, the authenticator will create a new asymmetric key pair and safely
store the private key for future reference.
...And 2 more matches
Window.sessionStorage - Web APIs
a page session lasts as long as the browser is open, and survives over page reloads and re
stores.
... data
stored in sessionstorage is specific to the protocol of the page.
... in particular, data
stored by a script on a site accessed with http (e.g., http://example.com) is put in a different sessionstorage object from the same site accessed with https (e.g., https://example.com).
...And 2 more matches
<input type="datetime-local"> - HTML: Hypertext Markup Language
the source for this interactive example is
stored in a github repository.
... </select> in either case, the date/time and time zone values would be submitted to the server as separate data points, and then you'd need to
store them appropriately in the database on the server-side.
... the y2k38 problem (often server-side) javascript uses double precision floating points to
store dates, as with all numbers, meaning that javascript code will not suffer from the y2k38 problem unless integer coercion/bit-hacks are used because all javascript bit operators use 32-bit signed 2s-complement integers.
...And 2 more matches
DataView.prototype.setBigInt64() - JavaScript
the setbigint64() method
stores a signed 64-bit integer (long long) value at the specified byte offset from the start of the dataview.
... the source for this interactive example is
stored in a github repository.
... syntax dataview.setbigint64(byteoffset, value [, littleendian]) parameters byteoffset the offset, in bytes, from the start of the view to
store the data from.
...And 2 more matches
DataView.prototype.setBigUint64() - JavaScript
the setbiguint64() method
stores an unsigned 64-bit integer (unsigned long long) value at the specified byte offset from the start of the dataview.
... the source for this interactive example is
stored in a github repository.
... syntax dataview.setbiguint64(byteoffset, value [, littleendian]) parameters byteoffset the offset, in bytes, from the start of the view to
store the data from.
...And 2 more matches
DataView.prototype.setFloat32() - JavaScript
the setfloat32() method
stores a signed 32-bit float (float) value at the specified byte offset from the start of the dataview.
... the source for this interactive example is
stored in a github repository.
... syntax dataview.setfloat32(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to
store the data.
...And 2 more matches
DataView.prototype.setFloat64() - JavaScript
the setfloat64() method
stores a signed 64-bit float (double) value at the specified byte offset from the start of the dataview.
... the source for this interactive example is
stored in a github repository.
... syntax dataview.setfloat64(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to
store the data.
...And 2 more matches
DataView.prototype.setInt16() - JavaScript
the setint16() method
stores a signed 16-bit integer (short) value at the specified byte offset from the start of the dataview.
... the source for this interactive example is
stored in a github repository.
... syntax dataview.setint16(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to
store the data.
...And 2 more matches
DataView.prototype.setInt32() - JavaScript
the setint32() method
stores a signed 32-bit integer (long) value at the specified byte offset from the start of the dataview.
... the source for this interactive example is
stored in a github repository.
... syntax dataview.setint32(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to
store the data.
...And 2 more matches
DataView.prototype.setUint16() - JavaScript
the setuint16() method
stores an unsigned 16-bit integer (unsigned short) value at the specified byte offset from the start of the dataview.
... the source for this interactive example is
stored in a github repository.
... syntax dataview.setuint16(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to
store the data.
...And 2 more matches
DataView.prototype.setUint32() - JavaScript
the setuint32() method
stores an unsigned 32-bit integer (unsigned long) value at the specified byte offset from the start of the dataview.
... the source for this interactive example is
stored in a github repository.
... syntax dataview.setuint32(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to
store the data.
...And 2 more matches
Digital audio concepts - Web media technologies
hich audio clips or samples may be remixed and then compressed; using lossless audio for the mastering process avoids compressing previously compressed data, resulting in additional quality loss factors that may recommend the use of lossy compression include: very large source audio constrained storage (either because the storage space is small, or because there's a large amount of sound to
store into it) a need to constrain the network bandwidth required to broadcast the audio; this is especially important for live streams and teleconferencing psychoacoustics 101 diving into the details of psychoacoustics and how audio compression works is far beyond the scope of this article, but it is useful to have a general idea of how audio gets compressed by common algorithms can help understan...
...thus, rather than storing every bit of each channel's sample, a base amplitude and a per-channel amplitude deviation value are
stored, wherein the deviation value may use fewer bits than a complete sample.
...then you
store the side channel value; this value is a number which can be added to the mid channel value to determine left channel's original amplitude, and subtracted from the mid channel value to compute the right channel's original value.
...And 2 more matches
Creating a Help Content Pack - Archive of obsolete content
this attribute marks the start point in the rdf graph described by the file, and the help viewer searches for this element in order to query for further information (
stored in child elements) about the content pack being parsed.
... the location of each of the glossary, index, and table of contents data sources is
stored in one rdf:description element contained within one rdf:li element, like so: <rdf:seq> <rdf:li> <rdf:description nc:panelid="glossary" nc:datasources="chrome://foo/locale/help/glossary.rdf"/> </rdf:li> <rdf:li> <rdf:description nc:panelid="toc" ...
... nc:platform (added in mozilla 1.8b2/firefox 1.1) when present specifies the platforms to which the information
stored in the referenced data sources applies.
...one possible source might be an online, dynamically-generated list of added content
stored on your web site.
Space Manager High Level Design - Archive of obsolete content
during reflow, the space manager
stores the space taken up by floats (updatespacemanager in nsblockframe) and provides information about the space available for other elements (getavailablespace in nsblockreflowstate).
... if the blockreflowstate already had a space manager instance associated with it, it is
stored off before being replaced, and the returned to the blockreflowstate instance after the new one has been destroyed.
...when done with the child, re
store the space managers coordinates by translating by the negative of the child block's origin.
... the blockreflowstate then
stores this available space rect for use in the rest of the reflow chain.
Template and Tree Listeners - Archive of obsolete content
the primary use of this listener is to
store some state before the template is rebuilt and re
store it afterwards.
...item: null, willrebuild : function(builder) { this.item = builder.getresourceatindex(builder.root.currentindex); }, didrebuild : function(builder) { if (this.item) { var idx = builder.getindexofresource(this.item) if (idx != -1) builder.root.view.selection.select(idx); } } }; tree.builder.addlistener(somelistener); this example is very simple and just saves and re
stores the selected index after a rebuild.
... since the content goes away during a rebuild, the selection is lost, so it is re
stored here during the didrebuild method.
...naturally, we can't
store the index as the item may have moved its position.
XUL element attributes - Archive of obsolete content
when the window is re-opened, the values of persistent attributes are re
stored.
... in mozilla, persistent attributes are
stored in the per-profile file xul
store.json.
... persistence can also be
stored using the document.persist function.
... natural the data is sorted in natural order, which means the order that it is
stored in.
tab - Archive of obsolete content
pending type: boolean this attribute is set to true if the tab is currently in the process of being re
stored by the session
store service.
... once the tab is re
stored, this attribute is removed.
... you can determine if a tab is being re
stored by checking to see if hasattribute("pending") is true.
...this would be useful if the images are
stored remotely or you plan on swapping the image frequently.
Debug - Archive of obsolete content
the debug object only works in internet explorer and windows 8 and windows phone 8.1
store apps.
... there are different ways to debug internet explorer and windows 8.x
store apps.
... in windows 8.x
store apps, the write and writeln functions of the debug object display strings in the visual studio output window at run time.
...also supported in
store apps (windows 8 and windows phone 8.1).
Desktop gamepad controls - Game development
buttons we will need a function that will do exactly that on every frame: function gamepadupdatehandler() { buttonspressed = []; if(controller.buttons) { for(var b=0; b<controller.buttons.length; b++) { if(controller.buttons[b].pressed) { buttonspressed.push(b); } } } } we first reset the buttonspressed array to get it ready to
store the latest info we'll write to it from the current frame.
... object, which contains useful variables and functions: var gamepadapi = { active: false, controller: {}, connect: function(event) {}, disconnect: function(event) {}, update: function() {}, buttons: { layout: [], cache: [], status: [], pressed: function(button, state) {} } axes: { status: [] } }; the controller variable
stores the information about the connected gamepad, and there's an active boolean variable we can use to know if the controller is connected or not.
... the pressed() function gets the input data and sets the information about it in our object, and the axes property
stores the array containing the values signifying the amount an axis is pressed in the x and y directions, represented by a float in the (-1, 1) range.
... after the gamepad is connected, the information about the controller is
stored in the object: connect: function(event) { gamepadapi.controller = event.gamepad; gamepadapi.active = true; }, the disconnect function removes the information from the object: disconnect: function(event) { delete gamepadapi.controller; gamepadapi.active = false; }, the update() function is executed in the update loop of the game on every frame, so it contains the latest information on the pressed buttons: update: function() { gamepadapi.buttons.cache = []; for(var k=0; k<gamepadapi.buttons.status.length; k++) { gamepadapi.buttons.cache[k] = gamepadapi.buttons.status[k]; } gamepadapi.buttons.status = []; var c = gamepadapi.controller || {}; var pressed = []; if(c.buttons) { ...
What is a web server? - Learn web development
on the hardware side, a web server is a computer that
stores web server software and a website's component files.
...an http server can be accessed through the domain names of the websites it
stores, and it delivers the content of these hosted websites to the end user's device.
... hosting files first, a web server has to
store the website's files, namely all html documents and their related assets, including images, css stylesheets, javascript files, fonts, and video.
... technically, you could host all those files on your own computer, but it's far more convenient to
store files all on a dedicated web server because: a dedicated web server is typically more available.
Using data attributes - Learn web development
data-* attributes allow us to
store extra information on standard, semantic html elements without other hacks such as non-standard attributes, extra properties on dom, or node.setuserdata().
...say you have an article and you want to
store some extra information that doesn’t have any visual representation.
... data attributes can also be
stored to contain information that is constantly changing, like scores in a game.
... issues do not
store content that should be visible and accessible in data attributes, because assistive technology may not access them.
Video and audio content - Learn web development
they define a structure in which the audio and/or video tracks that make up the media are
stored, along with metadata describing the media, what codecs are used to encode its channels, and so forth.
...for example, for some types of audio, a codec's data is often
stored without a container, or with a simplified container.
... one such instance is the flac codec, which is
stored most commonly in flac files, which are just raw flac tracks.
...an "mp3 file" is actually an mpeg-1 audio layer iii (mp3) audio track
stored within an mpeg or mpeg-2 container.
Graceful asynchronous programming with Promises - Learn web development
next, we call our function three times to begin the process of fetching and decoding the images and text and
store each of the returned promises in a variable.
... add the following below your previous code: let coffee = fetchanddecode('coffee.jpg', 'blob'); let tea = fetchanddecode('tea.jpg', 'blob'); let description = fetchanddecode('description.txt', 'text'); next, we will define a promise.all() block to run some code only when all three of the promises
stored above have successfully fulfilled.
...here we use some fairly simple sync code to
store the results in separate variables (creating object urls from the blobs), then display the images and text on the page.
... console.log(values); //
store each value returned from the promises in separate variables; create object urls from the blobs let objecturl1 = url.createobjecturl(values[0]); let objecturl2 = url.createobjecturl(values[1]); let desctext = values[2]; // display the images in <img> elements let image1 = document.createelement('img'); let image2 = document.createelement('img'); image1.src = objecturl1; image2.src = objecturl2; document.body.appendchild(image1); document.body.appendchild(image2); // display the text in a paragraph let para = document.createelement('p'); para.textcontent = desctext; document.body.appendchild(para); save and refresh and you should see your ui components all loaded, albeit in a not particularly attractive way!
Test your skills: Conditionals - Learn web development
response — begins uninitialized, but is later used to
store a reponse that will be printed to the output panel.
... response — begins uninitialized, but is later used to
store a reponse that will be printed to the output panel.
... machineresult — begins uninitialized, but is later used to
store a reponse that will be printed to the output panel, letting the user know whether the machine is switched on.
... pwdresult — begins uninitialized, but is later used to
store a reponse that will be printed to the output panel, letting the user know whether their login attempt was succcessful.
Test your skills: Strings - Learn web development
we would like you to: retrieve the length of the quote, and
store it in a variable called quotelength.
... find the index position where substring appears in quote, and
store that value in a variable called index.
... use a combination of the variables you have and available string properties/methods to trim down the original quote to "i do not like green eggs and ham.", and
store it in a variable called revisedquote.
...
store the new quote in a variable called fixedquote.
Object-oriented JavaScript for beginners - Learn web development
object data (and often, functions too) can be
stored neatly (the official word is encapsulated) inside an object package (which can be given a specific name to refer to, which is sometimes called a namespace), making it easy to structure and access; objects are also commonly used as data
stores that can be easily sent across the network.
...you can now see that we have two new objects on the page, each of which is
stored under a different namespace — when you access their properties and methods, you have to start calls with person1 or person2; the functionality contained within is neatly packaged away so it won't clash with other functionality.
... let's look at the constructor calls again: let person1 = new person('bob'); let person2 = new person('sarah'); in each case, the new keyword is used to tell the browser we want to create a new object instance, followed by the function name with its required parameters contained in parentheses, and the result is
stored in a variable — very similar to how a standard function is called.
... try entering this into your browser's javascript console: let person1 = new object(); this
stores an empty object in the person1 variable.
Client-Server Overview - Learn web development
the server for a static site will only ever need to process get requests, because the server doesn't
store any modifiable data.
...using the example of a product site, the server would
store product "data" in a database rather than individual html files.
...this has major advantages over a static site: using a database allows the product information to be
stored efficiently in an easily extensible, modifiable, and searchable way.
...the structure of our data is defined in models, which are python classes that define the fields to be
stored in the underlying database.
Package management basics - Learn web development
the package manager will provide a method to install new dependencies (also referred to as "packages"), manage where packages are
stored on your file system, and offer capabilities for you to publish your own packages.
... in theory you may not need a package manager and you could manually download and
store your project dependencies, but a package manager will seamlessly handle installing and uninstalling packages.
... setting up the app as an npm package first of all, create a new directory to
store our experimental app in, somewhere sensible that you’ll find again.
... in addition, the npm (and yarn) commands are clever in that they will search for command line tools that are locally installed to the project before trying to find them through conventional methods (where your computer will normally
store and allow software to be found).
Creating Sandboxed HTTP Connections
setting up an http connection the first step in setting up an http connection from an url (
stored in a string) is to create an nsiuri out of it.
... since nsistreamlistener does not cover cookies, the current channel being used will need to be
stored as a global, since another listener will be used for cookie notifications (covered in the next section).
...; }, onstoprequest: function (arequest, acontext, astatus) { if (components.issuccesscode(astatus)) { // request was successfull this.mcallbackfunc(this.mdata); } else { // request failed this.mcallbackfunc(null); } gchannel = null; }, // nsichanneleventsink onchannelredirect: function (aoldchannel, anewchannel, aflags) { // if redirecting,
store the new channel gchannel = anewchannel; }, // nsiinterfacerequestor getinterface: function (aiid) { try { return this.queryinterface(aiid); } catch (e) { throw components.results.ns_nointerface; } }, // nsiprogresseventsink (not implementing will cause annoying exceptions) onprogress : function (arequest, acontext, aprogress, aprogressmax) { }, onstatus...
...since the channel that causes the notification is passed in as the first argument, comparing it to the globally
stored channel (gchannel) in the previous section (which also gets updated each time a redirect happens).
Webapps.jsm
s: function sanitizeredirects(asource) _savewidgetsfullpath: function(amanifest, adestapp) appkind: function(aapp, amanifest) updatepermissionsforapp: function(aid, aispreinstalled) updateofflinecacheforapp: function(aid) installpreinstalledapp: function installpreinstalledapp(aid) removeifhttpsduplicate: function(aid) installsystemapps: function() loadandupdateapps: function() updatedata
store: function(aid, aorigin, amanifesturl, amanifest) _registersystemmessagesforentrypoint: function(amanifest, aapp, aentrypoint) _registerinterappconnectionsforentrypoint: function(amanifest, aapp,) _registersystemmessages: function(amanifest, aapp) _registerinterappconnections: function(amanifest, aapp) _createactivitie
storegister: function(amanifest, aapp, aentrypoint, arunupdate) _registera...
...ctivitiesforapps: function(aapp
storegister, arunupdate) _registeractivities: function(amanifest, aapp, arunupdate) _createactivitiestounregister: function(amanifest, aapp, aentrypoint) _unregisteractivitiesforapps: function(aappstounregister) _unregisteractivities: function(amanifest, aapp) _processmanifestforids: function(aids, arunupdate) observe: function(asubject, atopic, adata) addmessagelistener: function(amsgnames, aapp, amm) removemessagelistener: function(amsgnames, amm) formatmessage: function(adata) receivemessage: function(amessage) getappinfo: function getappinfo(aappid) broadcastmessage: function broadcastmessage(amsgname, acontent) registerupdatehandler: function(ahandler) unregisterupdatehandler: function(ahandler) notifyupdatehandlers: function(aapp, amanifest, a...
..., amanifesturl, azipfile, acertdb) _readpackage: function(aoldapp, anewapp, aislocalfileinstall, aisupdate,) _checksignature: function(aapp, aissigned, aislocalfileinstall) _saveetag: function(aisupdate, aoldapp, arequestchannel, ahash, amanifest) _checkorigin: function(aissigned, aoldapp, amanifest, aisupdate) _getids: function(aissigned, azipreader, aconverter, anewapp, aoldapp,) _checkfor
storeidmatch: function(aisupdate, anewapp, a
storeid, a
storeversion) revertdownloadpackage: function(aid, aoldapp, anewapp, aisupdate, aerror) uninstall: function(amanifesturl) _promptforuninstall: function(adata) confirmuninstall: function(adata) denyuninstall: function(adata, areason = "error_unknown_failure") getself: function(adata, amm) checkinstalled: function(adata, amm) getinstalled: fun...
...t: function(adata, amm) removereceipt: function(adata, amm) replacereceipt: function(adata, amm) setenabled: function(adata) getmanifestfor: function(amanifesturl, aentrypoint) getappbymanifesturl: function(amanifesturl) getfullappbymanifesturl: function(amanifesturl, aentrypoint, alang) getmanifestcspbylocalid: function(alocalid) getdefaultcspbylocalid: function(alocalid) getapplocalidby
storeid: function(a
storeid) getappbylocalid: function(alocalid) getmanifesturlbylocalid: function(alocalid) getapplocalidbymanifesturl: function(amanifesturl) getcoreappsbasepath: function() getwebappsbasepath: function() _islaunchable: function(aapp) _notifycategoryandobservers: function(subject, topic, data, msg) registerbrowserelementparentforapp: function(amsg, amn) receiveappmessage: fun...
PR_dtoa
decpt a pointer to a memory location where the runtime will
store the offset, relative to the beginning of the output string, of the conversion's decimal point.
... sign a location where the runtime can
store an indication that the conversion was of a negative value.
... buf the address of the buffer in which to
store the result.
... results the principle output is the null-terminated string
stored in buf.
NSS_3.12_release_notes.html
bug 395093: pkix_pl_httpcert
store_processcertresponse is unable to process certs in der format bug 395224: don't reject certs with critical netscapecerttype extensions in libpkix bug 395427: pkix_pl_initialize must not call nss_init bug 395850: build of libpkix tests creates links to nonexistant shared libraries and breaks windows build bug 398401: memory leak in pkix init.
...bug 217538: softoken databases cannot be shared between multiple processes bug 294531: design new interfaces for certificate path building and verification for libpkix bug 326482: nss ecc performance problems (intel) bug 391296: need an update helper for shared databases bug 395090: remove duplication of pkcs7 code from pkix_pl_httpcert
store.c bug 401026: need to provide a way to modify and create new pkcs #11 objects.
... self issued, trusted cert bug 390728: pkix_pl_ocsprequest_create throws an error if it was not able to get aia location bug 397825: libpkix: ifdef code that uses user object types bug 397832: libpkix leaks memory if a macro calls a function that returns an error bug 402727: functions responsible for creating an object leak if subsequent function code produces an error bug 402731: pkix_pl_pk11cert
store_crlquery will crash if fails to acquire dp cache.
... bug 406647: libpkix does not use user defined revocation checkers bug 407064: pkix_pl_ldapcert
store_buildcrllist should not fail if a crl fails to be decoded bug 421216: libpkix test nss_thread leaks a test certificate bug 301259: signtool usage message is unhelpful bug 389781: nss should be built size-optimized in browser builds on linux, windows, and mac bug 90426: use of obsolete typedefs in public nss headers bug 113323: the first argument to pk11_findcertfromnickname should be const.
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
"-b <headerfilename> -i <ipfilename> | ", "-b <headerfilename> -i <ipfilename> | ", "-b <headerfilename> -e <encryptfilename> -o <opfilename> \n"); fprintf(stderr, "commands:\n\n"); fprintf(stderr, "%s %s\n --for generating cert request (for ca also)\n\n", progname, "-g -s <subject> -r <csr>"); fprintf(stderr, "%s %s\n --to input and
store cert (for ca also)\n\n", progname, "-a -n <nickname> -t <trust> -c <cert> [ -r <csr> -u <issuernickname> [-x <\"\">] -m <serialnumber> ]"); fprintf(stderr, "%s %s\n --to put cert in header\n\n", progname, "-h -n <nickname> -b <headerfilename> [-v <\"\">]"); fprintf(stderr, "%s %s\n --to find public key from cert in header and encrypt\n\n", progn...
... * reads cert request file and
stores certificate in db.
... * input,
store and trust ca certificate.
...input and
store a cert in cert db and also used to input,
store and trust ca cert.
sample2
"-b <headerfilename> -i <ipfilename> -e <encryptfilename> | ", "-b <headerfilename> -i <ipfilename> | ", "-b <headerfilename> -i <ipfilename> | ", "-b <headerfilename> -e <encryptfilename> -o <opfilename> \n"); fprintf(stderr, "commands:\n\n"); fprintf(stderr, "%s %s\n --for generating cert request (for ca also)\n\n", progname, "-g -s <subject> -r <csr>"); fprintf(stderr, "%s %s\n --to input and
store cert (for ca also)\n\n", progname, "-a -n <nickname> -t <trust> -c <cert> [ -r <csr> -u <issuernickname> [-x <\"\">] -m <serialnumber> ]"); fprintf(stderr, "%s %s\n --to put cert in header\n\n", progname, "-h -n <nickname> -b <headerfilename> [-v <\"\">]"); fprintf(stderr, "%s %s\n --to find public key from cert in header and encrypt\n\n", progname, "-e -b <headerfilename> -i <ipfilename> -e <enc...
...* reads cert request file and
stores certificate in db.
... * input,
store and trust ca certificate.
...input and
store a cert in cert db and also used to input,
store and trust ca cert.
nss tech note5
to move keys to the desired slot, see section moving a key from one slot to another <big>secstatus s = pk11_wrapsymkey(wrapmech, secparam, wrappingsymkey, tobewrappedsymkey, &wrappedkey);</big> <big><big>transport/
store or do whatever with the wrapped key (wrappedkey.data, wrappedkey.len)</big></big> <big><big>unwrapping.
...to move keys to the desired slot, see section moving a key from one slot to another <big>secstatus s = pk11_wrapprivkey(slot, wrappingsymkey, tobewrappedpvtkey, wrapmech, secparam, &wrappedkey, null);</big> <big><big>transport/
store or do whatever with the wrapped key (wrappedkey.data, wrappedkey.len)</big></big> <big><big>unwrapping.</big></big> prepare the args for the unwrap function.
...to move keys to the desired slot, see section moving a key from one slot to another <big>secstatus s = pk11_pubwrapsymkey(wrapmech, wrappingpubkey, tobewrappedsymkey, &wrappedkey);</big> <big><big>transport/
store or do whatever with the wrapped key (wrappedkey.data, wrappedkey.len)</big></big> <big><big>unwrapping.
... generate a symmetric key subsequent to the operation, the symmetric key may need to be transported/
stored in wrapped or raw form.
FC_SetOperationState
name fc_setoperationstate - re
store the cryptographic operation state of a session.
...hencryptionkey [in] handle of the encryption or decryption key to be used in in a
stored session or zero if no key is needed.
... hauthenticationkey [in] handle of the authentication key to be used in the
stored session or zero if none is needed.
... description fc_setoperationstate re
stores the cryptographic operations state of a session from an array of bytes obtained with fc_getoperationstate.
NSS tools : modutil
this directory should be one below which it is appropriate to
store dynamic library files, such as a server's root directory.
... o with the -changepw command, the password on the nss internal module cannot be set or changed, since this password is
stored in the key database.
... "./pk11inst.dir/setup.sh" executed successfully installed module "example pkcs #11 module" into module database installation completed successfully adding module spec each module has information
stored in the security database about its configuration and parameters.
... nss database types nss originally used berkeleydb databases to
store security information.
NSS tools : modutil
this directory should be one below which it is appropriate to
store dynamic library files, such as a server's root directory.
... o with the -changepw command, the password on the nss internal module cannot be set or changed, since this password is
stored in the key database.
... "./pk11inst.dir/setup.sh" executed successfully installed module "example pkcs #11 module" into module database installation completed successfully adding module spec each module has information
stored in the security database about its configuration and parameters.
... nss database types nss originally used berkeleydb databases to
store security information.
JIT Optimization Outcomes
notfixedslot the property being accessed is not
stored at a known location in the object.
... this can occur if one of the expected types of objects to be used in this operation has unknown properties, or if different instances of the object
store the property at different locations (for example, some instances have the property assigned in a different order than others).
... inconsistentfixedslot the property being accessed is not
stored at a known location in the object.
... notobject optimization failed because the
stored in the property could potentially be a non-object value.
JS_ExecuteRegExp
test bool pass true to avoid creating match result array and
store boolean value to rval.
... if test is false, js_executeregexp and js_newregexpobjectnostatics
store the match result array to *rval if matches, otherwise
stores null to *rval.
... if test is true, js_executeregexp and js_newregexpobjectnostatics
store the boolean value true to *rval if matches, otherwise
stores null to *rval.
... if successful, js_executeregexp and js_newregexpobjectnostatics returns true and
stores the result to *rval, otherwise returns false and the value of *rval is undefined see also mxr id search for js_executeregexp mxr id search for js_executeregexpnostatics regexp bug 571355 - added js_executeregexpnostatics function ...
JS_GetReservedSlot
v js::value (in js_setreservedslot) the value to
store.
... description if a jsclass has jsclass_has_reserved_slots(n) in its flags, with n > 0, or has a non-null jsclass.reserveslots callback, then objects of that class have n reserved slots in which the application may
store data.
... reserved slots may also contain private values to
store pointer values (whose lowest bit is 0) or uint32_t, when non-javascript values must be
stored; the garbage collector ignores such values when it sees them.
...it's only legal to
store and retrieve data from private values.
JS_SaveFrameChain
saves and re
stores frame chains.
... syntax bool js_saveframechain(jscontext *cx); void js_re
storeframechain(jscontext *cx); name type description cx jscontext * the context to query.
...before calling js_re
storeframechain, cx's call stack must be balanced and all nested calls to js_saveframechain must have had matching js_re
storeframechain calls.
...see also mxr id search for js_saveframechain mxr id search for js_re
storeframechain ...
JSAPI reference
25 js::currentglobalornull added in spidermonkey 31 js_getglobalforscopechain obsolete since jsapi 25 js_getglobalobject obsolete since jsapi 24 js_setglobalobject obsolete since jsapi 25 js_initclass js_initstandardclasses js_resolvestandardclass js_enumeratestandardclasses js_enumerateresolvedstandardclasses obsolete since jsapi 24 js_isrunning js_saveframechain js_re
storeframechain js_isassigning obsolete since javascript 1.8.5 js_isconstructing obsolete since jsapi 26 js_isconstructing_possiblywithgiventhisobject obsolete since jsapi 17 js_getscopechain obsolete since javascript 1.8.7 compartments: class jsautocompartment added in spidermonkey 24 js_newglobalobject added in spidermonkey 17 js_entercompartment added in spidermonkey 24 js_leavecomp...
...trict_mode_error the following functions allow c/c++ functions to throw and catch javascript exceptions: js::createerror added in spidermonkey 38 js_isexceptionpending js_getpendingexception js_setpendingexception js_clearpendingexception js_throwstopiteration added in spidermonkey 1.8 js_isstopiteration added in spidermonkey 31 typedef jsexceptionstate js_saveexceptionstate js_re
storeexceptionstate js_dropexceptionstate these functions translate errors into exceptions and vice versa: js_reportpendingexception js_errorfromexception js_throwreportederror obsolete since jsapi 29 values and types typedef jsval js::value js::value constructors: js::nullvalue added in spidermonkey 24 js::undefinedvalue added in spidermonkey 24 js::booleanvalue added in spid...
...they have been removed in js 1.8.5, though js_enterlocalrootscope obsolete since javascript 1.8.5 js_leavelocalrootscope obsolete since javascript 1.8.5 js_leavelocalrootscopewithresult obsolete since javascript 1.8.5 js_forgetlocalroot obsolete since javascript 1.8.5 added in spidermonkey 1.8 if an object contains references to other gc things that are not
stored in spidermonkey data structures ("slots"), it must implement the jstraceop hook to enable the garbage collector to traverse those references.
...ng js_internucstringn js_internjsstring added in spidermonkey 1.8.5 js_stringhasbeeninterned added in spidermonkey 17 js_getlatin1internedstringchars added in spidermonkey 38 js_gettwobyteinternedstringchars added in spidermonkey 38 js_getinternedstringchars obsolete since jsapi 33 js_getinternedstringcharsandlength obsolete since jsapi 33 the character data for external strings is
stored in memory provided by the application.
SpiderMonkey 1.8.5
since jsdoubles are now
stored in the jsval, instead of on the heap, we no longer need to define roots for them.
...jsapi no longer represents floating-point numbers (and integers more than 31 bits long) as pointers to jsdouble; instead, the jsdouble value is directly
stored in the jsval.
... numbers spidermonkey 1.8.5 now
stores integers up to 32-bits in the jsval.
...the jsval now also
stores jsdoubles directly, rather than storing them on the heap.
SpiderMonkey 1.8.7
since jsdoubles are now
stored in the jsval, instead of on the heap, we no longer need to define roots for them.
...jsapi no longer represents floating-point numbers (and integers more than 31 bits long) as pointers to jsdouble; instead, the jsdouble value is directly
stored in the jsval.
... numbers spidermonkey 1.8.5 now
stores integers up to 32-bits in the jsval.
... the jsval now also
stores jsdoubles directly, rather than storing them on the heap.
Redis Tips
for example, if you have a job queueing system, you might want redis to manage the queues themselves, and
store pointers for the job data which might be retrieved by workers from some different, disk-resident db.
...as a conservative calculation, i multiply all the bytes i think i might
store and multiply by 10, which antirez once recommended as a worst-case factor for data structure overhead.
... if i ever have more values to
store per email than just the password, i could use a hash, with a key like ptu:identity:<email>.
... in the case where you want to do something akin to a join, like, say, associate an email and a remote url to
store a browserid assertion, just make a new key.
Mork
a minus before the table id indicates that all the rows currently
stored in the table should be removed before adding more rows.
...where integer data is used, the convention is to use and
store the hexadecimal value for the output.
... aliases are how dictionary values are
stored.
...all data
stored internally will be destroyed when the morkreader goes out of scope.
Places Developer Guide
the bookmarks data
store is hierarchical, modeling folders and their contents.
... backup/re
store the new bookmarks system uses the json format for storing backups of users' bookmarks.
.../ import placesutils cu.import("resource://gre/modules/placesutils.jsm"); cu.import("resource://gre/modules/services.jsm"); // create the backup file var jsonfile = services.dirsvc.get("profd", ci.nsilocalfile); jsonfile.append("bookmarks.json"); jsonfile.create(ci.nsilocalfile.normal_file_type, 0600); // export bookmarks in json format to file placesutils.backupbookmarkstofile(jsonfile); // re
store bookmarks from the json file // note: this *overwrites* all pre-existing bookmarks placesutils.re
storebookmarksfromjsonfile(jsonfile); history the toolkit history service is nsinavhistoryservice: var history = cc["@mozilla.org/browser/nav-history-service;1"] .getservice(ci.nsinavhistoryservice); the history service provides methods for adding, editing, deleting browser history.
... annotations annotations provide a way to
store small bits of arbitrary data for a uri or a bookmark: // get the annotation service var annotations = cc["@mozilla.org/browser/annotation-service;1"] .getservice(ci.nsiannotationservice); // create a uri to annotate var ioservice = cc["@mozilla.org/network/io-service;1"] .getservice(ci.nsiioservice); var myuri = ioservice.newuri("http://www.mozilla.com", null, n...
XPCOM array guide
will your array
store non-refcounted objects and need automatic resizing?
... will your array
store non-refcounted objects and be a fixed size?
... usage it is most often used as a member of a c++ class to
store a list of well-typed xpcom objects.
... usage it is most often used as a member of a c++ class to
store a list of well-typed objects.
Creating the Component Code
component registration all xpcom components - whether they're
stored in shared libraries (dlls, dsos, dylibs), javascript files, or otherwise - need to be registered before they can be used.
...this parameter is useful when the component needs to know where it has been installed or registered - as, for example, when other files must be
stored or accessed relative to the component.
...a single zip archive may
store several xpcom components, where every component in the archive has the same nsifile parameter but the aloaderstr parameter can be used to refer to the location within the zip archive.
...-------- extern "c" ns_export nsresult nsgetmodule(nsicomponentmanager *servmgr, nsifile* location, nsimodule** return_cobj) { nsresult rv = ns_ok; // create and initialize the module instance samplemodule *m = new samplemodule(); if (!m) { return ns_error_out_of_memory; } // increase refcnt and
store away nsimodule interface to m in return_cobj rv = m->queryinterface(kimoduleiid, (void**)return_cobj); if (ns_failed(rv)) { delete m; } return rv; } note: non-null-out the createinstance method guarantees that if the out variable is non-null, it is valid.
nsIMicrosummaryService
in the old rdf-based bookmarks data
store, bookmark ids are nsirdfresource objects.
... in the new places-based data
store, they are nsiuri objects.
...if the caller passes a bookmark id, and one of the microsummaries is the current one for the bookmark, this method will retrieve content from the data
store for that microsummary, which is useful when callers want to display a list of microsummaries for a page that isn't loaded, and they want to display the actual content of the selected microsummary immediately (rather than after the content is asynchronously loaded).
...refreshmicrosummary() refreshes a microsummary, updating its value in the data
store and ui.
nsIMsgDBHdr
messageoffset unsigned long indicates the position of the offline copy of an imap or news messages within the offline
store.
... folder nsimsgfolder readonly: indicates the folder in which this message is
stored.
...usually you would use this to
store your own properties.
...thunderbird
stored uint32 properties (not a complete list): indexed used for spotlight integration on osx.
nsINavHistoryService
many types of uris, such as "chrome:" uris, are not
stored when adduri is called.
...this will probably not be commonly used other than for backup/re
store type operations.
... getcharsetforuri() gets the
stored character-set for an uri.
... void getcharsetforuri( in nsiuri auri ); parameters auri uri to retrieve character-set for returns returns the character-set, empty string if not found setcharsetforuri() gets the
stored character-set for an uri.
nsIPermissionManager
the nsipermissionmanager interface is used to persistently
store permissions for different object types (cookies, images, and so on) on a site-by-site basis.
...ri uri, in string type); pruint32 testexactpermissionfromprincipal(in nsiprincipal principal, in string type); pruint32 testpermission(in nsiuri uri, in string type); pruint32 testpermissionfromprincipal(in nsiprincipal principal, in string type); attributes attribute type description enumerator nsisimpleenumerator enumerates all
stored permissions.
... removepermission() remove a given permission from the
stored permissions.
...permission information
stored after this timestamp will be removed.
Component; nsIPrefBranch
note: the preferences system is not designed to
store large amounts of data: all preferences are
stored in a single file, which is read at the application startup.
... if you find yourself wondering what is the maximum amount of data you can
store in a string preference, consider storing data separately, for example in a flat file or an sqlite database.
... note: the preferences system is not designed to
store large amounts of data: all preferences are
stored in a single file, which is read at the application startup.
... if you find yourself wondering what is the maximum amount of data you can
store in a string preference, consider storing data separately, for example in a flat file or an sqlite database.
Using nsIPasswordManager
working with password manager extensions often need to securely
store passwords to external sites, web applications, and so on.
...getting nsipasswordmanager to get a component implementing nsipasswordmanager, use the following: var passwordmanager = components.classes["@mozilla.org/passwordmanager;1"] .getservice(components.interfaces.nsipasswordmanager); storing a password to
store a password in the password manager, you need three things: a hostname/url (you'll need this to retrieve the password again later), a username, and a password.
... of this information, the password is the only data that will be
stored securely.
... adding a password to the password manager is easy: passwordmanager.adduser('host', 'username', 'password'); since there's no provision to include names of html input fields, no password
stored by this interface will be used to fill in passwords on web pages.
Address Book examples
the code
stores uris in various places (e.g.
... let card = collection.getcardfromproperty("jobtitle", "software engineer", false); if you are searching for a card with a particular email address, you can use the cardforemailaddress function that will match against multiple email addresses
stored in one card.
... adding a mailing list first create a mailing list object and initialize it: var maillist = components.classes["@mozilla.org/addressbook/directoryproperty;1"] .createinstance(components.interfaces.nsiabdirectory); maillist.ismaillist = true; now fill in the details you want to
store: maillist.dirname = "my mailing list"; maillist.listnickname = "nickname for list"; maillist.description = "list description"; add the cards you want to include in the list: for (let i = 0; i < numcards; i++) maillist.addresslists.appendelement(card[i], false); now save the list: var parentdirectory = ...; // an nsiabdirectory for the parent of the mailing list.
...a mork based local
store or a os x address book ldap - use for searching in ldap address books.
Using the Multiple Accounts API
incoming servers (nsimsgincomingserver): an incoming server represents a remote message
store such as a pop, imap, or nntp server.
... in the above example, the list of identities would be as follows: alec flett <alecf@mywork.com>) alec flett <alecf@myisp.com>) alec flett <alecfnospam@myisp.com>) relevant api calls: nsimsgaccount.identities nsimsgaccountmanager.allservers: a list of all servers across all accounts storage the accounts are
stored in the preferences.
... 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.
...- boolean, should we download new messags on biff (true) or just alert user that there is new mail (false) preference: mail.server.server.directory - local platform-specific path to
store messages and folder indexes preference: mail.server.server.name - user-visible name of server the following are specific to imap: preference: mail.server.server.admin_url - administration url for server preference: mail.server.server.using_subscription - boolean, should we use subscriptions?
Mozilla
creating a login manager storage module the login manager manages and
stores user passwords.
... firefox operational information database: sqlite a large amount of operational information about websites visited and browser configuration is
stored in relational databases in sqlite used by firefox.
... preferences the preference system makes it possible to
store data for mozilla applications using a key/value pairing system.
... profile manager firefox and other xulrunner applications
store user settings and data in special folders, called profiles.
Streams - Plugins
if the stream is not seekable, these requests are fulfilled only when all the data has been read and
stored in the cache.
...the plug-in can
store private data associated with the stream in stream->pdata.
... the browser
stores private data in stream->ndata; this value should not be changed by the plug-in.
...if the stream is not seekable, these requests are fulfilled only when all the data has been read and
stored in the cache.
Debugger.Memory - Firefox Developer Tools
this accessor can be both fetched and
stored to.
... debugger.memory handler functions similar to debugger’s handler functions, debugger.memory inherits accessor properties that
store handler functions for spidermonkey to call when given events occur in debuggee code.
...known values include the following: “api” “eager_alloc_trigger” “destroy_runtime” “last_ditch” “too_much_malloc” “alloc_trigger” “debug_gc” “compartment_revived” “reset” “out_of_nursery” “evict_nursery” “full_
store_buffer” “shared_memory_limit” “periodic_full_gc” “incremental_too_slow” “dom_window_utils” “component_utils” “mem_pressure” “cc_waiting” “cc_forced” “load_end” “page_hide” “nsjscontext_destroy” “set_new_document” “set_doc_shell” “dom_utils” “dom_ipc” “dom_worker” “inter_slice_gc�...
...to take advantage of this regularity, spidermonkey objects with identical sets of properties may share their property metadata; only property values are
stored directly in the object.
EventTarget.addEventListener() - Web APIs
(hence they too can have properties, and will be retained in memory even after they finish executing if assigned to a variable that persists in memory.) because object properties can be used to
store data in memory as long as a variable referencing the object exists in memory, you can actually use them to get data into an event listener, and any changes to the data back out after an event handler executes.
... note: objects are
stored in variables by reference, meaning only the memory location of the actual data is
stored in the variable.
... among other things, this means variables that "
store" objects can actually affect other variables that get assigned ("
store") the same object reference.
... note: because objects are
stored in variables by reference, you can return an object from a function to keep it alive (preserve it in memory so you don't lose the data) after that function stops executing.
IDBCursor.direction - Web APIs
the direction read-only property of the idbcursor interface is a domstring that returns the direction of traversal of the cursor (set using idbobject
store.opencursor for example).
... 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.
...we specify the direction of travel using the 2nd argument of idbobject
store.opencursor.
...for a complete working example, see our idbcursor example (view example live.) function backwards() { list.innerhtml = ''; var transaction = db.transaction(['rushalbumlist'], 'readonly'); var object
store = transaction.object
store('rushalbumlist'); object
store.opencursor(null,'prev').onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.albumtitle + '</strong>, ' + cursor.value.year; list.appendchild(listitem); console.log(cursor.direction...
IDBCursorWithValue - Web APIs
the cursor has a source that indicates which index or object
store it is iterating over.
...operations are performed on the underlying index or object
store.
... example in this example we create a transaction, retrieve an object
store, then use a cursor to iterate through all the records in the object
store.
...for a complete working example, see our idbcursor example (view example live.) function displaydata() { var transaction = db.transaction(['rushalbumlist'], "readonly"); var object
store = transaction.object
store('rushalbumlist'); object
store.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = cursor.value.albumtitle + ', ' + cursor.value.year; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displaye...
IDBDatabase: error event - Web APIs
or examples this example opens a database and tries to add a record, listening for the error event for the add() operation (this will occur if, for example, a record with the given tasktitle already exists): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an object
store for this database const object
store = db.createobject
store('todolist', { keypath: 'tasktitle' }); // define what data items the object
store will contain object
store.createindex('hours', 'hours', { unique: false }); object
store.createindex('minutes', 'minutes', { unique: false }); object
store.createindex('day', 'day', { unique: false }); object
store.createindex('month', 'month', { uni...
...que: false }); object
store.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2020 }; const db = dbopenrequest.result; db.addeventlistener('error', () => { console.log(`error adding new item: ${newitem.tasktitle}`); }); // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); const object
store = transaction.object
store('todolist'); const object
storerequest = object
store.add(newitem); }; the same example, using the onerror property instead of addeventlistener(): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgraden...
...eeded = (event) => { const db = event.target.result; // create an object
store for this database const object
store = db.createobject
store('todolist', { keypath: 'tasktitle' }); // define what data items the object
store will contain object
store.createindex('hours', 'hours', { unique: false }); object
store.createindex('minutes', 'minutes', { unique: false }); object
store.createindex('day', 'day', { unique: false }); object
store.createindex('month', 'month', { unique: false }); object
store.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2020 }; const db = dbopenrequest.result; db.onerror = () => { console.log(`error adding new ite...
...m: ${newitem.tasktitle}`); }; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); const object
store = transaction.object
store('todolist'); const object
storerequest = object
store.add(newitem); }; ...
IDBIndex.get() - Web APIs
the get() method of the idbindex interface returns an idbrequest object, and, in a separate thread, finds either the value in the referenced object
store that corresponds to the given key or the first corresponding value, if key is set to an idbkeyrange.
... 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 object
store using idbobject
store.opencursor except that the returned records are sorted based on the index, not the primary key.
...for a complete working example, see our idbindex-example demo repo (view the example live.) function displaydatabyindex() { tableentry.innerhtml = ''; var transaction = db.transaction(['contactslist'], 'readonly'); var object
store = transaction.object
store('contactslist'); var myindex = object
store.index('lname'); var getrequest = myindex.get('bungle'); getrequest.onsuccess = function() { console.log(getrequest.result); } myindex.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tablerow = document.createelement('tr'); tablerow.innerhtml = '<...
IDBIndex.isAutoLocale - Web APIs
the isautolocale read-only property of the idbindex interface returns a boolean indicating whether the index had a locale value of auto specified upon its creation (see createindex()'s optionalparameters.) syntax var myindex = object
store.index('index'); console.log(myindex.isautolocale); value a boolean.
... example in the following example we open a transaction and an object
store, then get the index lname from a simple contacts database.
... we then open a basic cursor on the index using idbindex.opencursor — this works the same as opening a cursor directly on an object
store using idbobject
store.opencursor except that the returned records are sorted based on the index, not the primary key.
... function displaydatabyindex() { tableentry.innerhtml = ''; var transaction = db.transaction(['contactslist'], 'readonly'); var object
store = transaction.object
store('contactslist'); var myindex = object
store.index('lname'); console.log(myindex.isautolocale); myindex.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tablerow = document.createelement('tr'); tablerow.innerhtml = '<td>' + cursor.value.id + '</td>' + '<td>' + cursor.value.lname + '</td>' + '<td>' + cursor.value.fname + '</td>' + '<td>' + cursor.value.jtitle + '</td>' + '<td>' + cursor.value.compan...
IDBIndex.locale - Web APIs
syntax var myindex = object
store.index('index'); console.log(myindex.locale); value a domstring.
... example in the following example we open a transaction and an object
store, then get the index lname from a simple contacts database.
... we then open a basic cursor on the index using idbindex.opencursor — this works the same as opening a cursor directly on an object
store using idbobject
store.opencursor except that the returned records are sorted based on the index, not the primary key.
... function displaydatabyindex() { tableentry.innerhtml = ''; var transaction = db.transaction(['contactslist'], 'readonly'); var object
store = transaction.object
store('contactslist'); var myindex = object
store.index('lname'); console.log(myindex.locale); myindex.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tablerow = document.createelement('tr'); tablerow.innerhtml = '<td>' + cursor.value.id + '</td>' + '<td>' + cursor.value.lname + '</td>' + '<td>' + cursor.value.fname + '</td>' + '<td>' + cursor.value.jtitle + '</td>' + '<td>' + cursor.value.company + '</td>' ...
IDBIndex.multiEntry - Web APIs
this is decided when the index is created, using the idbobject
store.createindex method.
... 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 object
store using idbobject
store.opencursor except that the returned records are sorted based on the index, not the primary key.
...for a complete working example, see our idbindex-example demo repo (view the example live.) function displaydatabyindex() { tableentry.innerhtml = ''; var transaction = db.transaction(['contactslist'], 'readonly'); var object
store = transaction.object
store('contactslist'); var myindex = object
store.index('lname'); console.log(myindex.multientry); myindex.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tablerow = document.createelement('tr'); tablerow.innerhtml = '<td>' + cursor.value.id + '</td>' + '<td>' + cursor.value.l...
IDBIndex.name - Web APIs
invalidstateerror the index, or its object
store, has been deleted; or the current transaction is not an upgrade transaction.
... 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 idbobject
store using opencursor() except that the returned records are sorted based on the index, not the primary key.
... function displaydatabyindex() { tableentry.innerhtml = ''; var transaction = db.transaction(['contactslist'], 'readonly'); var object
store = transaction.object
store('contactslist'); var myindex = object
store.index('lname'); console.log(myindex.name); myindex.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tablerow = document.createelement('tr'); tablerow.innerhtml = '<td>' + cursor.value.id + '</td>' + '<td>' + cursor.value.lname + '</t...
IDBIndex.openCursor() - Web APIs
if nothing is passed, this will default to a key range that selects all the records in this object
store.
... 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 object
store using idbobject
store.opencursor except that the returned records are sorted based on the index, not the primary key.
...for a complete working example, see our idbindex-example demo repo (view the example live.) function displaydatabyindex() { tableentry.innerhtml = ''; var transaction = db.transaction(['contactslist'], 'readonly'); var object
store = transaction.object
store('contactslist'); var myindex = object
store.index('lname'); myindex.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tablerow = document.createelement('tr'); tablerow.innerhtml = '<td>' + cursor.value.id + '</td>' + '<td>' + cursor.value.lname + '</td>' + '<td>' + cursor.value.fname + '</td>' + '<td>' + ...
IDBIndex.openKeyCursor() - Web APIs
if nothing is passed, this will default to a key range that selects all the records in this object
store.
... 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 object
store using idbobject
store.openkeycursor except that the returned records are sorted based on the index, not the primary key.
... function displaydatabyindex() { tableentry.innerhtml = ''; var transaction = db.transaction(['contactslist'], 'readonly'); var object
store = transaction.object
store('contactslist'); var myindex = object
store.index('lname'); myindex.openkeycursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tablerow = document.createelement('tr'); tablerow.innerhtml = '<td>' + cursor.key + '</td>' + '<td>' + cursor.primarykey + '</td>'; tableentry.appendchild(tablerow); cursor.continue(); } else { console.log('all last names displayed...
IDBIndex.unique - Web APIs
this is decided when the index is created, using the idbobject
store.createindex method.
... 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 object
store using idbobject
store.opencursor except that the returned records are sorted based on the index, not the primary key.
...for a complete working example, see our idbindex-example demo repo (view the example live.) function displaydatabyindex() { tableentry.innerhtml = ''; var transaction = db.transaction(['contactslist'], 'readonly'); var object
store = transaction.object
store('contactslist'); var myindex = object
store.index('lname'); console.log(myindex.unique); myindex.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tablerow = document.createelement('tr'); tablerow.innerhtml = '<td>' + cursor.value.id + '</td>' + '<td>' + cursor.value.lname...
IDBOpenDBRequest.onupgradeneeded - Web APIs
the onupgradeneeded property of the idbopendbrequest interface is the event handler for the upgradeneeded event, triggered when a database of a bigger version number than the existing
stored database is loaded.
... var
store = db.createobject
store("books", {keypath: "isbn"}); var titleindex =
store.createindex("by_title", "title", {unique: true}); var authorindex =
store.createindex("by_author", "author"); } if (event.oldversion < 2) { // version 2 introduces a new index of books by year.
... var book
store = request.transaction.object
store("books"); var yearindex = book
store.createindex("by_year", "year"); } if (event.oldversion < 3) { // version 3 introduces a new object
store for magazines with two indexes.
... var magazines = db.createobject
store("magazines"); var publisherindex = magazines.createindex("by_publisher", "publisher"); var frequencyindex = magazines.createindex("by_frequency", "frequency"); } }; request.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; db = request.result; populateanddisplaydata(); }; specifications specification status comment indexed database api 2.0the definition of 'onupgradeneeded' in that specification.
IDBRequest.error - Web APIs
it's an exception type for creating
stores and indexes.
... example the following example requests a given record title, onsuccess gets the associated record from the idbobject
store (made available as object
storetitlerequest.result), updates one property of the record, and then puts the updated record back into the object
store.
...for a full working example, see our to-do notifications app (view example live.) var title = "walk dog"; // open up a transaction as usual var object
store = db.transaction(['todolist'], "readwrite").object
store('todolist'); // get the do-do list with the specified title var object
storetitlerequest = object
store.get(title); object
storetitlerequest.onsuccess = function() { // grab the data object returned as the result var data = object
storetitlerequest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item // back into the database var updatetitlerequest = object
store.put(data); // when this ne...
...w request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; object
storetitlerequest.onerror = function() { // if an error occurs with the request, log what it is console.log("there has been an error with retrieving your data: " + object
storetitlerequest.error); }; specifications specification status comment indexed database api 2.0the definition of 'error' in that specification.
IDBRequest: error event - Web APIs
for the error event for the add() operation (this will occur if, for example, a record with the given tasktitle already exists): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.addeventlistener('upgradeneeded', event => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an object
store for this database var object
store = db.createobject
store('todolist', { keypath: 'tasktitle' }); // define what data items the object
store will contain object
store.createindex('hours', 'hours', { unique: false }); object
store.createindex('minutes', 'minutes', { unique: false }); object
store.createindex('day', 'day', { unique: false }); object
store.createindex('month', 'month', { uniqu...
...e: false }); object
store.createindex('year', 'year', { unique: false }); }); dbopenrequest.addeventlistener('success', event => { const db = dbopenrequest.result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); const object
store = transaction.object
store('todolist'); const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2020 }; const object
storerequest = object
store.add(newitem); object
storerequest.addeventlistener('error', () => { console.log(`error adding new item: ${newitem.tasktitle}`); }); }); the same example, using the onerror property instead of addeventlistener(): // open the database const dbopenrequest = window.indexeddb.open('todolist',...
... 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an object
store for this database var object
store = db.createobject
store('todolist', { keypath: 'tasktitle' }); // define what data items the object
store will contain object
store.createindex('hours', 'hours', { unique: false }); object
store.createindex('minutes', 'minutes', { unique: false }); object
store.createindex('day', 'day', { unique: false }); object
store.createindex('month', 'month', { unique: false }); object
store.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = event => { const db = dbopenrequest.result; // open a read/write db transaction, ready for adding the data con...
...st transaction = db.transaction(['todolist'], 'readwrite'); const object
store = transaction.object
store('todolist'); const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2020 }; const object
storerequest = object
store.add(newitem); object
storerequest.onerror = () => { console.log(`error adding new item: ${newitem.tasktitle}`); }; }; ...
IDBRequest.source - Web APIs
the source read-only property of the idbrequest interface returns the source of the request, such as an index or an object
store.
... syntax var idbindex = request.source; var idbcursor = request.source; var idbobject
store = request.source; value an object representing the source of the request, such as an idbindex, idbobject
store or idbcursor.
... example the following example requests a given record title, onsuccess gets the associated record from the idbobject
store (made available as object
storetitlerequest.result), updates one property of the record, and then puts the updated record back into the object
store in another request.
...for a full working example, see our to-do notifications app (view example live.) var title = "walk dog"; // open up a transaction as usual var object
store = db.transaction(['todolist'], "readwrite").object
store('todolist'); // get the to-do list object that has this title as its title var object
storetitlerequest = object
store.get(title); object
storetitlerequest.onsuccess = function() { // grab the data object returned as the result var data = object
storetitlerequest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item // back into the database var updatetitlerequest = object
store.put(data); // log the source of this request con...
IDBTransaction: complete event - Web APIs
o cancelable no interface event event handler property oncomplete examples using addeventlistener(): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an object
store for this database var object
store = db.createobject
store('todolist', { keypath: 'tasktitle' }); // define what data items the object
store will contain object
store.createindex('hours', 'hours', { unique: false }); object
store.createindex('minutes', 'minutes', { unique: false }); object
store.createindex('day', 'day', { unique: false }); object
store.createindex('month', 'month', { uniqu...
...e: false }); object
store.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = event => { const db = dbopenrequest.result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); // add a listener for `complete` transaction.addeventlistener('complete', event => { console.log('transaction was competed'); }); const object
store = transaction.object
store('todolist'); const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2019 }; const object
storerequest = object
store.add(newitem); }; using the oncomplete property: // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = event =>...
... { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an object
store for this database var object
store = db.createobject
store('todolist', { keypath: 'tasktitle' }); // define what data items the object
store will contain object
store.createindex('hours', 'hours', { unique: false }); object
store.createindex('minutes', 'minutes', { unique: false }); object
store.createindex('day', 'day', { unique: false }); object
store.createindex('month', 'month', { unique: false }); object
store.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = event => { const db = dbopenrequest.result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], ...
...'readwrite'); // add a listener for `complete` transaction.oncomplete = event => { console.log('transaction was competed'); }; const object
store = transaction.object
store('todolist'); const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2019 }; const object
storerequest = object
store.add(newitem); }; ...
IDBTransaction: error event - Web APIs
or examples this example opens a database and tries to add a record, listening for the error event for the add() operation (this will occur if, for example, a record with the given tasktitle already exists): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an object
store for this database const object
store = db.createobject
store('todolist', { keypath: 'tasktitle' }); // define what data items the object
store will contain object
store.createindex('hours', 'hours', { unique: false }); object
store.createindex('minutes', 'minutes', { unique: false }); object
store.createindex('day', 'day', { unique: false }); object
store.createindex('month', 'month', { uni...
...que: false }); object
store.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const db = dbopenrequest.result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); transaction.addeventlistener('error', () => { console.log(`error adding new item: ${newitem.tasktitle}`); }); const object
store = transaction.object
store('todolist'); const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2020 }; const object
storerequest = object
store.add(newitem); }; the same example, using the onerror property instead of addeventlistener(): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest...
....onupgradeneeded = (event) => { const db = event.target.result; // create an object
store for this database const object
store = db.createobject
store('todolist', { keypath: 'tasktitle' }); // define what data items the object
store will contain object
store.createindex('hours', 'hours', { unique: false }); object
store.createindex('minutes', 'minutes', { unique: false }); object
store.createindex('day', 'day', { unique: false }); object
store.createindex('month', 'month', { unique: false }); object
store.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const db = dbopenrequest.result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); transaction.onerror = (...
...) => { console.log(`error adding new item: ${newitem.tasktitle}`); }; const object
store = transaction.object
store('todolist'); const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2020 }; const object
storerequest = object
store.add(newitem); }; ...
MediaStream - Web APIs
mediastream.addtrack()
stores a copy of the mediastreamtrack given as argument.
... mediastream.getaudiotracks() returns a list of the mediastreamtrack objects
stored in the mediastream object that have their kind attribute set to audio.
... mediastream.gettracks() returns a list of all mediastreamtrack objects
stored in the mediastream object, regardless of the value of the kind attribute.
... mediastream.getvideotracks() returns a list of the mediastreamtrack objects
stored in the mediastream object that have their kind attribute set to "video".
RTCRemoteOutboundRtpStreamStats.localId - Web APIs
networkteststart() this function simply calls the rtcpeerconnection method getstats() to request an rtcstatsreport and
store it in the variable startreport.
... let startreport; async function networkteststart(pc) { if (pc) { startreport = await pc.getstats(); } } given an rtcpeerconnection, pc, this calls its getstats() method to obtain a statistics report object, which it
stores in startreport for use once the end-of-test data has been collected by networkteststop().
...this statistics record is
stored in endremoteoutbound.
...with that in hand, we can look up the remote-outbound-rtp record in the starting statistics record (startreport), which we
store into startremoteoutbound.
SubtleCrypto.verify() - Web APIs
*/ function getmessageencoding() { const messagebox = document.queryselector(".rsassa-pkcs1 #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } /* fetch the encoded message-to-sign and verify it against the
stored signature.
...*/ function getmessageencoding() { const messagebox = document.queryselector(".rsa-pss #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } /* fetch the encoded message-to-sign and verify it against the
stored signature.
...*/ function getmessageencoding() { const messagebox = document.queryselector(".ecdsa #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } /* fetch the encoded message-to-sign and verify it against the
stored signature.
...*/ function getmessageencoding() { const messagebox = document.queryselector(".hmac #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } /* fetch the encoded message-to-sign and verify it against the
stored signature.
WebGLRenderingContext.makeXRCompatible() - Web APIs
this is why the webglcontextlost and webglcontextre
stored events are used: the first gives you the opportunity to discard anything you won't need anymore, while the second gives you the opportunity to load resources and prepare to render the scene in its new context.
...se; let currentscene = "scene1"; let glstartbutton; let xrstartbutton; window.addeventlistener("load", (event) => { loadsceneresources(currentscene); glstartbutton.addeventlistener("click", handlestartbuttonclick); xrstartbutton.addeventlistener("click", handlestartbuttonclick); }); outputcanvas.addeventlistener("webglcontextlost", (event) => { /* the context has been lost but can be re
stored */ event.canceled = true; }); /* when the gl context is reconnected, reload the resources for the current scene.
... */ outputcanvas.addeventlistener("webglcontextre
stored", (event) => { loadsceneresources(currentscene); }); async function onstartedxrsession(xrsession) { try { await gl.makexrcompatible(); } catch(err) { switch(err) { case aborterror: showsimplemessagebox("unable to transfer the game to your xr headset.", "cancel"); break; case invalidstateerror: showsimplemessagebox("you don't appear to have a compatible xr headset available.", "cancel"); break; default: handlefatalerror(err); break; } xrsession.end(); } } async function handlestartbuttonclick(event) { if (event.target.classlist.contains("use-webxr") && navigator.xr) { try { xrsession = await navigator.xr.requestsession("immersive-vr"); ...
... handlers are provided for both webglcontextlost and webglcontextre
stored; in the first case, we make sure we're aware that the state can be recovered, while in the latter we actually reload the scene to ensure we have the correct resources for the current screen or headset configuration.
Window.localStorage - Web APIs
the read-only localstorage property allows you to access a storage object for the document's origin; the
stored data is saved across browser sessions.
... localstorage is similar to sessionstorage, except that while data
stored in localstorage has no expiration time, data
stored in sessionstorage gets cleared when the page session ends — that is, when the page is closed.
... (data in a localstorage object created in a "private browsing" or "incognito" session is cleared when the last "private" tab is closed.) data
stored in either localstorage is specific to the protocol of the page.
... in particular, data
stored by a script on a site accessed with http (e.g., http://example.com) is put in a different localstorage object from the same site accessed with https (e.g., https://example.com).
font-kerning - CSS: Cascading Style Sheets
the font-kerning css property sets the use of the kerning information
stored in a font.
... the source for this interactive example is
stored in a github repository.
... normal font kerning information
stored in the font must be applied.
... none font kerning information
stored in the font is disabled.
Event reference
sswindowclosing addons specific the session
store will stop tracking this window.
... sstabclosing addons specific the session
store will stop tracking this tab.
... sstabrestoring addons specific a tab is about to be re
stored.
... sstabre
stored addons specific a tab has been re
stored.
Index - HTTP
it allows web developers to have more control over the data
stored locally by a browser for their origins.
... 51 report-to csp, http, report-to the report-to http response header field instructs the user agent to
store reporting endpoints for an origin.
... 54 cookie cookies, http, reference, header, request the cookie http request header contains
stored http cookies previously sent by the server with the set-cookie header.
...it is used as a validator to determine if a resource received or
stored is the same.
HTTP headers - HTTP
intermediate proxies must retransmit these headers unmodified and caches must
store them.
... if-match makes the request conditional, and applies the method only if the
stored resource matches one of the given etags.
... if-none-match makes the request conditional, and applies the method only if the
stored resource doesn't match any of the given etags.
... max-forwards cookies cookie contains
stored http cookies previously sent by the server with the set-cookie header.
A re-introduction to JavaScript (JS tutorial) - JavaScript
javascript also supports functional programming — because they are objects, functions may be
stored in variables and passed around like any other object.
... also, watch out for stuff like: 0.1 + 0.2 == 0.30000000000000004; in practice, integer values are treated as 32-bit ints, and some implementations even
store it that way until they are asked to perform an instruction that's valid on a number but not on a 32-bit integer.
... it is important to note that wherever the rest parameter operator is placed in a function declaration it will
store all arguments after its declaration, but not before.
...function avg(firstvalue, ...args) will
store the first value passed into the function in the firstvalue variable and the remaining arguments in args.
Indexed collections - JavaScript
let arr = [] arr[3.4] = 'oranges' console.log(arr.length) // 0 console.log(arr.hasownproperty(3.4)) // true you can also populate an array when you create it: let myarray = new array('hello', myvar, 3.14159) // or let myarray = ['mango', 'apple', 'orange'] understanding length at the implementation level, javascript's arrays actually
store their elements as standard object properties, using the array index as the property name.
...this means that the length property will be one more than the highest index
stored in the array: let cats = [] cats[30] = ['dusty'] console.log(cats.length) // 31 you can also assign to the length property.
... writing a value that is shorter than the number of
stored items truncates the array.
... let a = new array(4) for (let i = 0; i < 4; i++) { a[i] = new array(4) for (let j = 0; j < 4; j++) { a[i][j] = '[' + i + ', ' + j + ']' } } this example creates an array with the following rows: row 0: [0, 0] [0, 1] [0, 2] [0, 3] row 1: [1, 0] [1, 1] [1, 2] [1, 3] row 2: [2, 0] [2, 1] [2, 2] [2, 3] row 3: [3, 0] [3, 1] [3, 2] [3, 3] using arrays to
store other properties arrays can also be used like objects, to
store related information.
DataView.prototype.setInt8() - JavaScript
the setint8() method
stores a signed 8-bit integer (byte) value at the specified byte offset from the start of the dataview.
... the source for this interactive example is
stored in a github repository.
... syntax dataview.setint8(byteoffset, value) parameters byteoffset the offset, in byte, from the start of the view where to
store the data.
... errors thrown rangeerror thrown if the byteoffset is set such as it would
store beyond the end of the view.
DataView.prototype.setUint8() - JavaScript
the setuint8() method
stores an unsigned 8-bit integer (byte) value at the specified byte offset from the start of the dataview.
... the source for this interactive example is
stored in a github repository.
... syntax dataview.setuint8(byteoffset, value) parameters byteoffset the offset, in byte, from the start of the view where to
store the data.
... errors thrown rangeerror thrown if the byteoffset is set such as it would
store beyond the end of the view.
WeakSet - JavaScript
the weakset object lets you
store weakly held objects in a collection.
...if no other references to an object
stored in the weakset exist, those objects can be garbage collected.
... note: this also means that there is no list of current objects
stored in the collection.
... weaksets are ideal for this purpose: // execute a callback on everything
stored inside an object function execrecursively(fn, subject, _refs = null){ if(!_refs) _refs = new weakset(); // avoid infinite recursion if(_refs.has(subject)) return; fn(subject); if("object" === typeof subject){ _refs.add(subject); for(let key in subject) execrecursively(fn, subject[key], _refs); } } const foo = { foo: "foo", bar: { bar: "bar" } }; foo.bar.baz = foo; // circular reference!
Web video codec guide - Web media technologies
due to the sheer size of uncompressed video data, it's necessary to compress it significantly in order to
store it, let alone transmit it over a network.
... imagine the amount of data needed to
store uncompressed video: a single frame of high definition (1920x1080) video in full color (4 bytes per pixel) is 8,294,400 bytes.
...then that shift is
stored, along with a description of the pixels that have moved that can't be described just by that shift.
...then, to finish the job, the remaining differences are found, then the set of object shifts and the set of pixel differences are
stored in the data representing the new frame.
Add to Home screen - Progressive web apps (PWAs)
to make your app work offline, you have to use the service worker api to handle storing the assets offline, and if required, web storage or indexeddb to
store its data.
... in our example app, we've just used a service worker to
store all necessary files.
...
store the event object in the deferredprompt variable so it can be used later on to perform the actual installation.
... use the prompt() method available on the beforeinstallprompt event object (
stored in deferredprompt) to trigger showing the install prompt.
Filter effects - SVG: Scalable Vector Graphics
,-40 h80 c30,0 30,40 0,40z" /> <g fill="#ffffff" stroke="black" font-size="45" font-family="verdana" > <text x="52" y="52">svg</text> </g> </g> </svg> step 1 <fegaussianblur in="sourcealpha" stddeviation="4" result="blur"/> <fegaussianblur> takes in "sourcealpha", which is the alpha channel of the source graphic, applies a blur of 4, and
stores the result in a temporary buffer named "blur".
... step 2 <feoffset in="blur" dx="4" dy="4" result="offsetblur"/> <feoffset> takes in "blur", which we previously created, shifts the result 4 to the right and 4 to the bottom, and
stores the result in the buffer "offsetblur".
... step 3 <fespecularlighting in="offsetblur" surfacescale="5" specularconstant=".75" specularexponent="20" lighting-color="#bbbbbb" result="specout"> <fepointlight x="-5000" y="-10000" z="20000"/> </fespecularlighting> <fespecularlighting> takes in "offsetblur", generates a lighting effect, and
stores the result in the buffer "specout".
... step 5 <fecomposite in="sourcegraphic" in2="specout" operator="arithmetic" k1="0" k2="1" k3="1" k4="0" result="litpaint"/> the second <fecomposite> takes in "sourcegraphic" and "specout", adds the result of "specout" on top of "sourcegraphic", and
stores the result in "litpaint".
indexed-db - Archive of obsolete content
so you can use the indexed-db module to access the same api: var { indexeddb } = require('sdk/indexed-db'); var request = indexeddb.open('mydatabase'); request.onerror = function(event) { console.log("failure"); }; request.onsuccess = function(event) { console.log("success"); }; most of the objects that implement the indexeddb api, such as idbtransaction, idbopendbrequest, and idbobject
store, are accessible through the indexeddb object itself.
... var { indexeddb, idbkeyrange } = require('sdk/indexed-db'); var database = {}; database.onerror = function(e) { console.error(e.value) } function open(version) { var request = indexeddb.open("stuff", version); request.onupgradeneeded = function(e) { var db = e.target.result; e.target.transaction.onerror = database.onerror; if(db.object
storenames.contains("items")) { db.deleteobject
store("items"); } var
store = db.createobject
store("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.objectsto...
...re("items"); var time = new date().gettime(); var request =
store.put({ "name": name, "time": time }); request.onerror = database.onerror; }; function getitems(callback) { var cb = callback; var db = database.db; var trans = db.transaction(["items"], "readwrite"); var
store = trans.object
store("items"); var items = new array(); trans.oncomplete = function() { cb(items); } var keyrange = idbkeyrange.lowerbound(0); var cursorrequest =
store.opencursor(keyrange); cursorrequest.onsuccess = function(e) { var result = e.target.result; if(!!result == false) return; items.push(result.value.name); result.continue(); }; cursorrequest.onerror = database.onerror; }; function listitems(itemlist) { console.log(itemlist); } open("1")...
private-browsing - Archive of obsolete content
it returns true only if the object is: a private window, or a tab belonging to a private window, or a worker that's associated with a document hosted in a private window any window, tab, or worker if the browser has been configured to never remember history (options->privacy->history) add-ons can use this api to decide whether or not to
store user data.
... for example, here's an add-on that
stores the titles of tabs the user loads, and uses isprivate() to exclude the titles of tabs that were loaded into private windows: var simplestorage = require("simple-storage"); if (!simplestorage.storage.titles) simplestorage.storage.titles = []; require("tabs").on("ready", function(tab) { if (!require("sdk/private-browsing").isprivate(tab)) { console.log("storing..."); simplestorage.storage.titles.push(tab.title); } else { console.log("not storing, private data"); } }); here's an add-on that uses a page-mod to log the content of pages loaded by the user, unless the page is private.
...r) { if (privatebrowsing.isprivate(worker)) { console.log("private window, doing nothing"); } else { worker.port.emit("log-content"); } } pagemod.pagemod({ include: "*", contentscript: loggingscript, onattach: logpublicpagecontent }); tracking private-browsing exit sometimes it can be useful to cache some data from private windows while they are open, as long as you don't
store it after the private browsing windows have been closed.
High-Level APIs - Archive of obsolete content
passwords interact with firefox's password manager to add, retrieve and remove
stored credentials.
... simple-prefs
store preferences across application restarts.
... simple-storage lets an add-on
store data so that it's retained across firefox restarts.
Overview - Archive of obsolete content
the widget is used to switch the annotator on and off, and to display a list of all the
stored annotations.
... the annotation-list panel shows a list of all
stored annotations.
... working with data we'll use the simple-storage module to
store annotations.
File I/O - Archive of obsolete content
profld f local settings on windows; where the network cache and fastload files are
stored.
... storing nsifile in preferences the following two snippets show the right way to
store a file path in user preferences (more about preferences in mozilla): absolute path (nsifile) to
store an arbitrary path in user preferences, use this code: // |file| is nsilocalfile.
...read path from prefs var file = prefs.getcomplexvalue("filename", components.interfaces.nsilocalfile); relative path (nsirelativefilepref) to
store paths relative to one of the predefined folders listed above, for example file relative to profile folder, use the following code: // 1.
Preferences - Archive of obsolete content
nsilocalfile and nsirelativefilepref
store paths in preferences.
... nsilocalfile is used to
store absolute paths, while nsirelativefilepref is used to
store paths relative to a "special" directory, such as the profile folder.
...so you could use, for instance: alert(prefs.getcharpref("mypref", "no value
stored")); be careful with this technique because prior to firefox 54, the additional (default) value will be ignored and an exception would still be thrown in this case.
Search Extension Tutorial (Draft) - Archive of obsolete content
due to the large volume of user complaints regarding hidden settings being changed against their will, and not being re
stored after the add-ons responsible are disabled, mozilla will take any steps necessary to mitigate the impact of offending add-ons.
...the most technically sound method of achieving this, and the only acceptable way of changing preferences such that they are automatically re
stored on add-on uninstall, is to make such changes in the default preference branch, as explained below.
...while changes to default preference values will not persist across sessions, restartless extensions must nevertheless re
store them for the balance of the session after they have been disabled.
Source code directories overview - Archive of obsolete content
these programs are used for code level things instead of build level things (which are a
stored in the build directory).
...it is used to
store mail box data, news data and global history data.
...it is used for the auto-completion feature on the url edit box (
stored in netscape.hst in mozilla classic) and for the cached pages index (
stored in fat.db in mozilla classic).
Code snippets - Archive of obsolete content
components.utils.import("resource://services-sync/engines.js"); components.utils.import("resource://services-sync/engines/bookmarks.js"); let bme = weave.service.enginemanager.get("bookmarks"); let ids = object.keys(bme._
store.getallids()); for each (let id in ids) { let record = bme._
store.createrecord(id, "bookmarks"); let len = record.tostring().length; if (len > 1000) { console.log("id: " + id + ", len = " + len + ", " + record.title); } } print an alphabetically sorted list of members of a collection components.utils.import("resource://services-sync/main.js"); components.utils.import("resource://servi...
... bump meta/global's modified time components.utils.import("resource://services-sync/main.js"); components.utils.import("resource://services-sync/resource.js"); function getpath(path) { let r = new resource(weave.service.storageurl + path); let g = r.get(); return [g, r]; }; let [g, r] = getpath("meta/global"); r.put(g); delete and re
store a record components.utils.import("resource://services-sync/main.js"); components.utils.import("resource://services-sync/resource.js"); components.utils.import("resource://services-sync/record.js"); // for example: let id = "iasokuozpixz" let collection = "bookmarks"; let resource = new resource(weave.service.storageurl + collection + "/" + id); let del = new cryptowrapper(collection, id); del.
...resource.put(del); // re
store the old value.
Message Summary Database - Archive of obsolete content
the mail summary files (.msf) are used to
store summary information about messages and threads in a folder, and some meta information about the folder.
...there are a set of generic property methods so that core code and extensions can set attributes on msg headers without changing nsimsghdr.idl.msg threads we
store thread information persistently in the database and expose these object through the [nsimsgthread interface.
...this allows us to
store watch/ignore information on a thread object, and avoids having to generate threading information whenever a folder is open.
RDF Datasource How-To - Archive of obsolete content
you may want to choose this implementation if your primary goal is to "wrap" a legacy data
store.
... this implementation may cause problems if your data
store can be modified "on the fly" by other agents.
...if you choose this route, you'll need to implement each of the nsirdfdata
store methods "by hand".
XPJS Components Proposal - Archive of obsolete content
a 'load' or 'import' function will also be provided to let the js code import other .js files where libraries of code might be
stored.
...the xpjsmanager will receive this call from the js code,
store the mapping of clsid to .js filespec in the registry for its own use later, and then call the real component manager to do the registration.
...that native nsgetfactory function will check the information it
stored in the registry to see that the js factory for the given clsid is in a given .js file.
pending - Archive of obsolete content
« xul reference home pending type: boolean this attribute is set to true if the tab is currently in the process of being re
stored by the session
store service.
... once the tab is re
stored, this attribute is removed.
... you can determine if a tab is being re
stored by checking to see if hasattribute("pending") is true.
persist - Archive of obsolete content
when the window is re-opened, the values of persistent attributes are re
stored.
... in mozilla, persistent attributes are
stored in the per-profile file xul
store.json.
... persistence can also be
stored using the document.persist function.
Reading from Files - Archive of obsolete content
if you know that a file is
stored using a different encoding, you can specify a third argument to nsiscriptableio.newinputstream() which specifies the encoding.
...var stream = io.newinputstream(file, "text", "utf-16"); this third argument is not needed if the file is
stored in utf-8.
...var length = stream.read32(); var data = stream.readstring(length); all values are read in big endian form, which means that integers are
stored in the file with their higher bits first.
Index - Archive of obsolete content
212 nore
storefocus no summary!
... 337 sizemode xul attributes, xul reference this attribute is used to save and re
store the state of a window (together with the persist attribute) and for css styles (e.g.
...each preference element corresponds to a preference which is
stored in the user's preferences file.
Introduction - Archive of obsolete content
<vbox datasources="rdf:bookmarks http://www.xulplanet.com/ds/sample.rdf"> in addition, when using the rdf type for chrome xul (such as in extensions), the datasource rdf:local-
store is always included in the composite.
... the local
store is a datasource which is usually used to hold state information such as window sizes, which columns in a tree are showing, and which tree items are open.
... you can query for any data in the local
store in a template though this is rarely done.
Adding Style Sheets - Archive of obsolete content
if your xul file is
stored remotely and accessed via an http url, you can
store the style sheet remotely as well.
...first, you could
store the style sheet in the same directory as the xul file.
... let's assume that we are building the find files dialog for themeability, because the find files dialog can be referred to with the url chrome://findfile/content/findfile.xul so the style sheet file will be
stored in chrome://findfile/skin/findfile.css.
Install Scripts - Archive of obsolete content
the registry also
stores the set of files and version information about the installed components.
...what you do need to know for an installation is that the registry
stores a set of information about your application, such as the file list and versions.
... all of this information is
stored in a key (and within subkeys) that you provide in the installation script (in step 1 mentioned above).
Introduction to RDF - Archive of obsolete content
rdf (resource description framework) is a format that can be used to
store resources such as bookmarks or mail.
...you can use any of the provided rdf datasources to populate trees with data or you can point to an rdf file
stored in xml which contains the data.
...think of the bookmarks as a database, which is
stored as a large table with numerous fields.
Extentsions FAQ - Archive of obsolete content
you shouldn't
store data there, so there's nothing to backup.
... do not
store files within the extension directory.
...however not all servers support user flags, in which case you get reduced functionality as follows: all flags are
stored in your local cache and are lost if your cache gets invalidated, and only "known" properties are copied when messages are copied.
ActiveXObject - Archive of obsolete content
warning: this object is a microsoft extension and is supported in internet explorer only, not in windows 8.x
store apps.
...not supported in windows 8.x
store apps.
... note: creating an activexobject on a remote server is not supported in internet explorer 9 standards mode, internet explorer 10 standards mode, internet explorer 11 standards mode, and windows
store apps or later.
Building up a basic demo with the PlayCanvas engine - Game development
creating a directory to
store your experiments in.
...there is one helper variable already included, which will
store a reference to the <canvas> element.
...for time based animations we'll use a timer variable that will
store the time that has passed since the start of the app by adding the deltatime to it on every update.
2D maze game with device orientation - Game development
to hold the block information we'll use a level data array: for each block we'll
store the top and left absolute positions in pixels (x and y) and the type of the block — horizontal or vertical (t with the 'w' value meaning width and 'h' meaning height).
... the objects are
stored in the this.levels array, which is by default invisible.
... adding the elapsed time to improve replayability and give players the option to compete with each other we will
store the elapsed time — players can then try to improve on their best game completion time.
Endianness - MDN Web Docs Glossary: Definitions of Web-related terms
every byte can
store an 8-bit number (i.e.
... between 0x00 and 0xff), so you must reserve more than one byte to
store a larger number.
...big-endian is also often called "network byte order", because internet standards usually require data to be
stored big-endian, starting at the standard unix socket level and going all the way up to standardized web binary data structures.
Organizing your CSS - Learn web development
/* ||
store pages */ .product-listing { ...
... for example, we might have an online
store as part of the site, with a lot of css used only for styling the product listings and forms needed for the
store.
... it would make sense to have those things in a different stylesheet, only linked to on
store pages.
Web fonts - Learn web development
fonts are created by font foundries and are
stored in different file formats.
... an online font service: this is a site that
stores and serves the fonts for you, making the whole process easier.
... using an online font service online font services generally
store and serve fonts for you, so you don't have to worry about writing the @font-face code, and generally just need to insert a simple line or two of code into your site to make everything work.
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
here, you're storing a reference to the <div> inside a constant, setting a rotatecount variable to 0, setting an uninitialized variable that will later be used to contain a reference to the requestanimationframe() call, and setting a starttime variable to null, which will later be used to
store the start time of the requestanimationframe().
...(note that the function name starts with "cancel", not "clear" as with the "set..." methods.) just pass it the value returned by the requestanimationframe() call to cancel, which you
stored in the variable raf: cancelanimationframe(raf); active learning: starting and stopping our spinner in this exercise, we'd like you to test out the cancelanimationframe() method by taking our previous example and updating it, adding an event listener to start and stop the spinner when the mouse is clicked anywhere on the page.
... an uninitialized variable to later
store the requestanimationframe() call that animates the spinner.
Build your own function - Learn web development
the first line uses a dom api function called document.queryselector() to select the <html> element and
store a reference to it in a constant called html, so we can do things to it later on: const html = document.queryselector('html'); the next section uses another dom api function called document.createelement() to create a <div> element and
store a reference to it in a constant called panel.
... finally, we call a dom function called node.appendchild() on the html constant we
stored earlier, which nests one element inside the other as a child of it.
... next, we'll select the button and
store a reference to it in a constant.
Looping code - Learn web development
we
store the value entered into the text input in a variable called searchname, before then emptying the text input and focusing it again, ready for the next search.
... inside the loop, we first split the current contact (contacts[i]) at the colon character, and
store the resulting two values in an array called splitcontact.
...ction(){ // we only want to save the state when the user code is being shown, // not the solution, so that solution is not saved over the user code if(solution.value === 'show solution') { userentry = textarea.value; } else { solutionentry = textarea.value; } updatecode(); }; active learning: filling in a guest list in this exercise, we want you to take a list of names
stored in an array and put them into a guest list.
Function return values - Learn web development
after the function calculates the value, it can return the result so it can be
stored in a variable; and you can use this variable in the next stage of the calculation.
...there's also a <script> element, in which we have
stored a reference to both html elements in two variables.
...when this anonymous function runs, the value in the input is
stored in the num constant.
Drawing graphics - Learn web development
now add the following lines of javascript inside the <script> element: const canvas = document.queryselector('.mycanvas'); const width = canvas.width = window.innerwidth; const height = canvas.height = window.innerheight; here we have
stored a reference to the canvas in the canvas constant.
... re
store the settings you saved in step 2, using re
store() call requestanimationframe() to schedule drawing of the next frame of the animation.
... note: we won't cover save() and re
store() here, but they are explained nicely in our transformations tutorial (and the ones that follow it).
Test your skills: Arrays - Learn web development
in this task we'd like you to create an array of three items,
stored inside a variable called myarray.
...
store the length of the array in a variable called arraylength.
...
store the last item in the array in a variable called lastitem.
Ember interactivity: Events, classes and state - Learn web development
with the interactivity of the header input out of the way, we need a place to
store todos so that other components can access them.
... run this terminal command to generate a service for us to
store our todo-list data in: ember generate service todo-data this should give you a terminal output like so: installing service create app/services/todo-data.js installing service-test create tests/unit/services/todo-data-test.js this creates a todo-data.js file inside the todomvc/app/services directory to contain our service, which initially contains an import statement and an empty class: i...
...s using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte
stores typescript support in svelte deployment and next steps ...
React interactivity: Events and state - Learn web development
function handlechange(e) { console.log(e.target.value); } updating state logging isn’t enough — we want to actually
store the updated state of the name as the input value changes!
... tasks as state import usestate into app.js, so that we can
store our tasks in state — update your react import line to the following: import react, { usestate } from "react"; we want to pass props.tasks into the usestate() hook – this will preserve its initial state.
...s using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte
stores typescript support in svelte deployment and next steps ...
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
the code so far git to see the state of the code as it should be at the end of this article, access your copy of our repo like this: cd mdn-svelte-tutorial/06-
stores or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/06-
stores remember to run npm install && npm run dev to start your app in development mode.
... in the next article we will see how to use
stores to communicate between components, and add animations to our components.
...s using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte
stores typescript support in svelte deployment and next steps ...
Gecko info for Windows accessibility vendors
data is therefore
stored and retrieved dynamically much faster.
...when an event is received, the negative childid should match one of these cached uniqueid's, if the entire document has been
stored and kept current.
...here is an algorithm for iterating through the nodes, looking for an item of a particular type:
store a pointer to the start_item if the current item has a flows_to relation, follow that relation otherwise, go to the next item in depth first search order if the current item matches your criteria, then return current_item if the current_item == start_item, return null (no item found) if the end has been reached, go back to the start if wrapping is desired, otherwise r...
Adding a new event
add event messages you need to add event messages which are
stored by widgetevent::message.
...this method is basically used for duplicating an internal event class instance of a dom event when the dom event is
stored by content.
...if all information of the event is
stored by its internal event, c++ event handlers can access them with following code: ns_imethodimp aneventlistener::handleevent(nsidomevent* aevent) { internalfooevent* internalevent = aevent->getinternalnsevent()->asfooevent(); if (ns_warn_if(!internalevent)) { return ns_error_unexpected; } dosomethingwith(internalevent->mbar); aevent->preventdefault(); return ns_ok; } implemen...
Runtime Directories
ectories firefox os application directory user profile directory temporary directory windows vista/7 c:\program files\mozilla firefox\ c:\users\<username>\appdata\roaming\mozilla\firefox\ (or %appdata%\mozilla\firefox\) c:\users\<username>\appdata\local\mozilla\firefox\ (or %localappdata%\mozilla\firefox) and c:\users\<username>\appdata\local\virtual
store\program files\mozilla firefox\ windows 2000/xp c:\program files\mozilla firefox\ c:\documents and settings\<username>\application data\mozilla\firefox\ (or %appdata%\mozilla\firefox\) c:\documents and settings\<username>\local settings\application data\mozilla\firefox\ os x /applications/firefox.app ~/library/application support/firefox/profiles/xxxxxxxx.defau...
...t/ n/d thunderbird os application directory user profile directory temporary directory windows vista/7 c:\program files\mozilla thunderbird\ c:\users\<username>\appdata\roaming\thunderbird\ (or %appdata%\thunderbird\) c:\users\<username>\appdata\local\thunderbird\ (or %localappdata%\thunderbird\) and c:\users\<username>\appdata\local\virtual
store\program files\mozilla thunderbird\ windows 2000/xp c:\program files\mozilla thunderbird\ c:\documents and settings\<username>\application data\thunderbird\ (or %appdata%\thunderbird\) c:\documents and settings\<username>\local settings\application data\thunderbird\ os x /applications/thunderbird.app ~/library/thunderbird/profiles/xxxxxxxx.default/ ~/library...
... ~/.thunderbird/xxxxxxxx.default/ (or ~/.mozilla-thunderbird/xxxxxxxx.default/ on debian/ubuntu) n/d see also https://support.mozilla.org/kb/profiles-where-firefox-
stores-user-data#w_how-do-i-find-my-profile https://support.mozilla.org/kb/profiles-tb#w_where-is-my-profile-
stored http://kb.mozillazine.org/profile_folder ...
SVG Guidelines
on the other hand the size of a raster file of the same image will likely vary tremendously depending on the dimensions of the image since the larger the dimensions the more pixel data the file needs to
store.
... at very small dimensions (the extreme case being 1px x 1px) the raster file will likely be much smaller than the svg file since it only needs to
store one pixel of data.
...if saved as a raster image then the work to rasterize the gradients and filters takes place on the authors computer before the result is
stored in the raster file.
Multiple Firefox profiles
you can also choose where to
store the profile on your computer.
... optionally, to change where the profile will be
stored on your computer, click choose folder...
... windows in windows, the developer and nightly builds get their own directory in the "programs" folder, so you don't have to worry about where to
store the downloaded files.
HTML parser threading
it contains all the information that is necessary to load back into the tree builder to re
store it into a behaviorally equivalent state.
...if the speculation failed, the first buffer corresponding to the starting point of the speculation gets its start index re
stored to the index
stored on the speculation object.
...the tokenizer gets its line number re
stored from the speculation object.
OS.File for the main thread
example: path manipulation the following snippet obtains the path to file "session
store.js", contained in the user's profile directory.
... let session
store = os.path.join(os.constants.path.profiledir, "session
store.js"); // under linux, this is generally "$home/.firefox/profiles/$profilename/session
store.js" // under macos, this is generally "$home/library/application support/firefox/$profilename/session
store.js" // under windows, this is generally "%appdata%\local\temp\%profilename%"\session
store.js // etc.
... promise<number> write( in arraybufferview source [optional] in object options ) arguments source the array in which the the bytes are
stored.
Application Translation with Mercurial
for a windows user, it looks like c:\users\myname , depending on your windows version: cd /c/users/myname now list all the files here: ls -a if there is no file called .hgrc , create it with > .hgrc this file
stores your general mercurial settings (mercurial is the tool which manages the source code and its history of changes).
...&newprivatewindow.label; has to be left unchanged so it can be replaced with the text of the string id &newprivatewindow.label; whis is
stored elsewhere.
... tell mercurial to
store the changes in the mercurial queue with the qref command.
Initial setup
these accounts will
store your code, contributions, and help you produce an official localization.
...these tools will help you to
store your contributions, build mozilla applications and language packs, and test your work.
...not only will you need a localization repository to
store your localizations, but you need to have it installed and configured on your personal computer as well.
Mozilla Style System Documentation
in mozilla, nscssdeclaration objects correspond to css declaration-blocks.) due to the high similarity of these lists between elements in the content tree, mozilla
stores the output of the selector matching process in a lexicographic tree, the rule tree.
...therefore, inherited structs are cached on the style context (but only the top style contexts pointing to them actually "owns" them), but structs that are shared between rule nodes are
stored only on the highest rule node to which they apply and then retrieved from that most upper rule node every time they are needed.
...then the style struct is computed from the declaration and
stored at the appropriate location in the rule tree or on the style context.
browser.download.lastDir.savePerSite
if set to true, the data is
stored as content preference.
...if no download directory for the current website has been
stored, browser.download.lastdir will be used.
... false the last used directory for any download (
stored in browser.download.lastdir) will be the preselected directory in the file picker.
Preference reference
if set to true, the data is
stored as content preference.browser.pagethumbnails.capturing_disabledthe preference browser.pagethumbnails.capturing_disabled controls whether the application creates screenshots of visited pages which will be shown if the web page is shown in the grid of the "new tab page" (about:newtab) which offers the most often visited pages for fast navigation.browser.search.context.loadinbackgroundbrowser.searc...
...the old behavior can be re
stored by setting the preference mail.tabs.drawintitlebar to false.nglayout.debug.disable xul fastloadthe preference nglayout.debug.disable_xul_fastload controls whether or not xul fastload is used.nglayout.debug.disable_xul_cacheto improve performance, mozilla caches chrome xul documents the first time they load for faster loading later.
...sed to underline words not recognized by the spellchecker.ui.textselectbackgroundui.textselectbackground saves the color in which the background of a text selection in the user interface or in content will be styled.ui.textselectforegroundui.textselectforeground saves the color in which the text of a text selection in the user interface or the content will be styled.ui.tooltipdelayui.tooltipdelay
stores the delay in milliseconds between the mouse stopping over an element and the appearing of its tooltip.view_source.syntax_highlightthe preference view_source.syntax_highlight controls whether markup in the view source view is syntax highlighted.
PKCS #11 Module Specs
this data is currently
stored in secmod.db or pkcs11.txt.
... rootflags - comma separated of flags describing any root certs that may be
stored (case-insensitive).
... valid values are: configdir configuration directory where nss can
store persistant state information (typically databases).
JSAPI Cookbook
to avoid this, your jsapi code implementing the finally block must: save the old exception, if any clear the pending exception so that your cleanup code can run do your cleanup re
store the old exception, if any return false if an exception occurred, so that the exception is propagated up.
... * it will be automatically re
stored when we return, unless we call savedstate.drop().
...since javascript values are usually
stored in js::value variables, a cast or conversion is usually needed.
JS::AutoSaveExceptionState
this article covers features introduced in spidermonkey 31 save and later re
store the current exception state of a given jscontext.
... description js::autosaveexceptionstate saves and later re
stores the current exception state of a given jscontext.
...return ok; see also mxr id search for js::autosaveexceptionstate js_saveexceptionstate js_re
storeexceptionstate js_dropexceptionstate bug 972319 ...
JS::Value
uble) string val.isstring() js::stringvalue(jsstring*) val.tostring() val.setstring(jsstring *) object val.isobject() js::objectvalue(jsobject&), js::objectornullvalue(jsobject*) val.toobject() val.setobject(jsobject &) symbol val.issymbol() js::symbolvalue(js::symbol*) val.tosymbol() val.setsymbol(js::symbol &) numbers are
stored in a js::value either as a double or as an int32_t.
...any double value may be
stored in a js::value, in one of these two representations.
...(note that both -0 and +0 are allowed, and the latter may sometimes be
stored using the int32_t representation.) js::value further provides these methods combining various aspects of the above methods: js::objectornullvalue(jsobject*) returns an object value corresponding to the given non-null pointer, or a null value if the pointer is null.
JSExceptionState
this is used to save and re
store exception states.
... syntax struct jsexceptionstate; description a jsexceptionstate object is returned by the js_saveexceptionstate function, and is passed to functions js_re
storeexceptionstate and js_dropexceptionstate.
... see also mxr id search for jsexceptionstate js_saveexceptionstate js_re
storeexceptionstate js_dropexceptionstate ...
JS_GetProperty
in the simplest case, js_getproperty
stores the value of the property in *vp and returns true.
...otherwise *vp is set to the property's
stored value, or undefined if the property does not have a
stored value, and then the property's getter is called with the arguments (cx, obj, id, vp).
... for many properties, the getter does nothing and returns true, so the property get succeeds and the property's
stored value is left in *vp.
JS_SetProperty
the initial
stored value of the new property is undefined.
...if the hook succeeds and the property has a
stored value, then the value left in v by the addproperty hook becomes the
stored value of the property.
...if the setter succeeds and the property has a
stored value, then the value left in v becomes the
stored value of the property.
JS_StringHasLatin1Chars
this article covers features introduced in spidermonkey 38 determine if a string's characters are
stored as latin1.
... description js_stringhaslatin1chars returns true iff the string's characters are
stored as latin1.
... string characters are
stored as either latin1char (8-bit) or char16_t (16-bit).
Animated PNG graphics
information for each frame about placement and rendering is
stored in 'fctl' chunks.
...apng-aware png editors should re
store them to correct order using the sequence numbers.
... changed format: instead of sequences of ihdr..idat..iend, frames other than frame 0 are
stored in 'afra' chunks.
Using the Places annotation service
the annotation service, provided by the nsiannotationservice interface, is designed to
store arbitrary data about a web page or about an item in the places database in firefox 3.
...the service
stores these names in a separate table, and the fewer names there are, the more efficient retrieving names will be.
...this allows you to link directly to data
stored in the annotation service.
mozIAsyncFavicons
favicon data for favicon uris that are not associated with a page uri via setandfetchfaviconforpage will be
stored in memory, but may be expired at any time, so you should make an effort to associate favicon uris with page uris as soon as possible.
... adatalen length of binary data amimetype mime type of the data to
store.
...favicon data for favicon uris that are not associated with a page uri via setandfetchfaviconforpage will be
stored in memory, but may be expired at any time, so you should make an effort to associate favicon uris with page uris as soon as possible.
nsIBrowserSearchService
gines); void getvisibleengines([optional] out unsigned long enginecount, [retval, array, size_is(enginecount)] out nsisearchengine engines); void init([optional] in nsibrowsersearchinitobserver observer); void moveengine(in nsisearchengine engine, in long newindex); void removeengine(in nsisearchengine engine); void re
storedefaultengines(); attributes attribute type description currentengine nsisearchengine the currently active search engine.
... re
storedefaultengines() un-hides all engines installed in the directory corresponding to the directory service's ns_app_search_dir key.
... (that is the set of engines returned by getdefaultengines()) void re
storedefaultengines(); parameters none.
nsICacheDeviceInfo
entrycount unsigned long get the number of
stored cache entries.
... maximumsize unsigned long get the upper limit of the size of the data the cache can
store.
... totalsize unsigned long get the total size of the
stored cache entries.
nsIContentPrefService2
(see nsicontentpref below.) for example, if you want to remember the user's preference for a certain zoom level on www.mozilla.org pages, you might
store a preference whose domain is "www.mozilla.org", whose name is "zoomlevel", and whose value is the numeric zoom level.
... callback optional handlecompletion is called when the preference has been
stored.
... callback optional handlecompletion is called when the preference has been
stored.
nsIDOMChromeWindow
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void beginwindowmove(in nsidomevent mousedownevent); void getattention(); void getattentionwithcyclecount(in long acyclecount); void maximize(); void minimize(); void notifydefaultbuttonloaded(in nsidomelement defaultbutton); void re
store(); void setcursor(in domstring cursor); attributes attribute type description browserdomwindow nsibrowserdomwindow the related nsibrowserdomwindow instance which provides access to yet another layer of utility functions by chrome script.
... re
store() re
stores the size and position of the window.
... void re
store(); parameters none.
nsIDOMStorage2
items
stored in local storage may only be accessed by the same origin that created the items in the first place.
... last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports method overview void clear(); domstring getitem(in domstring key); domstring key(in unsigned long index); void removeitem(in domstring key); void setitem(in domstring key, in domstring data); attributes attribute type description length unsigned long the number of keys
stored in local storage.
...key() returns the key for the item
stored at the specified index in the data
store.
nsIDOMStorageItem
attributes attribute type description secure boolean if true, the item was
stored for an https page.
... note: all items, regardless of whether they were
stored for an http page or an https page, are visible from https pages.
... however, http pages can only see items
stored from http pages, and will not see items
stored from https pages.
nsIDownloadManager
atarget the uri indicating where the transferred file should be
stored.
... atempfile the location of a temporary file (a file in which the received data will be
stored but is not equal to the target file).
...this can be one that is in progress, or one that has completed in the past and is
stored in the database.
nsIHttpChannel
tservice(components.interfaces.nsiioservice); var ch = ios.newchannel("https://www.example.com/", null, null); method overview void getoriginalresponseheader(in acstring aheader, in nsihttpheadervisitor avisitor); acstring getrequestheader(in acstring aheader); acstring getresponseheader(in acstring header); boolean isnocacheresponse(); boolean isno
storeresponse(); void redirectto(in nsiuri anewuri); void setemptyrequestheader(in acstring aheader); void setreferrerwithpolicy(in nsiuri referrer, in unsigned long referrerpolicy); void setrequestheader(in acstring aheader, in acstring avalue, in boolean amerge); void setresponseheader(in acstring header, in acstring value, in boolean merge); v...
... isno
storeresponse() boolean isno
storeresponse(); parameters none.
... return value true if the server sent a "cache-control: no-
store" response header.
nsILoginInfo
nsilogininfo is an object containing information for a login
stored by the login manager.
...forms with no action attribute default to submitting to their origin url, so that is
stored here.
... a blank value indicates the login was
stored before bug 360493 was fixed.
nsIPrefLocalizedString
inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void setdatawithlength(in unsigned long length, [size_is(length)] in wstring data); wstring tostring(); attributes attribute type description data wstring provides access to string data
stored in this property.
... data the string data to be
stored.
...return value returns wstring - the string containing the data
stored within this object.
nsISHEntry
the child shells are re
stored as children of the parent docshell, in this order, when the parent docshell re
stores a saved presentation.
...nsicontentviewer getanycontentviewer( out nsishentry ownerentry ); parameters ownerentry return value getscrollposition() void getscrollposition( out long x, out long y ); parameters x y native code only!getviewerbounds saved position and dimensions of the content viewer; we must adjust the root view's widget accordingly if this has changed when the presentation is re
stored.
...example see nssession
store.js for a real example.
nsITreeColumns
inherits from: nsisupports method overview nsitreecolumn getcolumnat(in long index); nsitreecolumn getcolumnfor(in nsidomelement element); nsitreecolumn getfirstcolumn(); nsitreecolumn getkeycolumn(); nsitreecolumn getlastcolumn(); nsitreecolumn getnamedcolumn(in astring id); nsitreecolumn getprimarycolumn(); nsitreecolumn getsortedcolumn(); void invalidatecolumns(); void re
storenaturalorder(); attributes attribute type description count long the number of columns.
...re
storenaturalorder() re
store the original order of the columns before the user moved them.
... void re
storenaturalorder(); parameters none.
nsIWindowsShellService
inherits from: nsishellservice last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview string getregistryentry(in long ahkeyconstant, in string asubkeyname, in string avaluename); obsolete since gecko 1.8 void re
storefilesettings(in boolean aforallusers); obsolete since gecko 1.9 void shortcutmaintenance(); attributes attribute type description desktopbackgroundcolor unsigned long the desktop background color, visible when no background image is used, or if the background image is centered and does not fill the entire screen.
... re
storefilesettings() obsolete since gecko 1.9 (firefox 3) re
stores system settings to what they were before firefox modified them.
... void re
storefilesettings( in boolean aforallusers ); parameters aforallusers whether or not firefox should re
store settings for all users on a multi-user system.
nsIXPConnect
void reparentscopeawarewrappers(in jscontextptr ajscontext, in jsobjectptr aoldscope, in jsobjectptr anewscope); obsolete since gecko 1.9.1 nsixpconnectjsobjectholder reparentwrappednativeiffound(in jscontextptr ajscontext, in jsobjectptr ascope, in jsobjectptr anewparent, in nsisupports acomobj); void re
storewrappednativeprototype(in jscontextptr ajscontext, in jsobjectptr ascope, in nsiclassinfo aclassinfo, in nsixpconnectjsobjectholder aprototype); void setdebugmodewhenpossible(in prbool mode); native code only!
...ctjsobjectholder reparentwrappednativeiffound( in jscontextptr ajscontext, in jsobjectptr ascope, in jsobjectptr anewparent, in nsisupports acomobj ); parameters ajscontext missing description ascope missing description anewparent missing description acomobj missing description return value missing description exceptions thrown missing exception missing description re
storewrappednativeprototype() re
store an old prototype for wrapped natives of type aclassinfo.
... void re
storewrappednativeprototype( in jscontextptr ajscontext, in jsobjectptr ascope, in nsiclassinfo aclassinfo, in nsixpconnectjsobjectholder aprototype ); parameters ajscontext missing description ascope missing description aclassinfo missing description aprototype missing description exceptions thrown missing exception missing description native code only!setdebugmodewhenpossible when we place the browser in js debug mode, there can't be any js on the stack.
Storage
note: storage is not the same as the dom:storage feature which can be used by web pages to
store persistent data or the session
store api (an xpcom storage utility for use by extensions).
...this extension is treated specially by windows as a known extension for an 'application compatibility database' and changes are backed up by the system automatically as part of system re
store functionality.
... nscomptr<mozistoragestatement> statement; // mdbconn is a database connection that is
stored a member variable of the class.
Using the clipboard
const nssupportsstring = components.constructor("@mozilla.org/supports-string;1", "nsisupportsstring"); function supportsstring(str) { // create an instance of the supports-string class var res = nssupportsstring(); //
store the javascript string that we want to wrap in the new nsisupportsstring object res.data = str; return res; } // create a constructor for the built-in transferable class const nstransferable = components.constructor("@mozilla.org/widget/transferable;1", "nsitransferable"); // create a wrapper to construct an nsitransferable instance and set its source to the given window, when necessary ...
...now that we have the object to copy, a transferring object needs to be created: var str = "text to copy"; var trans = transferable(sourcewindow); trans.adddataflavor("text/unicode"); // we multiply the length of the string by 2, since it's
stored in 2-byte utf-16 // format internally.
... services.clipboard.setdata(trans, null, services.clipboard.kglobalclipboard); we get the system clipboard object and
store it in the clip variable.
Index
the reason this file name scheme was chosen was is this is how netscape 7.0 im
stores buddy icons on disk.
...thunderbird's front-end code is
stored in mozilla/mail.
... training data is global across all mail accounts within a profile training data is
stored in a binary format, in a file named "training.dat".
Using COM from js-ctypes
; let aflags = spf_default; primative_hr = spvoice.speak(spvoiceptr, atext, aflags, 0); checkhresult(primative_hr, "cocreateinstance"); } catch (ex) { console.error('ex occured:', ex); } finally { if (spvoice) { spvoice.release(spvoiceptr); } couninitialize(); } } main(); lib.close(); other examples shgetproperty
storeforwindow - this examples shows that coinit is not needed, some winapi functions return the interface.
... this example uses iproperty
store::setvalue to change the system.usermodelapp.id of an open firefox window.
... example a - based on bugzilla :: bug 738501 - attachement 608538 exmaple b - based on example a ishelllink & ipersistfile & iproperty
store - uses iproperty
store to set and get the system.usermodelapp.id on shortcut files.
Debugging service workers - Firefox Developer Tools
testing a service worker cache if you are using your service worker to
store your site assets in cache storage (using the cache api), which is essential for creating offline apps, it can be annoying to test the cache.
... the firefox devtools’ storage tab has a cache storage section that lists all the different caches you have
stored under each different origin.
... 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.
Extension Storage - Firefox Developer Tools
this table contains the following columns: key — the name of the
stored item.
... value — the value of the
stored item.
... storage area — the name of the area where the item is
stored.
Cache.put() - Web APIs
fetch(url).then(function(response) { if (!response.ok) { throw new typeerror('bad response status'); } return cache.put(url, response); }) note: put() will overwrite any key/value pair previously
stored in the cache that matches the request.
... note: cache.add/cache.addall do not cache responses with response.status values that are not in the 200 range, whereas cache.put lets you
store any request/response pair.
... as a result, cache.add/cache.addall can't be used to
store opaque responses, whereas cache.put can.
Compositing example - Web APIs
0, 0, width/2, height/2); ctx.globalcompositeoperation = pop; ctx.drawimage(canvas2, 0, 0, width/2, height/2); ctx.globalcompositeoperation = "source-over"; ctx.fillstyle = "rgba(0,0,0,0.8)"; ctx.fillrect(0, height/2 - 20, width/2, 20); ctx.fillstyle = "#fff"; ctx.font = "14px arial"; ctx.filltext(pop, 5, height/2 - 5); ctx.re
store(); var ctx = canvastodrawon.getcontext('2d'); ctx.clearrect(0, 0, width, height) ctx.save(); ctx.drawimage(canvas1, 0, 0, width/2, height/2); ctx.fillstyle = "rgba(0,0,0,0.8)"; ctx.fillrect(0, height/2 - 20, width/2, 20); ctx.fillstyle = "#fff"; ctx.font = "14px arial"; ctx.filltext('existing content', 5, height/2 - 5); ...
... ctx.re
store(); var ctx = canvastodrawfrom.getcontext('2d'); ctx.clearrect(0, 0, width, height) ctx.save(); ctx.drawimage(canvas2, 0, 0, width/2, height/2); ctx.fillstyle = "rgba(0,0,0,0.8)"; ctx.fillrect(0, height/2 - 20, width/2, 20); ctx.fillstyle = "#fff"; ctx.font = "14px arial"; ctx.filltext('new content', 5, height/2 - 5); ctx.re
store(); dd.appendchild(canvastodrawon); dd.appendchild(canvastodrawfrom); dd.appendchild(canvastodrawresult); dl.appendchild(dd); } }; utility functions the program relies on a number of utility functions.
...ion = "lighter"; ctx.beginpath(); ctx.fillstyle = "rgba(255,0,0,1)"; ctx.arc(100, 200, 100, math.pi*2, 0, false); ctx.fill() ctx.beginpath(); ctx.fillstyle = "rgba(0,0,255,1)"; ctx.arc(220, 200, 100, math.pi*2, 0, false); ctx.fill() ctx.beginpath(); ctx.fillstyle = "rgba(0,255,0,1)"; ctx.arc(160, 100, 100, math.pi*2, 0, false); ctx.fill(); ctx.re
store(); ctx.beginpath(); ctx.fillstyle = "#f00"; ctx.fillrect(0,0,30,30) ctx.fill(); }; var colorsphere = function(element) { var ctx = canvas1.getcontext("2d"); var width = 360; var halfwidth = width / 2; var rotate = (1 / 360) * math.pi * 2; // per degree var offset = 0; // scrollbar offset var oleft = -20; var otop = -20; for (var n = 0; n <= 359; n...
Element: mousedown event - Web APIs
when the page loads, constants mypics and context are created to
store a reference to the canvas and the 2d context we will use to draw.
...first we
store the x and y coordinates of the mouse pointer in the variables x and y, and then set isdrawing to true.
...if isdrawing is true, the event handler calls the drawline function to draw a line from the
stored x and y values to the current location.
Element: mousemove event - Web APIs
when the page loads, constants mypics and context are created to
store a reference to the canvas and the 2d context we will use to draw.
...first we
store the x and y coordinates of the mouse pointer in the variables x and y, and then set isdrawing to true.
...if isdrawing is true, the event handler calls the drawline function to draw a line from the
stored x and y values to the current location.
Element: mouseup event - Web APIs
when the page loads, constants mypics and context are created to
store a reference to the canvas and the 2d context we will use to draw.
...first we
store the x and y coordinates of the mouse pointer in the variables x and y, and then set isdrawing to true.
...if isdrawing is true, the event handler calls the drawline function to draw a line from the
stored x and y values to the current location.
Introduction to the File and Directory Entries API - Web APIs
if you are targeting chrome for your app and you want to
store blobs, the file and directory entries api and app cache are your only choices.
... offline web mail client the client downloads attachments and
stores them locally.
...a blob is a set of binary data that is
stored as a single object.
History.scrollRestoration - Web APIs
syntax const scrollre
store = history.scrollrestoration values auto the location on the page to which the user has scrolled will be re
stored.
... manual the location on the page is not re
stored.
... const scrollrestoration = history.scrollrestoration if (scrollrestoration === 'manual') { console.log('the location on the page is not re
stored, user will need to scroll manually.'); } prevent automatic page location restoration if (history.scrollrestoration) { history.scrollrestoration = 'manual'; } specifications specification status comment html living standardthe definition of 'scroll restoration mode' in that specification.
IDBDatabase: abort event - Web APIs
// open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an object
store for this database const object
store = db.createobject
store('todolist', { keypath: 'tasktitle' }); // define what data items the object
store will contain object
store.createindex('hours', 'hours', { unique: false }); object
store.createindex('minutes', 'minutes', { unique: false }); object
store.createindex('day', 'day', { unique: false }); object
store.createindex('month', 'month', { uni...
...que: false }); object
store.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const db = dbopenrequest.result; db.addeventlistener('abort', () => { console.log('transaction aborted'); }); // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); // abort the transaction transaction.abort(); }; the same example, but assigning the event handler to the onabort property: // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an object
store for this database const object
store = db.createobject
store('todolist', { keypath: 'tasktitle' }); // define...
... what data items the object
store will contain object
store.createindex('hours', 'hours', { unique: false }); object
store.createindex('minutes', 'minutes', { unique: false }); object
store.createindex('day', 'day', { unique: false }); object
store.createindex('month', 'month', { unique: false }); object
store.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const db = dbopenrequest.result; db.onabort = () => { console.log('transaction aborted'); }; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); // abort the transaction transaction.abort(); }; ...
IDBDatabase: close event - Web APIs
bubbles no cancelable no interface event event handler property onerror examples this example opens a database and listens for the close event: // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an object
store for this database const object
store = db.createobject
store('todolist', { keypath: 'tasktitle' }); // define what data items the object
store will contain object
store.createindex('hours', 'hours', { unique: false }); object
store.createindex('minutes', 'minutes', { unique: false }); object
store.createindex('day', 'day', { unique: false }); object
store.createindex('month', 'month', { uni...
...que: false }); object
store.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const db = dbopenrequest.result; db.addeventlistener('close', () => { console.log('database connection closed'); }); }; the same example, using the onclose property instead of addeventlistener(): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an object
store for this database const object
store = db.createobject
store('todolist', { keypath: 'tasktitle' }); // define what data items the object
store will contain object
store.createindex('hours', 'hours', { unique: false }); object
store.createindex('minutes', 'minutes', { unique: false...
... }); object
store.createindex('day', 'day', { unique: false }); object
store.createindex('month', 'month', { unique: false }); object
store.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const db = dbopenrequest.result; db.onclose = () => { console.log('database connection closed'); }; }; ...
IDBDatabase.onabort - Web APIs
}; example this example shows an idbopendbrequest.onupgradeneeded block that creates a new object
store; it also includes onerror and onabort functions to handle non-success cases.
... dbopenrequest.onupgradeneeded = function(event) { var db = event.target.result; db.onerror = function() { note.innerhtml += '<li>error opening database.</li>'; }; db.onabort = function() { note.innerhtml += '<li>database opening aborted!</li>'; }; // create an object
store for this database var object
store = db.createobject
store("todolist", { keypath: "tasktitle" }); // define what data items the object
store will contain object
store.createindex("hours", "hours", { unique: false }); object
store.createindex("minutes", "minutes", { unique: false }); object
store.createindex("day", "day", { unique: false }); object
store.createindex("month", "month", { unique: false }); object
store.createindex("year", "year", { unique: false }); object
store.createindex("not...
...ified", "notified", { unique: false }); note.innerhtml += '<li>object
store created.</li>'; }; specifications specification status comment indexed database api 2.0the definition of 'onabort' in that specification.
IDBDatabase.onerror - Web APIs
} example this example shows an idbopendbrequest.onupgradeneeded block that creates a new object
store; it also includes onerror and onabort functions to handle non-success cases.
... dbopenrequest.onupgradeneeded = function(event) { var db = this.result; db.onerror = function(event) { note.innerhtml += '<li>error opening database.</li>'; }; db.onabort = function(event) { note.innerhtml += '<li>database opening aborted!</li>'; }; // create an object
store for this database var object
store = db.createobject
store("todolist", { keypath: "tasktitle" }); // define what data items the object
store will contain object
store.createindex("hours", "hours", { unique: false }); object
store.createindex("minutes", "minutes", { unique: false }); object
store.createindex("day", "day", { unique: false }); object
store.createindex("month", "month", { unique: false }); object
store.createindex("year", "year", { unique: false }); object
store.createindex("n...
...otified", "notified", { unique: false }); note.innerhtml += '<li>object
store created.</li>'; }; specifications specification status comment indexed database api 2.0the definition of 'onerror' in that specification.
IDBDatabase.onversionchange - Web APIs
} example this example shows an idbopendbrequest.onupgradeneeded block that creates a new object
store; it also includes onerror and onabort functions to handle non-success cases, and an onversionchange function to notify when a database structure change has occurred.
... request.onupgradeneeded = function(event) { var db = event.target.result; db.onerror = function(event) { note.innerhtml += '<li>error opening database.</li>'; }; db.onabort = function(event) { note.innerhtml += '<li>database opening aborted!</li>'; }; // create an object
store for this database var object
store = db.createobject
store("todolist", { keypath: "tasktitle" }); // define what data items the object
store will contain object
store.createindex("hours", "hours", { unique: false }); object
store.createindex("minutes", "minutes", { unique: false }); object
store.createindex("day", "day", { unique: false }); object
store.createindex("month", "month", { unique: false }); object
store.createindex("year", "year", { unique: false }); object
store.createindex(...
..."notified", "notified", { unique: false }); note.innerhtml += '<li>object
store created.</li>'; db.onversionchange = function(event) { note.innerhtml += '<li>a database change has occurred; you should refresh this browser window, or close it down and use the other open version of this application, wherever it exists.</li>'; }; }; specifications specification status comment indexed database api 2.0the definition of 'onversionchange' in that specification.
IDBDatabase: versionchange event - Web APIs
ubbles 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 object
store for this database const object
store = db.createobject
store('todolist', { keypath: 'tasktitle' }); // define what data items the object
store will contain object
store.createindex('hours', 'hours', { unique: false }); object
store.createindex('minutes', 'minutes', { unique: false }); object
store.createindex('day', 'day', { unique: false }); object
store.createindex('month', 'month', { uni...
...que: false }); object
store.createindex('year', 'year', { unique: false }); }; dbopenrequest.addeventlistener('success', event => { const db = event.target.result; db.addeventlistener('versionchange', event => { console.log('the version of this database has changed'); }); }); the same example, using the onversionchange event handler property: // open the database const dbopenrequest = window.indexeddb.open('nonexistent', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; // create an object
store for this database const object
store = db.createobject
store('todolist', { keypath: 'tasktitle' }); // define what data items the object
store will contain object
store.createindex('hours', 'hours', { unique: false }); object
store.createindex('minutes...
...', 'minutes', { unique: false }); object
store.createindex('day', 'day', { unique: false }); object
store.createindex('month', 'month', { unique: false }); object
store.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = event => { const db = event.target.result; db.onversionchange = event => { console.log('the version of this database has changed'); }; }; ...
IDBIndex.count() - Web APIs
example in the following example we open a transaction and an object
store, then get the index lname from a simple contacts database.
... we then open a basic cursor on the index using idbindex.opencursor — this works the same as opening a cursor directly on an object
store using idbobject
store.opencursor except that the returned records are sorted based on the index, not the primary key.
...for a complete working example, see our idbindex-example demo repo (view the example live.) function displaydatabyindex() { tableentry.innerhtml = ''; var transaction = db.transaction(['contactslist'], 'readonly'); var object
store = transaction.object
store('contactslist'); var myindex = object
store.index('lname'); var countrequest = myindex.count(); countrequest.onsuccess = function() { console.log(countrequest.result); } myindex.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tablerow = document.createelement('tr'); tablerow.innerhtml = '<...
IDBIndex.getKey() - Web APIs
example in the following example we open a transaction and an object
store, then get the index lname from a simple contacts database.
... we then open a basic cursor on the index using idbindex.opencursor — this works the same as opening a cursor directly on an object
store using idbobject
store.opencursor except that the returned records are sorted based on the index, not the primary key.
...for a complete working example, see our idbindex-example demo repo (view the example live.) function displaydatabyindex() { tableentry.innerhtml = ''; var transaction = db.transaction(['contactslist'], 'readonly'); var object
store = transaction.object
store('contactslist'); var myindex = object
store.index('lname'); var getkeyrequest = myindex.getkey('bungle'); getkeyrequest.onsuccess = function() { console.log(getkeyrequest.result); } myindex.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tablerow = document.createelement('tr'); tablerow.inne...
IDBIndex.keyPath - Web APIs
example in the following example we open a transaction and an object
store, then get the index lname from a simple contacts database.
... we then open a basic cursor on the index using idbindex.opencursor — this works the same as opening a cursor directly on an object
store using idbobject
store.opencursor except that the returned records are sorted based on the index, not the primary key.
...for a complete working example, see our idbindex-example demo repo (view the example live.) function displaydatabyindex() { tableentry.innerhtml = ''; var transaction = db.transaction(['contactslist'], 'readonly'); var object
store = transaction.object
store('contactslist'); var myindex = object
store.index('lname'); console.log(myindex.keypath); myindex.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tablerow = document.createelement('tr'); tablerow.innerhtml = '<td>' + cursor.value.id + '</td>' + '<td>' + cursor.value.lnam...
IDBKeyRange - Web APIs
records can be retrieved from idbobject
store and idbindex objects using keys or a range of keys.
...we open a transaction (using idbtransaction) and an object
store, and open a cursor with idbobject
store.opencursor, declaring keyrangevalue as its optional key range value.
... note: for a more complete example allowing you to experiment with key range, have a look at our idbkeyrange-example repo (view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.bound("a", "f"); var transaction = db.transaction(['fthings'], 'readonly'); var object
store = transaction.object
store('fthings'); object
store.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { conso...
IDBOpenDBRequest: blocked event - Web APIs
able no interface idbversionchangeevent event handler property onblocked examples using addeventlistener(): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an object
store for this database var object
store = db.createobject
store('todolist', { keypath: 'tasktitle' }); // define what data items the object
store will contain object
store.createindex('hours', 'hours', { unique: false }); object
store.createindex('minutes', 'minutes', { unique: false }); object
store.createindex('day', 'day', { unique: false }); object
store.createindex('month', 'month', { uniqu...
...e: false }); object
store.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { // let's try to open the same database with a higher revision version const req2 = indexeddb.open('todolist', 5); // in this case the onblocked handler will be executed req2.addeventlistener('blocked', () => { console.log('request was blocked'); }); }; using the onblocked property: // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an object
store for this database var object
store = db.createobject
store('todolist', { keypath: 'tasktitle' }); // define what data ite...
...ms the object
store will contain object
store.createindex('hours', 'hours', { unique: false }); object
store.createindex('minutes', 'minutes', { unique: false }); object
store.createindex('day', 'day', { unique: false }); object
store.createindex('month', 'month', { unique: false }); object
store.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { // let's try to open the same database with a higher revision version const req2 = indexeddb.open('todolist', 5); // in this case the onblocked handler will be executed req2.onblocked = () => { console.log('request was blocked'); }; }; ...
IDBOpenDBRequest: upgradeneeded event - Web APIs
bubbles no cancelable no interface event event handler onupgradeneeded examples this example opens a database and handles the upgradeneeded event by making any necessary updates to the object
store.
... // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.addeventlistener('upgradeneeded', event => { const db = event.target.result; console.log(`upgrading to version ${db.version}`); // create an object
store for this database var object
store = db.createobject
store('todolist', { keypath: 'tasktitle' }); // define what data items the object
store will contain object
store.createindex('hours', 'hours', { unique: false }); object
store.createindex('minutes', 'minutes', { unique: false }); object
store.createindex('day', 'day', { unique: false }); object
store.createindex('month', 'month', { unique: false }); object
store.createindex('year', 'year', { unique: false }); }); this is the same example, but uses the onupgradeneeded event handler...
... // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; console.log(`upgrading to version ${db.version}`); // create an object
store for this database var object
store = db.createobject
store('todolist', { keypath: 'tasktitle' }); // define what data items the object
store will contain object
store.createindex('hours', 'hours', { unique: false }); object
store.createindex('minutes', 'minutes', { unique: false }); object
store.createindex('day', 'day', { unique: false }); object
store.createindex('month', 'month', { unique: false }); object
store.createindex('year', 'year', { unique: false }); }; ...
IDBOpenDBRequest - Web APIs
dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; //
store the result of opening the database in the db // variable.
...he database needs to be created either one has not // been created before, or a new version number has been // submitted via the window.indexeddb.open line above // it is only implemented in recent browsers dbopenrequest.onupgradeneeded = function(event) { var db = this.result; db.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; // create an object
store for this database var object
store = db.createobject
store("todolist", { keypath: "tasktitle" }); // define what data items the object
store will contain object
store.createindex("hours", "hours", { unique: false }); object
store.createindex("minutes", "minutes", { unique: false }); object
store.createindex("day", "day", { unique: false }); object
store.createindex("month", "month", { ...
...unique: false }); object
store.createindex("year", "year", { unique: false }); object
store.createindex("notified", "notified", { unique: false }); }; specifications specification status comment indexed database api 2.0the definition of 'idbopendbrequest' in that specification.
IDBRequest.onerror - Web APIs
}; example the following example requests a given record title, onsuccess gets the associated record from the idbobject
store (made available as object
storetitlerequest.result), updates one property of the record, and then puts the updated record back into the object
store.
...for a full working example, see our to-do notifications app (view example live.) var title = "walk dog"; // open up a transaction as usual var object
store = db.transaction(['todolist'], "readwrite").object
store('todolist'); // get the to-do list object that has this title as it's title var object
storetitlerequest = object
store.get(title); object
storetitlerequest.onsuccess = function() { // grab the data object returned as the result var data = object
storetitlerequest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item back // into the database var updatetitlerequest = object
store.put(data); ...
... // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; object
storetitlerequest.onerror = function() { // if an error occurs with the request, log what it is console.log("there has been an error with retrieving your data: " + object
storetitlerequest.error); // todo what about event parameter into onerror()?
IDBRequest: success event - Web APIs
t handler property onsuccess examples this example tries to open a database and listens for the success event using addeventlistener(): // open the database const openrequest = window.indexeddb.open('todolist', 4); openrequest.onupgradeneeded = (event) => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an object
store for this database var object
store = db.createobject
store('todolist', { keypath: 'tasktitle' }); // define what data items the object
store will contain object
store.createindex('hours', 'hours', { unique: false }); object
store.createindex('minutes', 'minutes', { unique: false }); object
store.createindex('day', 'day', { unique: false }); object
store.createindex('month', 'month', { uniqu...
...e: false }); object
store.createindex('year', 'year', { unique: false }); }; openrequest.addeventlistener('success', (event) => { console.log('database opened successfully!'); }); the same example, but using the onsuccess event handler property: // open the database const openrequest = window.indexeddb.open('todolist', 4); openrequest.onupgradeneeded = (event) => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an object
store for this database var object
store = db.createobject
store('todolist', { keypath: 'tasktitle' }); // define what data items the object
store will contain object
store.createindex('hours', 'hours', { unique: false }); object
store.createindex('minutes', 'minutes', { unique: false }); obj...
...ect
store.createindex('day', 'day', { unique: false }); object
store.createindex('month', 'month', { unique: false }); object
store.createindex('year', 'year', { unique: false }); }; openrequest.onsuccess = (event) => { console.log('database opened successfully!'); }; ...
IDBTransaction.abort() - Web APIs
example in the following code snippet, we open a read/write transaction on our database and add some data to an object
store.
...for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; //
store the result of opening the database in the db variable.
...duplicate items not allowed.</li>'; }; // create an object
store on the transaction var object
store = transaction.object
store("todolist"); // add our newitem object to the object
store var object
storerequest = object
store.add(newitem[0]); object
storerequest.onsuccess = function(event) { // report the success of the request (this does not mean the item // has been
stored successfully in the db - for that you need transaction.onsuccess) not...
IDBTransaction: abort event - Web APIs
// open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an object
store for this database var object
store = db.createobject
store('todolist', { keypath: 'tasktitle' }); // define what data items the object
store will contain object
store.createindex('hours', 'hours', { unique: false }); object
store.createindex('minutes', 'minutes', { unique: false }); object
store.createindex('day', 'day', { unique: false }); object
store.createindex('month', 'month', { uniqu...
...e: false }); object
store.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = event => { const db = dbopenrequest.result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); // add a listener for `abort` transaction.addeventlistener('abort', () => { console.log('transaction was aborted'); }); // abort the transaction transaction.abort(); }; the same example, but assigning the event handler to the onabort property: // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an object
store ...
...for this database var object
store = db.createobject
store('todolist', { keypath: 'tasktitle' }); // define what data items the object
store will contain object
store.createindex('hours', 'hours', { unique: false }); object
store.createindex('minutes', 'minutes', { unique: false }); object
store.createindex('day', 'day', { unique: false }); object
store.createindex('month', 'month', { unique: false }); object
store.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = event => { const db = dbopenrequest.result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); // add a listener for `abort` transaction.onabort = (event) => { console.log('transaction was aborted'); }; //...
IDBTransaction.db - Web APIs
example in the following code snippet, we open a read/write transaction on our database and add some data to an object
store.
...for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; //
store the result of opening the database in the db variable.
...duplicate items not allowed.</li>'; }; // create an object
store on the transaction var object
store = transaction.object
store("todolist"); // add our newitem object to the object
store var object
storerequest = object
store.add(newitem[0]); object
storerequest.onsuccess = function(event) { // report the success of the request (this does not mean the item // has been
stored successfully in the db - for that you need transaction.onsuccess) not...
IDBTransaction.error - Web APIs
example in the following code snippet, we open a read/write transaction on our database and add some data to an object
store.
...for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; //
store the result of opening the database in the db variable.
...nsaction(["todolist"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error: ' + transaction.error + '</li>'; }; // create an object
store on the transaction var object
store = transaction.object
store("todolist"); // add our newitem object to the object
store var object
storerequest = object
store.add(newitem[0]); object
storerequest.onsuccess = function(event) { // report the success of the request (this does not mean the item // has been
stored successfully in the db - for that you need transaction.onsuccess) not...
IDBTransaction.onabort - Web APIs
}; example in the following code snippet, we open a read/write transaction on our database and add some data to an object
store.
...for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; //
store the result of opening the database in the db variable.
...ansaction(["todolist"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error: ' + transaction.error + '</li>'; }; // create an object
store on the transaction var object
store = transaction.object
store("todolist"); // add our newitem object to the object
store var object
storerequest = object
store.add(newitem[0]); object
storerequest.onsuccess = function(event) { // report the success of the request (this does not mean the item // has been
stored successfully in the db - for that you need transaction.onsuccess) not...
IDBTransaction.oncomplete - Web APIs
}; example in the following code snippet, we open a read/write transaction on our database and add some data to an object
store.
...for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; //
store the result of opening the database in the db variable.
...ansaction(["todolist"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error: ' + transaction.error + '</li>'; }; // create an object
store on the transaction var object
store = transaction.object
store("todolist"); // add our newitem object to the object
store var object
storerequest = object
store.add(newitem[0]); object
storerequest.onsuccess = function(event) { // report the success of the request (this does not mean the item // has been
stored successfully in the db - for that you need transaction.oncomplete) no...
IDBTransaction.onerror - Web APIs
}; example in the following code snippet, we open a read/write transaction on our database and add some data to an object
store.
...for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; //
store the result of opening the database in the db variable.
...nsaction(["todolist"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error: ' + transaction.error + '</li>'; }; // create an object
store on the transaction var object
store = transaction.object
store("todolist"); // add our newitem object to the object
store var object
storerequest = object
store.add(newitem[0]); object
storerequest.onsuccess = function(event) { // report the success of the request (this does not mean the item // has been
stored successfully in the db - for that you need transaction.onsuccess) not...
IDBVersionChangeRequest.setVersion() - Web APIs
for older webkit browsers, call this method before creating or deleting an object
store.
...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.
Timing element visibility with the Intersection Observer API - Web APIs
previouslyvisibleads used to temporarily
store the list of visible ads while the document is not visible (for example, if the user has tabbed to another page).
... refreshintervalid used to
store the interval id returned by setinterval().
...to do so, we begin by saving the set of visible ads into a variable known as previouslyvisibleads to be sure we can re
store them when the user tabs back into the document, and we then empty the visibleads set so they won't be treated as visible.
KeyboardEvent.charCode - Web APIs
og a <code>charcode</code>.</p> <input type="text" /> <p id="log"></p> javascript let input = document.queryselector('input'); let log = document.queryselector('#log'); input.addeventlistener('keypress', function(e) { log.innertext = `key pressed: ${string.fromcharcode(e.charcode)}\ncharcode: ${e.charcode}`; }); result notes in a keypress event, the unicode value of the key pressed is
stored in either the keycode or charcode property, but never both.
...otherwise, the code of the pressed key is
stored in keycode.
... to get the code of the key regardless of whether it was
stored in keycode or charcode, query the which property.
NavigatorStorage - Web APIs
the navigatorstorage mixin adds to the navigator and workernavigator interfaces the navigator.storage property, which provides access to the storagemanager singleton used for controlling the persistence of data
stores as well as obtaining information note: this feature is available in web workers.
... there are many apis which provide ways for web content to
store data on a user's computer, including cookies, the web storage api (window.localstorage and window.sessionstorage), and indexeddb.
...through the returned object, you can control persistence of data
stores as well as get estimates of how much space is left for your site or appliation to
store data.
Using the Notifications API - Web APIs
it
stores data locally using indexeddb and notifies users when tasks are due using system notifications.
... <button id="enable">enable notifications</button> clicking this calls the asknotificationpermission() function: function asknotificationpermission() { // function to actually ask the permissions function handlepermission(permission) { // whatever the user answers, we make sure chrome
stores the information if(!('permission' in notification)) { notification.permission = permission; } // set the button to shown or hidden, depending on what the user answers if(notification.permission === 'denied' || notification.permission === 'default') { notificationbtn.style.display = 'block'; } else { notificationbtn.style.display = 'none'; } } // le...
... to avoid duplicating code, we have
stored a few bits of housekeeping code inside the handlepermission() function, which is the first main block inside this snippet.
WebGL2RenderingContext - Web APIs
buffers webgl2renderingcontext.bufferdata() initializes and creates the buffer object's data
store.
... webgl2renderingcontext.buffersubdata() updates a subset of a buffer object's data
store.
... webgl2renderingcontext.renderbufferstoragemultisample() creates and initializes a renderbuffer object's data
store and allows specifying the number of samples to be used.
Data in WebGL - Web APIs
each kind of variable is accessible by one or both types of shader program (depending on the data
store type) and possibly by the site's javascript code, depending on the specific type of variable.
...attributes are typically used to
store color information, texture coordinates, and any other data calculated or retrieved that needs to be shared between the javascript code and the vertex shader.
... vec4( 1.0, 0.0, 0.0, 1.0 ), // red vec4( 1.0, 1.0, 0.0, 1.0 ), // yellow vec4( 0.0, 1.0, 0.0, 1.0 ), // green vec4( 0.0, 0.0, 0.0, 1.0 ), // black vec4( 1.0, 0.0, 0.0, 1.0 ), // red vec4( 1.0, 1.0, 0.0, 1.0 ), // yellow vec4( 0.0, 1.0, 0.0, 1.0 ), // green ]; var cbuffer = gl.createbuffer(); //continued //create buffer to
store colors and reference it to "vcolor" which is in glsl gl.bindbuffer( gl.array_buffer, cbuffer ); gl.bufferdata( gl.array_buffer, flatten(vertexcolors), gl.static_draw ); var vcolor = gl.getattriblocation( program, "vcolor" ); gl.vertexattribpointer( vcolor, 4, gl.float, false, 0, 0 ); gl.enablevertexattribarray( vcolor ); //glsl attribute vec4 vcolor; void main() { fcol...
Adding 2D content to a WebGL context - Web APIs
this information can then be
stored in varyings or attributes as appropriate to be shared with the fragment shader.
...since the attribute and uniform locations are specific to a single shader program we'll
store them together to make them easy to pass around const programinfo = { program: shaderprogram, attriblocations: { vertexposition: gl.getattriblocation(shaderprogram, 'avertexposition'), }, uniformlocations: { projectionmatrix: gl.getuniformlocation(shaderprogram, 'uprojectionmatrix'), modelviewmatrix: gl.getuniformlocation(shaderprogram, 'umodelviewmatrix'), ...
...it starts by calling the gl object's createbuffer() method to obtain a buffer into which we'll
store the vertex positions.
Using DTMF with WebRTC - Web APIs
dialbutton and logelement these variables will be used to
store references to the dial button and the <div> into which logging information will be written.
... then a second rtcpeerconnection, this one representing the receiving end of the call, is created and
stored in receiverpc; its onicecandidate event handler is set up too.
...if so, we log the fact that we're about to send the dtmf, then we call dtmf.insertdtmf() to send the dtmf on the same track as the audio data method on the rtcdtmfsender object we previously
stored in dtmfsender.
Privileged features - Web APIs
dialog the dialog feature removes all icons (re
store, minimize, maximize) from the window's titlebar, leaving only the close button.
...dialog windows are windows which have no minimize system command icon and no maximize/re
store down system command icon on the titlebar nor in correspondent menu item in the command system menu.
...in ns 6.x, the alwayslowered window has no minimize system command icon and no re
store/maximize system command.
Window: popstate event - Web APIs
it happens after the new location has loaded (if needed), displayed, made visible, and so on, after the pageshow event is sent, but before the persisted user state information is re
stored and the hashchange event is sent.
... if the browser has state information it wishes to
store with the current-entry before navigating away from it, it then does so.
... any persisted user state is re
stored, if the browser chooses to do so.
Window - Web APIs
domparser domparser can parse xml or html source
stored in a string into a dom document.
... window.localstorage read only returns a reference to the local storage object used to
store data that may only be accessed by the origin that created it.
... window.sessionstorage returns a reference to the session storage object used to
store data that may only be accessed by the origin that created it.
WindowOrWorkerGlobalScope.setTimeout() - Web APIs
pressing the first button will set a timeout which calls an alert dialog after two seconds and
stores the timeout id for use by cleartimeout().
... note: the minimum delay, dom_min_timeout_value, is 4 ms (
stored in a preference in firefox: dom.min_timeout_value), with a dom_clamp_timeout_nesting_level of 5.
... maximum delay value browsers including internet explorer, chrome, safari, and firefox
store the delay as a 32-bit signed integer internally.
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
solution: in gecko/mozilla, we did not want to
store an extra 32 bit unique id value on every object.
... if you're not using a hash table to keep track of unique id's,
store the child id's and objects for the last 50 or so events in a circular array.
... in mozilla, the client has another choice for tree navigation -- it can utilize data
stored in the dom via mozilla's custom isimpledomnode com interface.
HTTP conditional requests - HTTP
for unsafe methods, like put, which usually uploads a document, the conditional request can be used to upload the document, only if the original it is based on is the same as that
stored on the server.
... validators all conditional headers try to check if the resource
stored on the server matches a specific version.
...this is very common in any file system or source control applications, but any application that allows to
store remote resources needs such a mechanism.
Set-Cookie - HTTP
warning: many web browsers have a session re
store feature that will save all tabs and re
store them next time the browser is used.
... session cookies will also be re
stored, as if the browser was never closed.
...(however, confidential information should never be
stored in http cookies, as the entire mechanism is inherently insecure and doesn't encrypt any information.) note: insecure sites (http:) can't set cookies with the secure attribute (since chrome 52 and firefox 52).
Array.prototype.push() - JavaScript
the source for this interactive example is
stored in a github repository.
... note that we don't create an array to
store a collection of objects.
... instead, we
store the collection on the object itself and use call on array.prototype.push to trick the method into thinking we are dealing with an array—and it just works, thanks to the way javascript allows us to establish the execution context in any way we want.
JSON.stringify() - JavaScript
the source for this interactive example is
stored in a github repository.
... "bar", baz: "quux" }) //'{"foo":"bar","baz":"quux"}' var b = json.stringify({ baz: "quux", foo: "bar" }) //'{"baz":"quux","foo":"bar"}' console.log(a !== b) // true // some memoization functions use json.stringify to serialize arguments, // which may cause a cache miss when encountering the same object like above example of using json.stringify() with localstorage in a case where you want to
store an object created by your user and allowing it to be re
stored even after the browser has been closed, the following example is a model for the applicability of json.stringify(): // creating an example of json var session = { 'screens': [], 'state': true }; session.screens.push({ 'name': 'screena', 'width': 450, 'height': 250 }); session.screens.push({ 'name': 'screenb', 'width': 650, 'height...
... 390, 'height': 120 }); session.screens.push({ 'name': 'screenf', 'width': 1240, 'height': 650 }); // converting the json string with json.stringify() // then saving with localstorage in the name of session localstorage.setitem('session', json.stringify(session)); // example of how to transform the string generated through // json.stringify() and saved in localstorage in json object again var re
storedsession = json.parse(localstorage.getitem('session')); // now re
storedsession variable contains the object that was saved // in localstorage console.log(re
storedsession); well-formed json.stringify() engines implementing the well-formed json.stringify specification will stringify lone surrogates, any code point from u+d800 to u+dfff, using unicode escape sequences rather than literally.
Object.defineProperty() - JavaScript
the source for this interactive example is
stored in a github repository.
...if these methods use a variable to
store the value, this value will be shared by all objects.
... function myclass() { } object.defineproperty(myclass.prototype, "x", { get() { return this.
stored_x; }, set(x) { this.
stored_x = x; } }); var a = new myclass(); var b = new myclass(); a.x = 1; console.log(b.x); // undefined unlike accessor properties, value properties are always set on the object itself, not on a prototype.
Proxy - JavaScript
let validator = { set: function(obj, prop, value) { if (prop === 'age') { if (!number.isinteger(value)) { throw new typeerror('the age is not an integer'); } if (value > 200) { throw new rangeerror('the age seems invalid'); } } // the default behavior to
store the value obj[prop] = value; // indicate success return true; } }; const person = new proxy({}, validator); person.age = 100; console.log(person.age); // 100 person.age = 'young'; // throws an exception person.age = 300; // throws an exception extending constructor a function proxy could easily extend a constructor with a new constructor.
... let view = new proxy({ selected: null }, { set: function(obj, prop, newval) { let oldval = obj[prop]; if (prop === 'selected') { if (oldval) { oldval.setattribute('aria-selected', 'false'); } if (newval) { newval.setattribute('aria-selected', 'true'); } } // the default behavior to
store the value obj[prop] = newval; // indicate success return true; } }); let i1 = view.selected = document.getelementbyid('item-1'); //giving error here, i1 is null console.log(i1.getattribute('aria-selected')); // 'true' let i2 = view.selected = document.getelementbyid('item-2'); console.log(i1.getattribute('aria-selected')); // 'false' console.log(i2.getattribute('aria-selected...
...sers.length - 1]; } // the default behavior to return the value return obj[prop]; }, set: function(obj, prop, value) { // an extra property if (prop === 'latestbrowser') { obj.browsers.push(value); return true; } // convert the value if it is not an array if (typeof value === 'string') { value = [value]; } // the default behavior to
store the value obj[prop] = value; // indicate success return true; } }); console.log(products.browsers); // ['internet explorer', 'netscape'] products.browsers = 'firefox'; // pass a string (by mistake) console.log(products.browsers); // ['firefox'] <- no problem, the value is an array products.latestbrowser = 'chrome'; console.log(products.browsers); // ['firefox', 'chrome'] ...
TypedArray.prototype.set() - JavaScript
the set() method
stores multiple values in the typed array, reading input values from a specified array.
... the source for this interactive example is
stored in a github repository.
... exceptions a rangeerror, if the offset is set such as it would
store beyond the end of the typed array.
WebAssembly.Table() constructor - JavaScript
syntax new webassembly.table(tabledescriptor); parameters tabledescriptor an object that can contain the following members: element a string representing the type of value to be
stored in the table.
... the table2.wasm module contains two functions (one that returns 42 and another that returns 83) and
stores both into elements 0 and 1 of the imported table (see text representation).
... webassembly.instantiatestreaming(fetch('table2.wasm'), importobject) .then(function(obj) { console.log(tbl.length); console.log(tbl.get(0)()); console.log(tbl.get(1)()); }); note how you've got to include a second function invocation operator at the end of the accessor to actually invoke the referenced function and log the value
stored inside it (e.g.
WebAssembly.Table.prototype.get() - JavaScript
the get() prototype method of the webassembly.table() object retrieves a function reference
stored at a given index.
...it then retrieves the references
stored in the exported table.
... webassembly.instantiatestreaming(fetch('table.wasm')) .then(function(obj) { var tbl = obj.instance.exports.tbl; console.log(tbl.get(0)()); // 13 console.log(tbl.get(1)()); // 42 }); note how you've got to include a second function invocation operator at the end of the accessor to actually retrieve the value
stored inside the reference (e.g.
WebAssembly.Table.prototype.set() - JavaScript
the set() prototype method of the webassembly.table object mutates a reference
stored at a given index to a different value.
..., element:"anyfunc"}); console.log(tbl.length); console.log(tbl.get(0)); console.log(tbl.get(1)); we then create an import object that contains a reference to the table: var importobj = { js: { tbl:tbl } }; finally, we load and instantiate a wasm module (table2.wasm) using the webassembly.instantiatestreaming(), log the table length, and invoke the two referenced functions that are now
stored in the table (the table2.wasm module (see text representation) adds two function references to the table, both of which print out a simple value): webassembly.instantiatestreaming(fetch('table2.wasm'), importobject) .then(function(obj) { console.log(tbl.length); console.log(tbl.get(0)()); console.log(tbl.get(1)()); }); note how you've got to include a second function invocation operator ...
...at the end of the accessor to actually invoke the referenced function and log the value
stored inside it (e.g.
categories - Web app manifests
note: categories are used only as hints for catalogs or
stores listing web applications.
... like search engines and meta keywords, catalogs and
stores are free to ignore them.
... note: categories values are lower-cased by the
stores and catalogs before processing, so "news" and "news" are treated as the same value.
Media container formats (file types) - Web media technologies
in other cases, a particular codec,
stored in a certain container type, is so ubiquitous that the pairing is treated in a unique fashion.
... apple lossless (alac) no he-aac no mpeg-1 audio layer iii (mp3) no microsoft adpcm no µ-law 2:1 (u-law) no wave (wav) the waveform audio file format (wave), usually referred to simply as wav due to its filename extension being .wav, is a format developed by microsoft and ibm to
store audio bitstream data.
... the source for this interactive example is
stored in a github repository.
Introduction to progressive web apps - Progressive web apps (PWAs)
linkability one of the most powerful features of the web is the ability to link to an app at a specific url without the need for an app
store or complex installation process.
... this is achieved using a combination of technologies: service workers to control page requests (for example storing them offline), the cache api for storing responses to network requests offline (very useful for storing site assets), and client-side data storage technologies such as web storage and indexeddb to
store application data offline.
...this is very different from apps in app
stores, which may have a number of similarly-named apps, some of which may even be based on your own site, which only adds to the confusion.
Same-origin policy - Web security
(a "tuple" is a set of items that together comprise a whole — a generic form for double/triple/quadruple/quintuple/etc.) the following table gives examples of origin comparisons with the url http://
store.company.com/dir/page.html: url outcome reason http://
store.company.com/dir2/other.html same origin only the path differs http://
store.company.com/dir/inner/another.html same origin only the path differs https://
store.company.com/page.html failure different protocol http://
store.company.com:81/dir/page.html failure differe...
... for example, assume a script from the document at http://
store.company.com/dir/other.html executes the following: document.domain = "company.com"; afterward, the page can pass the same-origin check with http://company.com/dir/page.html (assuming http://company.com/dir/page.html sets its document.domain to "company.com" to indicate that it wishes to allow that - see document.domain for more).
... cross-origin data storage access access to data
stored in the browser such as web storage and indexeddb are separated by origin.
How to turn off form autocompletion - Web security
when the user visits the site again, the browser autofills the login fields with the
stored values.
... additionally, the browser enables the user to choose a master password that the browser will use to encrypt
stored login details.
...since users do not have to remember passwords that the browser
stores for them, they are able to choose stronger passwords than they would otherwise.
Types of attacks - Web security
xss attacks can be put into three categories:
stored (also called persistent), reflected (also called non-persistent), or dom-based.
...
stored xss attacks the injected script is
stored permanently on the target servers.
...this token should be unique per user and
stored (for example, in a cookie) such that the server can look up the expected value when the request is sent.
Content Scripts - Archive of obsolete content
sdk high-level and low-level apis, but can't access web content directly content scripts can't use the sdk's apis (no access to globals exports, require) but can access web content sdk apis that use content scripts, like page-mod and tabs, provide functions that enable the add-on's main code to load content scripts into web pages content scripts can be loaded in as strings, but are more often
stored as separate files under the add-on's "data" directory.
...pt option treats the string itself as a script: // main.js var pagemod = require("sdk/page-mod"); var contentscriptvalue = 'document.body.innerhtml = ' + ' "<h1>page matches ruleset</h1>";'; pagemod.pagemod({ include: "*.mozilla.org", contentscript: contentscriptvalue }); the contentscriptfile option treats the string as a resource:// url pointing to a script file
stored in your add-on's data directory.
Private Properties - Archive of obsolete content
a better approach would be to
store thumbnails in their own, separate hash map: let thumbnails = {}; function getthumbnail(image) { let thumbnail = thumbnails[image]; if (!thumbnail) { thumbnail = createthumbnail(image); thumbnails[image] = thumbnail; } return thumbnail; } there are two problems with the above approach.
...a better solution would be to
store all private properties on a single object, called a namespace, and then
store the namespace as a private property on the original object.
Module structure of the SDK - Archive of obsolete content
each module is a separate file
stored under your add-on's "lib" directory, and exports the objects you want to make available to other modules in your add-on.
... for example, the following add-on contains an additional module directly under "lib", and other modules under subdirectories of "lib": my-addon lib main.js password-dialog.js secrets hash.js storage password-
store.js to import modules into main: // main.js code var dialog = require("./password-dialog"); var hash = require("./secrets/hash"); to import modules into password-
store: // password-
store.js code var dialog = require("../password-dialog"); var hash = require("../secrets/hash"); external modules as well as using the sdk's modules and writing your own, you can use ...
Two Types of Scripts - Archive of obsolete content
each module is supplied as a script
stored under the lib directory under your add-on's root directory.
...if they are
stored in separate files you should
store them under the data directory under your add-on's root.
jpm - Archive of obsolete content
here is an example: # ignore .ds_
store files created by mac .ds_
store # ignore any zip or xpi files *.zip *.xpi a .jpmignore file with the above contents would ignore all zip files and .ds_
store files from the xpi generated by jpm xpi.
... this includes, for example, any extra add-ons you installed, or your history, or any data
stored using the simple-storage api.
jpmignore - Archive of obsolete content
here is an example: # ignore .ds_
store files created by mac .ds_
store # ignore any zip or xpi files *.zip *.xpi # ignore specific directory # you can start patterns with a forward slash (/) to avoid recursivity.
.../sample/ a .jpmignore file with the above contents would ignore all zip files and .ds_
store files and sample directory from the xpi generated by jpm xpi.
Canvas code snippets - Archive of obsolete content
t(canvas); } this.context = this.ctx = canvas.getcontext('2d'); if (!canvas2dcontext.prototype.arc) { canvas2dcontext.setup.call(this, this.ctx); } } canvas2dcontext.setup = function() { var methods = ['arc', 'arcto', 'beginpath', 'beziercurveto', 'clearrect', 'clip', 'closepath', 'drawimage', 'fill', 'fillrect', 'filltext', 'lineto', 'moveto', 'quadraticcurveto', 'rect', 're
store', 'rotate', 'save', 'scale', 'settransform', 'stroke', 'strokerect', 'stroketext', 'transform', 'translate']; var gettermethods = ['createpattern', 'drawfocusring', 'ispointinpath', 'measuretext', // drawfocusring not currently supported // the following might instead be wrapped to be able to chain their child objects 'createimagedata', 'createlineargradient', 'createradialgrad...
... ctx.clearrect(0, 0, remotecanvas.canvas_width, remotecanvas.canvas_height); ctx.save(); ctx.scale(remotecanvas.canvas_width / windowwidth, remotecanvas.canvas_height / windowheight); ctx.drawwindow(remotewindow, 0, 0, windowwidth, windowheight, 'rgb(255, 255, 255)'); ctx.re
store(); }; usage: var remotecanvas = new remotecanvas(); remotecanvas.load(); convert image files to base64 strings the following code gets a remote image and converts its content to data uri scheme.
Miscellaneous - Archive of obsolete content
see also http://mxr.mozilla.org/seamonkey/source/browser/base/content/browser.js#4674 discovering which element in the loaded document has focus // focusedcontrol
stores the focused field, or null if there is none.
... //put the cursor after the inserted text element.setselectionrange(selectionend, selectionend); } inserttext(document.getelementbyid("example"), "the text to be inserted"); disabling javascript programmatically // disable js in the currently active tab from the context of browser.xul gbrowser.docshell.allowjavascript = false; if this isn't your browser, you should save the value and re
store it when finished.
Delayed Execution - Archive of obsolete content
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 reference to the timer so that it's not reaped before it fires.
How to convert an overlay extension to restartless - Archive of obsolete content
how to get and load the data of of your add-on's files using the add-on manager api: // this is the old way of getting one of your files const myaddonid = ...; // just
store a constant with your id components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanager.getaddonbyid(myaddonid,function(addon) { var file = services.io.newuri("resource://myaddon/filename.ext",null,null) .queryinterface(components.interfaces.nsifileurl) .file; var stream = components.classes["@mozilla.org/network/file-in...
...the lazy getter magic will cause the file to be automatically loaded the first time it is needed, after which point a reference to the loaded string bundle will be
stored in "strings" for future accesses.
Security best practices in extensions - Archive of obsolete content
this is the same
store that holds the logins from web pages, and passwords can only be retrieved using a site/username pairing known to the author.
...the usefulness of it and power of how it works is best illustrated by the popular greasemonkey extension, which works on the premise of scripts being downloaded and
stored locally, to be injected into the web content context via the sandbox.
Signing an extension - Archive of obsolete content
mkdir key
store cd key
store nss-certutil -n -d .
...for production, use such a code: echo "enter password for object signing:" read mypassword nss-signtool \ -d /volumes/codesign/key
store \ -k "my company's verisign, inc.
Tabbed browser - Archive of obsolete content
xul: <menuitem oncommand="myextension.foo(event)" onclick="checkformiddleclick(this, event)" label="click me"/> js: var myextension = { foo: function(event) { openuilink("http://www.example.com", event, false, true); } } opening a url in an on demand tab cu.import("resource://gre/modules/xpcomutils.jsm"); xpcomutils.definelazyservicegetter(this, "gsession
store", "@mozilla.org/browser/session
store;1", "nsisession
store"); // create new tab, but don't load the content.
... var url = "https://developer.mozilla.org"; var tab = gbrowser.addtab(null, {relatedtocurrent: true}); gsession
store.settabstate(tab, json.stringify({ entries: [ { title: url } ], usertypedvalue: url, usertypedclear: 2, lastaccessed: tab.lastaccessed, index: 1, hidden: false, attributes: {}, image: null })); reusing tabs rather than open a new browser or new tab each and every time one is needed, it is good practice to try to re-use an existing tab which already displays the desired url--if one is already open.
JXON - Archive of obsolete content
the text content of each element is
stored into the keyvalue property, while nodeattributes, if they exist, are listed under the child object keyattributes.
...as above, the text content is
stored into the keyvalue property.
Notes on HTML Reflow - Archive of obsolete content
the reflow tree work, which will remove several commands from the queue at once.) a path is built from the target frame to the root frame and
stored in the reflow command.
... a reflow state object is created with a reflow reason of incremental, the reflow command is
stored in the state, and the reflow method of the root frame is invoked.
How Mozilla finds its configuration files - Archive of obsolete content
how mozilla finds its configuration files mozilla looks into the binary %userprofile%\application data\mozilla\registry.dat file for its "registry", which contains, amongst other information, a pointer to the directory where the profile is
stored (located at common/profiles/profilename/directory.
...the configuration itself is
stored in the specified directory, in a file named prefs.js.
How Thunderbird and Firefox find their configuration files - Archive of obsolete content
how thunderbird and firefox find their configuration files thunderbird looks into the binary %appdata%\thunderbird\profiles.ini file for its "registry", which contains, amongst other information, a pointer to the directory where the profile is
stored (usually located in %appdata%\thunderbird\profiles\profilename).
...the configuration itself is
stored in the specified directory, in a file named prefs.js.
Making a Mozilla installation modifiable - Archive of obsolete content
although mozilla
stores the ui files in jar archives, it can also access them in their original, unarchived form, which is useful for the extensions developer because it makes it unnecessary to extract the files from the archive before changing the code and then re-add them to the archive afterwards.
...the archives are
stored within the chrome subdirectory of the mozilla installation directory.
Drag and Drop Example - Archive of obsolete content
the ondrop handler first uses the createelement function to create a new element of the type
stored in the drag session.
...the values of the pagex and pagey properties
store the mouse pointer coordinates on the window where the drop occured.
Block and Line Layout Cheat Sheet - Archive of obsolete content
these are
stored as a doubly-linked list in the mlines member of nsblockframe.
... ll_understandsnwhitespace ll_textstartswithnbsp ll_firstletterstyleok ll_istopofpage ll_updatedband ll_impactedbyfloaters ll_lastfloaterwasletterframe ll_canplacefloater ll_knowstrictmode ll_instrictmode ll_lineendsinbr perframedata (why isn't this just
stored in the frame?) mflags pfd_relativepos pfd_istextframe pfd_isnonemptytextframe pfd_isnonwhitespacetextframe pfd_isletterframe pfd_issticky pfd_isbullet perspandata in nslinelayout, a "span" is a container inline frame, and a "frame" is one of its children.
Style System Overview - Archive of obsolete content
the declarations (properties & values) are
stored in data structs (nscss*).
... to match rules, we do lookups in the rulehash's tables, remerge the lists of rules using
stored indices, and then call selectormatchestree to find which selectors really match.
importUserCertificates - Archive of obsolete content
however, if this certificate has the same dn as one or more certificates that already exist in the user's certificate
store, the nickname associated with the certificate(s) of the same dn in the certificate
store is used, and the <tt>"nicknamestring"</tt> parameter is ignored.
... if the string is null and no certificate with the same dn exists in the user's certificate
store, personal security manager uses the following pattern to derive the nickname: <tt><common name>'s <issuer name> id</tt>.
Settings - Archive of obsolete content
the settings persist across browser sessions and are
stored using the jetpack [simple storage api][].
...with the above manifest the following
stored properties are available in the jetpack's code: * jetpack.storage.settings.twitter.username * jetpack.storage.settings.twitter.password * jetpack.storage.settings.facebook.username * jetpack.storage.settings.facebook.password * jetpack.storage.settings.music * jetpack.storage.settings.volume see also simple storage jep 24 ...
Settings - Archive of obsolete content
the settings persist across browser sessions and are
stored using the jetpack simple storage api.
...with the above manifest the following
stored properties are available in the jetpack's code: jetpack.storage.settings.twitter.username jetpack.storage.settings.twitter.password jetpack.storage.settings.facebook.username jetpack.storage.settings.facebook.password jetpack.storage.settings.music jetpack.storage.settings.volume ...
Simple Storage - Archive of obsolete content
it's a simple key-based persistent object data
store.
...examples this code persistently
stores some data: jetpack.future.import("storage.simple");var mystorage = jetpack.storage.simple;mystorage.fribblefrops = [1, 3, 3, 7];mystorage.heimelfarbs = { bar: "baz" }; and this code -- pretend it's in the same jetpack as the code above -- simply uses that data: mystorage.fribblefrops.foreach(function (elt) console.log(elt));var bar = mystorage.heimelfarbs.bar;jetpack.notifications.show(bar.baz);...
Simple Storage - Archive of obsolete content
it's a simple key-based persistent object data
store.
...examples this code persistently
stores some data: jetpack.future.import("storage.simple"); var mystorage = jetpack.storage.simple; mystorage.fribblefrops = [1, 3, 3, 7]; mystorage.heimelfarbs = { bar: "baz" }; and this code -- pretend it's in the same jetpack as the code above -- simply uses that data: mystorage.fribblefrops.foreach(function (elt) console.log(elt)); var bar = mystorage.heimelfarbs.bar; jetpack.notifications.show(bar...
Monitoring downloads - Archive of obsolete content
in particular, it needs to get an instance of the download manager's nsidownloadmanager interface and create the database into which its data will be
stored.
...that's to adjust the value from the granularity
stored in the database to that expected by javascript.
LIR - Archive of obsolete content
load short and sign-extend to an int 19 lduc2ui integer load unsigned char and zero-extend to an unsigned int 20 ldus2ui integer load unsigned short and zero-extend to an unsigned int 21 ldi integer load int 22 ldq quad 64 bit load quad 23 ldd double load double 24 ldf2d double load float and extend to a double
store 25 sti2c void
store int truncated to char 26 sti2s void
store int truncated to short 27 sti void
store int 28 stq void 64 bit
store quad 29 std void
store double 30 std2f void
store double as a float (losing precision) 31 not in use call 32 not in use 33 callv void c...
...s emitted for this) 42 not in use guards 43 x void exit always 44 xt void exit if true 45 xf void exit if false 46 xtbl void exit via indirect jump 47 xbarrier void a lir_xbarrier cause no code to be generated, but it acts like a never-taken guard in that it inhibits certain optimisations, such as dead stack
store elimination.
Supporting per-window private browsing - Archive of obsolete content
firefox 20 introduced per-window private browsing mode, in which private user data is
stored and accessed concurrently with public user data from another window.
...clearing any temporarily-
stored private data it is permissable to
store private data in non-persistent ways for the duration of a private browsing session.
URIs and URLs - Archive of obsolete content
together these segments form the url spec with the following syntax: scheme://username:password@host:port/directory/filebasename.fileextension;param?query#ref for performance reasons the complete spec is
stored in escaped form in the nsstandardurl object with pointers (position and length) to each basic segment and for the more global segments like path and prehost for example.
...the information how to escape each segment is
stored in a matrix.
Anonymous Content - Archive of obsolete content
when specified on the left-hand side of the pair it indicates that the attribute on the right-hand side should be
stored as text nodes underneath the anonymous element.
... when used on the right-hand side, it indicates that any raw text nodes that are explicit children of the bound element should be coalesced and the resulting value should be
stored as the attribute on the left-hand side.
Using XPInstall to Install Plugins - Archive of obsolete content
write keys in the windows registry which
store information about this secondary location, in particular the plugin path and the xpt path (if applicable) so that netscape gecko browsers can pick up the plugin from the secondary location if they are installed after the plugin is (and thus, if a particular netscape gecko browser follows or replaces the current browser).
...this value is actually entered in the client version registry upon installation, a mozilla-browser file that
stores metadata about the software that has just been installed.
patch - Archive of obsolete content
if the existing version of the file does not match the checksum
stored in the gdiff file, patch returns an error without applying the patch.
... after patch applies a patch, it compares a checksum.of the resulting file against a checksum
stored in the gdiff file.
sizemode - Archive of obsolete content
this attribute is used to save and re
store the state of a window (together with the persist attribute) and for css styles (e.g.
...use window.maximize(), window.re
store(), or window.minimize() to change the window state.
statedatasource - Archive of obsolete content
« xul reference home statedatasource type: uri chrome xul may specify an rdf datasource to use to
store tree state information.
...if you do not specify this attribute, state information will be
stored in the local
store (rdf:local-
store).
Writing to Files - Archive of obsolete content
as utf-8 can
store all characters, you will usually always use this default.
...stream.write16(1000); stream.write32(1000); all values are read in big endian form, which means that integers are
stored in the file with their higher bits first.
Building Trees - Archive of obsolete content
rather than generate content for every row in the tree, the results are
stored in a list inside the builder.
...for cells in normal columns, you can use the value attribute to
store some other value and you can use the view’s getcellvalue() method to retrieve it.
Tree Widget Changes - Archive of obsolete content
one feature that has been added is re
storenaturalorder which may be used to re
store the original order of the columns before the user moved them around.
... tree.columns.re
storenaturalorder() there is also a command on the end of the tree's column picker which the user may use to re
store the original column order.
Adding Methods to XBL-defined Elements - Archive of obsolete content
each element of the array
stores each direct child element of the xbl-defined element.
...in the returned array, the first button is
stored in the first array element (getanonymousnodes(element)[0]), the second button is
stored in the second array element and the third button is
stored in the third array element.
Box Objects - Archive of obsolete content
the content tree
stores the nodes as they are found in the source code.
...first, you can retrieve the position and size of the xul element as displayed, and second, you can determine the order of the elements in the box as displayed, instead of their order as they are
stored in the dom.
Manifest Files - Archive of obsolete content
a package can be
stored either as a directory or as a jar archive.
...in this case, there is, since the files for the branding package are
stored in a different path in the same archive.
Open and Save Dialogs - Archive of obsolete content
var nsifilepicker = components.interfaces.nsifilepicker; var fp = components.classes["@mozilla.org/filepicker;1"].createinstance(nsifilepicker); fp.init(window, "select a file", nsifilepicker.modeopen); first, a new file picker object is created and
stored in the variable 'fp'.
...the file the user selected will be
stored in the file picker's file property.
Persistent Data - Archive of obsolete content
the information is collected and
stored in a rdf file (local
store.rdf) in the same directory as other user preferences.
...you can add the persist attribute to any element and
store any attribute.
Trees - Archive of obsolete content
an advantage of using a tree view is that it allows the view to
store the data in a manner which is more suitable for the data, or to load the data on demand as rows are displayed.
...if you do, you might
store the data in an array or javascript data structure, or load the data from an xml file.
XPCOM Interfaces - Archive of obsolete content
mozilla
stores a list of all the components that are available in its own registry.
...you can get a component using javascript code like that below: var afile = components.classes["@mozilla.org/file/local;1"].createinstance(); the file component is retrieved and
stored in the afile variable.
Using Remote XUL - Archive of obsolete content
its value attribute, while defined in the xul specification, has no specific function in xul; it can
store any data associated with the item.
... in our case we use it to
store the url of the page to load when the user selects the item from the menu.
panel - Archive of obsolete content
attributes backdrag, close, consumeoutsideclicks, fade, flip, ignorekeys, label, left, level, noautofocus, noautohide, nore
storefocus, onpopuphidden, onpopuphiding, onpopupshowing, onpopupshown, position, titlebar, top, type properties accessibletype, label, popupboxobject, popup, state methods hidepopup, moveto, openpopup, openpopupatscreen, sizeto examples the following example shows how a panel may be attached to a label.
... nore
storefocus type: boolean if false, the default value, then when the panel is hidden, the keyboard focus will be re
stored to whatever had the focus before the panel was opened.
tree - Archive of obsolete content
statedatasource type: uri chrome xul may specify an rdf datasource to use to
store tree state information.
...if you do not specify this attribute, state information will be
stored in the local
store (rdf:local-
store).
window - Archive of obsolete content
this attribute is used to save and re
store the state of a window (together with the persist attribute) and for css styles (e.g.
...use window.maximize(), window.re
store(), or window.minimize() to change the window state.
NPP - Archive of obsolete content
syntax typedef struct _npp { void* pdata; /* plug-in private data */ void* ndata; /* mozilla private data */ } npp_t; typedef npp_t* npp; fields the data structure has the following fields: pdata a value, whose definition is up to the plug-in, that the plug-in can use to
store a pointer to an internal data structure associated with the instance; this field isn't modified by the browser.
... ndata a private value, owned by the browser, which is used to
store data associated with the instance; this value should not be modified by the plug-in.
NPP_Destroy - Archive of obsolete content
you should delete any private instance-specific information
stored in the plug-in's instance->pdata at this time.
... mac os if you want to re
store state information if this plug-in is later recreated, use np_memalloc to create an npsaveddata structure.
NPP_NewStream - Archive of obsolete content
the plug-in can
store plug-in-private data associated with the stream in stream->pdata.
...npn_requestread requests are only fulfilled when all data has been read and
stored in the cache.
NPStream - Archive of obsolete content
syntax typedef struct _npstream { void* pdata; /* plug-in private data */ void* ndata; /* netscape private data */ const char* url; uint32 end; uint32 lastmodified; void* notifydata; const char *headers; } npstream; fields the data structure has the following fields: plug-in-private value that the plug-in can use to
store a pointer to private data associated with the instance; not modified by the browser.
... ndata browser-private value that can
store data associated with the instance; should not be modified by the plug-in.
NPAPI plugin reference - Archive of obsolete content
npn_setvalueforurl allows a plugin to change the
stored information associated with a url, in particular its cookies.
... npsaveddata block of instance information saved after the plug-in instance is deleted; can be returned to the plug-in to re
store the data in future instances of the plug-in.
Threats - Archive of obsolete content
for example, suppose the site www.example.net pretends to be a furniture
store when it is really just a site that takes credit-card payments but never sends any goods.
...business needs have changed the way websites
store sensistive data, with more usage of cloud services.
GetObject - Archive of obsolete content
remarks the getobject function is not supported in internet explorer 9 standards mode, internet explorer 10 standards mode, internet explorer 11 standards mode, and windows
store apps or later.
... for example, in a drawing application you might have multiple layers to a drawing
stored in a file.
@cc_on - Archive of obsolete content
warning: conditional compilation is not supported in internet explorer 11 standards mode and windows 8.x
store apps.
...version + "."); document.write("<br />"); @if (@_win32) document.write("running on the 32-bit version of windows."); @elif (@_win16) document.write("running on the 16-bit version of windows."); @else document.write("running on a different operating system."); @end @*/ requirements supported in all versions of internet explorer, but not in windows 8.x
store apps.
@if - Archive of obsolete content
warning: conditional compilation is not supported in internet explorer 11 standards mode and windows 8.x
store apps.
...ript_version + "."); document.write("<br />"); @if (@_win32) document.write("running on a 32-bit version of windows."); @elif (@_win16) document.write("running on a 16-bit version of windows."); @else document.write("running on a different operating system."); @end @*/ requirements supported in all versions of internet explorer, but not in windows 8.x
store apps.
@set - Archive of obsolete content
warning: conditional compilation is not supported in internet explorer 11 standards mode and windows 8.x
store apps.
... requirements supported in all versions of internet explorer, but not in windows 8.x
store apps.
LiveConnect - Archive of obsolete content
mailing list newsgroup rss feed related topics javascript, plugins older notes (please update or remove as needed.) while the bloated liveconnect code in the mozilla source was removed in version 1.9.2 of the platform (see bug 442399), its former api has been re
stored (see also the specification and this thread) (building on npapi?), and as of java 6 update 12, extensions as well as applets can make use of this re
stored api.
... the reimplementation also re
stores the ability to use try-catch exceptions within javascript, and is free of the increasing number of other bugs introduced by the decline of the original liveconnect (e.g., java.lang.string and arrays not working properly).
RDF in Mozilla FAQ - Archive of obsolete content
first, it is a simple, cross-platform database for small data
stores.
... in order to take advantage of this functionality, you must of course be able to express your information in terms of the rdf datasource api, either by using the built-in memory datasource, using rdf/xml to
store your information, or writing your own implementation (possibly in javascript) of nsirdfdatasource.
Anatomy of a video game - Game development
building a better main loop in javascript there are two obvious issues with our previous main loop: main() pollutes the window object (where all global variables are
stored) and the example code did not leave us with a way to stop the loop unless the whole tab is closed or refreshed.
...to acquire one of these timestamps, you can call window.performance.now() and
store the result as a variable.
Publishing games - Game development
html5 games have a huge advantage over native in terms of publishing and distribution — you have the freedom of distribution, promotion and monetization of your game on the web, rather than each version being locked into a single
store controlled by one company.
...game distribution provides all you need to know about the ways you can distribute your newly created game into the wild — including hosting it yourself online, submitting it to open marketplaces, and submitting it to closed ones like google play or the ios app
store.
Create the Canvas and draw on it - Game development
then we're creating the ctx variable to
store the 2d rendering context — the actual tool we can use to paint on the canvas.
...the fillstyle property
stores a color that will be used by the fill() method to paint the square, in our case, red.
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.
... crud typically refers to operations performed in a database or data
store, 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.
Global object - MDN Web Docs Glossary: Definitions of Web-related terms
explanation: the global variable foo was
stored in the window object, like this: foo: "foobar" access global functions function greeting() { console.log("hi!"); } window.greeting(); // it is the same as the normal invoking: greeting(); the example above explains how global functions are
stored as properties in the window object.
... explanation: the global function greeting was
stored in the window object, like this: greeting: function greeting() { console.log("hi!"); } ...
Unicode - MDN Web Docs Glossary: Definitions of Web-related terms
by assigning each character a number, programmers can create character encodings, to let computers
store, process, and transmit any combination of languages in the same file or program.
...for example, one character set would
store japanese characters, and another would
store the arabic alphabet.
CSS FAQ - Learn web development
how do i re
store the default value of a property?
... initially css didn't provide a "default" keyword and the only way to re
store the default value of a property is to explicitly re-declare that property.
What is a Domain Name? - Learn web development
dns refreshing dns databases are
stored on every dns server worldwide, and all these servers refer to a few special servers called “authoritative name servers” or “top-level dns servers.” — these are like the boss servers that manage the system.
...each dns server that knows about a given domain
stores the information for some time before it is automatically invalidated and then refreshed (the dns server queries an authoritative server and fetches the updated information from it).
Client-side form validation - Learn web development
our applications won't work properly if our users' data is
stored in the wrong format, is incorrect, or is omitted altogether.
...:</label> <input type="email" id="mail" name="mail"> <button>submit</button> </form> and add the following javascript to the page: const email = document.getelementbyid("mail"); email.addeventlistener("input", function (event) { if (email.validity.typemismatch) { email.setcustomvalidity("i am expecting an e-mail address!"); } else { email.setcustomvalidity(""); } }); here we
store a reference to the email input, then add an event listener to it that runs the contained code each time the value inside the input is changed.
HTML forms in legacy browsers - Learn web development
buttons there are two ways to define buttons within html forms: the <input> element with its attribute type set to the values button, submit, reset or image the <button> element <input> the <input> element can make things a little difficult if you want to apply some css by using the element selector: <input type="button" value="click me"> if we remove the border on all inputs, can we re
store the default appearance on input buttons only?
... input { /* this rule turns off the default rendering for the input types that have a border, including buttons defined with an input element */ border: 1px solid #ccc; } input[type="button"] { /* this does not re
store the default rendering */ border: none; } input[type="button"] { /* these don't either!
Sending form data - Learn web development
you might display it,
store it into a database, send it by email, or process it in some other way.
...
store them on a different server and allow access to the file only through a different subdomain or even better through a completely different domain.
Sending forms through JavaScript - Learn web development
window.addeventlistener( 'load', function () { // these variables are used to
store the form data const text = document.getelementbyid( "thetext" ); const file = { dom : document.getelementbyid( "thefile" ), binary : null }; // use the filereader api to access file content const reader = new filereader(); // because filereader is asynchronous,
store its // result when it finishes to read the file reader.addeventlistener( "load", function ...
... // if there is not, delay the execution of the function if( !file.binary && file.dom.files.length > 0 ) { settimeout( senddata, 10 ); return; } // to construct our multipart form data request, // we need an xmlhttprequest instance const xhr = new xmlhttprequest(); // we need a separator to define each part of the request const boundary = "blob"; //
store our body request in a string.
The web and web standards - Learn web development
http hypertext transfer protocol, or http, is a messaging protocol that allows web browsers to communicate with web servers (where web sites are
stored).
...the following simple javascript will
store a reference to our paragraph in memory and change the text inside it: let pelem = document.queryselector('p'); pelem.textcontent = 'we changed the text!'; in the house analogy, javascript is like the cooker, tv, microwave, or hairdryer — the things that give your house useful functionality tooling once you've learned the "raw" technologies that can be used to build web pages (such as ...
Image gallery - Learn web development
looping through the images we've already provided you with lines that
store a reference to the thumb-bar <div> inside a constant called thumbbar, create a new <img> element, set its src attribute to a placeholder value xxx, and append this new <img> element inside thumbbar.
... writing a handler that runs the darken/lighten button that just leaves our darken/lighten <button> — we've already provided a line that
stores a reference to the <button> in a constant called btn.
Introduction to web APIs - Learn web development
client-side storage apis are becoming a lot more widespread in web browsers — the ability to
store data on the client-side is very useful if you want to create an app that will save its state between page loads, and perhaps even work when the device is offline.
... we start by creating an audiocontext instance inside which to manipulate our track: const audiocontext = window.audiocontext || window.webkitaudiocontext; const audioctx = new audiocontext(); next, we create constants that
store references to our <audio>, <button>, and <input> elements, and use the audiocontext.createmediaelementsource() method to create a mediaelementaudiosourcenode representing the source of our audio — the <audio> element will be played from: const audioelement = document.queryselector('audio'); const playbtn = document.queryselector('button'); const volumeslider = document.queryselector('.volume')...
What is JavaScript? - Learn web development
the core client-side javascript language consists of some common programming features that allow you to do things like:
store useful values inside variables.
... in the above example for instance, we ask for a new name to be entered then
store that name in a variable called name.
Getting started with Ember - Learn web development
ember-service-worker: configuring a pwa so that the app can be installed on mobile devices, just like apps from the device's respective app-
store.
...s using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte
stores typescript support in svelte deployment and next steps ...
Framework main features - Learn web development
the virtual dom is an approach whereby information about your browser's dom is
stored in javascript memory.
...s using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte
stores typescript support in svelte deployment and next steps ...
Accessibility in React - Learn web development
using useeffect() to control our heading focus now that we've
stored how many tasks we previously had, we can set up a useeffect() hook to run when our number of tasks changes, which will focus the heading if the number of tasks we have now is less than with it previously was — i.e.
...s using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte
stores typescript support in svelte deployment and next steps ...
Beginning our React todo list - Learn web development
this role will re
store the "list" meaning to the <ul> element.
...s using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte
stores typescript support in svelte deployment and next steps ...
Starting our Svelte Todo list app - Learn web development
this role will re
store the "list" meaning to the <ul> element.
...s using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte
stores typescript support in svelte deployment and next steps ...
Deployment and next steps - Learn web development
then we saw how to use
stores to work with a central data repository, and we created our own custom
store to persist our application's data to web storage.
...s using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte
stores typescript support in svelte deployment and next steps ...
Getting started with Svelte - Learn web development
it also compiles the markup and <script> section of every component and
stores the result in public/build/bundle.js.
...s using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte
stores typescript support in svelte deployment and next steps ...
Dynamic behavior in Svelte: working with variables and props - Learn web development
we'll take the tasks information from the markup and
store it in a todos array.
...s using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte
stores typescript support in svelte deployment and next steps ...
Creating our first Vue component - Learn web development
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 time it is called.
...s using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte
stores typescript support in svelte deployment and next steps ...
Getting started with Vue - Learn web development
with a basic introduction out of the way, we'll now go further and build up our sample app, a basic todo list application that allows us to
store a list of items, check them off when done, and filter the list by all, complete, and incomplete todos.
...s using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte
stores typescript support in svelte deployment and next steps ...
Handling common JavaScript problems - Learn web development
at the top, we have showheroes() the function we are currently in, and second we have onload, which
stores the event handler function containing the call to showheroes().
...talk to other developers to find out what they recommend, see how much activity and how many contributors the library has on github (or wherever else it is
stored), etc.
Accessible Toolkit Checklist
alt+f4 closes windows, similar to escape but even works on dialogs without cancel button alt+space opens window menu with re
store, move, size, minimize, maximize, close the move and size options must be usable with the arrow keys on the keyboard in windows, initial focus goes to first focusable widget that is not a clickable tabbed property sheet label making tab order definable.
...rt for moving slider: arrow keys, home, end, pgup, pgdn msaa support including role_slider, accessible value, value change events progress bars msaa support including accessible name, value, name and value change events grouped navigation widgets menus arrow keys, enter, escape alt alone enters main menu after leaving menus, focus is re
stored to where it was modified and unmodified mnemonics msaa support (including focus events, menu start and end events, radio and checkbox menu items) static text and group boxes msaa support radio groups only the selected radio button is in the tab order the other radio buttons can be selected and focused with up/down arrow.
Adding a new CSS property
the data structures in gecko that
store the computed value must correspond to this concept, or inheritance won't work as described by the specification.
... in any case where the computation you do might vary between elements that match the same list of style rules, you need to set the can
storeinruletree variable to false.
Eclipse CDT Manual Setup
for now it's
stored here until that integration happens in order that the eclipse cdt page isn't hugely cluttered with mostly redundant information, make setting up eclipse look much more complicated than it is nowadays.
...below.) initial workspace preferences when you open eclipse, it will ask you to "select a workspace" (a directory where eclipse will
store files that it generates during indexing, and so on.) it's recommended that you have a separate workspace containing only a single project for each mozilla source tree [rational], and that you choose a directory outside the mozilla source.
Storage access policy: Block cookies from trackers
this prevents those resources from retrieving tracking identifiers
stored in cookies or site storage and using them to identify users across visits to multiple first parties.
...this means that providers using cookies which are scoped to their third-party domain, or local storage and other site data
stored under their origin, will no longer have access to those identifiers across other websites.
Firefox UI considerations for web developers
the data
store provided by tippy top includes an optimized icon for each of the sites in the list; if the site is on this list, that icon is used.
... if tippy top doesn't include the site, firefox looks in its places data
store for icons specified in the page's <head> element; if an svg icon is available, that icon is selected.
Firefox Operational Information Database: SQLite
a large amount of operational information about websites visited and browser configuration is
stored in relational databases in sqlite used by firefox.
...t one of the tables listed in the left column and see the current contents of the database in the 'browse & search' tab.) some databases are used by the browser itself, others are used by applications that you have installed or used; for example: content-prefs.sqlite cookies.sqlite download.sqlite formhistory.sqlite persmissions.sqlite places.sqlite search.sqlite signons.sqlite webapp
store.sqlite ...
Getting from Content to Layout
elements that need to be restyled are marked with flags (e.g element_has_pending_restyle) and are
stored in the mpendingrestyles 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.
Implementing Download Resuming
the expected way to use it is this: for all downloads that happen, get the entityid from the channel, and
store it for later use.
...otherwise, call resumeat with the desired start position, and the previously
stored entity id.
DownloadLastDir.jsm
e getfileasync: downloadlastdir.getfileasync(uri, function (file) { // file is an nsifile console.log(file); }); deprecated since gecko 26.0 to retrieve the path in firefox 25 or earlier, use getfile: // file is an nsifile var file = gdownloadlastdir.getfile(uri); console.log(file); private browsing mode when browsing normally, the browser uses the browser.download.lastdir preference to
store the last download directory path.
... when history is cleared when the user's browsing history is cleared, the value of the last download directory path is re
stored to the platform's default download directory path.
SVN for Localizers
it's a handy tool that allows us to grab, change, and
store versions of source files in one location.
...note that path/to/output is meant to indicate the directory on your computer where you wish to
store the diff file.
Phishing: a short definition
for example, a usb token, bluetooth device, mobile phone, or simply a key
stored on a separate device.
...this qr code is nothing more than a random, secret key, that is
stored on the user’s phone.
ui.tooltipDelay
ui.tooltipdelay
stores the delay in milliseconds between the mouse stopping over an element and the appearing of its tooltip.
... type:integer default value:500 exists by default: no application support: gecko 11.0 (firefox 11.0 / thunderbird 11.0 / seamonkey 2.8) status: active; last updated 2012-02-21 introduction: pushed to nightly on 2011-12-15 bugs: bug 204786 values integer (milliseconds, default: 500) the time for delay between the mouse stopping over the element and the tooltip appearing is
stored in milliseconds and the default value is 500ms.
Preferences
the preference system makes it possible to
store data for mozilla applications using a key/value pairing system.
... a brief guide to mozilla preferences an introductory guide to where preferences are
stored and other useful information about the core preference system.
Leak And Bloat Tests
code locations the files specific to leak and bloat testing are be
stored in: http://mxr.mozilla.org/comm-central/source/mailnews/test/performance these files consist of: overlays (used to provide the hooks for the javascript): bloat/bloataddroverlay.xul bloat/bloatcomposeoverlay.xul bloat/bloatmainoverlay.xul javascript files (used to drive the tests): bloat/bloataddroverlay.js bloat/bloatcomposeoverlay.js bloat/bloatmainoverlay.js preference settings (used t...
...pref("mail.root.none", "/home/moztest/.thunderbird/t7i1txfw.minimum/mail"); user_pref("mail.root.pop3", "/home/moztest/.thunderbird/t7i1txfw.minimum/mail"); user_pref("mail.server.server1.directory", "/home/moztest/.thunderbird/t7i1txfw.minimum/mail/local folders"); user_pref("mail.server.server2.directory", "/home/moztest/.thunderbird/t7i1txfw.minimum/mail/tinderbox"); user_pref("mail.attachment.
store.version", 1); user_pref("mail.folder.views.version", 1); user_pref("mail.spam.version", 1); user_pref("mailnews.quotingprefs.version", 1); user_pref("mailnews.ui.threadpane.version", 6); changes to leak and bloat tests date and time (pst) description approx effect on numbers pre dec 2008 initial version - 2008/12/07 11:20 bug 463594 disabled os x and outlook address books via the prefer...
NSPR Poll Method
return value if the poll method
stores a nonzero value in *out_flags, the return value will be the value of in_flags.
...therefore, nspr clients should only use the return value as described in how to use the poll method section below.) if the poll method
stores zero in *out_flags, the return value will be the bottom layer's desires with respect to the in_flags.
PLHashEntry
if the key of an entry is an integral value that can fit into a void * pointer, you can just cast the key itself to void * and
store it in the key field.
... similarly, if the value of an entry is an integral value that can fit into a void * pointer, you can cast the value itself to void * and
store it in the value field.
PR_FindSymbolAndLibrary
lib a reference to a location at which the runtime will
store the library in which the symbol was discovered.
... returns if successful, returns a non-null pointer to the found symbol, and
stores a pointer to the library in which it was found at the location pointed to by lib.
JSS FAQ
illa/jss/tests/pk10gen.java org/mozilla/jss/tests/sdr.java org/mozilla/jss/tests/selftest.java org/mozilla/jss/tests/setupdbs.java org/mozilla/jss/tests/sigtest.java org/mozilla/jss/tests/symkeygen.java org/mozilla/jss/tests/testkeygen.java org/mozilla/jss/tests/sslclientauth.java org/mozilla/jss/tests/listcacerts.java org/mozilla/jss/tests/key
storetest.java org/mozilla/jss/tests/verifycert.java ssl examples: org/mozilla/jss/tests/sslclientauth.java org/mozilla/jss/ssl/sslclient.java org/mozilla/jss/ssl/sslserver.java org/mozilla/jss/ssl/ssltest.java other test code that may prove useful: org/mozilla/jss/asn1/integer.java org/mozilla/jss/asn1/sequence.java org/mozilla/jss/asn1/set.java ...
...what i am trying to do is write a java applet that will access the netscape certificate
store, retrieve a x509 certificate and then sign some data.
JSS Provider Notes
dsakpg.initialize(1024); keypair dsapair = dsakpg.generatekeypair(); supported classes cipher dsaprivatekey dsapublickey keyfactory keygenerator keypairgenerator mac messagedigest rsaprivatekey rsapublickey secretkeyfactory secretkey securerandom signature what's not supported the following classes don't work very well: key
store: there are many serious problems mapping the jca key
store interface onto nss's model of pkcs #11 modules.
...meanwhile, the org.mozilla.jss.crypto.crypto
store class can be used for some of this functionality.
Mozilla-JSS JCA Provider notes
what's not supported the following classes don't work very well: key
store: there are many serious problems mapping the jca key
store interface onto nss's model of pkcs #11 modules.
...meanwhile, the org.mozilla.jss.crypto.crypto
store class can be used for some of this functionality.
NSS 3.35 release notes
if nss is initialized, in read-write mode with a database directory provided, it uses database files to
store certificates, key, trust, and other information.
...nss 3.35 fixes this regression and re
stores the ability to read affected data.
PKCS11 Implement
if it runs out of sessions, it uses the initial session for saves and re
stores.
...pkcs c_generatekey c_generatekeypair (if token is read/write)c_generatekeypair (if token is read/write) c_generatekeypair (if token is read/write)c_generatekeypair (if token is read/write) c_wrapkey c_unwrapkey ckm_rsa_pkcs c_unwrapkey ckm_rsa_pkcs c_unwrapkey ckm_rsa_pkcs c_unwrapkey ckm_rsa_pkcs c_generaterandom c_save (when token runs out of sessions) c_re
store (when token runs out of sessions) external key tokens need to support c_decrypt and c_sign.
Python binding for NSS
hostentry objects now
store their aliases and networkaddress's in internal tuples.
...-07-08 scm tag source download change log general modifications: fix red hat bug #510343 client_auth_data_callback seg faults if false is returned from callback release 0.5.0 release date 2009-07-01 scm tag source download change log general modifications: re
store ssl.nss_init and ssl.nss_shutdown but make them deprecated add __version__ string to nss module release 0.4.0 release date 2009-06-30 scm tag source download change log general modifications: add binding for nss_nodb_init(), red hat bug #509002 move nss_init and nss_shutdown from ssl module to nss modul...
FC_Decrypt
pdata [out] pointer to location where recovered data is to be
stored.
... pusdatalen [in,out] pointer to location where the length of recovered data is to be
stored.
FC_DecryptFinal
plastpart [out] pointer to the location where the last block of recovered data, if any, is to be
stored.
... puslastpartlen [in,out] pointer to location where the number of bytes of recovered data is to be
stored.
FC_DecryptUpdate
ppart [out] pointer to location where recovered block is to be
stored.
... puspartlen [in,out] pointer the location where the number of bytes of recovered data is to be
stored.
FC_EncryptUpdate
pencryptedpart [out] pointer to location where encrypted block is to be
stored.
... pusencryptedpartalen [out] pointer the location where the number of bytes of encrypted data is to be
stored.
gtstd.html
each slot for a pkcs #11 module can in turn contain a token, which is the hardware or software device that actually provides cryptographic services and optionally
stores certificates and keys.
... the communicator certificate db token handles all communication with the certificate and key database files (called certx.db and keyx.db, respectively, where x is a version number) that
store certificates and keys.
NSS Tools modutil
this directory should be one below which it is appropriate to
store dynamic library files (for example, a server's root directory or the netscape communicator root directory).
... with the -changepw command, the password on the netscape internal module cannot be set or changed, since this password is
stored in key3.db.
NSS tools : signtool
-z tells signtool not to
store the signing time in the digital signature.
...you can use a zip utility instead of the -z option to package a signed archive into a jar file after you have signed it: cd signdir zip -r ../myjar.jar * adding: meta-inf/ (
stored 0%) adding: meta-inf/manifest.mf (deflated 15%) adding: meta-inf/signtool.sf (deflated 28%) adding: meta-inf/signtool.rsa (
stored 0%) adding: text.txt (
stored 0%) generating the keys and certificate the signtool option -g generates a new public-private key pair and certificate.
Rhino scopes and contexts
contexts the rhino context object is used to
store thread-specific information about the execution environment.
...so we can
store information that varies across scopes in the instance scope yet still share functions that manipulate that information reside in the shared scope.
Hacking Tips
for (; iter != current->end(); iter++) { ionspew(ionspew_codegen, "instruction %s", iter->opname()); […] masm.
store16(imm32(iter->id()), address(stackpointer, -8)); // added if (!iter->accept(this)) return false; […] } this modification will add an instruction which abuse the stack pointer to
store an immediate value (the lir id) to a location which would never be generated by any sane compiler.
...after all the compartments come arenas, which is where the gc things are actually
stored.
64-bit Compatibility
luckily there is an alias that will choose the right opcode for you - lir_ldp: struct object { void *data; }; lir->insload(lir_ldp, objins, ins->insimm(offsetof(object, data))); when you use lirwriter::ins
store, the correct size is chosen for you automatically, based on the size of the input operands.
... stobj_get_fslot - returns jsval-width lins stobj_get_dslot - returns jsval-width lins stobj_set_dslot -
stores jsval-width lins stobj_set_fslot -
stores jsval-width lins box_jsval - returns jsval-width lins unbox_jsval - expects jsval-width lins ...
INT_TO_JSVAL
before spidermonkey 1.8.5, not all integers can be
stored in a jsval; use int_fits_in_jsval to test.
... starting in spidermonkey 1.8.5, jsval can
store a full 32-bit integer, so this check isn't needed any longer for 32-bit integers.") }} if i does not fit into a jsval (see int_fits_in_jsval), the behavior is undefined.
JS::CompileOptions
compileoptions compileoptions is the compilation options
stored on the stack.
...if you create an instance of this type, it's up to you to guarantee that everything you
store in it will outlive it.
JS::Evaluate
if it is non-null, then on success, the result value is
stored in *rval.
... if a script compiles and executes successfully, js::evaluate
stores the result in *rval, if non-null, and returns true.
JSCheckAccessOp
on success, the callback must set *vp to the
stored value of the property.
... description check whether obj[id] may be accessed per mode, returning js_false on error/exception, js_true on success with obj[id]'s
stored value in *vp.
JSClass
private data custom classes very often need to
store private c/c++ data that should not be visible to scripts.
...implement a jsnative constructor function that allocates this private data and
stores it in the new object using js_setprivate.
JSNewEnumerateOp
(spidermonkey, noting the jsclass_new_enumerate flag, will cast that function pointer back to type jsnewenumerateop before calling it.) the behavior depends on the value of enum_op: jsenumerate_init a new, opaque iterator state should be allocated and
stored in *statep.
... (you can use private_to_jsval to tag the pointer to be
stored).
JSObjectOps.dropProperty
that is, the value that the jsobjectops.lookupproperty hook
stored in the *objp out parameter.
...that is, the value that jsobjectops.lookupproperty hook
stored in the *propp out parameter.
JSObjectOps.lookupProperty
if the property is found, the callback
stores the object on which the property was found in *objp.
...on success, the callback
stores in *propp a pointer to the property, if it exists, or null if it doesn't.
JS_CompileScript
on success, js_compilescript and js_compileucscript
stores the newly compiled script to *script and returns true.
... otherwise, they report an error,
stores null to *script, and return false.
JS_ConvertValue
on success, the converted value is
stored in *vp.
... on success, js_convertvalue
stores the converted value in *vp and returns true.
JS_DefineProperty
value js::handlevalue or js::handleobject or js::handlestring or int32_t or uint32_t or double initial
stored value for the new property.
... the parameters specify the new property's name, initial
stored value, getter, setter, and property attributes (attrs).
JS_DeleteElement2
if deletion is successful, js_deleteelement2
stores true to *succeeded and returns true.
...in both these cases, *succeeded will receive the
stored value of the property that was not deleted.
JS_EvaluateScript
if it is non-null, then on success, the result value is
stored in *rval.
... if a script compiles and executes successfully, js_evaluatescript or js_evaluateucscript
stores the result in *rval, if non-null, and returns js_true.
JS_LookupElement
on success, *vp receives the
stored value of obj[index], or undefined if the element does not exist.
... if the property obj[index] exists, js_lookupelement sets *vp to the property's
stored value and returns true.
JS_LookupProperty
on success, *vp receives the
stored value of the property, if any.
... if the property is found, *vp receives the property's
stored value, or true if the property has no
stored value; and the return value is true.
JS_NewExternalString
create a new jsstring whose characters are
stored in external memory.
...obsolete since jsapi 13 description js_newexternalstring and js_newexternalstringwithclosure create a new jsstring whose characters are
stored in external memory, i.e., memory allocated by the application, not the javascript engine.
JS_NewNumberValue
the result is an integer jsval if d can be
stored that way.
... on success, js_newnumbervalue
stores a numeric jsval in *rval and returns js_true.
JS_ResolveStandardClass
if the id is resolved, true is
stored into *resolved if success.
...if id does not name a standard class or a top-level property induced by initializing a standard class,
store false in *resolved and just return true.
JS_SET_TRACING_DETAILS
the callback
stores a string describing the reference traced in buf.
...when printer is null, arg must be const char * or char * c string naming the reference and index must be either (size_t)-1 indicating that the name alone describes the reference or it must be an index into some array vector that
stores the reference.
JS_SaveExceptionState
that object may then be used to re
store again the context using js_re
storeexceptionstate, or discarded using js_dropexceptionstate.
...see also mxr id search for js_saveexceptionstate jsexceptionstate js_re
storeexceptionstate js_dropexceptionstate ...
JS_SetCompartmentNameCallback
buf char * the buffer to
store the name of the compartment.
... jscompartmentnamecallback will be called when visiting the compartment, and it should
store the name of the compartment into buf with null terminated string.
JS_SetGCCallback
the application may
store this return value in order to re
store the original callback when the new callback is no longer needed.
... to re
store the original callback, call js_setgccallback a second time, and pass the old callback in as the cb argument.
JS_SetPrivate
for example, a socket class might use the private data field to
store the socket handle.
...only the pointer is
stored.
SpiderMonkey 1.8
in javascript 1.7 and earlier, x = [].length = "7"; would
store the number 7 in x.
... now this statement
stores the string "7" in x.
History Service Design
history management: provides basic and advanced apis to
store and modify visits and page details.
... storing pages and visits pages (intended as uris) are
stored into a table shared by both history and bookmarks, every url is unique in this table and is associated with a place id, commonly used as the foreign key on other tables.
Using the Places favicon service
the favicon service, implemented by the nsifaviconservice interface,
stores the favicons for pages in bookmarks and history.
... creating the favicon service the favicon service's contract id is @mozilla.org/browser/favicon-service;1, so to gain access to the favicon service, you should do something like this: var faviconservice = components.classes["@mozilla.org/browser/favicon-service;1"] .getservice(components.interfaces.nsifaviconservice); caching the favicon service
stores an expiration time for each favicon.
The Publicity Stream API
getpublicitystream( onsuccess: <function>, { [ onerror: <function> ], [ for_apps: <list> ], [ since: <date> ], [ before: <date> ], [ count: <int> ]): provides a means for a web
store to receive a list of the current user's socially relevant app activity by being called from an origin which hosts a web
store.
...possible error codes include: denied - if the user does not log in correctly permissiondenied - if the site is not allowed to access the publicity stream networkerror - if the publicity server is unreachable for_apps is a json list of apps that this
store has (each represented as its origin url), so that stream events not relating to applications in a given presentation context can be excluded from the return value.
Avoiding leaks in JavaScript XPCOM components
don't
store temporary objects permanently in global variables storing temporary objects permanently in global variables will leak memory in garbage-collected languages.
...(but since service is a global variable, just fixing the cycle doesn't fix the leak.) don't
store short-lived objects as javascript properties of short-lived dom nodes i mentioned earlier that, in versions of mozilla before 1.8, setting arbitrary javascript properties on elements (or using xbl fields) causes that element's javascript wrapper to be rooted until the document stops being displayed.
Component Internals
a set of default libraries
stored in this components directory makes up a typical gecko installation, providing functionality that consists of networking, layout, composition, a cross-platform user interface, and others.
...there are two types of manifests that xpcom uses to track components: component manifests when xpcom first starts up, it looks for the component manifest, which is a file that lists all registered components, and
stores details on exactly what each component can do.
Packaging WebLock
the files themselves are
stored in the jar file weblock.jar, which is simple a zip file with the xpi extension that sometimes also contains an internal installation file called install.js.
... the weblock installation script the installation script is the javascript file that is
stored within the xpi.
Introduction to XPCOM for the DOM
an instance of a class (called an object) can be allocated dynamically (on the heap, or free
store), using the syntax nsfoo *fooptr = new nsfoo; that object can then be manipulated only through fooptr.
...you pass an interface and the address of a pointer to
store the interface to queryinterface().
nsACString
size_type [pruint32] type used to represent the number of bytes
stored in the string.
...that is, it may be used to
store utf-8 characters, ascii characters, or any random binary data.
nsAString
size_type [pruint32] type used to represent the number of double-byte units
stored in the string.
...that is, it may be used to
store utf-16 characters, ucs-2 characters, or any random double-byte data.
mozIRegistry
and it happens that we've chosen, up till now, to
store that information in the "netscape registry" file.
... the contents of this rdf data base will be
stored in a plain-text rdf/xml file so that it can easily be viewed edited.
mozIStorageVacuumParticipant
the vacuum manager will try to re
store wal mode, but this will only work reliably if the participant properly resets statements.
... if the attempt to re
store the journal node fails, it will remain truncate.
nsIAbCard
properties aren't
stored anymore on the card, except for a handful of them.
... prefermailformat unsigned long allowed values are
stored in nsiabprefermailformat.
nsIAccessibleEvent
event_table_column_delete 0x0047 0x0043 event_table_column_reorder 0x0048 0x0044 event_window_activate 0x0049 0x0045 event_window_create 0x004a 0x0046 event_window_deactivate 0x004b 0x0047 event_window_destroy 0x004c 0x0048 event_window_maximize 0x004d 0x0049 event_window_minimize 0x004e 0x004a event_window_resize 0x004f 0x004b event_window_re
store 0x0050 0x004c event_hyperlink_end_index_changed 0x0051 0x004d the ending index of this link within the containing string has changed.
...le_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_maximize 0x0122 event_atk_window_minimize 0x0123 event_atk_window_resize 0x0124 event_atk_window_re
store 0x0125 event_dom_create 0x0001 an object has been created.
nsIApplicationCache
netwerk/base/public/nsiapplicationcache.idlscriptable this interface represents an application cache, which
stores resources for offline use.
...clients can open a session with nsicacheservice.createsession() using this client id and a storage policy of
store_offline to access this cache.
nsICacheEntryDescriptor
predicteddatasize print64
stores the content-length specified in the http header for this entry.
...this fails if the storage policy is not
store_in_memory.
nsICacheService
for example, a non-stream-based cache entry can only have a storage policy of
store_in_memory.
... visitentries() this method visits entries
stored in the cache.
nsIContentViewer
ashentry the history entry that the content viewer was
stored in.
... the entry must have the docshells for all of the child documents
stored in its child shell list.
nsICookieStorage
last changed in gecko 1.7 inherits from: nsisupports method overview void getcookie(in string acookieurl, in voidptr acookiebuffer, in pruint32ref acookiesize); void setcookie(in string acookieurl, in constvoidptr acookiebuffer, in unsigned long acookiesize); methods getcookie() retrieves a cookie from the browser's persistent cookie
store.
... setcookie()
stores a cookie in the browser's persistent cookie
store.
nsIDBChangeListener
the calling function
stores the value of astatus, changes the header ahdrtochange, then calls onhdrpropertychanged again with aprechange false.
... on this second call, the
stored value of astatus is provided, so that any changes may be noted.
nsIDOMStorageWindow
data
stored in local storage may only be accessed from the same origin that inserted the data into storage in the first place.
...data
stored in session storage may be accessed by any site in the browsing context.
nsIDOMWindow
data
stored in local storage may only be accessed from the same origin that inserted the data into storage in the first place.
...data
stored in session storage may be accessed by any site in the browsing context.
nsIDownload
deprecated since gecko 19.0 guid astring the guid of the download that is
stored in the database.
... targetfile nsilocalfile indicates the location at which the downloaded file will be (or is, if the download is complete)
stored.
nsIDynamicContainer
it can use the property bag on every result node to
store data associated with each item, such as a full path on disk.
...note: all result nodes implement a property bag if you need to
store state.
nsIFile
the new file's serial number will almost certainly be different, because it is a different file, probably
stored in a different physical location.
... the new file's serial number will almost certainly be different, because it is a different file, probably
stored in a different physical location.
nsIFormHistory2
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) note: this interface provides no means to access
stored values.
...
stored values are used by the formfillcontroller to generate autocomplete matches.
nsIMimeConverter
usually you would use this to
store you own properties.
...thunderbird
stored uint32 properties (not a complete list): indexed used for spotlight integration on osx.
nsIMsgWindow
to create an instance, use: msgwindow = components.classes["@mozilla.org/messenger/msgwindow;1"] .createinstance(components.interfaces.nsimsgwindow); in thunderbird the default message window is
stored in the global variable msgwindow.
...you should not
store this in a global variable.
nsIWebNavigation
when a page is loaded from session history, all content is loaded from the cache (if available) and page state (such as form values and scroll position) is re
stored.
...when a page is loaded from session history, all content is loaded from the cache (if available) and page state (such as form values and scroll position) is re
stored.
nsIXPCScriptable
this will always be one of three values: jsenumerate_init a new, opaque iterator state should be allocated and
stored in statep.
... you can use private_to_jsval() to tag the pointer to be
stored.
nsIZipReader
the entry must be
stored in the zip in either uncompressed or deflate-compressed format for the extraction to be successful.
...if aentryname is an external file which has meta-information
stored in the jar, verifyexternalfile (not yet implemented) must be called before getprincipal.
XPCOM string functions
this is a low-level api.ns_cstringtoutf16the ns_cstringtoutf16 function converts the value of a nsacstring instance to utf-16 and
stores the result in a nsastring instance.
...this is a low-level api.ns_utf16tocstringthe ns_utf16tocstring function converts the value of a nsastring instance from utf-16 to the specified multi-byte encoding and
stores the result in a nsacstring instance.
nsCOMPtr versus RefPtr
this basic rule derives from the fact that some of the nscomptr<t> code is factored into the nscomptr_base base class, which
stores the underlying mrawptr as an nsisupports*.
...since nscomptr
stores the pointer as an nsisupports*, it must be possible to unambiguously cast from t* to nsisupports*.
XUL Overlays
the chrome registry, which is a special rdf datasource into which user-specific information is persisted, or
stored, contains information about the components or additional packages that have been installed with the browser.
...the overlay mechanism allows you to merge elements into existing subtrees, but it also allows you to
store common ui elements in overlay files and merge them into any base files that use them.
Mail client architecture overview
messages - messages are always
stored and streamed in rfc822 format.
... whenever multiple messages are
stored in one file, the berkeley mailbox format is used.
customDBHeaders Preference
setting the preferences although there are various ways to set preferences, i tend to just navigate to the directory where my profile is
stored and edit the user.js file with my favorite text editor.
...</em:name> <em:description>test superfluous extension</em:description> <em:creator>garrett comeaux</em:creator> </description> </rdf> build process: [gcomeaux@kyle tbird-ext]$ cd superfluous/ [gcomeaux@kyle superfluous]$ make zip superfluous.xpi chrome/ chrome.manifest chrome/content/ chrome/content/superfluous.js chrome/content/superfluous_overlay.xul install.rdf adding: chrome/ (
stored 0%) adding: chrome.manifest (deflated 44%) adding: chrome/content/ (
stored 0%) adding: chrome/content/superfluous.js (deflated 57%) adding: chrome/content/superfluous_overlay.xul (deflated 44%) adding: install.rdf (deflated 50%) end result ultimately, you want to be able to compose a message like this: and see the superfluous column displayed in your inbox like this: thanks m...
Initialization and Destruction - Plugins
you can
store the instance-specific private data in its pdata field (instance->pdata).
...also, be sure to delete any private instance-specific information
stored in the plug-in's instance->pdata.
Debugger.Environment - Firefox Developer Tools
this means that the debugger can use the == operator to recognize when two debugger.environment instances refer to the same environment in the debuggee, and place its own properties on a debugger.environment instance to
store metadata about particular environments.
... setvariable(name,value)
storevalue as the value of the variable bound toname in this environment.name must be a string that is a valid ecmascript identifier name;value must be a debuggee value.
Debugger.Object - Firefox Developer Tools
this means that the debugger can use the == operator to recognize when two debugger.object instances refer to the same debuggee object, and place its own properties on a debugger.object instance to
store metadata about particular debuggee objects.
... setproperty(key, value, [receiver])
store value as the value of the referent’s property named key, creating the property if it does not exist.
Debugger.Source - Firefox Developer Tools
a debugger may place its own properties on debugger.source instances, to
store metadata about particular pieces of source code.
...thus, they donot refer to the call that created the element;
stored the source as the element’s text child; made the element a child of some uninserted parent node that was later inserted; or the like.
Debugger.Object - Firefox Developer Tools
this means that the debugger can use the == operator to recognize when two debugger.object instances refer to the same debuggee object, and place its own properties on a debugger.object instance to
store metadata about particular debuggee objects.
... setproperty(name,value)
storevalue as the value of the referent's property namedname, creating the property if it does not exist.name must be a string;value must be a debuggee value.
Examine and edit CSS - Firefox Developer Tools
any changes you make are temporary: reloading the page will re
store the original styling.
... in addition, hovering over a css variable name brings up a tooltip showing what color value is
stored in that variable (bug 1431949).
Storage Inspector - Firefox Developer Tools
indexeddb — all indexeddb databases created by the page or any iframes inside the page, their object
stores and the items
stored in these object
stores.
... under "cache storage", objects are organized by origin and then by the name of the cache: indexeddb objects are organized by origin, then by database name, then by object
store name: with the cookies, local storage, and session storage types, there's only one level in the hierarchy, so
stored items are listed directly under each origin: you can click on each item in the tree to expand or collapse its children.
Cache.addAll() - Web APIs
the request objects created during retrieval become keys to the
stored response operations.
... note: addall() will overwrite any key/value pairs previously
stored in the cache that match the request, but will fail if a resulting put() operation would overwrite a previous cache entry
stored by the same addall() method.
CanvasRenderingContext2D.getTransform() - Web APIs
syntax let
storedtransform = ctx.gettransform(); parameters none.
... html <canvas width="240"></canvas> <canvas width="240"></canvas> css canvas { border: 1px solid black; } javascript const canvases = document.queryselectorall('canvas'); const ctx1 = canvases[0].getcontext('2d'); const ctx2 = canvases[1].getcontext('2d'); ctx1.settransform(1, .2, .8, 1, 0, 0); ctx1.fillrect(25, 25, 50, 50); let
storedtransform = ctx1.gettransform(); console.log(
storedtransform); ctx2.settransform(
storedtransform); ctx2.beginpath(); ctx2.arc(50, 50, 50, 0, 2 * math.pi); ctx2.fill(); result specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.gettransform' in that specification.
CanvasRenderingContext2D.save() - Web APIs
syntax void ctx.save(); examples saving the drawing state this example uses the save() method to save the default state and re
store() to re
store it later, so that you are able to draw a rect with the default state later.
... html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // save the default state ctx.save(); ctx.fillstyle = 'green'; ctx.fillrect(10, 10, 100, 100); // re
store the default state ctx.re
store(); ctx.fillrect(150, 40, 100, 100); result specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.save' in that specification.
Drawing shapes with canvas - Web APIs
internally, paths are
stored as a list of sub-paths (lines, arcs, etc) which together form a shape.
...both are
stored as a path2d object, so that they are available for later usage.
CredentialsContainer.get() - Web APIs
this method collects credentials by calling the "collectfromcredential
store" method for each credential type allowed by the options argument.
... for example: if options.password exists, then the passwordcredential.[[collectfromcredential
store]] is called.
DOMMatrixReadOnly - Web APIs
the elements are
stored into the array as single-precision floating-point numbers in column-major (colexographical access, or "colex") order.
...the elements are
stored into the array as double-precision floating-point numbers in column-major (colexographical access access or "colex") order.
DataTransfer - Web APIs
datatransfer.mozsetdataat() a data transfer may
store multiple items, each at a given zero-based index.
... datatransfer.moztypesat() holds a list of the format types of the data that is
stored for an item at the specified index.
DataTransferItemList.clear() - Web APIs
the drag data
store in which this list is kept is only writable while handling the dragstart event.
... while handling drop, the drag data
store is in read-only mode, and this method silently does nothing.
FileSystemEntry - Web APIs
you can use the filesystem: scheme on google chrome to see all the files and folders that are
stored in the origin of your app.
...chrome shows a read-only list of all the files and folders
stored the origin of your app.
FileSystemEntrySync - Web APIs
you can use the filesystem: scheme on google chrome to see all the files and folders that are
stored in the origin of your app.
...chrome shows a read-only list of all the files and folders
stored the origin of your app.
Using the Gamepad API - Web APIs
instead of constantly storing the gamepad's latest state in a variable it only
stores a snapshot, so to do the same thing in chrome you have to keep polling it and then only use the gamepad object in code when it is available.
... in current versions of chrome (version 34 as of this writing) the button values are
stored as an array of double values, instead of gamepadbutton objects.
HTMLCanvasElement - Web APIs
htmlcanvaselement.toblob() creates a blob object representing the image contained in the canvas; this file may be cached on the disk or
stored in memory at the discretion of the user agent.
... webglcontextre
stored fired if the user agent re
stores the drawing buffer for a webglrenderingcontext or webgl2renderingcontext object.
Recommended Drag Types - Web APIs
these are equivalent to text/plain, and will
store and retrieve plain text data.
...the data should be the url of the image, or a data: uri if the image is not
stored on a web site or disk.
IDBCursor.advance() - Web APIs
example in this simple fragment we create a transaction, retrieve an object
store, then use a cursor to iterate through the records in the object
store.
...for a complete working example, see our idbcursor example (view example live.) function advanceresult() { list.innerhtml = ''; var transaction = db.transaction(['rushalbumlist'], "readonly"); var object
store = transaction.object
store('rushalbumlist'); object
store.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.albumtitle + '</strong>, ' + cursor.value.year; list.appendchild(listitem); cursor.advance(2); } else { console.log(...
IDBCursor.continue() - Web APIs
example in this simple fragment we create a transaction, retrieve an object
store, then use a cursor to iterate through all the records in the object
store.
...for a complete working example, see our idbcursor example (view example live.) function displaydata() { var transaction = db.transaction(['rushalbumlist'], "readonly"); var object
store = transaction.object
store('rushalbumlist'); object
store.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = cursor.value.albumtitle + ', ' + cursor.value.year; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displaye...
IDBCursor.continuePrimaryKey() - Web APIs
using it for cursors coming from an object
store will throw an error.
... example here’s how you can resume an iteration of all articles tagged with "javascript" since your last visit: let request = article
store.index("tag").opencursor(); let count = 0; let unreadlist = []; request.onsuccess = (event) => { let cursor = event.target.result; if (!cursor) { return; } let lastprimarykey = getlastiteratedarticleid(); if (lastprimarykey > cursor.primarykey) { cursor.continueprimarykey("javascript", lastprimarykey); return; } // update lastiteratedarticleid setlastiterate...
IDBCursor.delete() - Web APIs
example in this simple fragment we create a transaction, retrieve an object
store, then use a cursor to iterate through all the records in the object
store.
...for a complete working example, see our idbcursor example (view example live.) function deleteresult() { list.innerhtml = ''; var transaction = db.transaction(['rushalbumlist'], 'readwrite'); var object
store = transaction.object
store('rushalbumlist'); object
store.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { if(cursor.value.albumtitle === 'grace under pressure') { var request = cursor.delete(); request.onsuccess = function() { console.log('deleted that mediocre album from 1984.
IDBCursor.key - Web APIs
example in this simple fragment we create a transaction, retrieve an object
store, then use a cursor to iterate through all the records in the object
store.
...for a complete working example, see our idbcursor example (view example live.) function displaydata() { var transaction = db.transaction(['rushalbumlist'], "readonly"); var object
store = transaction.object
store('rushalbumlist'); object
store.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = cursor.value.albumtitle + ', ' + cursor.value.year; list.appendchild(listitem); console.log(cursor.key); cursor.continue(); } else { co...
IDBCursor.primaryKey - Web APIs
example in this simple fragment we create a transaction, retrieve an object
store, then use a cursor to iterate through all the records in the object
store.
...for a complete working example, see our idbcursor example (view example live.) function displaydata() { var transaction = db.transaction(['rushalbumlist'], "readonly"); var object
store = transaction.object
store('rushalbumlist'); object
store.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = cursor.value.albumtitle + ', ' + cursor.value.year; list.appendchild(listitem); console.log(cursor.primarykey); cursor.continue(); } else { ...
IDBCursorWithValue.value - Web APIs
example in this example we create a transaction, retrieve an object
store, then use a cursor to iterate through all the records in the object
store.
...for a complete working example, see our idbcursor example (view example live.) function displaydata() { var transaction = db.transaction(['rushalbumlist'], "readonly"); var object
store = transaction.object
store('rushalbumlist'); object
store.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = cursor.value.albumtitle + ', ' + cursor.value.year; list.appendchild(listitem); console.log(cursor.value); cursor.continue(); } else { ...
IDBDatabase.name - Web APIs
example this example shows a database connection being opened, the resulting idbdatabase object being
stored in a db variable, and the name property then being logged.
... // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being // opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; //
store the result of opening the database in the db variable.
IDBDatabaseException - Web APIs
for example, an object, such as an object
store or index, already exists and a request attempted to create a new one.
... 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.
IDBIndex.getAll() - Web APIs
if you are trying to get an array of all the objects in an object
store, though, you should use getall().
... example var myindex = object
store.index('index'); var getallrequest = myindex.getall(); getallrequest.onsuccess = function() { console.log(getallrequest.result); } specification specification status comment indexed database api draftthe definition of 'getall()' in that specification.
IDBKeyRange.bound() - Web APIs
we open a transaction (using idbtransaction) and an object
store, and open a cursor with idbobject
store.opencursor, declaring keyrangevalue as its optional key range value.
... note: for a more complete example allowing you to experiment with key range, have a look at the idbkeyrange directory in the indexeddb-examples repo (view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.bound("a", "f"); var transaction = db.transaction(['fthings'], 'readonly'); var object
store = transaction.object
store('fthings'); object
store.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else {...
IDBKeyRange.lower - Web APIs
we open a transaction (using idbtransaction) and an object
store, and open a cursor with idbobject
store.opencursor, declaring keyrangevalue as its optional key range value.
... note: for a more complete example allowing you to experiment with key range, have a look at our idbkeyrange-example repo (view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.bound("f", "w", true, true); console.log(keyrangevalue.lower); var transaction = db.transaction(['fthings'], 'readonly'); var object
store = transaction.object
store('fthings'); object
store.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else {...
IDBKeyRange.lowerBound() - Web APIs
we open a transaction (using idbtransaction) and an object
store, and open a cursor with idbobject
store.opencursor, declaring keyrangevalue as its optional key range value.
... note: for a more complete example allowing you to experiment with key range, have a look at our idbkeyrange-example repo (view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.lowerbound("f"); var transaction = db.transaction(['fthings'], 'readonly'); var object
store = transaction.object
store('fthings'); object
store.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else {...
IDBKeyRange.lowerOpen - Web APIs
we open a transaction (using idbtransaction) and an object
store, and open a cursor with idbobject
store.opencursor, declaring keyrangevalue as its optional key range value.
... note: for a more complete example allowing you to experiment with key range, have a look at our idbkeyrange-example repo (view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.bound("f", "w", true, true); console.log(keyrangevalue.loweropen); var transaction = db.transaction(['fthings'], 'readonly'); var object
store = transaction.object
store('fthings'); object
store.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else {...
IDBKeyRange.only() - Web APIs
we open a transaction (using idbtransaction) and an object
store, and open a cursor with idbobject
store.opencursor, declaring keyrangevalue as its optional key range value.
... note: for a more complete example allowing you to experiment with key range, have a look at our idbkeyrange repo (view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.only("a"); var transaction = db.transaction(['fthings'], 'readonly'); var object
store = transaction.object
store('fthings'); object
store.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entrie...
IDBKeyRange.upper - Web APIs
we open a transaction (using idbtransaction) and an object
store, and open a cursor with idbobject
store.opencursor, declaring keyrangevalue as its optional key range value.
... note: for a more complete example allowing you to experiment with key range, have a look at our idbkeyrange-example repo (view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.bound("f", "w", true, true); console.log(keyrangevalue.upper); var transaction = db.transaction(['fthings'], 'readonly'); var object
store = transaction.object
store('fthings'); object
store.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else {...
IDBKeyRange.upperBound() - Web APIs
we open a transaction (using idbtransaction) and an object
store, and open a cursor with idbobject
store.opencursor, declaring keyrangevalue as its optional key range value.
... note: for a more complete example allowing you to experiment with key range, have a look at our idbkeyrange-example repo (view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.upperbound("f"); var transaction = db.transaction(['fthings'], 'readonly'); var object
store = transaction.object
store('fthings'); object
store.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else {...
IDBKeyRange.upperOpen - Web APIs
we open a transaction (using idbtransaction) and an object
store, and open a cursor with idbobject
store.opencursor, declaring keyrangevalue as its optional key range value.
... note: for a more complete example allowing you to experiment with key range, have a look at our idbkeyrange-example repo (view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.bound("f", "w", true, true); console.log(keyrangevalue.upperopen); var transaction = db.transaction(['fthings'], 'readonly'); var object
store = transaction.object
store('fthings'); object
store.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else {...
IDBOpenDBRequest.onblocked - Web APIs
}; example var db; // let us open our database var request = indexeddb.open("todolist", 4); // these two event handlers act on the database being opened // successfully, or not request.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; //
store the result of opening the database in the db variable.
...either one has not been created // before, or a new version number has been submitted via the // window.indexeddb.open line above //it is only implemented in recent browsers request.onupgradeneeded = function(event) { var db = event.target.result; db.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; // create an object
store for this database var object
store = db.createobject
store("todolist", { keypath: "tasktitle" }); ...
IDBRequest.onsuccess - Web APIs
}; example the following example requests a given record title, onsuccess gets the associated record from the idbobject
store (made available as object
storetitlerequest.result), updates one property of the record, and then puts the updated record back into the object
store.
... for a full working example, see our to-do notifications app (view example live.) var title = "walk dog"; // open up a transaction as usual var object
store = db.transaction(['todolist'], "readwrite").object
store('todolist'); // get the to-do list object that has this title as it's title var object
storetitlerequest = object
store.get(title); object
storetitlerequest.onsuccess = function() { // grab the data object returned as the result var data = object
storetitlerequest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item back // into the database var updatetitlerequest = object
store.put(data); // when this new request succeeds, run the displaydata() // function again to update the display upd...
IDBRequest.readyState - Web APIs
example the following example requests a given record title, onsuccess gets the associated record from the idbobject
store (made available as object
storetitlerequest.result), updates one property of the record, and then puts the updated record back into the object
store in another request.
...for a full working example, see our to-do notifications app (view example live.) var title = "walk dog"; // open up a transaction as usual var object
store = db.transaction(['todolist'], "readwrite").object
store('todolist'); // get the to-do list object that has this title as it's title var object
storetitlerequest = object
store.get(title); object
storetitlerequest.onsuccess = function() { // grab the data object returned as the result var data = object
storetitlerequest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item // back into the database var updatetitlerequest = object
store.put(data); // log the source of this request ...
IDBRequest.result - Web APIs
syntax var myresult = request.result; value any example the following example requests a given record title, onsuccess gets the associated record from the idbobject
store (made available as object
storetitlerequest.result), updates one property of the record, and then puts the updated record back into the object
store.
... for a full working example, see our to-do notifications app (view example live.) var title = "walk dog"; // open up a transaction as usual var object
store = db.transaction(['todolist'], "readwrite").object
store('todolist'); // get the to-do list object that has this title as it's title var object
storetitlerequest = object
store.get(title); object
storetitlerequest.onsuccess = function() { // grab the data object returned as the result var data = object
storetitlerequest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item // back into the database var updatetitlerequest = object
store.put(data); // when this new request succeeds, run the displaydata() // function again to update the display upd...
IDBRequest - Web APIs
idbrequest.source read only the source of the request, such as an idbindex or an idbobject
store.
...mple live.) var db; // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being // opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; //
store the result of opening the database.
ImageData.data - Web APIs
data is
stored as a one-dimensional array in the rgba order, with integer values between 0 and 255 (inclusive).
...the data array
stores four values for each pixel, making 4 x 10,000, or 40,000 values in all.
LocalFileSystem - Web APIs
so to request storage, you need to do something like the following: var requestedbytes = 1024*1024*10; // 10mb navigator.webkitpersistentstorage.requestquota ( requestedbytes, function(grantedbytes) { window.requestfilesystem(persistent, grantedbytes, oninitfs, errorhandler); }, function(e) { console.log('error', e); } ); your user must grant your app permission to
store data locally before your app can use persistent storage.
... methods requestfilesystem() requests a file system where data should be
stored.
MSSiteModeEvent - Web APIs
*this property is not supported for windows
store apps using javascript.
...*this property is not supported for windows
store apps using javascript.
MediaStreamTrack: unmute event - Web APIs
examples in this example, event handlers are established for the mute and unmute events in order to detect when the media is not flowing from the source for the mediastreamtrack
stored in the variable musictrack.
...when the track exits the muted state—detected by the arrival of an unmuted event—the background color is re
stored to white.
NavigatorStorage.storage - Web APIs
the returned object lets you examine and configure persistence of data
stores and learn approximately how much more space your browser has available for local storage use.
... syntax var storagemanager = navigator.storage; value a storagemanager object you can use to maintain persistence for
stored data, as well as to determine roughly how much room there is for data to be
stored.
PannerNode - Web APIs
the orientation and position value are set and retrieved using different syntaxes, since they're
stored as audioparam values.
... pannernode.setposition() defines the position of the audio source relative to the listener (represented by an audiolistener object
stored in the audiocontext.listener attribute.) pannernode.setorientation() defines the direction the audio source is playing in.
PasswordCredential - Web APIs
var form = document.queryselector('#form'); var creds = new passwordcredential(form); //
store the credentials.
... navigator.credentials.
store(creds) .then(function(creds) { // do something with the credentials if you need to.
PaymentRequest.onpaymentmethodchange - Web APIs
examples an example payment method change handler is shown below; this example handles changes made to the payment method when using apple pay, specifically: request.onpaymentmethodchange = ev => { const { type: cardtype } = ev.methoddetails; const newstuff = {}; if (ev.methodname === "https://apple.com/apple-pay") { switch (cardtype) { case "
store": // do apple pay specific handling for
store card...
... // methoddetails contains the
store card information const result = calculatediscount(ev.methoddetails); object.assign(newstuff, result); break; } } // finally...
PerformanceTiming - Web APIs
if a persistent connection is used, or the information is
stored in a cache or a local resource, the value will be the same as performancetiming.fetchstart.
...if a persistent connection is used, or the information is
stored in a cache or a local resource, the value will be the same as performancetiming.fetchstart.
Request.cache - Web APIs
no-
store — the browser fetches the resource from the remote server without first looking in the cache, and will not update the cache with the downloaded resource.
...fetch("some.json", {cache: "no-
store"}) .then(function(response) { /* consume the response */ }); // download a resource with cache busting, but update the http // cache with the downloaded resource.
Using Service Workers - Web APIs
to do this, we use service worker’s brand new storage api — cache — a global object on the service worker that allows us to
store assets delivered by responses, and keyed by their requests.
...(see the browser compatibility section for more information.) if you want to use this now, you could consider using a polyfill like the one available in google's topeka demo, or perhaps
store your assets in indexeddb.
Storage.length - Web APIs
the length read-only property of the storage interface returns the number of data items
stored in a given storage object.
... syntax length = storage.length; return value the number of items
stored in the storage object.
Storage - Web APIs
it allows, for example, the addition, modification, or deletion of
stored data items.
... properties storage.length read only returns an integer representing the number of data items
stored in the storage object.
SubtleCrypto - Web APIs
storing keys cryptokey objects can be
stored using the structured clone algorithm, meaning that you can
store and retrieve them using standard web storage apis.
... the specification expects that most developers will use the indexeddb api to
store cryptokey objects.
Multi-touch interaction - Web APIs
ev.target.style.border = "dashed"; // check this event for 2-touch move/pinch/zoom gesture handle_pinch_zoom(ev); } touch end handler the touchend handler re
stores the event target's background color back to its original color.
... function end_handler(ev) { ev.preventdefault(); if (logevents) log(ev.type, ev, false); if (ev.targettouches.length == 0) { // re
store background and border to original values ev.target.style.background = "white"; ev.target.style.border = "1px solid black"; } } application ui the application uses <div> elements for the touch areas and provides buttons to enable logging and clear the log.
WEBGL_lose_context - Web APIs
webgl_lose_context.re
storecontext() simulates restoring the context.
... examples with this extension, you can simulate the webglcontextlost and webglcontextre
stored events: const canvas = document.getelementbyid('canvas'); const gl = canvas.getcontext('webgl'); canvas.addeventlistener('webglcontextlost', (event) => { console.log(event); }); gl.getextension('webgl_lose_context').losecontext(); // webglcontextevent event with type "webglcontextlost" is logged.
WebGLRenderingContext.bufferSubData() - Web APIs
the webglrenderingcontext.buffersubdata() method of the webgl api updates a subset of a buffer object's data
store.
... srcdata optional an arraybuffer, sharedarraybuffer or one of the arraybufferview typed array types that will be copied into the data
store.
WebGLRenderingContext.isContextLost() - Web APIs
examples include: two or more pages are using the gpu, but together place too high a demand on the gpu, so the browser tells the two contexts that they've lost the connection, then selects one of the two to re
store access for.
...in this case, all contexts are lost, then re
stored after switching gpus.
WebGLRenderingContext - Web APIs
webglrenderingcontext.pixel
storei() specifies the pixel storage modes webglrenderingcontext.polygonoffset() specifies the scale factors and units to calculate depth values.
... webglrenderingcontext.renderbufferstorage() creates a renderbuffer data
store.
Using shaders to apply color in WebGL - Web APIs
to do this, we first need to create an array of vertex colors, then
store it into a webgl buffer.
...then a new webgl buffer is allocated to
store these colors, and the array is converted into floats and
stored into the buffer.
WebGL model view projection - Web APIs
for convenience, these shaders are
stored in a <script> element that is brought into the program through the custom function mdn.createwebglprogramfromids().
...the positions and colors are
stored in gl buffers, sent to the shader as attributes, and then operated upon individually.
WebRTC connectivity - Web APIs
this information is exchanged and
stored using session description protocol (sdp); if you want details on the format of sdp data, you can find it in rfc 2327.
...a rollback re
stores the sdp offer (and the connection configuration by extension) to the configuration it had the last time the connection's signalingstate was stable.
Spaces and reference spaces: Spatial tracking in WebXR - Web APIs
since most users would prefer that you maintain the same viewer position and facing direction while performing this transition, you can use the xrframe method getviewerpose() to obtain the current xrviewerpose, switch the session, then use the saved viewer pose to re
store the viewer's position and facing.
...upon recovery of tracking, a reset means tracking has been re
stored and the new position information represents the actual position information provided by the xr hardware, rather than cached or "best-guess" data.
Starting up and shutting down a WebXR session - Web APIs
with the new reference space in hand and
stored into the worlddata object for safe-keeping, we call the session's requestanimationframe() method to schedule a callback to be executed when it's time to render the next frame of animation for the webxr session.
...you don't need a worlddata object to
store everything; you can
store the information you need to maintain any way you want to.
Example and tutorial: Simple synth keyboard - Web APIs
sineterms and cosineterms will be used to
store the data for generating the waveform; each will contain an array that's generated when the user chooses "custom".
...the returned oscillator is
stored into osclist for future reference, and data-pressed is set to yes to indicate that the note is playing so we don't start it again next time this is called.
Web audio spatialization basics - Web APIs
let's create constants that
store the values we'll use for these parameters later on: const innercone = 60; const outercone = 90; const outergain = 0.3; the next parameter is distancemodel — this can only be set to linear, inverse, or exponential.
...first, we'll get references to the elements we want to move, then we'll
store references to the values we'll change when we set up css transforms to actually do the movement.
Using Web Workers - Web APIs
we use the ports attribute of this event object to grab the port and
store it in a variable.
... the javascript code the following javascript code is
stored in the "fibonacci.js" file referenced by the html in the next section.
Window.open() - Web APIs
false;" title="this link will create a new window or will re-use an already opened one" >promote firefox adoption</a></p> you can also make such function able to open only 1 secondary window and to reuse such single secondary window for other links in this manner: <script type="text/javascript"> var windowobjectreference = null; // global variable var previousurl; /* global variable that will
store the url currently in the secondary window */ function openrequestedsinglepopup(url) { if(windowobjectreference == null || windowobjectreference.closed) { windowobjectreference = window.open(url, "singlesecondarywindowname", "resizable,scrollbars,status"); } else if(previousurl != url) { windowobjectreference = window.open(url, "singlesecondarywindowname",...
...*/ windowobjectreference.focus(); } else { windowobjectreference.focus(); }; previousurl = url; /* explanation: we
store the current url in order to compare url in the event of another call of this function.
XRRigidTransform.matrix - Web APIs
usage notes matrix format all 4x4 transform matrices used in webgl are
stored in 16-element float32arrays.
... the values are
stored into the array in column-major order; that is, each column is written into the array top-down before moving to the right one column and writing the next column into the array.
Introducing the CSS Cascade - CSS: Cascading Style Sheets
resetting styles after your content has finished altering styles, it may find itself in a situation where it needs to re
store them to a known state.
... all lets you opt to immediately re
store all properties to any of their initial (default) state, the state inherited from the previous level of the cascade, a specific origin (the user-agent stylesheet, the author stylesheet, or the user stylesheet), or even to clear the values of the properties entirely.
HTML5 - Developer guides
offline and storage: allowing webpages to
store data on the client-side locally and operate offline more efficiently.
... whatwg client-side session and persistent storage (aka dom storage) client-side session and persistent storage allows web applications to
store structured data on the client side.
HTML attribute: rel - HTML: Hypertext Markup Language
link link link manifest web app manifest link not allowed not allowed modulepreload tells to browser to preemptively fetch the script and
store it in the document's module map for later evaluation.
... modulepreload useful for improved performance, and relevant to the <link> anywhere in the document, setting rel="modulepreload" tells the browser to preemptively fetch the script (and dependencies) and
store it in the document's module map for later evaluation.
<input type="button"> - HTML: Hypertext Markup Language
the source for this interactive example is
stored in a github repository.
..."color"]'); var sizepicker = document.queryselector('input[type="range"]'); var output = document.queryselector('.output'); var clearbtn = document.queryselector('input[type="button"]'); // covert degrees to radians function degtorad(degrees) { return degrees * math.pi / 180; }; // update sizepicker output value sizepicker.oninput = function() { output.textcontent = sizepicker.value; } //
store mouse pointer coordinates, and whether the button is pressed var curx; var cury; var pressed = false; // update mouse pointer coordinates document.onmousemove = function(e) { curx = (window.event) ?
<input type="password"> - HTML: Hypertext Markup Language
the source for this interactive example is
stored in a github repository.
...finally, autocomplete is set to off to avoid password managers and session re
store features trying to set its value, since this isn't a password at all.
<input type="search"> - HTML: Hypertext Markup Language
the source for this interactive example is
stored in a github repository.
...the following screenshot comes from chrome: in addition, modern browsers also tend to automatically
store search terms previously entered across domains, which then come up as autocomplete options when subsequent searches are performed in search inputs on that domain.
<keygen> - HTML: Hypertext Markup Language
"smart cards") the user may also be given a choice of where to generate the key, i.e., in a smart card or in software and
stored on disk.
...the private key is encrypted and
stored in the local key database.
dir - HTML: Hypertext Markup Language
the source for this interactive example is
stored in a github repository.
... the auto value should be used for data with an unknown directionality, like data coming from user input, eventually
stored in a database.
Using the application cache - HTML: Hypertext Markup Language
the notification bar displays a message such as: this website (example.com) is asking to
store data on your computer for offline use.
... in firefox, the offline cache data is
stored separately from the firefox profile—next to the regular disk cache: windows vista/7: c:\users\<username>\appdata\local\mozilla\firefox\profiles\<salt>.<profile name>\offlinecache mac/linux: /users/<username>/library/caches/firefox/profiles/<salt>.<profile name>/offlinecache in firefox the current status of the offline cache can be inspected on the about:cache page (under the "offline cac...
Clear-Site-Data - HTTP
it allows web developers to have more control over the data
stored locally by a browser for their origins.
... examples sign out of web site if a user signs out of your website or service, you might want to remove locally
stored data.
Link prefetching FAQ - HTTP
a web page provides a set of prefetching hints to the browser, and after the browser is finished loading the page, it begins silently prefetching specified documents and
stores them in its cache.
...if a prefetched document is partially downloaded, then the partial document will still be
stored in the cache provided the server sent an "accept-ranges: bytes" response header.
HTTP Public Key Pinning (HPKP) - HTTP
the first time a web server tells a client via a special http header which public keys belong to it, the client
stores this information for a given period of time.
...max-age=5184000 tells the client to
store this information for two months, which is a reasonable time limit according to the ietf rfc.
Closures - JavaScript
they share the same function body definition, but
store different lexical environments.
...you could
store this function in a separate variable makecounter, and then use it to create several counters.
JavaScript data types and data structures - JavaScript
with bigints, you can safely
store and operate on large integers even beyond the safe integer limit for numbers.
... 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 with an empty argument list and retrieves the property value whenever a get access to the value is performed.
TypeError: X.prototype.y called on incompatible type - JavaScript
this issue can also happen when providing a function that is
stored as a property of an object as an argument to another function.
... in this case, the object that
stores the function won't be the this target of that function when it is called by the other function.
Array.prototype.flat() - JavaScript
the source for this interactive example is
stored in a github repository.
...on shift/unshift, but array ops on the end tends to be faster function flatten(input) { const stack = [...input]; const res = []; while(stack.length) { // pop value from stack const next = stack.pop(); if(array.isarray(next)) { // push back array items, won't modify the original input stack.push(...next); } else { res.push(next); } } // reverse to re
store input order return res.reverse(); } const arr = [1, 2, [3, 4, [5, 6]]]; flatten(arr); // [1, 2, 3, 4, 5, 6] use generator function function* flatten(array, depth) { if(depth === undefined) { depth = 1; } for(const item of array) { if(array.isarray(item) && depth > 0) { yield* flatten(item, depth - 1); } else { yield item; } }...
Atomics.exchange() - JavaScript
the static atomics.exchange() method
stores a given value at a given position in the array and returns the old value at that position.
... the source for this interactive example is
stored in a github repository.
Atomics.notify() - JavaScript
however, once the writing thread has
stored a new value, it will be notified by the writing thread and return the new value (123).
... atomics.wait(int32, 0, 0); console.log(int32[0]); // 123 a writing thread
stores a new value and notifies the waiting thread once it has written: console.log(int32[0]); // 0; atomics.
store(int32, 0, 123); atomics.notify(int32, 0, 1); specifications specification ecmascript (ecma-262)the definition of 'atomics.notify' in that specification.
Atomics.wait() - JavaScript
however, once the writing thread has
stored a new value, it will be notified by the writing thread and return the new value (123).
... atomics.wait(int32, 0, 0); console.log(int32[0]); // 123 a writing thread
stores a new value and notifies the waiting thread once it has written: console.log(int32[0]); // 0; atomics.
store(int32, 0, 123); atomics.notify(int32, 0, 1); specifications specification ecmascript (ecma-262)the definition of 'atomics.wait' in that specification.
DataView.prototype.getFloat32() - JavaScript
the source for this interactive example is
stored in a github repository.
... littleendian optional indicates whether the 32-bit float is
stored in little- or big-endian format.
DataView.prototype.getFloat64() - JavaScript
the source for this interactive example is
stored in a github repository.
... littleendian optional indicates whether the 64-bit float is
stored in little- or big-endian format.
DataView.prototype.getInt16() - JavaScript
the source for this interactive example is
stored in a github repository.
... littleendian optional indicates whether the 16-bit int is
stored in little- or big-endian format.
DataView.prototype.getInt32() - JavaScript
the source for this interactive example is
stored in a github repository.
... littleendian optional indicates whether the 32-bit int is
stored in little- or big-endian format.
DataView.prototype.getUint16() - JavaScript
the source for this interactive example is
stored in a github repository.
... littleendian optional indicates whether the 16-bit int is
stored in little- or big-endian format.
DataView.prototype.getUint32() - JavaScript
the source for this interactive example is
stored in a github repository.
... littleendian optional indicates whether the 32-bit int is
stored in little- or big-endian format.
Date.prototype.setSeconds() - JavaScript
the source for this interactive example is
stored in a github repository.
...for example, if you use 100 for secondsvalue, the minutes
stored in the date object will be incremented by 1, and 40 will be used for seconds.
Date.prototype.setUTCDate() - JavaScript
the source for this interactive example is
stored in a github repository.
...for example, if you use 40 for dayvalue, and the month
stored in the date object is june, the day will be changed to 10 and the month will be incremented to july.
Date.prototype.setUTCMilliseconds() - JavaScript
the source for this interactive example is
stored in a github repository.
...for example, if you use 1100 for millisecondsvalue, the seconds
stored in the date object will be incremented by 1, and 100 will be used for milliseconds.
Date.prototype.setUTCSeconds() - JavaScript
the source for this interactive example is
stored in a github repository.
...for example, if you use 100 for secondsvalue, the minutes
stored in the date object will be incremented by 1, and 40 will be used for seconds.
Map - JavaScript
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.
...the value of 'bla' is not
stored in the map for queries.
Math.imul() - JavaScript
the source for this interactive example is
stored in a github repository.
...multiplying two numbers
stored internally as integers (which is only possible with asmjs) with imul is the only potential circumstance where math.imul may prove performant in current browsers.
Object - JavaScript
it is used to
store various keyed collections and more complex entities.
... examples using object given undefined and null types the following examples
store an empty object object in o: let o = new object() let o = new object(undefined) let o = new object(null) using object to create boolean objects the following examples
store boolean objects in o: // equivalent to o = new boolean(true) let o = new object(true) // equivalent to o = new boolean(false) let o = new object(boolean()) object prototypes when altering the behavior of existing...
Promise.prototype.catch() - JavaScript
the source for this interactive example is
stored in a github repository.
... examples using and chaining the catch method var p1 = new promise(function(resolve, reject) { resolve('success'); }); p1.then(function(value) { console.log(value); // "success!" throw new error('oh, no!'); }).catch(function(e) { console.error(e.message); // "oh, no!" }).then(function(){ console.log('after a catch the chain is re
stored'); }, function () { console.log('not fired due to the catch'); }); // the following behaves the same as above p1.then(function(value) { console.log(value); // "success!" return promise.reject('oh, no!'); }).catch(function(e) { console.error(e); // "oh, no!" }).then(function(){ console.log('after a catch the chain is re
stored'); }, function () { console.log('not fired due to the catc...
Set() constructor - JavaScript
the set constructor lets you create set objects that
store unique values of any type, whether primitive values or object references.
... the source for this interactive example is
stored in a github repository.
Set - JavaScript
the set object lets you
store unique values of any type, whether primitive values or object references.
... nan and undefined can also be
stored in a set.
Symbol.for() - JavaScript
the source for this interactive example is
stored in a github repository.
... [[symbol]] a symbol that is
stored globally.
TypedArray.prototype.subarray() - JavaScript
the subarray() method returns a new typedarray on the same arraybuffer
store and with the same element types as for this typedarray object.
... the source for this interactive example is
stored in a github repository.
TypedArray - JavaScript
the source for this interactive example is
stored in a github repository.
... typedarray.prototype.set()
stores multiple values in the typed array, reading input values from a specified array.
eval() - JavaScript
the source for this interactive example is
stored in a github repository.
..."a.b.c" var result = setdescendantprop(obj, proppath, 1); // obj.a.b.c will now be 1 use functions instead of evaluating snippets of code javascript has first-class functions, which means you can pass functions as arguments to other apis,
store them in variables and objects' properties, and so on.
yield - JavaScript
the source for this interactive example is
stored in a github repository.
... let apple
store = countapplesales() // generator { } console.log(apple
store.next()) // { value: 3, done: false } console.log(apple
store.next()) // { value: 7, done: false } console.log(apple
store.next()) // { value: 5, done: false } console.log(apple
store.next()) // { value: undefined, done: true } you can also send a value with next(value) into the generator.
Strict mode - JavaScript
many compiler optimizations rely on the ability to say that variable x is
stored in that location: this is critical to fully optimizing javascript code.
...arguments objects for strict mode functions
store the original arguments when the function was invoked.
related_applications - Web app manifests
type array mandatory no the related_applications field is an array of objects specifying native applications that are installable by, or accessible to, the underlying platform — for example, a native android application obtainable through the google play
store.
... examples "related_applications": [ { "platform": "play", "url": "https://play.google.com/
store/apps/details?id=com.example.app1", "id": "com.example.app1" }, { "platform": "itunes", "url": "https://itunes.apple.com/app/example-app1/id123456789" } ] related application values application objects may contain the following values: member description platform the platform on which the application can be found.
Web app manifests
web app manifests are part of a collection of web technologies called progressive web apps (pwas), which are websites that can be installed to a device’s homescreen without an app
store.
...png" }, { "src": "images/touch/homescreen144.png", "sizes": "144x144", "type": "image/png" }, { "src": "images/touch/homescreen168.png", "sizes": "168x168", "type": "image/png" }, { "src": "images/touch/homescreen192.png", "sizes": "192x192", "type": "image/png" }], "related_applications": [{ "platform": "play", "url": "https://play.google.com/
store/apps/details?id=cheeaun.hackerweb" }] } deploying a manifest web app manifests are deployed in your html pages using a <link> element in the <head> of a document: <link rel="manifest" href="/manifest.webmanifest"> note: the .webmanifest extension is specified in the media type registration section of the specification (the response of the manifest file should return content-type: applicati...
Digital video concepts - Web media technologies
yuv data representation because the image is represented using more detail in greyscale than in color, the values of y', u, and v are not typically
stored together, one sample per pixel, the way rgb images are
stored in memory.
...for example, in the av1 codec, a record
stores the encoded luma for a tile, and a second record contains the chroma data in the form of the u and v values.
Navigation and resource timings - Web Performance
if a persistent connection is used, or the information is
stored in a cache or a local resource, the value will be the same as performancetiming.fetchstart.
...if a persistent connection is used, or the information is
stored in a cache or a local resource, the value will be the same as performancetiming.fetchstart.
local - SVG: Scalable Vector Graphics
the local attribute specifies the unique id for a locally
stored color profile as specified by international color consortium.
... only one element is using this attribute: <color-profile> usage notes value <string> default value none animatable no <string> this value specifies the unique id for a locally
stored color profile as specified by international color consortium.
SVG documentation index - SVG: Scalable Vector Graphics
127 local deprecated, svg, svg attribute the local attribute specifies the unique id for a locally
stored color profile as specified by international color consortium.
... 306 <defs> svg, svg container the <defs> element is used to
store graphical objects that will be used at a later time.
Enabling the behavior - updating the status bar panel - Archive of obsolete content
status", "busted"); else if (gxmlhttprequest.responsetext.match("ffaa00")) icon.setattribute("status", "testfailed"); else if (gxmlhttprequest.responsetext.match("11dd11")) icon.setattribute("status", "success"); else icon.setattribute("status", ""); } updatetinderboxstatus() retrieves a reference to the statusbarpanel element then searches through the retrieved html document (
stored in the responsetext property of the xmlhttprequest instance) for one of several color references.
Getting Started - Archive of obsolete content
for this reason we suggest that you install a second copy into a second directory (make sure that you use a different profile as stated in the release notes) extract the chrome the chrome is
stored in \mozilla\chrome and the individual modules are
stored in jar files.
Dehydra Object Reference - Archive of obsolete content
for example, an int[10] would have .max = 9 .variablelength boolean flag true if the type represents a c99 variable-length array type number type property type description .precision integer for floating-point types, the precision of the type .min integer for integer types, the minimum value capable of being
stored .max integer for integer types, the maximum value capable of being
stored .issigned boolean flag for integer types, true if the type
stores signed values .isunsigned boolean flag for integer types, true if the type
stores unsigned values .bitfieldbits integer if the type represents a bitfield, the number of bits used by the bitfield .bitfieldof number type object if the type repre...
Repackaging Firefox - Archive of obsolete content
if you find a preference you think is generally useful to most partner repacks, please add it below, using the same style: localizable preferences browser.startup.homepage=<string> browser.startup.homepage_reset=<string> url for the default homepage, and what the homepage gets reset to when the user hits "re
store to default" in the preferences.
HTTP Class Overview - Archive of obsolete content
nsirequest encapsulates a http request and response parses incoming data nshttpchunkeddecoder owned by a transaction strips chunked transfer encoding nshttprequesthead owns a nshttpheaderarray knows how to fill a request buffer nshttpresponsehead owns a nshttpheaderarray knows how to parse response lines performs common header manipulations/calculations nshttpheaderarray
stores http "<header>:<value>" pairs nshttpauthcache
stores authentication credentials for http auth domains nshttpbasicauth implements nsihttpauthenticator generates basic auth credentials from user:pass nshttpdigestauth implements nsihttpauthenticator generates digest auth credentials from user:pass original document information author(s): darin fisher last updated date: augus...
JavaScript crypto - Archive of obsolete content
= 0x1<<5; //diffie-hellman pkcs11_mech_skipjack_flag = 0x1<<6; //skipjack algorithm as in fortezza cards pkcs11_mech_rc5_flag = 0x1<<7; pkcs11_mech_sha1_flag = 0x1<<8; pkcs11_mech_md5_flag = 0x1<<9; pkcs11_mech_md2_flag = 0x1<<10; pkcs11_mech_random_flag = 0x1<<27; //random number generator pkcs11_pub_readable_cert_flag = 0x1<<28; //
stored certs can be read off the token w/o logging in pkcs11_disable_flag = 0x1<<30; //tell mozilla to disable this slot by default cipher flags reserved important for cryptomechanismflags 0x1<<11, 0x1<<12, ...
Storage - Archive of obsolete content
simple storage an easy-to-use persistent object data
store file access interface for performing file i/o settings settings persist across browser sessions and are accessible to jetpacks via simple object retrieval and assignment.
Mozilla Application Framework in Detail - Archive of obsolete content
the technology that makes this possible, xpinstall, allows application developers to write javascript installations that manage special cross-platform installation archives (called xpis, or "zippies"), in which packages such as new skins for the browser, patches, browser extensions, new gecko-based applications, and third party standalone applications are
stored.
PR_cnvtf
syntax #include <prdtoa.h> void pr_cnvtf ( char *buf, printn bufsz, printn prcsn, prfloat64 fval); parameters the function has these parameters: buf the address of the buffer in which to
store the result.
PR_strtod
if the value of se is not (char **) null, pr_strtod
stores a pointer to the character terminating the scan in *se.
Building NSS
test output is
stored in tests_results/security/$host.$number/.
Cryptography functions
ymkeywithflagsperm mxr 3.9 and later pk11_pubwrapsymkey mxr 3.2 and later pk11_randomupdate mxr 3.2 and later pk11_readrawattribute mxr 3.9.2 and later pk11_referencesymkey mxr 3.2 and later pk11_resettoken mxr 3.4 and later pk11_re
storecontext mxr 3.2 and later pk11_savecontext mxr 3.2 and later pk11_savecontextalloc mxr 3.6 and later pk11_setfortezzahack mxr 3.2 and later pk11_setpasswordfunc mxr 3.2 and later pk11_setprivatekeynickname mxr 3.4 and later pk11_set...
Encrypt Decrypt MAC Keys As Session Objects
* loop until eof(input) * read a buffer of plaintext from input file, * mac it, append the mac to the plaintext * encrypt it using cbc, using previously created iv, *
store the last block of ciphertext as the new iv, * write the cipher text to intermediate file * close files * report success */ secstatus rv; prfiledesc *infile; prfiledesc *headerfile; prfiledesc *encfile; unsigned char *enckeyid = (unsigned char *) "encrypt key"; unsigned char *mackeyid = (unsigned char...
Encrypt and decrypt MAC using token
* loop until eof(input) * read a buffer of plaintext from input file, * mac it, append the mac to the plaintext * encrypt it using cbc, using previously created iv, *
store the last block of ciphertext as the new iv, * write the cipher text to intermediate file * close files * report success */ secstatus rv; prfiledesc *infile; prfiledesc *headerfile; prfiledesc *encfile; unsigned char *enckeyid = (unsigned char *) "encrypt key"; unsigned char *mackeyid = (unsigned char...
NSS 3.12.4 release notes
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_httpcert
store_findsocketconnection reuses closed socket bug 470070: multiple object leaks reported by tinderbox bug 470479: io timeout during cert fetching makes libpkix abort validation.
NSS 3.16.4 release notes
notable changes in nss 3.16.4 the following 1024-bit root ca certificate was re
stored to allow more time to develop a better transition strategy for affected sites.
NSS 3.18.1 release notes
notable changes in nss 3.18.1 the following ca certificate had the websites and code signing trust bits re
stored to their original state to allow more time to develop a better transition strategy for affected sites.
NSS 3.27.2 Release Notes
previous versions of nss leaked the memory used to
store distinguished names when ssl_settrustanchors() was used.
NSS 3.47 release notes
8557 - bad debug statement in tls13con.c bug 1579060 - mozilla::pkix tag definitions for issueruniqueid and subjectuniqueid shouldn't have the constructed bit set bug 1583068 - nss 3.47 should pick up fix from bug 1575821 (nspr 4.23) bug 1152625 - support aes hw acceleration on armv8 bug 1549225 - disable dsa signature schemes for tls 1.3 bug 1586947 - pk11_importandreturnprivatekey does not
store nickname for ec keys bug 1586456 - unnecessary conditional in pki3hack, pk11load and stanpcertdb bug 1576307 - check mechanism param and param length before casting to mechanism-specific structs bug 1577953 - support longer (up to rfc maximum) hkdf outputs bug 1508776 - remove refcounting from sftk_freesession (cve-2019-11756) bug 1494063 - support tls exporter in tstclnt and selfserv bug 1...
NSS 3.53 release notes
this attribute provides a more graceful phase-out for certificate authorities than complete removal from the root certificate builtin
store.
NSS API Guidelines
queued, linked, and hash table
stored objects should be examined with special care.
Enc Dec MAC Output Public Key as CSR
* open an input file and an output file, * wrap the symmetric and mac keys using public key * write a header to the output that identifies the two wrapped keys * and public key * loop until eof(input) * read a buffer of plaintext from input file, * mac it, append the mac to the plaintext * encrypt it using cbc, using previously created iv, *
store the last block of ciphertext as the new iv, * write the cipher text to intermediate file * close files * report success */ secstatus rv; seckeypublickey *pubkey = null; secitem *pubkeydata = null; prfiledesc *infile = null; prfiledesc *headerfile = null; prfiledesc *encfile ...
Element.querySelectorAll() - Web APIs
the :scope pseudo-class re
stores the expected behavior, only matching selectors on descendants of the base element: var select = document.queryselector('.select'); var inner = select.queryselectorall(':scope .outer .inner'); inner.length; // 0 specifications specification status comment domthe definition of 'parentnode.queryselectorall()' in that specification.
FederatedCredential - Web APIs
examples var cred = new federatedcredential({ id: id, name: name, provider: 'https://account.google.com', iconurl: iconurl }); //
store it navigator.credentials.
store(cred) .then(function() { // do something else.
FileReader - Web APIs
the filereader object lets web applications asynchronously read the contents of files (or raw data buffers)
stored on the user's computer, using file or blob objects to specify the file or data to read.
Gamepad.buttons - Web APIs
syntax readonly attribute gamepadbutton[] buttons; example the following code is taken from my gamepad api button demo (you can view the demo live, and find the source code on github.) note the code fork — in chrome navigator.getgamepads needs a webkit prefix and the button values are
stores as an array of double values, whereas in firefox navigator.getgamepads doesn't need a prefix, and the button values are
stored as an array of gamepadbutton objects; it is the gamepadbutton.value or gamepadbutton.pressed properties of these we need to access, depending on what type of buttons they are.
GamepadButton - Web APIs
example the following code is taken from my gamepad api button demo (you can view the demo live, and find the source code on github.) note the code fork — in chrome navigator.getgamepads needs a webkit prefix and the button values are
stored as an array of double values, whereas in firefox navigator.getgamepads doesn't need a prefix, and the button values are
stored as an array of gamepadbutton objects; it is the gamepadbutton.value or gamepadbutton.pressed properties of these we need to access, depending on what type of buttons they are.
GlobalEventHandlers.onpointerdown - Web APIs
we also have a handler for pointerup events: targetbox.onpointerup = handleup; function handleup(evt) { targetbox.innerhtml = "tap me, click me, or touch me!"; evt.preventdefault(); } this code's job is to just re
store the original text into the target box after the user's interaction with the element ends (for example, when they release the mouse button, or when they lift the stylus or finger from the screen).
HTMLCanvasElement.toBlob() - Web APIs
the htmlcanvaselement.toblob() method creates a blob object representing the image contained in the canvas; this file may be cached on the disk or
stored in memory at the discretion of the user agent.
HTMLInputElement - Web APIs
possible values are: on: the browser can autocomplete the value using previously
stored value off: the user must explicity enter a value max string: returns / sets the element's max attribute, containing the maximum (numeric or date-time) value for this item, which must not be less than its minimum (min attribute) value.
The HTML DOM API - Web APIs
web storage interfaces the web_storage_api provides the ability for web sites to
store data either temporarily or permanently on the user's device for later re-use.
History.pushState() - Web APIs
because firefox saves state objects to the user's disk so they can be re
stored after the user restarts the browser, we impose a size limit of 640k characters on the serialized representation of a state object.
Ajax navigation example - Web APIs
this content is
stored into a php variable.</p>"; if (isset($_get["view_as"]) && $_get["view_as"] == "json") { echo json_encode(array("page" => $page_title, "content" => $page_content)); } else { ?> <!doctype html> <html> <head> <?php include "include/header.php"; echo "<title>" .
Working with the History API - Web APIs
because firefox saves state objects to the user's disk so they can be re
stored after the user restarts the browser, we impose a size limit of 640k characters on the serialized representation of a state object.
IDBCursor.request - Web APIs
for example: function displaydata() { list.innerhtml = ''; var transaction = db.transaction(['rushalbumlist'], 'readonly'); var object
store = transaction.object
store('rushalbumlist'); var request = object
store.opencursor(); request.onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.albumtitle + '</strong>, ' + cursor.value.year; list.appendchild(listitem); console.log(cu...
IDBDatabase.close() - Web APIs
// create event handlers for both success and failure of dbopenrequest.onerror = function(event) { note.innerhtml += "<li>error loading database.</li>"; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += "<li>database initialised.</li>"; //
store the result of opening the database in the db variable.
IDBDatabase.onclose - Web APIs
this can happen, for example, when the application is shut down or access to the disk the database is
stored on is lost while the database is open.
IDBDatabase.version - Web APIs
example // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database // being opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; //
store the result of opening the database in the db variable.
IDBFactory.deleteDatabase() - Web APIs
note that attempting to delete a database that doesn't exist does not throw an exception, in contrast to idbdatabase.deleteobject
store(), which does throw an exception if the named object
store does not exist.
IDBFactory.open() - Web APIs
*) // let us open version 4 of our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being opened // successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; //
store the result of opening the database in the db // variable.
IDBFactory - Web APIs
we don't need window.mozidb*) // let us open version 4 of our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being opened successfully, or not dbopenrequest.onerror = function(event) { console.error("error loading database."); }; dbopenrequest.onsuccess = function(event) { console.info("database initialised."); //
store the result of opening the database in the db variable.
IDBIndex.getAllKeys() - Web APIs
example var myindex = object
store.index('index'); var getallkeysrequest = myindex.getallkeys(); getallkeysrequest.onsuccess = function() { console.log(getallkeysrequest.result); } specification specification status comment indexed database api draftthe definition of 'getall()' in that specification.
IDBLocaleAwareKeyRange - Web APIs
examples function displaydata() { var keyrangevalue = idblocaleawarekeyrange.bound("a", "f"); var transaction = db.transaction(['fthings'], 'readonly'); var object
store = transaction.object
store('fthings'); var myindex = object
store.index('lname'); myindex.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tablerow = document.createelement('tr'); tablerow.innerhtml = '<td>' + cursor.value.id + '</td>' + '<td>' + cursor.value.lname + '&l...
IDBTransaction.commit() - Web APIs
duplicate items not allowed.</li>'; }; // create an object
store on the transaction var object
store = transaction.object
store("myobj
store"); // add our newitem object to the object
store var object
storerequest = object
store.add(newitem[0]); object
storerequest.onsuccess = function(event) { // report the success of the request (this does not mean the item // has been
stored successfully in the db - for that you need transaction.onsuccess) note.innerhtml ...
IDBVersionChangeEvent.newVersion - Web APIs
don't need window.mozidb*) // let us open version 4 of our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being opened dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; //
store the result of opening the database in the db variable.
IDBVersionChangeEvent.oldVersion - Web APIs
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.createobject
store("
store1"); } if (e.oldversion < 2) { db.deleteobject
store("
store1"); db.createobject
store("
store2"); } // etc.
IDBVersionChangeEvent - Web APIs
idb*) // let us open version 4 of our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; //
store the result of opening the database in the db variable.
Math.LN10 - JavaScript
the math.ln10 property represents the natural logarithm of 10, approximately 2.302: math.ln10=ln(10)≈2.302\mathtt{\mi{math.ln10}} = \ln(10) \approx 2.302 the source for this interactive example is
stored in a github repository.
Math.LN2 - JavaScript
the math.ln2 property represents the natural logarithm of 2, approximately 0.693: math.ln2=ln(2)≈0.693\mathtt{\mi{math.ln2}} = \ln(2) \approx 0.693 the source for this interactive example is
stored in a github repository.
Math.LOG10E - JavaScript
the math.log10e property represents the base 10 logarithm of e, approximately 0.434: math.log10e=log10(e)≈0.434\mathtt{\mi{math.log10e}} = \log_10(e) \approx 0.434 the source for this interactive example is
stored in a github repository.
Math.LOG2E - JavaScript
the math.log2e property represents the base 2 logarithm of e, approximately 1.442: math.log2e=log2(e)≈1.442\mathtt{\mi{math.log2e}} = \log_2(e) \approx 1.442 the source for this interactive example is
stored in a github repository.
Math.PI - JavaScript
the math.pi property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159: math.pi=π≈3.14159\mathtt{\mi{math.pi}} = \pi \approx 3.14159 the source for this interactive example is
stored in a github repository.
Math.SQRT1_2 - JavaScript
the math.sqrt1_2 property represents the square root of 1/2 which is approximately 0.707: math.sqrt1_2=12=12≈0.707\mathtt{\mi{math.sqrt1_2}} = \sqrt{\frac{1}{2}} = \frac{1}{\sqrt{2}} \approx 0.707 the source for this interactive example is
stored in a github repository.
Math.SQRT2 - JavaScript
the math.sqrt2 property represents the square root of 2, approximately 1.414: math.sqrt2=2≈1.414\mathtt{\mi{math.sqrt2}} = \sqrt{2} \approx 1.414 the source for this interactive example is
stored in a github repository.
Math.abs() - JavaScript
the math.abs() function returns the absolute value of a number, that is math.abs(x)=|x|={xifx>00ifx=0-xifx<0{\mathtt{\operatorname{math.abs}(z)}} = {|z|} = \begin{cases} x & \text{if} \quad x \geq 0 \\ x & \text{if} \quad x < 0 \end{cases} the source for this interactive example is
stored in a github repository.
Math.acos() - JavaScript
the math.acos() function returns the arccosine (in radians) of a number, that is ∀x∊[-1;1],math.acos(x)=arccos(x)= the unique y∊[0;π]such thatcos(y)=x\forall x \in [{-1};1],\;\mathtt{\operatorname{math.acos}(x)} = \arccos(x) = \text{ the unique } \; y \in [0; \pi] \, \text{such that} \; \cos(y) = x the source for this interactive example is
stored in a github repository.
Math.acosh() - JavaScript
the math.acosh() function returns the hyperbolic arc-cosine of a number, that is ∀x≥1,math.acosh(x)=arcosh(x)= the unique y≥0such thatcosh(y)=x\forall x \geq 1, \mathtt{\operatorname{math.acosh}(x)} = \operatorname{arcosh}(x) = \text{ the unique } \; y \geq 0 \; \text{such that} \; \cosh(y) = x the source for this interactive example is
stored in a github repository.
Math.asin() - JavaScript
the math.asin() function returns the arcsine (in radians) of a number, that is ∀x∊[-1;1],math.asin(x)=arcsin(x)= the unique y∊[-π2;π2]such thatsin(y)=x\forall x \in [{-1};1],\;\mathtt{\operatorname{math.asin}(x)} = \arcsin(x) = \text{ the unique } \; y \in \left[-\frac{\pi}{2}; \frac{\pi}{2}\right] \, \text{such that} \; \sin(y) = x the source for this interactive example is
stored in a github repository.
Math.asinh() - JavaScript
the math.asinh() function returns the hyperbolic arcsine of a number, that is math.asinh(x)=arsinh(x)= the unique ysuch thatsinh(y)=x\mathtt{\operatorname{math.asinh}(x)} = \operatorname{arsinh}(x) = \text{ the unique } \; y \; \text{such that} \; \sinh(y) = x the source for this interactive example is
stored in a github repository.
Math.atan() - JavaScript
the math.atan() function returns the arctangent (in radians) of a number, that is math.atan(x)=arctan(x)= the unique y∊[-π2;π2]such thattan(y)=x\mathtt{\operatorname{math.atan}(x)} = \arctan(x) = \text{ the unique } \; y \in \left[-\frac{\pi}{2}; \frac{\pi}{2}\right] \, \text{such that} \; \tan(y) = x the source for this interactive example is
stored in a github repository.
Math.atanh() - JavaScript
the math.atanh() function returns the hyperbolic arctangent of a number, that is ∀x∊(-1,1),math.atanh(x)=arctanh(x)= the unique ysuch thattanh(y)=x\forall x \in \left( -1, 1 \right), \mathtt{\operatorname{math.atanh}(x)} = \operatorname{arctanh}(x) = \text{ the unique } \; y \; \text{such that} \; \tanh(y) = x the source for this interactive example is
stored in a github repository.