Search completed in 1.07 seconds.
1805 results for "update":
Your results are loading. Please wait...
PaymentRequestUpdateEvent.updateWith() - Web APIs
for address field specific errors, use shippingaddresserrors. ...
...for address field specific errors, use shippingaddresserrors. ...
...for address field specific errors, use shippingaddresserrors. ...
...And 6 more matches
PaymentRequestUpdateEvent.PaymentRequestUpdateEvent() - Web APIs
the paymentrequestupdateevent constructor creates a new paymentrequestupdateevent object which enables a web page to update the details of a paymentrequest in response to a user action. actual updates are made by passing options to the updatewith() method. syntax var paymentrequestupdateevent = new paymentrequestupdateevent() parameters none. return value a new paymentrequestupdateevent object.payment request apithe definition of 'paymentrequestupdateevent' in that specification. specifications specification status comment payment request apithe definition of 'paymentrequestupdateevent()' in that specification. candidate recommendation initial definition. ...
Extension Versioning, Update and Compatibility - Archive of obsolete content
ns applications look at the targetapplication entries in the add-on's install.rdf. an entry must exist with an id matching the id of the application. additionally the minversion and maxversion of this entry must be a range that includes the version of the running application. if the application has a targetapplication entry but it is for an incompatible version then the application will retrieve updated compatibility information from the add-on's updateurl. if the install.rdf contains any targetplatform entries then the platform of the currently running application must be listed or the installation will be rejected. firefox 3 note in applications based on gecko 1.9 you can also use a targetapplication entry with an id toolkit@mozilla.org and minversion and maxversion that match the toolk...
...f the application since you do not know what api and ui changes are just around the corner. with compatibility updating it is not necessary to release a whole new version of the extension just to increase its maxversion. for the maxversion it is generally permissible to use a * in place of the minor version of the application you support, for example 2.0.0.* would mean that you support any minor update to version 2 of the application. the application will usually suggest to extension authors which version part it is sensible to do this with. do not mistakenly think that * in a version represents any version. the * actually represents an infinitely high number and so is really only sensibly used in the maxversion. using it in a minversion usually doesn't produce the effect you want. valid appl...
... application will usually suggest to extension authors which version part it is sensible to do this with. do not mistakenly think that * in a version represents any version. the * actually represents an infinitely high number and so is really only sensibly used in the maxversion. using it in a minversion usually doesn't produce the effect you want. ...
...And 35 more matches
Application Update - Archive of obsolete content
compiled versions of mar are available in the gecko sdk under the folder /host/bin for your os. ...
...compiled versions of mar are available in the gecko sdk under the folder /host/bin for your os. ...
...compiled versions of mar are available in the gecko sdk under the folder /host/bin for your os. ...
...And 24 more matches
AddonUpdateChecker
the addonupdatechecker is used to download and parse update information for an add-on's update manifest. if all you care about is finding the newest version for an addon then you probably want to use findupdates() instead. ...
... the addonupdatechecker is used to download and parse update information for an add-on's update manifest. if all you care about is finding the newest version for an addon then you probably want to use findupdates() instead. ...
... the addonupdatechecker is used to download and parse update information for an add-on's update manifest. if all you care about is finding the newest version for an addon then you probably want to use findupdates() instead. ...
...And 24 more matches
nsIUpdate
toolkit/mozapps/update/nsiupdateservice.idlscriptable an interface that describes an object representing an available update to the current application - this update may have several available patches from which one must be selected to download and install, for example we might select a binary difference patch first and attempt to apply that, then if the application process fails fall back to downloading a complete file-replace patch. this object also contains information about the update that the front end and other application services can use to learn more about what is going on. ...
... process fails fall back to downloading a complete file-replace patch. this object also contains information about the update that the front end and other application services can use to learn more about what is going on. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsiupdatepatch getpatchat(in unsigned long index); nsidomelement serialize(in nsidomdocument updates); attributes attribute type description appversion astring the application version of this update. billboardurl astring the url to a page that is typically localized to display in the update prompt. buildid astring the build id of this update. this is used to identify a particular build, dow...
...illboardurl astring the url to a page that is typically localized to display in the update prompt. buildid astring the build id of this update. this is used to identify a particular build, down to the hour, minute, and second of its creation. this lets the system differentiate between several nightly builds with the same version, for example. channel astring the channel used to retrieve this update from the update service. detailsurl astring the url to a page which offers details about the content of this update. ideally, this page is not the release notes but some other page that summarizes the differences between this update and the previous, which also links to the release notes. displayversion astring the string to display in the user interface for the version. if you want a real v...
...And 20 more matches
nsIApplicationUpdateService
toolkit/mozapps/update/nsiupdateservice.idlscriptable this interface describes a global application service that handles performing background update checks. it also provides utilities for selecting and downloading update patches. ...
...lobal application service that handles performing background update checks. it also provides utilities for selecting and downloading update patches. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void adddownloadlistener(in nsirequestobserver listener); astring downloadupdate(in nsiupdate update, in boolean background); void pausedownload(); void removedownloadlistener(in nsirequestobserver listener); nsiupdate selectupdate([array, size_is(updatecount)] in nsiupdate updates, in unsigned long updatecount); attributes attribute type description backgroundchecker nsiupdatechecker the update checker being used for background update checking. read only. can...
...siupdate update, in boolean background); void pausedownload(); void removedownloadlistener(in nsirequestobserver listener); nsiupdate selectupdate([array, size_is(updatecount)] in nsiupdate updates, in unsigned long updatecount); attributes attribute type description backgroundchecker nsiupdatechecker the update checker being used for background update checking. read only. canapplyupdates boolean true if the update service can download and install updates. indicates if the current user has access privileges to the install directory. read only. cancheckforupdates boolean true if the update service can check for updates. application updates might be disabled by the application and the platform the application is running on. read only. ...
...And 16 more matches
Setting up an update server
there are two common ways to obtain a mar to use: download a prebuilt one, or build one yourself. downloading a mar prebuilt nightly mars can be found here on archive.mozilla.org. be sure that you use the one that matches your machine's configuration. for example, if you want the nightly mar from 2019-09-17 for a 64 bit windows machine, you probably want the mar located at https://archive.mozilla.org/pub/firefox/nightly/2019/09/2019-09-17-09-36-29-mozilla-central/firefox-71.0a1.en-us.win64.complete.mar. ...
...he nightly mar from 2019-09-17 for a 64 bit windows machine, you probably want the mar located at https://archive.mozilla.org/pub/firefox/nightly/2019/09/2019-09-17-09-36-29-mozilla-central/firefox-71.0a1.en-us.win64.complete.mar. prebuilt mars for release and beta can be found here. beta builds are those with a b in the version string. after locating the desired version, the mars will be in the update directory. you want to use the mar labelled complete, not a partial mar. here is an example of an appropriate mar file to use: https://archive.mozilla.org/pub/firefox/releases/69.0b9/update/win64/firefox-69.0b9.complete.mar. building a mar building a mar locally is more complicated. part of the problem is that mars are signed by mozilla and so you cannot really build an "official" mar yourself.
...see building firefox for more information on building firefox locally. ...
...And 14 more matches
nsIUpdatePrompt
toolkit/mozapps/update/nsiupdateservice.idlscriptable this interface describes an object that can be used to show various update-related notifications to the user. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void checkforupdates(); void showupdateavailable(in nsiupdate update); void showupdatedownloaded(in nsiupdate update, [optional] in boolean background); void showupdateerror(in nsiupdate update); void showupdatehistory(in nsidomwindow parent); void showupdateinstalled(); methods checkforupdates() presents a user interface that checks for and displays the available updates. void checkforupdates(); parameters none. ...
...updateavailable(in nsiupdate update); void showupdatedownloaded(in nsiupdate update, [optional] in boolean background); void showupdateerror(in nsiupdate update); void showupdatehistory(in nsidomwindow parent); void showupdateinstalled(); methods checkforupdates() presents a user interface that checks for and displays the available updates. void checkforupdates(); parameters none. showupdateavailable() shows a message advising the user that an update is available to be downloaded and installed. if the app.update.silent preference is true or the user interface is already displayed the call will be a no-op. void showupdateavailable( in nsiupdate update ); parameters update an nsiupdate describing the update that's available. ...
...void checkforupdates(); parameters none. showupdateavailable() shows a message advising the user that an update is available to be downloaded and installed. if the app.update.silent preference is true or the user interface is already displayed the call will be a no-op. void showupdateavailable( in nsiupdate update ); parameters update an nsiupdate describing the update that's available. showupdatedownloaded() shows a message advising the user that an update has been downloaded, and that the user should restart the application in order to install it. if background is true (for example the download was not user initiated) and the app.update.silent preference is true the call will be a no-op. ...
...And 12 more matches
UpdateListener
an updatelistener receives messages from an update check for a single add-on, though it is possible to pass the same updatelistener to as many calls to findupdates() as you like. for each individual update check, the following methods will be called on the listener: either oncompatibilityupdateavailable() or onnocompatibilityupdateavailable(), depending on whether compatibility information for the requested application version was seen. either onupdateavailable() or onnoupdateavailable(), depending on whether a newer version of the addon was found. onupdatefinished() to signal that the update check has completed. ...
...er oncompatibilityupdateavailable() or onnocompatibilityupdateavailable(), depending on whether compatibility information for the requested application version was seen. either onupdateavailable() or onnoupdateavailable(), depending on whether a newer version of the addon was found. onupdatefinished() to signal that the update check has completed. ...
...vailable(), depending on whether compatibility information for the requested application version was seen. either onupdateavailable() or onnoupdateavailable(), depending on whether a newer version of the addon was found. onupdatefinished() to signal that the update check has completed. ...
...And 9 more matches
nsIUpdatePatch
hashfunction astring the hash function to use when determining the integrity of the patch file. ...
... hashfunction astring the hash function to use when determining the integrity of the patch file. ...
... hashfunction astring the hash function to use when determining the integrity of the patch file. ...
...And 9 more matches
IDBCursor.update() - Web APIs
Web › API › IDBCursor › update
return value an idbrequest object on which subsequent events related to this operation are fired. ...
... return value an idbrequest object on which subsequent events related to this operation are fired. ...
... return value an idbrequest object on which subsequent events related to this operation are fired. ...
...And 9 more matches
nsIUpdateCheckListener
toolkit/mozapps/update/nsiupdateservice.idlscriptable an interface describing an object that listens to the progress of an update check operation. this object is notified as the check continues, finishes and if it has an error. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void oncheckcomplete(in nsixmlhttprequest request, [array, size_is(updatecount)] in nsiupdate updates, in unsigned long updatecount); void onerror(in nsixmlhttprequest request, in nsiupdate update); void onprogress(in nsixmlhttprequest request, in unsigned long position, in unsigned long totalsize); methods oncheckcomplete() called when the update check is completed. void oncheckcomplet...
..., [array, size_is(updatecount)] in nsiupdate updates, in unsigned long updatecount); void onerror(in nsixmlhttprequest request, in nsiupdate update); void onprogress(in nsixmlhttprequest request, in unsigned long position, in unsigned long totalsize); methods oncheckcomplete() called when the update check is completed. void oncheckcomplete( in nsixmlhttprequest request, [array, size_is(updatecount)] in nsiupdate updates, in unsigned long updatecount ); parameters request the nsixmlhttprequest object handling the update check. updates an array of nsiupdate objects describing the available updates. updatecount the number of updates in the updates array. onerror() called when an error occurs while loading the remote update service file. void onerror( in nsixmlhttprequest request, ...
...in nsiupdate updates, in unsigned long updatecount ); parameters request the nsixmlhttprequest object handling the update check. updates an array of nsiupdate objects describing the available updates. updatecount the number of updates in the updates array. onerror() called when an error occurs while loading the remote update service file. void onerror( in nsixmlhttprequest request, in nsiupdate update ); parameters request the nsixmlhttprequest object handling the update check. update an nsiupdate object containing details about the error in its statustext attribute. onprogress() called every time there is a progress notification loading the update service file. void onprogress( in nsixmlhttprequest request, in unsigned long position, in unsigned long totalsize ); parameters ...
...And 8 more matches
nsIUpdateChecker
toolkit/mozapps/update/nsiupdateservice.idlscriptable this interface describes an object that knows how to check for software updates. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void checkforupdates(in nsiupdatechecklistener listener, in boolean force); void stopchecking(in unsigned short duration); constants constant value description current_check 1 constant for the stopchecking() method indicating that only the current update check should be stopped. current_session 2 constant for the stopchecking() method indicating that all update checks during the current session should be stopped. any_checks 3 constant for the stopchecking() method indica...
...gned short duration); constants constant value description current_check 1 constant for the stopchecking() method indicating that only the current update check should be stopped. current_session 2 constant for the stopchecking() method indicating that all update checks during the current session should be stopped. any_checks 3 constant for the stopchecking() method indicating that all update checking should be stopped. this disables the update checking preferences. methods checkforupdates() checks for available updates, notifying a listener of the results. ...
...rrent_session 2 constant for the stopchecking() method indicating that all update checks during the current session should be stopped. any_checks 3 constant for the stopchecking() method indicating that all update checking should be stopped. this disables the update checking preferences. methods checkforupdates() checks for available updates, notifying a listener of the results. void checkforupdates( in nsiupdatechecklistener listener, in boolean force ); parameters listener an object implementing nsiupdatechecklistener to be notified of the results of an update check. force if true, the update checker checks for updates, regardless of the current value of the user's update settings. ...
...And 8 more matches
UpdateInfo
each item in the array contains "id", "minversion", and "maxversion" properties. ...
...each item in the array contains "id", "minversion", and "maxversion" properties. ...
...each item in the array contains "id", "minversion", and "maxversion" properties. ...
...And 7 more matches
nsIUpdateTimerManager
toolkit/mozapps/update/nsiupdatetimermanager.idlscriptable this interface provides a global application service that provides support for long-duration timers (on the order of many days, weeks, or even months). these timers are used to schedule update checks in the future, for example. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void registertimer(in astring id, in nsitimercallback callback, in unsigned long interval); methods registertimer() presents a user interface that checks for and displays the available updates. void registertimer( in astring id, in nsitimercallback callback, in unsigned long interval ); parameters id...
... callback an nsitimercallback object that is notified when the interval expires. interval the length of time, in seconds, until the timer should fire. remarks note that the timer is not precise, and that the default minimum interval is 2 minutes. ...
... seconds, until the timer should fire. remarks note that the timer is not precise, and that the default minimum interval is 2 minutes. in order to avoid having to instantiate a component to call the registertimer() method, the component can instead register an update-timer category with comma-separated values as a single string representing the timer, like this: _xpcom_categories: [{ category: "update-timer", value: "contractid," + "method," + "id," + "preference," + "interval" }], this allows you to schedule the timer without actually having to instantiate the component; instead, the component is instantiated when the timer is triggered. the values ar...
...And 7 more matches
PaymentDetailsUpdate - Web APIs
displayitems optional an array of paymentitem objects, each describing one line item for the payment request. ...
... displayitems optional an array of paymentitem objects, each describing one line item for the payment request. ...
... displayitems optional an array of paymentitem objects, each describing one line item for the payment request. ...
...And 7 more matches
nsIUpdateManager
toolkit/mozapps/update/nsiupdateservice.idlscriptable this interface describes a global application service that maintains a list of previously installed updates, as well as the currently in use update. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview nsiupdate getupdateat(in long index); void saveupdates(); attributes attribute type description activeupdate nsiupdate an nsiupdate object describing the currently in use update. this update is not in the history list. read only. updatecount long the number of updates in the history list; the updates can be fetched by calling getupdateat(). read only. ...
... method overview nsiupdate getupdateat(in long index); void saveupdates(); attributes attribute type description activeupdate nsiupdate an nsiupdate object describing the currently in use update. this update is not in the history list. read only. updatecount long the number of updates in the history list; the updates can be fetched by calling getupdateat(). read only. methods getupdateat() returns the update at the specified index into the history list. nsiupdate getupdateat( in long index ); parameters index an index into the history list for the nsiupdate to retrieve. return value the nsiupdate at the specified index into the history list. saveupdates() saves all updates to disk. void saveupdates(); parameters none. ...
...dateat(). read only. methods getupdateat() returns the update at the specified index into the history list. nsiupdate getupdateat( in long index ); parameters index an index into the history list for the nsiupdate to retrieve. return value the nsiupdate at the specified index into the history list. saveupdates() saves all updates to disk. void saveupdates(); parameters none. ...
...And 6 more matches
nsIUpdateItem
.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) this interface is obsolete; instead of using the extension manager, you should use the addon manager. method overview void init(in astring id, in astring version, in astring installlocationkey, in astring minappversion, in astring maxappversion, in astring name, in astring downloadurl, in astring xpihash, in astring iconurl, in astring updateurl, in astring updatekey, in long type, in astring targetappid); attributes attribute type description iconurl astring the url of the icon that can be shown for this item. read only. id astring the guid of the item. read only. installlocationkey astring the name of the install location where this item is installed. read only. ...
... maxappversion astring the maximum version of the application that this item works with, in fvf format. read only. minappversion astring the minimum version of the application that this item works with, in fvf format. read only. name astring the name of this item. read only. ...
...read only. version astring the version of the item, in fvf format. read only. ...
...And 4 more matches
AnimationEffect.updateTiming() - Web APIs
working draft editor's draft. ...
... working draft editor's draft. ...
... working draft editor's draft. ...
...And 2 more matches
PaymentRequestUpdateEvent - Web APIs
properties provides only the properties inherited from its parent interface, event. ...
...equest. those events are: shippingaddresschange secure context dispatched whenever the user changes their shipping address. also available using the onshippingaddresschange event handler property. shippingoptionchange secure context dispatched whenever the user changes a shipping option. also available using the onshippingoptionchange event handler property. ...
...context dispatched whenever the user changes their shipping address. also available using the onshippingaddresschange event handler property. shippingoptionchange secure context dispatched whenever the user changes a shipping option. also available using the onshippingoptionchange event handler property. constructor paymentrequestupdateevent() secure context creates a new paymentrequestupdateevent object. ...
...And 2 more matches
XRSession.updateRenderState() - Web APIs
the specified object may have any combination of the following fields. baselayer optional an xrwebgllayer object from which the webxr compositor will obtain imagery. this is null by default. ...
... the specified object may have any combination of the following fields. baselayer optional an xrwebgllayer object from which the webxr compositor will obtain imagery. this is null by default. ...
... the specified object may have any combination of the following fields. baselayer optional an xrwebgllayer object from which the webxr compositor will obtain imagery. this is null by default. ...
...And 2 more matches
Animation.updatePlaybackRate() - Web APIs
the updateplaybackrate() method of the web animations api's animation interface sets the speed of an animation after first synchronizing its playback position. in some cases, an animation may run on a separate thread or process and will continue updating even while long-running javascript delays the main thread. in such a case, setting the playbackrate on the animation directly may cause the animation's playback position to jump since its playback position on the main thread may have drifted from the playback position where it is currently running. updateplaybackrate() is an asynchronous method that sets the speed of an animation after synchronizing with its current playback position, ensuring that the resulting change in speed does not produce a sharp jump. ...
... cause the animation's playback position to jump since its playback position on the main thread may have drifted from the playback position where it is currently running. updateplaybackrate() is an asynchronous method that sets the speed of an animation after synchronizing with its current playback position, ensuring that the resulting change in speed does not produce a sharp jump. after calling updateplaybackrate() the animation's playbackrate is not immediately updated. it will be updated once the animation's ready promise is resolved. syntax animation.updateplaybackrate(2); parameters playbackrate the new speed to set. this may be a positive number (to speed up or slow down the animation), a negative number (to make it play backwards), or zero (to effectively pause the animation). ...
...animation's ready promise is resolved. syntax animation.updateplaybackrate(2); parameters playbackrate the new speed to set. this may be a positive number (to speed up or slow down the animation), a negative number (to make it play backwards), or zero (to effectively pause the animation). return value none. ...
...krate the new speed to set. this may be a positive number (to speed up or slow down the animation), a negative number (to make it play backwards), or zero (to effectively pause the animation). return value none. examples a speed selector component would benefit from smooth updating of updateplaybackrate(), as demonstrated below: speedselector.addeventlistener('input', evt => { cartoon.updateplaybackrate(parsefloat(evt.target.value)); cartoon.ready.then(() => { console.log(`playback rate set to ${cartoon.playbackrate}`); }); }); specifications specification status comment web animationsthe definition of 'updateplaybackrate()' in that specification. working draft ...
HTMLMediaElement: timeupdate event - Web APIs
the timeupdate event is fired when the time indicated by the currenttime attribute has been updated. the event frequency is dependant on the system load, but will be thrown between about 4hz and 66hz (assuming the event handlers don't take longer than 250ms to run). user agents are encouraged to vary the frequency of the event based on the system load and the average cost of processing the event each time, so that the ui updates are not any more frequent than the user agent can comfortably handle while decoding the video. ...
...nt based on the system load and the average cost of processing the event each time, so that the ui updates are not any more frequent than the user agent can comfortably handle while decoding the video. bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.ontimeupdate specification html5 media examples these examples add an event listener for the htmlmediaelement's timeupdate event, then post a message when that event handler has reacted to the event firing. remember, the event frequency is dependant on the system load. ...
...dlers.ontimeupdate specification html5 media examples these examples add an event listener for the htmlmediaelement's timeupdate event, then post a message when that event handler has reacted to the event firing. remember, the event frequency is dependant on the system load. using addeventlistener(): const video = document.queryselector('video'); video.addeventlistener('timeupdate', (event) => { console.log('the currenttime attribute has been updated. again.'); }); using the ontimeupdate event handler property: const video = document.queryselector('video'); video.ontimeupdate = (event) => { console.log('the currenttime attribute has been updated. again.'); }; specifications specification status html living standardthe definition of 'timeup...
...he ontimeupdate event handler property: const video = document.queryselector('video'); video.ontimeupdate = (event) => { console.log('the currenttime attribute has been updated. again.'); }; specifications specification status html living standardthe definition of 'timeupdate media event' in that specification. living standard html5the definition of 'timeupdate media event' in that specification. recommendation ...
ServiceWorkerRegistration.update() - Web APIs
the update() method of the serviceworkerregistration interface attempts to update the service worker. it fetches the worker's script url, and if the new worker is not byte-by-byte identical to the current worker, it installs the new worker. the fetch of the worker bypasses any browser caches if the previous fetch occurred over 24 hours ago. note: this feature is available in web workers. syntax serviceworkerregistration.update(); parameters none. return value a promise that resolves with a serviceworkerregistration object. ...
... any browser caches if the previous fetch occurred over 24 hours ago. note: this feature is available in web workers. syntax serviceworkerregistration.update(); parameters none. return value a promise that resolves with a serviceworkerregistration object. ...
... working draft initial definition. ...
... working draft initial definition. ...
FC_DecryptDigestUpdate
name fc_decryptdigestupdate - continue a multi-part decrypt and digest operation syntax ck_rv fc_decryptdigestupdate( ck_session_handle hsession, ck_byte_ptr pencryptedpart, ck_ulong ulencryptedpartlen, ck_byte_ptr ppart, ck_ulong_ptr pulpartlen ); parameters hsession [in] session handle. pencryptedpart [in] pointer to the encrypted data part. ulencryptedpartlen [in] length of encrypted data in bytes. ppart [in] pointer to the location which receives the recovered data part or null. pulpartlen [in] pointer to the length of the recovered part buffer. description fc_decryptdigestupdate continues a multi-part decrypt and digest operation. after calling both fc_decryptinit and fc_digestinit to set up the operations this function may be called multiple times. the operat...
...ecovered part buffer. description fc_decryptdigestupdate continues a multi-part decrypt and digest operation. after calling both fc_decryptinit and fc_digestinit to set up the operations this function may be called multiple times. the operation is finished by calls to fc_digestfinal and fc_decryptfinal. a user must log into the token (to assume the nss user role) before calling fc_decryptdigestupdate. ...
...inues a multi-part decrypt and digest operation. ...
FC_DecryptUpdate
name fc_decryptupdate - decrypt a block of a multi-part encryption operation. syntax ck_rv fc_decryptupdate( ck_session_handle hsession, ck_byte_ptr pencryptedpart, ck_ulong usencryptedpartlen, ck_byte_ptr ppart, ck_ulong_ptr puspartlen ); parameters hsession [in] session handle. pencryptedpart [in] pointer to the next block of data to be decrypted. usencryptedpartlen [in] length of data block in bytes. 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. description fc_decryptupdate decrypts a block of data according to the attributes of the previous call to fc_decryptinit. the block may be part of a multi-part decryption operation. a user must l...
...red block is to be stored. puspartlen [in,out] pointer the location where the number of bytes of recovered data is to be stored. description fc_decryptupdate decrypts a block of data according to the attributes of the previous call to fc_decryptinit. the block may be part of a multi-part decryption operation. ...
...the number of bytes of recovered data is to be stored. description fc_decryptupdate decrypts a block of data according to the attributes of the previous call to fc_decryptinit. the block may be part of a multi-part decryption operation. a user must log into the token (to assume the nss user role) before calling fc_decryptupdate. ...
FC_DecryptVerifyUpdate
name fc_decryptverifyupdate - continue a multi-part decrypt and verify operation syntax ck_rv fc_decryptverifyupdate( ck_session_handle hsession, ck_byte_ptr pencrypteddata, ck_ulong ulencrypteddatalen, ck_byte_ptr pdata, ck_ulong_ptr puldatalen ); parameters hsession [in] session handle. pencrypteddata [in] pointer to the encrypted data part. ulencrypteddatalen [in] length of encrypted data in bytes. pdata [in] pointer to the location which receives the recovered data part or null. puldatalen [in] pointer to the length of the recovered part buffer. description fc_decryptverifyupdate continues a multi-part decryption and and signature verification operation. after calling both fc_decryptinit and fc_verifyinit to set up the operations this function may be called mul...
... description fc_decryptverifyupdate continues a multi-part decryption and and signature verification operation. after calling both fc_decryptinit and fc_verifyinit to set up the operations this function may be called multiple times. the operation is finished by calls to fc_decryptfinal and fc_verifyfinal. a user must log into the token (to assume the nss user role) before calling fc_decryptverifyupdate. ...
...yption and and signature verification operation. ...
FC_DigestEncryptUpdate
name fc_digestencryptupdate - continue a multi-part digest and encryption operation syntax ck_rv fc_digestencryptupdate( ck_session_handle hsession, ck_byte_ptr ppart, ck_ulong ulpartlen, ck_byte_ptr pencryptedpart, ck_ulong_ptr pulencryptedpartlen ); parameters hsession [in] session handle. ppart [in] pointer to the data part. ulpartlen [in] length of data in bytes. pencryptedpart [in] pointer to the location which receives the digested and encrypted part or null. pulencryptedpartlen [in] pointer to the length of the encrypted part buffer. description fc_digestencryptupdate continues a multi-part digest and encryption operation. after calling both fc_digestinit and fc_encryptinit to set up the operations this function may be called multiple times. the operation is...
...fer. description fc_digestencryptupdate continues a multi-part digest and encryption operation. after calling both fc_digestinit and fc_encryptinit to set up the operations this function may be called multiple times. the operation is finished by calls to fc_digestfinal and fc_encryptfinal in that order. a user must log into the token (to assume the nss user role) before calling fc_digestencryptupdate. ...
...t digest and encryption operation. ...
FC_EncryptUpdate
name fc_encryptupdate - encrypt a block of a multi-part encryption operation. syntax ck_rv fc_encryptupdate( ck_session_handle hsession, ck_byte_ptr ppart, ck_ulong uspartlen, ck_byte_ptr pencryptedpart, ck_ulong_ptr pusencryptedpartlen ); parameters hsession [in] session handle. ppart [in] pointer to the next block of data to be encrypted. uspartlen [in] length of data block in bytes. 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. description fc_encryptupdate encrypts a block of data according to the attributes of the previous call to fc_encryptinit. the block may be part of a multi-part encryption operation. a user must lo...
...ck is to be stored. pusencryptedpartalen [out] pointer the location where the number of bytes of encrypted data is to be stored. description fc_encryptupdate encrypts a block of data according to the attributes of the previous call to fc_encryptinit. the block may be part of a multi-part encryption operation. ...
...the number of bytes of encrypted data is to be stored. description fc_encryptupdate encrypts a block of data according to the attributes of the previous call to fc_encryptinit. the block may be part of a multi-part encryption operation. a user must log into the token (to assume the nss user role) before calling fc_encryptupdate. ...
FC_SignEncryptUpdate
name fc_signencryptupdate - continue a multi-part signing and encryption operation syntax ck_rv fc_signencryptupdate( ck_session_handle hsession, ck_byte_ptr ppart, ck_ulong ulpartlen, ck_byte_ptr pencryptedpart, ck_ulong_ptr pulencryptedpartlen ); parameters hsession [in] session handle. ppart [in] pointer to the data part. ulpartlen [in] length of data in bytes. pencryptedpart [in] pointer to the location which receives the signed and encrypted data part or null. pulencryptedpartlen [in] pointer to the length of the encrypted part buffer. description fc_signencryptupdate continues a multi-part signature and encryption operation. after calling both fc_signinit and fc_encryptinit to set up the operations this function may be called multiple times. the operation is ...
... encrypted part buffer. description fc_signencryptupdate continues a multi-part signature and encryption operation. after calling both fc_signinit and fc_encryptinit to set up the operations this function may be called multiple times. the operation is finished by calls to fc_signfinal and fc_encryptfinal. a user must log into the token (to assume the nss user role) before calling fc_signencryptupdate. ...
...ntinues a multi-part signature and encryption operation. ...
Element: compositionupdate event - Web APIs
the compositionupdate event is fired when a new character is received in the context of a text composition session controlled by a text composition system such as an input method editor. for example, this event could be fired while a user enters a chinese character using a pinyin ime. ...
...on system such as an input method editor. for example, this event could be fired while a user enters a chinese character using a pinyin ime. ...
...nst log = document.queryselector('.event-log-contents'); const clearlog = document.queryselector('.clear-log'); clearlog.addeventlistener('click', () => { log.textcontent = ''; }); function handleevent(event) { log.textcontent = log.textcontent + `${event.type}: ${event.data}\n`; } inputelement.addeventlistener('compositionstart', handleevent); inputelement.addeventlistener('compositionupdate', handleevent); inputelement.addeventlistener('compositionend', handleevent); result specifications specification status ui events working draft ...
startSoftwareUpdate - Web APIs
this method has been largely superseded by newer install method, which is more flexible and allows you to install more than one xpi. ...
...this method has been largely superseded by newer install method, which is more flexible and allows you to install more than one xpi. ...
...this method has been largely superseded by newer install method, which is more flexible and allows you to install more than one xpi. ...
ServiceWorkerRegistration.onupdatefound - Web APIs
working draft initial definition. ...
... working draft initial definition. ...
...ever an event of type statechange is fired; it is fired any time the serviceworkerregistration.installing property acquires a new service worker. note: this feature is available in web workers. syntax serviceworkerregistration.onupdatefound = function() { ... }; specifications specification status comment service workersthe definition of 'serviceworkerregistration.onupdatefound' in that specification. working draft initial definition. ...
updateready - Archive of obsolete content
read only. cancelable boolean is it possible to cancel the event? ...
... property type description target eventtarget (dom element) the event target (the topmost target in the dom tree). read only. type string the type of event. read only. canbubble boolean does the event normally bubble? read only. cancelable boolean is it possible to cancel the event? read only. related events checking noupdate downloading progress cached updateready obsolete error ...
Debugging update problems
checking update requests if you're debugging the application update feature in firefox or other mozilla applications, you may need to see what requests are occurring. you can do this using the live http headers addon to determine the url of the update request. that url might look something like: https://aus3.mozilla.org/update/3/firefox/12.0a1/20120106040225/darwin_x86_64-gcc3-u-i386-x86_64-shark/nightly-profiling/darwin%2010.8.0/default/default/update.xml?force=1 you can then request this url manually to see what's inside. useful preferences enabling the following preferences in about:config can help troubleshoot problems with updates: app.update.log - for application updates; extensions.logging.enabled - for add-on updates. ...
...i386-x86_64-shark/nightly-profiling/darwin%2010.8.0/default/default/update.xml?force=1 you can then request this url manually to see what's inside. useful preferences enabling the following preferences in about:config can help troubleshoot problems with updates: app.update.log - for application updates; extensions.logging.enabled - for add-on updates. related resources extension versioning, update and compatibility. ...
FC_DigestUpdate
name fc_digestupdate - process the next block of a multi-part digest operation. syntax ck_rv fc_digestupdate( ck_session_handle hsession, ck_byte_ptr ppart, ck_ulong uspartlen ); parameters hsession [in] session handle. ppart [in] pointer to the next block of data to be digested. uspartlen [in] length of data block in bytes. description fc_digestupdate starts or continues a multi-part digest operation. one or more blocks may be part of the message digest operation. the digest for the entire message is returned by a call to fc_digestfinal. a user may call fc_digestupdate without logging into the token (to assume the nss user role). ...
...tes. description fc_digestupdate starts or continues a multi-part digest operation. one or more blocks may be part of the message digest operation. the digest for the entire message is returned by a call to fc_digestfinal. a user may call fc_digestupdate without logging into the token (to assume the nss user role). ...
FC_SignUpdate
name fc_signupdate - process the next block of a multi-part signing operation. syntax ck_rv fc_signupdate( ck_session_handle hsession, ck_byte_ptr ppart, ck_ulong uspartlen ); parameters hsession [in] session handle. ppart [in] pointer to the next block of the data to be signed. uspartlen [in] length of data block in bytes. description fc_signupdate starts or continues a multi-part signature operation. one or more blocks may be part of the signature. the signature for the entire message is returned by a call to fc_signfinal. a user must log into the token (to assume the nss user role) before calling fc_signupdate. ...
...th of data block in bytes. description fc_signupdate starts or continues a multi-part signature operation. one or more blocks may be part of the signature. the signature for the entire message is returned by a call to fc_signfinal. a user must log into the token (to assume the nss user role) before calling fc_signupdate. ...
FC_VerifyUpdate
name fc_verifyupdate - process the next block of a multi-part verify operation. syntax ck_rv fc_verifyupdate( ck_session_handle hsession, ck_byte_ptr ppart, ck_ulong uspartlen ); parameters hsession [in] session handle. ppart [in] pointer to the next block of the data to be verified. uspartlen [in] length of data block in bytes. description fc_verifyupdate starts or continues a multi-part signature verification operation where the signature is an appendix to the data. one or more blocks may be part of the signature. the result for the entire message is returned by a call to fc_verifyfinal. a user must log into the token (to assume the nss user role) before calling fc_verifyupdate. ...
...ate starts or continues a multi-part signature verification operation where the signature is an appendix to the data. one or more blocks may be part of the signature. the result for the entire message is returned by a call to fc_verifyfinal. a user must log into the token (to assume the nss user role) before calling fc_verifyupdate. return value examples see also fc_verifyfinal, nsc_verifyupdate ...
JS_updateMallocCounter
this article covers features introduced in spidermonkey 17 decrement malloc counter. syntax void js_updatemalloccounter(jscontext *cx, size_t nbytes); name type description cx jscontext * pointer to a js context to decrement the malloc counter. nbytes size_t number of bytes to decrement from malloc counter. description js_updatemalloccounter decrements malloc counter of gc and the zone of the context. malloc counter measures memory pressure for gc scheduling. it runs from maxmallocbytes down to zero. ...
... description js_updatemalloccounter decrements malloc counter of gc and the zone of the context. malloc counter measures memory pressure for gc scheduling. it runs from maxmallocbytes down to zero. maxmallocbytes is initialized with maxbytes parameter of js_newruntime, and could be configured later by calling js_getgcparameter with jsgc_max_malloc_bytes. ...
nsIMsgDBViewCommandUpdater
the nsimsgdbviewcommandupdater interface controls changes that occur as the selection changes. mailnews/base/public/nsimsgdbview.idl#349scriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports in thunderbird this is implemented for different windows in several different places: nsmsgdbviewcommandupdater (for the standalone message window) nsmsgdbviewcommandupdater (for the threadpane message window) nsmsgsearchcommandupdater (for search dialogs) method overview void updatecommandstatus(); void displaymessagechanged(in nsimsgfolder afolder, in astring asubject, in acstring akeywords); void updatenextmessageafterdelete(); methods updatecommandstatus() called when the number of selected items changes. void up...
...changes. void updatecommandstatus(); parameters none. displaymessagechanged() called when the displayed message has changed. void displaymessagechanged(in nsimsgfolder afolder, in astring asubject, in acstring akeywords ); parameters afolder the folder containing selected message. asubject the subject of the selected message. akeywords keywords associated with the selected message. updatenextmessageafterdelete() allows the backend to tell the front end to re-determine which message we should select after a delete or move void updatenextmessageafterdelete(); parameters none. ...
MSCandidateWindowUpdate - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. mscandidatewindowupdate fires after the input method editor (ime) candidate window has been identified as needing to change size, but before any visual updates have rendered. this proprietary method is specific to internet explorer. general info synchronous no bubbles no cancelable no note windows 8.1 and windows 7 imes for certain languages on internet explorer for the desktop might not support this event. on internet explorer in the new windows ui, this event is supported in windows 8.1...
...ry method is specific to internet explorer. general info synchronous no bubbles no cancelable no note windows 8.1 and windows 7 imes for certain languages on internet explorer for the desktop might not support this event. on internet explorer in the new windows ui, this event is supported in windows 8.1 imes of all languages. syntax event property object.oncandidatewindowupdate = handler; addeventlistener method object.addeventlistener("mscandidatewindowupdate", handler, usecapture) parameters pevtobj [in] type: ihtmleventobj pointer to an ihtmleventobj interface for the current event. tan ime candidate window may be identified as needing to change size for any of the following reasons: as a result of displaying new / changed alternatives or p...
PaymentDetailsUpdate.error - Web APIs
the paymentdetailsupdate dictionary's error property is a human-readable domstring which provides an error message to be displayed if the specified information doesn't offer any valid shipping options. syntax errorstring = paymentdetailsupdate.error; paymentdetailsupdate.error = errorstring; value a domstring specifying the string to display to the user if the information specified in the paymentdetailsupdate doesn't provide any valid shipping options. this happens if both of the following are true: the paymentrequest specifies using its requestshipping property that shipping information is required. the paymentdetailsupdate object specifies no valid shipping options in its shippingoptions list. this message can be used to explain to the user why they cannot submit their payment a...
...list. this message can be used to explain to the user why they cannot submit their payment as currently specified—whether that's because the selected products cannot be shipped to their region or because their address is not served by any of the shipping companies you use. specifications specification status comment payment request apithe definition of 'paymentdetailsupdate.error' in that specification. candidate recommendation initial definition. ...
PaymentDetailsUpdate.shippingAddressErrors - Web APIs
for each property in paymentaddress, a property by the same name is found in shippingaddresserrors if and only if a validation error occurred for that property. in that case, the property in shippingaddresserrors is a string describing the validation error, ideally including suggestions about fixing the error. ...
... candidate recommendation initial definition. ...
Window.updateCommands() - Web APIs
whether we are in bold right now). notes this enables or disables items (setting or clearing the "disabled" attribute on the command node as appropriate), or ensures that the command state reflects the state of the selection by setting current state information in the "state" attribute of the xul command nodes. specification dom level 0. not part of specification. browser compatibility the compatibility table in this page is generated from structured data. ...
...of specification. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
update - CSS: Cascading Style Sheets
example: documents printed on paper. slow the layout may change dynamically according to the usual rules of css, but the output device is not able to render or display changes quickly enough for them to be perceived as a smooth animation. examples: e-book readers or severely underpowered devices. ...
...ng to the usual rules of css, and the output device is not unusually constrained in speed, so regularly-updating things like css animations can be used. example: computer screens. examples html <p>if this text animates for you, you are using a fast-updating device.</p> css @keyframes jiggle { from { transform: translatey(0); } to { transform: translatey(25px); } } @media (update: fast) { p { animation: 1s jiggle linear alternate infinite; } } result specifications specification status comment media queries level 4the definition of 'update' in that specification. candidate recommendation initial definition. ...
noupdate - Archive of obsolete content
the noupdate event is fired after checking for an application cache update, if the manifest hasn't changed. general info specification offline interface event bubbles no cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree). read only. type string the type of event. read only. canbubble boolean does the event normally bubble? read only. cancelable boolean is it possible to cancel the event? read only. related events checking noupdate downloading progress cached updateready obsolete error ...
InstallTrigger.startSoftwareUpdate - Archive of obsolete content
function triggerurl(url) { installtrigger.startsoftwareupdtate(url); } // get the url to the .xpi from either a form // or text field entry. then do: ... ...
commandupdater - Archive of obsolete content
« xul reference home commandupdater type: boolean if true, the commandset is used for updating commands. typically, this is used to update menu commands such as undo and cut based on when an event occurs. for example, since the cut command is only valid when something is selected, a command updater might be used when the select event occurs. ...
oncommandupdate - Archive of obsolete content
« xul reference home oncommandupdate type: script code this event occurs when a command update occurs. you would use this to update the disabled status of items. ...
commandupdate - Archive of obsolete content
general info specification xul interface event bubbles no cancelable no target element default action none. properties property type description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. ...
Debug.msUpdateAsyncCallbackRelation - Archive of obsolete content
relationtype optional the value that specifies the relationship status. remarks the synchronous work item is typically the callback function for the asynchronous operation. this function may be called when an asynchronous operation is aborted, when a join operation is used, or in other scenarios. ...
Getting documentation updated
this backup is maintained by andrew sachen of realityripple software. it may see periodical improvements or updates, and may eventually even be cleaned up (and de-archived) for better uxp focus, but for now, it's a historical snapshot for reference, not a living website. ...
UpdateCheckListener
updatechecklisteners are passed the results of update checks performed by the addonupdatechecker. method overview void onupdatecheckcomplete(in updateinfo results[]) void onupdatecheckerror(in integer status) methods onupdatecheckcomplete() called when the update check completed successfully. void onupdatecheckcomplete( in updateinfo results[] ) parameters results an array of updateinfo objects representing the available add-on versions onupdatecheckerror() called when the update check fails. void onupdatecheckerror( in integer status ) parameters status a value representing the type of failure; see the range of possible values. ...
Updates
march 22, 2011 firefox 4.0 has been released! this new version comes with several bug fixes and new features for mathml. some improvements are particularly worth noting: a new html parser, which lets you use mathml inside non-xhtml documents. complete support for stix fonts 1.0. better rendering of mathematical symbols, especially stretchy operators. october 21, 2010 mathml 3.0 is now a w3c recommendation! june 11, 2010 stix fonts version 1.0 are now compatible with trunk. may 28, 2010 stix fonts version 1.0 released. ...
nsIAccelerometerUpdate
xpcom/system/nsiaccelerometer.idlnot scriptable replaced by nsidevicemotionupdate 1.0 66 introduced gecko 2.0 obsolete gecko 6.0 inherits from: nsiaccelerometer last changed in gecko 5.0 (firefox 5.0 / thunderbird 5.0 / seamonkey 2.2) this method is only used in content tabs to receive nsiacceleration data from the chrome process. method overview void accelerationchanged(in double x, in double y, in double z); methods accelerationchanged() void accelerationchanged( in double x, in double y, in double z ); parameters x y z the coordinates of the nsiacceleration data. ...
nsIGeolocationUpdate
idlscriptable provides a way for a geolocation provider to notify the system that a new location is available. 1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) interface provides a way for a geolocation provider to notify the system that a new location is available. method overview void update(in nsidomgeoposition position); methods update() notify the geolocation service that a new geolocation has been discovered. note: this must be called on the main thread. void update( in nsidomgeoposition position ); parameters position a nsidomgeoposition object describing the updated position information. see also using geolocation nsigeolocationprovider w3c geolocation specification ...
update() - Web APIs
the mediakeysession.update() method loads messages and licenses to the cdm, and then returns a promise . syntax mediakeysession.update(response).then(function() { ... }); parameters response an instance of type buffersource. return value a promise. specifications specification status comment encrypted media extensionsthe definition of 'update()' in that specification. recommendation initial definition ...
Index - Web APIs
Web › API › Index
rty, reference, web animations, timeline, web animations api the animation.timeline property of the animation interface returns or sets the timeline associated with this animation. a timeline is a source of time values for synchronization purposes, and is an animationtimeline-based object. by default, the animation's timeline and the document's timeline are the same. 81 animation.updateplaybackrate() api, animation, experimental, interface, method, reference, web animations, playbackrate, updateplaybackrate, waapi, web animations api the updateplaybackrate() method of the web animations api's animation interface sets the speed of an animation after first synchronizing its playback position. 82 animationeffect api, animation, experimental, interface, refe...
...face returns the calculated timing properties for this animation effect. 84 animationeffect.gettiming() api, animation, experimental, method, reference, timing, waapi, web animations api the animationeffect.gettiming() method of the animationeffect interface returns an effecttiming object containing the timing properties for the animation effect. 85 animationeffect.updatetiming() api, animation, experimental, method, reference, web animations, waapi, web animations api the updatetiming() method of the animationeffect interface updates the specified timing properties for an animation effect. 86 animationevent api, experimental, interface, reference, web animations the animationevent interface represents events providing information re...
...y api, needsmarkupwork, property, reference, référence(2) indicates the current battery charge level as a value between 0.0 and 1.0. 269 batterymanager.onchargingchange api, battery api, event handler, needsmarkupwork, property, reference, référence(2) specifies an event listener to receive chargingchange events. these events occur when the battery charging state is updated. 270 batterymanager.onchargingtimechange api, battery api, event handler, needsmarkupwork, property, reference, référence(2) specifies an event listener to receive chargingtimechange events. these events occur when the battery chargingtime is updated. 271 batterymanager.ondischargingtimechange api, battery api, event handler, needsmarkupwork, property, refer...
...And 84 more matches
Index - Archive of obsolete content
e. 52 passwords add-on sdk interact with firefox's password manager to add, retrieve and remove stored credentials. 53 private-browsing add-on sdk check whether a given object is private, so an add-on can respect private browsing 54 querystring add-on sdk utility functions for working with query strings. 55 request needsupdate, sdk, add-on make simple network requests. 56 selection add-on sdk get and set text and html selections in the current web page. 57 self add-on sdk access data that is bundled with the add-on, and add-on metadata. 58 simple-prefs add-on sdk store preferences across application restarts. 59 simple-storage add-on sd...
...the code snippets on this page will let your site work until these new features are more widely available. 190 isdefaultnamespace no summary! 191 js xpcom code snippets, javascript, xpcom, about:...
...lt settings by allowing default preferences. 228 deploying a plugin as an extension add-ons, plugins one of the new features available in firefox 1.5 is the ability to place browser plugins in a firefox extension. this feature is particularly useful for vendors who wish to deploy the plugin even if firefox is not currently installed, or who want to use the automatic extension update mechanism to update their plugin to a newer version. 229 developing add-ons add-ons this page will help guide you to the information you need in order to create add-ons for firefox, thunderbird, or other software based on the mozilla platform, as well as how to distribute your add-ons. 230 displaying web content in an extension without security issues extension...
...And 60 more matches
Linear-gradient Generator - CSS: Cascading Style Sheets
| this.isvalidrgbvalue(blue) === false) return; this.r = red | 0; this.g = green | 0; this.b = blue | 0; if (this.isvalidrgbvalue(alpha) === true) this.a = alpha | 0; }; color.prototype.setbyname = function setbyname(name, value) { if (name === 'r' || name === 'g' || name === 'b') { if(this.isvalidrgbvalue(value) === false) return; this[name] = value; this.updatehsx(); } }; color.prototype.sethsv = function sethsv(hue, saturation, value) { this.hue = hue; this.saturation = saturation; this.value = value; this.hsvtorgb(); }; color.prototype.sethsl = function sethsl(hue, saturation, lightness) { this.hue = hue; this.saturation = saturation; this.lightness = lightness; this.hsltorgb(); }; color.prototype.sethue = function sethue(va...
... this.value = value; this.hsvtorgb(); }; color.prototype.sethsl = function sethsl(hue, saturation, lightness) { this.hue = hue; this.saturation = saturation; this.lightness = lightness; this.hsltorgb(); }; color.prototype.sethue = function sethue(value) { if (typeof(value) !== 'number' || isnan(value) === true || value < 0 || value > 359) return; this.hue = value; this.updatergb(); }; color.prototype.setsaturation = function setsaturation(value) { if (typeof(value) !== 'number' || isnan(value) === true || value < 0 || value > 100) return; this.saturation = value; this.updatergb(); }; color.prototype.setvalue = function setvalue(value) { if (typeof(value) !== 'number' || isnan(value) === true || value < 0 || value > 100) return; this.value =...
... this.alpha = 1; this.rgbtohsv(); }; /*========== conversion methods ==========*/ color.prototype.converttohsl = function converttohsl() { if (this.format === 'hsl') return; this.setformat('hsl'); this.rgbtohsl(); }; color.prototype.converttohsv = function converttohsv() { if (this.format === 'hsv') return; this.setformat('hsv'); this.rgbtohsv(); }; /*========== update methods ==========*/ color.prototype.updatergb = function updatergb() { if (this.format === 'hsv') { this.hsvtorgb(); return; } if (this.format === 'hsl') { this.hsltorgb(); return; } }; color.prototype.updatehsx = function updatehsx() { if (this.format === 'hsv') { this.rgbtohsv(); return; } if (this.format === 'hsl') { this.rgbtohsl(); return; } }...
...And 46 more matches
Color picker tool - CSS: Cascading Style Sheets
| this.isvalidrgbvalue(blue) === false) return; this.r = red | 0; this.g = green | 0; this.b = blue | 0; if (this.isvalidrgbvalue(alpha) === true) this.a = alpha | 0; }; color.prototype.setbyname = function setbyname(name, value) { if (name === 'r' || name === 'g' || name === 'b') { if(this.isvalidrgbvalue(value) === false) return; this[name] = value; this.updatehsx(); } }; color.prototype.sethsv = function sethsv(hue, saturation, value) { this.hue = hue; this.saturation = saturation; this.value = value; this.hsvtorgb(); }; color.prototype.sethsl = function sethsl(hue, saturation, lightness) { this.hue = hue; this.saturation = saturation; this.lightness = lightness; this.hsltorgb(); }; color.prototype.sethue = function sethue(va...
... this.value = value; this.hsvtorgb(); }; color.prototype.sethsl = function sethsl(hue, saturation, lightness) { this.hue = hue; this.saturation = saturation; this.lightness = lightness; this.hsltorgb(); }; color.prototype.sethue = function sethue(value) { if (typeof(value) !== 'number' || isnan(value) === true || value < 0 || value > 359) return; this.hue = value; this.updatergb(); }; color.prototype.setsaturation = function setsaturation(value) { if (typeof(value) !== 'number' || isnan(value) === true || value < 0 || value > 100) return; this.saturation = value; this.updatergb(); }; color.prototype.setvalue = function setvalue(value) { if (typeof(value) !== 'number' || isnan(value) === true || value < 0 || value > 100) return; this.value =...
... this.alpha = 1; this.rgbtohsv(); }; /*========== conversion methods ==========*/ color.prototype.converttohsl = function converttohsl() { if (this.format === 'hsl') return; this.setformat('hsl'); this.rgbtohsl(); }; color.prototype.converttohsv = function converttohsv() { if (this.format === 'hsv') return; this.setformat('hsv'); this.rgbtohsv(); }; /*========== update methods ==========*/ color.prototype.updatergb = function updatergb() { if (this.format === 'hsv') { this.hsvtorgb(); return; } if (this.format === 'hsl') { this.hsltorgb(); return; } }; color.prototype.updatehsx = function updatehsx() { if (this.format === 'hsv') { this.rgbtohsv(); return; } if (this.format === 'hsl') { this.rgbtohsl(); return; } }...
...And 38 more matches
Box-shadow generator - CSS: Cascading Style Sheets
.max = max > 0 ? max : 100; this.step = step === 0 ? 1 : step; this.value = value <= max && value >= min ? value : (min + max) / 2 | 0; this.snap = snap === "true" ? ...
...= slider.step; setvalue(slider.topic, slider.value) notify.call(slider); } }; var decrement = function decrement(topic) { var slider = sliders[topic]; if (slider === null || slider === undefined) return; if (slider.value - slider.step >= slider.min) { slider.value -= slider.step; setvalue(topic, slider.value) notify.call(slider); } } // this = slider object var updateslider = function updateslider(e) { var node = this.node; var pos = e.pagex - node.offsetleft; var width = node.clientwidth; var delta = this.max - this.min; var offset = this.pointer.clientwidth + 4; // border width * 2 if (pos < 0) pos = 0; if (pos > width) pos = width; var value = pos * delta / width | 0; var precision = value % this.step; value = value - precision + this.
...s.g = green | 0; if (blue != undefined) this.b = blue | 0; if (alpha != undefined) this.a = alpha | 0; } /** * hsv/hsb (hue, saturation, value / brightness) * @param hue 0-360 * @param saturation 0-100 * @param value 0-100 */ color.prototype.sethsv = function sethsv(hue, saturation, value) { this.hue = hue; this.saturation = saturation; this.value = value; this.updatergb(); } color.prototype.updatergb = function updatergb() { var sat = this.saturation / 100; var value = this.value / 100; var c = sat * value; var h = this.hue / 60; var x = c * (1 - math.abs(h % 2 - 1)); var m = value - c; var precision = 255; c = (c + m) * precision; x = (x + m) * precision; m = m * precision; if (h >= 0 && h < 1) { this.setrgba(c, x, m); return; } ...
...And 29 more matches
Working with Svelte stores - Learn web development
; } </style> let's walk through this piece of code in detail. at the beginning we import the alert store. next we import the ondestroy() lifecycle function, which lets us execute a callback after the component has been unmounted. we then create a local variable named alertcontent. remember that we can access top-level variables from the markup, and whenever they are modified the dom will update accordingly. then we call the method alert.subscribe(), passing it a callback function as a parameter. whenever the value of the store changes, the callback function will be called with the new value as its parameter. in the callback function we just assign the value we receive to the local variable, which will trigger the update of the component's dom. the subscribe() method also returns a cle...
...ontent variable in our markup, and if the user clicks on the alert we clean it. at the end we include a few css lines to style our alert component. this setup allows us to work with stores in a reactive way. when the value of the store changes, the callback is executed. there we assign a new value to a local variable, and thanks to svelte reactivity all our markup and reactive dependencies are updated accordingly. using the component let's now use our component. in app.svelte we'll import the component; add the following import statement below the existing one: import alert from './components/alert.svelte' then call the alert component just above the todos call, like this: <alert /> <todos {todos} /> load your test app now, and you should now see the alert message on...
... automatically. so our previous code block can be replaced with this: <script> import mystore from './stores.js' </script> {$mystore} and $mystore will be fully reactive. this also applies to your own custom stores. if you implement the subscribe() and set() methods, like we'll do later, the reactive $store syntax will also apply to your stores. let's apply this to our alert component. update the <script> and markup sections of alert.svelte as follows: <script> import { alert } from '../stores.js' </script> {#if $alert} <div on:click={() => $alert = ''}> <p>{ $alert }</p> </div> {/if} check your app again and you'll see that this works just like before. that's much better! behind the scenes svelte has generated the code to declare the local variable $alert, subscri...
...And 27 more matches
Componentizing our Svelte app - Learn web development
previous overview: client-side javascript frameworks next in the last article we started developing our todo list app. the central objective of this article is to look at how to break our app into manageable components and share information between them. we'll componentize our app, then add more functionality to allow users to update existing components. prerequisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. you'll need a terminal with node + npm installed to compile and build your app. objective: to learn how to break our app into components and share information among them. code along with us git clone the github repo ...
...e below line is all you need: <filterbutton {filter} /> note: remember that when the html attribute name and variable matches, they can be replaced with {variable}, that's why we could replace <filterbutton filter={filter} /> with <filterbutton {filter} />. so far so good! let's try out the app now. you'll notice that when you click on the filter buttons, they are selected and the style updates appropriately. but! we have a problem — the todos aren't filtered. that's because the filter variable flows down from the todos component to the filterbutton component through the prop, but changes occurring in the filterbutton component don't flow back up to its parent — the data binding is one-way by default. let's look at a way to solve this. sharing data between components: passing a ha...
... any filter button, the child will call the onclick handler, passing the selected filter as a parameter, back up to its parent. ...
...And 26 more matches
Index
Mozilla › Tech › XPCOM › Index
xpcom in xpcom, a weak reference is a special object that contains a pointer to an xpcom object, but doesnot keep that object alive. if the referent object is destroyed before the weak reference, the pointer inside the weak reference is set to nsnull. 91 working with multiple versions of interfaces add-ons, extensions, xpcom in this short note we illustrate how one can update an xpcom module in order for it to work in both firefox 2 and firefox 3, even if the interfaces have changed in the interim. 92 working with out parameters add-ons, extensions, xpcom:language bindings, xpconnect no summary! 93 xpcom abi xpcom xpcom abi is the binary interface of xpcom components. while xpcom components written in a scripting language (suc...
...o 2.0. 98 xpcom guide add-ons, extensions, guide, landing, mozilla, xpcom these articles provide tutorials and usage documentation for xpcom, including how to use it in your own projects and how to build xpcom components for your firefox add-ons and the like. 99 avoiding leaks in javascript xpcom components add-ons, developing mozilla, extensions, mozilla, needsupdate, obsolete, xpcom, xpcom:language bindings, xpconnect programmers writing and reviewing javascript code in mozilla should understand how code using xpcom in javascript can leak so that they can avoid leaks. this document attempts to help them do so, first by explaining the underlying concepts, and second by describing a number of common javascript patterns that cause leaks. 100 cr...
... it with mozilla - prompts a discussion of the relationship between components and modules, of xpcom interfaces, and of the registration process in general. 108 resources guide, xpcom this last section of the book provides a list of resources referred to in the tutorial and other links that may be useful to the gecko developer. 109 setting up the gecko sdk needsupdate, tutorial, xpcom this chapter provides basic setup information for the gecko software development kit (sdk) used to build the weblock component in this tutorial. the following four sections tell the developer how to download and organize the gecko sdk and create a new project in which components like weblock can be created. 110 starting weblock xpcom in this chapter, we...
...And 25 more matches
Theme changes in Firefox 2 - Archive of obsolete content
filename css file details browser/base/searchdialog.xul browser/base/content/searchdialog.css removed from firefox 2. ...
... filename css file details browser/base/searchdialog.xul browser/base/content/searchdialog.css removed from firefox 2. ...
... filename css file details browser/base/searchdialog.xul browser/base/content/searchdialog.css removed from firefox 2. ...
...And 22 more matches
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
into the app and try it out! you'll find that the remove completed button works fine, but the check all/uncheck all button just silently fails. to find out what is happening here, we'll have to dig a little deeper into svelte reactivity. reactivity gotchas: updating objects and arrays to see what's happening we can log the todos array from the checkalltodos() function to the console. ...
...this also means that in this case, a reactive statement like $: console.log('todos', todos) won't be very useful. ...
...the todo objects' completed properties are toggled between true and false), but svelte is not aware of that. this also means that in this case, a reactive statement like $: console.log('todos', todos) won't be very useful. to find out why this is happening, we need to understand how reactivity works in svelte when updating arrays and objects. many web frameworks use the virtual dom technique to update the page. basically, the virtual dom is an in-memory copy of the contents of the web page. the framework updates this virtual representation which is then synced with the "real" dom. this is much faster than directly updating the dom and allows the framework to apply many optimization techniques. these frameworks, by default, basically re-run all our javascript on every change against this virtu...
...And 21 more matches
Dynamic behavior in Svelte: working with variables and props - Learn web development
ding">{completedtodos} out of {totaltodos} items completed</h2> go to the app, and you should see the "2 out of 3 items completed" message as before, but this time the information is coming from the todos array. to prove it, go to that array, and try changing some of the todo object's completed property values, and even add a new todo object. observe how the numbers in the message are updated appropriately. dynamically generating the todos from the data at the moment, our displayed todo items are all static. we want to iterate over each item in our todos array and render the markup for each task, so let's do that now. html doesn't have a way of expressing logic — like conditionals and loops. svelte does. in this case we use the {#each...} directive to iterate over the todos a...
...lay the tasks from our component's state. great! we are getting there. working with props with a hardcoded list of todos, our todos component is not very useful. to turn our component into a general purpose to-do editor we should allow the parent of this component to pass in the list of todos to edit. this would allow us to save them to a web service or local storage and later retrieve them for update. so let's turn the array into a prop. in todos.svelte, replace the existing let todos = ... block with export let todos = []. export let todos = [] this may feel a little weird at first. that's not how export normally works in javascript modules! this is how svelte 'extends' javascript by taking valid syntax and giving it a new purpose. in this case svelte is using the export keyword...
....svelte component will accept a todos attribute, which when omitted will be initialized to an empty array. have a look at the app, and you'll see the "nothing to do here!" message. this is because we are currently not passing any value into it from app.svelte, so it's using the default value. now let's move our todos to app.svelte and pass them to the todos.svelte component as a prop. ...
...And 21 more matches
Install Manifests - Archive of obsolete content
ntroduction an install manifest is the file an add-on manager-enabled xul application (e.g. firefox or thunderbird) uses to determine information about an add-on as it is being installed. it contains metadata identifying the add-on, providing information about who created it, where more information can be found about it, which versions of what applications it is compatible with, how it should be updated, and so on. the format of the install manifest is rdf/xml. the file must be called install.rdf and live at the top level of an add-on's xpi file. layout the basic layout of an install manifest is like so: <?xml version="1.0" encoding="utf-8"?> <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <description about="urn:mozilla:inst...
...the same fashion as the version property and will be compared to the application version; this allows the extension author to specify which versions of firefox an extension has been tested with. id, minversion, and maxversion are all required. note: extensions compatible with firefox 3.5 should specify a maxversion of 3.5.*, so that they are automatically compatible with security and stability updates. for firefox 3.0, a maxversion of 3.0.* should be used. extensions compatible only with firefox or thunderbird 2 should specify a maxversion of 2.0.0.*. the install manifest must specify at least one of these objects, and may specify more if the add-on targets multiple applications that support the add-on manager (e.g. firefox and thunderbird). examples <em:targetapplication> <description>...
...s property was added for firefox 1.5, and is only required for add-on types other than extensions and themes. firefox 2 and previous supported a value of 16 to represent plug-ins. in firefox 3 this has been removed. version a version string identifying the version of the add-on being supplied. for firefox/thunderbird 1.0, the format must conform to the rules specified in extension versioning, update and compatibility. for firefox/thunderbird 1.5, see toolkit version format. examples <em:version>2.0</em:version> <em:version>1.0.2</em:version> <em:version>0.4.1.2005090112</em:version> firefox 1.5 / xulrunner 1.8 - add-ons that do not use a valid version format will not be installed. the version format is different from, although backwards-compatible with, 1.0's. for add-ons hosted on add...
...And 19 more matches
WAI-ARIA basics - Learn web development
wai-aria is a technology that can help with such problems by adding in further semantics that browsers and assistive technologies can recognize and use to let users know what is going on. here we'll show how to use it at a basic level to improve accessiblity. ...
...ace, your operating system needs to run browsers that have the necessary accessibility apis in place to expose the information screenreaders need to do their job. most popular oses have one or two browsers in place that screenreaders can work with. the paciello group has a fairly up-to-date post that provides data for this — see rough guide: browsers, operating systems and screen reader support updated. next, you need to worry about whether the browsers in question support aria features and expose them via their apis, but also whether screenreaders recognise that information and present it to their users in a useful way. browser support is generally quite good — at the time of writing, caniuse.com stated that global browser support for wai-aria was around 88%. screenreader support for a...
...hat prompted wai-aria to be created earlier on, but essentially, there are four main areas that wai-aria is useful in: signposts/landmarks: aria's role attribute values can act as landmarks that either replicate the semantics of html5 elements (e.g. <nav>), or go beyond html5 semantics to provide signposts to different functional areas, e.g search, tabgroup, tab, listbox, etc. dynamic content updates: screenreaders tend to have difficulty with reporting constantly changing content; with aria we can use aria-live to inform screenreader users when an area of content is updated, e.g. via xmlhttprequest, or dom apis. enhancing keyboard accessibility: there are built-in html elements that have native keyboard accessibility; when other elements are used along with javascript to simulate similar i...
...And 16 more matches
HTML text fundamentals - Learn web development
.a11y-label { margin: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var solution = document.getelementbyid('solution'); var output = document.queryselector('.output'); var code = textarea.value; var userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution...
...) { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solution'; } updatecode(); }); var htmlsolution = '<h1>my short story</h1>\n<p>i am a statistician and my name is trish.</p>\n<p>my legs are made of cardboard and i am married to a fish.</p>'; var solutionentry = htmlsolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead...
...op; var caretpos = textarea.selectionstart; var front = (textarea.value).substring(0, caretpos); var back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.onkeyup = function(){ // 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(); }; why do w...
...And 16 more matches
React interactivity: Events and state - Learn web development
te a function named addtask() which has a single parameter of name: function addtask(name) { alert(name); } next, we'll pass addtask() into <form /> as a prop. the prop can have whatever name you want, but pick a name you’ll understand later. something like addtask works, because it matches the name of the function as well as what the function will do. ...
... <form /> as a prop. the prop can have whatever name you want, but pick a name you’ll understand later. something like addtask works, because it matches the name of the function as well as what the function will do. your <form /> component call should be updated as follows: <form addtask={addtask} /> finally, you can use this prop inside the handlesubmit() function in your <form /> component! update it as follows: function handlesubmit(e) { e.preventdefault(); props.addtask("say hello!"); } clicking on the "add" button in your browser will prove that the addtask() callback function works, but it'd be nice if we could get the alert to show us what we're typing in our input field! this is what we'll do next. note: we decided to name our callback prop addtask to make it easy to understa...
...cross in react code is to prefix callback prop names with the word on, followed by the name of the event that will cause them to be run. for instance, we could have given our form a prop of onsubmit with the value of addtask. state and the usestate hook so far, we've used props to pass data through our components and this has served us just fine. now that we're dealing with user input and data updates, however, we need something more. for one thing, props come from the parent of a component. our <form /> will not be inheriting a new name for our task; our <input /> element lives directly inside of <form />, so <form/> will be directly responsible for creating that new name. we can't ask <form /> to spontaneously create its own props, but we can ask it to track some of its own data for us. d...
...And 16 more matches
Anatomy of a video game - Game development
ow a game engine is programmed. the specifics depend on the game. some games drive this cycle by user input. imagine that you are developing a "find the differences between these two similar pictures"-type game. these games present two images to the user; they accept their click (or touch); they interpret the input as a success, failure, pause, menu interaction, etc.; finally, they calculate an updated scene resulting from that input. the game loop is advanced by the user's input and sleeps until they provide it. this is more of a turn-based approach that doesn't demand a constant update every frame, only when the player reacts. other games demand control over each of the smallest possible individual timeslices. the same principles as above apply with a slight twist: each frame of animation p...
...ncluding multiple webgl canvases with transparent backgrounds if you want) into a complex hierarchy. each of these paths will lead to different opportunities and constraints. it is decision... time you will need to make hard decisions about your main loop: how to simulate the accurate progress of time. if you demand per-frame control then you will need to determine how frequently your game will update and draw. you might even want update and draw to occur at different rates. you will also need to consider how gracefully your game will fail if the user's system cannot keep up with the workload. let us start by assuming that you will handle user input and update the game state every time you draw. we will branch out later. note: changing how your main loop deals with time is a debugging nightm...
... /* * starting with the semicolon is in case whatever line of code above this example * relied on automatic semicolon insertion (asi). the browser could accidentally * think this whole example continues from the previous line. the leading semicolon * marks the beginning of our new line if the previous one was not empty or terminated. ...
...And 15 more matches
NSS functions
ssl functions the public functions listed here are used to configure sockets for communication via the ssl and tls protocols. ...
... 3.2 and later pk11_isreadonly mxr 3.2 and later pk11_isremovable mxr 3.12 and later pk11_ivfromparam mxr 3.2 and later pk11_keygen mxr 3.2 and later pk11_linkgenericobject mxr 3.9.2 and later pk11_listcerts mxr 3.2 and later. updated 3.8 with new options. see bug 215186 pk11_listfixedkeysinslot mxr 3.4 and later pk11_listprivkeysinslot mxr 3.4 and later pk11_listpublickeysinslot mxr 3.4 and later pk11_loadprivkey mxr 3.4 and later pk11_logoutall mxr 3.4 and later pk11_mak...
... 3.9.3 and later pk11_pubencryptraw mxr 3.2 and later pk11_pubunwrapsymkey mxr 3.2 and later pk11_pubunwrapsymkeywithflags mxr 3.6 and later pk11_pubunwrapsymkeywithflagsperm 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_restorecontext mxr 3.2 and later pk11_savecontext mxr 3.2 and later pk11_savecontextalloc ...
...And 15 more matches
Background Tasks API - Web APIs
the cooperative scheduling of background tasks api (also referred to as the background tasks api or simply the requestidlecallback() api) provides the ability to queue tasks to be executed automatically by the user agent when it determines that there is free time to do so. concepts and usage the main thread of a web browser is centered around its event loop. this code draws any pending updates to the document currently being displayed, runs any javascript code the page needs to run, accepts events from input devices, and dispatches those events to the elements that should receive them. in addition, the event loop handles interactions with the operating system, updates to the browser's own user interface, and so forth. it's an extremely busy chunk of code, and your main javascript code...
...he browser's own user interface, and so forth. it's an extremely busy chunk of code, and your main javascript code may run right inside this thread along with all of this. certainly most if not all code that is capable of making changes to the dom is running in the main thread, since it's common for user interface changes to only be available to the main thread. because event handling and screen updates are two of the most obvious ways users notice performance issues, it's important for your code to be a good citizen of the web and help to prevent stalls in the execution of the event loop. in the past, there's been no way to do this reliably other than by writing code that's as efficient as possible and by offloading as much work as possible to workers. window.requestidlecallback() makes it pos...
... should be thoughtful about how you go about using them. use idle callbacks for tasks which don't have high priority. because you don't know how many callbacks have been established, and you don't know how busy the user's system is, you don't know how often your callback will be run (unless you specify a timeout. there's no guarantee that every pass through the event loop (or even every screen update cycle) will include any idle callbacks being executed; if the event loop uses all available time, you're out of luck (again, unless you've used a timeout). idle callbacks should do their best not to overrun the time allotted. while the browser, your code, and the web in general will continue to run normally if you go over the specified time limit (even if you go way over it), the time restrictio...
...And 15 more matches
Border-image generator - CSS: Cascading Style Sheets
elect'; while (node.firstelementchild !== null) { option = node.firstelementchild; option_value = option.getattribute('data-value'); if (option_value === null) option.setattribute('data-value', uval); list.appendchild(node.firstelementchild); uval++; } node.appendchild(select); node.appendchild(list); select.onclick = this.toggle.bind(this); list.onclick = this.updatevalue.bind(this); document.addeventlistener('click', clickout); this.state = 0; this.time = 0; this.dropmenu = list; this.select = select; this.toggle(false); this.value = {}; this.topic = topic; if (label) select.textcontent = label; else this.setnodevalue(list.children[selected]); dropdowns[topic] = this; }; dropdown.prototype.toggle = function toggle(state) { ...
...{ if (active) active.toggle(false); active = this; } if (this.state === 0) this.dropmenu.setattribute('data-hidden', 'true'); else this.dropmenu.removeattribute('data-hidden'); }; var clickout = function clickout(e) { if (active.state === 0 || e.target === active.dropmenu || e.target === active.select) return; active.toggle(false); }; dropdown.prototype.updatevalue = function updatevalue(e) { if (date.now() - this.time < 500) return; if (e.target.classname !== "ui-dropdown-list") { this.setnodevalue(e.target); this.toggle(false); } this.time = date.now(); }; dropdown.prototype.setnodevalue = function setnodevalue(node) { this.value['name'] = node.textcontent; this.value['value'] = node.getattribute('data-value'); this.sele...
...manager.setvalue('slice-fill', prop['fill']); dropdownmanager.setvalue('image-repeat-x', prop['repeat'][0]); dropdownmanager.setvalue('image-repeat-y', prop['repeat'][1]); inputslidermanager.setvalue('preview-width', prop['size'][0]); inputslidermanager.setvalue('preview-height', prop['size'][1]); inputslidermanager.setvalue('preview-area-height', prop['preview_area']); }; var update = function update() { scale = math.min(300, (30000 / this.width) | 0); setscale(scale); inputslidermanager.setvalue('scale', scale, false); subject.style.backgroundimage = 'url("' + this.src + '")'; preview.style.borderimagesource = 'url("' + this.src + '")'; guidelines['slice-top'].setmax(this.height); guidelines['slice-right'].setmax(this.width); guidelines['slice-bot...
...And 15 more matches
Application cache implementation overview
's enough to describe the simplest case ; for complete documentation of the selection algorithm refer to the spec or to the code. when the url in the manifest attribute of the html tag is identical to the manifest url the channel's nsiapplicationcache object belongs to and, the channel's loadedfromapplicationcache flag is set, the document is associated with that nsiapplicationcache object and an update attempt for the manifest is scheduled after the document completely loads. marking entries as foreign when nscontentsink::processofflinemanifest() discovers that the url in the manifest attribute of the html tag is different from the manifest url the channel's nsiapplicationcache object belongs to, the entry the document has been loaded from is marked “foreign” and the page load is completely...
... namespace failed to load from the network, we perform fallback to the previously remembered fallback entry. it's actually a redirect to the fallback url loading from the associated nsiapplicationcache. ...
...orm fallback to the previously remembered fallback entry. it's actually a redirect to the fallback url loading from the associated nsiapplicationcache. updating an existing cache or first download of an offline cache the process of updating or first caching is invoked asynchronously from nscontentsink::processofflinemanifest() using nsofflinecacheupdateservice. the implementation of offline cache update is in /uriloader/prefetch. ...
...And 14 more matches
Web Console remoting - Firefox Developer Tools
ypical page errors and console api calls. these will be explained in the following sections of this document. actor preferences to allow the web console to configure logging options while it is running, we have added the setpreferences packet: { "to": "conn0.console9", "type": "setpreferences", "preferences": { "networkmonitor.saverequestandresponsebodies": false } } reply: { "updated": [ "networkmonitor.saverequestandresponsebodies" ], "from": "conn0.console10" } for convenience you can use webconsoleclient.setpreferences(prefs, onresponse). the prefs argument is an object like { prefname: prefvalue, ... }. in firefox 25 we added the getpreferences request packet: { "to": "conn0.console34", "type": "getpreferences", "preferences": [ "networkmonitor.save...
...nt", "bindobjectactor": null, "frameactor": null, "url": null, "selectednodeactor": null, } the bindobjectactor property is an optional objectactor id that points to a debugger.object. this option allows you to bind _self to the debugger.object of the given object actor, during string evaluation. see evalinglobalwithbindings() for information about bindings. the variable view needs to update objects and it does so by binding _self to the debugger.object of the objectactor that is being viewed. as such, variable view sends strings like these for evaluation: _self["prop"] = value; the frameactor property is an optional frameactor id. the fa holds a reference to a debugger.frame. this option allows you to evaluate the string in the frame of the given fa. the url property is an op...
... is created. the isxhr flag indicates if the request was initiated via an xmlhttprequest instance, that is: the nsihttpchannel's notification is of an nsixmlhttprequest interface. the private flag tells if the network request comes from a private window/tab (added in firefox 24). the networkeventactor the new network event actor stores further request and response information. ...
...And 14 more matches
Using XPInstall to Install Plugins - Archive of obsolete content
ugin dll, but also the realplayer application (exe) which the plugin dll is a subset of. in this case, the plugin is the part of the software package that is browser-specific, as a mechanism to give the application additional "hooks" into the browser. xpinstall can be used to install any combination of these files on an end-user's machine. ...
...nism to give the application additional "hooks" into the browser. xpinstall can be used to install any combination of these files on an end-user's machine. for those familiar with netscape communicator 4.x's smartupdate technology, this will be a familiar idea. a brief history of netscape installer technologies this section is relevant if you are familiar with netscape communicator 4.x's smartupdate installer technology. the use of javascript as the install logic is not unprecedented in netscape browsers. ...
...e familiar with netscape communicator 4.x's smartupdate technology, this will be a familiar idea. a brief history of netscape installer technologies this section is relevant if you are familiar with netscape communicator 4.x's smartupdate installer technology. the use of javascript as the install logic is not unprecedented in netscape browsers. netscape communicator 4.x uses the notion of smartupdate to install software, particularly plugins and java applets to be run locally. smartupdate is not supported by mozilla browsers (and netscape/aol browsers based on mozilla such as netscape 7), but because of the similarity between the two installer technologies, it is easy to convert your smartupdate files to xpinstall files. ...
...And 12 more matches
Border-radius generator - CSS: Cascading Style Sheets
this.unity = 0; this.unitr = 0; this.maxw = 100; this.maxh = 100; this.maxr = 100; this.topic = y + '-' + x; var sliderw = inputslidermanager.getnode(this.topic + '-w'); var sliderh = inputslidermanager.getnode(this.topic + '-h'); var sliderr = inputslidermanager.getnode(this.topic); this.setunitx(this.unitx); this.setunity(this.unity); this.setunitr(this.unitr); this.updatewidth(); this.updateheight(); this.updateradius(); if (x === 'left') this.resizex = 1; if (x === 'right') this.resizex = -1; if (y === 'top') this.resizey = 1; if (y === 'bottom') this.resizey = -1; radius.classname = 'radius'; var unit_selector = document.getelementbyid("unit-selection"); var unitw = new unitselector(this.topic + '-w'); var unith = new unitselector(this.t...
...(x === 'right' && y == 'top') handle.classname = 'handle handle-top-right'; if (x === 'right' && y == 'bottom') handle.classname = 'handle handle-bottom-right'; if (x === 'left' && y == 'bottom') handle.classname = 'handle handle-bottom-left'; handle.addeventlistener("mousedown", function(e) { active = true; this.radius.style.display = 'block'; previewmousetracking.subscribe(this.updatecontainer.bind(this)); }.bind(this)); document.addeventlistener("mouseup", function(e) { this.radius.style.display = 'none'; if (active === true) previewmousetracking.unsubscribe(this.updatecontainer.bind(this)); }.bind(this)); inputslidermanager.subscribe(this.topic + '-w', this.setwidth.bind(this)); inputslidermanager.subscribe(this.topic + '-h', this.setheight.bind(this));...
...nd(this)); buttonmanager.subscribe(this.topic, function(value) { this.rounded = value; if (value === true) { unitw.container.style.display = 'none'; unith.container.style.display = 'none'; unitr.container.style.display = 'block'; sliderw.style.display = 'none'; sliderh.style.display = 'none'; sliderr.style.display = 'block'; this.setunitr(this.unitr); this.updateradius(); } if (value === false) { unitw.container.style.display = 'block'; unith.container.style.display = 'block'; unitr.container.style.display = 'none'; sliderw.style.display = 'block'; sliderh.style.display = 'block'; sliderr.style.display = 'none'; this.setunitx(this.unitx); this.setunity(this.unity); this.updatewidth(); this.updateheight(); ...
...And 12 more matches
Using CSS transitions - CSS: Cascading Style Sheets
it-transition-property: width height background-color font-size left top transform -webkit-transform color; -webkit-transition-duration: 0.5s; -webkit-transition-timing-function: ease-in-out; transition-property: width height background-color font-size left top transform -webkit-transformv color; transition-duration: 0.5s; transition-timing-function: ease-in-out; } function updatetransition() { var el = document.queryselector("div.box"); if (el) { el.classname = "box1"; } else { el = document.queryselector("div.box1"); el.classname = "box"; } return el; } var intervalid = window.setinterval(updatetransition, 7000); transition-duration: 1s <div class="parent"> <div class="box">lorem</div> </div> .parent { width: 250px; height...
...-webkit-transition-property: width height background-color font-size left top -webkit-transform transform color; -webkit-transition-duration: 1s; -webkit-transition-timing-function: ease-in-out; transition-property: width height background-color font-size left top transform -webkit-transform color; transition-duration: 1s; transition-timing-function: ease-in-out; } function updatetransition() { var el = document.queryselector("div.box"); if (el) { el.classname = "box1"; } else { el = document.queryselector("div.box1"); el.classname = "box"; } return el; } var intervalid = window.setinterval(updatetransition, 7000); transition-duration: 2s <div class="parent"> <div class="box">lorem</div> </div> .parent { width: 250px; height...
...-webkit-transition-property: width height background-color font-size left top transform -webkit-transform color; -webkit-transition-duration: 2s; -webkit-transition-timing-function: ease-in-out; transition-property: width height background-color font-size left top transform -webkit-transform color; transition-duration: 2s; transition-timing-function: ease-in-out; } function updatetransition() { var el = document.queryselector("div.box"); if (el) { el.classname = "box1"; } else { el = document.queryselector("div.box1"); el.classname = "box"; } return el; } var intervalid = window.setinterval(updatetransition, 7000); transition-duration: 4s <div class="parent"> <div class="box">lorem</div> </div> .parent { width: 250px; height...
...And 12 more matches
Making decisions in your code — conditionals - Learn web development
rning to our previous example about the child doing a chore for their parent, you could write it like this: let shoppingdone = false; if (shoppingdone) { // don't need to explicitly specify '=== true' let childsallowance = 10; } else { let childsallowance = 5; } nesting if ... else it is perfectly ok to put one if...else statement inside another one — to nest them. for example, we could update our weather forecast application to show a further set of choices depending on what the temperature is: if (choice === 'sunny') { if (temperature < 86) { para.textcontent = 'it is ' + temperature + ' degrees outside — nice and sunny. let\'s go out to the beach, or the park, and get an ice cream.'; } else if (temperature >= 86) { para.textcontent = 'it is ' + temperature + ' degrees...
... chooser where the styling for the site is applied using a ternary operator. ...
...e</option> <option value="black">black</option> </select> <h1>this is my website</h1> const select = document.queryselector('select'); const html = document.queryselector('html'); document.body.style.padding = '10px'; function update(bgcolor, textcolor) { html.style.backgroundcolor = bgcolor; html.style.color = textcolor; } select.onchange = function() { ( select.value === 'black' ) ? update('black','white') : update('white','black'); } here we've got a <select> element to choose a theme (black or white), plus a simple <h1> to display a website title. we also have a function called update(), which takes two colors as parameters (inputs). the website's background color is set to the first provided color, and its text color is set to the second provided color. finally, we've also ...
...And 11 more matches
TypeScript support in Svelte - Learn web development
cy manager to get started. npm install # download new dependencies npm run dev # start the app in development mode these instructions apply to any svelte project you'd like to convert to typescript. just take into account that the svelte community is constantly improving svelte typescript support, so you should run npm update regularly to take advantage of the latest changes. note: if you find any trouble working with typescript inside a svelte application, have a look at this troubleshooting/faq section about typescript support. as we said before, typescript is a superset of javascript, so your application will run without modifications. currently you will be running a regular javascript application with typescri...
... enabled, without taking advantage of any of the features that typescript provides. you can now start adding types progressively. once you have typescript configured, you can start using it from a svelte component by just adding a <script lang='ts'> at the beginning of the script section. to use it from regular javascript files, just change the file extension from .js to .ts. you'll also have to update any corresponding import statements (don't include the .ts in your import statements; typescript chose to omit the extensions). note: using typescript in component markup sections is not supported yet. you'll have to use javascript from the markup, and typescript in the <script lang='ts'> section. improved developer experience with typescript typescript provides code editors and ides with lo...
...array of todotype. replace export let todos = [] with the following two lines: import type { todotype } from '../types/todo.type' export let todos: todotype[] = [] next we'll specify all the missing types. the variable todosstatus, which we used to programmatically access the methods exposed by the todosstatus component, is of type todosstatus. and each todo will be of type todotype. ...
...And 11 more matches
IME handling guide
by automated tests. mozilla::widgetcompositionevent internally, widgetcompositionevent represents native ime behavior. its message is one of following values: ecompositionstart this is dispatched at starting a composition. this represents a dom compositionstart event. the mdata value is a selected string at dispatching the dom event and it's automatically set by textcomposition. ecompositionupdate this is dispatched by textcomposition when an ecompoitionchange will change the composition string. this represents a dom compositionupdate event. ecompositionend this is dispatched by textcomposition when an ecompositioncommitasis or ecomposiitoncommit event is dispatched. this represents a dom compositionend event. ecompositionchange this is used internally only. this is dispatched at modi...
...ific string. the mdata value is the commit string. this causes a dom text event without clause information and a dom compositionend event. ...
...nt without clause information and a dom compositionend event. ...
...And 11 more matches
Battery Status API - Web APIs
w events you can handle to monitor the battery status. example in this example, we watch for changes both to the charging status (whether or not we're plugged in and charging) and for changes to the battery level and timing. this is done by listening for the chargingchange, levelchange, chargingtimechange, dischargingtimechange events. ...
...onitor the battery status. example in this example, we watch for changes both to the charging status (whether or not we're plugged in and charging) and for changes to the battery level and timing. this is done by listening for the chargingchange, levelchange, chargingtimechange, dischargingtimechange events. ...
...s. example in this example, we watch for changes both to the charging status (whether or not we're plugged in and charging) and for changes to the battery level and timing. this is done by listening for the chargingchange, levelchange, chargingtimechange, dischargingtimechange events. ...
...And 11 more matches
ARIA live regions - Accessibility
while these changes are usually visually apparent to users who can see the page, they may not be obvious to users of assistive technologies. aria live regions fill this gap and provide a way to programmatically expose dynamic content changes in a way that can be announced by assistive technologies. ...
...ssistive technologies will announce dynamic changes in the content of a live region. including an aria-live attribute or a specialized live region role (such as role="alert") on the element you want to announce changes to works as long as you add the attribute before the changes occur — either in the original markup, or dynamically using javascript. ...
...the default setting is off. this attribute is by far the most important. aria-controls: the aria-controls=[idlist] is used to associate a control with the regions that it controls. ...
...And 11 more matches
Event reference
vent name fired when beforeprint the print dialog is opened afterprint the print dialog is closed text composition events event name fired when compositionstart the composition of a passage of text is prepared (similar to keydown for a keyboard input, but works with other inputs such as speech recognition). compositionupdate a character is added to a passage of text being composed. compositionend the composition of a passage of text has been completed or canceled. view events event name fired when fullscreenchange an element was toggled to or from fullscreen mode. fullscreenerror it was impossible to switch to fullscreen mode for technical reasons or ...
...but estimates that not enough data has been loaded to play the media up to its end without having to stop for further buffering of content. canplaythrough the browser estimates it can play the media up to its end without stopping for content buffering. complete the rendering of an offlineaudiocontext is terminated. durationchange the duration attribute has been updated. emptied the media has become empty; for example, this event is sent if the media has already been loaded (or partially loaded), and the load() method is called to reload it. ended playback has stopped because the end of the media was reached. loadeddata the first frame of the media has finished loading. loadedmetadata the metadata has been loaded.
...is ready to start after having been paused or delayed due to lack of data. ratechange the playback rate has changed. seeked a seek operation completed. seeking a seek operation began. stalled the user agent is trying to fetch media data, but data is unexpectedly not forthcoming. suspend media data loading has been suspended. timeupdate the time indicated by the currenttime attribute has been updated. volumechange the volume has changed. waiting playback has stopped because of a temporary lack of data. progress events event name fired when abort progression has been terminated (not due to an error). error progression has failed. load prog...
...And 11 more matches
2D maze game with device orientation - Game development
create: function() { this.game.state.start('mainmenu'); } }; there are single images, spritesheets and audio files loaded by the framework. in this state the preloadbar is showing the progress on the screen. that progress of the loaded assets is visualized by the framework with the use of one image. with every asset loaded you can see more of the preloadbar image: from 0% to 100%, updated on every frame. after all the assets are loaded, the mainmenu state is launched. mainmenu.js the mainmenu state shows the main menu of the game, where you can start playing by clicking the button. ball.mainmenu = function(game) {}; ball.mainmenu.prototype = { create: function() { this.add.sprite(0, 0, 'screen-mainmenu'); this.gametitle = this.add.sprite(ball._width*0.5, 40...
...after clicking the screen the actual game is launched. game.js the game state from the game.js file is where all the magic happens. all the initialization is in the create() function (launched once at the beginning of the game). after that some functionality will require further code to control — we will write our own functions to handle more complicated tasks. ...
...ed. game.js the game state from the game.js file is where all the magic happens. all the initialization is in the create() function (launched once at the beginning of the game). after that some functionality will require further code to control — we will write our own functions to handle more complicated tasks. in particular, take note of the update() function (executed at every frame), which updates things such as the ball position. ...
...And 10 more matches
Getting started with HTML - Learn web development
llowed by content, followed by the closing tag. active learning: creating your first html element edit the line below in the input area by wrapping it with the tags <em> and </em>. to open the element, put the opening tag <em> at the start of the line. to close the element, put the closing tag </em> at the end of the line. doing this should give the line italic text formatting! see your changes update live in the output area. if you make a mistake, you can clear your work using the reset button. if you get really stuck, press the show solution button to see the answer. playable code <h2>live output</h2> <div class="output" style="min-height: 50px;"> </div> <h2>editable code</h2> <p class="a11y-label">press esc to move focus away from the code area (tab inserts a tab character).</p> <text...
... .a11y-label { margin: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var solution = document.getelementbyid('solution'); var output = document.queryselector('.output'); var code = textarea.value; var userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution...
...) { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solution'; } updatecode(); }); var htmlsolution = '<em>this is my text.</em>'; var solutionentry = htmlsolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } ...
...And 10 more matches
Useful string methods - Learn web development
s works very simply at a basic level, although there are some advanced things you can do with it that we won't go into yet. it takes two parameters — the string you want to replace, and the string you want to replace it with. try this example: browsertype.replace('moz','van'); this returns "vanilla" in the console. but if you check the value of browsertype, it is still "mozilla". to actually update the value of the browsertype variable in a real program, you'd have to set the variable value to be the result of the operation; it doesn't just update the substring value automatically. so you'd have to actually write this: browsertype = browsertype.replace('moz','van'); active learning examples in this section we'll get you to try your hand at writing some string manipulation code. in each ex...
...: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); let code = textarea.value; let userentry = textarea.value; function updatecode() { eval(textarea.value); } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = jssolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { ...
...n() { textarea.value = code; userentry = textarea.value; solutionentry = jssolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solution'; } updatecode(); }); const jssolution = 'const list = document.queryselector(\'.output ul\');' + '\nlist.innerhtml = \'\';' + '\nlet greetings = [\'happy birthday!\',' + '\n \'merry christmas my love\',' + '\n \'a happy christmas to all the family\',' + '\n \'you\\\'re all i want for christmas\',' + '\n \'get well soon\'];' + '\n' + '\nfor (l...
...And 10 more matches
AddressErrors - Web APIs
s dictionary is used by the payment request api to to report validation errors in a physical address (typically a billing address or a shipping address). any members which is present indicates that a validation error occurred for the member of the same name in an address described using paymentaddress. addresserrors is the type of the object returned by shippingaddresserrors in the paymentdetailsupdate passed into paymentrequestupdateevent.updatewith() by the shippingaddresschange event handler if a change to the address resulted in a validation error occurring. see the examples below to see how this works. properties addressline a domstring which, if present, indicates that the addressline property of the paymentaddress could not be validated. the contents of the string provide a human-r...
...change(ev) { const validcountries = ["us", "ca", "gb", "jp", "cn", "mx"]; const genericaddresserror = "unable to ship to the given address. ...
... complete example here we'll see a complete, working version of the example above (except of course that it's not connected to an actual payment handler, so no payments are ac...
...And 10 more matches
Timing element visibility with the Intersection Observer API - Web APIs
t, and not the tab's visibility (which is a different issue entirely), we need to use the page visibility api to detect these tab switches and disable our timers for the duration. ...
... do is remove the ads from the set of visible ads (visibleads) and mark them as inactive. to do so, we begin by saving the set of visible ads into a variable known as previouslyvisibleads to be sure we can restore them when the user tabs back into the document, and we then empty the visibleads set so they won't be treated as visible. then, for each of the ads that are being suspended, we call our updateadtimer() function, which handles updating the ad's total visible time counter, then we set their dataset.lastviewstarted property to 0, which indicates that the tab's timer isn't running. if the document has just become visible, we reverse this process: first we go through previouslyvisibleads and set each one's dataset.lastviewstarted to the current document's time (in milliseconds since the do...
...tarted to the current document's time (in milliseconds since the document was created) using the performance.now() method. then we set visibleads back to previouslyvisibleads and set the latter to null. now the ads are all restarted, and configured to know that they became visible at the current time, so that they will not add up the duration of time the page was tabbed away the next time they're updated. handling intersection changes once per pass through the browser's event loop, each intersectionobserver checks to see if any of its target elements have passed through any of the observer's intersection ratio thresholds. for each observer, a list of targets that have done so is compiled, and sent to the observer's callback as an array of intersectionobserverentry objects. our callback, inters...
...And 10 more matches
Updating Commands - Archive of obsolete content
invoking commands if a command has an oncommand attribute, you can invoke it just by using the docommand method of the command or an element which links to it. for other commands, you will need to use a couple of additional lines of code. you will need to use these extra steps when invoking commands implemented by a controller. in addition, you will need to do this when creating your own menu commands, for instance to implement the edit menu commands in your own application. fortunately, the extra code is fairly simple. all we need to do is get the needed controller and call the command. ...
..." command="cmd_paste"/> the example above will implement a paste button. it is attached to the command which will invoke the command on the necessary controller when called. the code above is all you need to implement the functionality of the paste command in your application. the only other thing you need to do is ensure that the enabled status of the paste command, and therefore the button, is updated at the right time, which is described below. command updaters a command updater is a feature of the commandset element which allows it to update commands when certain events happen. you will need to think about when a command is valid and when it is not. in addition, you will need to consider when the state could change and when the commands should be updated. for example, the paste command is v...
...d to think about when a command is valid and when it is not. in addition, you will need to consider when the state could change and when the commands should be updated. for example, the paste command is valid when a textbox has the focus and there is something on the clipboard to paste. the command will become enabled whenever a textbox is focused and when the clipboard contents change. a command updater will listen for these situations and code can be executed which enables and disables commands as necessary. ...
...And 9 more matches
How to build custom form controls - Learn web development
iscussion of solving this issue for all scenarios would require a book). just remember, it is vital make your script generic and reusable. in our example, if our javascript code isn't running, we'll fall back to displaying a standard <select> element. we include our control and the <select>; which one is displayed depends on the class of the body element, with the class of the body element being updated by the script that makes the control function, when it loads successfully to achieve this, we need two things: first, we need to add a regular <select> element before each instance of our custom control. there is a benefit to having this "extra" select even if our javascript works as hoped: we will use this select to send data from our custom control along with the rest of our form data. we wi...
.... // we deactivate the control deactivateselect(select); }); // loose focus if the user hits `esc` select.addeventlistener('keyup', function (event) { // deactive on keyup of `esc` if (event.keycode === 27) { deactivateselect(select); } }); }); at that point, our control will change state according to our design, but its value doesn't get updated yet. we'll handle that next. live example check out the source code handling the control's value now that our control is working, we have to add code to update its value according to user input and make it possible to send the value along with form data. the easiest way to do this is to use a native control under the hood. such a control will keep track ...
...of the value with all the built-in controls provided by the browser, and the value will be sent as usual when a form is submitted. there's no point in reinventing the wheel when we can have all this done for us. ...
...And 9 more matches
Adding a new todo form: Vue events, methods, and models - Learn web development
ture. for installation, and to use some of the more advanced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed. objective: to learn about handling forms in vue, and by association, events, models, and methods. creating a new to-do form we now have an app that displays a list of to-do items. however, we can't update our list of items without manually changing our code! let's fix that. let's create a new component that will allow us to add a new to-do item. in your components folder, create a new file called todoform.vue. add a blank <template> and a <script> tag like before: <template></template> <script> export default {}; </script> let's add in an html form that lets you enter a new...
...that will allow us to add a new to-do item. in your components folder, create a new file called todoform.vue. add a blank <template> and a <script> tag like before: <template></template> <script> export default {}; </script> let's add in an html form that lets you enter a new todo item and submit it into the app. we need a <form> with a <label>, an <input>, and a <button>. ...
...e of a new todo item (which will become a label for the corresponding todoitem when it is eventually rendered). let's load this component into our app. ...
...And 9 more matches
Desktop gamepad controls - Game development
fo and the pressed buttons: var controller = {}; var buttonspressed = []; function gamepadhandler(e) { controller = e.gamepad; output.innerhtml = "gamepad: " + controller.id; } the second line in the gamepadhandler function shows up on the screen when the device is connected: we can also show the id of the device — in the case above we're using the xbox 360 wireless controller. ...
...innerhtml = "gamepad: " + controller.id; } the second line in the gamepadhandler function shows up on the screen when the device is connected: we can also show the id of the device — in the case above we're using the xbox 360 wireless controller. to update the state of the gamepad's currently pressed 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. then, if the buttons are availabl...
... if(buttonspressed[i] == button) { press = true; } } return press; } the function takes a button as a parameter; in the loop it checks if the given button's number is among the currently pressed buttons available in the buttonspressed array. if it is, then the function returns true; false otherwise. ...
...And 8 more matches
Advanced text formatting - Learn web development
l { margin: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); const output = document.queryselector('.output'); const code = textarea.value; const userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution...
...) { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solution'; } updatecode(); }); const htmlsolution = '<dl>\n <dt>bacon</dt>\n <dd>the glue that binds the world together.</dd>\n <dt>eggs</dt>\n <dd>the glue that binds the cake together.</dd>\n <dt>coffee</dt>\n <dd>the drink that gets the world running in the morning.</dd>\n <dd>a light brown color.</dd>\n</dl>'; const solutionentry = htmlsolution; textarea.addeventlistener('input', updatecode); window.addeventli...
...nst htmlsolution = '<dl>\n <dt>bacon</dt>\n <dd>the glue that binds the world together.</dd>\n <dt>eggs</dt>\n <dd>the glue that binds the cake together.</dd>\n <dt>coffee</dt>\n <dd>the drink that gets the world running in the morning.</dd>\n <dd>a light brown color.</dd>\n</dl>'; const solutionentry = htmlsolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; const caretpos = textarea.selectionstart; const fr...
...And 8 more matches
Fetching data from the server - Learn web development
previous overview: client-side web apis next another very common task in modern websites and applications is retrieving individual data items from the server to update sections of a webpage without having to load an entire new page. this seemingly small detail has had a huge impact on the performance and behavior of sites, so in this article, we'll explain the concept and look at technologies that make it possible, such as xmlhttprequest and the fetch api. prerequisites: javascript basics (see first steps, building blocks, javascript objects), the basics of client-side apis objective: to learn how to fetch data from the server and use it to update the contents of a web page. what is the problem here? originally page loading on the web was simple — you...
...this is extremely wasteful and results in a poor user experience, especially as pages get larger and more complex. ...
...eload the entire page. let's think about the significance of this: go to one of your favorite information-rich sites, like amazon, youtube, cnn, etc., and load it. now search for something, like a new product. the main content will change, but most of the surrounding information, like the header, footer, navigation menu, etc., will stay the same. this is a really good thing because: page updates are a lot quicker and you don't have to wait for the page to refresh, meaning that the site feels faster and more responsive. less data is downloaded on each update, meaning less wasted bandwidth. this may not be such a big issue on a desktop on a broadband connection, but it's a major issue on mobile devices and in developing countries that don't have ubiquitous fast internet service. to spe...
...And 8 more matches
Index
pplication, you are able to register your own implementation of an http request callback interface, and nss can use your application code that supports proxies. when using hashing, encryption, and decryption functions, it is possible to stream data (as opposed to operating on a large buffer). create a context handle while providing all the parameters required for the operation, then call an “update” function multiple times to pass subsets of the input to nss. the data will be processed and either returned directly or sent to a callback function registered in the context. when done, you call a finalization function that will flush out any pending data and free the resources. this line is a placeholder for future sections that should explain how libpkix works and is designed. if you w...
... release for nss 3.20. the bug fixes in nss 3.20.1 are described in the "security advisories" section below. 73 nss 3.20.2 release notes network security services (nss) 3.20.2 is a security patch release for nss 3.20. the bug fixes in nss 3.20.2 are described in the "security fixes" section below. 74 nss 3.21 release notes 2016-01-07, this page has been updated to include additional information about the release. the sections "security fixes" and "acknowledgements" have been added. 75 nss 3.21.1 release notes network security services (nss) 3.21.1 is a security patch release for nss 3.21. the bug fixes in nss 3.21.1 are described in the "security fixes" section below. 76 nss 3.21.2 release notes network secur...
... this document describes the data formats used by nss 3.x for installing certificates. this document is currently being revised and has not yet been reviewed for accuracy. 162 nss code coverage nss no summary! 163 nss config options no summary! 164 nss developer tutorial nss, tutorial no summary! 165 nss faq nss, needsupdate nss is set of libraries, apis, utilities, and documentation designed to support cross-platform development of security-enabled client and server applications. it provides a complete open-source implementation of the crypto libraries used by mozilla and other companies in the firefox browser, aol instant messenger (aim), server products from red hat, and other products. 166 nss ke...
...And 8 more matches
nsICRLManager
security/manager/ssl/public/nsicrlmanager.idlscriptable please add a summary to this article. ...
... security/manager/ssl/public/nsicrlmanager.idlscriptable please add a summary to this article. ...
... gecko 1.7 method overview wstring computenextautoupdatetime(in nsicrlinfo info, in unsigned long autoupdatetype, in double noofdays); void deletecrl(in unsigned long crlindex); nsiarray getcrls(); void importcrl([array, size_is(length)] in octet data, in unsigned long length, in nsiuri uri, in unsigned long type, in boolean dosilentdownload, in wstring crlkey); void reschedulecrlautoupdate(); boolean updatecrlfromurl(in wstring url, in wstring key); constants constant value description type_autoupdate_time_based 1 type_autoupdate_freq_based 2 methods computenextautoupdatetime() wstring computenextautoupdatetime( in nsicrlinfo info, in unsigned long autoupdatetype, in double noofdays ); parameters info autoupdatetype noofdays return value deletecrl() ...
...And 8 more matches
Microsummary XML grammar reference - Archive of obsolete content
from the web via nssidebar::addmicrosummarygenerator are identified by the remote url from which they were downloaded, and firefox ignores the value of this attribute for them. child elements: <template> (required) defines how to transform pages into their microsummaries. <pages> (required) identifies the set of pages that the generator is able to summarize. <update> (optional) specifies how frequently firefox should update the microsummaries. the <template> element the <template> element contains the xslt stylesheet which transforms web pages into their microsummaries. attributes: none. child elements: <stylesheet> or <transform> (required) the xslt stylesheet which performs the transformation. per xslt, you may specify the styleshee...
...formation about the use of this element, see the entry for #the_<pages>_element. the <exclude> element the <exclude> element identifies a set of pages that the generator is not able to summarize. it must be a child of the <pages> element, and it must contain a javascript-compatible regular expression. for more information about the use of this element, see the entry for #the_<pages>_element. the <update> element the optional <update> element specifies how frequently firefox should update microsummaries generated by the generator. the element can be used to specify both an absolute update interval and a series of conditional intervals based on the content of the page being summarized. attributes: interval (optional) an absolute interval of time, in minutes, that must elapse between...
... the interval attribute defines an absolute interval in minutes. its value must be a number greater than or equal to 1. fractional values (e.g. ...
...And 7 more matches
Looping code - Learn web development
the loop, which means that you can complete a whole load of tasks that are similar but slightly different — if you've got a lot of different calculations to do, you want to do each different one, not the same one over and over again! let's look at an example to perfectly illustrate why loops are such a good thing. ...
...head> <meta charset="utf-8"> <title>random canvas circles</title> <style> html { width: 100%; height: inherit; background: #ddd; } canvas { display: block; } body { margin: 0; } button { position: absolute; top: 5px; left: 5px; } </style> </head> <body> <button>update</button> <canvas></canvas> <script> const btn = document.queryselector('button'); const canvas = document.queryselector('canvas'); const ctx = canvas.getcontext('2d'); let width = document.documentelement.clientwidth; let height = document.documentelement.clientheight; canvas.width = width; canvas.height = height; function random(number) { return ...
...sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); let code = textarea.value; let userentry = textarea.value; function updatecode() { eval(textarea.value); } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = jssolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { ...
...And 7 more matches
AddonManager
moveaddonlistener(in addonlistener listener) void addtypelistener(in typelistener listener) void removetypelistener(in typelistener listener) nsiuri geturiforresourceinfile(in nsifile afile, in string apath) properties overview attribute type description addontypes dictionary a dictionary that maps type id to addontype. autoupdatedefault boolean whether add-ons should auto-update by default (overrideable per add-on). corresponds to the extensions.autoupdatedefault preference. callbacks installcallback() a callback that is passed a single addoninstall void installcallback( in addoninstall install ) parameters install the addoninstall passed back from the asynchronous request installlistcallback() a...
...stcallback( in addon addons[] ) parameters addons the array of addons passed back from the asynchronous request constants addoninstall states constant description state_available an install that is waiting to be started. state_downloading an install that is in the process of being downloaded. state_checking an install that is checking for updated information. state_downloaded an install that has finished downloading and is ready to install. state_download_failed an install that failed to download. state_installing an install that is in the process of being installed. state_installed an install that has successfully been installed. state_install_failed an install that has failed ...
... constant description error_network_failure a network error occurred. error_incorrect_hash the downloaded file did not match the expected hash. error_corrupt_file the file appears to be corrupt. error_file_access there was an error accessing the filesystem. error_signedstate_required the addon must be signed and isn't. ...
...And 7 more matches
nsICryptoHash
rithms supported are md2, md5, sha-1, sha-256, sha-384, and sha-512. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview acstring finish(in prbool aascii); void init(in unsigned long aalgorithm); void initwithstring(in acstring aalgorithm); void update([const, array, size_is(alen)] in octet adata, in unsigned long alen); void updatefromstream(in nsiinputstream astream, in unsigned long alen); constants hash algorithms these constants are used by the init() method to indicate which hashing function to use. the values map directly onto the values defined in mozilla/security/nss/lib/cryptohi/hasht.h. constant value ...
... times with different algorithm types. note: this method or " .. manch("init") .. " must be called before any other method on this interface is called. void initwithstring( in acstring aalgorithm ); parameters aalgorithm the hash algorithm type to be used as a string, such as "sha256". exceptions thrown ns_error_invalid_arg indicates that an unsupported algorithm type was passed update() adds an array of data to be hashed to the object. see computing the hash of a string for an example of using this method. void update( [const, array, size_is(alen)] in octet adata, in unsigned long alen ); parameters adata a buffer to calculate the hash over. alen the length of the buffer adata. exceptions thrown ns_error_not_initialized indicates that init() or initwithstri...
... be hashed to the object. see computing the hash of a string for an example of using this method. void update( [const, array, size_is(alen)] in octet adata, in unsigned long alen ); parameters adata a buffer to calculate the hash over. alen the length of the buffer adata. exceptions thrown ns_error_not_initialized indicates that init() or initwithstring() has not been called. updatefromstream() calculates and updates a new hash based on a given data stream (nsiinputstream). see computing the hash of a file for an example of using this method. void updatefromstream( in nsiinputstream astream, in unsigned long alen ); parameters astream an input stream to read from. alen how much to read from the given astream. passing pr_uint32_max indicates that all data availa...
...And 7 more matches
SVG documentation index - SVG: Scalable Vector Graphics
Web › SVG › Index
ll the attributes that can be specified on some svg elements to control whether or not the element on which it appears should be rendered. 15 svg core attributes attribute, intermediate, reference, svg the svg core attributes are all the common attributes that can be specified on any svg element. 16 svg event attributes advanced, attribute, draft, landing, needsupdate, svg event attributes always have their name starting with "on" followed by the name of the event for which they are intended. they specifies some script to run when the event of the given type is dispatched to the element on which the attributes are specified. 17 svg presentation attributes attribute, beginner, draft, reference, svg svg presentation attributes are css ...
...initial coordinate system, the positive z-axis comes out towards the person viewing the content and assuming that one unit along the z-axis equals one unit in x and y. 269 zoomandpan deprecated, svg, svg attribute the zoomandpan attribute specifies whether the svg document can be magnified and panned. 270 svg tutorial intermediate, needscontent, needshelp, needsupdate, svg, svg:tutorial scalable vector graphics, svg, is a w3c xml dialect to mark up graphics. it is partially implemented in firefox, opera, webkit browsers, internet explorer and other browsers. 271 basic transformations intermediate, svg, svg:tutorial now we're ready to start distorting our beautiful images. but first, let's formally introduce the <g> element. with this...
...lter effects advanced, needscontent, svg, svg:tutorial there are situations, where basic shapes do not provide the flexibility you need to achieve a certain effect. drop shadows, to provide a popular example, cannot be created reasonably with a combination of gradients. filters are svg's mechanism to create sophisticated effects. ...
...And 7 more matches
places/bookmarks - Archive of obsolete content
create, modify, and retrieve bookmarks. usage this module exports: three constructors: bookmark, group, and separator, corresponding to the types of objects, referred to as bookmark items, in the bookmarks database in firefox two additional functions, save() to create, update, and remove bookmark items, and search() to retrieve the bookmark items that match a particular set of criteria. save() and search() are both asynchronous functions: they synchronously return a placesemitter object, which then asynchronously emits events as the operation progresses and completes. each retrieved bookmark item represents only a snapshot of state at a specific time. the module does not automatically sync up a bookmark instance with ongoing changes to that item in the database from the same add-on, ...
...ark, save } = require("sdk/places/bookmarks"); // create a new bookmark instance, unsaved let bookmark = bookmark({ title: "mozilla", url: "http://mozilla.org" }); // attempt to save the bookmark instance to the bookmarks database // and store the emitter let emitter = save(bookmark); // listen for events emitter.on("data", function (saved, inputitem) { // on a "data" event, an item has been updated, passing in the // latest snapshot from the server as `saved` (with properties // such as `updated` and `id`), as well as the initial input // item as `inputitem` console.log(saved.title === inputitem.title); // true console.log(saved !== inputitem); // true console.log(inputitem === bookmark); // true }).on("end", function (saveditems, inputitems) { // similar to "data" events, ex...
...hildren // of `group`. this will be saved implicitly. save(bookmarks).on("data", function (saved, input) { // a data event is called once for each item saved, as well // as implicit items, like `group` console.log(input === group || ~bookmarks.indexof(input)); // true }).on("end", function (saves, inputs) { // like the previous example, the "end" event returns an // array of all of our updated saves. only explicitly saved // items are returned in this array -- the `group` won't be // present here. console.log(saves[0].title); // "ran" console.log(saves[2].group.title); // "guitars" }); searching for bookmarks bookmarks can be queried with the search() function, which accepts a query object or an array of query objects, as well as a query options object. query properties are ...
...And 6 more matches
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
d control. this model is also interesting because is optimized to access contextual data instead reloading full web pages. this article discusses the concept of inner-browsing and possible approaches for its implementation. it also provides two implementation examples using the model. the first one looks like a traditional dhtml ticker application and uses hidden iframes and javascript to provide updates inside the webpage's ticker headlines section. this sample was made using iframes to illustrate a possible implementation. an implementation can also use other transport technologies such as soap-based remote procedure calls, xmlhttprequest interfaces, or dom 3 load. the second example shows a tabbed menu that dynamically loads news headlines into the current web page. this implementation uses x...
...w web technologies in the html 4.0 specification, xml 1.0, dom level 3 were explicitly created with application-like behavior and more sophisticated navigational models in mind. in the next section we will introduce inner-browsing as an extension to the traditional model. let's start defining what we mean by inner-browsing. in this model, when a request goes to the web server, the current page is updated rather than replaced. without leaving the page, the user browses new information and preserves the page's context. this new navigational method allows us to make html user interfaces behave similarly to non-web based applications such as contact management software. the basic implementation uses a resource such as the web page or the web application to control the navigation system. in other wor...
...ated way, much like a client mail app; and a stock ticker that spools the information across the web page. see the table below for a description of how applications like this exemplify inner-browsing and how they might be implemented using the inner-browsing approach. some examples: web page with ticker it is common to see web pages with a ticker element, often used to rotate news or stock quotes updates. a simple ticker element implemented in dhtml statically includes the data in the page. if the data changes, it will not update unless you reload the web page. this article includes a ticker example demonstrating that the inner-browsing model can be used to dynamically request new data from the server side and provide updates to the ticker. spell check suppose you have a web publishing system fo...
...And 6 more matches
Index - Archive of obsolete content
Archive › Mozilla › XUL › Index
y! 62 collapsed xul attributes, xul reference no summary! 63 color xul attributes, xul reference no summary! 64 colorpicker.type xul attributes, xul reference no summary! 65 cols xul attributes, xul reference no summary! 66 command xul attributes, xul reference no summary! 67 commandupdater xul attributes, xul reference no summary! 68 completedefaultindex xul attributes, xul reference no summary! 69 completeselectedindex no summary! 70 container xul attributes, xul reference no summary! 71 containment xul attributes, xul reference no summary! 72 contentcontextmenu xul attri...
...an event listener to the object for the event change. ...
...he attributes of the element (such as a broadcaster) being listened to are changed. the event handler should be placed on an observer. 986 close the close event is executed when a request has been made to close the window when the user presses the close button. 987 command the command event is executed when an element is activated. 988 commandupdate the commandupdate event is executed when a command update occurs on a <commandset>. this event would be used to update the disabled status of its commands. 989 popuphidden the popuphidden event is executed when a <menupopup>, <panel> or <tooltip> has become hidden. 990 popuphiding the popuphiding event is executed when a <menupopup>, <panel> ...
...And 6 more matches
Drawing graphics - Learn web development
hen the image has finished loading. add the following block below the previous one: image.onload = function() { ctx.drawimage(image, 50, 50); } if you load your example in the browser now, you should see the image embeded in the canvas. but there's more! what if we want to display only a part of the image, or to resize it? we can do both with the more complex version of drawimage(). update your ctx.drawimage() line like so: ctx.drawimage(image, 20, 20, 185, 175, 50, 50, 185, 175); the first parameter is the image reference, as before. parameters 2 and 3 define the coordinates of the top left corner of the area you want to cut out of the loaded image, relative to the top-left corner of the image itself. nothing to the left of the first parameter or above the second will...
...this case, we have specified the same dimensions as the original slice, but you could resize it by specifying different values. the final example should look like so: note: the finished code is available on github as 5_canvas_images.html. loops and animations we have so far covered some very basic uses of 2d canvas, but really you won't experience the full power of canvas unless you update or animate it in some way. after all, canvas does provide scriptable images! if you aren't going to change anything, then you might as well just use static images and save yourself all the work. creating a loop playing with loops in canvas is rather fun — you can run canvas commands inside a for (or other type of) loop just like any other javascript code. let's build a simple example. ...
...e defines how far we want to move each time we draw a new triangle. draw a line to a coordinate of (moveoffset+length, moveoffset). this draws a line of length length parallel to the x axis. calculate the triangle's height, as before. draw a line to the downward-pointing corner of the triangle, then draw a line back to the start of the triangle. call fill() to fill in the triangle. update the variables that describe the sequence of triangles, so we can be ready to draw the next one. we decrease the length value by 1, so the triangles get smaller each time; increase moveoffset by a small amount so each successive triangle is slightly further away, and use another new function, rotate(), which allows us to rotate the entire canvas! we rotate it by 5 degrees before drawing the next t...
...And 6 more matches
What is JavaScript? - Learn web development
css. objective: to gain familiarity with what javascript is, what it can do, and how it fits into a web site. a high-level definition javascript is a scripting or programming language that allows you to implement complex features on web pages — every time a web page does more than just sit there and display static information for you to look at — displaying timely content updates, interactive maps, animated 2d/3d graphics, scrolling video jukeboxes, etc. — you can bet that javascript is probably involved. it is the third layer of the layer cake of standard web technologies, two of which (html and css) we have covered in much more detail in other parts of the learning area. html is the markup language that we use to structure and give meaning to our web content, fo...
... so what can it really do? the core ...
... so what can it really do? the core client-side javascript ...
...And 6 more matches
Vue conditional rendering: editing existing todos - Learn web development
previous overview: client-side javascript frameworks next now it is time to add one of the major parts of functionality that we're still missing — the ability to edit existing todo items. to do this, we will take advantage of vue's conditional rendering capabilities — namely v-if and v-else — to allow us to toggle between the existing todo item view, and an edit view where you can update todo item labels. we'll also look at adding functionality to delete todo items. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line. vue components are written as a combination of javascript objects that manage the app's data and an html-based template syntax that maps to the underlying dom structure. for inst...
...ked, the component signals this by emitting an edit-cancelled event. modifying our todoitem component before we can add todoitemeditform to our app, we need to make a few modifications to our todoitem component. specifically, we need to add a variable to track if the item is being edited, and a button to toggle that variable. we’ll also add a delete button since deletion is closely related. update your todoitem’s template as shown below. <template> <div class="stack-small"> <div class="custom-checkbox"> <input type="checkbox" class="checkbox" :id="id" :checked="isdone" @change="$emit('checkbox-changed')" /> <label :for="id" class="checkbox-label">{{label}}</label> </div> <div class="btn-group"> <button type="button" class="btn" @click="toggl...
...r todo item, via an event handler function called toggletoitemeditform(). this handler will set an isediting flag to true. to do that, we'll need to first define it inside our data() property. the "delete" button, when clicked, will delete the todo item via an event handler function called deletetodo(). in this handler we’ll emit an item-deleted event to our parent component so the list can be updated. let's define our click handlers, and the necessary isediting flag. add isediting below your existing isdone data point: data() { return { isdone: this.done, isediting: false }; } now add your methods inside a methods property, right below your data() property: methods: { deletetodo() { this.$emit('item-deleted'); }, toggletoitemeditform() { this.isediti...
...And 6 more matches
Setting up your own test automation environment - Learn web development
ators embedded in the docs. see run tests on mobile browsers and run tests on desktop browsers. filling in browserstack test details programmatically you can use the browserstack rest api and some other capabilities to annotate your test with more details, such as whether it passed, why it passed, what project the test is part of, etc. ...
...ed, why it passed, what project the test is part of, etc. browserstack doesn't know these details by default! ...
...roject' : 'google test 2' next we need to access the sessionid of the current session, so we know where to send the request (the id is included in the request url, as you'll see later). include the following lines just below the block that creates the driver object (let driver ...) : let sessionid; driver.session_.then(function(sessiondata) { sessionid = sessiondata.id_; }); finally, update the driver.sleep(2000) ... block near the bottom of the code to add rest api calls (again, replace the your-user-name and your-access-key placeholders in the code with your actual user name and access key values): driver.sleep(2000).then(function() { driver.gettitle().then(function(title) { if(title === 'webdriver - google search') { console.log('test passed'); request({uri: "...
...And 6 more matches
Addon
s are considered "required" and others "optional," which means that the optional methods or property may not exist on addon instances for some types of add-ons. api consumers should take care to verify the existence of these methods or properties before relying on them. ...
...dered "required" and others "optional," which means that the optional methods or property may not exist on addon instances for some types of add-ons. api consumers should take care to verify the existence of these methods or properties before relying on them. ...
...h them. permissions read only integer a bitfield holding all the the operations that can be performed on this add-on. operations my be restricted based on system policies (e.g., the system administrator may not allow certain add-ons to be uninstalled), add-on type (e.g., themes may not be disabled), or add-on state (e.g., an incompatible add-on cannot be enabled). providesupdatessecurely read only boolean true if the add-on has a secure means of updating or cannot be updated at all. scope read only integer indicates what scope the add-on is installed in, per profile, user, system, or application. type read only string the type of the add-on. userdisabled boolean true if the user wants this add-on to be disabled. ...
...And 6 more matches
CustomizableUI.jsm
ent and isn't invisible), the binding will call into customizableui and register the toolbar's node as being one of the concrete instances of its area. for each area, customizableui keeps track of a list of the widgets they contain, generally refered to as 'placements'. this is analogous to the old currentset attribute. if consumers make a change to the placements in an area, customizableui will update the actual nodes in each area instance for them. toolbars generally function the same way they always have. however, they can now be 'overflowable', that is, if there are too many widgets to fit in the toolbar's horizontal space, the excess widgets will be placed in a panel accessible from an anchor (chevron) in the toolbar. in order to register such a toolbar, set the 'overflowable' property to...
...d areason indicates whether the area as a whole was unregistered (reason_area_unregistered), or whether a window closed (reason_window_closed). onareanoderegistered(aarea, anode) fired after an area node is first built when it is registered. this is often when the window has opened, but in the case of add-ons, could fire when the node has just been registered with customizableui after an add-on update or disable/enable sequence. onwidgetcreated(awidgetid) fired when a widget with id awidgetid has been created, but before it is added to any placements or any dom nodes have been constructed. only fired for api-based widgets. onwidgetaftercreation(awidgetid, aarea) fired after a widget with id awidgetid has been created, and has been added to either its default area or the area in which it wa...
...rnode(atoolbar, aexistingchildren); void registermenupanel(apanel); void unregisterarea(aareaid, adestroyplacements); void addwidgettoarea(awidgetid, aareaid, [optional] aposition); void removewidgetfromarea(awidgetid); void movewidgetwithinarea(awidgetid, aposition); void ensurewidgetplacedinwindow(awidgetid, awindow); void beginbatchupdate(); void endbatchupdate(aforcedirty); widgetgroupwrapper createwidget(awidgetspecification); void destroywidget(awidgetid); widgetgroupwrapper getwidget(awidgetid); array getunusedwidgets(awindow); array getwidgetidsinarea(aareaid); array getwidgetsinarea(aareaid); string getareatype(aareaid); domelement getcustomizet...
...And 6 more matches
Mozilla Development Strategies
this article offers some strategies and suggestions to help developers stay productive. warning: the content of this article may be out of date. it has not been updated for usage of mercurial (instead of cvs). work on the most important bugs first everyone likes to check in. but keep in mind that your checkin rate isn't everything. it's better to fix one data loss bug, crasher, or performance bug that really affects the user than edge case bugs that are rarely seen or minor bugs. make sure documentation gets updated if the bug you're fixing is likely to require an update to developer documentation once it's fixed, be sure to add the dev-doc-needed keyword to the bug (or ask someone to do it, if you don't have editbugs privileges on bugzilla). this puts the bug on the radar of ...
...if you don't mark the bug, your work might go unnoticed by the docs team! of course, our documentation is a wiki; you can really help by updating the documentation yourself. even if you're not comfortable with your writing skills, keep in mind that our helpful, happy documentation gnomes will follow along behind you and clean up for you. ...
... you appreciate anyone who finds a bug in your code. appreciate it even more if they find it before you ship. they're giving you a second chance to get it right before it becomes a bug that affects users. minimize how you are affected by regressions unless you are the type to go out and tackle daily regressions, you need to find a way to not let them affect you. ...
...And 6 more matches
nsINavBookmarksService
ey 2.11) implemented by: @mozilla.org/browser/nav-bookmarks-service;1. ...
...obsolete since gecko 1.9 void getbookmarkidsforuri(in nsiuri auri, [optional] out unsigned long count, [array, retval, size_is(c...
...ill keep an owning reference to the observer. if ownsweak is true, then aobserver must implement nsisupportsweakreference, and the bookmark service will keep a weak reference to the observer. void addobserver( in nsinavbookmarkobserver observer, in boolean ownsweak ); parameters observer the bookmark observer to be added. ownsweak the owning reference state (boolean). ...
...And 6 more matches
Using the application cache - HTML: Hypertext Markup Language
er has allowed to use offline capabilities. loading documents the use of an application cache modifies the normal process of loading a document: if an application cache exists, the browser loads the document and its associated resources directly from the cache, without accessing the network. this speeds up the document load time. the browser then checks to see if the cache manifest has been updated on the server. if the cache manifest has been updated, the browser downloads a new version of the manifest and the resources listed in the manifest. this is done in the background and does not affect performance significantly. the process for loading documents and updating the application cache is specified in greater detail below: when the browser visits a document that includes the manif...
...t document cause the browser to load the document and other assets specified in the manifest file from the application cache (not from the server). in addition, the browser also sends a checking event to the window.applicationcache object, and fetches the manifest file, following the appropriate http caching rules. if the currently-cached copy of the manifest is up-to-date, the browser sends a noupdate event to the applicationcache object, and the update process is complete. note that if you change any cached resources on the server, you must also change the manifest file itself, so that the browser knows it needs to fetch all the resources again. if the manifest file has changed, all the files listed in the manifest—as well as those added to the cache by calling applicationcache.add()—are...
... manifest file has changed, all the files listed in the manifest—as well as those added to the cache by calling applicationcache.add()—are fetched into a temporary cache, following the appropriate http caching rules. for each file fetched into this temporary cache, the browser sends a progress event to the applicationcache object. if any errors occur, the browser sends an error event, and the update halts. once all the files have been successfully retrieved, they are moved into the real offline cache automatically, and a cached event is sent to the applicationcache object. since the document has already been loaded into the browser from the cache, the updated document will not be rendered until the document is reloaded (either manually or programatically). storage location and clearing th...
...And 6 more matches
ui/button/toggle - Archive of obsolete content
/firefox-32.png" }, onchange: function(state) { console.log(state.label + " checked state: " + state.checked); } }); by default, the button appears in the firefox toolbar: however, users can move it to the firefox menu panel: badged buttons new in firefox 36. you can add a "badge" to a button using its badge property. this can contain a number or a string, and you can update it at any time. by default the badge's color is red, but you can set your own color using the badgecolor property, specified as a css <color> value: var { togglebutton } = require("sdk/ui/button/toggle"); var button = togglebutton({ id: "my-button1", label: "my button1", icon: "./icon-16.png", onchange: changed, badge: 0, badgecolor: "#00aaaa" }); function changed(sta...
...hide }); function handlechange(state) { if (state.checked) { panel.show({ position: button }); } } function handlehide() { button.state('window', {checked: false}); } disabling buttons you can disable a button by setting its disabled property to true. a disabled button will not generate click or change events and its icon will appear disabled: updating state you can update all the button's properties, except for its id. depending on your application, you might want a button to have different state in different browser windows or different tabs. for example, you might want to give it a different appearance when the current page is being served over https. the button api handles this by defining a tree of potential states. at the root is the global state, then there...
...abel"; you can set state to be specific to a window or tab using the button's state() method. to set state like this, call state() with 2 parameters: the first parameter is a window or tab object or as a shorthand, the string "window" for the currently active window, or the string "tab" for the currently active tab the second parameter is an object containing the state properties you wish to update. here's an add-on with a button that disables itself when you click it, but only for the currently active window: var { togglebutton } = require("sdk/ui/button/toggle"); var button = togglebutton({ id: "my-button", label: "my button", icon: { "16": "./firefox-16.png", "32": "./firefox-32.png" }, onclick: disableforthiswindow }); function disableforthiswindow...
...And 5 more matches
How to convert an overlay extension to restartless - Archive of obsolete content
eferences if you want to keep your preference file in defaults/preferences/, the approach above only works as long as your extension is unpacked. for packed extensions (the default), you can either load a module similar to firebug’s prefloader.js or load this workaround module (n.b. as of may 29, 2017, that module does not work with packed extensions; i'm preserving the link in case the author updates the gist to fix this issue). step 5: no more internal jar files you know how i've been mentioning extractionless add-ons every once in a while thus far? well, you should probably consider switching to be extractionless when you go restartless. an old-style add-on installer is packaged something like this: myaddon.xpi file (glorified zip) └─ chrome.manifest └─ install.rdf └─ chrome...
...single jar file made all your stuff load in one file read, which was faster. extractionless xpis are bascially a standardization of this idea. xpi files are glorified zips, and zip compression is horrible. doing anuncompressed internal jar (aka, another zip) acts like a poor-man's solid archive and significantly boosts the overall compression ratio of the xpi, resulting in smaller installers and updates. so, it's pretty much internal jaror extractionless xpi. well, you can't use an internal jar anymore. firefox aggressively caches add-on data a bit too much. your restartless add-on won't actually reload some types of files if they are in a jar and the add-on is updated without a restart. the big culprits are jsm files and locale files (namely property files), though in some situations this is...
...on == app_shutdown) return; foreachopenwindow(unloadfromwindow); services.wm.removelistener(windowlistener); mymodule.shutdown(); // do whatever shutdown stuff you need to do on addon disable components.utils.unload("chrome://myaddon/content/mymodule.jsm"); // same url as above // hack warning: the addon manager does not properly clear all addon related caches on update; // in order to fully update images and locales, their caches need clearing here services.obs.notifyobservers(null, "chrome-flush-caches", null); } function install(data,reason) { } function uninstall(data,reason) { } function loadintowindow(window) { /* call/move your ui construction function here */ } function unloadfromwindow(window) { /* call/move your ui tear down funct...
...And 5 more matches
Implementing controls using the Gamepad API - Game development
connected. ...
...an array of gamepadbutton objects containing pressed and value properties. the index variable is useful if we're connecting more than one controller and want to identify them to act accordingly — for example when we have a two-player game requiring two devices to be connected. ...
...cts containing pressed and value properties. the index variable is useful if we're connecting more than one controller and want to identify them to act accordingly — for example when we have a two-player game requiring two devices to be connected. querying the gamepad object beside connect() and disconnect(), there are two more methods in the gamepadapi object: update() and buttonpressed(). ...
...And 5 more matches
Images in HTML - Learn web development
.a11y-label { margin: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var solution = document.getelementbyid('solution'); var output = document.queryselector('.output'); var code = textarea.value; var userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution...
...) { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solution'; } updatecode(); }); var htmlsolution = '<img src="https://udn.realityripple.com/samples/ec/5a13bd14f6.jpg"\n alt="the head and torso of a dinosaur skeleton; it has a large head with long sharp teeth"\n width="200"\n height="171"\n title="a t-rex on display in the manchester university museum">'; var solutionentry = htmlsolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('lo...
...); }); var htmlsolution = '<img src="https://udn.realityripple.com/samples/ec/5a13bd14f6.jpg"\n alt="the head and torso of a dinosaur skeleton; it has a large head with long sharp teeth"\n width="200"\n height="171"\n title="a t-rex on display in the manchester university museum">'; var solutionentry = htmlsolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { var scrollpos = textarea.scrolltop; var caretpos = textarea.selectionstart; var front = ...
...And 5 more matches
Arrays - Learn web development
otal.tofixed(2); </textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"> <input id="solution" type="button" value="show solution"> </div> const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); let code = textarea.value; let userentry = textarea.value; function updatecode() { eval(textarea.value); } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = jssolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { ...
...n() { textarea.value = code; userentry = textarea.value; solutionentry = jssolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solution'; } updatecode(); }); const jssolution = 'const list = document.queryselector(\'.output ul\');\nconst totalbox = document.queryselector(\'.output p\');\nlet total = 0;\nlist.innerhtml = \'\';\ntotalbox.textcontent = \'\';\n\nlet products = [\'underpants:6.99\',\n \'socks:5.99\',\n \'t-shirt:14.99\',\n \'trousers:31.99\',\n \'shoes:23.99\'];\n\nfor(let i = 0; i < products.length; i++) {\n let subarray ...
...ucts[i].split(\':\');\n let name = subarray[0];\n let price = number(subarray[1]);\n total += price;\n let itemtext = name + \' — $\' + price;\n\n let listitem = document.createelement(\'li\');\n listitem.textcontent = itemtext;\n list.appendchild(listitem);\n}\n\ntotalbox.textcontent = \'total: $\' + total.tofixed(2);'; let solutionentry = jssolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; const c...
...And 5 more matches
React interactivity: Editing, filtering, conditional rendering - Learn web development
filtering and an editing ui in our app. editing the name of a task we don’t have a user interface for editing the name of a task yet. we'll get to that in a moment. to start with, we can at least implement an edittask() function in app.js. it’ll be similar to deletetask() because it'll take an id to find its target object, but it'll also take a newname property containing the name to update the task to. we'll use array.prototype.map() instead of array.prototype.filter() because we want to return a new array with some changes, instead of deleting something from the array. add the edittask() function inside your app component, in the same place as the other functions: function edittask(id, newname) { const editedtasklist = tasks.map(task => { // if this task has the same id as t...
...default isediting state from false to true in your code for now; we will look at making the edit button toggle this in the next section! toggling the <todo /> templates at long last, we are ready to make our final core feature interactive. to start with, we want to call setediting() with a value of true when a user presses the "edit" button in our viewtemplate, so that we can switch templates. ...
...n switch templates. update the "edit" button in the viewtemplate like so: <button type="button" classname="btn" onclick={() => setediting(true)}> edit <span classname="visually-hidden">{props.name}</span> </button> now we'll add the same onclick handler to the "cancel" button in the editingtemplate, but this time we'll set isediting to false so that it switches us back to the view template. update the "cancel" button in the edittemplate like so: <button type="button" classname="btn todo-cancel" onclick={() => setediting(false)} > cancel <span classname="visually-hidden">renaming {props.name}</span> </button> with this code in place, you should be able to press the "edit" and "cancel" buttons in your todo items to toggle between templates. the next step is to actually make ...
...And 5 more matches
FIPS mode of operation
fc_login fc_logout object management functions these functions manage certificates and keys. fc_createobject fc_copyobject fc_destroyobject fc_getobjectsize fc_getattributevalue fc_setattributevalue fc_findobjectsinit fc_findobjects fc_findobjectsfinal encryption functions these functions support triple des and aes in ecb and cbc modes. ...
..._getobjectsize fc_getattributevalue fc_setattributevalue fc_findobjectsinit fc_findobjects fc_findobjectsfinal encryption functions these functions support triple des and aes in ecb and cbc modes. fc_encryptinit fc_encrypt fc_encryptupdate fc_encryptfinal decryption functions these functions support triple des and aes in ecb and cbc modes. fc_decryptinit fc_decrypt fc_decryptupdate fc_decryptfinal message digesting functions these functions support sha-1, sha-256, sha-384, and sha-512. ...
... support triple des and aes in ecb and cbc modes. fc_encryptinit fc_encrypt fc_encryptupdate fc_encryptfinal decryption functions these functions support triple des and aes in ecb and cbc modes. fc_decryptinit fc_decrypt fc_decryptupdate fc_decryptfinal message digesting functions these functions support sha-1, sha-256, sha-384, and sha-512. fc_digestinit fc_digest fc_digestupdate fc_digestkey fc_digestfinal signature and mac generation functions these functions support dsa, rsa, ecdsa, and hmac. fc_signinit fc_sign fc_signupdate fc_signfinal fc_signrecoverinit fc_signrecover signature and mac verification functions these functions support dsa, rsa, ecdsa, and hmac. ...
...And 5 more matches
Utility functions
hash_gethashtypebyoidtag mxr 3.8 and later hash_gettype mxr 3.12 and later hash_hashbuf mxr 3.10 and later hash_resultlen mxr 3.4 and later hash_resultlenbyoidtag mxr 3.10 and later hash_resultlencontext mxr 3.10 and later hash_update mxr 3.4 and later nss_init mxr 3.2 and later nss_initialize mxr 3.2 and later nss_initreadwrite mxr 3.2 and later nss_initwithmerge mxr 3.12 and later nss_isinitialized mxr 3.9.2 and later nss_nodb_init mxr 3.2 and late...
...r 3.2 and later nss_unregistershutdown mxr 3.11.1 and later nss_versioncheck mxr 3.2 and later nssbase64_decodebuffer mxr 3.4 and later nssbase64decoder_create mxr 3.2 and later nssbase64decoder_destroy mxr 3.2 and later nssbase64decoder_update mxr 3.2 and later nssbase64_encodeitem mxr 3.4 and later nssbase64encoder_create mxr 3.2 and later nssbase64encoder_destroy mxr 3.2 and later nssbase64encoder_update mxr 3.2 and later nssrwlock_destroy mxr 3.2 and later nssrwlock_h...
... later sec_asn1decoderclearnotifyproc mxr 3.2 and later sec_asn1decoderfinish mxr 3.2 and later sec_asn1decodersetfilterproc mxr 3.2 and later sec_asn1decodersetnotifyproc mxr 3.2 and later sec_asn1decoderstart mxr 3.2 and later sec_asn1decoderupdate mxr 3.2 and later sec_asn1encode mxr 3.2 and later sec_asn1encodeinteger mxr 3.2 and later sec_asn1encodeitem mxr 3.2 and later sec_asn1encoderabort mxr 3.9 and later sec_asn1encoderclearnotifyproc mxr 3.2 and later sec_asn1encoder...
...And 5 more matches
Places Developer Guide
the bookmarks service: removeitem(aitemid) - works for all types removefolder(aitemid) - works for folders and livemarks removefolderchildren(aitemid) - works for folders and livemarks observing bookmark events the nsinavbookmarkobserver interface is used for observing bookmarks activity such as item additions, changes and deletions. ...
...ildren(aitemid) - works for folders and livemarks observing bookmark events the nsinavbookmarkobserver interface is used for observing bookmarks activity such as item additions, changes and deletions. // create a bookmark observer var observer = { onbeginupdatebatch: function() { // this method is notified when a batch of changes are about to occur. // observers can use this to suspend updates to the user-interface, for example // while a batch change is occurring. ...
...server interface is used for observing bookmarks activity such as item additions, changes and deletions. // create a bookmark observer var observer = { onbeginupdatebatch: function() { // this method is notified when a batch of changes are about to occur. // observers can use this to suspend updates to the user-interface, for example // while a batch change is occurring. }, onendupdatebatch: function() { this._inbatch = false; }, onitemadded: function(id, folder, index) { }, onitemremoved: function(id, folder, index) { }, onitemchanged: function(id, property, isannotationproperty, value) { // isannotationproperty is a boolean value that is true of the changed property is an annotation. // you can access a bookmark item's annotations with the <code>nsiann...
...And 5 more matches
nsIDOMWindowUtils
boolean dispatchdomeventviapresshell(in nsidomnode atarget, in nsidomevent aevent, in boolean atrusted); nsidomelement elementfrompoint(in float ax, in float ay, in boolean aignorerootscrollframe, in boolean aflushlayout); void entermodalstate(); nsidomelement findelementwithviewid(in nsviewid aid); void focus(in nsidomelement aelement); void forceupdatenativemenuat(in astring indexstring); void garbagecollect([optional] in nsicyclecollectorlistener alistener); short getcursortype(); astring getdocumentmetadata(in astring aname); nsidomwindow getouterwindowwithid(in unsigned long long aouterwindowid); long getpccountscriptcount(); astring getpccountscriptsummary(in long ascript); ...
... void removesheet(in nsiuri sheeturi, in unsigned long type); void resumetimeouts(); voi...
...hat currently has focus, and focus the document. cannot be accessed from unprivileged context (not content-accessible) will throw a dom security error if called without universalxpconnect privileges. do not use this method. just use element.focus if available or nsifocusmanager.setfocus() instead. void focus( in nsidomelement aelement ); parameters aelement the element to focus. forceupdatenativemenuat() see nsiwidget.forceupdatenativemenuat(). cannot be accessed from unprivileged context (not content-accessible) will throw a dom security error if called without universalxpconnect privileges. void forceupdatenativemenuat( in astring indexstring ); parameters indexstring garbagecollect() force a garbage collection followed by a cycle collection. will throw a dom secu...
...And 5 more matches
Drawing and Event Handling - Plugins
igin(portx, porty) to place the upper-left corner of its rectangle at (0,0). the mac os grafport structure's cliprgn field should be set to the clipping rectangle for the instance in port coordinates. because the plug-in and the browser share the same graphics port, they share the responsibility for managing it correctly. the browser sets up the port for the plug-in before passing the plug-in an update event in two ways: the browser calls setorigin(npport->portx, npport->porty). this method makes the instance's upper-left coordinate equal to (0,0). the browser sets the port's clip region to the region of the plug-in currently visible (not scrolled off the page, obscured by floating palettes, or otherwise hidden). however, for the plug-in to draw at any other time, for example, to highligh...
...pvpluginwindowbool, (void*)false); } invalidating the drawing area before it can repaint or refresh part of its drawing area, a windowless plug-in must first invalidate the area with either of these browser methods: npn_invalidaterect or npn_invalidateregion. both methods perform the same operations: they invalidate the specified drawing area prior to repainting or refreshing. they pass an update event or a paint message to the plug-in. the browser redraws invalid areas of the document and windowless plug-ins at regularly timed intervals. to force a paint message, the plug-in can call npn_forceredraw after calling one of the invalidate methods. if a plug-in calls one of these methods, it receives a paint message asynchronously. void npn_invalidaterect(npp instance, nprect *invalidrect)...
...void npn_invalidaterect(npp instance, nprect *invalidrect); void npn_invalidateregion(npp instance, npregion invalidregion); the instance parameter represents the current plug-in. the invalidrect and invalidregion parameters represent the area to invalidate, specified in a coordinate system whose origin is at the top left of the plug-in. both methods cause the npp_handleevent method to pass an update event or a paint message to the plug-in. #ifdef xp_mac typedef rgnhandle npregion; #elif defined(xp_win) typedef hrgn npregion; #elif defined(xp_unix) typedef region npregion; #else typedef void* npregion; #endif /* xp_mac */ void npn_invalidaterect(npp instance, nprect *invalidrect); void npn_invalidateregion(npp instance, npregion invalidregion); forcing a paint message windowed an...
...And 5 more matches
Using IndexedDB - Web APIs
...
...n mode when necessary. you can concurrently run multiple readonly transactions with overlapping scopes, but you can have only one readwrite transaction for an object store. to learn more, see the definition for transactions in the basic concepts article. updating an entry in the database now we've retrieved some data, updating it and inserting it back into the indexeddb is pretty simple. ...
...ved some data, updating it and inserting it back into the indexeddb is pretty simple. let's update the previous example somewhat: var objectstore = db.transaction(["customers"], "readwrite").objectstore("customers"); var request = objectstore.get("444-44-4444"); request.onerror = function(event) { // handle errors! ...
...And 5 more matches
MediaDevices.ondevicechange - Web APIs
the mediadevices.ondevicechange property is an eventhandler which specifies a function to be called when the devicechange event occurs on a mediadevices instance. this happens whenever the set of media devices available to the user agent and, by extension, to the web site or app has changed. you can at any time use enumeratedevices() to get the updated list of available devices. ...
...t and, by extension, to the web site or app has changed. you can at any time use enumeratedevices() to get the updated list of available devices. syntax mediadevices.ondevicechange = eventhandler; value a function you provide which accepts as input a event object describing the devicechange event that occurred. there is no information about the change included in the event object; to get the updated list of devices, you'll have to use enumeratedevices(). example in this example, we create a function called updatedevicelist(), which is called once when mediadevices.getusermedia() successfully obtains a stream, and then is called any time the device list changes. it displays in the browser window two lists: one of audio devices and one of video devices, with both the device's label (name) a...
...og(msg) { logelement.innerhtml += msg + "<br>"; } document.getelementbyid("startbutton").addeventlistener("click", function() { navigator.mediadevices.getusermedia({ video: { width: 160, height: 120, framerate: 30 }, audio: { samplerate: 44100, samplesize: 16, volume: 0.25 } }).then(stream => { videoelement.srcobject = stream; updatedevicelist(); }) .catch(err => log(err.name + ": " + err.message)); }, false); we set up global variables that contain references to the <ul> elements that are used to list the audio and video devices: let audiolist = document.getelementbyid("audiolist"); let videolist = document.getelementbyid("videolist"); getting and drawing the device list now let's take a look at updatedevicelist...
...And 5 more matches
Using the Web Animations API - Web APIs
in the above example, to make sure that alice’s color changes at 30% (not 50%) for the color change, we are giving it offset: 0.3. currently, there should be at least two keyframes specified (representing the starting and ending states of the animation sequence). if your keyframe list has only one entry, element.animate() may throw a notsupportederror exception in some browsers until they are updated. so to recap, the keys are equally spaced by default unless you specify an offset on a key. handy, no? representing timing properties we’ll also need to create an object of timing properties (an animationeffecttimingproperties object) corresponding to the values in alice’s animation: var alicetiming = { duration: 3000, iterations: infinity } you’ll notice a few differences here fr...
...the web animations api provides several useful methods for controlling playback. let’s take a look at pausing and playing animations in the growing/shrinking alice game (check out the full code on codepen): in this game, alice has an an...
...to a world where she must run to stay in place — and run twice as fast to move forward! in the red queen’s race example, alice and the red queen are running to stay in place (check out the full code on codepen): because small children tire out easily, unlike automaton chess pieces, alice is constantly slowing down. we can do this by setting a decay on her animation’s playbackrate. ...
...And 5 more matches
widget - Archive of obsolete content
} }); // a widget that changes display on mouseover. widgets.widget({ id: "mouseover-effect", label: "widget with changing image on mouseover", contenturl: "http://www.yahoo.com/favicon.ico", onmouseover: function() { this.contenturl = "http://www.bing.com/favicon.ico"; }, onmouseout: function() { this.contenturl = "http://www.yahoo.com/favicon.ico"; } }); // a widget that updates content on a timer. widgets.widget({ id: "auto-update-widget", label: "widget that updates content on a timer", content: "0", contentscript: 'settimeout(function() {' + ' document.body.innerhtml++;' + '}, 2000)', contentscriptwhen: "ready" }); // a widget created with a specified width, that grows. var mywidget = widgets.widget({ id: "widget-effect...
.... parameters window : browserwindow the browserwindow instance to match. returns widgetview : a widgetview instance associated with the browser window. any changes subsequently applied to this object will only be applied to the widget attached to that window. properties label the widget's label. read-only. content a string containing the widget's content. it can contain html. setting it updates the widget's appearance immediately. however, if the widget was created using contenturl, then this property is meaningless, and setting it has no effect. contenturl the url of content to load into the widget. this can point to local content loaded from your add-on's "data" directory or remote content, an image or web content. setting it updates the widget's appearance immediately. however, if...
...effect. setting the contenturl property will break the channel of communication between this widget and any content scripts it contains. messages sent from the content script will no longer be received by the main add-on code, and vice versa. this issue is currently tracked as bug 825434. panel a panel to open when the user clicks on the widget. width the widget's width in pixels. setting it updates the widget's appearance immediately. tooltip the text of the tooltip that appears when the user hovers over the widget. allow a object describing permissions for the content. it contains a single key named script whose value is a boolean that indicates whether or not to execute script in the content. contentscriptfile a local file url or an array of local file urls of content scripts to lo...
...And 4 more matches
cfx - Archive of obsolete content
. defaults to test-harness. cfx xpi this tool is used to package your add-on as an xpi file, which is the install file format for mozilla add-ons. called with no options, this command looks for a file called package.json in the current directory and creates the corresponding xpi file. once you have built an xpi file you can distribute your add-on by submitting it to addons.mozilla.org. ...
...test-harness. cfx xpi this tool is used to package your add-on as an xpi file, which is the install file format for mozilla add-ons. called with no options, this command looks for a file called package.json in the current directory and creates the corresponding xpi file. once you have built an xpi file you can distribute your add-on by submitting it to addons.mozilla.org. ...
...nd looks for a file called package.json in the current directory and creates the corresponding xpi file. once you have built an xpi file you can distribute your add-on by submitting it to addons.mozilla.org. updateurl and updatelink if you choose to host the xpi yourself you should enable the host application to find new versions of your add-on. to do this, include a url in the xpi called the updateurl: the host application will go here to get information about updates. ...
...And 4 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
curial.i586 0:1.2.1-1.fc11 check merge tools in [root@b008-02 ~]# vim /etc/mercurial/hgrc.d/mergetools.rc get the source comm-central [root@b008-02 moz]# time hg clone http://hg.mozilla.org/comm-central/ commsrc requesting all changes adding changesets adding manifests adding file changes added 2975 changesets with 16793 changes to 7117 files (+3 heads) updating working directory 5644 files updated, 0 files merged, 0 files removed, 0 files unresolved real 0m40.771s user 0m9.284s sys 0m1.304s [root@b008-02 commsrc]# python client.py checkout executing command: ['hg', 'pull', '-r', './.', '-r', 'tip'] pulling from http://hg.mozilla.org/comm-central/ searching for changes no changes found executing command: ['hg', 'update', '-r', 'default', '-r', './.'] 0 files updated, 0 files ...
...unresolved real 0m40.771s user 0m9.284s sys 0m1.304s [root@b008-02 commsrc]# python client.py checkout executing command: ['hg', 'pull', '-r', './.', '-r', 'tip'] pulling from http://hg.mozilla.org/comm-central/ searching for changes no changes found executing command: ['hg', 'update', '-r', 'default', '-r', './.'] 0 files updated, 0 files merged, 0 files removed, 0 files unresolved updated to revision c10119db13cad9797b05750bfe18a57261a88922. ...
...hing for changes no changes found executing command: ['hg', 'update', '-r', 'default', '-r', './.'] 0 files updated, 0 files merged, 0 files removed, 0 files unresolved updated to revision c10119db13cad9797b05750bfe18a57261a88922. executing command: ['hg', 'clone', 'http://hg.mozilla.org/releases/mozilla-1.9.1/', './mozilla'] requesting all changes adding changesets ... executing command: ['hg', 'update', '-r', 'default', '-r', './mozilla/extensions/inspector'] 0 files updated, 0 files merged, 0 files removed, 0 files unresolved updated to revision 51c6d483a4c15a657df18540219bd0201896c6f2. cvs checkout begin: 2009-06-30 10:28:31 utc executing command: ['cvs', '-d', ':pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot', '-q', 'checkout', '-p', '-r', 'ldapcsdk_6_0_6b_mozilla_rtm', '-d', 'c-sdk', 'm...
...And 4 more matches
How to Write and Land Nanojit Patches - Archive of obsolete content
eful. scenario 1: creating an internal (ie. nanojit-only) patch write the patch in whichever repository you like. for mozilla people it's probably best done in your tracemonkey repo, for adobe people it's probably best done in your tamarin-redux repo. once the patch seems ready, copy it to the other two repositories and test it. ...
...le it's probably best done in your tamarin-redux repo. once the patch seems ready, copy it to the other two repositories and test it. [njn: it's possible that the other tm/tr public repo hasn't been updated from nanojit-central sufficiently recently, in which case the patch won't apply cleanly. if the breakage is minor you'll be able to fix it by hand. if it's major you'll need to do a private update of that other repo in order to test. but don't push that update, as that should only be done by a member of that public repo.] once it passes testing, file the patch to bugzilla (file a bug under the "nanojit" component in the "core" product) and get a review. generally, patches by mozilla people should be reviewed by adobe people and vice versa. once it passes review, land it on nanojit-central...
...reakage. scenario 2: creating an external patch write and test the patch, as in scenario 1 above. split the patch into three parts: nanojit, tracemonkey, tamarin. file them all in a single bug. reviews should involve people from both mozilla and adobe. once all the patches pass review, land the nanojit patch on nanojit-central and mark the bug as fixed-in-nanojit. whoever does the next tm/tr update (scenario 3 below) will deal with the other patches. scenario 3: doing a periodic nj-to-tm/tr update this step is only done by certain people. nnethercote usually does it for mozilla, edwsmith and stejohns usually do it for adobe. note that you'd only do this for your company's tm/tr repo, ie. mozilla people for tm, and adobe people for tr. propagate all recent nanojit-central changes to your...
...And 4 more matches
Using workers in extensions - Archive of obsolete content
tus bar extension creating a dynamic status bar extension adding preferences to an extension localizing an extension updating an extension to support multiple mozilla applications download the sample you may download the complete example: download the example. how this differs from previous versions this version of the stock ticker extension moves the xmlhttprequest call that fetches updated stock information into a worker thread, which then passes that information back to the main body of the extension's code to update the display in the status bar. this demonstrates not only how to use workers in an extension, but also how to perform xmlhttprequest in a worker, and how workers and main thread code can pass data back and forth. the worker the worker thread's job in this example i...
...that's all it does. every 10 minutes, it calls xmlhttprequest, and, when the results are received, sends an event back to the main thread with the received data. so we need to move the refreshinformation() method from the stockwatcher2.js file into a separate file that will host the worker thread. ...
... the stock symbol being tracked is set to the upper case version of that value. this is used to initialize the worker, and to change which stock is being monitored. if there is no data field, the refreshinformation() method is called to fetch the latest information about the stock and pass it back to the main thread. this provides a way for the main thread to specifically request that the worker update the stock information at once. the refreshinformation() method is fairly similar to the previous versions, with two notable exceptions: if the ticker symbol has not been set yet, an exception is thrown (lines 4-6). when the result is received from xmlhttprequest, instead of immediately updating the displayed information in the status bar, a message is sent to the main thread using the worke...
...And 4 more matches
XForms Input Element - Archive of obsolete content
allows for free-form data entry (xhtml/xul). characteristics a text field is presented to the user when there is no type given for the bound node or a type is specified that is not handled by one of the other widgets (as documented below). analogous widgets are <xhtml:input type="text"/> and <xul:textbox/> specific handling of attributes incremental - if "true", the bound instance node will be updated on each character typed by the user. if "false", or the incremental attribute is omitted on this element then the bound instance node will be updated when the control loses the focus. checkbox most often used when the form author only needs a simple 'true', 'false', '1', or '0' response from the user (xhtml/xul). characteristics used when the instance node is of type xsd:boolean or a type deri...
...ics used when the instance node is of type xsd:boolean or a type derived from it analogous widgets are <xhtml:input type="checkbox"/> and <xul:checkbox/> the corresponding label can be displayed before or after the checkbox by using the labelposition attribute. specific handling of attributes incremental - if "true" or this attribute is omitted from this element, then the instance node will be updated when the user checks or un-checks the checkbox. if "false" then the instance node will be updated when the checkbox loses the focus. labelposition - a mozilla xforms extension in the namespace http://www.mozilla.org/projects/xfor...009/extensions. this attribute is optional, possible values are before and after. the default value if omitted is after. it controls the display of the label relative...
...field for direct user input next to a button that when activated will 'drop down' a calender widget that the user can also interact with (xhtml/xul). characteristics used when the instance node is of type xsd:date or a type derived from it. will not work with xsd:datetime (behavior defaults to text input). specific handling of attributes incremental - if "true", the bound instance node will be updated on each character typed by the user or when the user clicks on a date from the calendar widget. if "false" or the incremental attribute is omitted on this element then the bound instance node will be updated when the control loses focus. calendar a form author may notice a xforms input element represented by a calendar widget in the mozilla xforms processor if the control meets the following cr...
...And 4 more matches
Building up a basic demo with the PlayCanvas engine - Game development
example code in the second one. there is one helper variable already included, which will store a reference to the <canvas> element. before reading on, copy this code to a new text file and save it in your working directory as index.html. playcanvas application to begin developing our game we have to create the playcanvas application first (using the given <canvas> element), and then start the update loop. add the following code to the bottom of your second <script> element: var app = new pc.application(canvas); app.start(); the pc global object contains all the playcanvas functions available in the engine. next, we'll set the canvas to fill the window, and automatically change its resolution to be the same as the canvas size. again, add the following lines at the bottom of your script. ...
...e code above assign a dark grey ambient light for the whole scene. the box look better now, but it could get some colors to look even better - for that we need to create material for it. material the basic playcanvas material is called phongmaterial — add the following lines below the previous code. var boxmaterial = new pc.phongmaterial(); boxmaterial.diffuse.set(0, 0.58, 0.86); boxmaterial.update(); box.model.model.meshinstances[0].material = boxmaterial; by diffusing the light on the object we can give it it's own color —we'll choose a nice familiar blue. note: in playcanvas, the color channel values are provided as floats in the range 0-1, instead of integers of 0-255 as you might be used to using on the web. after the material is created and its color is set, it has to be updat...
... code we used for creating a cube, but instead of the box component we are adding a cylinder. it is also rotated around the x axis to show it's actually a 3d shape. to make the cylinder have a color, let's say yellow, we need to create the material for it, as before. add the following lines: var cylindermaterial = new pc.phongmaterial(); cylindermaterial.diffuse.set(1, 0.58, 0); cylindermaterial.update(); cylinder.model.model.meshinstances[0].material = cylindermaterial; cone creating a cone and its material is done in almost exacly the same way as we did for the cylinder. add the following code, again, at the bottom of your script: var cone = new pc.entity(); cone.addcomponent("model", { type: "cone" }); app.root.addchild(cone); cone.translate(2, 0, 0); var conematerial = new pc.phongmate...
...And 4 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
ered when responses are processed by cors, since they're considered safe (as the headers listed in access-control-expose-headers). 51 crlf cr, crlf, glossary, infrastructure, lf, carriage return, line feed cr and lf are control characters or bytecode that can be used to mark a line break in a text file. 52 crud glossary, infrastructure crud (create, read, update, delete) is an acronym for ways one can operate on stored data. it is a mnemonic for the four basic functions of persistent storage. crud typically refers to operations performed in a database or datastore, but it can also apply to higher level functions of an application such as soft deletes where data is not actually deleted but marked as deleted via a status. 53 csp glossary, h...
...ferent numeric types exist; for example, integers, floats, doubles, or bignums. 295 oop beginner, codingscripting, glossary oop (object-oriented programming) is an approach in programming in which data is encapsulated within objects and the object itself is operated on, rather than its component parts. 296 ota glossary, infrastructure, intro, ota, over the air, updates over the air (ota) refers to automatic updating of software on connected devices from a central server. all device owners receiving a given set of updates are on the same "channel", and each device often can access several channels (e.g. for production or engineering builds). 297 owasp glossary, security owasp (open web application security project) is a non-profit org...
...sary, infrastructure, intro, mobile, telephony ril (radio interface layer) is a mobile operating system component which communicates between the device's software and the device's phone, radio, or modem hardware. 356 rss glossary, openpractices, rss, sharing, webmechanics rss (really simple syndication) refers to several xml document formats designed for publishing site updates. when you subscribe to a website's rss feed, the website sends information and updates to your rss reader in an rss document called a feed, so you don't need to check all your favorite websites manually. 357 rtcp (rtp control protocol) glossary, media, networking, protocol, rtcp, control the rtp control protocol (rtcp) is a partner to the rtp protocol. rtcp is used to provid...
...And 4 more matches
Client-side storage - Learn web development
item on one website, it won't be available to the other website. this makes sense — you can imagine the security issues that would arise if websites could see each other's data! a more involved example let's apply this new-found knowledge by writing a simple working example to give you an idea of how web storage can be used. our example will allow you enter a name, after which the page will update to give you a personalized greeting. this state will also persist across page/browser reloads, because the name is stored in web storage. you can find the example html at personal-greeting.html — this contains a simple website with a header, content, and footer, and a form for entering your name. let's build up the example, so you can understand how it works. first, make a local copy ...
...tings and updating the form display namedisplaycheck(); }); at this point we also need an event handler to run a function when the "forget" button is clicked — this is only displayed after the "say hello" button has been clicked (the two form states toggle back and forth). in this function we remove the name item from web storage using removeitem(), then again run namedisplaycheck() to update the display. add this to the bottom: // run function when the 'forget' button is clicked forgetbtn.addeventlistener('click', function() { // remove the stored name from web storage localstorage.removeitem('name'); // run namedisplaycheck() to sort out displaying the // generic greeting again and updating the form display namedisplaycheck(); }); it is now time to define the name...
... displaydata(); }; transaction.onerror = function() { console.log('transaction not opened due to error'); }; } this is quite complex; breaking it down, we: run event.preventdefault() on the event object to stop the form actually submitting in the conventional manner (this would cause a page refresh...
...And 4 more matches
Object building practice - Learn web development
opens. type in the following to create a new ball instance: let testball = new ball(50, 100, 4, 4, 'blue', 10); try calling its members: testball.x testball.size testball.color testball.draw() when you enter the last line, you should see the ball draw itself somewhere on the canvas. ...
... 'blue', 10); try calling its members: testball.x testball.size testball.color testball.draw() when you enter the last line, you should see the ball draw itself somewhere on the canvas. updating the ball's data we can draw the ball in position, but to actually move the ball, we need an update function of some kind. ...
...ball.size testball.color testball.draw() when you enter the last line, you should see the ball draw itself somewhere on the canvas. updating the ball's data we can draw the ball in position, but to actually move the ball, we need an update function of some kind. ...
...And 4 more matches
Routing in Ember - Learn web development
ow for routing. creating the routes let's start by creating three new routes: "index", "active" and "completed". to do this you’ll need to enter the following commands into your terminal, inside the root directory of your app: ember generate route index ember generate route completed ember generate route active the second and third commands should have not only generated new files, but also updated an existing file, app/router.js. it contains the following contents: import emberrouter from '@ember/routing/router'; import config from './config/environment'; export default class router extends emberrouter { location = config.locationtype; rooturl = config.rooturl; } router.map(function() { this.route('completed'); this.route('active'); }); the highlighted lines were added when th...
...r route javascript files to allow us to easily return specific data sets to display in those models. model is a data loading lifecycle hook. for todomvc, the capabilities of model aren't that important to us; you can find more information in the ember model guide if you want to dig deeper. we also provide access to the service, like we did for the components. ...
...ex route model first of all, update todomvc/app/routes/index.js so it looks as follows: import route from '@ember/routing/route'; import { inject as service } from '@ember/service'; export default class indexroute extends route { @service('todo-data') todos; model() { let todos = this.todos; return { get alltodos() { return todos.all; } } } } we can now update the todomvc/app/templates/index.hbs file so that when it includes the <todolist /> component, it does so explicitly with the available model, calling its alltodos() getter to make sure all of the todos are shown. ...
...And 4 more matches
Using Vue computed properties - Learn web development
his.todoitems.filter(item =>item.done).length return `${numberfinisheditems} out of ${this.todoitems.length} items completed` } } now we can add {{listsummary}} directly to our template; we'll add this inside an <h2> element, just above our <ul>. we'll also add an id and an aria-labelledby attribute to assign the <h2> contents to be a label for the <ul> element. ...
...e described <h2> and update the <ul> inside your app's template as follows: <h2 id="list-summary">{{listsummary}}</h2> <ul aria-labelledby="list-summary" class="stack-large"> <li v-for="item in todoitems" :key="item.id"> <to-do-item :label="item.label" :done="item.done" :id="item.id"></to-do-item> </li> </ul> you should now see the list summary in your app, and the total number of items update as you add more todo items! however, if you try checking and unchecking some items, you'll reveal a bug. currently, we're not actually tracking the "done" data in any fashion, so the number of completed items does not change. tracking changes to "done" we can use events to capture the checkbox update and manage our list accordingly. since we're not relying on a button press to trigger the chan...
...ou'll reveal a bug. currently, we're not actually tracking the "done" data in any fashion, so the number of completed items does not change. tracking changes to "done" we can use events to capture the checkbox update and manage our list accordingly. since we're not relying on a button press to trigger the change, we can attach a @change event handler to each checkbox instead of using v-model. update the <input> element in todoitem.vue to look like this. <input type="checkbox" class="checkbox" :id="id" :checked="isdone" @change="$emit('checkbox-changed')" /> since all we need to do is emit that the checkbox was checked, we can include the $emit() inline. in app.vue, add a new method called updatedonestatus(), below your addtodo() method. this method should take one parameter: the to...
...And 4 more matches
Deploying our app - Learn web development
s possible. here's just a few things to consider for this particular project: generating a production build: ensuring files are minimised, chunked, have tree-shaking applied, and that versions are "cache busted". running tests: these can range from "is this code formatted properly?" to "does this thing do what i expect?", and ensuring failing tests prevent deployment. actually deploying the updated code to a live url: or potentially a staging url so it can be reviewed first. note: cache busting is a new term that we haven't met before in the module. this is the strategy of breaking a browser's own caching mechanism, which forces the browser to download a new copy of your code. parcel (and indeed many other tools) will generate filenames that are unique to each new build. this unique fil...
...a new term that we haven't met before in the module. this is the strategy of breaking a browser's own caching mechanism, which forces the browser to download a new copy of your code. parcel (and indeed many other tools) will generate filenames that are unique to each new build. this unique filename "busts" your browser's cache, thereby making sure the browser downloads the fresh code each time an update is made to the deployed code. the above tasks also break down into further tasks; note that most web development teams will have their own terms and processes for at least some part of the post-development phase. for this project, we're going to use netlify's wonderful static hosting offering to host our project. netlify gives us hosting or more specifically, a url to view your project online ...
...if the build is successful, the website changes will be deployed. although netlify offers a drag and drop deployment service, we are intending to trigger a new deployment to netlify each time we push to a github repo. it's exactly these kinds of connected services that we would encourage you to look for when deciding on your own build toolchain. we can commit our code and push to github and the updated code will automatically trigger the entire build routine. if all is well, we get a live change deployed automatically. the only action we need to perform is that initial "push". however, we do have to set these steps up, and we'll look at that now. the build process again, because we're using parcel for development, the build option is extremely simple to add. instead of running the server wi...
...And 4 more matches
Webapps.jsm
/webapps.jsm"); // exported symbol is domapplicationregistry method overview init: function() loadcurrentregistry: function() notifyappsregistrystart: function notifyappsregistrystart() notifyappsregistryready: function notifyappsregistryready() sanitizeredirects: function sanitizeredirects(asource) _savewidgetsfullpath: function(amanifest, adestapp) appkind: function(aapp, amanifest) updatepermissionsforapp: function(aid, aispreinstalled) updateofflinecacheforapp: function(aid) installpreinstalledapp: function installpreinstalledapp(aid) removeifhttpsduplicate: function(aid) installsystemapps: function() loadandupdateapps: function() updatedatastore: function(aid, aorigin, amanifesturl, amanifest) _registersystemmessagesforentrypoint: function(amanifest, aapp, aentrypoint) _...
...() updatedatastore: function(aid, aorigin, amanifesturl, amanifest) _registersystemmessagesforentrypoint: function(amanifest, aapp, aentrypoint) _registerinterappconnectionsforentrypoint: function(amanifest, aapp,) _registersystemmessages: function(amanifest, aapp) _registerinterappconnections: function(amanifest, aapp) _createactivitiestoregister: function(amanifest, aapp, aentrypoint, arunupdate) _registeractivitiesforapps: function(aappstoregister, 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, ad...
...on(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, azippath) _getappdir: function(aid) _writefile: function(apath, adata) dogetlist: function() doexport: function(amsg, amm) doimport: function(amsg, amm) doextractmanifest: function(amsg, amm) dolaunch: function (adata, amm) launch: function launch(amanifesturl, astartpo...
...And 4 more matches
nsIDOMOfflineResourceList
iptable please add a summary to this article. last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsisupports method overview void mozadd(in domstring uri); boolean mozhasitem(in domstring uri); domstring mozitem(in unsigned long index); void mozremove(in domstring uri); void swapcache(); void update(); attributes attribute type description mozitems nsidomofflineresourcelist the list of dynamically-managed entries in the offline resource list. read only. mozlength unsigned long the number of entries in the dynamically managed offline resource list. read only. onchecking nsidomeventlistener an event listener to be called whe...
...ption mozitems nsidomofflineresourcelist the list of dynamically-managed entries in the offline resource list. read only. mozlength unsigned long the number of entries in the dynamically managed offline resource list. read only. onchecking nsidomeventlistener an event listener to be called when fetching the application cache manifest and checking for updates. onerror nsidomeventlistener an event listener to be called when an error occurs during the caching process. onnoupdate nsidomeventlistener an event listener to be called when there is no update to download. ondownloading nsidomeventlistener an event listener to be called when resources are being downloaded into the cache. onprogress nsido...
... oncached nsidomeventlistener an event listener to be called when caching is complete. ...
...And 4 more matches
Capabilities, constraints, and settings - Web APIs
ect that eventually gets passed into getusermedia(). you can also change the constraints of an existing mediastreamtrack on the fly, by calling the track's applyconstraints() method, passing into it an object representing the constraints you wish to apply to the track: videotrack.applyconstraints({ width: 1920, height: 1080 }); in this snippet, the video track referenced by videotrack is updated so that its resolution as closely as possible matches 1920x1080 pixels (1080p high definition). retrieving current constraints and settings it's important to remember the difference between constraints and settings. constraints are a way to specify what values you need, want, and are willing to accept for the various constrainable properties (as described in the documentation for mediatrackcon...
...ample below. function switchcameras(track, camera) { let constraints = track.getconstraints(); constraints.facingmode = camera; track.applyconstraints(constraints); } this function accepts a mediastreamtrack and a string indicating the camera facing mode to use, fetches the current constraints, sets the value of the mediatrackconstraints.facingmode to the specified value, then applies the updated constraint set. getting the current settings for a track unless you only use exact constraints (which is pretty restrictive, so be sure you mean it!), there's no guarantee exactly what you're going to actually get after the constraints are applied. the values of the constrainable properties as they actually are in the resulting media are referred to as the settings. if you need to know the tru...
... contents of the two constraint set editor elements to the defaults. videoconstrainteditor.value = videodefaultconstraintstring; audioconstrainteditor.value = audiodefaultconstraintstring; updating the settings display to the right of each of the constraint set editors is a second text box which we use to display the current configuration of the track's configurable properties. this display is updated by the function getcurrentsettings(), which gets the current settings for the audio and video tracks and inserts the corresponding code into the tracks' settings display boxes by setting their value. function getcurrentsettings() { if (videotrack) { videosettingstext.value = json.stringify(videotrack.getsettings(), null, 2); } if (audiotrack) { audiosettingstext.value = json.strin...
...And 4 more matches
PaymentRequest.show() - Web APIs
t a time. if your architecture doesn't necessarily have all of the data ready to go at the moment it instantiates the payment interface by calling show(), specify the detailspromise parameter, providing a promise that is fulfilled once the data is ready. if this is provided, show() will not allow the user to interact with the payment interface until the promise is fulfilled, so that data can be updated prior to the user engaging with the payment process. processing the result and, if necessary, calling paymentresponse.retry() to retry a failed payment can all be done either asynchronously or synchronously, depending on your needs. for the best user experience, asynchronous solutions are typically the best way to go. most examples on mdn and elsewhere use async/await to wait asynchronously whi...
...ence, asynchronous solutions are typically the best way to go. most examples on mdn and elsewhere use async/await to wait asynchronously while results are validated and so forth. syntax paymentpromise = paymentrequest.show(detailspromise); parameters detailspromise optional an optional promise that you can provide if your architecture requires that the payment request's details need to be updated between instantiating the payment interface and the user beginning to interact with it. the promise should resolve with a paymentdetailsupdate object containing the updated information. return value a promise that eventually resolves with a paymentresponse. the promise is resolved when the user accepts the payment request (such as by clicking a "pay" button in the browser's payment sheet). e...
...en().catch() to handle the response and any possible rejection. ...
...And 4 more matches
context-menu - Archive of obsolete content
f.on("click", function (node, data) {' + ' self.postmessage(node.src);' + '});', onmessage: function (imgsrc) { openimageeditor(imgsrc); } }); updating a menu item's label each menu item must be created with a label, but you can change its label later using a couple of methods. the simplest method is to set the menu item's label property. ...
...for instance, if your item performs a search with the user's selected text, it would be nice to display the text in the item to provide feedback to the user. in these cases you can use the second method. ...
... labeled menu item that can perform an action when clicked. methods destroy() permanently removes the item from its parent menu and frees its resources. the item must not be used afterward. if you need to remove the item from its parent menu but use it afterward, call removeitem() on the parent menu instead. properties label the menu item's label. you can set this after creating the item to update its label later. image the item's icon, a string url. the url can be remote, a reference to an image in the add-on's data directory, or a data uri. you can set this after creating the item to update its image later. to remove the item's image, set it to null. data an optional arbitrary value to associate with the item. it must be either a string or an object that implements tostring(). it wil...
...And 3 more matches
Creating Reusable Modules - Archive of obsolete content
var s = array.from(hash, (c, i) => tohexstring(hash.charcodeat(i))).join(""); return s; } putting it together the complete add-on adds a butto...
... var s = array.from(hash, (c, i) => tohexstring(hash.charcodeat(i))).join(""); return s; } putting it together the complete add-on adds a button to firefox: when the user clicks the button, we ask them to select a file, compu...
... var s = array.from(hash, (c, i) => tohexstring(hash.charcodeat(i))).join(""); return s; } function promptforfile() { var window = require("sd...
...And 3 more matches
JavaScript Client API - Archive of obsolete content
} foorecord.prototype = { __proto__: cryptowrapper.prototype, _logname: "record.foo", ttl: foo_ttl // optional }; utils.defergetset(foorec, "cleartext", ["bar", "baz"]); the store object the store object (which extends store, as defined in services/sync/modules/engines.js) has the job of creating and maintaining a set of record objects from the underlying data. the store must also make updates to the underlying data itself based on incoming record objects. the majority of the code you write for syncing a new data type will most likely be in the store implementation. each record that the store keeps track of must be identified by a unique id (unique among all records in the store) called guid. depending of what type of data you're working with, you might already have guids built into ...
..., you may have to invent your own mapping from data objects to guids as long as it's consistent. in this case, it is highly recommended to use the utils.makeguid() helper to generate new guids: let newguid = utils.makeguid(); your store object must implement the following methods: itemexists(id) createrecord(id, collection) changeitemid(oldid, newid) getallids() wipe() create(record) update(record) remove(record) you may also find it useful to override other methods of the base implementation, for example applyincomingbatch if the underlying storage for your data supports batch operations. createrecord the createrecord( id, collection ) method gets called by the engine to request a new record for an item with a given guid. it's your store's responsibility to instantiate a ...
... deletes all bookmarks from the current firefox profile. how to do this for your particular data type is up to you to figure out. the next three methods are called by the sync algorithm when it determines that the state of the local application needs to be changed to keep it up-to-date with the user's remote activities. the sync algorithm will call your store object with a record to be created, updated, or removed, and it is your store object's responsibility to apply this change to the local application using whatever methods are neccessary. create(record) not to be confused with createrecord(), this method (which should probably be renamed for clarity soon) tells your store to create a new item in the local application, based on the data in record. (so for example, bookmarkstore.creat...
...And 3 more matches
Monitoring downloads - Archive of obsolete content
(source text, size integer," + " starttime integer, endtime integer," + " speed real, status integer)"); dbconn.close(); }, this is fairly simple stuff. the download manager instance is cached into a member variable in the downloadlogger object for reuse later, and its addlistener() method is called to start listening for download status updates. the database file is opened, and an sqlite create table command is executed to create the table. finally, the database is closed. note: the mozistorageconnection method close() is being added to firefox 3 alpha 8; in prior versions of firefox, there is no way to explicitly close the database. instead, it is closed when the garbage collector disposes of the connection object. handling downloa...
...g the database and building a replace into sqlite command. the first three rows are set to the values of the source uri, file size, and start time fields from the download object. the remaining rows are set to zeroes since that's not information we have at the moment. if the download's state indicates that the download is finished, canceled, or failed, we call our logtransfercompleted routine to update the log to indicate that state change. that code looks like this: logtransfercompleted: function(adownload) { var endtime = new date(); // current time is the end time // issue the replace sqlite command to update the record. we find a // record for the same source uri and start time, then update the end // time, size, and speed entries in the record. by ma...
...command to update the record. we find a // record for the same source uri and start time, then update the end // time, size, and speed entries in the record. by matching on both // source uri and start time, we support logging multiple downloads of // the same file. ...
...And 3 more matches
XUL Events - Archive of obsolete content
broadcaster) being listened to are changed. ...
...g listened to are changed. ...
...dler should be placed on an observer.checkboxstatechangethe checkboxstatechange event is executed when the state of a <checkbox> element has changed.closethe close event is executed when a request has been made to close the window when the user presses the close button.commandthe command event is executed when an element is activated.commandupdatethe commandupdate event is executed when a command update occurs on a <commandset>. ...
...And 3 more matches
commandset - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is not displayed and serves as a container for command elements. in addition, this element can hold a command updater which is used to update commands when certain events occur. a common use of the command updater is to update cut, copy, and paste menu items. more information is available in the xul tutorial. ...
... attributes | properties | methods | related ] this element is not displayed and serves as a container for command elements. in addition, this element can hold a command updater which is used to update commands when certain events occur. a common use of the command updater is to update cut, copy, and paste menu items. more information is available in the xul tutorial. ...
...| methods | related ] this element is not displayed and serves as a container for command elements. in addition, this element can hold a command updater which is used to update commands when certain events occur. a common use of the command updater is to update cut, copy, and paste menu items. more information is available in the xul tutorial. attributes commandupdater, events, oncommandupdate, targets example <commandset> <command id="cmd_open" oncommand="alert('open!');"/> <command id="cmd_help" oncommand="alert('help!');"/> </commandset> attributes commandupdater type: boolean if true, the commandset is used for updating commands. typically, this is used to update menu commands such as undo and cut based on when an event occurs. for example, since ...
...And 3 more matches
Adding features to our bouncing balls demo - Learn web development
e program (have not been eaten by the evil circle). this should be a boolean (true/false). the ball() constructor should inherit the x, y, velx, vely, and exists properties from the shape() constructor. it should also define a color and a size property, like the original ball() constructor did. remember to set the ball() constructor's prototype and constructor appropriately. the ball draw(), update(), and collisiondetect() method definitions should be able to stay exactly the same as they were before. you also need to add a new parameter to the new ball() ( ... ) constructor call — the exists parameter should be the 5th parameter, and should be given a value of true. at this point, try reloading the code — it should work just the same as it did before, with our redesigned objects. de...
...ust have an outer line (stroke). you can achieve this by updating fillstyle and fill() to strokestyle and stroke(). we also want to make the stroke a bit thicker, so you can see the evil circle a bit more easily. this can be achieved by setting a value for linewidth somewhere after the beginpath() call (3 will do). ...
...the evil circle a bit more easily. this can be achieved by setting a value for linewidth somewhere after the beginpath() call (3 will do). checkbounds() this method will do the same thing as the first part of ball()'s update() function — look to see whether the evil circle is going to go off the edge of the screen, and stop it from doing so. ...
...And 3 more matches
Client-Server Overview - Learn web development
ng the hypertext transfer protocol (http). when you click a link on a web page, submit a form, or run a search, the browser sends an http request to the server. this request includes: a url identifying the target server and resource (e.g. an html file, a particular data point on the server, or a tool to run). a method that defines the required action (for example, to get a file or to save or update some data). the different methods/verbs and their associated actions are listed below: get: get a specific resource (e.g. an html file containing information about a product, or a list of products). post: create a new resource (e.g. add a new article to a wiki, add a new contact to a database). head: get the metadata information about a specific resource without getting the body lik...
...et: get a specific resource (e.g. an html file containing information about a product, or a list of products). post: create a new resource (e.g. add a new article to a wiki, add a new contact to a database). head: get the metadata information about a specific resource without getting the body like get would. you might for example use a head request to find out the last time a resource was updated, and then only use the (more "expensive") get request to download the resource if it has changed. put: update an existing resource (or create a new one if it doesn't exist). delete: delete the specified resource. trace, options, connect, patch: these verbs are for less common/advanced tasks, so we won't cover them here. additional information can be encoded with the request (for ...
...://mysite.com?name=fred&age=11. you always have a question mark (?) separating the rest of the url from the url parameters, an equals sign (=) separating each name from its associated value, and an ampersand (&) separating each pair. url parameters are inherently "insecure" as they can be changed by users and then resubmitted. as a result url parameters/get requests are not used for requests that update data on the server. post data. post requests add new resources, the data for which is encoded within the request body. client-side cookies. cookies contain session data about the client, including keys that the server can use to determine their login status and permissions/accesses to resources. web servers wait for client request messages, process them when they arrive, and reply to...
...And 3 more matches
Ember interactivity: Events, classes and state - Learn web development
ent super-class. to create a header class to go with your header component, type this in to your terminal: ember generate component-class header this will create the following empty class file — todomvc/app/components/header.js: import component from '@glimmer/component'; export default class headercomponent extends component { } inside this file we will implement the event handler code. ...
...rom an event that occurred in the template. @action also binds the this of the function to the class instance. note: a decorator is basically a wrapper function, which wraps and calls other functions or properties, providing additional functionality along the way. for example, the @tracked decorator (see slightly later on) runs code it is applied to, but additionally tracks it and automatically updates the app when values change. read javascript decorators: what they are and when to use them for more general information on decorators. coming back to our browser tab with the app running, we can type whatever we want, and when we hit enter we'll be greeted with an alert message telling us exactly what we typed. with the interactivity of the header input out of the way, we need a place to st...
...ext of the todo, and a @tracked iscompleted property that specifies whether the todo has been completed or not. when instantiated, a todo object will have an initial text value equal to the text given to it when created (see below), and an iscompleted value of false. ...
...And 3 more matches
Focus management with Vue refs - Learn web development
it form is shown. we'll also want to put focus back on the "edit" button when a user cancels or saves their edit. in order to set focus, we need to understand a little bit more about how vue works internally. virtual dom and refs vue, like some other frameworks, uses a virtual dom (vdom) to manage elements. this means that vue keeps a representation of all of the nodes in our app in memory. any updates are first performed on the in-memory nodes, and then all the changes that need to be made to the actual nodes on the page are synced in a batch. since reading and writing actual dom nodes is often more expensive than virtual nodes, this can result in better performance. however, it also means you often should not edit your html elements directly through native browser apis (like document.getele...
...bout and understand. to use a ref in a component, you add a ref attribute to the element that you want to access, with a string identifier for the value of the attribute. it's important to note that a ref needs to be unique within a component. no two elements rendered at the same time should have the same ref. adding a ref to our app so, let's attach a ref to our "edit" button in todoitem.vue. update it like this: <button type="button" class="btn" ref="editbutton" @click="toggletoitemeditform"> edit <span class="visually-hidden">{{label}}</span> </button> to access the value associated with our ref, we use the $refs property provided on our component instance. to see the value of the ref when we click our "edit" button, add a console.log() to our toggletoitemeditform() method, like so: ...
...he component featuring the "edit" button. this means there's no element to bind the ref to, so it becomes undefined. you might now be thinking "hey, don’t we set isediting=false before we try to access the ref, so therefore shouldn't the v-if now be displaying the button?” this is where the virtual dom comes into play. because vue is trying to optimize and batch changes, it won't immediately update the dom when we set isediting to false. so when we call focusonedit(), the "edit" button has not been rendered yet. instead, we need to wait until after vue undergoes the next dom update cycle. to do that, vue components have a special method called $nexttick(). this method accepts a callback function, which then executes after the dom updates. since the focusoneditbutton() method needs to be i...
...And 3 more matches
Package management basics - Learn web development
ngle file on your web server that contains all the javascript for your software — typically compressed as much as possible to help reduce the time it takes to get your software downloaded and displayed in your visitors’ browser. in addition, what happens if you find a better tool that you want to use instead of the current one, or a new version of your dependency is released that you want to update to? this is not too painful for a couple of dependencies, but in larger projects with many dependencies this kind of thing can become really challenging to keep track of. it makes more sense to use a package manager such as npm, as this will guarantee that the code is added and removed cleanly, as well as a host of other advantages. what exactly is a package manager? we've met npm already, but ...
...ty, i.e. npx parcel index.html. now we're ready to benefit from the full javascript package ecosystem. for a start, there is now a local web server running at http://localhost:1234. go there now and you’ll not see anything for now, but what is cool is that when you do make changes to your app, parcel will rebuild it and refresh the server automatically so you can instantly see the effect your update had. now for some page content. let's say we want to show human-readable relative dates, such as "2 hours ago", "4 days ago" and so on. the date-fns package’s formatdistancetonow() method is useful for this (there's other packages that do the same thing too). in the index.js file, add the following code and save it: import { formatdistancetonow } from 'date-fns' const date = '1996-09-13 10:...
...rly special about the code above is that it is using the formatdistancetonow() function from the date-fns package, which we didn’t install! parcel has spotted that you need the module, searched for it in the npmjs.com package registry, and installed it locally for us, automatically. you can prove this by looking in our package.json file again — you'll see that the dependencies field have been updated for us: "dependencies": { "date-fns": "^2.12.0", "parcel-bundler": "^1.12.4" } parcel has also added the files required for someone else to pick up this project and install any dependencies that we’ve used. if you take a look in the directory you ran the parcel command in, you’ll find a number of new files; the most interesting of which are: node_modules: the dependency files of par...
...And 3 more matches
Eclipse CDT
will be displayed after the command completes. manual setup, and more more information can be found on the eclipse cdt manual setup page. much of that page is redundant (taken care of by the mach setup), but there is still some information there that is relevant that should make its way back here at some point. keeping the index up-to-date as the source changes from day-to-day, you'll want to update the index to keep the code assistance working well. since the compiler options used to build the source change relatively infrequently, the "build" step above doesn't need to be rerun all that often. rerun it (and then rebuild the index) once a week or so, or as necessary when you start to notice unusual code assistance issues that aren't fixed by rebuilding the index alone. rebuilding the inde...
...ce a week or so, or as necessary when you start to notice unusual code assistance issues that aren't fixed by rebuilding the index alone. rebuilding the index itself is required much more frequently since the source changes more frequently. in principle, you can set the index to rebuild automatically by opening the workspace preferences, selecting "c/c++ > indexer", and reenabling "automatically update the index". however, you may find this too disruptive, since re-indexing will then happen very frequently and code assistance can be broken while the index is rebuilding. the alternative is to leave that option disabled and update the index manually as necessary. to update the index manually, use the context menu in the project explorer tab on the left side of the window. to rebuild for changes i...
...nless the user takes extra steps to tell it. this is the reason that the instructions in the initial project properties section above instruct users that have their object directory outside their source directory to explicitly add {objdir}/dist/include to the project's "cdt user setting entries". fixing eclipse bug 381601 would considerably reduce the impact of the "unresolved inclusion" issue. ...
...And 3 more matches
McCoy
mccoy uses xulrunner which is bound to break, for details see this post. mozilla calls mccoy a "simple system" which is a clear sign that something probably is not working, and indeed, is not. mccoy is an application that allows add-on authors to provide secure updates to their users. applications periodically look for and install updates to their add-ons. it's important that the update information retrieved has not been tampered with since being written by the add-on author. specifically, it focuses on the process of digitally signing update manifests so the applications can verify the integrity of a manifest retrieved over normally insecure channels. if you want to learn about the technical details of mccoy then visit the project wiki. installing mccoy to use mccoy you need to do...
...this is in the form of the public part of a cryptographic key included in the original add-on you release. the first step is to create a cryptographic key. simply click the "create" toolbar button or select "create key" from the "keys" me...
...this is in the form of the public part of a cryptographic key included in the original add-on you release. the first step is to create a cryptographic key. simply click the "create" toolbar button or select "create key" from the "keys" menu. you should give the key a name that will remind you what you are usin...
...And 3 more matches
XPCOM changes in Gecko 2.0
prior to gecko 2, during component registration, all binary and javascript component files were loaded and called, asking them to register themselves. ...
...prior to gecko 2, during component registration, all binary and javascript component files were loaded and called, asking them to register themselves. ...
...omponent files were loaded and called, asking them to register themselves. if you used xpcomutils.jsm, some of this was hidden from you, but it was still there. starting in gecko 2, however, components are registered using manifest files, similarly to how chrome is registered. in fact, the same chrome manifest file will be used to register components. all existing xpcom components will need to be updated to support this. however, it's very easy to do, and you can actually support both types of registration for backward compatibility. component manifests all component registration is now handled through manifest files. for extensions, this is the same chrome.manifest currently used to register chrome. xpt files the path of any xpt files must be listed explicitly in a manifest using an interfaces ...
...And 3 more matches
IDBObjectStore.put() - Web APIs
the put() method of the idbobjectstore 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. if the record is successfully stored, then a success event is fired on the returned request object with the result set to the key for the stored record, and the transaction set to the transaction in which this object store is opened. the put method is an update or insert method. see the idbobjectstore.add method for an insert only method. bear in mind that if you have a idb...
...d is successfully stored, then a success event is fired on the returned request object with the result set to the key for the stored record, and the transaction set to the transaction in which this object store is opened. the put method is an update or insert method. see the idbobjectstore.add method for an insert only method. bear in mind that if you have a idbcursor to the record you want to update, updating it with idbcursor.update() is preferable to using idbobjectstore.put(). doing so makes it clear that an existing record will be updated, instead of a new record being inserted. note: this feature is available in web workers. syntax let request = objectstore.put(item); let request = objectstore.put(item, key); parameters item the item you wish to update (or insert). key optional...
...from idbcursor.primarykey). this is only needed for object stores that have an autoincrement primary key, therefore the key is not in a field on the record object. ...
...And 3 more matches
Online and offline events - Web APIs
now when the user comes back online, so that you can re-synchronize with the server. you need to know when the user is offline, so that you can queue your server requests for a later time. it is this process that online/offline events help to simplify. api navigator.online navigator.online is a property that maintains a true/false value (true for online, false for offline). this property is updated whenever the user switches into "offline mode" by selecting the corresponding menu item (file -> work offline in firefox). additionally, this property should update whenever a browser is no longer capable of connecting to the network. according to the specification: the navigator.online attribute must return false if the user agent will not contact the network when the user follows links or wh...
...ile -> work offline in firefox). additionally, this property should update whenever a browser is no longer capable of connecting to the network. according to the specification: the navigator.online attribute must return false if the user agent will not contact the network when the user follows links or when a script requests a remote page (or knows that such an attempt would fail)... firefox 2 updates this property when switching to/from the browser's offline mode. firefox 41 updates this property when the os reports a change in network connectivity on windows, linux, and os x. this property existed in older versions of firefox and internet explorer (the specification based itself off of these prior implementations), so you can begin using it immediately. network status autodetection was imp...
...ributes on the <body> tag in the html markup. example there's a simple test case that you can run to verify that the events are working (does not work in chrome due to attaching the event listener to document.body). ...
...And 3 more matches
PaymentRequest.shippingOption - Web APIs
equestshipping was false (or missing), shippingoption returns null, even the developer provides a selected a shipping option. syntax // returns the id of the selected paymentshippingoption var shippingoption = request.shippingoption; example in the example below, the paymentrequest.onshippingoptionchange and the paymentrequest.onshippingaoptionchange events are dispatched. ...
...tax // returns the id of the selected paymentshippingoption var shippingoption = request.shippingoption; example in the example below, the paymentrequest.onshippingoptionchange and the paymentrequest.onshippingaoptionchange events are dispatched. in each calls to updatedetails() are made, one using a promise, and the other with a plain js object. this demotrates synchrounous and asynchronous updates to a payment sheet. ...
... example in the example below, the paymentrequest.onshippingoptionchange and the paymentrequest.onshippingaoptionchange events are dispatched. in each calls to updatedetails() are made, one using a promise, and the other with a plain js object. this demotrates synchrounous and asynchronous updates to a payment sheet. ...
...And 3 more matches
PaymentRequest: shippingaddresschange event - Web APIs
the shippingaddresschange event is sent to the paymentrequest object when the user selects a shipping address or changes details of their shipping address. bubbles no cancelable no interface paymentrequestupdateevent event handler property onshippingaddresschange usage notes depending on the browser, the shipping address information may be redacted for privacy reasons. that is, the paymentaddress which contains the shipping address may have some portions of its content altered, obscured, or left out entirely in order to prevent identifying the user without their consent (since if they choose to have you ship products to them, you'll need their address). example in this example, a handler for the shippingaddresschange event is set up t...
...(since if they choose to have you ship products to them, you'll need their address). example in this example, a handler for the shippingaddresschange event is set up to validate that the address meets requirements set by the web application. ...
... need their address). example in this example, a handler for the shippingaddresschange event is set up to validate that the address meets requirements set by the web application. ...
...And 3 more matches
Request.cache - Web APIs
Web › API › Request › cache
a matching request in its http cache. if there is a match and it is fresh, it will be returned from the cache. if there is a match but it is stale, the browser will make a conditional request to the remote server. if the server indicates that the resource has not changed, it will be returned from the cache. otherwise the resource will be downloaded from the server and the cache will be updated. if there is no match, the browser will make a normal request, and will update the cache with the downloaded resource. 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. reload — the browser fetches the resource from the remote server without first looking in the cache, b...
... no-cache — the browser looks for a matching request in its http cache. if there is a match, fresh or stale, the browser will make a conditional request to the remote server. if the server indicates that the resource has not changed, it will be returned from the cache. ...
...e the cache with the downloaded resource. no-cache — the browser looks for a matching request in its http cache. if there is a match, fresh or stale, the browser will make a conditional request to the remote server. if the server indicates that the resource has not changed, it will be returned from the cache. ...
...And 3 more matches
Animating textures in WebGL - Web APIs
project based on this code. our sample loads a copy from a cdn in our html's <head>. ...
...unction setupvideo(url) { const video = document.createelement('video'); var playing = false; var timeupdate = false; video.autoplay = true; video.muted = true; video.loop = true; // waiting for these 2 events ensures // there is data in the video video.addeventlistener('playing', function() { playing = true; checkready(); }, true); video.addeventlistener('timeupdate', function() { timeupdate = true; checkready(); }, true); video.src = url; video.play(); function checkready() { if (playing && timeupdate) { copyvideo = true; } } return video; } first we create a video element. we set it to autoplay, mute the sound, and loop the video. we then set up two events to make sure the video is playing and the time has been upd...
...ype, pixel); // turn off mips and set wrapping to clamp to edge so it // will work regardless of the dimensions of the video. ...
...And 3 more matches
ARIA Test Cases - Accessibility
however, the information might still be useful for some readers. for more up-to-date examples, see the openajaxalliance aria examples page. or copy-paste: http://oaa-accessibility.org/examples/ for each example we test the "expected" results with assistive technologies, for each browser that at supports wai-aria in. where a failure occurs we will test the browser for api incorrectness, using tools such as msaa inspect. this must be done in order to determine where to file a bug (browser or at). ...
... (al) if the screen reader provides a keystroke to announce the current progress, this should work with an aria progressbar as well. jaws - jaws announces the level of progress at each time interval the user selects in jaws configuration. markup ...
... - - - nvda - n/a - - zoom (leopard) pass n/a pass pass zoomtext - - - - orca - - - - progressbar dojo nightly build progress bar in "off" live region progressbar in "assertive" live region expected at behavior: the progress updates should be treated as the screen reader treats any progress updates. the live region markup should not affect how the progress updates are presented. (al) if the screen reader provides a keystroke to announce the current progress, this should work with an aria progressbar as well. jaws - jaws announces the level of progress at each time interval the user selects in jaws configuration. markup used: role="progressbar", aria-valuemin, aria-valuenow, aria-val...
...And 3 more matches
<input type="color"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › color
a-f]{6} or #[0-9a-fa-f]{6} (preferably the latter because some users may not expect a different result with just a letter-case change) and set a placeholder attribute equal to a color representing the expected format of the user's input, such as #ff0000. using color inputs inputs of type color are simple, due to the limited number of attributes they support. providing a default color you can update the simple example above to set a default value, so that the color well is pre-filled with the default color and the color picker (if any) will also default to that color: <input type="color" value="#ff0000"> if you don't specify a value, the default is #000000, which is black. the value must be in seven-character hexadecimal notation, meaning the "#" character followed by two digits each rep...
...can be used to detect changes to the color value: input and change. input is fired on the <input> element every time the color changes. the change event is fired when the user dismisses the color picker. in both cases, you can determine the new value of the element by looking at its value. ...
...d handler to do the main startup work once the page is fully loaded. var colorwell; var defaultcolor = "#0000ff"; window.addeventlistener("load", startup, false); initialization once the page is loaded, our load event handler, startup(), is called: function startup() { colorwell = document.queryselector("#colorwell"); colorwell.value = defaultcolor; colorwell.addeventlistener("input", updatefirst, false); colorwell.addeventlistener("change", updateall, false); colorwell.select(); } this gets a reference to the color <input> element in a variable called colorwell, then sets the color input's value to the value in defaultcolor. then the color input's input event is set up to call our updatefirst() function, and the change event is set to call updateall(). these are both seen belo...
...And 3 more matches
Browser detection using the user agent - HTTP
all of the above better alternatives to user agent sniffing, there are still some potential cases where user agent sniffing is appropriate and justified. one such case is using user agent sniffing as a fallback when detecting if the device has a touch screen. see the mobile device detection section for more information. another such case is for fixing bugs in browsers that do not automatically update. internet explorer (on windows) and webkit (on ios) are two perfect examples. prior to version 9, internet explorer had unbelievable issues with rendering bugs, css bugs, api bugs, and so forth. however, internet explorer was such a special little wasp exception prior to version 9 that it was very easy to detect the browser based upon the browser-specific features available. webkit is a bit worse...
...unbelievable issues with rendering bugs, css bugs, api bugs, and so forth. however, internet explorer was such a special little wasp exception prior to version 9 that it was very easy to detect the browser based upon the browser-specific features available. webkit is a bit worse because apple forces all of the browsers on ios to use webkit internally, thus the user has no way to get a better more updated browser on older devices. most bugs can be detected, but some bugs take more effort to detect than others. in such cases, it might be beneficial to use user agent sniffing to save on performance. for example, webkit 6 has a bug whereby when the device orientation changes, the browser might not fire mediaquerylist listeners when it should. to overcome this bug, observe the code below. var ua=nav...
... user agent sniffing to save on performance. for example, webkit 6 has a bug whereby when the device orientation changes, the browser might not fire mediaquerylist listeners when it should. to overcome this bug, observe the code below. ...
...And 3 more matches
HTTP conditional requests - HTTP
http has a concept of conditional requests, where the result, and even the success of a request, can be changed by comparing the affected resources with the value of a validator. such requests can be useful to validate the content of a cache, and sparing a useless control, to verify the integrity of a document, like when resuming a download, or when preventing to lose updates when uploading or modifying a document on the server. principles http conditional requests are requests that are executed differently, depending on the value of specific headers. these headers define a precondition, and the result of the request will be different if the precondition is matched or not. the different behaviors are defined by the method of the request used, and by the set of headers used for a precondition...
...s header. if-unmodified-since succeeds if the last-modified date of the distant resource is older or the same than the one given in this header. if-range similar to if-match, or if-unmodified-since, but can have only one single etag, or one date. if it fails, the range request fails, and instead of a 206 partial content response, a 200 ok is sent with the complete resource. use cases cache update the most common use case for conditional requests is updating a cache. with an empty cache, or without a cache, the requested resource is sent back with a status of 200 ok. together with the resource, the validators are sent in the headers. in this example, both last-modified and etag are sent, but it could equally have been only one of them. these validators are cached with the resource (lik...
...oad from the beginning: even if this method works, it adds an extra response/request exchange when the document has been changed. this impairs performance, and http has a specific header to avoid this scenario: if-range: this solution is more efficient, but slightly less flexible, as only one etag can be used in the condition. rarely is such additional flexibility needed. avoiding the lost update problem with optimistic locking a common operation in web applications is to update a remote document. 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. common web sites, like wikis and other cms, have such a need. with the put method you are able to implement this. the client first reads the ...
...And 3 more matches
HTTP Index - HTTP
Web › HTTP › Index
nt-server model, with a client opening a connection to make a request, then waiting until it receives a response. http is a stateless protocol, meaning that the server does not keep any data (state) between two requests. though often based on a tcp/ip layer, it can be used on any reliable transport layer, that is, a protocol that doesn't lose messages silently like udp does. rudp — the reliable update of udp — is a suitable alternative. 2 a typical http session http in client-server protocols, like http, sessions consist of three phases: 3 an overview of http html, http, overview, webmechanics, l10n:priority http isthe foundation of any data exchange on the web and it is a client-server protocol, which means requests are initiated by the recipient, u...
...rls guide, http, url a recurring question among website owners is whether to choose non-www or www urls. this page provides some advice on what's best. 6 data urls base64, guide, http, intermediate, url data urls, urls prefixed with the data: scheme, allow content creators to embed small files inline in documents. 7 evolution of http guide, http, needsupdate, needsupdate(http/3) http (hypertext transfer protocol) is the underlying protocol of the world wide web. http has evolved from an early protocol to exchange files in a semi-trusted laboratory environment, to the modern maze of the internet, now carrying images, videos in high resolution and 3d. 8 identifying resources on the web domain, http, path, scheme, syntax, uri, url, ...
... requests, guide, http http has a concept of conditional requests, where the result, and even the success of a request, can be changed by comparing the affected resources with the value of a validator. such requests can be useful to validate the content of a cache, and sparing a useless control, to verify the integrity of a document, like when resuming a download, or when preventing to lose updates when uploading or modifying a document on the server. 45 http cookies advertising, browser, cookies, cookies article, guide, http, history, javascript, privacy, protocols, server, storage, web development, data, request, tracking an http cookie (web cookie, browser cookie) is a small piece of data that a server sends to the user's web browser. the browser may store it and se...
...And 3 more matches
Porting the Library Detector - Archive of obsolete content
estlibraries() function builds an array of libraries by iterating through the tests and adding an entry for each library which passes. once the list is built, the switchlibraries() function constructs a xul statusbarpanel element for each library it found, populates it with the icon at the corresponding chrome:// url, and adds it to the box. finally, it listens to gbrowser's tabselect event, to update the contents of the box for that window. content script separation the test objects in the original script need access to the dom window object, so in the sdk port, they need to run in a content script. in fact, they need access to the un-proxied dom window, so they can see the objects added by libraries, so we’ll need to use the experimental unsafewindow. the main add-on script, main.js, wi...
...so main.js needs to filter out any duplicates, in case a page contains more than one iframe, and those iframes use the same library. implementing the user interface showing the library array t...
...es, and use that to build the widget's html content dynamically: function buildwidgetviewcontent(librarylist) { widgetcontent = htmlcontentpreamble; librarylist.foreach(function(library) { widgetcontent += buildiconhtml(icons[library.name], library.name + "&lt;br&gt;version: " + library.version); }); widgetcontent += htmlcontentpostamble; return widgetcontent; } function updatewidgetview(tab) { var widgetview = widget.getview(tab.window); if (!tab.libraries) { tab.libraries = []; } widgetview.content = buildwidgetviewcontent(tab.libraries); widgetview.width = tab.libraries.length * icon_width; } main.js will use the tabs module to update the widget's content when necessary (for example, when the user switches between tabs): tabs.on('activate', function(...
...And 2 more matches
jpm - Archive of obsolete content
run -o this instructs jpm to use the local copies of the sdk modules, not the ones in firefox. if you do not want to set the jetpack_root environment variable, you can pass the location of your copy of the sdk modules along with -o: jpm run -o "/path/to/addon-sdk/" the path must be an absolute path and point to the sdk's root (not addon-sdk/sdk or addon-sdk/sdk/lib, for instance). supporting updates for self-hosted add-ons this feature is only supported from jpm 1.0.3 onwards. when you make updates to your add-on to add features or fix bugs, you'll want any previously installed versions of the add-on to update themselves to the new version. if you list your add-on on addons.mozilla.org, then all you have to do here is submit the new version; add-ons default to checking addons.mozilla.o...
...ion; add-ons default to checking addons.mozilla.org for new versions of themselves. you can stop reading this section. if you do not list your add-on on addons.mozilla.org, you need to generate a mozilla-signed xpi and tell firefox where it can find new versions of your add-on. the way this works is: you run jpm sign anytime you need to create a new version you host the signed add-on xpi and update it when you need to you host an "update manifest", which, among other things, contains a url pointing to the xpi your add-on tells firefox where it can find the update manifest to do this, include two extra keys in package.json: updateurl: this url is included in the install manifest of the xpi file that jpm xpi builds. it points to your update manifest. the updateurl value may be https. i...
...est", which, among other things, contains a url pointing to the xpi your add-on tells firefox where it can find the update manifest to do this, include two extra keys in package.json: updateurl: this url is included in the install manifest of the xpi file that jpm xpi builds. it points to your update manifest. the updateurl value may be https. if it is not, then you'll also need to sign the update manifest, and then include the public key using the updatekey field in package.json. see securing updates for more on this. updatelink: this url is included in the update manifest file. it points to the xpi, and must be an https url. ...
...And 2 more matches
Communication between HTML and your extension - Archive of obsolete content
between an html page and and extension after building a sample extension by reading carefully and following the complete instructions for building an extension i was able to get an extension that could display something on the status bar. what i wanted to do was have an extension "look" for something on an html page and if it found that something perform some operation on the found thing and then update the status bar with the results of the operation. with a lot of help from irc://irc.mozilla.org#js and irc://irc.mozilla.org#extdev i was able to get it running pretty well, but i still would rather have the client less responsible for pinging the extension to "look" for what is on the page. what i tried my first attempt was trying to create an xbl component. from what i gather, xbl components...
...re are only a handful of events and the w3c documentation is pretty complete. the basic problem with the event model is probably due to what i was trying to do. in my html i have an input element in a form. i set the onblur action to a little javascript function that performed a standard ajax request to get a result. the onreadystatechange was set to another little javascript function that would update a specific element on the html page with the result. the result of the ajax request was the something that i wanted the extension to find. there were only a handful of events that seemed relevant (load, change, dominsertnode, dominsertnodeintodocument, domactivate) and i tried them all in many different ways. some of the events only apply to certain types of elements so i included trying to modif...
...the result of the ajax request to be of the appropriate element type (img, which supports "onload," rather than span, which doesn't, for example). the problem with the events is the timing. i wasn't sure about the difference between the capture or bubbling flag that you pass to addeventlistener but every time i would catch the event in the extension, the element from the ajax request wasn't fully updated into the html page. what that meant is that everytime the extension went looking for the element, it wasn't there yet. as a last ditch effort i tried setting a timeout using settimeout when i got the event in the extension to wait a few milliseconds before looking for the desired element. this was non-optimal and the timeout wasn't very reliable for some reason. sometimes i would get the timeout...
...And 2 more matches
Enhanced Extension Installation - Archive of obsolete content
the appropriate type container. the system also writes a .autoreg file to the profile folder which tells the startup system that something has changed on the next restart. a copy of the xpi file the item was installed from is set aside since the xpinstall system cleans up the temporary file it hands to the extension system. if the item is not compatible, the extension system asks the appropriate update service (either the one specified by the item, or the default one) if there is remote compatibility information that supercedes the compatibility information held by the item. if there is, and this remote information makes it so that the item is now compatible with the running version of the application, the item is configured in the manner described above (metadata written, added to container). ...
...e extension system can quickly locate an install location for an item using the getinstalllocation method which basically reads this value from the datasource and retrieves the install location from the hash of registered install locations. item type install.rdf install manifests should now specify a <em:type> property which tells the extension system what their type is. types are defined in nsiupdateservice.idl on the nsiupdateitem interface. the types at the time of writing include: 2 - extension 4 - theme 8 - locale for backward compatibility the extension system will continue to assume an item is an extension by default, and a theme if the item has a <em:internalname> property, but extension and theme authors should be good citizens and upgrade their install manifests to include the...
... are validated, and then compatibility is checked for by the new _getinstalldata function. this function returns the guid, version, and type of the item, and also an error code listing either success, or the reason for a failure, such as invalid guid, version, or incompatible item. depending on the failure, the install function may take several steps. if the item is found incompatible, a version update check is performed as before. if updated compatibility information is found this is written into the in-memory representation of the the temporary install manifest and the install function is called recursively, supplying this updated install manifest as the source for _getinstalldata. if the item is determined compatible by either of the above processes, a copy of the item's file is staged into...
...And 2 more matches
Installing Extensions and Themes From Web Pages - Archive of obsolete content
oing so for theme jar files too and wondering why they aren't auto-detected and installed. well, xpi is a mozilla-specific extension and so we can have special handling for it, but jar is not - not all .jar files are firefox themes, so if you click on a .jar link you'll be shown the save as decision dialog. for this reason you should always use the installtrigger api to install themes. ...
...n't auto-detected and installed. well, xpi is a mozilla-specific extension and so we can have special handling for it, but jar is not - not all .jar files are firefox themes, so if you click on a .jar link you'll be shown the save as decision dialog. for this reason you should always use the installtrigger api to install themes. ...
...r is not - not all .jar files are firefox themes, so if you click on a .jar link you'll be shown the save as decision dialog. for this reason you should always use the installtrigger api to install themes. a note on updateenabled() installtrigger exposes a function called updateenabled that some of you may be calling before you call installtrigger.install. this is not necessary as install calls updateenabled itself internally. ...
...And 2 more matches
Chapter 1: Introduction to Extensions - Archive of obsolete content
an excellent way to manage extensions, and is a great step up in ease of use. the add-ons manager handles the following tasks: safely installs and uninstalls add-ons makes sure add-ons are compatible with the version of firefox you're using manages a whitelist of sites trusted for installing add-ons helps troubleshoot add-ons by disabling them and offering a safe mode confirms and runs updates provides access to add-ons' settings dialogs provides access to add-ons' support sites development environment amenities initially, there wasn't adequate documentation available, and extension developers were largely left to fend for themselves1; however, now there's a considerable store of knowledge. because firefox and its extensions are designed to support multiple languages, excellent ...
...ty, has created a positive feedback loop, with the number of extension users and extension developers growing explosively—there are now more than 7000 extensions and themes published at the firefox add-ons site (https://addons.mozilla.org). what you can do with extensions let's look at what features extensions can add, and some actual examples of extensions. single feature extensions fixme: update this. these are relatively simple extensions that add a single feature. text link makes it so that double-clicking on an unlinked url follows that url. undo closed tabs button adds a toolbar button to re-open the most recently closed tabs to the history menu. locationbar separates a url’s domain and path in the location bar for easier reading. feature enhancing extensions ...
... these are relatively simple extensions that add a single feature. text link makes it so that double-clicking on an unlinked url follows that url. undo closed tabs button adds a toolbar button to re-open the most recently closed tabs to the history menu. locationbar separates a url’s domain and path in the location bar for easier reading. feature enhancing extensions fixme: update this. these extensions enhance features that already exist in firefox. tab mix plus offers detailed tab-related settings. prefbar gives access to numerous preferences from the toolbar. noscript enables and disables javascript execution on a site-by-site basis. web application integration extensions fixme: update this. the use the apis of certain web applications to provide certain...
...And 2 more matches
Adding preferences to an extension - Archive of obsolete content
s won't be rehashed here, so if you haven't already seen them: creating a status bar extension creating a dynamic status bar extension also, for reference, you may want to take a look at preferences system and the preferences api. download the sample you can download a copy of this sample to look over, or to use as the basis for your own extension. get the code here: download the sample update the manifests the install manifest and chrome manifest need to be updated. by and large, the changes are simply changing the id of the extension. however, we do need to add one new line to the install.rdf file: <em:optionsurl>chrome://stockwatcher2/content/options.xul</em:optionsurl> this line establishes the url of the xul file that describes the options dialog. please note that if you ar...
...an object. that involves turning each function into a member of the stockwatcher class. let's take a look at each function in the class. startup() the stockwatcher.startup() function is called when our extension is first loaded. its job is to start up the observer to watch for changes to our preferences, instantiate an object to use to manage our preferences, and install an interval routine to update the stock information periodically. var stockwatcher = { prefs: null, tickersymbol: "", // initialize the extension startup: function() { // register to receive notifications of preference changes this.prefs = components.classes["@mozilla.org/preferences-service;1"] .getservice(components.interfaces.nsiprefservice) .getbranch("extensions.stockwatcher...
... the event, since all we're interested in is changes to the values of our preferences. once we've established that the event is in fact a preference change, we look at the data parameter, which contains the name of the preference that changed. in our example, we only have one preference, but you can monitor as many preferences as you wish here. if the changed preference is "symbol", we grab the updated value of the preference by calling the nsiprefbranch.getcharpref() method, and stash it in our tickersymbol variable. once we've gotten the updated preference, we call refreshinformation() to immediately update the display with the new stock's information. watchstock() while we're at it, let's add a method that sets which stock we want to be watching, changing the preference and immediately r...
...And 2 more matches
MenuItems - Archive of obsolete content
checkbox type. the first menuitem is checked by default, as indicated by the checked attribute set to the value true. the second menuitem is not checked by default. when the user activates the menuitem, the command event gets fired. from within a command listener, you can execute code which will change the state of the toolbar or status bar or whatever it is that need changing. you do not need to update the checked attribute as the menuitem will update this automatically before the command event is fired. note that the checked state is updated before the command event fires, so if you use the menuitem's checked attribute within the command listener, it will already be in the new state. <script> function changetoolbarstate(event) { if (event.target.getattribute("checked") == "true") showt...
...te(event) { if (event.target.getattribute("checked") == "true") showtoolbar(); else hidetoolbar(); } </script> ... <menuitem label="show toolbar" accesskey="t" type="checkbox" oncommand="changetoolbarstate();"/> in this example, we show the toolbar when the menuitem is checked and hide the toolbar otherwise. ...
... <script> function changetoolbarstate(event) { if (event.target.getattribute("checked") == "true") hidetoolbar(); event.target.removeattribute("checked"); } else { if (!showtoolbar()) return; event.target.setattribute("checked", "true"); } } </script> ... ...
...And 2 more matches
Gecko Compatibility Handbook - Archive of obsolete content
if you're new to standards, you may find using web standards in your web pages a helpful introduction. ...
...ike internet explorer for mac and ie for windows, which are very different programs and so may behave quite differently from each other. quick compatibility test if your site uses netscape 4.x and microsoft proprietary technologies, see using web standards in your web pages for a quick tutorial on standards. this compatibility test will be most beneficial to sites using simple code or that have updated to support standards. set up browsers for testing the various gecko-based browsers do not always contain netscape in the user-agent string. thus it's critical to verify that you are properly detecting browsers such as aol for macos. you can either download the various browsers. or, if you are using user-agent detection, you can install an extension in firefox or mozilla which allows you to "s...
...grade web authoring tool to versions that support the w3 standards and gecko browsers content differs in gecko browsers and internet explorer the javascript console in netscape 6.x and netscape 7.x displays errors about document.all, document.layers, document.<property> not being defined because of an incorrect browser sniffing, or use of proprietary javascript. update browser sniffing to correctly detect gecko browsers. upgrade apis to use newer standards-conformant versions upgrade web authoring tool to versions that support the w3 standards and gecko browsers content differs in gecko browsers and internet explorer your css relies on bugs in internet explorer's implementation of css. internet explorer incorrectly...
...And 2 more matches
Mozilla release FAQ - Archive of obsolete content
this document may be distributed and modified freely. no guarantee of factuality in this faq is made, and it is maintained by pat gunn, who is not affiliated with netscape. various other people have contributed to this faq. general questions about the mozilla project what is mozilla? mozilla is a project to continue netscape communicator as an open project. the project is maintained by employees of netscape (now a division of aol), red hat, some other companies, as well as contributors from the community. ...
...ource. mozilla 1.0 (mozilla uses a different versioning system than netscape) is due for release soon. when was mozilla released? the source to mozilla was first released on 31 march 1998. the code has been continually available since then via cvs (see section 1.8), and occasional binary releases (first as milestones, and more recently as versioned releases) have been made. as of the time of this update, mozilla 1.0 release candicate 2 is the most recent release. what is the current version of mozilla? mozilla is continually available via cvs, and also is occasionally released as versioned numbers. if built from cvs, the date of the cvs checkout is the best way to refer to the version, otherwise use the release number. older versions used milestone numbers (e.g. the milestone 7 release was known...
...s opposed to 4dos or 4nt) will probably yield better results. regarding compilation options, it would be good not to compile with optimization, because it's much slower to build, and on windows platforms, there's a bug in some versions of vc++ that makes mozilla crash in many common circumstances if compiled with optimization on. ...
...And 2 more matches
Initialize the framework - Game development
this tutorial uses phaser v2 — it won't work with the current version on phaser (v3). the v2 library is still available on the phase...
...this tutorial uses phaser v2 — it won't work with the current version on phaser (v3). the v2 library is still available on the phaser downlo...
...this tutorial uses phaser v2 — it won't work with the current version on phaser (v3). the v2 library is still available on the phaser download page, below the links for the v3 download. go to the phaser download page...
...And 2 more matches
Assessment: Accessibility troubleshooting - Learn web development
ring the questions given below. color the text is difficult to read because of the current color scheme. can you do a test of the current color contrast (text/background), report the results of the test, and then fix it by changing the assigned colors? semantic html the content is still not very accessible — report on what happens when you try to navigate it using a screenreader. ...
...once you add paragraph elements, you'll notice the styling looking better. ...
...once you add paragraph elements, you'll notice the styling looking better. ...
...And 2 more matches
Index - Learn web development
ges: 48 javascript — dynamic client-side scripting beginner, codingscripting, javascript, javascripting beginner, landing, module, topic, l10n:priority javascript is a programming language that allows you to implement complex things on web pages. every time a web page does more than just sit there and display static information for you to look at—displaying timely content updates, interactive maps, animated 2d/3d graphics, scrolling video jukeboxes, or more—you can bet that javascript is probably involved. 49 asynchronous javascript beginner, codingscripting, guide, javascript, landing, promises, async, asynchronous, await, callbacks, requestanimationframe, setinterval, settimeout in this module we take a look at asynchronous javascript, why it is ...
... sizing, viewport units this lesson has given you a rundown of some key issues that you might run into when sizing things on the web. when you move onto css layout, sizing will become very important in mastering the different layout methods, so it is worth understanding the concepts here before moving on. 124 styling tables article, beginner, css, codingscripting, guide, needsupdate, styling, tables with styling tables now behind us, we need something else to occupy our time. the next article explores debugging css — how to solve problems such as layouts not looking like they should, or properties not applying when you think they should. this includes information on using browser devtools to find solutions to your problems. 125 test your skills: images and...
...s to common problems you may face when working with css. 167 css faq css, example, faq, guide, web, questions in this article, you'll find some frequently-asked questions (faqs) about css, along with answers that may help you on your quest to become a web developer. 168 using css generated content basic, beginner, css, css:getting_started, graphics, guide, needsupdate, web this article describes some ways in which you can use css to add content when a document is displayed. you modify your stylesheet to add text content or images. 169 create fancy boxes beginner, css, codingscripting, learn css boxes are the building blocks of any web page styled with css. making them nice looking is both fun and challenging. it's fun because it's al...
...And 2 more matches
Ember Interactivity: Footer functionality, conditional rendering - Learn web development
where the checkbox has been checked). we'll also wire up our "clear completed" button. along the way, we'll learn about using conditional rendering in our templates. ...
... pending todo counter. filters for all, active, and completed todos. a button to clear the completed todos. because we need access to our service from the footer component, we need to generate a class for the footer. ...
...e" a todo. we need to wire up the todo.hbs template to the service, so that checking the relevant checkbox changes the state of each todo. we'll do that next. the todo/todos plural problem the above is fine, but we have another small issue to contend with. the "todos left" indicator always says "x todos left", even when there is only one todo left, which is bad grammar! to fix this, we need to update this part of the template to include some conditional rendering. in ember, you can conditionally render parts of the template using conditional content; a simple block example looks something like this: {{#if this.thingistrue}} content for the block form of "if" {{/if}} so let's try replacing this part of footer.hbs: <strong>{{this.todos.incomplete.length}}</strong> todos left with the foll...
...And 2 more matches
Ember app structure and componentization - Learn web development
ul in such cases where we have an <input> being used with no corresponding html text that could be turned into a label. when you save application.hbs, the development server you started earlier will automatically rebuild the app and refresh the browser. the rendered output should now look like this: it doesn't take too much effort to get our html looking like a fully-featured to-do list app. ...
...ent todo ember generate component footer you’ll now see the following inside your todomvc/app/components directory: now that we have all of our component structure files, we can cut and paste the html for each component out of the application.hbs file and into each of those components, and then re-write the application.hbs to reflect our new abstractions. ...
...cut and paste the html for each component out of the application.hbs file and into each of those components, and then re-write the application.hbs to reflect our new abstractions. the header.hbs file should be updated to contain the following: <input class="new-todo" aria-label="what needs to be done?" placeholder="what needs to be done?" autofocus > todo-list.hbs should be updated to contain this chunk of code: <section class="main"> <input id="mark-all-complete" class="toggle-all" type="checkbox"> <label for="mark-all-complete">mark all as complete</label> <ul class="todo-list"> <todo /> <todo /> </ul> </section> note: the only non-html in this new todo-list.hbs is the <todo /> component invocation. in ember, a component invocation is similar to...
...And 2 more matches
Getting started with Svelte - Learn web development
doesn't do any kind of magic — it just lets you download and unzip the latest version of a git repo's contents. this is much quicker than using git clone because it will not download all the history of the repo, or create a complete local clone. after running npm run dev, svelte will compile and build your application. it will start a local server at localhost:5000. svelte will watch for file updates, and automatically recompile and refresh the app for you when changes are made to the source files. your browser will display something like this: application structure the starter template comes with the following structure: moz-todo-svelte ├── readme.md ├── package.json ├── package-lock.json ├── rollup.config.js ├── .gitignore ├── node_modules ├──...
...). making a couple of changes now that we have a general idea of how it all fits together, we can start making a few changes. at this point you can try updating your app.svelte component — for example change the <h1> element on line 6 of app.svelte so that it reads like this: <h1>hello {name} from mdn!</h1> just save your changes and the app running at localhost:5000 will be automatically updated. a first look at svelte reactivity in the context of a ui framework, reactivity means that the framework can automatically update the dom when the state of any component is changed. in svelte, reactivity is triggered simply by assigning a new value to any top level variable in a component. for example, we could include a togglename() function in our app component, and a button to run it. try...
... note the use of : in on:click. that's svelte's syntax for listening to dom events. inspecting main.js: the entry...
...And 2 more matches
Handling common accessibility problems - Learn web development
using webgl 100% accessible to a blind person, but you could implement keyboard controls so it is usable by non-mouse users, and make the color scheme contrasting enough to be usable by those with color deficiencies. complex functionality one of the main areas problematic for accessibility is complex apps that involve complicated form controls (such as date pickers) and dynamic content that is updated often and incrementally. non-native complicated form controls are problematic because they tend to involve a lot of nested <div>s, and the browser does not know what to do with them by default. if you are inventing them yourself, you need to make sure that they are keyboard accessible; if you are using some kind of third-party framework, carefully review the options available to see how accessi...
... keyboard accessible; if you are using some kind of third-party framework, carefully review the options available to see how accessible they are before diving in. bootstrap looks to be fairly good for accessibility, for example, although making bootstrap a little more accessible by rhiana heath explores some of its issues (mainly related to color contrast), and looks at some solutions. regularly updated dynamic content can be a problem because screenreader users might miss it, especially if it updates unexpectedly. if you have a single-page app with a main content panel that is regularly updated using xmlhttprequest or fetch, a screenreader user might miss those updates. wai-aria do you need to use such complex functionality, or will plain old semantic html do instead? if you do need complexi...
...es like roles to state what role different elements have in a widget (for example, are they a tab, or a tab panel?), aria-disabled to say whether a control is disabled or not, etc. to deal with regularly updating regions of content, you can use the aria-live attribute, which identifies an updating region. its value indicates how urgently the screen reader should read it out: off: the default. updates should not be announced. polite: updates should be announced only if the user is idle. assertive: updates should be announced to the user as soon as possible. rude: updates should be announced straight away, even if this interrupts the user. here's an example: <p><span id="liveregion1" aria-live="polite" aria-atomic="false"></span></p> you can see an example in action at freedom scientifi...
...And 2 more matches
Creating a spell check dictionary add-on
parts needed to create a dictionary add-on, you first need two things: a spell check dictionary in hunspell or myspell format, with a license which allows you to use it. such a dictionary consists of two files, one with a .dic and one with an .aff file extension. a locale code to describe the language of the dictionary. for example en-us, de-de or da. ...
... locale code, or the spell checker will not be able to match the language of your dictionary against the language of a web page in order to select the right dictionary to use. if you are creating a new dictionary, as opposed to updating an existing one, please make sure that there is not already a dictionary available for your locale. if there already is one, try contacting the author to get it updated, or contact amo editors if the author does not respond. packaging a firefox add-on is a zip file renamed to use an .xpi file extension instead of the normal .zip file extension. to create a dictionary add-on, simply create a zip file which contains the following files and folders: my-dictionary.xpi install.rdf dictionaries/ locale-code.dic locale-code.aff the .dic and .aff...
...you should adapt the install.rdf file: if you are creating a new dictionary add-on, we recommend that the em:id consists of your locale code followed by @dictionaries.addons.mozilla.org, but if there is more than one dictionary for your language (for example the german "old spelling" versus "new spelling" dictionaries), you may need to choose another id, that follows the rules of em:id. if you update an existing dictionary add-on, you must keep the existing em:id, or your users will not be updated to the latest version. the em:version should follow the rules of mozilla add-on version numbers, and if you update an existing dictionary add-on, the new version number must be greater than the old one. don't change em:type or em:unpack, and don't add a em:bootstrap element. type = 64 indicates th...
...And 2 more matches
Updating NSPR or NSS in mozilla-central
d nss teams push a new hg tag to mozilla-central. ...
...d and released, the mozilla hg server rejects accidental changes/forking, if the required keywords are missing in the commit comment.) if nspr or nss must be upgraded to a new static tag, follow this procedure: before starting, make sure your local repository is updated to mozilla-central tip and that there are no local changes: $ hg status -mard pull the new sources $ python client.py update_nspr nspr_tag_name or $ python client.py update_nss nss_tag_name if you update a branch older than mozilla 17 (without the change from bug 782784), you must manually add a dummy change (add or remove a blank line) to force a rebuild of nspr: mozilla/nsprpub/config/prdepend.h or nss: mozilla/security/nss/coreconf/coreconf.dep check directory mozilla/nsprpub/patches/ for patches...
... must manually add a dummy change (add or remove a blank line) to force a rebuild of nspr: mozilla/nsprpub/config/prdepend.h or nss: mozilla/security/nss/coreconf/coreconf.dep check directory mozilla/nsprpub/patches/ for patches that need to be applied to nspr, and directory mozilla/security/patches/ for patches that need to be applied to nss. apply the patches. if merging is required, update the patch file. if a patch is no longer needed, remove the patch from the directory and update the readme file. check for new or removed files $ hg addremove -n review the output to make sure it looks correct update the minimum required system nss version in old-configure.in. this is for builds with --with-system-nss. for example, in the following, "3.16.1" would be replaced with the ...
...And 2 more matches
Localizing with Mercurial
path% variable (tortoisehg doesn't need this step). use the add_path.exe utility found in c:\mozilla-build\hg to do this. ps c:\users\your_id> cd c:\mozilla-build\hg ps c:\mozilla-build\hg> .\add_path.exe /result . note the dot (".") at the end of the second command, which means the current directory. if the utility modified your %path% successfully, a dialog will open saying, "%path% has been updated correctly." alternatively, you can edit the %path% variable manually. in order to do so, right-click on your computer icon, choose properties > advanced > environmental variables, select path and click edit. if you don't see path among the options, you'll have to click add and edit it within the add dialog. see the screenshot for an example. did it work? go to start > run... type cmd.exe a...
...illa-central, and pull some other hg repositories. the other directories are required for seamonkey and thunderbird. cloning your localization repository for the first time is just as easy. ...
... firefox nightly l10n repo, run the following command, replacing ab-cd with your locale code: hg clone https://hg.mozilla.org/l10n-central/ab-cd/ updating your local repos to update your working copy of mozilla-central, go to your local mozilla-central directory and run: hg pull -u this will both get new changesets from mozilla-central and apply those changes in your working copy. ...
...And 2 more matches
Localization formats
ent of mozilla web sites and not to the development of gecko-based extensions or applications. ...
...s or applications. there are 4 main approaches to web l10n with regards to the choice of technology used for localization logic: html/php .lang gettext (.po) wiki (tbd) the choice of the filetype depends on a couple of factors: how much content is there to be localized? how often, if at all, the site will be updated after the launch? is this a long-term project with continuous updates to content? is this a long-term project with stable content? is this a short-term project? will the content differ per locale? if so, to what extent? as every new web-dev project takes shape, a project manager should ask themselves these questions and have the answers ready before starting the web l10n process. html/php maybe you are designing a project that has relatively small...
...ort-term project? will the content differ per locale? if so, to what extent? as every new web-dev project takes shape, a project manager should ask themselves these questions and have the answers ready before starting the web l10n process. html/php maybe you are designing a project that has relatively small translation needs like three to four lines (or more) of content asking users to update to the next version of software available. you may choose to present just the html for localization: we give an html file which lists several pieces of content like, <h1>getting started</h1> and the localizer translates to <h1>débuter avec firefox</h1> the localizer then submits the translated html or php back to us by either checking in changes to svn or sending us a patch that pascal ...
...And 2 more matches
NSS 3.35 release notes
services (nss) 3.35, which is a minor release. distribution information the hg tag is nss_3_35_rtm. nss 3.35 requires nspr 4.18, or newer. nss 3.35 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_35_rtm/src/ new in nss 3.35 new functionality tls 1.3 support has been updated to draft -23. this includes a large number of changes since 3.34, which supported only draft -18. see below for details. new types in sslt.h sslhandshaketype - the type of a tls handshake message. for the sslsignaturescheme enum, the enumerated values ssl_sig_rsa_pss_sha* are deprecated in response to a change in tls 1.3. please use the equivalent ssl_sig_rsa_pss_rsae_sha* for rs...
... an option to enable tls 1.3 compatibility mode, ssl_enable_tls13_compat_mode, was added. note: in this release, support for new rsa_pss_pss_shax signature schemes have been disabl...
...print: 0c:25:8a:12:a5:67:4a:ef:25:f2:8b:a7:dc:fa:ec:ee:a3:48:e5:41:e6:f5:cc:4e:e6:3b:71:b3:61:60:6a:c3 cn = global chambersign root sha-256 fingerprint: ef:3c:b4:17:fc:8e:bf:6f:97:87:6c:9e:4e:ce:39:de:1e:a5:fe:64:91:41:d1:02:8b:7d:11:c0:b2:29:8c:ed significant changes to tls 1.3 were made, along with the update from draft -18 to draft -23: support for keyupdate was added. keyupdate will be used automatically, if a cipher is used for a sufficient number of records. ssl_keylogfile support was updated for tls 1.3. an option to enable tls 1.3 compatibility mode, ssl_enable_tls13_compat_mode, was added. note: in this release, support for new rsa_pss_pss_shax signature schemes have been disabled; end-entity certificates with rsa-pss keys will still ...
...And 2 more matches
Enc Dec MAC Output Public Key as CSR
null, keysize, keyid, pr_false, pwdata); if (!key) { pr_fprintf(pr_stderr, "symmetric key generation failed \n"); } return key; } /* * macinit */ secstatus macinit(pk11context *ctx) { secstatus rv = pk11_digestbegin(ctx); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac failed : pk11_digestbegin()\n"); } return rv; } /* * macupdate */ secstatus macupdate(pk11context *ctx, unsigned char *msg, unsigned int msglen) { secstatus rv = pk11_digestop(ctx, msg, msglen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac failed : digestop()\n"); } return rv; } /* * finalize macing */ secstatus macfinal(pk11context *ctx, unsigned char *mac, unsigned int *maclen, unsigned int maxle...
... pr_fprintf(pr_stderr, "compute mac failed : pk11_digestfinal()\n"); } return secsuccess; } /* * compute mac */ secstatus computemac(pk11context *ctxmac, unsigned char *ptext, unsigned int ptextlen, unsigned char *mac, unsigned int *maclen, unsigned int maxlen) { secstatus rv = macinit(ctxmac); if (rv != secsuccess) return rv; rv = macupdate(ctxmac, ptext, ptextlen); if (rv != secsuccess) return rv; rv = macfinal(ctxmac, mac, maclen, maxlen); return rv; } /* * writetoheaderfile */ secstatus writetoheaderfile(const char *buf, unsigned int len, headertype type, prfiledesc *outfile) { secstatus rv; const char *header; const char *trailer; switch (type) { case symkey: ...
...arams rsaparams; void *params; seckeyprivatekey *privkey = null; secstatus rv; unsigned char randbuf[blocksize + 1]; rv = generaterandom(randbuf, blocksize); if (rv != secsuccess) { fprintf(stderr, "error while generating the random numbers : %s\n", port_errortostring(rv)); goto cleanup; } pk11_randomupdate(randbuf, blocksize); switch (keytype) { case rsakey: rsaparams.keysizeinbits = size; rsaparams.pe = publicexponent; mechanism = ckm_rsa_pkcs_key_pair_gen; algtag = sec_oid_pkcs1_md5_with_rsa_encryption; params = &rsaparams; break; default: ...
...And 2 more matches
Encrypt Decrypt_MAC_Using Token
*/ secstatus macfinal(pk11context *ctx, unsigned char *mac, unsigned int *maclen, unsigned int maxl...
... */ secstatus macfinal(pk11context *ctx, unsigned char *mac, unsigned int *maclen, unsigned int maxlen) { secstatus rv =...
... pr_fprintf(pr_stderr, "compute mac failed : pk11_digestfinal()\n"); } return secsuccess; } /* * compute mac. ...
...And 2 more matches
GCIntegration - SpiderMonkey Redirect 1
ot been marked yet. in the middle frame some code creates a pointer from b to c and destroys the pointer from a to c. in the last frame, a gets marked by the gc. the problem is that c is never marked even though it's reachable. this will likely lead to a crash if c is accessed via b. write barriers all the schemes for preventing this sort of thing require write barriers. every time a pointer is updated, a small amount of code runs that may mark one of the objects involved in the update. this only happens if an incremental gc is in progress. spidermonkey uses a simple barrier commonly called a "snapshot at the beginning" barrier. the fundamental invariant that this barrier guarantees is that any object reachable when the incremental gc started will be marked. in addition, objects allocated duri...
...ll be marked when the pointer from a to c is nulled out. this barrier is conservative—it assumes that any destroyed pointer was pointing to an object that was part of the initial snapshot. consequently, more objects may be marked than necessary, but those objects will be collected in the next gc if they're unreachable. spidermonkey implements the write barrier internally. any time a property is updated in the vm or the jit, a write barrier is invoked. the troublesome spots are the pointers in gecko that spidermonkey doesn't know about. to understand the problem more, let's consider some reasons why barriers are not needed in common areas of firefox: if a pointer is never changed after it's initialized, then there's no need for a write barrier. initializing a pointer never requires a write ...
...t have a fully formed plan in place for what will replace it, but whatever it is will likely resemble auto-rooters. the main difference is that every reference will need to be rooted. for example, the following code will be incorrect: autorootedobject obj1 = ...; jsobject *obj2 = obj1; // use obj2 if a gc runs in the middle of this code, and if obj1/obj2 is moved, then the obj1 pointer will be updated to point to the new location. the obj2 pointer will not, and it will contain garbage. we have a three-pronged strategy for ensuring that no auto-rooters are missing: all spidermonkey apis will require that only rooted objects be passed to them. so you might be able to get your hands on an unrooted object, but you won't be able to do anything with it. brian hackett has written a dynamic anal...
...And 2 more matches
Parser API
<: statement { type: "whilestatement"; test: expression; body: statement; } a while statement. interface dowhilestatement <: statement { type: "dowhilestatement"; body: statement; test: expression; } a do/while statement. interface forstatement <: statement { type: "forstatement"; init: variabledeclaration | expression | null; test: expression | null; update: expression | null; body: statement; } a for statement. interface forinstatement <: statement { type: "forinstatement"; left: variabledeclaration | expression; right: expression; body: statement; each: boolean; } a for/in statement, or, if each is true, a for each/in statement. note: the for each form is spidermonkey-specific. interface forofstatement <: statement ...
...xpression. interface binaryexpression <: expression { type: "binaryexpression"; operator: binaryoperator; left: expression; right: expression; } a binary operator expression. interface assignmentexpression <: expression { type: "assignmentexpression"; operator: assignmentoperator; left: pattern; right: expression; } an assignment operator expression. interface updateexpression <: expression { type: "updateexpression"; operator: updateoperator; argument: expression; prefix: boolean; } an update (increment or decrement) operator expression. interface logicalexpression <: expression { type: "logicalexpression"; operator: logicaloperator; left: expression; right: expression; } a logical operator expression. interface conditiona...
...| "-" | "*" | "/" | "%" | "|" | "^" | "&" | "in" | "instanceof" | ".." } a binary operator token. note: the .. operator is e4x-specific. enum logicaloperator { "||" | "&&" } a logical operator token. enum assignmentoperator { "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" } an assignment operator token. enum updateoperator { "++" | "--" } an update (increment or decrement) operator token. e4x this section describes node types that are provided for e4x support. e4x has since been removed as of gecko 21. note: e4x is not part of the ecmascript standard (ecma-262), but is a separate standard of its own (ecma-357). declarations interface xmldefaultdeclaration <: declaration { type: "xmldefault...
...And 2 more matches
mozIAsyncHistory
void getplacesinfo( in jsval aplaceidentifiers, in mozivisitinfocallback acallback ); parameters aplaceidentifiers the uri for...
... in nsiuri auri, in mozivisitedstatuscallback acallback ); parameters auri the places for which to retrieve information, identified by either a single place guid, a single uri, or a js array of uris and/or guids. acallback an object implementing the mozivisitedstatuscallback.isvisited() method; this method will be called with the results once the request has been completed. ...
... auri the places for which to retrieve information, identified by either a single place guid, a single uri, or a js array of uris and/or guids. acallback an object implementing the mozivisitedstatuscallback.isvisited() method; this method will be called with the results once the request has been completed. updateplaces() adds a set of visits for one or more moziplaceinfo objects, and updates each moziplaceinfo's title or guid. ...
...And 2 more matches
nsIMicrosummary
since generators and pages can be remote resources, and we need them to generate the content, this may not always be available. read only. generator nsimicrosummarygenerator the generator that generates this microsummary. may need to be loaded. need...
...s be available. read only. generator nsimicrosummarygenerator the generator that generates this microsummary. may need to be loaded. needsremoval boolean used when a site author has indicated that a microsummary (or an associated generator) will no longer be available. read only. pageuri nsiuri the uri of the page being summarized. read only. updateinterval long the minimum interval after which this microsummary would like to be refreshed or null if it doesn't care. read only. methods addobserver() add a microsummary observer to this microsummary. void addobserver( in nsimicrosummaryobserver observer ); parameters observer the microsummary observer to add. equals() microsummary equivalence test. microsummaries equal ...
... the microsummary to compare against. return value returns true if the microsummaries are equal. false if they aren't. note: this method returns false if either objects don't have a generator removeobserver() remove a microsummary observer from this microsummary. ...
...And 2 more matches
nsIMsgFolder
the nsimsgfolder interface is used to interact with folders in thunderbird. this page is out of date. check //github.com/realityripple/uxp/blob/master/mailnews/base/public/nsimsgfolder.idl for the newer methods (esp. isspecialfolder and such). ...
...dow 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); void updatesummarytotals(in boolean force); void summarychanged(); long getnumunread(in boolean deep); long gettotalmessages(in boolean deep); void clearnewmessages(); void clearrequirescleanup(); void setflag(in unsigned long flag); void clearflag(in unsigned long flag); boolean getflag(in unsigned long flag); void toggleflag(i...
...ate_replied 0 nsmsgdispositionstate_forwarded 1 allmessagecountnotifications 0 turn notifications on/off for various notification types. currently only supporting allmessagecountnotifications which refers to both total and unread message counts. methods startfolderloading() void startfolderloading(); endfolderloading() void endfolderloading(); updatefolder() get new headers for the database. void updatefolder(nsimsgwindow awindow); getfilterlist() get the filter list on folder's server (or in the case of news, the filter list for this newsgroup). nsimsgfilterlist getfilterlist(nsimsgwindow msgwindow); setfilterlist() void setfilterlist(in nsimsgfilterlist filterlist); forcedbclosed() void forcedbclosed(); delete() void del...
...And 2 more matches
nsINavHistoryObserver
ports last changed in gecko 21.0 (firefox 21.0 / thunderbird 21.0 / seamonkey 2.18) warning: if you are in the middle of a batch transaction, there may be a database transaction active. you can still access the database in this situation but be careful (of what?). ...
...tabase in this situation but be careful (of what?). ...
...an out of memory error), then you may get a notification even though the page doesn't wind up getting deleted. note: see using onbeforedeleteuri() in gecko 1.9.1 for how to implement this in gecko 1.9.1 void onbeforedeleteuri( in nsiuri auri, in acstring aguid ); parameters auri the uri of the page about to be deleted. aguid the unique id associated with the page. onbeginupdatebatch() notifies you that a batch of things are about to change. you should avoid doing any heavy-duty processing until onendupdatebatch() is called. void onbeginupdatebatch(); parameters none. onclearhistory() called just prior to all of history being cleared. void onclearhistory(); parameters none. ondeleteuri() the specified page and all its visits has been deleted. delete notifications are n...
...And 2 more matches
nsIWindowMediator
zlevelbottom 2 send window to bottom. zlevelbelow 3 place window below some window. methods addlis...
... zlevelbottom 2 send window to bottom. zlevelbelow 3 place window below some window. methods addlistener() register a listener for window status changes. void addlistener( in ...
...getmostrecentwindow( in wstring awindowtype ); parameters awindowtype return the topmost window of this type. ("type" is the |windowtype| attribute of the xml <window> element.) if null, return the topmost window of any type. return value the topmost window. note: starting in gecko 8.0, the returned value is an nsidomwindow; previously, it was an nsidomwindowinternal. you may need to update your code or recompile binary components, if they use this method. getouterwindowwithid() return the outer window with the given id, if any. nsidomwindow getouterwindowwithid( in unsigned long long aouterwindowid ); parameters aouterwindowid the id of the outer window, e.g., as obtained by nsidomwindowutils.outerwindowid. return value the dom window with the given id. if no window ...
...And 2 more matches
XPCOM Interface Reference
tmozistorageprogresshandlermozistorageresultsetmozistoragerowmozistorageservicemozistoragestatementmozistoragestatementcallbackmozistoragestatementparamsmozistoragestatementrowmozistoragestatementwrappermozistoragevacuumparticipantmozistoragevaluearraymozitxttohtmlconvmozithirdpartyutilmozivisitinfomozivisitinfocallbackmozivisitstatuscallbacknsiabcardnsiaboutmodulensiabstractworkernsiaccelerometerupdatensiaccessnodensiaccessibilityservicensiaccessiblensiaccessiblecaretmoveeventnsiaccessiblecoordinatetypensiaccessibledocumentnsiaccessibleeditabletextnsiaccessibleeventnsiaccessiblehyperlinknsiaccessiblehypertextnsiaccessibleimagensiaccessibleprovidernsiaccessiblerelationnsiaccessibleretrievalnsiaccessiblerolensiaccessiblescrolltypensiaccessibleselectablensiaccessiblestatechangeeventnsiaccessiblest...
...accessibletablechangeeventnsiaccessibletextnsiaccessibletextchangeeventnsiaccessibletreecachensiaccessiblevaluensiaccessiblewin32objectnsialertsservicensiannotationobservernsiannotationservicensiappshellnsiappshellservicensiappstartupnsiappstartup_mozilla_2_0nsiapplicationcachensiapplicationcachechannelnsiapplicationcachecontainernsiapplicationcachenamespacensiapplicationcacheservicensiapplicationupdateservicensiarraynsiasyncinputstreamnsiasyncoutputstreamnsiasyncstreamcopiernsiasyncverifyredirectcallbacknsiauthinformationnsiauthmodulensiauthpromptnsiauthprompt2nsiauthpromptadapterfactorynsiauthpromptcallbacknsiauthpromptprovidernsiauthpromptwrappernsiautocompletecontrollernsiautocompleteinputnsiautocompleteitemnsiautocompletelistenernsiautocompleteobservernsiautocompleteresultnsiautocompletesea...
...nsifeedresultnsifeedresultlistenernsifeedtextconstructnsifilensifileinputstreamnsifileoutputstreamnsifilepickernsifileprotocolhandlernsifilespecnsifilestreamsnsifileurlnsifileutilitiesnsifileviewnsifocusmanagernsiformhistory2nsiframeloadernsiframeloaderownernsiframemessagelistenernsiframemessagemanagernsiframescriptloadernsigsettingscollectionnsigsettingsservicensigeolocationprovidernsigeolocationupdatensiglobalhistorynsiglobalhistory2nsiglobalhistory3nsihtmleditornsihttpheaderlistenernsihapticfeedbacknsihttpactivitydistributornsihttpactivityobservernsihttpchannelnsihttpchannelinternalnsihttpheadervisitornsihttpservernsihttpupgradelistenernsiidnservicensiiframeboxobjectnsiiniparsernsiiniparserfactorynsiiniparserwriternsiioservicensiidleservicensiinprocesscontentframemessagemanagernsiinputstreamn...
...And 2 more matches
Introduction to DOM Inspector - Firefox Developer Tools
it will contain the list of currently loaded chrome windows and subdocuments. a browser window and the dom inspector are likely be already open and displayed in this list. the dom inspector keeps track of all the windows that are open, so to inspect the dom of a particular window in the dom inspector, simply access that window as you would normally and then choose its title from this dynamically updated menulist. inspecting arbitrary urls you may also inspect the dom of arbitrary urls by using the inspect a url menuitem in the file menu, or by just entering a url into the dom inspector's address bar and clicking inspect or pressing enter. for example, you can enter http://www.mozilla.org in the address bar and see the dom structure of the mozilla.org home page. you should not use this appr...
...rome you are interested in, you'll see that it loads the dom nodes viewer in the document pane and the dom node viewer in the object pane. in the dom nodes viewer, there should be a structured, hierarchical view of the dom. by clicking around in the document pane, you'll see that the viewers are linked; whenever you select a new node from the dom nodes viewer, the dom node viewer is automatically updated to reflect the information for that node. linked viewers are the first major aspect to understand when learning how to use the dom inspector. dom inspector viewers note that these viewers are just two viewers that the dom inspector provides. it's possible to use other viewers, but for now we'll stick to describing the dom nodes viewer and the dom node viewer. you can use the dom nodes viewer ...
...n by id, class, or attribute. when you select edit > find nodes... or press ctrl + f, the dom inspector displays a find dialog that lets you find elements in various ways, and that gives you incremental searching by way of the <f3> shortcut key. updating the dom dynamically another feature to mention in this introduction is the ability is the ability the dom inspector gives you to dynamically update information reflected in the dom about web pages, user interface, and other elements. note that when the dom inspector displays information about a particular node or subtree, it presents individual nodes and their values (in the dom, attributes are subnodes of elements, typically) in an active list. you can perform actions on the individual items in this list from the context menu and the edit m...
...And 2 more matches
Element.shadowRoot - Web APIs
losed. (see element.attachshadow() for further details). examples the following snippets are taken from our life-cycle-callbacks example (see it live also), which creates an element that displays a square of a size and color specified in the element's attributes. ...
... in the element's attributes. inside the <custom-square> element's class definition we include some life cycle callbacks that make a call to an external function, updatestyle(), which actually applies the size and color to the element. you'll see that we are passing it this (the custom element itself) as a parameter. ...
...l to an external function, updatestyle(), which actually applies the size and color to the element. you'll see that we are passing it this (the custom element itself) as a parameter. connectedcallback() { console.log('custom square element added to page.'); updatestyle(this); } attributechangedcallback(name, oldvalue, newvalue) { console.log('custom square element attributes changed.'); updatestyle(this); } in the updatestyle() function itself, we get a reference to the shadow dom using element.shadowroot. ...
...And 2 more matches
Using files from web applications - Web APIs
doctype html> <html> <head> <meta charset="utf-8"> <title>file(s) size</title> </head> <body> <form name="uploadform"> <div> <input id="uploadinput" type="file" name="myfiles" multiple> selected files: <span id="filenum">0</span>; total size: <span id="filesize">0</span> </div> <div><input type="submit" value="send file"></div> </form> <script> function updatesize() { let nbytes = 0, ofiles = this.files, nfiles = ofiles.length; for (let nfileid = 0; nfileid < nfiles; nfileid++) { nbytes += ofiles[nfileid].size; } let soutput = nbytes + " bytes"; // optional code for multiples approximation const amultiples = ["kib", "mib", "gib", "tib", "pib", "eib", "zib", "yib"]; for (nmultiple = 0, napprox = nbytes /...
...you can do this by styling the input element with display:none and calling the click() method on the <input> element. conside...
... from which to read the image data. ...
...And 2 more matches
Using the Gamepad API - Web APIs
on that is fully pressed. axes: an array representing the controls with axes present on the device (e.g. analog thumb sticks). each entry in the array is a floating point value in the range -1.0 - 1.0, representing the axis position from the lowest value (-1.0) to the highest value (1.0). timestamp: this returns a domhighrestimestamp representing the last time the data for this gamepad was updated, allowing developers to determine if the axes and button data have been updated from the hardware. the value must be relative to the navigationstart attribute of the performancetiming interface. values are monotonically increasing, meaning that they can be compared to determine the ordering of updates, as newer values will always be greater than or equal to older values. note that this property ...
...l always be greater than or equal to older values. note that this property is not currently supported in firefox. note: the gamepad object is available on the gamepadconnected event rather than the window object itself, for security reasons. once we have a reference to it, we can query its properties for information about the current state of the gamepad. behind the scenes, this object will be updated every time the gamepad's state changes. using button information let's look at a simple example that displays connection information for one gamepad (it ignores subsequent gamepad connections) and allows you to move a ball around the screen using the four gamepad buttons on the right hand side of the gamepad. you can view the demo live, and find the source code on github. to start with, we d...
... { var gp = gamepads[i]; if (gp) { gamepadinfo.innerhtml = "gamepad connected at index " + gp.index + ": " + gp.id + ". it has " + gp.buttons.length + " buttons and " + gp.axes.length + " axes."; gameloop(); clearinterval(interval); } } } now on to the main game loop. in each execution of the loop we check if one of four buttons is being pressed; if so, we update the values of the a and b movement variables appropriately, then update the left and top properties, changing their values to the current values of a and b respectively. this has the effect of moving the ball around the screen. 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. this is fixed i...
...And 2 more matches
MouseEvent.pageX - Web APIs
Web › API › MouseEvent › pageX
specification as a long integer, but was redefined in the cssom view module to be a double-precision floating-point number to allow for subpixel precision. even though numeric types both are represented by number in javascript, they may be handled differently internally in the browser's code, resulting in potential behavior differences. see browser compatibility to learn which browsers have been updated to use the revised data type. example more examples you can also see an example that demonstrates how to access the mouse position information in every available coordinate system. let's take a look at a simple example that shows you the mouse's position relative to the page's origin. since this example is presented in an <iframe>, that top-left corner is the top-left corner of the frame, no...
...dinate system. let's take a look at a simple example that shows you the mouse's position relative to the page's origin. since this example is presented in an <iframe>, that top-left corner is the top-left corner of the frame, not the browser window. ...
... this example is presented in an <iframe>, that top-left corner is the top-left corner of the frame, not the browser window. ...
...And 2 more matches
Multi-touch interaction - Web APIs
ent is fired when a pointer (mouse, pen/stylus or touch point on a touchscreen) makes contact with the contact surface. the event's state must be cached, in case this down event is part of a multi-touch interaction. in this application, when a pointer is placed down on an element, the background color of the element changes, depending on the number of active touch points the element has. ...
...n element, the background color of the element changes, depending on the number of active touch points the element has. see the update_background function for more details about the color changes. function pointerdown_handler(ev) { // the pointerdown event signals the start of a touch interaction. // save this event for later processing (this could be part of a // multi-touch interaction) and update the background color push_event(ev); if (logevents) log("pointerdown: name = " + ev.target.id, ev); update_background(ev); } pointer move the pointermove handler is called when the pointer moves. it may be called multiple times (for example, if the user moves the pointer) before a different event type is fired. in this application, a pointer move is represented by the target's border being...
... the element has received this event. function pointermove_handler(ev) { // note: if the user makes more than one "simultaneous" touch, most browsers // fire at least one pointermove event and some will fire several pointermoves. // // this function sets the target element's border to "dashed" to visually // indicate the target received a move event. if (logevents) log("pointermove", ev); update_background(ev); ev.target.style.border = "dashed"; } pointer up the pointerup event is fired when a pointer is raised from the contact surface. when this occurs, the event is removed from the associated event cache. in this application, this handler is also used for pointercancel, pointerleave and pointerout events. function pointerup_handler(ev) { if (logevents) log(ev.type, ev); // re...
...And 2 more matches
Using Service Workers - Web APIs
ant to cache. if the promise is rejected, the install fails, and the worker won’t do anything. this is ok, as you can fix your code and then try again the next time registration occurs. after a successful installation, the service worker activates. this doesn’t have much of a distinct use the first time your service worker is installed/activated, but it means more when the service worker is updated (see the updating your service worker section later on.) note: localstorage works in a similar way to service worker cache, but it is synchronous, so not allowed in service workers. note: indexeddb can be used inside a service worker for data storage if you require it. custom responses to requests now you’ve got your site assets cached, you need to tell service workers to do something...
... self.addeventlistener('fetch', (event) => { event.respondwith( // magic goes here ); }); we could start by simply responding with the resource whose url matches that of the network request, in each case: self.addeventlistener('fetch', (event) => { event.respondwith( caches.match(event.request) ); }); caches.match(event.request) allows us to match each...
... updating your service worker if your service worker has previously been installed, but then a new version of the worker is available on refresh or page load, the new version is installed in the background, but not yet activated. it is only activated when ther...
...And 2 more matches
Service Worker API - Web APIs
they will also allow access to push notifications and background sync apis. ...
... installation/activation (see below) for urls accessed by the user inside the whole origin, or inside a subset specified by you. download, install and activate at this point, your service worker will observe the following lifecycle: download install activate the service worker is immediately downloaded when a user first accesses a service worker–controlled site/page. after that, it is updated when: a navigation to an in-scope page occurs. an event is fired on the service worker and it hasn't been downloaded in the last 24 hours. installation is attempted when the downloaded file is found to be new — either different to an existing service worker (byte-wise compared), or the first service worker encountered for this page/site. if this is the first time a service worker has be...
...nal events are not dispatched to the service worker until the promise is successfully resolved. for a complete tutorial to show how to build up your first basic example, read using service workers. other use case ideas service workers are also intended to be used for such things as: background data synchronization. responding to resource requests from other origins. receiving centralized updates to expensive-to-calculate data such as geolocation or gyroscope, so multiple pages can make use of one set of data. client-side compiling and dependency management of coffeescript, less, cjs/amd modules, etc. for development purposes. hooks for background services. custom templating based on certain url patterns. performance enhancements, for example pre-fetching resources that the user is l...
...And 2 more matches
ShadowRoot - Web APIs
e caret, and caret's character offset within that node. examples the following snippets are taken from our life-cycle-callbacks example (see it live also), which creates an element that displays a square of a size and color specified in the element's attributes. ...
... in the element's attributes. inside the <custom-square> element's class definition we include some life cycle callbacks that make a call to an external function, updatestyle(), which actually applies the size and color to the element. you'll see that we are passing it this (the custom element itself) as a parameter. ...
...l to an external function, updatestyle(), which actually applies the size and color to the element. you'll see that we are passing it this (the custom element itself) as a parameter. connectedcallback() { console.log('custom square element added to page.'); updatestyle(this); } attributechangedcallback(name, oldvalue, newvalue) { console.log('custom square element attributes changed.'); updatestyle(this); } in the updatestyle() function itself, we get a reference to the shadow dom using element.shadowroot. ...
...And 2 more matches
Web audio spatialization basics - Web APIs
function moveboombox(direction) { switch (direction) { case 'left': if (transform.xax...
...rbound = 1.5; let's create a function that takes the direction we want to move as a parameter, and both modifies the css transform and updates the position and orientation values of our panner node properties to change the sound as appropriate. to start with let's take a look at our left, right, up and down values as these are pretty straightforward. we'll move the boombox along these axis and update the appropriate position. function moveboombox(direction) { switch (direction) { case 'left': if (transform.xaxis > leftbound) { transform.xaxis -= 5; panner.positionx.value -= 0.1; } break; case 'up': if (transform.yaxis > topbound) { transform.yaxis -= 5; panner.posit...
...o: case 'back': if (transform.zaxis > innerbound) { transform.zaxis -= 0.01; panner.positionz.value += 40; } break; case 'forward': if (transform.zaxis < outerbound) { transform.zaxis += 0.01; panner.positionz.value -= 40; } break; our rotation values are a little more involved, however, as we need to move the sound around. not only do we have to update two axis values (e.g. if you rotate an object around the x-axis, you update the y and z coordinates for that object), but we also need to do some more maths for this. the rotation is a circle and we need math.sin and math.cos to help us draw that circle. let's set up a rotation rate, which we'll convert into a radian range value for use in math.sin and math.cos later, when we want to figure out ...
...And 2 more matches
Using the Web Storage API - Web APIs
ad by calling storageavailable('sessionstorage'). see here for a brief history of feature-detecting localstorage. example to illustrate some typical web storage usage, we have created an example, imaginatively called web storage demo. the landing page provides controls that can be used to customize the color, font, and decorative image: when you choose different options, the page is instantly updated; in addition, your choices are stored in localstorage, so that when you leave the page and load it again, later on, your choices are remembered. we have also provided an event output page — if you load this page in another tab, then make changes to your choices in the landing page, you'll see the updated storage information outputted as a storageevent is fired. note: as well as viewing th...
...was previously accessed): if(!localstorage.getitem('bgcolor')) { populatestorage(); } else { setstyles(); } the storage.getitem() method is used to get a data item from storage; in this case, we are testing to see whether the bgcolor item exists; if not, we run populatestorage() to add the existing customization values to the storage. if there are already values there, we run setstyles() to update the page styling with the stored values. note: you could also use storage.length to test whether the storage object is empty or not. getting values from storage as noted above, values can be retrieved from storage using storage.getitem(). this takes the key of the data item as an argument, and returns the data value. for example: function setstyles() { var currentcolor = localstorage.getite...
... document.getelementbyid('image').value = currentimage; htmlelem.style.backgroundcolor = '#' + currentcolor; pelem.style.fontfamily = currentfont; imgelem.setattribute('src', currentimage); } here, the first three lines grab the values from local storage. next, we set the values displayed in the form elements to those values, so that they keep in sync when you reload the page. finally, we update the styles/decorative image on the page, so your customization options come up again on reload. setting values in storage storage.setitem() is used both to create new data items, and (if the data item already exists) update existing values. this takes two arguments — the key of the data item to create/modify, and the value to store in it. function populatestorage() { localstorage.setitem('...
...And 2 more matches
ARIA: timer role - Accessibility
is defines this div element as a timer with no remaining time. description the timer role indicates to assistive technologies that this part of the web content is a live region containing a timer listing the time remaining or elapsed time. a timer's inner text should be an updating current time measurement. while the value does not necessarily need to be machine parsable, it should continuously update at regular intervals unless the timer is paused or reaches its end-point. associated wai-aria roles, states, and properties aria-label used to provide the name of the timer. aria-live elements with the role timer have an implicit aria-live value of off. aria-describedby used to indicate the idref of an element that contains additional instructions for navigating or operating this element...
...g to the regular web content on other parts of the page, must be handled. use wisely, and cautiously! examples some prominent web timers include clocks, stop watches and countdowns, such as ticketing websites, e-commerce sites, and event countdowns (see https://countingdownto.com/). as an illustration of aria-atomic, consider a site with a simple clock, showing hours and minutes. ...
...e sites, and event countdowns (see https://countingdownto.com/). as an illustration of aria-atomic, consider a site with a simple clock, showing hours and minutes. the clock is updated each minute, with the new remaining time simply overwriting the current content. ...
...And 2 more matches
Web applications and ARIA FAQ - Accessibility
his example, the role="progressbar" attribute informs the browser that this element is actually a javascript-powered progress bar widget. the aria-valuemin and aria-valuemax attributes specify the minimum and maximum values for the progress bar, and the aria-valuenow describes the current state of it. along with placing them directly in the markup, aria attributes can be added to the element and updated dynamically using javascript code like this: // find the progress bar <div> in the dom. var progressbar = document.getelementbyid("percent-loaded"); // set its aria roles and states, so that assistive technologies know what kind of widget it is. progressbar.setattribute("role", "progressbar"); progressbar.setattribute("aria-valuemin", 0); progressbar.setattribute("aria-valuemax", 100); // cre...
.../ find the progress bar <div> in the dom. var progressbar = document.getelementbyid("percent-loaded"); // set its aria roles and states, so that assistive technologies know what kind of widget it is. progressbar.setattribute("role", "progressbar"); progressbar.setattribute("aria-valuemin", 0); progressbar.setattribute("aria-valuemax", 100); // create a function that can be called at any time to update the value of the progress bar. function updateprogress(percentcomplete) { progressbar.setattribute("aria-valuenow", percentcomplete); } will adding aria change my page styles or behavior? no, aria is only made available to assistive technology apis, and doesn't affect native browser functionality with respect to the dom or styling. from the browser's point of view, the native html defines the...
...so, using the example of a progress bar, you can degrade gracefully to a role="progressbar" in cases where the <progressbar> tag isn't supported. here is an example of the markup used for an html5 progress bar: <!doctype html> <html> <head><title>gracefully degrading progress bar</title></head> <body> <progress id="progress-bar" value="0" max="100">0% complete</progress> <button id="update-button">update</button> </body> </html> ... and here is the javascript code that will ensure the progress bar still works in older browsers: var progressbar = document.getelementbyid("progress-bar"); // check to see if the browser supports the html5 <progress> tag. var supportshtml5progress = (typeof (htmlprogresselement) !== "undefined"); function setupprogress() { if (!supportshtml5prog...
...And 2 more matches
Cross-browser audio basics - Developer guides
ot due to an error. error an error is encountered while media data is being download. emptied the media buffer has been emptied, possibly due to an error or because the load() method was invoked to reload it. stalled media data is unexpectedly no longer available. media playing events we also have another set of events that are useful for reacting to the state of the media playback. ...
...or. error an error is encountered while media data is being download. emptied the media buffer has been emptied, possibly due to an error or because the load() method was invoked to reload it. stalled media data is unexpectedly no longer available. media playing events we also have another set of events that are useful for reacting to the state of the media playback. ...
...nexpectedly no longer available. media playing events we also have another set of events that are useful for reacting to the state of the media playback. timeupdate the timeupdate event is triggered every time the currenttime property changes. in practice, this occurs every 250 milliseconds. this event can be used to trigger the displaying of playback progress. myaudio.addeventlistener("timeupdate", function() { //update something related to playback progress }); playing the playing event is initiated when playback is ready to start after having being paused due to lack of media data. waiting the waiting event is triggered when playback has stopped due to lack of media data, although it is expected to resume once data becomes available. play the play event is initiated after the pl...
...And 2 more matches
Creating a cross-browser video player - Developer guides
n">mute/unmute</button></li> <li><button id="volinc" type="button">vol+</button></li> <li><button id="voldec" type="button">vol-</button></li> <li><button id="fs" type="button">fullscreen</button></li> </ul> each button is given an id so it can be easily accessed with javascript. the span within the <progress> element is for browsers that do not support the progress element and will be updated at the same time as progress (this span element won't be visible on browsers that support progress). the controls are initially hidden with a css display:none and will be enabled with javascript. again if a user has javascript disabled, the custom control set will not appear and they can use the browser's default control set unhindered. of course this custom control set is currently useless an...
...when the video's metadata has been loaded: video.addeventlistener('loadedmetadata', function() { progress.setattribute('max', video.duration); }); unfortunately in some mobile browsers, when loadedmetadata is raised — if it even is raised — video.duration may not have the correct value, or even any value at all. so something else needs to be done. more on that below. ...
...rect value, or even any value at all. so something else needs to be done. more on that below. another event, timeupdate, is raised periodically as the video is being played through. this event is ideal for updating the progress bar's value, setting it to the value of the video's currenttime attribute, which indicates how far through the video the current playback is. video.addeventlistener('timeupdate', function() { progress.value = video.currenttime; progressbar.style.width = math.floor((video.currenttime / video.duration) * 100) + '%'; }); as the timeupdate event is raised, the progress element's value attribute is set to the video's currenttime. ...
...And 2 more matches
Index - Developer guides
Web › Guide › Index
your until-now-webkit-only sites work with firefox, which uses the unprefixed version of the spec. 16 audio and video manipulation audio, canvas, examples, guide, html5, media, video, web audio api, webgl, developer recommendation the ability to read the pixel values from each frame of a video can be very useful. 17 event developer guide dom, event, guide, needsupdate, events events refers both to a design pattern used for the asynchronous handling of various incidents which occur in the lifetime of a web page and to the naming, characterization, and use of a large number of incidents of different types. 18 creating and triggering events advanced, dom, guide, javascript, needscontent, events this article demonstrates how to create an...
...number of incidents of different types. 18 creating and triggering events advanced, dom, guide, javascript, needscontent, events this article demonstrates how to create and dispatch dom events. such events are commonly called synthetic events, as opposed to the events fired by the browser itself. 19 dom onevent handlers beginner, dom, dom beginner, needsbeginnerupdate, needsupdate the web platform provides several ways to be notified of dom events. two common approaches are addeventlistener() and the specific onevent handlers. 20 media events intermediate, media various events are sent when handling media that are embedded in html documents using the <audio> and <video> elements; this section lists them and provides some helpful info...
...termediate, mobile, motion, needscontent, orientation, páginas_a_traducir, rotation when using orientation and motion events, it's important to understand what the values you're given by the browser mean. this article provides details about the coordinate systems at play and how you use them. 24 overview of events and handlers beginner, dom, example, javascript, needsbeginnerupdate, needsupdate, events this overview of events and event handling explains the code design pattern used to react to incidents occurring when a browser accesses a web page, and it summarizes the types of such incidents modern web browsers can handle. 25 touch events (mozilla experimental) dom the experimental touch events api described on this page was available from gecko...
...And 2 more matches
<input type="button"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › button
begin by creating a simple button with a click event handler that starts our machine (well, it toggles the value of the button and the text content of the following paragraph): <form> <input type="button" value="start machine"> </form> <p>the machine is stopped.</p> const button = document.queryselector('input'); const paragraph = document.queryselector('p'); button.addeventlistener('click', updatebutton); function updatebutton() { if (button.value === 'start machine') { button.value = 'stop machine'; paragraph.textcontent = 'the machine has started!'; } else { button.value = 'start machine'; paragraph.textcontent = 'the machine is stopped.'; } } the script gets a reference to the htmlinputelement object representing the <input> in the dom, saving this refence in the...
...cified as the access key (you'll need to press s plus the particular modifier keys for your browser/os combination; see accesskey for a useful list of those). ...
...(you'll need to press s plus the particular modifier keys for your browser/os combination; see accesskey for a useful list of those). ...
...And 2 more matches
Using custom elements - Web Components
/custom-square> the class constructor is really simple — here we attach a shadow dom to the element, then attach empty <div> and <style> elements to the shadow root: const shadow = this.attachshadow({mode: 'open'}); const div = document.createelement('div'); const style = document.createelement('style'); shadow.appendchild(style); shadow.appendchild(div); the key function in this example is updatestyle() — this takes an element, gets its shadow root, finds its <style> element, and adds width, height, and background-color to the style. function updatestyle(elem) { const shadow = elem.shadowroot; shadow.queryselector('style').textcontent = ` div { width: ${elem.getattribute('l')}px; height: ${elem.getattribute('l')}px; background-color: ${elem.getattribute('c')};...
...element, gets its shadow root, finds its <style> element, and adds width, height, and background-color to the style. function updatestyle(elem) { const shadow = elem.shadowroot; shadow.queryselector('style').textcontent = ` div { width: ${elem.getattribute('l')}px; height: ${elem.getattribute('l')}px; background-color: ${elem.getattribute('c')}; } `; } the actual updates are all handled by the life cycle callbacks, which are placed inside the class definition as methods. ...
...or('style').textcontent = ` div { width: ${elem.getattribute('l')}px; height: ${elem.getattribute('l')}px; background-color: ${elem.getattribute('c')}; } `; } the actual updates are all handled by the life cycle callbacks, which are placed inside the class definition as methods. ...
...And 2 more matches
ui/button/action - Archive of obsolete content
click: function(state) { console.log("button '" + state.label + "' was clicked"); } }); by default, the button appears in the firefox toolbar: however, users can move it to the firefox menu panel using the toolbar customization feature: badged buttons new in firefox 36. you can add a "badge" to a button using its badge property. this can be a number or a string, and you can update it at any time. by default the badge's color is red, but you can set your own color using the badgecolor property, specified as a css <color> value: var { togglebutton } = require("sdk/ui/button/toggle"); var button = togglebutton({ id: "my-button1", label: "my button1", icon: "./icon-16.png", onchange: changed, badge: 0, badgecolor: "#00aaaa" }); function changed(sta...
...ked '" + state.label + "' again"); } the listener is passed a state object that contains all the button's properties. you can generate click events programmatically with the button's click() method. disabling buttons you can disable a button by setting its disabled property to true. a disabled button will not generate click events and its icon will appear disabled: updating state you can update all the button's properties except for its id. by default, the button has global state: that is, its properties are the same across all open windows and tabs, and updating them updates the button's state across all open windows and tabs. you can set state to be specific to a window or tab using the button's state() method. to set state like this, call state() with 2 parameters: the first par...
... tabs. you can set state to be specific to a window or tab using the button's state() method. to set state like this, call state() with 2 parameters: the first parameter is a window or tab object or as a shorthand, the string "window" for the currently active window, or the string "tab" for the currently active tab the second parameter is an object containing the state properties you wish to update. here's an add-on with a button that disables itself when you click it, but only for the currently active window: var { actionbutton } = require("sdk/ui/button/action"); var button = actionbutton({ id: "my-button", label: "my button", icon: { "16": "./firefox-16.png", "32": "./firefox-32.png" }, onclick: disableforthiswindow }); function disableforthiswindow...
...el: "my button", icon: { "16": "./firefox-16.png", "32": "./firefox-32.png" }, onclick: function(state) { console.log("you clicked '" + state.label + "'"); } }); button.click(); state() get or set the button's state for a specific window or tab. by default, a button's properties are global, meaning that they are the same across all open windows and tabs, and that if you update these properties, then they are updated across all windows and tabs. but sometimes you want a button attached to one window (or tab) to have a different state to a button attached to a different window (or tab). that's what state() is for. to set a button's properties for a specific window or tab, call state(), passing it the window or tab you want the property to apply to, and the property valu...
package.json - Archive of obsolete content
.rdf. translators an array of strings listing the people who contributed to the localization of this add-on. these values will be used as the add-on's em:translator elements in its install.rdf. note: jpm supports nodejs people fields. unpack same as the unpack in an install.rdf file. useful when the extension contains binaries. updatekey same as the updatekey in an install.rdf file. see supporting updates for self-hosted add-ons. note: this key is only available with jpm. updatelink same as the updatelink for an update.rdf file. previously was --update-link in cfx. see supporting updates for self-hosted add-ons. note: this key is only available with jpm. ...
... note: this key is only available with jpm. version string representing the version of the add-on. defaults to "0.0.1". this value is used as the add-on's em:version element in its install.rdf. ...
... note: this key is only available with jpm. version string representing the version of the add-on. defaults to "0.0.1". this value is used as the add-on's em:version element in its install.rdf. ...
... note: this key is only available with jpm. version string representing the version of the add-on. defaults to "0.0.1". this value is used as the add-on's em:version element in its install.rdf. ...
Listening to events in Firefox extensions - Archive of obsolete content
for a number of these progress events from web pages. most of this goes on in browser.js. domlinkhandler the domlinkhandler object is called by the domlinkadded event in order to detect any rss feeds, site icons, or opensearch plugins for the web site. ...
...or the web site. pageshoweventhandlers the pageshoweventhandlers() function is called by the pageshow event and is used to populate the character set menu and update the ui elements associated with any detected feeds or opensearch plugins for the website. xulbrowserwindow xulbrowserwindow is an nsiwebprogresslistener used to get progress events for the currently visible browser. ...
...pageshoweventhandlers() function is called by the pageshow event and is used to populate the character set menu and update the ui elements associated with any detected feeds or opensearch plugins for the website. xulbrowserwindow xulbrowserwindow is an nsiwebprogresslistener used to get progress events for the currently visible browser. ...
...s associated with any detected feeds or opensearch plugins for the website. xulbrowserwindow xulbrowserwindow is an nsiwebprogresslistener used to get progress events for the currently visible browser. it is used to update the ui for many different reasons: update the progress bar and status messages as pages load turn on and off the throbber as pages load set the site icon when available update the address bar as the user navigates hide notification bars when appropriate as the user navigates apply the site zoom preferences to newly loading pages update the bookmarking star button ui update the identity display as the site's security changes tabsprogresslistener this object is a tabs progress listener and receives events for all browsers in the window. it is used to detect when a...
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
e special visual effects for extensions. first, add the skin directory and its subordinate files to your helloworld directory as shown in figure 10. the purpose of each of these files is explained in table 4. download the files icon.png and icon-small.png from the resources website and place them appropriately. fixme: figure 10: directory structure with skin package added add the skin package update chrome.manifest with the contents of listing 10. listing 10: additional content for chrome.manifest skin helloworld classic/1.0 skin/classic/ style chrome://browser/content/browser.xul chrome://helloworld/skin/overlay.css style chrome://global/content/customizetoolbar.xul chrome://helloworld/skin/overlay.css register skin package (skin instruction) line 1 beginning skin is used to register t...
...e firefox standard theme. cross-package overlays with style sheets (style instruction) in phase 1, we used the overlay instruction to invoke a cross-package overlay with xul; to do this with a style sheet, we use the style instruction. lines 2-3 create overlays on the browser window and the “customize toolbar” window. add the toolbar button to add the toolbar button to the browser window, update overlay.xul as shown in listing 11. in order to make it so that users can relocate the button where they like, you will add a new toolbarbutton element, using the special element toolbarpalette with the id browsertoolbarpalette as the merge point. you’ll also add a new command element, so that a click on the toolbar button will share its process with the menu item. listing 11: revisions to ove...
...lines 1–3 define the icon image to use with full-sized icons, and lines 4–6 define the icon image to use when small toolbar icons have been selected. listing 12: content for overlay.css #helloworldbutton { list-style-image: url(chrome://helloworld/skin/icon.png); } toolbar[iconsize="small"] #helloworldbutton { list-style-image: ur...
...ld fr-fr jar:chrome/helloworld.jar!/locale/fr-fr/ skin helloworld classic/1.0 jar:chrome/helloworld.jar!/skin/classic/ style chrome://browser/content/browser.xul chrome://helloworld/skin/overlay.css style chrome://global/content/customizetoolbar.xul chrome://helloworld/skin/overlay.css that completes the process of xpi packaging. one point you need to take special note of is that in step 4, you updated chrome.manifest so that the files it refers to have paths pointing inside the zip archive. in order to go back into development mode after you’ve finished packaging the extension as an xpi, you need to revert the chrome.manifest you edited in step 4 to point to the backup files in step 3. if you forget to do this, any subsequent changes you make to your source files during development will no...
Creating a dynamic status bar extension - Archive of obsolete content
ck. concepts covered in the previous sample won't be reiterated here; instead, refer to the downloadable sample code or to the previous sample for further details. download the sample you can download a copy of this sample to look over, or to use as the basis for your own extension. ...
...ere; instead, refer to the downloadable sample code or to the previous sample for further details. download the sample you can download a copy of this sample to look over, or to use as the basis for your own extension. or, if you've already got the code from the creating a status bar extension sample, you can follow this tutorial to update that existing code with new features. ...
...his sample to look over, or to use as the basis for your own extension. or, if you've already got the code from the creating a status bar extension sample, you can follow this tutorial to update that existing code with new features. download the sample update the install manifest replace all occurrences of the first sample's id, "status-bar-sample-1", with the new sample's id, "stockwatcher", and update the front end metadata to describe our new extension. see install manifests for details. update the chrome manifest the chrome manifest needs only a minor update from the previous sample; simply replace the id of the first sample, "status-bar-sample-1", with the name of the new sample, "stockwatcher". if you need to brush up, visit the chrome manifest section. write the xul file we need a slightl...
...his so that upon loading, the stock information is displayed as soon as possible. after doing that, we install an interval routine on the browser window by calling window.setinterval(). this configures our refreshinformation() routine to be called every 10 minutes (the time interval is specified in milliseconds). refreshinformation() the refreshinformation() function is called whenever we want to update the stock information. it's called whenever the user clicks on the status bar panel, when our extension is first added to a browser window, and by the interval handler to periodically update the display. refreshinformation: function() { var httprequest = null; var fullurl = 'http://quote.yahoo.com/d/quotes.csv?f=sl1d1t1c1ohgv&e=.csv&s=goog'; // ... httprequest = new xmlhttprequest(); ...
Source code directories overview - Archive of obsolete content
he directory structure of the mozilla source code tree. it gives a bird's eye view of the source code so a developer can get a good idea what is in mozilla and where to find things. it is a good document for a new mozilla developer to start learning about the mozilla code base. this document contains material for seamonkey, firefox, and toolkit. it is a living document which is (supposed to be) updated monthly according to changes in the mozilla source tree. see also similar information in mozilla source code directory structure, and also see the more detailed overview of how the parts of gecko fit together. introduction: common subdirectories a common naming scheme is used throughout the mozilla source trees. at the top level is the name of the product (e.g. seamonkey). at the second level...
...ms are used for code level things instead of build level things (which are a stored in the build directory). content was split off from layout and contains objects as they are exposed to the dom. db contains c code for the mdb/mork database which is a low-level, general-purpose and cross-platform file library. it is used to store mail box data, news data and global history data. it has not been updated to support xpcom yet. this code originated in the mozilla classic code base. dbm contains c code for managing, reading and writing hash tables. 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). this code originated at uc berkeley. directory contains the ldap sdk. docs...
...e and xul for implementing the "cross platform front end." essentially, this is where the mozilla program starts and manages other components to accomplish tasks. this code contains very little platform dependent code; it relies on other components to provide platform independent interfaces to platform specific functionality. xpinstall contains the c interfaces and code for implementing the smartupdate feature from mozilla classic. xpinstall provides code for downloading files, uncompressing them and installing them in a platform independent way. xulrunner contains code for xul runner. firefox firefox is contained in the browser directory app contains contains code to build the firefox executable. base contains the xul and branding code. components contains firefox specific components ...
...oletecontains obsolete stuff. profilecontains the profile manager themescontains themes as they relate to toolkit things. xreis the xul runtime engine. this directory contains the code for initializing the toolkit. original document information author(s): daniel howard other contributors: heikki toivonen (11-nov-1999), hervé renault (for the french translation) (16-nov-1999) last updated date: michael kaply 2-june-2005 copyright information: portions of this content are © 1998-2007 by individual mozilla.org contributors; content available under a creative commons license | details. further history: document history. ...
Enabling the behavior - retrieving tinderbox status - Archive of obsolete content
our mozilla extension now exists, but it doesn't do anything. to make it work we have to add javascript code that changes its status when the tinderbox status changes. the first step is to write a function that queries the tinderbox server and retrieves the current status. var gxmlhttprequest; function loadtinderboxstatus() { gxmlhttprequest = new xmlhttprequest(); gxmlhttprequest.onload = updatetinderboxstatus; gxmlhttprequest.open("get", "http://tinderbox.mozilla.org/seamonkey/panel.html"); gxmlhttprequest.send(null); } xmlhttprequest is an interface in mozilla for retrieving documents via http. although it is designed to retrieve xml content and parse it into a dom, it can retrieve (but not parse) other kinds of content as well. in this case we use it to retrieve an html page con...
...g/seamonkey/panel.html"); gxmlhttprequest.send(null); } xmlhttprequest is an interface in mozilla for retrieving documents via http. although it is designed to retrieve xml content and parse it into a dom, it can retrieve (but not parse) other kinds of content as well. in this case we use it to retrieve an html page containing a brief summary of the current tinderbox state. ...
...ieve an html page containing a brief summary of the current tinderbox state. that document gets updated by the tinderbox server every time a build finishes. it displays a list of active tinderbox clients along with the result of their last build attempt. xmlhttprequest is easy to use in the simple case we have here. we use new to create a new instance of it, set the instance's onload property to updatetinderboxstatus(), the function we want to execute when the document finishes loading, call its open method with the type of http request we want to make and the url of the document to retrieve, and then call its send method to send the request. xmlhttprequest will retrieve the document located at the given url and call the updatetinderboxstatus() function when it is done. notice that we defined...
...method with the type of http request we want to make and the url of the document to retrieve, and then call its send method to send the request. xmlhttprequest will retrieve the document located at the given url and call the updatetinderboxstatus() function when it is done. notice that we defined the instance of xmlhttprequest as a global variable. this is because we need to reference it in the updatetinderboxstatus() function as well as the current function, and we can't pass the object from one function to the other because the one doesn't call the other directly. « previousnext » ...
Twitter - Archive of obsolete content
next! jetpack's twitter library, jetpack.lib.twitter, is a very simple, lightweight layer on top of twitter's rest api. in fact it's hardly more than syntactic sugar for doing xmlhttprequests. to use this library, you therefore need to be familiar with twitter's own api. (it's easy!) methods each method in twitter's api maps to a method here. for example, the twitter method for tweeting, statuses/update, maps to jetpack.lib.twitter.statuses.update(). to call trends/current, use jetpack.lib.twitter.trends.current(). for search, jetpack.lib.twitter.search(). replace slashes with dots. most of twitter's methods are supported, but not all. list methods, spam reporting methods, and oauth are not currently supported. if something is not supported but you would like it to be, please file a bug. (or...
...cond style will be familiar if you have used jquery.ajax() -- in fact the object is passed as-is (almost) to it. in other words, define a data property that is itself an object whose properties correspond to the parameters of the twitter method. with this style you can use any of the various jquery.ajax() options in your request: data, success, complete, etc. example: jetpack.lib.twitter.statuses.update({ data: { status: "o frabjous day!" }, username: "basic_auth_username", password: "basic_auth_password", success: function () console.log("hey!") }); user authentication you can supply a username and password to methods that require authentication using the second, more advanced call style described above. or you can simply rely on firefox. when you call a method that requires auth...
...sername: "basic_auth_username", password: "basic_auth_password", success: function () console.log("hey!") }); user authentication you can supply a username and password to methods that require authentication using the second, more advanced call style described above. or you can simply rely on firefox. when you call a method that requires authentication -- such as jetpack.lib.twitter.statuses.update() -- without providing a username or password, firefox will prompt the user for them if she is not already authenticated with twitter. both methods use http basic authentication. in the future, the library may support oauth. see twitter's authentication documentation for related information. faq see twitter's api faq. since jetpack's twitter library is a very thin wrapper around twitter's api...
...thods use http basic authentication. in the future, the library may support oauth. see twitter's authentication documentation for related information. faq see twitter's api faq. since jetpack's twitter library is a very thin wrapper around twitter's api, most everything there applies here, and not much applies here that doesn't apply there. example usage tweeting jetpack.lib.twitter.statuses.update({ status: "o frabjous day!" }); firefox will prompt for a username and password if the user is not already authenticated with twitter. user info jetpack.lib.twitter.users.show({ id: "mozlabs", success: function (data, status) console.log(data.tosource()), error: function (xhr, errmsg, errobj) console.error(xhr.responsetext) }); friends of a user jetpack.lib.twitter.statuses.friends({ id...
Simple Storage - Archive of obsolete content
owser restarts as a note. all notes are shown in the tools menu. you can install this example from the jetpack gallery. ...
...uture.import("storage.simple");// create the persistent notes array if it doesn't already exist.jetpack.storage.simple.notes = jetpack.storage.simple.notes || [];var notes = jetpack.storage.simple.notes;// updates the jetpack menu with the current notes. we'll add a notes menu with// a submenu, which lists all the notes. if there are no notes, we'll show a// disabled "(empty)" menuitem.function updatejetpackmenu() { jetpack.menu.set({ label: "notes", menu: new jetpack.menu(notes.length > 0 ? notes : [{ label: "(empty)", disabled: true }]) });}// modify the page's context menu by sneaking in before it's shown. if there's// a selection, add a note menuitem that makes a new note. otherwise, don't// modify the menu at all. we'll limit ...
...s a new note. otherwise, don't// modify the menu at all. we'll limit the number of notes to 20. old notes// will be forgotten. ...
... to 20. old notes// will be forgotten. ...
Simple Storage - Archive of obsolete content
starts as a note. all notes are shown in the tools menu. you can install this example from the jetpack gallery. jetpack.future.import("menu"); jetpack.future.import("selection"); jetpack.future.import("storage.simple"); // create the persistent notes array if it doesn't already exist. ...
...ort("storage.simple"); // create the persistent notes array if it doesn't already exist. jetpack.storage.simple.notes = jetpack.storage.simple.notes || []; var notes = jetpack.storage.simple.notes; // updates the jetpack menu with the current notes. we'll add a notes menu with // a submenu, which lists all the notes. if there are no notes, we'll show a // disabled "(empty)" menuitem. function updatejetpackmenu() { jetpack.menu.set({ label: "notes", menu: new jetpack.menu(notes.length > 0 ? notes : [{ label: "(empty)", disabled: true }]) }); } // modify the page's context menu by sneaking in before it's shown. if there's // a selection, add a note menuitem that makes a new note. otherwise, don't // modify the menu at all. w...
.... otherwise, don't // modify the menu at all. we'll limit the number of notes to 20. old notes // will be forgotten. ...
...s // will be forgotten. ...
Space Manager High Level Design - Archive of obsolete content
he space manager are: nsblockreflowstate nsblockframe nsboxtoblockadaptor the general interaction model is to create a space manager for a block frame in the context of a reflow, and to associate it with the blockreflowstate so it is passed down to child frames' reflow methods. after reflow, the space manager is destroyed. 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). additionally, there is a need to manage impacts to lines caused by changes to floated elements. this is referred to as propagation of float damage and is handled by the block frame, making use of the space manager. when a float is incrementally reflowed, th...
...gers are effectively 'nested' during reflow, with each new block introducing its own space manager. use case 2: float is added to the space manager after a space manager is created for a block context's reflow chain, a floated block may be added to it. this happens in the method nsblockreflowstate::recoverfloats and nsblockreflowstate::flowandplacefloat (formerly this was done in nsblockframe::updatespacemanager). the general algorithm in nsblockreflowstate::recoverfloats is: for each line in the block, see if it has floated blocks if floats are in the line, iterate over the floats and add each one to the space manager via the addrectregion method. the actual rect for the frame is cached in an nsfloatcache so it does not have to be recomputed. if the block has any block children, then tra...
...e::recoverfloats is: for each line in the block, see if it has floated blocks if floats are in the line, iterate over the floats and add each one to the space manager via the addrectregion method. the actual rect for the frame is cached in an nsfloatcache so it does not have to be recomputed. if the block has any block children, then translate the space manager to the child block's origin and update the space manager in the context for the child block, recursively. when done with the child, restore the space managers coordinates by translating by the negative of the child block's origin. the general algorithm in nsblockreflowstate::flowandplacefloat is: the region that the float currently occupies is recorded. the band of available space is searched (with nsblockreflowstate::getavailable...
...ine) nsblockframe::paint is mucking with nsblockbanddata in and #if 0 block - remove that and the include (compiles fine) nsspacemanger has no way of clearing the float damage interval set - this might be needed if the spacemanager persists beyond a reflow original document information author(s): marc attinasi other contributors: alex savulov, chris waterson, david baron, josh soref last updated date: november 20, 2005 ...
textbox - Archive of obsolete content
e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. focused type: boolean this attribute is true if the element is focused. emptytext deprecated since gecko 2 type: string a string that appears in the textbox when it has no value. this is superseded by the placeholder attribute in gecko 2.0. the old name is retained for compatibility, but you should update your code. hidespinbuttons type: boolean if tru...
...ues. there are several attributes that allow the number textbox to be configured, including decimalplaces, min, max, increment, wraparound, hidespinbuttons, and textbox.value. password a textbox that hides what is typed, used for entering passwords. search a textbox intended for searching. the command event will fire as the user modifies the value. a listener for the command event should update search results. if the searchbutton attribute is set to true, the command event is only fired if the user presses the search button or presses the enter key. you may specify grey text to appear when the search box is empty using the emptytext attribute, and a timeout may be set for the command event using the timeout attribute (defaults to 500). timed this textbox will fire a command event ...
... a certain time has passed. the delay is set with the timeout attribute. the command event will fire if the user presses the enter key. the timed type is deprecated in gecko 1.9.1 and the search textbox may be used instead. value type: string the default value entered in a textbox. the attribute only holds the default value and is never modified when the user enters text. to get the updated value, use the value property. for number boxes, the default is 0 or the minimum value returned by the min property, whichever is higher. wrap type: string set this attribute to the value off to disable word wrapping in the textbox. if this attribute is not specified, word wrapping is enabled. wraparound type: boolean if true, the value of the number box will wrap around when ...
...nd sets the value of the disabled attribute. editor type: nsieditor a reference to the nsieditor for editable text. this property is read only. emptytext deprecated since gecko 2 type: string gets and sets a string that appears in the textbox when it has no value. this is superseded by the placeholder property in gecko 2.0. the old name is retained for compatibility, but you should update your code. increment type: integer gets and sets the value of the increment attribute. inputfield type: textbox element in mozilla, the xul textbox is implemented as a wrapper around an html input element. this read only property holds a reference to this inner input element. label type: string sets the label attribute. gets the label attribute if it is present ...
XULRunner Hall of Fame - Archive of obsolete content
now available with xulrunner 30 with i18n support. mathml support is significant. includes smil audio overlays and idpf fixed layout. ...
...his lightweight extension for firefox, thunderbird, seamonkey, songbird, komodo etc. sqlite manager is also available as a xulrunner application. surebo browselorer a new, simple yet highly functional and customizable web browser, based on xulrunner 22. websecurify web application security testing environment. source yoono desktop win/mac application to get all your friend updates, update your status and share stuff easily across facebook, myspace, twitter, and more - all at once! simplify your online social life. zotero reference manager with firefox, chrome, and safari integration. both firefox extension and xulrunner-based standalone application available. source applications based on xulrunner 1.9 or earlier buzzbird xul-based desktop twitter client.
... pc application to manage tomtom gps devices understanding faith (desktop version) a multimedia religious education resource for catholic secondary schools in australia. vivipos integrated point-of-sales software-hardware solution with customized xul application as the device front-end. english site. inactive projects these projects appear to be less actively developed, with no updates since 2010. they are all based on xulrunner 1.8 or earlier. abstract an accounting package with breakthrough level of automation. latest release: 0.0.2 november 2010 - source clines a clone of color lines (game). latest release: 1.2 november 2008 - source cocoapsyc.app a psyc im/chat client for mac os x (also available as a firefox extension). latest release 0.5 febuary...
...tructions spicebird a collaboration suite - e-mail, calendaring and instant messaging. latest release: june 2010 - build instructions utilities / prototypes ajax toolkit framework (atf) a part of the eclipse web tools platform (wtp) aliwal geocoder geocode addresses onto a map benjamin's xulrunner examples "mybrowser is a very simple example browser", xulmine. an updated version of "mybrowser" that works with firefox 25.0.1+ is available in matthew kastor's xulrunner examples at https://github.com/matthewkastor/xulrunner-examples/ exch a currency conversion tool using updated data from http://finance.yahoo.com/currency. you can use the firefox extension or the stand-alone xul application. opendocument viewer cross-platform viewer for opendocument...
2006-10-06 - Archive of obsolete content
summary: mozilla.dev.l10n - october 6, 2006 announcements english united states dictionary english united states dictionary for firefox 2. firefox 2 sign-off procedure localization team should begin intense qa as outlined here. ffx 2 rc2 testing today l10n builds were completed was completed and ready for test. ...
... firefox 2 sign-off procedure localization team should begin intense qa as outlined here. ffx 2 rc2 testing today l10n builds were completed was completed and ready for test. test resumt will be found here another lightning localization update with some bad news difference has been located between sunbird_0_3_branch (for sunbird 0.3) and mozilla_1_8_branch. sunbird/lightning localization update you need to update your localization if you want your locale to ship with lightning 0.3 or sunbird 0.3. mozillatranslator 5.13 rfes new version of mozillatranslator will be relaesed in a few weeks. calendar localization update rc1 for sunbird 0.3 is out now and ready for testing. l10n locked down - ff2 rc2 code freeze 9/29/2006 at 9am pdt the l10n repository is locked down. discussion...
... meetings none for this week. ...
...lization if you want your locale to ship with lightning 0.3 or sunbird 0.3. mozillatranslator 5.13 rfes new version of mozillatranslator will be relaesed in a few weeks. calendar localization update rc1 for sunbird 0.3 is out now and ready for testing. l10n locked down - ff2 rc2 code freeze 9/29/2006 at 9am pdt the l10n repository is locked down. discussions status update fx2 status update for firefox 2. meetings none for this week. authors paul yanchun gu (gpaul) aditya nanda kuswanto(vipers101) ...
Building a Theme - Archive of obsolete content
note: this tutorial is about building themes for firefox 29 and later. other tutorials exist for building themes for earlier versions of firefox. for an older tutorial, see creating a skin for firefox. note: firefox for mac os x has changed some directories so the guide may be obsolete. setting up the development environment themes and extensions are packaged and distributed in zip files or bundles, with the xpi (pronounced “zippy”) file extension. ...
...ctor is broken. to workaround this, disable hardware acceleration in firefox' options. open up the dom inspector now (located under the "tools" menu), and go to "file->inspect chrome document". this will be a menu containing all the xul documents currently open in firefox. pick the first document with a web page title, like "firefox start page" and select it. for this tutorial, we're going to update the background color of the toolbars. select the node finding tool (the arrow-plus-box in the top-left corner of the dom inspector), and click on any unused space on a toolbar. this should select a node of type "xul:toolbar" in the dom inspector. from here, you can play around with various different stylings for the toolbar and associated elements. by default, the right pane should show the dom ...
...theme directory and install the theme. your theme will not be active the first time you install, and you will need to click "enable" and restart before you can see your change. after it restarts this second time, you should see the background color of the toolbars is displayed in orange now. you can now go back and make additional changes to your css files, close and restart firefox, and see the updates. package now that your theme works, you can package it for deployment and installation. zip up the contents of your theme's folder (not the theme folder itself), and rename the zip file to have a .xpi extension. in windows, you can do this easily by selecting all the files and subfolders in your extension folder, right click and choose "send to -> compressed (zipped) folder". a .zip file wi...
...-> compressed (zipped) folder". a .zip file will be created for you. just rename it and you're done! on mac os or linux, you can use the command-line zip tool: zip -r my_theme.xpi install.rdf chrome.manifest browser communicator global mozapps or, if you have 7-zip installed, you can use that for zipping it up: 7z a -tzip my_theme.xpi chrome chrome.manifest note: the command-line tool will update an existing zip file, not replace it - so if you have files you've deleted from your theme, be sure to remove the .xpi file before running the zip command again. now upload the .xpi file to your server, making sure it's served as application/x-xpinstall. you can link to it and allow people to download and install it. for the purposes of just testing our .xpi file we can just drag it into the add...
Array.observe() - Archive of obsolete content
however, this api has been deprecated and removed from browsers. you can use the more general proxy object instead. syntax array.observe(arr, callback) parameters arr the array to be observed. ...
... to be observed. callback the function called each time changes are made, with the following argument: changes an array of objects each representing a change. the properties of these change objects are: name: the name of the property which was changed. object: the changed array after the change was made. type: a string indicating the type of change taking place. one of "add", "update", "delete", or "splice". oldvalue: only for "update" and "delete" types. the value before the change. index: only for the "splice" type. the index at which the change occurred. removed: only for the "splice" type. an array of the removed elements. addedcount: only for the "splice" type. the number of elements added. description the callback function is called each time a ...
...r the "splice" type. the number of elements added. description the callback function is called each time a change is made to arr, with an array of all changes in the order in which they occurred. changes done via array methods, such as array.prototype.pop() will be reported as "splice" changes. ...
...r in which they occurred. changes done via array methods, such as array.prototype.pop() will be reported as "splice" changes. index assignment changes which do not change the length of the array may be reported as "update" changes. examples logging different change types var arr = ['a', 'b', 'c']; array.observe(arr, function(changes) { console.log(changes); }); arr[1] = 'b'; // [{type: 'update', object: <arr>, name: '1', oldvalue: 'b'}] arr[3] = 'd'; // [{type: 'splice', object: <arr>, index: 3, removed: [], addedcount: 1}] arr.splice(1, 2, 'beta', 'gamma', 'delta'); // [{type: 'splice', object: <arr>, index: 1, removed: ['b', 'c'], addedcount: 3}] specifications strawman proposal specification. ...
Reference - Archive of obsolete content
cial:search?search=javascript1.2&go=go. how should they be revised? --maian 23:43, 21 september 2005 (pdt) i think we need a new section in the reference that specifies the differences between versions, collecting this information into a single location rather than leaving it scattered haphazardly throughout the reference as it currently is. once that is done, the various code samples should be updated to reflect current practices and code if they cannot be written in a "version-neutral" manner. do you think this makes sense? -- dria 04:27, 22 september 2005 (pdt) those examples are not "bad examples" per se. they are there specifically to show the differences between the two versions. i was wondering what should be done about those examples, since they would no longer be valid with fx 1.5+ ...
...rence:statements:for_each...in. the for each...in loop should either be listed on this page or moved to a different category. and somebody should see if there are other features in the same situation. herorev 00:49, 27 october 2006 (pdt) since the for each...in loop is a 1.6 feature (not a 1.5 feature), maybe someone should rename this page/category to be either a general javascript reference or update it to be the 1.6 reference. having 1.6 features defined in the 1.5 reference might be confusing. cstevens 10:23, 20 december 2006 (pst) we do plan to move the pages around, see core javascript 1.5 reference/reorg, but it's not clear when that will happen. in the meantime, newer features from js 1.6 (and hopefully someone will add js 1.7 features too) are being added to the reference with appropri...
... (pst) yes, seeing stuff that doesn't apply to 1.5 on a page titled "... javascript 1.5" might be a little confusing. but there is no other place to put javascript 1.6 features at the moment. (there is no "core javascript 1.6 reference" yet.) what should we do, that will be the most useful to our readers? copy all the "... javascript 1.5 ..." pages to "... javascript 1.6 ..." ? then carefully update all links to the javascript 1.5 pages to link to the javascript 1.6 pages -- unless the links are specifically about javascript 1.5 ? then do it all over again when javascript 1.7, javascript 2.0, javascript xxxxii.1, etc. comes out ? make a footnote on each page, pointing to a page listing "hot new javascript features", which in turn points to 1 page for 1.6, 1 page for 1.7, etc., listing all t...
... footnote on each page, pointing to a page listing "hot new javascript features", which in turn points to 1 page for 1.6, 1 page for 1.7, etc., listing all the differences from one version to the next ? this would be the simplest thing for us to write. but someone trying write some javascript 2.0, wanting a list of all the features it supports, might be annoyed at having to read through *all* the updates. make a footnote on each page, pointing to a page listing "hot new javascript features", which lists all the differences between the current latest version, and the documented 1.5 version ? (every time a new version comes out, a few more things are added to that page). none of those options appeal to me. what is the right way to write about the latest javascript version? --davidcary 06:42, 31 ...
XForms Custom Controls - Archive of obsolete content
ded from file:// urls. it is possible to re-enable this by following the steps on using remote xul. this is required for all examples here to run! purpose you are in the right place if you would like to create your own custom renderings of the xforms controls like input, output, trigger, etc. we will also show you how to create custom controls that work with the xforms model and are automatically updated just like xforms controls. the purpose of this article is to give you enough background information so that you'll be able to get a good start. to really grasp the following information, a good understanding of xforms, xbl, javascript and css is needed. xpcom knowledge will certainly not hurt. but even if you are only comfortable with a couple of these technologies, we hope that the possibilitie...
...o main groups of interfaces -> callback interfaces that must be implemented by the custom controls and the interfaces that custom controls can use to access the mozilla xforms engine. nsixformsuiwidget every custom control should implement the nsixformsuiwidget interface. this interface is used by the xforms engine to interact with the underlying control. ...
... */ void refresh(); /** * is called when focus is advanced to the xforms element. */ boolean focus(); /** * is called when control should be disabled. * this really only applies to the submit element. */ void disable(in boolean disable); /** * is called to get current value of control. ...
... as determined by the mdg. */ boolean isrequired(); /** * return true if instance node is valid as determined by the mdg. */ boolean isvalid(); /** * return true if the control is bound to an instance node. */ boolean hasboundnode(); /** * return the bound instance node. */ nsidomnode getboundnode(); /** * set the content of the instance node. if aforceupdate is true then the * xforms model will rebuild/recalculate/revalidate/refresh. */ void setcontent(in nsidomnode anode, in boolean aforceupdate); } note: setcontent() can be used to set place complexcontent (mixture of text and element nodes) under the control's bound node. please see the comments in the source .idl file for more information on using this method. xbl bindings most xforms co...
XForms Select1 Element - Archive of obsolete content
l) listbox - used when appearance = 'compact' (xhtml/xul) radio group - used when appearance = 'full' (xhtml/xul) combobox displaying a combobox is the default representation (xhtml/xul). xhtml widget characteristics analogous widgets is <html:select/> visual grouping by choices element is supported selection="open" is supported if incremental attribute value is false, the bound node is updated when the select1 control is blurred (i.e. loses focus), otherwise it is updated upon item selection xul widget characteristics analogous widgets are <html:select/> and <xul:menulist/> visual grouping by choices element isn't implemented selection="open" attribute isn't supported if incremental attribute value is false, the bound node is updated when the select control is blurred (i.e. lose...
... is blurred (i.e. loses focus), otherwise it is updated upon item selection xul widget characteristics analogous widgets are <html:select/> and <xul:menulist/> visual grouping by choices element isn't implemented selection="open" attribute isn't supported if incremental attribute value is false, the bound node is updated when the select control is blurred (i.e. loses focus), otherwise it is updated upon item selection listbox the select1 is represented as listbox (xhtml/xul). characteristics analogous widgets are <html:select size="5"/> and <xul:listbox/> visual grouping by choices element isn't implemented selection="open" attribute isn't supported if incremental attribute value is false, the bound node is updated when the select control is blurred (i.e. loses focus), otherwise it...
...on item selection listbox the select1 is represented as listbox (xhtml/xul). characteristics analogous widgets are <html:select size="5"/> and <xul:listbox/> visual grouping by choices element isn't implemented selection="open" attribute isn't supported if incremental attribute value is false, the bound node is updated when the select control is blurred (i.e. ...
...e. loses focus), otherwise it is updated upon item selection radio group the select is represented as group of radios (xhtml/xul). ...
Bounding volume collision detection with THREE.js - Game development
ngsphere property available in geometry. var knot = new three.mesh( new three.torusknotgeometry(0.5, 0.1), new meshnormalmaterial({})); var knotbsphere = new sphere( knot.position, knot.geometry.boundingsphere.radius); unfortunately, there is no equivalent of box3.setfromobject for sphere instances. so if we apply transformations or change the position of the mesh, we need to manually update the bounding sphere. for instance: knot.scale.set(2, 2, 2); knotbsphere.radius = knot.geometry.radius * 2; intersection tests point vs. box3 / sphere both box3 and sphere have a containspoint method to do this test. var point = new three.vector3(2, 4, 7); knotbbox.containspoint(point); box3 vs. box3 the box3.intersectsbox method is available for performing this test. knotbbox.intersectsb...
... mesh representing the bounding box, which shows the bounding box's shape, and can passed to the previously seen setfromobject method in order to have a bounding box matching the mesh. boxhelper is the recommended way to handle 3d collisions with bounding volumes in three.js. you will miss sphere tests, but the tradeoffs are well worth it. the advantages of using this helper are: it has an update() method that will resize its bounding box mesh if the linked mesh rotates or changes its dimensions, and update its position. it takes into account the child meshes when computing the size of the bounding box, so the original mesh and all its children are wrapped. we can easily debug collisions by rendering the meshes that boxhelper creates. by default they are created with a linebasicmaterial...
...), new three.meshnormalmaterial({}) ); var knotboxhelper = new three.boxhelper(knot, 0x00ff00); scene.add(knotboxhelper); in order to also have our actual box3 bounding box, we create a new box3 object and make it assume the boxhelper's shape and position. var box3 = new three.box3(); box3.setfromobject(knotboxhelper); if we change the mesh position, rotation, scale, etc. ...
... assume the boxhelper's shape and position. var box3 = new three.box3(); box3.setfromobject(knotboxhelper); if we change the mesh position, rotation, scale, etc. we need to call the update() method so the boxhelper instance matches its linked mesh. we also need to call setfromobject again in order to make the box3 follow the mesh. knot.position.set(-3, 2, 1); knot.rotation.x = -math.pi / 4; // update the bounding box so it stills wraps the knot knotboxhelper.update(); box3.setfromobject(knotboxhelper); performing collision tests is done in the same way as explained in the above section — we use our box3 object in the same way as described above. // box vs box box3.intersectsbox(otherbox3); // box vs point box3.containspoint(point.position); demos there are two demos you can take a look ...
Move the ball - Game development
conds: function draw() { // drawing code } setinterval(draw, 10); thanks to the infinite nature of setinterval the draw() function will be called every 10 milliseconds forever, or until we stop it. now, let's draw the ball — add the following inside your draw() function: ctx.beginpath(); ctx.arc(50, 50, 10, 0, math.pi*2); ctx.fillstyle = "#0095dd"; ctx.fill(); ctx.closepath(); try your updated code now — the ball should be repainted on every frame. making it move you won't notice the ball being repainted constantly at the moment, as it's not moving. let's change that. first, instead of a hardcoded position at (50,50) we will define a starting point at the bottom center part of the canvas in variables called x and y, then use those to define the position the circle is drawn at. fi...
...oment, as it's not moving. let's change that. first, instead of a hardcoded position at (50,50) we will define a starting point at the bottom center part of the canvas in variables called x and y, then use those to define the position the circle is drawn at. ...
...95dd"; ctx.fill(); ctx.closepath(); } now comes the important part: we want to add a small value to x and y after every frame has been drawn to make it appear that the ball is moving. let's define these small values as dx and dy and set their values to 2 and -2 respectively. add the following below your x and y variable definitions: var dx = 2; var dy = -2; the last thing to do is to update x and y with our dx and dy variable on every frame, so the ball will be painted in the new position on every update. add the following two new lines indicated below to your draw() function: function draw() { ctx.beginpath(); ctx.arc(x, y, 10, 0, math.pi*2); ctx.fillstyle = "#0095dd"; ctx.fill(); ctx.closepath(); x += dx; y += dy; } save your code again and try it in ...
...dth, canvas.height); ctx.beginpath(); ctx.arc(x, y, 10, 0, math.pi*2); ctx.fillstyle = "#0095dd"; ctx.fill(); ctx.closepath(); x += dx; y += dy; } save your code and try again, and this time you'll see the ball move without a trail. every 10 milliseconds the canvas is cleared, the blue circle (our ball) will be drawn on a given position and the x and y values will be updated for the next frame. cleaning up our code we will be adding more and more commands to the draw() function in the next few articles, so it's good to keep it as simple and clean as possible. let's start by moving the ball drawing code to a separate function. replace the existing draw() function with the following two functions: function drawball() { ctx.beginpath(); ctx.arc(x, y, 10, 0,...
Player paddle and controls - Game development
ball we have to enable physics for the paddle. continue by adding the following new line, again at the bottom of the create() function: game.physics.enable(paddle, phaser.physics.arcade); now the magic can start to happen — the framework can take care of checking the collision detection on every frame. to enable collision detection between the paddle and ball, add the collide() method to the update() function as shown: function update() { game.physics.arcade.collide(ball, paddle); } the first parameter is one of the objects we are interested in — the ball — and the second is the other one, the paddle. this works, but not quite as we expected it to — when the ball hits the paddle, the paddle falls off the screen! all we want is the ball bouncing off the paddle and the paddle sta...
...l hits it. to do this, add the below line at the bottom of the create() function: paddle.body.immovable = true; now it works as expected. controlling the paddle the next problem is that we can't move the paddle. to do that we can use the system's default input (mouse or touch, depending on platform) and set the paddle position to where the input position is. add the following new line to the update() function, as shown: function update() { game.physics.arcade.collide(ball, paddle); paddle.x = game.input.x; } now on every new frame the paddle's x position will adjust accordingly to the input's x position, however when we start the game, the position of the paddle is not in the middle. it's because the input position is not yet defined. to fix that we can set the default position (...
...de(ball, paddle); paddle.x = game.input.x; } now on every new frame the paddle's x position will adjust accordingly to the input's x position, however when we start the game, the position of the paddle is not in the middle. it's because the input position is not yet defined. to fix that we can set the default position (if an input position is not yet defined) to be the middle of the screen. update the previous line as follows: paddle.x = game.input.x || game.world.width*0.5; if you haven't already done so, reload your index.html and try it out! position the ball we have the paddle working as expected, so let's position the ball on it. it's very similar to positioning the paddle — we need to have it placed in the middle of the screen horizontally and at the bottom vertically with a l...
... game.add.sprite( ... ) line, and replace it with the following two lines: ball = game.add.sprite(game.world.width*0.5, game.world.height-25, 'ball'); ball.anchor.set(0.5); the velocity stays almost the same — we're just changing the second parameter's value from 150 to -150, so the ball will start the game by moving up instead of down. find the existing ball.body.velocity.set( ... ) line and update it to the following: ball.body.velocity.set(150, -150); now the ball will start right from the middle of the paddle. compare your code you can check the finished code for this lesson in the live demo below, and play with it to understand better how it works: next steps we can move the paddle and bounce the ball off it, but what's the point if the ball is bouncing off the bottom edge of t...
MVC - MDN Web Docs Glossary: Definitions of Web-related terms
e, quantity and price of each item we need to buy this week. below we'll describe how we could implement some of this functionality using mvc. the model the model defines what data the app should contain. if the state of this data changes, then the model will usually notify the view (so the display can change as needed) and sometimes the controller (if different logic is needed to control the updated view). going back to our shopping list app, the model would specify what data the list items should contain — item, price, etc. — and what list items are already present. the view the view defines how the app's data should be displayed. in our shopping list app, the view would define how the list is presented to the user, and receive the data to display from the model. the controller t...
...ng list app, the model would specify what data the list items should contain — item, price, etc. — and what list items are already present. the view the view defines how the app's data should be displayed. in our shopping list app, the view would define how the list is presented to the user, and receive the data to display from the model. the controller the controller contains logic that updates the model and/or view in response to input from the users of the app. so for example, our shopping list could have input forms and buttons that allow us to add or delete items. these actions require the model to be updated, so the input is sent to the controller, which then manipulates the model as appropriate, which then sends updated data to the view. you might however also want to just upda...
... mvc on the web as a web developer, this pattern will probably be quite familiar even if you've never consciously used it before. ...
...e solution such as indexeddb [en-us].) your app's controlling code is probably written in html/javascript, and your user interface is probably written using html/css/whatever else you like. this sounds very much like mvc, but mvc makes these components follow a more rigid pattern. in the early days of the web, mvc architecture was mostly implemented on the server-side, with the client requesting updates via forms or links, and receiving updated views back to display in the browser. however, these days, more of the logic is pushed to the client with the advent of client-side data stores, and xmlhttprequest allowing partial page updates as required. web frameworks such as angularjs and ember.js all implement an mvc architecture, albeit in slightly different ways. learn more general knowledge ...
From object to iframe — other embedding technologies - Learn web development
label { margin: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); const output = document.queryselector('.output'); let code = textarea.value; let userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution...
...) { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solution'; } updatecode(); }); const htmlsolution = '<iframe width="420" height="315" src="https://www.youtube.com/embed/qh2-tgulwu4" frameborder="0" allowfullscreen>\n</iframe>\n\n<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d37995.65748333395!2d-2.273568166412784!3d53.473310471916975!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x487bae6c05743d3d%3a0xf82fddd1e49fc0a1!2sthe+lowry!5e0!3m2!
...ww.google.com/maps/embed?pb=!1m18!1m12!1m3!1d37995.65748333395!2d-2.273568166412784!3d53.473310471916975!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x487bae6c05743d3d%3a0xf82fddd1e49fc0a1!2sthe+lowry!5e0!3m2!1sen!2suk!4v1518171785211" width="600" height="450" frameborder="0" style="border:0" allowfullscreen>\n</iframe>'; let solutionentry = htmlsolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; const ca...
...const caretpos = textarea.selectionstart; const front = (textarea.value).substring(0, caretpos); const back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.onkeyup = function(){ // 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(); }; iframes ...
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
can also pass any parameters required by the function being executed as subsequent parameters of the setinterval() call. let's look at an example. the following function creates a new date() object, extracts a time string out of it using tolocaletimestring(), and then displays it in the ui. it then runs the function once per second using setinterval(), creating the effect of a digital clock that updates once per second (see this live, and also see the source): function displaytime() { let date = new date(); let time = date.tolocaletimestring(); document.getelementbyid('demo').textcontent = time; } const createclock = setinterval(displaytime, 1000); just like settimeout(), setinterval() returns an identifying value you can use later when you need to clear the interval. clearing inte...
...er of seconds will be the amount of seconds left over when all of the minutes have been removed. you'll want to include a leading zero on your display values if the amount is less than 10, so it looks more like a traditional clock/watch. to pause the stopwatch, you'll want to clear the interval. to reset it, you'll want to set the counter back to 0, clear the interval, and then immediately update the display. you probably ought to disable the start button after pressing it once, and enable it again after you've stopped/reset it. otherwise multiple presses of the start button will apply multiple setinterval()s to the clock, leading to wrong behavior. note: if you get stuck, you can find our version here (see the source code also). things to keep in mind about settimeout() and setinte...
...g requestanimationframe() elsewhere in the course — see for example drawing graphics, and object building practice. the method takes as an argument a callback to be invoked before the repaint. this is the general pattern you'll see it used in: function draw() { // drawing code goes here requestanimationframe(draw); } draw(); the idea is to define a function in which your animation is updated (e.g. your sprites are moved, score is updated, data is refreshed, or whatever). then, you call it to start the process off. at the end of the function block you call requestanimationframe() with the function reference passed as the parameter, and this instructs the browser to call the function again on the next display repaint. this is then run continuously, as the code is calling requestanimat...
...(), guybrush would move his limbs too fast and the animation would look ridiculous. this example therefore throttles the rate at which the sprite cycles its frames using the following code: if (posx % 13 === 0) { if (sprite === 5) { sprite = 0; } else { sprite++; } } so the code only cycles the sprite once every 13 animation frames. ...actually, it's about every 6.5 frames, as we update posx (character's position on the screen) by two each frame: if (posx > width/2) { newstartpos = -( (width/2) + 102 ); posx = math.ceil(newstartpos / 13) * 13; console.log(posx); } else { posx += 2; } this is the code that calculates how to update the position in each animation frame. the method you use to throttle your animation will depend on your particular code. for instance, in th...
Build your own function - Learn web development
inside the function scope. if you tried the last experiment, make sure to undo the last change before carrying on. improving the function with parameters as it stands, the function is still not very useful — we don't want to just show the same default message every time. let's improve our function by adding some parameters, allowing us to call it with some different options. ...
...s to call it with some different options. first of all, update the first line of the function: function displaymessage() { to this: function displaymessage(msgtext, msgtype) { now when we call the function, we can provide two variable values inside the parentheses to specify the message to display in the message box, and the type of message it is. to make use of the first parameter, update the following line inside your function: msg.textcontent = 'this is a message box'; to msg.textcontent = msgtext; last but not least, you now need to update your function call to include some updated message text. change the following line: btn.onclick = displaymessage; to this block: btn.onclick = function() { displaymessage('woo, this is a different message!'); }; if we w...
...xercise (warning and chat) from github. save them in a new folder called icons in the same location as your html file. note: the warning and chat icons were originally found on iconfinder.com, and designed by nazarrudin ansyari — thanks! (the actual icon pages were since moved or removed.) next, find the css inside your html file. we'll make a few changes to make way for the icons. first, update the .msgbox width from: width: 200px; to width: 242px; next, add the following lines inside the .msgbox p { ... } rule: padding-left: 82px; background-position: 25px center; background-repeat: no-repeat; now we need to add code to our displaymessage() function to handle displaying the icons. add the following block just above the closing curly brace (}) of your function: if (msg...
...ackground color is set to aqua blue. if the msgtype parameter is not set at all (or to something different), then the else { ... } part of the code comes into play, and the paragraph is simply given default padding and no icon, with no background panel color set either. this provides a default state if no msgtype parameter is provided, meaning that it is an optional parameter! let's test out our updated function, try updating the displaymessage() call from this: displaymessage('woo, this is a different message!'); to one of these: displaymessage('your inbox is almost full — delete some mails', 'warning'); displaymessage('brian: hi there, how are you today?','chat'); you can see how useful our (now not so) little function is becoming. note: if you have trouble getting the example ...
Basic math in JavaScript — numbers and operators - Learn web development
needed. we've actually provided a simple example showing how this is done — check it out live, and look at the source code to see if you can spot the incrementors! we'll look at loops in detail later on in the course. let's try playing with these in your console. for a start, note that you can't apply these directly to a number, which might seem strange, but we are assigning a variable a new updated value, not operating on the value itself. the following will return an error: 3++; so, you can only increment an existing variable. try this: let num1 = 4; num1++; okay, strangeness number 2! when you do this, you'll see a value of 4 returned — this is because the browser returns the current value, then increments the variable. you can see that it's been incremented if you return the varia...
...ox. the box is drawn using a browser api called the canvas api. there is no need to worry about how this works — just concentrate on the math for now. the width and height of the box (in pixels) are defined by the variables x and y, which are initially both given a value of 50. open in new window in the editable code box above, there are two lines marked with a comment that we'd like you to update to make the box grow/shrink to certain sizes, using certain operators and/or values in each case. let's try the following: change the line that calculates x so the box is still 50px wide, but the 50 is calculated using the numbers 43 and 7 and an arithmetic operator. change the line that calculates y so the box is 75px high, but the 75 is calculated using the numbers 25 and 3 and an arithmeti...
...y season it is zoom a map in or out depending on what zoom level is selected we'll look at how to code such logic when we look at conditional statements in a future article. for now, let's look at a quick example: <button>start machine</button> <p>the machine is stopped.</p> const btn = document.queryselector('button'); const txt = document.queryselector('p'); btn.addeventlistener('click', updatebtn); function updatebtn() { if (btn.textcontent === 'start machine') { btn.textcontent = 'stop machine'; txt.textcontent = 'the machine has started!'; } else { btn.textcontent = 'start machine'; txt.textcontent = 'the machine is stopped.'; } } open in new window you can see the equality operator being used just inside the updatebtn() function. in this case, we are not t...
...if the button is currently saying "stop machine" when it is pressed, we swap the display back again. note: such a control that swaps between two states is generally referred to as a toggle. it toggles between one state and another — light on, light off, etc. ...
Accessibility in React - Learn web development
d in the editing template. const editfieldref = useref(null); const editbuttonref = useref(null); these refs have a default value of null because they will not have value until we attach them to their respective elements. to do that, we'll add an attribute of ref to each element, and set their values to the appropriately named ref objects. ...
...ide effect (3) todo.js:98 that's it for our experimentation for now. delete console.log("main render") now, and lets move on to implementing our focus management. focusing on our editing field now that we know our useeffect() hook works, we can manage focus with it. as a reminder, we want to focus on the editing field when we switch to the editing template. update your existing useeffect() hook so that it reads like this: useeffect(() => { if (isediting) { editfieldref.current.focus(); } }, [isediting]); these changes make it so that, if isediting is true, react reads the current value of the editfieldref and moves browser focus to it. we also pass an array into useeffect() as a second argument. this array is a list of values useeffect() should d...
...t now, and you'll see that when you click an "edit" button, focus moves to the corresponding edit <input>! moving focus back to the edit button at first glance, getting react to move focus back to our "edit" button when the edit is saved or cancelled appears deceptively easy. surely we could add a condition to our useeffect to focus on the edit button if isediting is false? let's try it now — update your useeffect() call like so: useeffect(() => { if (isediting) { editfieldref.current.focus(); } else { editbuttonref.current.focus(); } }, [isediting]); this kind of mostly works. head back to your browser and you’ll see that your focus moves between edit <input> and "edit" button as you start and end an edit. however, you may have noticed a new problem — the "edit" button i...
... function useprevious(value) { const ref = useref(); useeffect(() => { ref.current = value; }); return ref.current; } now we'll define a wasediting constant beneath the hooks at the top of todo(). we want this constant to track the previous value of isediting, so we call useprevious with isediting as an argument: const wasediting = useprevious(isediting); with this constant, we can update our useeffect() hook to implement the pseudocode we discussed before — update it as follows: useeffect(() => { if (!wasediting && isediting) { editfieldref.current.focus(); } if (wasediting && !isediting) { editbuttonref.current.focus(); } }, [wasediting, isediting]); note that the logic of useeffect() now depends on wasediting, so we provide it in the array of dependencies. ...
Styling Vue components with CSS - Learn web development
e adding these files directly to the reset.css stylesheet would work, we'll instead add them to the <style> tags in app.vue to demonstrate how this can be used. there are already some styles present in the file. let's remove those and replace them with the styles below. these styles do a few things — adding some styling to buttons and inputs, and customizing the #app element and its children. ...
...ere's one more semantic and styling change we can make. since our form denotes a specific section of our page, it could benefit from an <h2> element. the label, however, already denotes the purpose of the form. to avoid repeating ourselves, let's wrap our label in an <h2>. there are a few other global css styles which we can add as well. we'll also add the input__lg class to our <input> element. ...
...ut type="text" id="new-todo-input" name="new-todo" autocomplete="off" v-model.lazy.trim="label" class="input__lg" /> <button type="submit" class="btn btn__primary btn__lg"> add </button> </form> </template> let's also add the stack-large class to the <ul> tag in our app.vue file. this will help improve the spacing of our to-do items a bit. update it as follows: <ul aria-labelledby="list-summary" class="stack-large"> adding scoped styles the last component we want to style is our todoitem component. to keep the style definitions close to the component we can add a <style> element inside it. however, if these styles alter things outside of this component, it could be challenging to track down the styles responsible, and fix the problem. ...
...{ opacity: 1; } @media only screen and (min-width: 40rem) { label, input, .custom-checkbox { font-size: 19px; font-size: 1.9rem; line-height: 1.31579; } } now we need to add some css classes to our template to connect the styles. to the root <div>, add a custom-checkbox class. to the <input>, add a checkbox class. last of all, to the <label> add a checkbox-label class. the updated template is below: the app should now have custom checkboxes. your app should look something like the screenshot below. summary our work is done on the styling of our sample app. in the next article we'll return to adding some more functionlity to our app, namely using a computed property to add a count of completed todo items to our app. previous overview: client-side javascript fram...
Theme concepts
s bar, search bar, and tab strip. these theme options can be implemented as static themes (although the theme images themselves may be animated) or as dynamic themes created in a browser extension. if you have a lightweight theme it will be converted to this new theme format automatically before lightweight themes are deprecated. you do not need to port your theme. however, please feel free to update your themes to use any of the new features described here. static themes static themes are specified using the same resources as a browser extension: a manifest.json file to define the theme components with those components stored in the same folder as the manifest.json file or a sub folder. these resources are then packed in a zip for publication on addons.mozilla.org (amo) or for self-distri...
...namic themes. updating static themes if your static theme is hosted on amo, you can upload a new version using the developer hub with the following steps: visit the product page for your theme through the developer hub select "upload new version" on the left upload your packaged file for validation or modify it using the theme generator for self-hosted static themes, a new version can be updated through amo by following the above steps or be handled by you through an updateurl or external application updates. a new version will need to be signed through the developer hub. if you are uploading a packaged file, the version number must be higher than the current version number dynamic themes as an alternative to defining a static theme, you can use the theme api to control the theme ...
...programmatic control. and, obviously, you can combine the two and bundle a programmatically controlled theme with your extension. using the theme api is straightforward. first, request "theme" permission in the extension's manifest.json file. next, you build a json object containing the same information you would use in a static theme’s manifest.json, finally, pass the json object in a theme.update() call. for example, the following code, from the dynamic theme example defines the content for the day and night elements of the dynamic theme: const themes = { 'day': { images: { theme_frame: 'sun.jpg', }, colors: { frame: '#cf723f', tab_background_text: '#111', } }, 'night': { images: { theme_frame: 'moon.jpg', }, colors: { frame: '#...
... day and night elements of the dynamic theme: const themes = { 'day': { images: { theme_frame: 'sun.jpg', }, colors: { frame: '#cf723f', tab_background_text: '#111', } }, 'night': { images: { theme_frame: 'moon.jpg', }, colors: { frame: '#000', tab_background_text: '#fff', } } }; the theme.theme object is then passed to theme.update() to change the header theme, as in this code snippet from the same example: function settheme(theme) { if (currenttheme === theme) { // no point in changing the theme if it has already been set. return; } currenttheme = theme; browser.theme.update(themes[theme]); } learn more about dynamic themes and see an additional example in the following video: if you have not built a...
Performance
rences to the frame script global when it is passed into a jsm. alternatively the frame's unload event or weak maps can be used to ensure that frames can be cleaned up when their respective tab is closed. 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-addon:update-configuration", onupdate) // maincopy used by other functions the main issue here is that a separate object is kept for each tab. not only does that increase memory footprint bu...
...used by other functions the main issue here is that a separate object is kept for each tab. not only does that increase memory footprint but the deserialization also has to be executed seperately for each tab, thus requiring more cpu time. ...
...xecuted seperately for each tab, thus requiring more cpu time. ...
...oy a master-slave architecture where the parent has the authoritative state and replicates it to the child processes in advance so they can act based on their local copy. see the previous chapter on how to efficiently replicate addon state to each process. clean up on addon unload bad: all the previous examples, *even the "better" ones* if your addon is restartless or uses the sdk then updates or the user turning it off and on will load to unload/reload events. not handling those properly can lead to duplicate or conflicting code execution, especially when messages are sent. it can also lead to conflicts between the old and new code. under some circumstances it may even cause exceptions when attempting to register something twice under the same id. better: // addon.js function onunl...
Embedding the editor
or per window current composer clients in the mozilla codebase all assume that there is only one <editor> tag per window. they all need to be able to deal with multiple editors. fixing this would require js changes of the following kind: standardize the way that clients get at the editorshell (or its replacement, post-embedding work) from the window. ensure that focus changes between editors update the window's notion of the "current" editor. if we continue to use window.editorshell, then this needs to be updated on focus changes. ensure that each editor is properly constructed on window setup, and torn down on window destruction. ensure that window close tests (e.g. calling window.trytoclose) appropriately consult each editor for state. insulating editor from the chrome composer needs...
...via a new interface that the embedder implements. any ui that is now thrown up by composer should go through this interface. use a new interface, nsieditoruserinterface, to mediate communication between the editor and the ui. an embedder would need to implement this to get native toolbars and menus to work. in composer, we'd have an implementation in js that talks to the existing commands, and updates the xul nodes. fix existing js and c++ code which explicitly addresses elements in the xul document to go through nsieditoruserinterface. steps to embedding this section attempts to lay out an implementation plan, with the aim of keeping everything working as the various steps are taken. some of these tasks can be done concurrently. decide on how to implement editing session multiple-edito...
... implementation plan, with the aim of keeping everything working as the various steps are taken. some of these tasks can be done concurrently. decide on how to implement editing session multiple-editor support eliminate specific interdependencies between composer and the xul document, via nsieditoruserinterface create bottleneck for getting to the focussed editor; ensure that focus changes update state move editor ownership to docshell, creating nsieditorframe created the editing session api which copes with collections of editors (or make editor refocussable) open questions where should file open and save logic live? it seems that some embedders will want composer open and save file logic, and some won't. where should this logic live? can it be in javascript? of course, an embedder ...
... dialogs use the available editor apis to get and set data, so can do all their work through existing apis. ...
L20n Javascript API
lling requestlocales, the resource files will be retrieved, parsed and compiled. you can listen to the ready event (emitted by the context instance when all the resources have been compiled) and use ctx.getsync and ctx.getentitysync to get translations synchronously. alternatively, you can register callbacks to execute when the context is ready (or when globals change and translations need to be updated) with ctx.localize. ctx.localize(['hello', 'new'], function(l10n) { var node = document.queryselector('[data-l10n-id=hello]'); node.textcontent = l10n.entities.hello.value; node.classlist.remove('hidden'); }); ctx.registerlocales(defaultlocale: string?, availablelocales: array<string>?) register the default locale of the context instance, as well as all other locales available to the...
...ler.error, when l20n is unable to evaluate an entity to a string; there are two types of errors in this category: compiler.valueerror, when l20n can still try to use the literal source string of the entity as fallback, and compiler.indexerror otherwise. ctx.removeeventlistener(event: string, callback: function) remove an event listener previously registered with addeventlistener. ...
...e to evaluate an entity to a string; there are two types of errors in this category: compiler.valueerror, when l20n can still try to use the literal source string of the entity as fallback, and compiler.indexerror otherwise. ctx.removeeventlistener(event: string, callback: function) remove an event listener previously registered with addeventlistener. ...
...ise. ctx.removeeventlistener(event: string, callback: function) remove an event listener previously registered with addeventlistener. ctx.updatedata(ctxdata: object) update the context data which will be available to all entities in the context. the ctxdata is an object which extends the context data per key and per level of hierarchy. in other words, the following two calls: ctx.updatedata({ user: { name: "bob" } }); ctx.updatedata({ user: { gender: "masculine" } }); will make the internally-stored context data look like this: { "user" : { "name": "bob", "gender": "masculine" } } ctx.getsync(id: string, ctxdata: object?) retrieve a string value of an entity called id. if passed, ctxdata is a simple hash object with a list of variables that extend the conte...
Encrypt Decrypt MAC Keys As Session Objects
null, keysize, keyid, pr_true, pwdata); if (!key) { pr_fprintf(pr_stderr, "symmetric key generation failed \n"); } return key; } /* * macinit */ secstatus macinit(pk11context *ctx) { secstatus rv = pk11_digestbegin(ctx); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac failed : pk11_digestbegin()\n"); } return rv; } /* * macupdate */ secstatus macupdate(pk11context *ctx, unsigned char *msg, unsigned int msglen) { secstatus rv = pk11_digestop(ctx, msg, msglen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac failed : digestop()\n"); } return rv; } /* * finalize macing */ secstatus macfinal(pk11context *ctx, unsigned char *mac, unsigned int *maclen, unsigned int maxle...
... pr_fprintf(pr_stderr, "compute mac failed : pk11_digestfinal()\n"); } return secsuccess; } /* * compute mac */ secstatus computemac(pk11context *ctxmac, unsigned char *ptext, unsigned int ptextlen, unsigned char *mac, unsigned int *maclen, unsigned int maxlen) { secstatus rv = macinit(ctxmac); if (rv != secsuccess) return rv; rv = macupdate(ctxmac, ptext, ptextlen); if (rv != secsuccess) return rv; rv = macfinal(ctxmac, mac, maclen, maxlen); return rv; } /* * writetoheaderfile */ secstatus writetoheaderfile(const char *buf, unsigned int len, headertype type, prfiledesc *outfile) { secstatus rv; char header[40]; char trailer[40]; char *outstring = null...
... != secsuccess) { pr_fprintf(pr_stderr, "encrypt failure\n"); goto cleanup; } /* save the last block of ciphertext as the next iv */ iv = encbuf; ivlen = encbuflen; /* write the cipher text to intermediate file */ nwritten = pr_write(encfile, encbuf, encbuflen); /*pr_assert(nwritten == encbuflen);*/ rv = macupdate(ctxmac, ptext, ptextlen); } rv = macfinal(ctxmac, mac, &maclen, digestsize); if (rv != secsuccess) { pr_fprintf(pr_stderr, "macfinal failure\n"); goto cleanup; } if (maclen == 0) { pr_fprintf(pr_stderr, "bad mac length\n"); rv = secfailure; goto cleanup; } writetoheaderfile(mac, maclen, mac, headerfile); if (rv != secsuccess...
...ctext, sizeof(ctext))) > 0) { count += ctextlen; /* decrypt cipher text buffer using cbc and iv */ rv = decrypt(ctxenc, decbuf, &decbuflen, sizeof(decbuf), ctext, ctextlen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "decrypt failure\n"); goto cleanup; } if (decbuflen == 0) break; rv = macupdate(ctxmac, decbuf, decbuflen); if (rv != secsuccess) { goto cleanup; } if (count == filelength) { decbuflen = decbuflen-paddinglength; } /* write the plain text to out file */ temp = pr_write(outfile, decbuf, decbuflen); if (temp != decbuflen) { pr_fprintf(pr_stderr, "write error\n"); rv = secfailure; br...
Encrypt and decrypt MAC using token
null, keysize, keyid, pr_true, pwdata); if (!key) { pr_fprintf(pr_stderr, "symmetric key generation failed \n"); } return key; } /* * macinit */ secstatus macinit(pk11context *ctx) { secstatus rv = pk11_digestbegin(ctx); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac failed : pk11_digestbegin()\n"); } return rv; } /* * macupdate */ secstatus macupdate(pk11context *ctx, unsigned char *msg, unsigned int msglen) { secstatus rv = pk11_digestop(ctx, msg, msglen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac failed : digestop()\n"); } return rv; } /* * finalize macing */ secstatus macfinal(pk11context *ctx, unsigned char *mac, unsigned int *maclen, unsigned int maxle...
... pr_fprintf(pr_stderr, "compute mac failed : pk11_digestfinal()\n"); } return secsuccess; } /* * compute mac */ secstatus computemac(pk11context *ctxmac, unsigned char *ptext, unsigned int ptextlen, unsigned char *mac, unsigned int *maclen, unsigned int maxlen) { secstatus rv = macinit(ctxmac); if (rv != secsuccess) return rv; rv = macupdate(ctxmac, ptext, ptextlen); if (rv != secsuccess) return rv; rv = macfinal(ctxmac, mac, maclen, maxlen); return rv; } /* * writetoheaderfile */ secstatus writetoheaderfile(const char *buf, unsigned int len, headertype type, prfiledesc *outfile) { secstatus rv; char header[40]; char trailer[40]; char *outstring = null...
... != secsuccess) { pr_fprintf(pr_stderr, "encrypt failure\n"); goto cleanup; } /* save the last block of ciphertext as the next iv */ iv = encbuf; ivlen = encbuflen; /* write the cipher text to intermediate file */ nwritten = pr_write(encfile, encbuf, encbuflen); /*pr_assert(nwritten == encbuflen);*/ rv = macupdate(ctxmac, ptext, ptextlen); } rv = macfinal(ctxmac, mac, &maclen, digestsize); if (rv != secsuccess) { pr_fprintf(pr_stderr, "macfinal failure\n"); goto cleanup; } if (maclen == 0) { pr_fprintf(pr_stderr, "bad mac length\n"); rv = secfailure; goto cleanup; } writetoheaderfile(mac, maclen, mac, headerfile); if (rv != secsuccess...
...ctext, sizeof(ctext))) > 0) { count += ctextlen; /* decrypt cipher text buffer using cbc and iv */ rv = decrypt(ctxenc, decbuf, &decbuflen, sizeof(decbuf), ctext, ctextlen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "decrypt failure\n"); goto cleanup; } if (decbuflen == 0) break; rv = macupdate(ctxmac, decbuf, decbuflen); if (rv != secsuccess) { goto cleanup; } if (count == filelength) { decbuflen = decbuflen-paddinglength; } /* write the plain text to out file */ temp = pr_write(outfile, decbuf, decbuflen); if (temp != decbuflen) { pr_fprintf(pr_stderr, "write error\n"); rv = secfailure; br...
NSS_3.12_release_notes.html
application to specify ocsp timeout bug 361025: support for camellia cipher suites to tls rfc4132 bug 376417: pk11_generatekeypair needs to get the key usage from the caller. bug 391291: shared database integrity checks not yet implemented. bug 391292: shared database implementation slow bug 391294: shared database implementation really slow on network file systems bug 392521: automatic shared db update fails if user opens database r/w but never supplies a password bug 392522: integrity hashes must be updated when passwords are changed. bug 401610: shared db fails on iopr tests bug 388120: build error due to sec_begin_protos / sec_end_protos are undefined bug 415264: make security use of new nspr rotate macros bug 317052: lib/base/whatnspr.c is obsolete bug 317323: set nspr31_lib_prefix to empty...
...: invalid pointer bug 300929: certificate policy extensions not supported bug 129303: nss needs to expose interfaces to deal with multiple token sources of certs. 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_httpcertstore.c bug 401026: need to provide a way to modify and create new pkcs #11 objects. bug 403680: cert_pkixverifycert fails if crls are missing, implement cert_pi_revocationflags bug 427706: nss_3_12_rc1 crashes in passwordmgr tests bug 426245: assertion failure went undetected by tinderbox bug 158242: pk...
...bug 132485: built-in root certs slot description is empty bug 177184: nss_cmsdecoder_cancel might have a leak bug 232392: erroneous root ca tests in nss libraries bug 286642: util should be in a shared library bug 287052: function to get crl entry reason code has incorrect prototype and implementation bug 299308: need additional apis in the crl cache for libpkix bug 335039: nssckfwcryptooperation_updatecombo is not declared bug 340917: crlutil should init nss read-only for some options bug 350948: freebl macro change can give 1% improvement in rsa performance on amd64 bug 352439: reference leaks in modutil bug 369144: certutil needs option to generate subjectkeyid extension bug 391771: pk11_config_name and pk11_config_strings leaked on shutdown bug 401194: crash in lg_findobjects on win64 bug 40...
...bug 330721: remove os/2 vacpp compiler support from nss bug 408260: certutil usage doesn't give enough information about trust arguments bug 410226: leak in create_objects_from_handles bug 415007: pk11_findcertfromdersubjectandnickname is dead code bug 416267: compiler warnings on solaris due t...
NSS 3.24 release notes
3.24, which is a minor release. distribution information the hg tag is nss_3_24_rtm. nss 3.24 requires netscape portable runtime (nspr) 4.12 or newer. nss 3.24 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_24_rtm/src/ new in nss 3.24 nss 3.24 includes two nss softoken updates, a new function to configure ssl/tls server sockets, and two functions to improve the use of temporary arenas. new functionality nss softoken has been updated with the latest national institute of standards and technology (nist) guidance (as of 2015): software integrity checks and post functions are executed on shared library load. these checks have been disabled by default, as they ca...
...hey can cause a performance regression. to enable these checks, you must define symbol nss_force_fips when building nss. counter mode and galois/counter mode (gcm) have checks to prevent counter overflow. additional csps are zeroed in the code. nss softoken uses new guidance for how many rabin-miller tests are needed to verify a prime based on prime size. nss softoken has also been updated to allow nss to run in fips level 1 (no password). this mode is triggered by setting the database password to the empty string. in fips mode, you may move from level 1 to level 2 (by setting an appropriate password), but not the reverse. a ssl_configservercert function has been added for configuring ssl/tls server sockets with a certificate and private key. use this new function in place of ssl...
... deprecate the following functions. (applications should instead use the new ssl_configservercert function.) ssl_setstapledocspresponses ssl_setsignedcerttimestamps ssl_configsecureserver ssl_configsecureserverwithcertchain deprecate the nss_findcertkeatype function, as it reports a misleading value for certificates that might be used for signing rather than key exchange. update sslauthtype to define a larger number of authentication key types. deprecate the member attribute authalgorithm of type sslciphersuiteinfo. instead, applications should use the newly added attribute authtype. rename ssl_auth_rsa to ssl_auth_rsa_decrypt. add a shared library (libfreeblpriv3) on linux platforms that define freebl_lowhash. remove most code related to ssl v2, including the abilit...
...the server-side implementation of the ssl/tls protocol still supports processing of received v2-compatible client hello messages. disable (by default) nss support in optimized builds for logging ssl/tls key material to a logfile if the sslkeylogfile environment variable is set. to enable the functionality in optimized builds, you must define the symbol nss_allow_sslkeylogfile when building nss. update nss to protect it against the cachebleed attack. disable support for dtls compression. improve support for tls 1.3. this includes support for dtls 1.3. note that tls 1.3 support is experimental and not suitable for production use. bugs fixed in nss 3.24 this bugzilla query returns all the bugs fixed in nss 3.24: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=compon...
NSS 3.52 release notes
ans petter jansson distribution information the hg tag is nss_3_52_rtm. nss 3.52 requires nspr 4.25 or newer. nss 3.52 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_52_rtm/src/ other releases are available in nss releases. notable changes in nss 3.52 bug 1603628 - update nss to support pkcs #11 v3.0. note: this change modifies the ck_gcm_params struct to include the ulivbits field which, prior to pkcs #11 v3.0, was ambiguously defined and not included in the nss definition. if an application is recompiled with nss 3.52+, this field must be initialized to a value corresponding to ulivlen. alternatively, defining nss_pkcs11_2_0_compat will yield the old defi...
...fips. bug 1630458 - fix problem of gyp msvc builds not producing debug symbol files. bug 1629663 - add ikev1 quick mode kdf. bug 1629661 - mpconfig calls in ssl initialize policy before nss is initialized. bug 1629655 - support temporary session objects in ckfw. bug 1629105 - add pkcs11 v3.0 functions to module debug logger. bug 1626751 - fix error in generation of fuzz32 docker image after updates. bug 1625133 - fix implicit declaration of function 'getopt' error. bug 1624864 - allow building of gcm-arm32-neon on non-armv7 architectures. bug 1624402 - fix compilation error in firefox android. bug 1624130 - require ck_function_list structs to be packed. bug 1624377 - fix clang warning for unknown argument '-msse4'. bug 1623374 - support new pkcs #11 v3.0 message interface for aes-gcm...
...- support new pkcs #11 v3.0 message interface for aes-gcm and chachapoly. bug 1623184 - fix freebl_cpuid for querying extended features. bug 1622555 - fix argument parsing in lowhashtest. bug 1620799 - introduce nss_disable_gcm_arm32_neon to build on arm32 without neon support. bug 1619102 - add workaround option to include both dtls and tls versions in dtls supported_versions. bug 1619056 - update readme: tls 1.3 is not experimental anymore. bug 1618915 - fix ubsan issue in ssl_parsesessionticket. bug 1618739 - don't assert fuzzer behavior in ssl_parsesessionticket. bug 1617968 - update delegated credentials implementation to draft-07. bug 1617533 - update hacl* dependencies for libintvector.h bug 1613238 - add vector accelerated sha2 for power 8+. bug 1612493 - integrate avx2 chacha...
...te avx2 chacha20, poly1305, and chacha20poly1305 from hacl*. bug 1612281 - maintain pkcs11 c_getattributevalue semantics on attributes that lack nss database columns. bug 1612260 - add wycheproof rsa test vectors. bug 1608250 - broken fipstest handling of ki_len. bug 1608245 - consistently handle null slot/session. bug 1603801 - avoid dcache pollution from sdb_measureaccess(). bug 1603628 - update nss to support pkcs #11 v3.0. bug 1561637 - tls 1.3 does not work in fips mode. bug 1531906 - fix overzealous assertion when evicting a cached sessionid or using external cache. bug 1465613 - fix issue where testlib makefile build produced extraneous object files. bug 1619959 - properly handle multi-block seed ecb inputs. bug 1630925 - guard all instances of nsscmssigneddata.signerinfo to av...
NSS Sample Code Sample_3_Basic Encryption and MACing
null, keysize, keyid, pr_true, pwdata); if (!key) { pr_fprintf(pr_stderr, "symmetric key generation failed \n"); } return key; } /* * macinit */ secstatus macinit(pk11context *ctx) { secstatus rv = pk11_digestbegin(ctx); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac failed : pk11_digestbegin()\n"); } return rv; } /* * macupdate */ secstatus macupdate(pk11context *ctx, unsigned char *msg, unsigned int msglen) { secstatus rv = pk11_digestop(ctx, msg, msglen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac failed : digestop()\n"); } return rv; } /* * finalize macing */ secstatus macfinal(pk11context *ctx, unsigned char *mac, unsigned int *maclen, unsigned int maxle...
... pr_fprintf(pr_stderr, "compute mac failed : pk11_digestfinal()\n"); } return secsuccess; } /* * compute mac */ secstatus computemac(pk11context *ctxmac, unsigned char *ptext, unsigned int ptextlen, unsigned char *mac, unsigned int *maclen, unsigned int maxlen) { secstatus rv = macinit(ctxmac); if (rv != secsuccess) return rv; rv = macupdate(ctxmac, ptext, ptextlen); if (rv != secsuccess) return rv; rv = macfinal(ctxmac, mac, maclen, maxlen); return rv; } /* * write to header file */ secstatus writetoheaderfile(const char *buf, unsigned int len, headertype type, prfiledesc *outfile) { secstatus rv; char header[40]; char trailer[40]; char *outstring = n...
... != secsuccess) { pr_fprintf(pr_stderr, "encrypt failure\n"); goto cleanup; } /* save the last block of ciphertext as the next iv */ iv = encbuf; ivlen = encbuflen; /* write the cipher text to intermediate file */ nwritten = pr_write(encfile, encbuf, encbuflen); /*pr_assert(nwritten == encbuflen);*/ rv = macupdate(ctxmac, ptext, ptextlen); } rv = macfinal(ctxmac, mac, &maclen, digestsize); if (rv != secsuccess) { pr_fprintf(pr_stderr, "macfinal failure\n"); goto cleanup; } if (maclen == 0) { pr_fprintf(pr_stderr, "bad mac length\n"); rv = secfailure; goto cleanup; } writetoheaderfile(mac, maclen, mac, headerfile); if (rv != secsuccess...
...ctext, sizeof(ctext))) > 0) { count += ctextlen; /* decrypt cipher text buffer using cbc and iv */ rv = decrypt(ctxenc, decbuf, &decbuflen, sizeof(decbuf), ctext, ctextlen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "decrypt failure\n"); goto cleanup; } if (decbuflen == 0) break; rv = macupdate(ctxmac, decbuf, decbuflen); if (rv != secsuccess) { goto cleanup; } if (count == filelength) { decbuflen = decbuflen-paddinglength; } /* write the plain text to out file */ temp = pr_write(outfile, decbuf, decbuflen); if (temp != decbuflen) { pr_fprintf(pr_stderr, "write error\n"); rv = secfailure; br...
EncDecMAC using token object - sample 3
te the symmetric key */ key = pk11_tokenkeygen(slot, mechanism, null, keysize, keyid, pr_true, pwdata); if (!key) { pr_fprintf(pr_stderr, "symmetric key generation failed \n"); } return key; } /* * macinit */ secstatus macinit(pk11context *ctx) { secstatus rv = pk11_digestbegin(ctx); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac failed : pk11_digestbegin()\n"); } return rv; } /* * macupdate */ secstatus macupdate(pk11context *ctx, unsigned char *msg, unsigned int msglen) { secstatus rv = pk11_digestop(ctx, msg, msglen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac failed : digestop()\n"); } return rv; } /* * finalize macing */ secstatus macfinal(pk11context *ctx, unsigned char *mac, unsigned int *maclen, unsigned int maxlen) { secstatus rv = pk11_digestfinal(ctx, mac, ...
..._digestfinal(ctx, mac, maclen, maxlen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac failed : pk11_digestfinal()\n"); } return secsuccess; } /* * compute mac */ secstatus computemac(pk11context *ctxmac, unsigned char *ptext, unsigned int ptextlen, unsigned char *mac, unsigned int *maclen, unsigned int maxlen) { secstatus rv = macinit(ctxmac); if (rv != secsuccess) return rv; rv = macupdate(ctxmac, ptext, ptextlen); if (rv != secsuccess) return rv; rv = macfinal(ctxmac, mac, maclen, maxlen); return rv; } /* * writetoheaderfile */ secstatus writetoheaderfile(const char *buf, unsigned int len, headertype type, prfiledesc *outfile) { secstatus rv; char header[40]; char trailer[40]; char *outstring = null; switch (type) { case symkey: strcpy(header, enckey_header); strcpy(trailer, encke...
...cksize; } rv = encrypt(ctxenc, encbuf, &encbuflen, sizeof(encbuf), ptext, ptextlen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "encrypt failure\n"); goto cleanup; } /* save the last block of ciphertext as the next iv */ iv = encbuf; ivlen = encbuflen; /* write the cipher text to intermediate file */ nwritten = pr_write(encfile, encbuf, encbuflen); /*pr_assert(nwritten == encbuflen);*/ rv = macupdate(ctxmac, ptext, ptextlen); } rv = macfinal(ctxmac, mac, &maclen, digestsize); if (rv != secsuccess) { pr_fprintf(pr_stderr, "macfinal failure\n"); goto cleanup; } if (maclen == 0) { pr_fprintf(pr_stderr, "bad mac length\n"); rv = secfailure; goto cleanup; } writetoheaderfile(mac, maclen, mac, headerfile); if (rv != secsuccess) { pr_fprintf(pr_stderr, "write mac failure\n"); goto cleanup; } pad[0] ...
...(ek, iv, ivlen, ckm_aes_cbc); filelength = filesize(encryptedfilename); while ((ctextlen = pr_read(infile, ctext, sizeof(ctext))) > 0) { count += ctextlen; /* decrypt cipher text buffer using cbc and iv */ rv = decrypt(ctxenc, decbuf, &decbuflen, sizeof(decbuf), ctext, ctextlen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "decrypt failure\n"); goto cleanup; } if (decbuflen == 0) break; rv = macupdate(ctxmac, decbuf, decbuflen); if (rv != secsuccess) { goto cleanup; } if (count == filelength) { decbuflen = decbuflen-paddinglength; } /* write the plain text to out file */ temp = pr_write(outfile, decbuf, decbuflen); if (temp != decbuflen) { pr_fprintf(pr_stderr, "write error\n"); rv = secfailure; break; } /* save last block of ciphertext */ memcpy(iv, decbuf, decbuflen); ivlen = decbuflen; bloc...
NSS Tools crlutil
type of crl. possible types are: 0 - sec_krl_type, 1 - sec_crl_type. this option is obsolete -u url specify the url. crl generation script syntax: crl generation script file has the following syntax: line with comments should have <bold>#</bold> as a first symbol of a line set "this update" or "next update" crl fields: update=yyyymmddhhmmssz nextupdate=yyyymmddhhmmssz field "next update" is optional. time should be in generalizedtime format (yyyymmddhhmmssz). for example: 20050204153000z add an extension to a crl or a crl certificate entry: addext extension-name critical/non-critical [arg1[arg2 ...]] where: extensio...
... listing crls in a database this example lists all the crls in the nss database in the specified directory: crlutil -l -d certdir the crl management tool displays output similar to the following: crl name crl type cn=nss test ca,o=bogus nss,l=mountain ...
...l=mountain view,st=california,c=us crl cn=john smith,o=netscape,l=mountain view,st=california,c=us crl to view a particular crl user should specify -n nickname parameter. ...
... crl into a database this example imports crl into a database: crlutil -i -i crl-file -d certdir file should has binary format of asn.1 encoded crl data. modifying crl in a database this example modifies a new crl and importing it in to a database in the specified directory: crlutil -g -d certdir -n cert-nickname -c crl-script-file or crlutil -m -d certdir -n cert-nickname <<eof update=20050204153000z addcert 40-60 20050105153000z eof the crl management tool extracts existing crl from a database, will modify and sign with certificate cert-nickname and will store it in database. to modify while importing crl from file user should supply -i import-crl-file option. ...
Index
atch this document, and that's ok. whenever practical, new code and changes should move code closer to the ideal future. and of course, the idea of the future is always evolving in time as things change and we learn more. 6 gc rooting guide spidermonkey no summary! 7 gcintegration developing mozilla, firefox, garbage collection, intermediate, intro, jsapi, needsupdate, spidermonkey, tools, memory the spidermonkey garbage collector (gc) will be changing a lot in the future. this page is intended to explain the changes that are happening, with a focus on how they will affect gecko code that uses jsapi. at a high level, there are three issues to be aware of: 8 getting spidermonkey source code guide, spidermonkey you can get the spidermo...
...tion). 150 jsreserveslotsop jsapi reference, obsolete, reference, référence(2), spidermonkey jsclass offers the following hook: 151 jsresolveop jsapi reference, reference, référence(2), spidermonkey jsresolveop callback is a hook which is called when a property is not found on an object. 152 jsruntime jsapi reference, needscontent, needsupdate, spidermonkey in the jsapi, jsruntime is the top-level object that represents an instance of the javascript engine. a program typically has only one jsruntime, even if it has many threads. the jsruntime is the universe in which javascript objects live; they can't travel to other jsruntimes. 153 jssecuritycallbacks.contentsecuritypolicyallows the jssecuritycallbacks.con...
...elay js_free(p) invocation as a performance optimization as specified by the given jsfreeop instance. 506 js_malloc jsapi reference, spidermonkey js_malloc allocates a region of memory nbytes in size. on success, js_malloc returns a pointer to the beginning of the region. as with the standard c function malloc, memory allocated by js_malloc is uninitialized. 507 js_updatemalloccounter jsapi reference, reference, référence(2), spidermonkey js_updatemalloccounter decrements malloc counter of gc and the zone of the context. 508 object_to_jsval jsapi reference, obsolete, spidermonkey object_to_jsval casts obj from type jsobject * to jsval. if obj is null, the result is jsval_null. 509 private_to_jsval jsapi reference, ob...
...umentation, guide, spidermonkey use these instructions to build the latest spidermonkey source code. 526 rebranding spidermonkey (1.8.5) build documentation, spidermonkey after installing the build pre-requisites and downloading the spidermonkey source tarball issue the following commands at the terminal: 527 spidermonkey internals guide, javascript, needsupdate, spidermonkey at heart, spidermonkey is a fast interpreter that runs an untyped bytecode and operates on values of type js::value—type-tagged values that represent the full range of javascript values. in addition to the interpreter, spidermonkey contains a just-in-time (jit) compiler, a garbage collector, code implementing the basic behavior of javascript values, a standard library implem...
imgIContainer
ormat, [array, size_is(imagelength)] out pruint8 imagedata, out unsigned long imagelength); native code only! obsolete since gecko 2.0 imgicontainer extractcurrentframe([const] in nsintrect arect); native code only! obsolete since gecko 2.0 imgicontainer extractframe(in pruint32 awhichframe, [const] in nsintrect arect, in pruint32 aflags); native code only! void frameupdated(in unsigned long framenum, in nsintrect anewrect); native code only! obsolete since gecko 2.0 void getcurrentframerect(in nsintrect aframerect); native code only! obsolete since gecko 2.0 gfxasurface getframe(in pruint32 awhichframe, in pruint32 aflags); native code only! gfxiimageframe getframeat(in unsigned long index); obsolete since gecko 1.9.2 void get...
...hframe, [const] in nsintrect arect, in pruint32 aflags ); parameters awhichframe frame specifier of the frame_* variety. arect the area of the current frame to be duplicated in the returned imgcontainer's frame. aflags flags of the flag_* variety. ...
... flags of the flag_* variety. return value missing description exceptions thrown missing exception missing description native code only!frameupdated obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. void frameupdated( in unsigned long framenum, in nsintrect anewrect ); parameters framenum missing description anewrect missing description exceptions thrown missing exception missing description native code only!getcurrentframerect obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1)this feature is obsolete. although it may still work in some browsers, its us...
...g exception missing description requestdiscard() if this image is unlocked, discard its decoded data. if the image is locked or has already been discarded, do nothing. void requestdiscard(); parameters none. exceptions thrown missing exception missing description violates the xpcom interface guidelines requestrefresh() indicates that this imgicontainer has been triggered to update its internal animation state. likely this should only be called from within nsimageframe or objects of similar type. void requestrefresh( [const] in timestamp atime ); parameters atime missing description exceptions thrown missing exception missing description resetanimation() void resetanimation(); parameters none. exceptions thrown missing exception missing desc...
mozISpellCheckingEngine
name of the current dictionary used by check() and suggest(). this will be either element from the array returned by getdictionarylist() or an empty string if no dictionary is selected. note: setting this value to a value that doesn't match an existing dictionary throws a ns_error_file_not_found exception. when this attribute's value is changed, a "spellcheck-dictionary-update" notification is sent. if the dictionary was set to "no dictionary" (that is, by specifying an empty string), the observer may select another dictionary before returning. language wstring the language this spell checker is using when checking. this is the language of dictionary. read only. when this changes, the spell checker sends a "spellcheck...
...on is sent. if the dictionary was set to "no dictionary" (that is, by specifying an empty string), the observer may select another dictionary before returning. language wstring the language this spell checker is using when checking. this is the language of dictionary. read only. when this changes, the spell checker sends a "spellcheck-dictionary-update" notification. name wstring the name of the engine. not currently used. read only. personaldictionary mozipersonaldictionary the personal dictionary. providespersonaldictionary boolean does the engine provide its own personaldictionary? read only. provideswordutils boolean does ...
...ilities? read only. methods adddirectory() adds all the dictionaries in the specified directory to the spell checker. void adddirectory( nsifile dir ); parameters dir an nsifile object indicating the directory from which to add dictionaries. check() checks a word to determine if it's spelled correctly. when this changes, the spell checker sends a "spellcheck-dictionary-update" notification. boolean check( in wstring word ); parameters word a word to check for correct spelling. return value returns true if word is spelled correctly according to the dictionary attribute, and returns false if word is misspelled. getdictionarylist() gets the list of dictionaries. void getdictionarylist( [array, size_is(count)] out wstring dictionaries, out pruint32 ...
...ovedirectory() removes all the dictionaries in the specified directory from the spell checker. void removedirectory( nsifile dir ); parameters dir an nsifile object indicating the directory whose spell checkers are to be removed from the spell checker. suggest() gets a list of suggestions for a misspelled word. when this changes, the spell checker sends a "spellcheck-dictionary-update" notification. void suggest( in wstring word, [array, size_is(count)] out wstring suggestions, out pruint32 count ); parameters word a word, which is misspelled according to check. suggestions a list of words suggested instead of word. count the length of suggestions. ...
nsICryptoHMAC
netwerk/base/public/nsicryptohmac.idlscriptable this interface provides hmac signature algorithms. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview acstring finish(in prbool aascii); void init(in unsigned long aalgorithm, in nsikeyobject akeyobject); void reset(); void update([const, array, size_is(alen)] in octet adata, in unsigned long alen); void updatefromstream(in nsiinputstream astream, in unsigned long alen); constants hashing algorithms. these values are to be used by the init() method to indicate which hashing function to use. these values map onto the values defined in mozilla/security/nss/lib/softoken/pkcs11t.h and are switched to ckm_*_hmac ...
... .getservice(components.interfaces.nsikeyobjectfactory) .keyfromstring(components.interfaces.nsikeyobject.hmac, rawkeydata); exceptions thrown ns_error_invalid_arg if an unsupported algorithm type is passed. reset() reinitialize hmac context to be reused with the same settings (the key and hash algorithm) but on different set of data. void reset(); parameters none. ...
...components.interfaces.nsikeyobjectfactory) .keyfromstring(components.interfaces.nsikeyobject.hmac, rawkeydata); exceptions thrown ns_error_invalid_arg if an unsupported algorithm type is passed. reset() reinitialize hmac context to be reused with the same settings (the key and hash algorithm) but on different set of data. void reset(); parameters none. ...
...the same settings (the key and hash algorithm) but on different set of data. void reset(); parameters none. update() void update( [const, array, size_is(alen)] in octet adata, in unsigned long alen ); parameters adata a buffer to calculate the hash over. alen the length of the buffer adata. exceptions thrown ns_error_not_initialized if init() has not been called. updatefromstream() calculates and updates a new hash based on a given data stream. void updatefromstream( in nsiinputstream astream, in unsigned long alen ); parameters astream an input stream to read from. alen how much to read from the given astream. passing pr_uint32_max indicates that all data available will be used to update the hash. exceptions thrown ns_error_not_initi...
nsIDOMSimpleGestureEvent
tureevent interface is the datatype for all mozilla-specific simple gesture events in the document object model. the following events are generated: mozswipegesture - generated when the user completes a swipe across across the input device. mozmagnifygesturestart - generated when the user begins the magnify ("pinch") gesture. the "delta" value represents the initial movement. mozmagnifygestureupdate - generated periodically while the user is continuing the magnify ("pinch") gesture. the "delta" value represents the movement since the last mozmagnifygesturestart or mozmagnifygestureupdate event. mozmagnifygesture - generated when the user has completed the magnify ("pinch") gesture. if you only want to receive a single event when the magnify gesture is complete, you only need to hook this ev...
...esture. the "delta" value represents the movement since the last mozmagnifygesturestart or mozmagnifygestureupdate event. mozmagnifygesture - generated when the user has completed the magnify ("pinch") gesture. if you only want to receive a single event when the magnify gesture is complete, you only need to hook this event and can safely ignore the mozmagnifygesturestart and the mozmagnifygestureupdate events. the "delta" value is the cumulative amount represented by the user's gesture. mozrotategesturestart - generated when the user begins the rotation gesture. the "delta" value represents the initial rotation. mozrotategestureupdate - generated periodically while the user is continuing the rotation gesture. the "delta" value represents the rotation since the last mozrotategesturestart or mo...
...delta" value is the cumulative amount represented by the user's gesture. mozrotategesturestart - generated when the user begins the rotation gesture. the "delta" value represents the initial rotation. mozrotategestureupdate - generated periodically while the user is continuing the rotation gesture. the "delta" value represents the rotation since the last mozrotategesturestart or mozrotategestureupdate event. mozrotategesture - generated when the user has completed the rotation gesture. if you only want to receive a single event when the rotation gesture is complete, you only need to hook this event and can safely ignore the mozrotategesturestart and the mozrotategestureupdate events. the "delta" value is the cumulative amount of rotation represented by the user's gesture. moztapgesture - gen...
...ong clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in unsigned long directionarg, in double deltaarg); attributes attribute type description delta double the delta value indicating how far the gesture moved. for update events, this indicates the movement since the previous update; for the mozrotategesture and mozmagnifygesture events, this indicates the total movement that occurred while the event was being processed. the value is specified in degrees for rotation events (where positive values indicate clockwise rotation and negative values indicate counter-clockwise rotation). for magnify gestures, the un...
nsIDeviceMotion
native code only!addwindowlistener sets the nsiaccelerometer as the source for mozorientation events on the specified dom window. void addwindowlistene...
...pport implementation must begin to notify the specified nsidevicemotionlistener by calling its nsidevicemotionlistener.onaccelerationchange() method as appropriate to share updated acceleration data. void addlistener( in nsidevicemotionlistener alistener ); parameters alistener the nsidevicemotionlistener object whose nsidevicemotionlistener.onaccelerationchange() method should be called with updated acceleration data. native code only!addwindowlistener sets the nsiaccelerometer as the source for mozorientation events on the specified dom window. ...
... native code only!removewindowlistener removes the nsiaccelerometer as the source for mozorientation events on the specified dom window. ...
... native code only!removewindowlistener removes the nsiaccelerometer as the source for mozorientation events on the specified dom window. ...
nsIDownloadManager
ad adddownload(in short adownloadtype, in nsiuri asource, in nsiuri atarget, in astring adisplayname, in nsimimeinfo amimeinfo, in prtime astarttime, in nsilocalfile atempfile, in nsicancelable acancelable, in boolean aisprivate); void addlistener(in nsidownloadprogresslistener alistener); void canceldownload(in unsigned long aid); void cleanup(); void endbatchupdate(); obsolete since gecko 1.9.1 void flush(); obsolete since gecko 1.8 nsidownload getdownload(in unsigned long aid); void onclose(); obsolete since gecko 1.9.1 void open(in nsidomwindow aparent, in nsidownload adownload); obsolete since gecko 1.9.1 void openprogressdialogfor(in nsidownload adownload, in nsidomwindow aparent, in boolean acanceldownloado...
...read only. activedownloads nsisimpleenumerator an enumeration of active nsidownloads. read only. cancleanup boolean whether or not there are downloads that can be cleaned up (removed) that i...
...d the unique id of the download. exceptions thrown ns_error_failure the download is not in progress. cleanup() removes completed, failed, and canceled downloads from the list. also notifies observers of the "download-manager-remove-download" topic with a null subject to allow any download manager consumers to react to the removals. void cleanup(); parameters none. endbatchupdate() obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) indicate that a batch update is ending. void endbatchupdate(); parameters none. flush() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) flush the download datasource to disk. void flush(); parameters none. getdownload() retrieves a download ...
...d. void retrydownload( in unsigned long aid ); parameters aid the unique id of the download. exceptions thrown ns_error_failure if the download is not in the following states: download_canceled or download_failed. ns_error_not_availale if the download id is not known. savestate() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) update the download datasource. void savestate(); parameters none. startbatchupdate() obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) indicate that a batch update (for example mass removal) is about to start. void startbatchupdate(); parameters none. see also nsidownload nsidownloadmanagerui nsidownloadprogresslistener the download ma...
nsIFile
ot use the native form unless it is guaranteed that the path passed to a native form function is always ascii. to create an nsifile from a path you can use fileutils.jsm: var fileutils = cu.import("resource://gre/modules/fileutils.jsm").fileutils var nsifile = new fileutils.file( filename ) note: nsilocalfile was merged with this interface in gecko 14. much of the documentation has not been updated to reflect this change. method overview void append(in astring node); void appendnative(in acstring node); native code only! void appendrelativenativepath(in acstring relativefilepath); void appendrelativepath(in astring relativefilepath); nsifile clone(); boolean contains(in nsifile infile); void copyto(in nsifile newparentdir, in...
...te permissions will return false. for specific handling before gecko 9 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6), please see bug 682571. boolean iswritable(); parameters none. return value true if the file or directory may be modified by the user. otherwise it returns false. moveto() this method moves this file to a new location. note: if this method succeeds, this instance will be updated to point to the new file. if the current file path corresponds to a regular file (for storage of bytes), and if the new leaf name identifies a regular file that already exists, then this method will overwrite the destination file. usually, "move" means to relocate the file to a different directory without changing the file's contents or properties, or in fact the file's serial number (inode). ...
...denied indicates that an attempt was made to move a directory to the location of an existing directory that is not writable. ns_error_file_destination_not_dir indicates that "newparentdir" exists and is not a directory. native code only! movetonative this method moves this file to a new location. [native character encoding variant] note: if this method succeeds, this instance will be updated to point to the new file. if the current file path corresponds to a regular file (for storage of bytes), and if the new leaf name identifies a regular file that already exists, then this method will overwrite the destination file. usually, "move" means to relocate the file to a different directory without changing the file's contents or properties, or in fact the file's serial number (inode). ...
...nent of the path prefix is not a directory. ns_error_file_access_denied read or search permission was denied for a component of the path prefix. renameto() this method moves this file to a new location within the same volume. this method is identical to moveto except that if this file or directory is moved to a a different volume, it fails and if this method succeeds, this instance will not updated to point to the new file. void renameto( in nsifile newparentdir, in astring newname ); parameters newparentdir this parameter specifies the parent directory to move the file into. if this parameter is null, then the parent directory of the file will be used. newname this parameter allows you to specify a new leaf name for the file to be moved. this parameter may be empty, in which ...
nsIMsgDBView
rtordervalue sortorder, in nsmsgviewflagstypevalue viewflags, out long count); void openwithhdrs(in nsisimpleenumerator aheaders, in nsmsgviewsorttypevalue asorttype, in nsmsgviewsortordervalue asortorder, in nsmsgviewflagstypevalue aviewflags, out long acount); void close(); void init(in nsimessenger amessengerinstance, in nsimsgwindow amsgwindow, in nsimsgdbviewcommandupdater acommandupdater); void sort(in nsmsgviewsorttypevalue sorttype, in nsmsgviewsortordervalue sortorder); void docommand(in nsmsgviewcommandtypevalue command); void docommandwithfolder(in nsmsgviewcommandtypevalue command, in nsimsgfolder destfolder); void getcommandstatus(in nsmsgviewcommandtypevalue command, out boolean selectable_p, out nsmsgviewcommandcheckst...
... nsmsgnavigationtypevalue motion); nsmsgkey getkeyat(in nsmsgviewindex index); nsimsgdbhdr getmsghdrat(in nsmsgviewindex index); nsimsgfolder getfolderforviewindex(in nsmsgviewindex index); acstring geturiforviewindex(in nsmsgviewindex index); nsimsgdbview clonedbview(in nsimessenger amessengerinstance, in nsimsgwindow amsgwindow, in nsimsgdbviewcommandupdater acommandupdater); void geturisforselection([array, size_is(count)] out string uris, out unsigned long count); void getindicesforselection([array, size_is(count)] out nsmsgviewindex indices, out unsigned long count); void loadmessagebymsgkey(in nsmsgkey amsgkey); void loadmessagebyviewindex(in nsmsgviewindex aindex); void loadmessagebyurl(in string aur...
...r flags to be used. defined in the interface: nsmsgviewflagstype. return values acount upon return, the count variable may contain the number of messages loaded. close() close the current list of messages. void close(); init() initializes the database view for use. void init(in nsimessenger amessengerinstance, in nsimsgwindow amsgwindow, in nsimsgdbviewcommandupdater acommandupdater); parameters amessengerinstance amsgwindow acommandupdater sort() sorts the currently loaded messages. void sort(in nsmsgviewsorttypevalue sorttype, in nsmsgviewsortordervalue sortorder); parameters sorttype a nsmsgviewsorttypevalue designating the sort type used. defined in the interface: nsmsgviewsorttype. sortorder an nsmsgviewsortordervalue desi...
...index index); parameters index the index to get the url for>. nsmsgviewindex is defined as a unsigned long in mailnewstypes2.idl. return value a string containing the messages url. clonedbview() clones this nsimsgdbview. nsimsgdbview clonedbview(in nsimessenger amessengerinstance, in nsimsgwindow amsgwindow, in nsimsgdbviewcommandupdater acommandupdater); parameters amessengerinstance the nsimessenger to use in the clone. amsgwindow the nsimsgwindow to use in the clone. acommandupdater the nsimsgdbviewcommandupdater to use in the clone. geturisforselection() gets an arry of urls for all currently selected messages. void geturisforselection([array, size_is(count)] out string uris, ...
nsINavBookmarkObserver
r bookmark changes. ...
... 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 21.0 (firefox 21.0 / thunderbird 21.0 / seamonkey 2.18) method overview void onbeforeitemremoved(in long long aitemid, in unsigned short aitemtype, in long long aparentid, in acstring aguid, in acstring aparentguid); obsolete since gecko 21.0 void onbeginupdatebatch(); void onendupdatebatch(); void onfolderadded(in print64 folder, in print64 parent, in print32 index); obsolete since gecko 1.9 void onfolderchanged(in print64 folder, in acstring property); obsolete since gecko 1.9 void onfoldermoved(in print64 folder, in print64 oldparent, in print32 oldindex, in print64 newparent, in print32 newindex); obsolete since gecko 1.9 void onfolderrem...
...d ); parameters aitemid the id of the bookmark that will be removed. aitemtype the type of the item that is about to be removed; this is one of the nsinavbookmarksservice.type constants. aparentid the id of the folder containing the item. aguid the unique id associated with the item. aparentguid the unique id associated with the item's parent. onbeginupdatebatch() this method notifies this observer that a batch transaction has started. other notifications will be sent during the batch change, but the observer is guaranteed that onendupdatebatch() will be called at the completion of changes. during a batch the observer should do its best to reduce the work done to handle notifications, since multiple changes are going to happen in a short timeframe. ...
... method notifies this observer that a batch transaction has started. other notifications will be sent during the batch change, but the observer is guaranteed that onendupdatebatch() will be called at the completion of changes. during a batch the observer should do its best to reduce the work done to handle notifications, since multiple changes are going to happen in a short timeframe. void onbeginupdatebatch(); parameters none. onendupdatebatch() this method notifies this observer that a batch transaction has ended. void onendupdatebatch(); parameters none. onfolderadded() obsolete since gecko 1.9 (firefox 3) notify this observer that a bookmark folder has been added. void onfolderadded( in print64 folder, in print64 parent, in print32 index ); parameters ...
nsITreeBoxObject
view nsitreeview the view that backs the tree and that supplies it with its data. it is dynamically settable, either using a view attribute on the tree tag or by setting this ...
... view nsitreeview the view that backs the tree and that supplies it with its data. it is dynamically settable, either using a view attribute on the tree tag or by setting this attribute to a new value. ...
...led multiple times. void rowcountchanged(in long index, in long count); parameters index the position at which the new rows were added or at which rows were removed. count the number of rows added or removed. use negative values for removed rows. example you deleted the row with index rowindex. ...
... parameters index the position at which the new rows were added or at which rows were removed. count the number of rows added or removed. use negative values for removed rows. example you deleted the row with index rowindex. inform the tree about this change by calling rowcountchanged(rowindex+1, -1); beginupdatebatch() notify the tree that the view is about to perform a batch update, that is, add, remove or invalidate several rows at once. this must be followed by calling endupdatebatch(), otherwise the tree will get out of sync. void beginupdatebatch(); endupdatebatch() notify the tree that the view has completed a batch update. void endupdatebatch(); clearstyleandimagecaches() called on a theme switch to flush out the tree's style and image caches. void clearstyleandi...
nsIXPConnect
obsolete since gecko 2.0 jsval varianttojs(in jscontextptr ctx, in jsobjectptr scope, in nsivariant value); void wrapjs(in jscontextptr ajscontext, in jsobjectptr ajsobj, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result); void wrapjsaggregatedtonativ...
...xtptr read only. deferreleasesuntilaftergarbagecollection prbool obsolete since gecko 1.9 pendingexception nsiexception constants constant value description init_js_standard_classes 1 << 0 flag_system_global_object 1 << 1 omit_components_object 1 << 2 xpc_xow_clearscope 1 tells updatexows() to clear the scope of all of the xows it finds. obsolete since gecko 2.0 methods native code only!addjsholder root js objects held by aholder. void addjsholder( in voidptr aholder, in nsscriptobjecttracerptr atracer ); parameters aholder the object that hold the js objects that should be rooted. atracer missing description exceptions thrown missing exception m...
...nsixpcsecuritymanager amanager, in pruint16 flags ); parameters ajscontext missing description amanager missing description flags missing description exceptions thrown missing exception missing description syncjscontexts() deprecated do-nothing function. void syncjscontexts(); parameters none. ...
... aobject which xpcwrappednative we should find the xows for. away what operation to perform. ...
XPCOM Interface Reference by grouping
loginmanager nsiloginmanagerstorage nsiloginmetainfo history nsiglobalhistory nsiglobalhistory2 nsiglobalhistory3 ssl nsibadcertlistener2 system action nsicancelable application application nsiapplicationupdateservice nsiappshell nsiappshellservice nsiappstartup xul nsixulappinfo nsixulruntime nsixultemplatebuilder nsixultemplatequeryprocessor nsixultemplateresult bookmark livemark nsilivemarkserv...
...nsisocketproviderservice nsisockettransport nsisockettransportservice nsisupports nsiuuidgenerator debug nsistackframe device display nsiscreen nsiscreenmanager geolocation nsigeolocationprovider nsigeolocationupdate orientation nsiacceleration nsiaccelerationlistener nsiaccelerometer misc nsisound nsiwifimonitor document nsiwebnavigation environment nsienvironment event nsieventlisten...
... windows nsitaskbarpreview nsitaskbarpreviewbutton nsitaskbarpreviewcontroller nsitaskbarprogress nsitaskbartabpreview nsitaskbarwindowpreview nsiwintaskbar nsialertsservice nsiwebprogress nsiwebprogresslistener nsiwebprogresslistener2 update nsiupdate nsiupdatechecker nsiupdatechecklistener nsiupdateitem nsiupdatemanager nsiupdatepatch nsiupdateprompt nsiupdatetimermanager nsiprogramminglanguage thunderbird credentials nsimsgaccountmanagerextension element nsieditormailsupport ...
...nglanguage thunderbird credentials nsimsgaccountmanagerextension element nsieditormailsupport message nsidbchangeannouncer nsidbchangelistener nsimessenger nsimsgcompfields nsimsgcustomcolumnhandler nsimsgdatabase nsimsgdbhdr nsimsgdbview nsimsgdbviewcommandupdater nsimsgfolder nsimsgidentity nsimsgmessageservice nsimsgsendlater nsimsgthread nsimsgwindow nsimsgwindowcommands user history nsibrowserhistory nsibrowsersearchservice nsimicrosummary nsimicrosummarygenerator nsimicrosummaryobserver nsimicrosummaryservice nsimicrosummaryset ...
Index
test it? on window and mac, the cached compose window is on by default. to test it 17 content tabs thunderbird content tabs enable thunderbird to display remote content in a tab, which users can browse in (mostly) the same way as with a browser. for example, invoking thunderbird's help | what's new menu option opens a tab that displays web content. the thunderbird team can update this content via the website at any time. 18 cookies in thunderbird cookies, guide, thunderbird in versions of thunderbird prior to 3 the cookie policy was very restrictive (to rss only). thunderbird 3 uses the gecko cookie policy with some changes. 19 creating a gloda message query thunderbird 3, thunderbird this page describes how to programmatically cr...
...tension 9: distributing extensions, thunderbird the addons.mozilla.org site is a distribution site where you can host your extension for free. your extension will be hosted on mozilla's mirror network. mozilla's site also provides users with easier installation and will automatically make new versions available to users of your existing versions when you upload them. in addition mozilla update allows users to comment and provide feedback on your extension. it is highly recommended that you use amo to distribute your extensions. 83 creating a custom column add-ons, extensions, thunderbird in this example we will be developing a small extension that will be adding a column that will display the "reply-to:" field of an email (if it exists, it if often not set). if you...
...erbird application as well as the currently opened tabs. you can do many things with the window object, such as accessing the height or width of the window/tab or setting its title, registering timer events and much more. the window api will give you the complete details. since window is a global variable you can use it directly from your javascript file. 96 access window area needsupdate, missing, thunderbird this page has no content. enrich mdc by contributing. 97 add new tab missing, thunderbird no summary! 98 add option to context menu incomplete, thunderbird assuming this on chrome.manifest: 99 add tab needsupdate, missing, thunderbird this page has no content. enrich mdc by contributing. 100 add ...
...bird version thunderbird on thunderbird version 3.0b3pre and later, you can use the following snippet to get the thunderbird version. (version 3.0b3pre was the first build to include steel.) 105 modify folder pane display missing, thunderbird see https://addons.mozilla.org/thu...er-categories/ for an example. 106 modify message list needscontent, needsupdate, missing, thunderbird this page has no content. enrich mdc by contributing. 107 use sqlite thunderbird if you'd like to use an sqlite database in your extension you'll need to look over the storage docs for an api reference, however this code should get you started. be careful of multi-thread access to your database. 108 folders and message lists guide, t...
Mozilla
existing password management system, or use your own password storage format or database. so for example, on kde is is desirable to fully employ the kde wallet manager, rather than any secondary replacements of kdewallet. creating a spell check dictionary add-on this page describes how to package a hunspell spell check dictionary as a firefox add-on, or how to update your existing add-on, so that it can be installed, uninstalled and updated without a restart. creating javascript callbacks in components xpcom components use idl to create interfaces. these interfaces are used to manipulate the component in c++ and javascript. a common pattern used with interfaces to create a bi-directional communication between two...
... like security and backups. seamonkey seamonkey is mozilla's all in one internet suite. these pages document seamonkey's mailnews component and also provide links to documentation about the mailnews backend which is also used in other projects such as eudora/penelope, thunderbird, correo, etc. setting up an update server the goal of this document is to provide instructions for installing a locally-served firefox update. signing mozilla apps for mac os x mac os x's gatekeeper functionality prevents users from launching applications that haven't been code-signed, in order to help keep their computers secure. firefox and thunderbird releases are both signed before shi...
... the thunderbird community. these pages document thunderbird and the mailnews backend which is also used in other projects such as seamonkey and postbox. toolkit version format this document is a reference for the version format, as used in firefox 1.5 (xulrunner 1.8) and later. this format is used by the extension manager, software update, and other parts of the platform. versions in at least the following places must conform to this format: using c++ in mozilla code documentation moved in-tree using js in mozilla code js language features that are implemented in the mozilla js engine are ordinarily safe to use in mozilla code. using mozilla code in other proj...
...e, this popup notification is displayed when a web site requests geolocation information: using raii classes in mozilla raii classes are useful when two operations (e.g., lock/unlock, addref/release, pushstate/popstate) must be paired. using tab-modal prompts note: this part of the documentation is outdated. the updated prompt documentation can be found in the firefox source docs. using the mozilla source server using the mozilla source server is now even more feature-packed. the nightly debug builds are now also source indexed so that by following a couple of simple steps you can also have the source code served to you for debugging without a loc...
Frame rate - Firefox Developer Tools
the frame rate graph in the performance tool shows you the frame rate over the course of a recording. ...
...e having problems, enabling you to use the other tools for a more in-depth analysis. frame rate and responsiveness frame rate is the rate at which a video device can produce images (or frames). it's most familiar from film and gaming, but is now widely used as a performance measure for websites and web apps. in web performance, a frame encapsulates the work the browser needs to do in order to update and repaint the screen. frame rate is most obviously applicable to animations: if the frame rate is too low, an animation will have a jerky appearance, while a faster frame rate will be smoother. but frame rate is also useful as a general measure of a site's responsiveness as the user interacts with it. for example, if moving the mouse over some page element triggers some javascript that changes...
..., if moving the mouse over some page element triggers some javascript that changes the element's appearance, and that triggers a reflow and a repaint, then all this work needs to be completed in that frame. if it takes too long for the browser to process the frame, then the browser will appear momentarily unresponsive (janky). ...
... however, consistency is especially important: if you can't deliver 60fps, it's better to deliver lower frame rates more consistently, and avoid sudden dips in the frame rate which cause the site to freeze. frame rate graph the frame rate graph is found in the recording overview part of the performance tool. ...
Ajax navigation example - Web APIs
function ajaxerror () { alert("unknown error."); } function ajaxload () { var vmsg, nstatus = this.status; switch (nstatus) { case 200: vmsg = json.parse(this.responsetext); document.title = opageinfo.title = vmsg.page; document.getelementbyid(stargetid).innerhtml = vmsg.content; if (bupdateurl) { history.pushstate(opageinfo, opageinfo.title, opageinfo.url); bupdateurl = false; } break; default: vmsg = nstatus + ": " + (ohttpstatus[nstatus] || "unknown"); switch (math.floor(nstatus / 100)) { /* case 1: // i...
... bisloading = true; oreq.onload = ajaxload; oreq.onerror = ajaxerror; if (spage) { opageinfo.url = filterurl(spage, null); } oreq.open("get", filterurl(opageinfo.url, "json"), true); oreq.send(); oloadingbox.parentnode || document.body.appendchild(oloadingbox); } function requestpage (surl) { if (history.pushstate) { bupdateurl = true; getpage(surl); } else { /* ajax navigation is not supported */ location.assign(surl); } } function processlink () { if (this.classname === sajaxclass) { requestpage(this.href); return false; } return true; } function init () { opageinfo.title = document.title; ...
...available", 504: "gateway timeout", 505: "http version not supported", 506: "variant also negotiates (experimental)", 507: "insufficient storage", 508: "loop detected", 509: "unassigned", 510: "not extended", 511: "network authentication required" }; var oreq, bisloading = false, bupdateurl = false; oloadingbox.id = "ajax-loader"; ocover.onclick = abortreq; oloadingimg.src = "data:image/gif;base64,r0lgodlheaaqapiaap///waaamlcwkjcqgaaagjiyokcgpkskih/c05fvfndqvbfmi4waweaaaah/hpdcmvhdgvkihdpdgggywphegxvywquaw5mbwah+qqjcgaaacwaaaaaeaaqaaadmwi63p4wyklre2mioggznadomgyjrbexwroumcg2lmdewnhqlvsyod2mbzkydadka+diaaah+qqjcgaaacwaaaaaeaaqaaadnai63p5ojcegg4qmu7dmikrxqlfuydezigbmrv...
...addeventlistener("load", init, false) : window.attachevent ? attachevent("onload", init) : (onload = init); // public methods this.open = requestpage; this.stop = abortreq; this.rebuildlinks = init; })(); for more ...
IDBRequest.transaction - Web APIs
or abort the the upgrade. following the upgrade, the transaction ​property will again be null. note: this feature is available in web workers. syntax var mytransaction = request.transaction; value an idbtransaction. example the following example requests a given record title, onsuccess gets the associated record from the idbobjectstore (made available as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store in another request. the source of the requests is logged to the developer console — both originate from the same transaction. for a full working example, see our to-do notifications app (view example live.) var title = "walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todoli...
..."walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as it's title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objectstoretitlerequest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item back // into the database var updatetitlerequest = objectstore.put(data); // log the transaction that originated this request console.log("the transaction that originated this request is " + updatetitlerequest.transaction); // when this new request succeeds, run the di...
... openrequest.onupgradeneeded = function(event) { console.log(openrequest.transactio...
...ed = "yes"; // create another request that inserts the item back // into the database var updatetitlerequest = objectstore.put(data); // log the transaction that originated this request console.log("the transaction that originated this request is " + updatetitlerequest.transaction); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; this example shows how a the transaction property can be used during a version upgrade to access existing object stores:​ var openrequest = indexeddb.open('db', 2); console.log(openrequest.transaction); // will log "null". openrequest.onupgradeneeded = function(event) { console.log(openrequest.transaction.mode); // will log ...
KeyboardEvent.code - Web APIs
arts at 0° (pointing straight up). finally, spaceship is set to refer to the element with the id "spaceship", which is the svg polygon representing the ship the player controls. ...
... updateposition(). this function takes as input the distance the ship is to be moved, where positive is a forward movement and negative is a backward movement. this function computes the new position of the ship given the distance moved and the current direction the ship is facing. it also handles ensuring that the ship wraps across the boundaries of the play field instead of vanishing. ...
...tening for keydown events, acting on each key by updating the ship position and rotation angle, then calling refresh() to draw the ship at its new position and angle. ...
...refresh() to draw the ship at its new position and angle. ...
Key Values - Web APIs
ode_henkan (214) "dead" a dead "combining" key; that is, a key which is used in tandem with other keys to generate accented and other modified characters. if pressed by itself, it doesn't generate a character. if you wish to identify which specific dead key was pressed (in cases where more than one exists), you can do so by examining the keyboardevent's associated compositionupdate event's data property. see dead keycodes for linux below "finalmode" the final (final mode) key is used on some asian keyboards to enter final mode when using imes. vk_final (0x18) "groupfirst" switches to the first character group on an iso/iec 9995 keyboard. each key may have multiple groups of characters, each in its own column. pressi...
... this key is reported as "unidentified" prior to firefox 37. dead keycodes for linux linux generates accented characters using special dead keys. dead keys are keys which are pressed in combination with character keys to generate accented forms of those characters. you can identify which specific dead key was used (if more than one exists) by examining the keyboardevent's associated compositionupdate event's data property. you can find a table of the dead keys and the characters they can be used with to generate accented or otherwise special characters on linux using gtk. the value of data will be one of the following: compositionevent.data value symbol comments gdk_key_dead_grave (0xfe50) qt::key_dead_grave (0x01001250) ` gdk_key_dead_acute...
...icmute (0x01000113) keycode_mute (91) "microphonevolumeup" increases the microphone's input volume. appcommand_microphone_volume_up qt::key_micvolumeup (0x0100011d) [1] internet explorer, edge, and firefox (48 and earlier) use "volumeup", "volumedown", and "volumemute" instead of "audiovolumeup", "audiovolumedown", and "audiovolumemute". in firefox 49 they were updated to match the latest specification. tv control keys these key values represent buttons or keys present on television devices, or computers or phones which have tv support. keyboardevent.key value description virtual keycode windows mac linux android "tv" [1] switches into tv viewing mode. keycode_tv (170) "tv3dmode" toggle...
..._launche (0x1008ff4e) qt::key_launche (0x010000b0) "launchapplication16" the 16th generic application launcher button. gdk_key_launchf (0x1008ff4f) qt::key_launchf (0x010000b1) [1] internet explorer, edge, and firefox (36 and earlier) use "selectmedia" instead of "launchmediaplayer". firefox 37 through firefox 48 use "mediaselect". firefox 49 has been updated to match the latest specification, and to return "launchmediaplayer". [2] google chrome 57 and earlier returned "launchmycomputer" instead of "launchapplication1". see chrome bug 612743 for more information. [3] google chrome 57 and earlier returned "launchcalculator" instead of "launchapplication2". see chrome bug 612743 for more information. [4] prior to firefox 37, firefox returned the key...
PaymentRequest: paymentmethodchange event - Web APIs
event handler property onpaymentmethodchange examples let's take a look at an example. this code creates a new paymentrequest, adds a handler for the paymentmethodchange event by calling the request's addeventlistener(), then calls show() to present the payment interface to the user. the code assumes the existence of a method detailsforshipping(), which returns a paymentdetailsupdate object containing the shipping options for the ground shipping method, in the form found in the paymentshippingoption dictionary. by doing so, the payment form defaults to the ground shipping method. const options = { requestshipping: true }; const paymentrequest = new paymentrequest(paymentmethods, detailsforshipping("ground"), options); paymentrequest.addeventlistener("paymentmethodc...
..., detailsforshipping("ground"), options); paymentrequest.addeventlistener("paymentmethodchange", handlepaymentchange, false); paymentrequest.show() .then(response => response.complete("success")) .catch(err => console.log("error handling payment request: " + err)); the event handler function itself, handlepaymentchange(), looks like this: handlepaymentchange = event => { const detailsupdate = {}; if (event.methodname === "https://apple.com/apple-pay") { const servicefeeinfo = calculateservicefee(event.methoddetails); object.assign(detailsupdate, servicefeeinfo); } event.updatewith(detailsupdate); }, false); this begins by looking at the event's methodname property; if that indicates that the user is trying to use apple pay, we pass the methoddetails into a function...
... related events merchantvalidation, shippingaddresschange, shippingoptionchange, and payerdetailchange ...
...create to take the information about the transaction, such as the underlying credit card being used to service the apple pay request, and compute and return an paymentdetailsupdate object that specifies changes to be applied to the paymentrequest in order to add any service fees that the payment method might require. before the event handler returns, it calls the event's paymentmethodchangeevent.updatewith.updatewith() method to integrate the changes into the request. related events merchantvalidation, shippingaddresschange, shippingoptionchange, and payerdetailchange specifications specification status comment payment request apithe definition of 'paymentmethodchange' in that specification. candidate recommendation ...
PaymentRequest.shippingAddress - Web APIs
ull by default. syntax var paymentaddress = paymentrequest.shippingaddress; example generally, the user agent will fill the shippingaddress property value. you can trigger this by setting paymentoptions.requestshipping to true when calling the paymentrequest constructor. in the example below, the cost of shipping varies by geography. ...
...paymentaddress = paymentrequest.shippingaddress; example generally, the user agent will fill the shippingaddress property value. you can trigger this by setting paymentoptions.requestshipping to true when calling the paymentrequest constructor. in the example below, the cost of shipping varies by geography. ...
...onshippingaddresschange is called, updatedetails() is called to update the details of the paymentrequest, using shippingaddress to set the correct shipping cost. // initialization of paymentrequest arguments are excerpted for the sake of // brevity. var payment = new paymentrequest(supportedinstruments, details, options); payment.addeventlistener('shippingaddresschange', function(evt) { evt.updatewith(new promise(function(resolve) { updatedetails(details, request.shippingaddress, resolve); })); }); payment.show().then(function(paymentresponse) { // processing of paymentresponse exerpted for brevity. ...
...payment.addeventlistener('shippingaddresschange', function(evt) { evt.updatewith(new promise(function(resolve) { updatedetails(details, request.shippingaddress, resolve); })); }); payment.show().then(function(paymentresponse) { // processing of paymentresponse exerpted for brevity. ...
PaymentResponse.shippingAddress - Web APIs
ect providing details comprising the shipping address provided by the user. example generally, the user agent will fill the shippingaddress property for you. you can trigger this by setting paymentoptions.requestshipping to true when calling the paymentrequest constructor. in the example below, the cost of shipping varies by geography. ...
...ing the shipping address provided by the user. example generally, the user agent will fill the shippingaddress property for you. you can trigger this by setting paymentoptions.requestshipping to true when calling the paymentrequest constructor. in the example below, the cost of shipping varies by geography. ...
... paymentrequest.onshippingaddresschange is called, updatedetails() is called to update the details of the paymentrequest, using shippingaddress to set the correct shipping cost. // initialization of paymentrequest arguments are excerpted for brevity. var payment = new paymentrequest(supportedinstruments, details, options); request.addeventlistener('shippingaddresschange', function(evt) { evt.updatewith(new promise(function(resolve) { updatedetails(details, request.shippingaddress, resolve); })); }); payment.show().then(function(paymentresponse) { // processing of paymentresponse exerpted for the same of brevity. ...
...addeventlistener('shippingaddresschange', function(evt) { evt.updatewith(new promise(function(resolve) { updatedetails(details, request.shippingaddress, resolve); })); }); payment.show().then(function(paymentresponse) { // processing of paymentresponse exerpted for the same of brevity. ...
Pointer Lock API - Web APIs
// pointer lock event listener // hook pointer lock state change events for different browsers document.addeventlistener('pointerlockchange', lockchangealert, false); document.addeventlistener('mozpointerlockchange', lockchangealert, false); this function checks the pointlockelement property to see if it is our canvas. ...
... if it is our canvas. if so, it attached an event listener to handle the mouse movements with the updateposition() function. if not, it removes the event listener again. function lockchangealert() { if (document.pointerlockelement === canvas || document.mozpointerlockelement === canvas) { console.log('the pointer lock status is now locked'); document.addeventlistener("mousemove", updateposition, false); } else { console.log('the pointer lock status is now unlocked'); document.removeeventlistener("mousemove", updateposition, false); } } the updateposition() function updates the position of the ball on the canvas (x and y), and also includes if() statements to check whether the ball has gone off the edges of the canvas. if so, it makes the ball wrap around to the oppo...
...ion() function updates the position of the ball on the canvas (x and y), and also includes if() statements to check whether the ball has gone off the edges of the canvas. if so, it makes the ball wrap around to the opposite edge. it also includes a check whether a requestanimationframe() call has previously been made, and if so, calls it again as required, and calls the canvasdraw() function that updates the canvas scene. a tracker is also set up to write out the x and y values to the screen, for reference. ...
...e ball wrap around to the opposite edge. it also includes a check whether a requestanimationframe() call has previously been made, and if so, calls it again as required, and calls the canvasdraw() function that updates the canvas scene. a tracker is also set up to write out the x and y values to the screen, for reference. ...
SVGAngle - Web APIs
Web › API › SVGAngle
at can be an <angle> or <number> value. an svgangle reflected through the animval attribute is always read only. an svgangle object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. an svgangle object can be associated with a particular element. the associated element is used to determine which element's content attribute to update if the object reflects an attribute. unless otherwise described, an svgangle object is not associated with any element. every svgangle object operates in one of two modes: reflect the base value of a reflected animatable attribute (being exposed through the baseval member of an svganimatedangle), be detached, which is the case for svgangle objects created with svgsvgelement.createsvgangle()...
...eg an <angle> with a deg unit. svg_angletype_rad an <angle> with a rad unit. svg_angletype_grad an <angle> with a grad unit. properties unittype the type of the value as specified by one of the svg_angletype_* constants defined on this interface. value the value as a floating point value, in user units. ...
...to be updated automatically to reflect this setting. exceptions on setting: a domexception with code no_modification_allowed_err is raised when the length corresponds to a read-only attribute, or when the object itself is read-only. valueinspecifiedunits the value as a floating point value, in the units expressed by unittype. setting this attribute will cause value and valueasstring to be updated automatically to reflect this setting. exceptions on setting: a domexception with code no_modification_allowed_err is raised when the length corresponds to a read-only attribute, or when the object itself is read-only. valueasstring the value as a domstring value, in the units expressed by unittype. ...
... exceptions on setting: a domexception with code syntax_err is raised if the assigned string cannot be parsed as a valid <angle>. a domexception with code no_modification_allowed_err is raised when the length corresponds to a read-only attribute, or when the object itself is read-only. ...
Screen Wake Lock API - Web APIs
n needs to keep running. wakelocksentinel provides a handle to the underlying platform wake lock and if referenced can be manually released and reacquired. get an instance of the object by calling wakelock.request. navigator.wakelock returns a wakelock object instance, from which all other functionality can be accessed. examples feature detection this code checks for wake lock support and updates the ui accordingly. if ('wakelock' in navigator) { issupported = true; statuselem.textcontent = 'screen wake lock api supported!'; } else { wakebutton.disabled = true; statuselem.textcontent = 'wake lock is not supported by this browser.'; } requesting a wake lock the following example demonstrates how to request a wakelocksentinel object. the wakelock.request method is promise based...
...orted = true; statuselem.textcontent = 'screen wake lock api supported!'; } else { wakebutton.disabled = true; statuselem.textcontent = 'wake lock is not supported by this browser.'; } requesting a wake lock the following example demonstrates how to request a wakelocksentinel object. the wakelock.request method is promise based and so we can create an asynchronous function, which in turn updates the ui to reflect the wake lock is active. // create a reference for the wake lock let wakelock = null; // create an async function to request a wake lock const requestwakelock = async () => { try { wakelock = await navigator.wakelock.request('screen'); // change up our interface to reflect wake lock active statuselem.textcontent = 'wake lock is active!'; } catch (err) { ...
... = 'wake lock is active!'; } catch (err) { // if wake lock request fails - usually system related, such as battery statuselem.textcontent = `${err.name}, ${err.message}`; } } releasing wake lock the following example shows how to release the previously acquired wake lock. wakelock.release() .then(() => { wakelock = null; }); listening for wake lock release this example updates the ui if the wake lock has been released for any reason (such as navigating away from the active window/tab). wakelock.addeventlistener('release', () => { // the wake lock has been released statuselem.textcontent = 'wake lock has been released'; }); reacquiring a wake lock the following code reacquires the wake lock should the visibility of the document change and the wake lock is rele...
... of the document change and the wake lock is released. document.addeventlistener('visibilitychange', () => { if (wakelock !== null && document.visibilitystate === 'visible') { wakelock = await navigator.wakelock.request('screen'); } }); putting it all together you can find the complete code on github here. the demo uses a button to acquire a wake lock and also release it, which in turn updates the ui. the ui also updates if the wake lock is released automatically for any reason. there's a checkbox which when checked, will automatically reacquire the wake lock if the document's visibility state changes and becomes visible again. performance considerations release the screen wake lock when user ends activity that required always-on screen. for example, a ticketing app which uses qr ...
ServiceWorkerRegistration - Web APIs
g indexed content for offline viewing. unimplemented properties serviceworkerregistration.periodicsync read only returns a reference to the periodicsyncmanager interface, which manages periodic background synchronization processes. this was mentioned as an idea in the sw explainer at some point, but as yet has not been implemented anywhere. event handlers serviceworkerregistration.onupdatefound read only an eventlistener property called whenever an event of type updatefound is fired; it is fired any time the serviceworkerregistration.installing property acquires a new service worker. methods also implements methods from its parent interface, eventtarget. serviceworkerregistration.getnotifications() returns a promise that resolves to an array of notification objects. servi...
...the serviceworkerregistration.installing property acquires a new service worker. methods also implements methods from its parent interface, eventtarget. serviceworkerregistration.getnotifications() returns a promise that resolves to an array of notification objects. serviceworkerregistration.shownotification() displays the notification with the requested title. serviceworkerregistration.update() checks the server for an updated version of the service worker without consulting caches. serviceworkerregistration.unregister() unregisters the service worker registration and returns a promise. the service worker will finish any ongoing operations before it is unregistered. examples in this example, the code first checks whether the browser supports service workers and if so registers o...
... for an updated version of the service worker without consulting caches. serviceworkerregistration.unregister() unregisters the service worker registration and returns a promise. the service worker will finish any ongoing operations before it is unregistered. examples in this example, the code first checks whether the browser supports service workers and if so registers one. next, it adds an updatefound listener in which it uses the service worker registration to listen for further changes to the service worker's state. if the service worker hasn't changed since the last time it was registered, then the updatefound event will not be fired. if ('serviceworker' in navigator) { navigator.serviceworker.register('/sw.js') .then(function(registration) { registration.addeventlistener('upd...
...service worker registration to listen for further changes to the service worker's state. if the service worker hasn't changed since the last time it was registered, then the updatefound event will not be fired. if ('serviceworker' in navigator) { navigator.serviceworker.register('/sw.js') .then(function(registration) { registration.addeventlistener('updatefound', function() { // if updatefound is fired, it means that there's // a new service worker being installed. var installingworker = registration.installing; console.log('a new service worker is being installed:', installingworker); // you can listen for changes to the installing service worker's // state via installingworker.onstatechange }); }) .catch(function(error) { consol...
SourceBuffer - Web APIs
pplied to timestamps inside media segments that are subsequently appended to the sourcebuffer. sourcebuffer.trackdefaults specifies the default values to use if kind, label, and/or language information is not available in the initialization segment of the media to be appended to the sourcebuffer. sourcebuffer.updating read only a boolean indicating whether the sourcebuffer is currently being updated — i.e. whether an sourcebuffer.appendbuffer(), sourcebuffer.appendstream(), or sourcebuffer.remove() operation is currently in progress. sourcebuffer.videotracks read only a list of the video tracks currently contained inside the sourcebuffer. event handlers sourcebuffer.onabort fired whenever sourcebuffer.appendbuffer() or sourcebuffer.appendstream() is ended by a call to sourcebuffe...
...r. event handlers sourcebuffer.onabort fired whenever sourcebuffer.appendbuffer() or sourcebuffer.appendstream() is ended by a call to sourcebuffer.abort(). sourcebuffer.updating changes from true to false. sourcebuffer.onerror fired whenever an error occurs during sourcebuffer.appendbuffer() or sourcebuffer.appendstream(). sourcebuffer.updating changes from true to false. ...
...pdating changes from true to false. sourcebuffer.onerror fired whenever an error occurs during sourcebuffer.appendbuffer() or sourcebuffer.appendstream(). sourcebuffer.updating changes from true to false. sourcebuffer.onupdate fired whenever sourcebuffer.appendbuffer() method or the sourcebuffer.remove() completes. sourcebuffer.updating changes from true to false. this event is fired before onupdateend. sourcebuffer.onupdateend fired whenever sourcebuffer.appendbuffer() method or the sourcebuffer.remove() has ended. this event is fired after onupdate. sourcebuffer.onupdatestart fired whenever the value of sourcebuffer.updating transitions from false to true. methods inherits methods from its parent interface, eventtarget. sourcebuffer.abort() aborts the current segment and resets ...
...rc = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); video.play(); //console.log(mediasource.readystate); // ended }); sourcebuffer.appendbuffer(buf); }); } function fetchab (url, cb) { console.log(url); var xhr = new xmlhttprequest; xhr.open('get', url); xhr.responsetype = 'arraybuffer'; xhr.onload = function () { cb(xhr.response); }; xhr.send(); } speci...
Multi-touch interaction - Web APIs
irst touchstart event will have // targettouches length of one, the second event will have a length // of two, and so on. ev.preventdefault(); // cache the touch points for later processing of 2-touch pinch/zoom if (ev.targettouches.length == 2) { for (var i=0; i < ev.targettouches.length; i++) { tpcache.push(ev.targettouches[i]); } } if (logevents) log("touchstart", ev, true); update_background(ev); } touch move handler the touchmove handler calls preventdefault() for the same reason mentioned above, and invokes the pinch/zoom handler. function move_handler(ev) { // note: if the user makes more than one "simultaneous" touches, most browsers // fire at least one touchmove event and some will fire several touchmoves. // consequently, an application might want to "ignore"...
...ve event and some will fire several touchmoves. // consequently, an application might want to "ignore" some touchmoves. // // this function sets the target element's border to "dashed" to visually // indicate the target received a move event. // ev.preventdefault(); if (logevents) log("touchmove", ev, false); // to avoid too much color flashing many touchmove events are started, // don't update the background if two touch points are active if (!(ev.touches.length == 2 && ev.targettouches.length == 2)) update_background(ev); // set the target element's border to dashed to give a clear visual // indication the element received a move event. ev.target.style.border = "dashed"; // check this event for 2-touch move/pinch/zoom gesture handle_pinch_zoom(ev); } touch end handler th...
... or swipe me 3</div> <div id="target4"> tap, hold or swipe me 4</div> <!-- ui for logging/bebugging --> <button id="log" onclick="enablelog(event);">start/stop event logging</button> <button id="clearlog" onclick="clearlog(event);">clear the log</button> <p></p> <output></output> miscellaneous functions these functions support the application but aren't directly involved with the event flow. ...
...pplication but aren't directly involved with the event flow. update background color the background color of the touch areas will change as follows: no touch is white; one touch is yellow; two simultaneous touches is pink, and three or more simultaneous touches is lightblue. see touch move for information about the background color changing when a 2-finger move/pinch/zoom is detected. ...
Basic scissoring - Web APIs
stablishes a clipping region outside which drawing will not occur. clearing the drawing buffer when scissoring applies this is a simple demonstration of a rendering with scissor(). although the clear() drawing command writes the clear color (set by clearcolor()) to all pixels in the drawing buffer, scissor() defines a mask that only allows pixels inside the specified rectangular area to be updated. this is a good opportunity to talk about the difference between pixels and fragments. a pixel is a picture element (in practice, a point) on the screen, or a single element of the drawing buffer, that area in memory that holds your pixel data (such as rgba color components). a fragment refers to the pixel while it is being handled by the webgl pipeline. the reason for this distinction is that...
...e reason for this distinction is that fragment color (and other fragment values, such as depth) may be manipulated and changed several times during graphics operations before finally being written to the screen. we have already seen how fragment color changes during graphics operations, by applying color masking. ...
...the pixel value is not updated), or it may interact with the already existing pixel value (such as when doing color blending for non-opaque elements in the scene). here we see another example of the distinction between fragments and pixels. scissoring is a distinct stage in the webgl/opengl graphics pipeline (it occurs after color clearing, but before color masking). before the actual pixels are updated, fragments must go through the scissor test. if the fragments pass the scissor test, they continue down the graphics pipeline, and the corresponding pixels are updated on the screen. if they fail the test, they are immediately discarded, no further processing occurs, and pixels are not updated. because only fragments within the specified rectangular area successfully pass the scissor test, only ...
... the scissoring stage of the pipeline is disabled by default. ...
Lighting in WebGL - Web APIs
you drop out the concept of point sources and specular lighting, there are two pieces of information we'll need in order to implement our directional lighting: we need to associate a surface normal with each vertex. this is a vector that's perpendicular to the face at that vertex. we need to know the direction in which the light is traveling; this is defined by the direction vector. then we update the vertex shader to adjust the color of each vertex, taking into account the ambient lighting as well as the effect of the directional lighting given the angle at which it's striking the face. we'll see how to do that when we look at the code for the shader. building the normals for the vertices the first thing we need to do is generate the array of normals for all the vertices that comprise o...
... gl.uniformmatrix4fv( programinf...
... the shader a normal matrix, which is used to transform the normals when dealing with the current orientation of the cube in relation to the light source: const normalmatrix = mat4.create(); mat4.invert(normalmatrix, modelviewmatrix); mat4.transpose(normalmatrix, normalmatrix); ... gl.uniformmatrix4fv( programinfo.uniformlocations.normalmatrix, false, normalmatrix); update the shaders now that all the data the shaders need is available to them, we need to update the code in the shaders themselves. the vertex shader the first thing to do is update the vertex shader so it generates a shading value for each vertex based on the ambient lighting as well as the directional lighting. let's take a look at the code: const vssource = ` attribute vec4 avertexpositio...
... amount of directional lighting is computed, we can generate the lighting value by taking the ambient light and adding in the product of the directional light's color and the amount of directional lighting to provide. as a result, we now have an rgb value that will be used by the fragment shader to adjust the color of each pixel we render. ...
Signaling and video calling - Web APIs
t all to the signaling server. readying the chat server for signaling our chat server uses the websocket api to send information as json strings between each client and the server. the server supports several message types to handle tasks, such as registering new users, setting usernames, and sending public chat messages. to allow the server to support signaling and ice negotiation, we need to update the code. we'll have to allow directing messages to one specific user instead of broadcasting to all connected users, and ensure unrecognized message types are passed through and delivered, without the server needing to know what they are. this lets us send signaling messages using this same server, instead of needing a separate server. let's take a look which changes we need to make to the chat...
...t. we could have made it receive our original message object, but in this example it's more efficient this way. since the message has already been stringified, we can send it with no further processing. each entry in connectionarray is a websocket object, so we can just call its send() method directly. our original chat demo didn't support sending messages to a specific user. the next task is to update the main websocket message handler to support doing so. this involves a change near the end of the "connection" message handler: if (sendtoclients) { var msgstring = json.stringify(msg); var i; if (msg.target && msg.target !== undefined && msg.target.length !== 0) { sendtooneuser(msg.target, msgstring); } else { for (i=0; i<connectionarray.length; i++) { connectionarray[i]...
...ehind the scenes. our role is to simply send the candidates, back and forth, through the signaling server. the client application the core to any signaling process is its message handling. it's not necessary to use websockets for signaling, but it is a common solution. you should, of course, select a mechanism for exchanging signaling information that is appropriate for your application. let's update the chat client to support video calling. updating the html the html for our client needs a location for video to be presented. this requires video elements, and a button to hang up the call: <div class="flexchild" id="camera-container"> <div class="camera-box"> <video id="received_video" autoplay></video> <video id="local_video" autoplay muted></video> <button id="hangup-button"...
...r item = document.createelement("li"); item.appendchild(document.createtextnode(username)); item.addeventlistener("click", invite, false); listelem.appendchild(item); }); } after getting a reference to the <ul> which contains the list of user names into the variable listelem, we empty the list by removing each of its child elements. note: obviously, it would be more efficient to update the list by adding and removing individual users instead of rebuilding the whole list every time it changes, but this is good enough for the purposes of this example. then we iterate over the array of user names using foreach(). for each name, we create a new <li> element, then create a new text node containing the user name using createtextnode(). that text node is added as a child of the <li>...
A simple RTCDataChannel sample - Web APIs
nly called a “signalling server,” is usually used to exchange the description (which is in application/sdp form) between the two peers. handling successful peer connection as each side of the peer-to-peer connection is successfully linked up, the corresponding rtcpeerconnection's icecandidate event is fired. these handlers can do whatever's needed, but in this example, all we need to do is update the user interface: function handlelocaladdcandidatesuccess() { connectbutton.disabled = true; } function handleremoteaddcandidatesuccess() { disconnectbutton.disabled = false; } the only thing we do here is disable the "connect" button when the local peer is connected and enable the "disconnect" button when the remote peer connects. connecting the data channel once the rtcpe...
...disabled = false; connectbutton.disabled = true; } else { messageinputbox.disabled = true; sendbutton.disabled = true; connectbutton.disabled = false; disconnectbutton.disabled = true; } } } if the channel's state has changed to "open", that indicates that we have finished establishing the link between the two peers. the user interface is updated correspondingly by enabling the text input box for the message to send, focusing the input box so that the user can immediately begin to type, enabling the "send" and "disconnect" buttons, now that they're usable, and disabling the "connect" button, since it is not needed when the conneciton is open. if the state has changed to "closed", the opposite set of actions occurs: the input box and "se...
...eviously set as that button's handler is called. function disconnectpeers() { // close the rtcdatachannels if they're open. sendchannel.close(); receivechannel.close(); // close the rtcpeerconnections localconnection.close(); remoteconnection.close(); sendchannel = null; receivechannel = null; localconnection = null; remoteconnection = null; // update user interface elements connectbutton.disabled = false; disconnectbutton.disabled = true; sendbutton.disabled = true; messageinputbox.value = ""; messageinputbox.disabled = true; } this starts by closing each peer's rtcdatachannel, then, similarly, each rtcpeerconnection. then all the saved references to these objects are set to null to avoid accidental reuse, and the us...
... next steps you should try out this example and take a look at the webrtc-simple-datachannel source code, available on github. ...
Using DTMF with WebRTC - Web APIs
mf. from there, you can simply call rtcdtmfsender.insertdtmf() to enqueue dtmf signals to be sent on the track to the other peer. the rtcrtpsender will then send the tones to the other peer as packets alongside the track's audio data. each time a tone is sent, the rtcpeerconnection receives a tonechange event with a tone property specifying which tone finished playing, which is an opportunity to update interface elements, for example. when the tone buffer is empty, indicating that all the tones have been sent, a tonechange event with its tone property set to "" (an empty string) is delivered to the connection object. if you'd like to know more about how this works, read rfc 3550: rtp: a transport protocol for real-time applications and rfc 4733: rtp payload for dtmf digits, telephony tones, an...
... dtmf over). we then obtain the rtcrtpsender's dtmf property, which is an rtcdtmfsender object that can send dtmf on the connection, from the caller to the receiver. if getsenders() isn't available, we instead call rtcpeerconnection.createdtmfsender() to get the rtcdtmfsender object. although this method is obsolete, this example supports it as a fallback to let older browsers (and those not yet updated to support the current webrtc dtmf api) run the example. finally, we set the dtmf sender's ontonechange event handler so we get notified each time a dtmf tone finishes playing. you can find the log function at the bottom of the documentation. when a tone finishes playing each time a dtmf tone finishes playing, a tonechange event is delivered to callerpc. the event listener for these is imple...
...dicate when an individual tone has played and when all tones have finished playing. the event's tone property is a string indicating which tone just finished playing. if all tones have finished playing, tone is an empty string; when that's the case, rtcdtmfsender.tonebuffer is empty. in this example, we log to the screen which tone just finished playing. in a more advanced application, you might update the user interface, for example, to indicate which note is currently playing. on the other hand, if the tone buffer is empty, our example is designed to disconnect the call. this is done by stopping each stream on both the caller and the receiver by iterating over each rtcpeerconnection's track list (as returned by its gettracks() method) and calling each track's stop() method. once both the ca...
...nt.candidate is null, that indicates that there are no more candidates available, and we log that information. adding media to the receiver when the receiver begins to receive media, an event is delivered to the receiver's rtcpeerconnection, receiverpc. as explained in starting the connection process, the current webrtc specification uses the track event for this, but some browsers haven't been updated to support this yet, so we also need to handle the addstream event. the handlereceivertrackevent() and handlereceiveraddstreamevent() methods, shown below, handle these. function handlereceivertrackevent(event) { audio.srcobject = event.streams[0]; } function handlereceiveraddstreamevent(event) { audio.srcobject = event.stream; } the track event includes a streams property containing an ...
Window.devicePixelRatio - Web APIs
tx.font = '18px arial'; ctx.textalign = 'center'; ctx.textbaseline = 'middle'; var x = size / 2; var y = size / 2; var textstring = "i love mdn"; ctx.filltext(textstring, x, y); monitoring screen resolution or zoom level changes in this example, we'll set up a media query and watch it to see when the device resolution changes, so that we can check the value of devicepixelratio to handle any updates we need to. javascript the javascript code creates the media query that monitors the device resolution and checks the value of devicepixelratio any time it changes. let pixelratiobox = document.queryselector(".pixel-ratio"); let mqstring = `(resolution: ${window.devicepixelratio}dppx)`; const updatepixelratio = () => { let pr = window.devicepixelratio; let prstring = (pr * 100).tofixed(0...
...y that monitors the device resolution and checks the value of devicepixelratio any time it changes. let pixelratiobox = document.queryselector(".pixel-ratio"); let mqstring = `(resolution: ${window.devicepixelratio}dppx)`; const updatepixelratio = () => { let pr = window.devicepixelratio; let prstring = (pr * 100).tofixed(0); pixelratiobox.innertext = `${prstring}% (${pr.tofixed(2)})`; } updatepixelratio(); matchmedia(mqstring).addlistener(updatepixelratio); the string mqstring is set up to be the media query itself. ...
...string}% (${pr.tofixed(2)})`; } updatepixelratio(); matchmedia(mqstring).addlistener(updatepixelratio); the string mqstring is set up to be the media query itself. the media query, which begins as (resolution: 1dppx) (for standard displays) or (resolution: 2dppx) (for retina/hidpi displays), checks to see if the current display resolution matches a specific number of device dots per px. the updatepixelratio() function fetches the current value of devicepixelratio, then sets the innertext of the element pixelratiobox to a string which displays the ratio both as a percentage and as a raw decimal value with up to two decimal places. ...
...ution: 2dppx) (for retina/hidpi displays), checks to see if the current display resolution matches a specific number of device dots per px. the updatepixelratio() function fetches the current value of devicepixelratio, then sets the innertext of the element pixelratiobox to a string which displays the ratio both as a percentage and as a raw decimal value with up to two decimal places. then the updatepixelratio() function is called once to display the starting value, after which the media query is created using matchmedia() and addeventlistener() is called to set up updatepixelratio() as a handler for the change event. html the html creates the boxes containing the instructions and the pixel-ratio box that will display the current pixel ratio information. <div class="container"> <div clas...
Window.screenX - Web APIs
Web › API › Window › screenX
estanimationframe() to constantly redraw the circle in the same physical position on the screen, even if the window position is moved. ...
...the circle in the same physical position on the screen, even if the window position is moved. ...
... also in the code we include a snippet that...
... also in the code we include a snippet that detects whether screen...
Window.screenY - Web APIs
Web › API › Window › screenY
estanimationframe() to constantly redraw the circle in the same physical position on the screen, even if the window position is moved. ...
...the circle in the same physical position on the screen, even if the window position is moved. ...
... also in the code we include a snippet that...
... also in the code we include a snippet that detects whether screen...
XRRenderState.baseLayer - Web APIs
the read-only baselayer property of the xrrenderstate interface returns the xrwebgllayer instance that is the source of bitmap images and a description of how the image is to be rendered in the device. this property is read-only; however, you can indirectly change its value using xrsession.updaterenderstate. syntax var xrwebgllayer = xrrenderstate.baselayer; value a xrwebgllayer object which is used as the source of the world's contents when rendering each frame of the scene. ...
...ages and a description of how the image is to be rendered in the device. this property is read-only; however, you can indirectly change its value using xrsession.updaterenderstate. syntax var xrwebgllayer = xrrenderstate.baselayer; value a xrwebgllayer object which is used as the source of the world's contents when rendering each frame of the scene. see the examples below to see how to use updaterenderstate() to set the current xrwebgllayer used for rendering the scene. ...
... xrsession.updaterenderstate. syntax var xrwebgllayer = xrrenderstate.baselayer; value a xrwebgllayer object which is used as the source of the world's contents when rendering each frame of the scene. see the examples below to see how to use updaterenderstate() to set the current xrwebgllayer used for rendering the scene. ...
...ate() to set the current xrwebgllayer used for rendering the scene. examples you can set the xrwebgllayer used for rendering by calling updaterenderstate(), like this: let canvas = document.queryselector("canvas"); gl = canvas.getcontext("webgl", { xrcompatible: true }); setnewwebgllayer(); function setnewwebgllayer(gl) { if (!gl) { /* webgl not available */ return; } xrsession.updaterenderstate({ baselayer: new xrwebgllayer(xrsession, gl); }); }; here, the canvas obtained in the first line is the canvas into which webgl is going to draw. that context is passed into new xrwebgllayer() to create an xrwebgllayer which uses the contents of the webgl context gl as the source of the world's image during presentation. specifications specification status comm...
XRView.eye - Web APIs
Web › API › XRView › eye
e, if the flag is true, that view is skipped instead of being rendered. ...
....baselayer; gl.bindframebuffer(gl.framebuffer, gllayer.framebuffer); gl.clearcolor(0,0, 0, 1.0); gl.cleardepth(1.0); gl.clear(gl.color_buffer_bit, gl.depth_buffer_bit); for (let view of xrpose.views) { let skipview = false; if (view.eye == "left" && body.lefteye.injured) || skipview = updateinjury(body.lefteye); } else if (view.eye == "right" && body.righteye.injured) { skipview = updateinjury(body.righteye); } if (!skipview) { let viewport = gllayer.getviewport(view); gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); renderscene(gl, view); } } for each of the views, the value of eye is checked and if it's either left or right, we check to see if the body.lefteye.injured or body.righteye.injured property is true; if so, we call a function ...
...if the result is false, indicating that the eye is now healthy, we render the scene for that eye. otherwise, we d...
...renderscene(gl, view); } } for each of the views, the value of eye is checked and if it's either left or right, we check to see if the body.lefteye.injured or body.righteye.injured property is true; if so, we call a function updateinjury() on that eye to do things such as allow a bit of healing to occur, track the progress of a poison effect, or the like, as appropriate for the game's needs. updateinjury() returns true if the eye is still injured or false if the eye has been restored to health by the function,. if the result is false, indicating that the eye is now healthy, we render the scene for that eye. otherwise, we don't. specifications specification status comment webxr device apithe definition of 'xrview.eye' in that specification. working draft i...
Using the slider role - Accessibility
r agents and assistive technology note: opinions may differ on how assistive technology should handle this technique. the information provided above is one of those opinions and therefore not normative. examples example 1: simple numerical range in the example below, a simple slider is used to select a value between 1 and 100. the current volume is 50. ...
... the example below, a simple slider is used to select a value between 1 and 100. the current volume is 50. the application will programmatically update the value of aria-valuenow in response to user input. <label for="fader">volume</label> <input type="range" id="fader" min="1" max="100" value="50" step="1" aria-valuemin="1" aria-valuemax="100" aria-valuenow="50" oninput="outputupdate(value)"> <output for="fader" id="volume">50</output> the following code snippet allows you to return the output as it is updated by user input: function outputupdate(vol) { document.queryselector('#volume').value = vol; } example 2: text values sometimes, a slider is used to choose a value that is not, semantically, a number. in these cases, the aria-valuetext attribute is used to provide...
...mple below, the slider is used to select a day of the week. ...
...ider-handle" role="slider" aria-labelledby="day-label" aria-valuemin="1" aria-valuemax="7" aria-valuenow="2" aria-valuetext="monday"> </div> </div> the code snippet below shows a function that responds to user input and updates the aria-valuenow and aria-valuetext attributes: var daynames = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"]; var updateslider = function (newvalue) { var handle = document.getelementbyid("day-handle"); handle.setattribute("aria-valuenow", newvalue.tostring()); handle.setattribute("aria-valuetext", daynames[newvalue]); }; working examples: slider example notes aria attributes used aria-valuemin aria-valuemax aria-valuenow aria-valuetext aria-orientation related aria techniques ...
ARIA - Accessibility
pplications (especially those developed with javascript) more accessible to people with disabilities. it supplements html so that interactions and widgets commonly used in applications can be passed to assistive technologies when there is not otherwise a mechanism. for example, aria enables accessible navigation landmarks in html4, javascript widgets, form hints and error messages, live content updates, and more. many of these widgets were later incorporated into html5, and developers should prefer using the correct semantic html element over using aria, if such an element exists. for instance, native elements have built-in keyboard accessibility, roles and states. however, if you choose to use aria, you are responsible for mimicking (the equivalent) browser behaviour in script. here's th...
...operties. these are specified by adding attributes to the element. in this example, the role="progressbar" attribute informs the browser that this element is actually a javascript-powered progress bar widget. the aria-valuemin and aria-valuemax attributes specify the minimum and maximum values for the progress bar, and the aria-valuenow describes the current state of it and therefore must be kept updated with javascript. along with placing them directly in the markup, aria attributes can be added to the element and updated dynamically using javascript code like this: // find the progress bar <div> in the dom. var progressbar = document.getelementbyid("percent-loaded"); // set its aria roles and states, // so that assistive technologies know what kind of widget it is. progressbar.setattribute(...
...ind the progress bar <div> in the dom. var progressbar = document.getelementbyid("percent-loaded"); // set its aria roles and states, // so that assistive technologies know what kind of widget it is. progressbar.setattribute("role", "progressbar"); progressbar.setattribute("aria-valuemin", 0); progressbar.setattribute("aria-valuemax", 100); // create a function that can be called at any time to update // the value of the progress bar. function updateprogress(percentcomplete) { progressbar.setattribute("aria-valuenow", percentcomplete); } note that aria was invented after html4, so does not validate in html4 or its xhtml variants. however, the accessibility gains it provides far outweigh any technical invalidity. in html5, all aria attributes validate. the new landmark elements (<main>, <h...
... using aria a practical guide for developers. it suggests what aria attributes to use on html elements. suggestions are based on implementation realities. simple aria enhancements enhancing page navigation with aria landmarks a nice intro to using aria landmarks to improve web page navigation for screen reader users. see also, aria landmark implementation notes and examples on real sites (updated as of july 2011). improving form accessibility aria is not just for dynamic content! learn how to improve accessibility of html forms using additional aria attributes. aria for scripted widgets writing keyboard-navigable javascript widgets built-in elements like <input>, <button> etc have built-in keyboard accessibility. if you 'fake' these with <div>s and aria, you must ensure your widg...
Accessibility documentation index - Accessibility
a) defines ways to make the web more accessible to people with disabilities. a few guidelines to follow that ensure better accessibility, like using drag and drop for placement of the widgets. 7 aria live regions aria, accessibility, arialive using javascript, it is possible to dynamically change parts of a page without requiring the entire page to reload — for instance, to update a list of search results on the fly, or to display a discreet alert or notification which does not require user interaction. while these changes are usually visually apparent to users who can see the page, they may not be obvious to users of assistive technologies. aria live regions fill this gap and provide a way to programmatically expose dynamic content changes in a way that can be announced b...
...ns, suggestion the suggestion landmark role semantically denotes a single proposed change to an editable document. this should be used on an element that wraps an element with an insertion role, and one with a deletion role. 51 aria: alert role aria, aria role, aria alert, aria widget, reference the alert role can be used to tell the user an element has been dynamically updated. screen readers will instantly start reading out the updated content when the role is added. if the user is expected to close the alert, then the alertdialog role should be used instead. 52 aria: application role aria, aria role, aria widget, reference, role application the application role indicates to assistive technologies that an element and all of its children should be...
...tiative at the w3c. aria provides a means to make web applications and widgets more accessible to a diverse range of users, including those who use assistive technologies such as screen readers or magnifiers. 79 widgets accessibility this page was auto-generated because a user created a sub-page to this page. 80 overview accessibility, javascript, landing, needsupdate here's a look at working examples and best practices in building accessible javascript widgets. 81 accessibility faq accessibility, faq mozilla accessibility project 82 accessibility information for web authors accessibility, authoring dhtml accessibility roadmap: a peek into how dhtml will be made accessible in the future. this document gives a pla...
...soft active accessibility (msaa) server accessibility, msaa, microsoft, server this document is for developers working to support msaa in an application in order to make it accessible with 3rd party assistive technologies, as well as for hackers wishing to be involved in mozilla's msaa support specifically. 93 keyboard-navigable javascript widgets accessibility, dom, needsupdate web applications often use javascript to mimic desktop widgets such as menus, tree views, rich text fields, and tab panels. these widgets are typically composed of <div> and <span> elements that do not, by nature, offer the same keyboard functionality that their desktop counterparts do. this document describes techniques to make javascript widgets accessible with the keyboard. 94 ...
Web accessibility for seizures and physical reactions - Accessibility
reduce) { button { animation: none; } } prefers-color-scheme this can be useful if the ambient light api is not available. support is emerging. @media (prefers-color-scheme: dark) { /* adust styles for dark mode */ } window​.match​media() there is a powerful tool available to developers via window.matchmedia(). a great resource is mdn's document on window.matchmedia() media update feature the more often the screen is refreshed, the more stable it appears to the human eye, and the less it "flickers". the vast majority of modern technology refreshes at a rate that does not cause problems with photosensitivity. however, not everybody is wealthy enough to be able to afford the most recent technology: older or underpowered computers can have low refresh rates. abilitynet's fac...
...sh rates. a very old article, tech republic's epilepsy and crt/lcd screen flicker, had an interesting response concerning the refresh rates in hz. ...
...tive use the update feature which, used in combination with animation-duration or transition-duration, to conclude at a rate that is imperceptible to the human eye. in other words, eric's techniques address the refresh-rate problem. the css below is from the article, css-tricks revisiting prefers-reduced-motion, the reduced motion media query. ...
...it has the values of "none", "slow", and "fast". developmental & experimental features mdn navigator​.donottrack from the documentation: "returns the user's do-not-track setting. ...
transition-delay - CSS: Cascading Style Sheets
; -webkit-transition-property: width height background-color font-size left top color; -webkit-transition-duration:2s; -webkit-transition-delay:0.5s; -webkit-transition-timing-function: linear; transition-property: width height background-color font-size left top color; transition-duration:2s; transition-delay:0.5s; transition-timing-function: linear; } function updatetransition() { var el = document.queryselector("div.box"); if (el) { el.classname = "box1"; } else { el = document.queryselector("div.box1"); el.classname = "box"; } return el; } var intervalid = window.setinterval(updatetransition, 7000); transition-delay: 1s <div class="parent"> <div class="box">lorem</div> </div> .parent { width: 250px; height:125px;} .b...
...olute; -webkit-transition-property: width height background-color font-size left top color; -webkit-transition-duration:2s; -webkit-transition-delay:1s; -webkit-transition-timing-function: linear; transition-property: width height background-color font-size left top color; transition-duration:2s; transition-delay:1s; transition-timing-function: linear; } function updatetransition() { var el = document.queryselector("div.box"); if (el) { el.classname = "box1"; } else { el = document.queryselector("div.box1"); el.classname = "box"; } return el; } var intervalid = window.setinterval(updatetransition, 7000); transition-delay: 2s <div class="parent"> <div class="box">lorem</div> </div> .parent { width: 250px; height:125px;} .b...
...olute; -webkit-transition-property: width height background-color font-size left top color; -webkit-transition-duration:2s; -webkit-transition-delay:2s; -webkit-transition-timing-function: linear; transition-property: width height background-color font-size left top color; transition-duration:2s; transition-delay:2s; transition-timing-function: linear; } function updatetransition() { var el = document.queryselector("div.box"); if (el) { el.classname = "box1"; } else { el = document.queryselector("div.box1"); el.classname = "box"; } return el; } var intervalid = window.setinterval(updatetransition, 7000); transition-delay: 4s <div class="parent"> <div class="box">lorem</div> </div> .parent { width: 250px; height:125px;} .b...
... -webkit-transition-property: width height background-color font-size left top color; -webkit-transition-duration:2s; -webkit-transition-delay:4s; -webkit-transition-timing-function: ease-in-out; transition-property: width height background-color font-size left top color; transition-duration:2s; transition-delay:4s; transition-timing-function: ease-in-out; } function updatetransition() { var el = document.queryselector("div.box"); if (el) { el.classname = "box1"; } else { el = document.queryselector("div.box1"); el.classname = "box"; } return el; } var intervalid = window.setinterval(updatetransition, 7000); specifications specification status comment css transitionsthe definition of 'transition-delay' in ...
transition-duration - CSS: Cascading Style Sheets
ebkit-transition-property: width height background-color font-size left top transform -webkit-transform color; -webkit-transition-duration:0.5s; -webkit-transition-timing-function: ease-in-out; transition-property: width height background-color font-size left top transform -webkit-transformv color; transition-duration:0.5s; transition-timing-function: ease-in-out; } function updatetransition() { var el = document.queryselector("div.box"); if (el) { el.classname = "box1"; } else { el = document.queryselector("div.box1"); el.classname = "box"; } return el; } var intervalid = window.setinterval(updatetransition, 7000); transition-duration: 1s <div class="parent"> <div class="box">lorem</div> </div> .parent { width: 250px; height:125px;}...
... -webkit-transition-property: width height background-color font-size left top -webkit-transform transform color; -webkit-transition-duration:1s; -webkit-transition-timing-function: ease-in-out; transition-property: width height background-color font-size left top transform -webkit-transform color; transition-duration:1s; transition-timing-function: ease-in-out; } function updatetransition() { var el = document.queryselector("div.box"); if (el) { el.classname = "box1"; } else { el = document.queryselector("div.box1"); el.classname = "box"; } return el; } var intervalid = window.setinterval(updatetransition, 7000); transition-duration: 2s <div class="parent"> <div class="box">lorem</div> </div> .parent { width: 250px; height:125px;}...
... -webkit-transition-property: width height background-color font-size left top transform -webkit-transform color; -webkit-transition-duration:2s; -webkit-transition-timing-function: ease-in-out; transition-property: width height background-color font-size left top transform -webkit-transform color; transition-duration:2s; transition-timing-function: ease-in-out; } function updatetransition() { var el = document.queryselector("div.box"); if (el) { el.classname = "box1"; } else { el = document.queryselector("div.box1"); el.classname = "box"; } return el; } var intervalid = window.setinterval(updatetransition, 7000); transition-duration: 4s <div class="parent"> <div class="box">lorem</div> </div> .parent { width: 250px; height:125px;}...
... -webkit-transition-property: width height background-color font-size left top transform -webkit-transform color; -webkit-transition-duration:4s; -webkit-transition-timing-function: ease-in-out; transition-property: width height background-color font-size left top transform -webkit-transform color; transition-duration:4s; transition-timing-function: ease-in-out; } function updatetransition() { var el = document.queryselector("div.box"); if (el) { el.classname = "box1"; } else { el = document.queryselector("div.box1"); el.classname = "box"; } return el; } var intervalid = window.setinterval(updatetransition, 7000); specifications specification status comment css transitionsthe definition of 'transition-duration' ...
Getting Started - Developer guides
you started. what's ajax? ajax stands for asynchronous javascript and xml. in a nutshell, it is the use of the xmlhttprequest object to communicate with servers. it can send and receive information in various formats, including json, xml, html, and text files. ajax’s most appealing characteristic is its "asynchronous" nature, which means it can communicate with the server, exchange data, and update the page without having to refresh the page. the two major features of ajax allow you to do the following: make requests to the server without reloading the page receive and work with data from the server step 1 – how to make an http request in order to make an http request to the server with javascript, you need an instance of an object with the necessary functionality. this is where x...
...in alertcontents(), we need to replace the line alert(httprequest.responsetext); with: var xmldoc = httprequest.responsexml; var root_node = xmldoc.getelementsbytagname('root').item(0); alert(root_node.firstchild.data); this code takes the xmldocument object given by responsexml and uses dom methods to access some of the data contained in the xml document. you can see the test.xml here and the updated test script here. step 5 – working with data finally, let's send some data to the server and receive a response. our javascript will request a dynamic page this time, test.php, which will take the data we send and return a "computed" string - "hello, [user data]!" - which we'll alert(). first we'll add a text box to our html so the user can enter their name: <label>your name: <input type...
... 312.14 time: 312.15 once the text file is loaded, we split() the items into an array at each newline character (\n — basically where each line break is in the text file), and then print the complete list of timestamps, and the last timestamp, onto the page. this is repeated every 5 seconds, using a setinterval() call. the idea would be that a server-side script of some kind would continually update the text file with new timestamps, and our xhr code would be used to report the latest timestamp on the client-side. <!doctype html> <html> <head> <meta charset="utf-8"> <title>xhr log time</title> <style> </style> </head> <body> <p id="writedata" class="data">off-line</p> <p id="laststamp">no data yet</p> <script> const fulldata = document.getelementbyid...
...tml> <html> <head> <meta charset="utf-8"> <title>xhr log time</title> <style> </style> </head> <body> <p id="writedata" class="data">off-line</p> <p id="laststamp">no data yet</p> <script> const fulldata = document.getelementbyid('writedata'); const lastdata = document.getelementbyid('laststamp'); function fetchdata() { console.log('fetching updated data.'); let xhr = new xmlhttprequest(); xhr.open("get", "time-log.txt", true); xhr.onload = function() { updatedisplay(xhr.response); } xhr.send(); } function updatedisplay(text) { fulldata.textcontent = text; let timearray = text.split('\n'); // included because some file systems always include a blank line at the end of text f...
Mouse gesture events - Developer guides
e user uses three fingers to "swipe" the trackpad. mozmagnifygesturestart the mozmagnifygesturestart event is sent when the user begins performing a "pinch" gesture, by using two fingers as the corners of a rectangle and moving them either closer together or farther apart. this is typically used to zoom in and out on content (this is the default behavior in firefox, for example). mozmagnifygestureupdate the mozmagnifygestureupdate event is sent periodically while processing a magnify gesture, to provide updated status information. the event's delta value represents the amount by which the gesture has moved since the mozmagnifygesturestart or mozmagnifygestureupdate event. note: this event is sent whenever the movement of the user's fingers exceeds the number of pixels indicated by the browser.
...icated by the browser.gesture.pinch.threshold preference. mozmagnifygesture the mozmagnifygesture event is sent when the user completes a "pinch" gesture. if you only care about the end results of the pinch gesture, you can simply watch for this event; however, if you want to provide feedback during the handling of the gesture, you should also watch the mozmagnifygesturestart and mozmagnifygestureupdate events. the delta value is the cumulative change over the course of handling the entire sequence of magnify gesture events. mozrotategesturestart the mozrotategesturestart event is sent when the user begins performing a rotate gesture, by placing two fingers on the trackpad and rotating them around the center of the trackpad. firefox uses this gesture to move backward and forward through the tabs...
...ve change over the course of handling the entire sequence of magnify gesture events. mozrotategesturestart the mozrotategesturestart event is sent when the user begins performing a rotate gesture, by placing two fingers on the trackpad and rotating them around the center of the trackpad. firefox uses this gesture to move backward and forward through the tabs in the current window. mozrotategestureupdate the mozrotategestureupdate event is sent periodically while processing a rotate gesture, to provide updated status information. the event's delta value represents the amount by which the gesture has moved since the mozrotategesturestart or mozrotategestureupdate event. note: this event is sent whenever the movement of the user's fingers exceeds the number of pixels indicated by the browser.gest...
... indicated by the browser.gesture.pinch.threshold preference. mozrotategesture the mozrotategesture event is sent when the user completes a rotate gesture. if you only care about the end results of the rotate gesture, you can simply watch for this event; however, if you want to provide feedback during the handling of the gesture, you should also watch the mozrotategesturestart and mozrotategestureupdate events. the delta value is the cumulative change over the course of handling the entire sequence of rotate gesture events. event fields mouse gesture events have additional fields providing information about the gesture. these are: direction the direction in which the swipe moved. delta the amount by which the gesture moved; for rotation, this value is in degrees. positive values...
<input type="hidden"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › hidden
ncoding used to submit the form. using hidden inputs as mentioned above, hidden inputs can be used anywhere that you want to include data the user can't see or edit along with the form when it's submitted to the server. let's look at some examples that illustrate its use. ...
...s to be updated when an edit form is submitted. a typical workflow looks like this: user decides to edit some content they have control over, such as a blog post, or a product entry. they get started by pressing the edit button. the content to be edited is taken from the database and loaded into an html form to allow the user to make changes. after editing, the user submits the form, and the updated data is sent back to the server to be updated in the database. the idea here is that during step 2, the id of the record being updated is kept in a hidden input. when the form is submitted in step 3, the id is automatically sent back to the server with the record content. the id lets the site's server-side component know exactly which record needs to be updated with the submitted data. you ca...
...ke this: <form> <div> <label for="title">post title:</label> <input type="text" id="title" name="title" value="my excellent blog post"> </div> <div> <label for="content">post content:</label> <textarea id="content" name="content" cols="60" rows="5"> this is the content of my excellent blog post. ...
...no scripting is needed in the content to handle this. the output looks like this: note: you can also find the example on github (see the source code, and also see it running live). when submitted, the form data sent to the server will look something like this: title=my+excellent+blog+post&content=this+is+the+content+of+my+excellent+blog+post.+i+hope+you+enjoy+it...
HTTP caching - HTTP
Web › HTTP › Caching
field is omitted in a request. use pragma only for backwards compatibility with http/1.0 clients. freshness once a resource is stored in a cache, it could theoretically be served by the cache forever. caches have finite storage so items are periodically removed from storage. this process is called cache eviction. on the other side, some resources may change on the server so the cache should be updated. as http is a client-server protocol, servers can't contact caches and clients when a resource changes; they have to communicate an expiration time for the resource. before this expiration time, the resource is fresh; after the expiration time, the resource is stale. eviction algorithms often privilege fresh resources over stale resources. note that a stale resource is not evicted or ignored; wh...
...reshnesslifetime - currentage where responsetime is the time at which the response was received according to the browser. revved resources the more we use cached resources, the better the responsiveness and the performance of a web site will be. to optimize this, good practices recommend to set expiration times as far in the future as possible. this is possible on resources that are regularly updated, or often, but is problematic for resources that are rarely and infrequently updated. they are the resources that would benefit the most from caching resources, yet this makes them very difficult to update. this is typical of the technical resources included and linked from each web pages: javascript and css files change infrequently, but when they change you want them to be updated quickly. we...
...d. they are the resources that would benefit the most from caching resources, yet this makes them very difficult to update. this is typical of the technical resources included and linked from each web pages: javascript and css files change infrequently, but when they change you want them to be updated quickly. web developers invented a technique that steve souders called revving[1]. infrequently updated files are named in a specific way: in their url, usually in the filename, a revision (or version) number is added. that way each new revision of this resource is considered as a resource on its own that never changes and that can have an expiration time very far in the future, usually one year or even more. in order to have the new versions, all the links to them must be changed, that is the dra...
...er is present in a response, then the client can issue an if-modified-since request header to validate the cached document. when a validation request is made, the server can either ignore the validation request and response with a normal 200 ok, or it can return 304 not modified (with an empty body) to instruct the browser to use its cached copy. the latter response can also include headers that update the expiration time of the cached document. varying responses the vary http response header determines how to match future request headers to decide whether a cached response can be used rather than requesting a fresh one from the origin server. when a cache receives a request that can be satisfied by a cached response that has a vary header field, it must not use that cached response unless a...
Animation performance and frame rate - Web Performance
r frames, and to drop frames if necessary. however, the performance cost of modifying a css property can vary from one property to another. it's commonly accepted that 60 frames per second is the rate at which animations will appear smooth. for a rate of 60 frames per second, the browser has 16.7 milliseconds to execute scripts, recalculate styles and layout if needed, and repaint the area being updated. slow scripts and animating expensive css properties can result in jank as the browser struggles to hit a smooth frame rate. the rendering waterfall the process a browser uses to paint changes to a page when an element is animating css properties can be described as a waterfall consisting of the following steps: recalculate style: when a property for an element changes, the browser must r...
... out the position and geometry for the elements. this operation is labeled "layout" but is also sometimes called "reflow". paint: finally, the browser needs to repaint the elements to the screen. one last step is not shown in this sequence: the page may be split into layers, which are painted independently and then combined in a process called "composition". ...
... css property cost in the context of the rendering waterfall, some properties are more expensive than others: property type cost examples properties that affect an element's geometry or position trigger a style recalculation, a layout and a repaint. ...
...rigger a style recalculation, a layout and a repaint. left max-width border-width margin-left font-size properties that don't affect geometry or position, but are not rendered in their own layer, do not trigger a layout. color properties that are rendered in their own layer don't even trigger a repaint, because the update is handled in composition. transform opacity the css triggers website shows how much of the waterfall is triggered for each css property, with information for most css properties by browser engine. an example: margin versus transform in this section we'll see how the waterfall can highlight the difference between animating using margin and animating using transform. the i...
Example - SVG: Scalable Vector Graphics
first, each mote tries to move towards the cursor, and second each mote tries to move away from the average mote position. combined, we get this very natural looking behavior. ...
... this.vy = -max; } // mote::capposition() -- apply an upper/lower limit // on mote position. mote.prototype.capposition = function() { var dims = dimensions(); if( this.x < 0 ) this.x = 0; else if( this.x >= dims[0] ) this.x = dims[0]-1; if( this.y < 0 ) this.y = 0; else if( this.y >= dims[1] ) this.y = dims[1]-1; } // mote::move() -- move a mote, update the screen. mote.prototype.move = function() { // apply attraction to cursor. var attract = parseint( document.getelementbyid('attract_cursor').value ); var cursor = cursor(); this.applyforce(cursor, attract); // apply repulsion from average mote position. var repel = parseint( document.getelementbyid('repel_peer').value ); var average = averagemoteposition(); this.ap...
... // too few? while( motes.length < num ) motes.push( new mote() ); // or too many? if( num == 0 ) motes = []; else if( motes.length > num...
... num = 0; // make sure we have exactly that many... ...
Caching compiled WebAssembly modules - WebAssembly
stance. 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. note: the entire site's wasm cache (not just the given url) is versioned by the specified dbversion passed into the function. if the wasm module code is updated, or its url changes, you will need to update dbversion. any subsequent call to instantiatecachedurl() will then clear out the entire cache, allowing you to avoid using out-of-date modules. the function starts off by defining some necessary constants: function instantiatecachedurl(dbversion, url, importobject) { const dbname = 'wasm-cache'; const storename = 'wasm-cache'; setting up the d...
... function opendatabase() { return new promise((resolve, reject) => { var request = indexeddb.open(dbname, dbversion); request.onerror = reject.bind(null, 'error opening wasm cache database'); request.onsuccess = () => { resolve(request.result) }; request.onupgradeneeded = event => { var db = request.result...
... the url of the wasm module you want to instantiate. an import object, if required. const wasmcacheversion = 1; instantiatecachedurl(wasmcacheversion, 'test.wasm').then(instance => console.log("instance says the answer is: " + instance.exports.answer()) ).catch(err => console.error("failure to instantiate: " + err) ); you can f...
...h(url)).then(results => { return results.instance }); }); } caching a wasm module with the above library function defined, getting a wasm module instance and using its exported features (while handling caching in the background) is as simple as calling it with the following parameters: a cache version, which — as we explained above — you need to update when any wasm module is updated or moved to a different url. the url of the wasm module you want to instantiate. an import object, if required. const wasmcacheversion = 1; instantiatecachedurl(wasmcacheversion, 'test.wasm').then(instance => console.log("instance says the answer is: " + instance.exports.answer()) ).catch(err => console.error("failure to instantiate: " + err) ); you can find the source code for this ex...
panel - Archive of obsolete content
this is usually the best approach. embedding an iframe in the panel, and changing its document setting the panel's contenturl property. however, doing this will cause any content scripts to be unloaded and then reloaded, so it may be less efficient, and you'll lose any state associated wi...
...this is usually the best approach. ...
... currently shown or not. this property is read-only. height the height of the panel in pixels. width the width of the panel in pixels. focus whether or not focus will be taken away when the panel is shown. this property is read-only. contenturl the url of content loaded into the panel. this can point to local content loaded from your add-on's "data" directory or remote content. setting it updates the panel's content immediately. allow an object describing permissions for the content. it contains a single key named script whose value is a boolean that indicates whether or not to execute script in the content. contentscriptfile a local file url or an array of local file urls of content scripts to load. content scripts specified by this property are loaded before those specified by the ...
Displaying annotations - Archive of obsolete content
ion assigned to onattach is called. this function: initializes the content script instance with the current set of annotations provides a handler for messages from that content script, handling the three messages - show, hide and detach - that the content script might send adds the worker to an array, so we it can send messages back later. ...
...vides a handler for messages from that content script, handling the three messages - show, hide and detach - that the content script might send adds the worker to an array, so we it can send messages back later. then in the module's scope implement a function to update the matcher's workers, and edit handlenewannotation to call this new function when the user enters a new annotation: function updatematchers() { matchers.foreach(function (matcher) { matcher.postmessage(simplestorage.storage.annotations); }); } function handlenewannotation(annotationtext, anchor) { var newannotation = new annotation(annotationtext, anchor); simplestorage.storage.annotations.push(newannotation); updatematchers(); } annotation panel the annotation panel just shows the content of an annotation. ...
...align:left; } </style> </head> <body> <div id="annotation"> </div> </body> </html> save this in data/annotation as annotation.html. annotation panel content script the annotation panel has a minimal content script that sets the text: self.on('message', function(message) { $('#annotation').text(message); }); save this in data/annotation as annotation.js. updating main.js finally, update main.js with the code to construct the annotation panel: var annotation = panels.panel({ width: 200, height: 180, contenturl: data.url('annotation/annotation.html'), contentscriptfile: [data.url('jquery-1.4.2.min.js'), data.url('annotation/annotation.js')], onshow: function() { this.postmessage(this.content); } }); execute cfx run one last time. activate th...
Bookmarks - Archive of obsolete content
renced by the id newbkmkid. the item uri similarly, you can obtain the uri corresponding to a given bookmark item by calling the nsinavbookmarksservice.getbookmarkuri() method. var thisuri = bmsvc.getbookmarkuri(newbkmkid); assuming you've run all the code samples previous to this one, this will output "http://google.com". you can use the nsinavbookmarksservice.changebookmarkuri() method to update the uri for a given bookmark item: var uri = ios.newuri("http://mozilla.com/", null, null); bmsvc.changebookmarkuri(newbkmkid, uri); this example changes the bookmark to refer to the mozilla web site instead of google. note: all annotations, tags, and so forth are kept when the bookmark's uri is changed. checking to see if a uri is bookmarked if you want to see if a given uri is already...
... set up an observer to listen for changes related to bookmarks, you will need to create an nsinavbookmarkobserver object and use the nsinavbookmarksservice.addobserver() and nsinavbookmarksservice.removeobserver() methods. note that this example takes advantage of xpcomutils to generate the nsisupports.queryinterface() method. ...
...hanges related to bookmarks, you will need to create an nsinavbookmarkobserver object and use the nsinavbookmarksservice.addobserver() and nsinavbookmarksservice.removeobserver() methods. note that this example takes advantage of xpcomutils to generate the nsisupports.queryinterface() method. ...
JavaScript Daemons Management - Archive of obsolete content
oing backwards or not). note: the stop() method is not part of the base system. daemon instances methods mydaemon.isatend() returns a boolean expressing whether the daemon is at the start/end position or not. mydaemon.synchronize() synchronizes the timer of a started daemon with the time of invocation of mydaemon.synchronize(). if the rate property has been changed, the daemon will be updated with the new rate value. mydaemon.pause() pauses the daemon. mydaemon.start([backwards]) starts the daemon forwards (index of each invocation increasing) or backwards (index decreasing). mydaemon.stop() stops the daemon. all original properties will be restored. if it exists a stop listener will be called with three arguments: index (the iterative index of each invocation), length (the num...
...chronously or not. if the reversals argument is specified, the mydaemon.reversals property will be setted on it. if the backwards argument is specified, the daemon will move forwards (false) or backwards (true). if it is not specified the daemon will start in the same direction in which it has been left. ...
... mydaemon.forceposition(index) sets the internal index property equal to the index argument without any kind of control about the range. mydaemon.getduration() returns the duration of the daemon in milliseconds. mydaemon.getposition() returns the internal index property. ...
Deploying a Plugin as an Extension - Archive of obsolete content
historically, most people have chosen to use an install.js script to install a plugin. ...
...historically, most people have chosen to use an install.js script to install a plugin. ...
...fox, the extension manager will include an entry for the rhapsody player engine. because it is an extension, we can disable/enable it, as well as uninstall it. you'll notice that one thing we did not do is provide a mechanism for updating the plugin, as discussed at the beginning of this article. let's cover that now. one of the additional things that can be placed in the install.rdf is called an updateurl. for example: <em:updateurl><http://www.rhapsody.com/update.rdf></em:updateurl> this url specifies an rdf file that can be used to tell firefox that there are updates available for your extension. this rdf file can be updated to indicate that an update to our extension/plugin is available. finally, if you want to package plugins for multiple platforms into a single extension, you can do that ...
Multiple item extension packaging - Archive of obsolete content
as <em:type nc:parsetype="integer">32</em:type>. the xml namespace xmlns:nc="http://home.netscape.com/nc-rdf#" must also be declared in your install.rdf as shown below. ... <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:nc="http://home.netscape.com/nc-rdf#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <description about="urn:mozilla:install-manifest"> <!-- nsiupdateitem type for a multiple item package --> <em:type nc:parsetype="integer">32</em:type> ... for the firefox and thunderbird 2.0 extension manager you can use the above syntax or <em:type>32</em:type> as shown below. ... <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <description about="urn:mozilla:install-manifest"> <!-- ns...
...tem type for a multiple item package --> <em:type nc:parsetype="integer">32</em:type> ... for the firefox and thunderbird 2.0 extension manager you can use the above syntax or <em:type>32</em:type> as shown below. ... <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <description about="urn:mozilla:install-manifest"> <!-- nsiupdateitem type for a multiple item package --> <em:type>32</em:type> ... when specifying em:targetapplication the minversion specified should be the highest minversion and the maxversion specified should be the lowest maxversion from all of the installable bundles contained by the multiple item package for the em:targetapplication. if this is not done, any items that are not compatible will not be...
...type>32</em:type> ... when specifying em:targetapplication the minversion specified should be the highest minversion and the maxversion specified should be the lowest maxversion from all of the installable bundles contained by the multiple item package for the em:targetapplication. if this is not done, any items that are not compatible will not be installed unless a compatibility check discovers updated compatibility information. installation installation can be performed using any of the existing methods used for installing extensions / themes. the same user interface is used for installing a multiple item package (i.e. the individual packages contained in the multiple item package will not be listed). this also allows displaying of signing information for the multiple item package. if a ma...
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
ogram at the spot where you inserted the breakpoint with venkman, and start the debugger. the local variables screen should always display variables and objects during step-by-step execution. with functions that include a lot of variables, this will be hard to read, so you can point out specific variables that you want to watch (figure 4). watched variables appear under the watches tab, and are updated every time they are evaluated. you can then continue with stepwise execution and watch the changes in the program and variables. once you’ve finished your inspection, you can continue and let the halted program resume execution. the author has done almost no work developing extensions, but has used this to investigate how extensions were implemented. in the quicknote example, we first set o...
... b = this.pop(); this.push(func(a, b)); }, plus: function() { return this._letfunc(this._plus); }, _plus: function(a, b) { return a + b; }, pop: function() { return this.stack.pop(); } } check for errors now you’re ready for your first test. when you run it, you should see a red bar, showing that it failed. implement in calc.js we need to flesh out calc.js. update it with the contents of listing 3. run test run the test again. you should see a green bar showing that the test succeeded. implement the subtraction operation now let’s add subtraction. create test case first, add the test case for the subtraction method. open test_calc.js and update it with the method in listing 4. implement in calc.js next we need to add the executable code. this wil...
... run test run the test again. you should see a green bar showing that the test succeeded. implement the subtraction operation now let’s add subtraction. create test case first, add the test case for the subtraction method. open test_calc.js and update it with the method in listing 4. implement in calc.js next we need to add the executable code. this will work much as it did for addition. update calc.js with the method in listing 5. run test if we run the test at this point, we’ll get a red bar. what’s the matter? the screen will display “expected -1, got 1”. somehow, using pop() got the order of the arguments mixed up. so let’s update the _letfunc function as shown in listing 6. if we run the test again, we should get a green bar, showing that it ran correctly. benefits of...
Tabbed browser - Archive of obsolete content
bbrowser/> elements, use dom inspector or look in browser.xml for corresponding xbl bindings (or just look at the current reference pages on browser and tabbrowser. getting the browser that fires the http-on-modify-request notification see the observer notifications page for information on http-on-* notifications. ...
...rowser. getting the browser that fires the http-on-modify-request notification see the observer notifications page for information on http-on-* notifications. note that some http requests aren't associated with a tab; for example, rss feed updates, extension manager requests, xhr requests from xpcom components, etc. in those cases, the following code returns null. warning: this code should be updated to use nsiloadcontext instead of getinterface(components.interfaces.nsidomwindow). updated example is in section below this observe: function (subject, topic, data) { if (topic == "http-on-modify-request") { subject.queryinterface(components.interfaces.nsihttpchannel); var url = subject.uri.spec; /* url being requested. you might want this for something else */ var browser = this.
...the previous section was left intact so people can see the old way of doing things. components.utils.import('resource://gre/modules/services.jsm'); services.obs.addobserver(httpobs, 'http-on-modify-request', false); //services.obs.removeobserver(httpobs, 'http-on-modify-request'); //uncomment this line, or run this line when yo...
Promises - Archive of obsolete content
e; // use the response to construct form data object for the // second request. let form = new formdata; form.append("id", data.id); form.append("content", data.content); // make the second request. resp = yield new promise((resolve, reject) => { let xhr = new xmlhttprequest; xhr.onload = resolve; xhr.onerror = reject; xhr.open("post", updateurl); xhr.send(form); }); // use the response of the second request. notifyuser(resp.target.responsetext); }); example using promise-based helper the following example relies on the helper function defined below. task.spawn(function* () { // make the initial request. let xhr = yield request(dataurl, { responsetype: "json" }); let data = xhr.response; // us...
... task.spawn(function* () { // make the initial request. let xhr = yield request(dataurl, { responsetype: "json" }); let data = xhr.response; // use the response to construct form data object for the // second request. let form = new formdata; form.append("id", data.id); form.append("content", data.content); // make the second request. xhr = yield request(updateurl, { data: form }); // use the response of the second request. notifyuser(xhr.responsetext); }); downloading remote files nearly all previous methods of downloading remote files have been superseded by the much simpler downloads.jsm module. the downloads object provides a promise-based api for downloading remote files, with full support for progress tracking, pause and resume, and, op...
... yield db.executecached( "insert into nodes (id, owner, key, value) \ values (:id, :owner, :key, :value);", { params: { id: node.id, owner: node.owner.id, key: node.key, value: node.value }}); }); // perform a bulk update. yield db.execute( "update owners, nodes \ set owners.name = nodes.name \ where owners.id = nodes.owner and nodes.key = 'name';"); // process some results. yield db.execute( "select owners.group as group, nodes.value as task \ from nodes \ inner join owners on owner.id = nodes.owner \ ...
downloading - Archive of obsolete content
read only. ...
...read only. ...
... property type description target eventtarget (dom element) the event target (the topmost target in the dom tree). read only. type string the type of event. read only. canbubble boolean does the event normally bubble? read only. cancelable boolean is it possible to cancel the event? read only. related events checking noupdate progress cached updateready obsolete error ...
Index of archived content - Archive of obsolete content
an extension developing add-ons displaying web content in an extension without security issues downloading json and javascript in extensions enhanced extension installation extension etiquette extension library extension packaging extension samples extension theming guidelines extension versioning, update and compatibility extensions support in seamonkey 2 firefox addons developer guide hiding browser chrome hotfix extension how to convert an overlay extension to restartless inline options install manifests installing extensions and themes from web pages interaction between privileged and non-privileged pages...
... install script template xpinstall api reference examples file.macalias file.windowsshortcut install.adddirectory install.addfile installtrigger.installchrome installtrigger.startsoftwareupdate trigger scripts and install scripts windows install file object methods install object methods properties ...
...df engine extending gecko with xbl and xtf mozilla e4x rich web svg and canvas in mozilla xul - mozilla's xml user interface language xtech 2006 presentations xul explorer xulrunner application update article building xulrunner building xulrunner with python commandline components creating xulrunner apps with the mozilla build system creating a windows inno setup installer for xulrunner applications custom app bundles for mac os x debugging a xulrunner application deploying x...
List of Former Mozilla-Based Applications - Archive of obsolete content
eveloped name description additional information aphrodite browser inactive aol client for mac internet software no longer available beonex communicator internet software last news item on site from 2004 chameleon theme builder inactive civil netizen p2p file delivery (email attachment replacement) site not updated since 2006 compuserve client internet software no longer available doczilla sgml/xml/html browser last release on site from july 2005 fabula language learning application inactive galeon browser last news item on site from september 2006 gencatrss rss reader domain switched over to domain parking service ghostzil...
...old article available about how borland embedded mozilla in kylix 2 mango im client last news item on site from january 2007 mobidvd dvd/vcd/cd ripping software site down mozilla suite internet application suite development shifted to fi...
...the authoring part of this app was xulrunner based. other places to find former mozilla-based applications: archived mozilla hall of fame page siftery ...
List of Mozilla-Based Applications - Archive of obsolete content
a list of former mozilla-based applications is also available. ...
...framework designed for elderly people with dementia but other applications mac os x operating system makes use of some mpl files such as libsecurity_asn1 maemo browser browser for maemo internet tablet development name is microb magooclient business process management tool uses mozilla rhino mantra security tool mccoy secure update tool for add-ons xulrunner application mediacoder media converter transcoder for video, audio, and even devices such as zen, zune, pocketpcs, ipods, and psps mekhala browser part of the khmeros linux distro midbrowser mobile web browser mockery mockup creation tool built on xulrunner mongodb database project uses spide...
...l daim image tool xul explorer development tool xulrunner application xuljet javascript framework uses xulrunner xulmine game standalone version yahoo! ...
Localizing an extension - Archive of obsolete content
ch is used as the title of the preference window. the stockwatcher2.dtd file contains the mappings for the stockwatcher2.xul file: <!entity panel_loading "loading..."> <!entity menu_refresh_now.label "refresh now"> <!entity menu_apple.label "apple (aapl)"> <!entity menu_google.label "google (goog)"> <!entity menu_microsoft.label "microsoft (msft)"> <!entity menu_yahoo.label "yahoo (yhoo)"> update the xul files each xul file needs to reference its corresponding locale file. we also need to update the code to use the entities instead of the strings, so that the substitutions take place based on the currently active locale. to add a reference to the correct locale file for a given xul file, we need to add one line to the xul file. to options.xul, we add this line: <!doctype window system "c...
...rovide in your chrome manifest. then we simply replace each text string in our xul files with the corresponding entity. for example, in stockwatcher2.xul, we change this line: <menuitem label="refresh now" oncommand="stockwatcher.refreshinformation()"/> to <menuitem label="&menu_refresh_now.label;" oncommand="stockwatcher.refreshinformation()"/> do this for every string used in each xul file. update the chrome manifest to let firefox know about the locale files, we need to make a revision to our chrome.manifest file, adding one line for each localization: locale stockwatcher2 en-us chrome/locale/ this instructs firefox that the en-us localization is located in the chrome/locale/en-us directory. localizing strings in javascript code if your javascript code contains literal strings that need...
...hrome://stockwatcher2/locale/stockwatcher2.properties"/> </stringbundleset> this establishes a new string bundle, referenced by the id "string-bundle", whose keys and values are to be loaded from the stockwatcher2.properties file we've already created. note: you should use a unique id for each string bundle element for each file you use to avoid conflicts. (e.g. id="myextensionname-filename") update the javascript code now we're ready to revise the javascript code to load the strings from the string bundle instead of using literal strings. this involves rewriting the refreshinformation() function to load the strings, and its enclosed inforeceived() function to use the loaded, localized, strings instead of string literals. we add to refreshinformation() the following code: var stringsbundle ...
Block and Line Layout Cheat Sheet - Archive of obsolete content
objects this section presents some of the classes involved in block and line reflow, along with important members of each object that control reflow processing. ...
...r holds current frame in the reflow chain. nslinelayout encapsulates the transient reflow state for a nslinebox that contains inline frames. a new nslinelayout object is created for each inline linebox that is flowed. mflags ll_endsinwhitespace set to true by default when starting line layout. ...
... also be directly manipulated if a line is split, or if frames are pushed from one line to the next. mframe the perframedata of the inline frame that "owns" the span, or null if this is the root span. mframe is initialized to the containing inline frame's perframedata when a new perspandata is pushed in nslinelayout::beginspan. original document information author(s): chris waterson last updated date: december 4, 2004 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Building Firefox with Rust code - Archive of obsolete content
ough guide for people using rust in firefox. see also the documentation on this topic on the oxidation wiki page. adding rust code we generally target stable rust, but sometimes issues temporarily require a beta or custom toolchain build. our goal is to always ship a firefox release build with a stable rust toolchain release. if you don't have rust already, use the rustup tool to install it and update as new releases become available, or use the ./mach bootstrap command. the build system will generate a special 'rust unified library' crate, compiled to a static library (libgkrust.a) which is in turn linked into xul, so all public symbols will be available to c++ code. if you have new rust libraries that code in libxul calls directly, then you should add the appropriate extern crate lines in ...
...rate depends on any other crates, their sources must also be checked into the tree, and e10s's cargo.toml must have path attributes for each of its dependencies, and so on. this is automated by the mach vendor command, which installs the dependencies in third_party/rust. be sure the licenses of all dependent crates are compatible. cargo.lock files have also been checked in, so you will need to update those as well when appropriate. crates for unit tests can be added in a similar fashion to the files in toolkit/library/gtest/rust/. if your crate has optional features that aren't normally turned on, you are strongly encouraged to remove dependencies for those features when importing code so the build system doesn't require that (unused) code to live in-tree. the build system will check...
...bxul. if this turns out to be a serious problem in practice, we can look into ways of relaxing that check. if you need to locally patch a third-party crate, you'll need to add a [replace] section to the referencing cargo.toml to declare that the vendored source shouldn't match the upstream release. this works even if you use the existing vendored source location, but be aware that other vendor updates could clobber your patch in that case. testing rust code there's a simple linkage unit test in the tree. you can use it to check that rust is enabled and working with your build setup. ./mach gtest rust.* look for the rust.callfromcpp test to pass, along with any others. ...
Layout System Overview - Archive of obsolete content
rmatting, or reflow. the presentation shell owns and maintains a reflow queue where requests for reflow are held until it is time to perform a reflow, and then pulled out and executed. it is also important to see the presentation shell as an observer of many kinds of events in the system. for example, the presentation shell receives notifications of document load events, which are used to trigger updates to the formatting of the frames in some cases. the presentation shell also receives notifications about changes in cursor and focus states, whereby the selection and caret updates can be made visible. there are dozens of other data objects managed by the presentation shell and presentation context, all necessary for the internal implementation. these data members and their roles will be discusse...
...gnated as the primary frame for a piece of content. when a frame is created for a piece of content, it may be the 'primary frame' for that content element (content elements that require multiple frames have primary and secondary frames; only the primary frame is mapped). the frame manager is then instructed to store the mapping from a content element to the primary frame. this mapping facilitates updates to frames that result in changes to content (see discussion above). another important mapping maintained by the frame manager is that of the undisplayed content. when a content element is defined as having no display (via the css property 'display:none') it is noted by a special entry in the undisplayed map. this is important because no frame is generated for these elements yet changes to their ...
.... ...
Microsummary topics - Archive of obsolete content
onent. see generating a uuid in the nsiuuidgenerator documentation. you may also use another form appropriate to your extension. note: when web sites install generators via window.sidebar.addmicrosummarygenerator(), firefox sets their uri attribute to urn:source:sourceurl, where sourceurl is the url from which the generator was downloaded. ...
...it does not generally download related content like embedded images and javascript scripts referenced by the page. ...
...m those initiated automatically by firefox for the purpose of summarizing that page, check for the presence and value of the x-moz request header. if the x-moz header is present, and its value is microsummary, then the request is a microsummary-related request. otherwise, it is a user-initiated request. controlling the frequency of microsummary requests when firefox downloads content in order to update a microsummary, it honors cache-related http response headers. thus, if you would like to control how frequently firefox initiates microsummary-related requests to your web server, you can do so by including an http expires or cache-control header in your response to a microsummary-related request. for example, you might include the following header in your response to prevent firefox from making...
Modularization techniques - Archive of obsolete content
introduction the purpose of this document is provide all the information you need to create a new mozilla module or break existing code into a module. the mechanism we're using is based on the principles laid down by com, so pretty much anything you know about com can be applied here, and any reference on com can provide you with more interesting and complex examples than the ones provided here. the basics interfaces the basic building blocks of modules are c++ pure virtual interfaces. ...
..., 0xae3c, 0x11d1, {0xb6, 0x6c, 0x00, 0x80, 0x5f, 0x8a, 0x26, 0x76}}; why the b66c couplet gets broken up and grouped with the last set of bytes is probably a footnote somewhere. on windows you can use the programs uuidgen and guidgen, which ship with visual c++, to generate ids. a simple example it is recommended that you use xpidl to define your interfaces. this sample code should be updated to reflect this, but it gives you a good basic understanding of com from the c++ perspective. file nsisample.h nsisample.h defines an extremely simple interface and its interface id (iid). the important things to notice are that the interface inherits from nsisupports, and all member functions are pure virtual methods. #include "nsisupports.h" // {57ecad90-ae1a-11d1-b66c-00805f8a2676} #defi...
...ns we are not going to be doing that. in house equivalents to the important elements of this technology will be developed as needed. ...
Mozilla Application Framework in Detail - Archive of obsolete content
nstallation 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. xpinstall makes it easy to write both simple installation scripts and complex installations that check versions, log installation data to the local system, execute other installers, and update the appropriate registry settings. it is often used to install mozilla-based applications and browser add-ons, but can just as easily be used to create installations for third party software that use the browser as a delivery device on any platform. mozdev is just one place where this cross-platform installation technology is used to provide a simple installation and registration facilities for m...
...or third party software that use the browser as a delivery device on any platform. mozdev is just one place where this cross-platform installation technology is used to provide a simple installation and registration facilities for mozilla application developers. the mozblog application hosted at mozdev.org, for example, uses xpinstall to make several different versions available simultaneously as updates are made and the browser itself advances versions. the xpinstall api makes the following functionality available as high-level javascript objects: an install trigger that initiates installations windows registry access mozilla registration interfaces for registering new mozilla software facilities for detecting and maintaining application versions high-level objects for manipulating local ...
...nd s/mime support; an sql support that provides the ability to set up data sources, query a database, and retrieve results as javascript objects or rdf data sources; and an api for directory services via the lightweight directory access protocol (ldap). original document information author(s): myk melez, ian oeschger original document: http://www.mozilla.org/why/framework-details.html last updated date: february 15, 2006 copyright information: copyright (c) myk melez, ian oeschger ...
Mozilla Crypto FAQ - Archive of obsolete content
ssl, s/mime, and related features based on cryptographic technology. note that this document is for your information only and is not intended as legal advice. if you wish to develop and distribute cryptographic software, particularly for commercial sale or distribution, then you should consult an attorney with expertise in the particular laws and regulations that apply in your jurisdiction. i've updated this version of the mozilla crypto faq to discuss the situation now that the rsa public key algorithm is in the public domain and a full open source crypto implementation is being added to the mozilla code base. information in the faq also reflects the new u.s. encryption export regulations published on january 14, 2000, the release on february 11, 2000, of source code for ssl, s/mime, and gener...
...ss and psm will be included in the mozilla binary releases distributed by mozilla.org. for more information on the rsa patent see the rsa security press release announcing release of the patent into the public domain, and the rsa patent itself. for information on new us encryption export regulations, see the u.s. department of commerce press release announcing the new regulations as well as the updated regulations (pdf) themselves. export of source code for open source software is addressed in part 740 (pdf), section 740.13(e), "unrestricted encryption source code"; export of binaries is addressed in 740.17. (you may also be interested in a more in-depth analysis of the new regulations, with an emphasis on how they affect open source software.) for more information on the ssl, s/mime, pki, a...
...commerce, by stewart baker and paul hurst. an in-depth (but badly outdated) discussion of the legal framework for regulation of cryptography in various countries around the world, including the u.s. see the epic bookstore for more recommendations of books discussing privacy in general and public policies related to privacy issues. original document information author(s): frank hecker last updated date: september 10, 2000 (version 2.11) copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
The life of an HTML HTTP request - Archive of obsolete content
(1) the loading of the url is started in nswebshell::doloadurl (called from some loadurl or loaduri variant in the webshell). the webshell then tells its documentloader to load (command "view") the specified url. [note: passes nswebshell.mobserver as nsistreamobserver and the webshell as nsicontentviewercontainer to the docloader.] (2) the document loader calls ns_openuri with the url to begin transfering the requested file. ...
... in places like nshtmlcontentsink::willinterrupt() and nshtmlcontentsink::didbuildmodel(). willinterrup is called by the parser between every 8kb block of data (unless the parser is temporarily blocked). (7) since the presentation shell (nspresshell) has registred as an documentobserver with the nsidocument it also gets notified of changes in the document/content tree. this is used to create and update the nsiframe hierarchy. this is done by the nscssframeconstructor, which creates frames for each content node according to the rules specified in the user agent stylesheet (ua.css) and the document specific style sheets. each content node corresponds to one or more nsiframe, except content with displaytype "none". if there are several frames created from a content node, then the first of these ar...
...::paint() method of all frames. these get passed references to the presentation context and a rendering context to do the drawing on. the rendering context implementation is a native class (nsgtkrenderingcontext on unix) that knows how to draw in a window. todo: views, viewmanager, eventstatemanager? diagram created with dia. original document information author(s): alexander larsson last updated date: october 8, 1999 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Learn XPI Installer Scripting by Example - Archive of obsolete content
quite similar, and you can easily take what you learn here and apply it to installations on any platform that mozilla supports. about browser.xpi browser.xpi is the xpi archive in which the main components of the mozilla browser are archived for installation. mozilla cross-platform installations use the xpi format as a way to organize, compress, and automate software installations and software updates. a xpi is a pkzip-compressed archive (like zip and jar files) with a special script at the highest level that manages the installation. that installer script , usually named install.js, is the subject of this article. first, a quick scan of the contents of the xpi file (which you can open using with any unzip utility) reveals the following high-level directory structure: install.js bin\ chro...
...e two files in a xpi (which, as described above, is simply a zip file with an install.js script at the top and a suffix of '.xpi'), the next step is to add an installation script to the xpi. minimally, the installation script must: call initinstall with the name and version of the executable (the version is not optional, though you may or may not use the version in subsequent installations or updates) find somewhere to put the installed files. in the example below, getfolder is used with the "program" keyword to specify the browser's program directory as the target for installation. since i am using ns6 right now on a windows machine, that target directory is "c:\program files\netscape\netscape 6\". add files to the initialized installation using addfile. call performinstall to execute th...
...y-hosted xpi (called here 'cdrip.xpi') and trigger its installation: function putit() { xpi={'cd_ripper':'cdrip.xpi'}; installtrigger.install(xpi); } ... <a href="#" onclick="putit();">install the cd ripper now!</a> see the installtrigger object in the xpinstall api reference for more information on triggering installations. original document information author(s): ian oeschger last updated date: 01/26/2006 copyright information: copyright (c) ian oeschger ...
events - Archive of obsolete content
focus: occurs when the focused element changes. select: occurs when the selected text changed. ...
... focus: occurs when the focused element changes. select: occurs when the selected text changed. ...
... focus: occurs when the focused element changes. select: occurs when the selected text changed. ...
RDF Modifications - Archive of obsolete content
« previousnext » one of the most useful aspects of using templates with rdf datasources is that when the rdf datasource changes, for instance a new triple is added, or a triple is removed, the template updates accordingly, adding or removing result output as needed. no extra code needs to be written to do this; it happens automatically. this involves a third type of observer involved in a template builder, an nsirdfobserver, used to listen for modifications to the rdf datasource. naturally, this only applies to rdf queries. when the datasource is modified, the datasource will notify any observers of the change. the template builder uses these notifcations to update the template as necessary based on the new or removed information. you don't need to implement this observer yours...
...not exist yet, it will be added. any triples that don't exist in the new data but were there before are removed. this means that the observer will be called only for the triples that differ between the new and old version of the data. if the reloaded datasource hasn't changed, the builder won't receive any notifications. this saves a lot of extra work. the rdf observer also has two methods onbeginupdatebatch and onendupdatebatch. these are called when performing a lot of operations on a datasource. when changing the datasource, the changes are surrounded by begin and end batch calls. then, rather than notify on every change, the datasource will send one notification when the changes are finished. the template builder then rebuilds the template completely when done. this is useful when making a l...
...ables. in this case, there are no other statements, so the builder accepts this result as a new match. since all the variables have been filled in, the action body can be processed and a new block of content generated and inserted into the output. we'll find out how the builder determines where to insert the new content is an upcoming section. however, this does show that the template builder can update the output upon changes without rebuilding the entire template. when an unassertion occurs, or data is removed from the datasource, a different process is used. in this case, the builder looks at the results and determines which ones to remove. when it had first generated the results, the builder stored extra information to specify what parts of the graph were navigated over. it uses this informa...
Broadcasters and Observers - Archive of obsolete content
on. for example, a command would be used for an action such as back, cut or delete. a broadcaster would be used to hold, for instance, a flag to indicate whether the user was online or not. in the former case, menu items and toolbar buttons would need to be disabled when there was no page to go back to, or no text to cut or delete. in the latter case, various user interface elements might need to update when the user switches from offline mode to online mode. the simplest broadcaster is shown below. you should always use an id attribute so that it can be referred to by other elements. <broadcasterset> <broadcaster id="isoffline" label="offline"/> </broadcasterset> any elements that are watching the broadcaster will be modified automatically whenever the broadcaster has its label attribute ...
...he broadcaster above: <button id="offline_button" observes="isoffline"/> the observes attribute has been placed on the button and its value has been set to the value of the id on the broadcaster to observe. here the button will observe the broadcaster which has the id isoffline, which is the one defined earlier. if the value of the label attribute on the broadcaster changes, the observers will update the values of their label attributes also. we could continue with additional elements. as many elements as you want can observe a single broadcaster. you can also have only one if you wanted to but that would accomplish very little since the main reason for using broadcasters is to have attributes forwarded to multiple places. you should only use broadcasters when you need multiple elements that...
...he key won't use any of the received attributes for anything, but it will be disabled when the broadcaster is disabled. you can use a broadcaster to observe any attribute that you wish. the observers will grab all the values of any attributes from the broadcasters whenever they change. whenever the value of any of the attributes on the broadcaster changes, the observers are all notified and they update their own attributes to match. attributes of the observers that the broadcaster doesn't have itself are not modified. the only attributes that are not updated are the id and persist attributes; these attributes are never shared. you can also use your own custom attributes if you wish. broadcasters aren't used frequently as commands can generally handle most uses. one thing to point out is that t...
Tree Box Objects - Archive of obsolete content
e tree or removed from the tree. the tree will redraw the affected area. you don't need to call the rowcountchanged() function when a row has simply changed in some way, for example if a cell's label changes. in this case, there are other drawing functions that can be used. the simplest is to call invalidaterow() which will redraw a specific row in the tree. the tree will call the view to get the updated data and update the contents of the tree on screen. other redrawing functions are invalidatecell() to redraw only a single cell invalidatecolumn() to redraw a column invalidaterange() to redraw a range of rows invalidate() to redraw the entire tree. note that redrawing does not occur until the calling script ends since mozilla does not redraw in the background. note: it is not necessar...
...is since rows always take up the entire horizontal space of the tree. one important thing to note is that the coordinates are measured from the upper left corner of the containing document, not the edge of the tree itself. this makes it easy to pass event coordinates directly to these functions, as in the following example of the getcellat() function. ...
...itreeboxobject); boxobject.getcellat(event.clientx, event.clienty, row, column, part); if (column.value && typeof column.value != "string") column.value = column.value.id; document.getelementbyid("row").value = row.value; document.getelementbyid("column").value = column.value; document.getelementbyid("part").value = part.value; } </script> <tree id="thetree" flex="1" onmousemove="updatefields(event);"> <treecols> <treecol id="utensil" label="utensil" primary="true" flex="1"/> <treecol id="count" label="count" flex="1"/> </treecols> <treechildren> <treeitem> <treerow> <treecell label="fork"/> <treecell label="5"/> </treerow> </treeitem> <treeitem> <treerow> <treecell label="knife"/> <treecell label="2"/> ...
Extentsions FAQ - Archive of obsolete content
h a firefox tab isn't quite the same as having a completely separate explorer window. however, it's functional and does allow for the explorer to be handling the display of the folder contents, and all of the right-click context menu support is present so it should meet my needs. what is the valid location and things needed to to release a mozilla extension on mozallia site? you must remove updateurl from the install.rdf and use a known to amo minversion/maxversion. no confirmation that the answer given worked yet. is it possible to open the url in a new tab? var tab = gbrowser.addtab( url ); // and if you want it to load in the foreground: gbrowser.selectedtab = tab; is it possible to read the html-code of the current url/site? yes, this is possible. use the dom api (http://www.w...
...thunderbird presumably)? could someone make an addressbook enhancer extension that has the ability to put pictures on a contact and other features the thunderbird address book lacks. ...
...nhancer extension that has the ability to put pictures on a contact and other features the thunderbird address book lacks. ...
2006-12-01 - Archive of obsolete content
group. windows dde shell integration removal robert strong announces that a long standing bug in firefox's use of the windows dde shell integration code has been uncovered during vist os integration testing. firefox's use of this code has been removed but the windows dde shell integration code has been kept so that 3rd party apps depending on this code can stay working. ...
...ces that a long standing bug in firefox's use of the windows dde shell integration code has been uncovered during vist os integration testing. firefox's use of this code has been removed but the windows dde shell integration code has been kept so that 3rd party apps depending on this code can stay working. firefox 1.5.0.9/2.0.0.1 update - we need help! jay patael calls for help getting the next update ff 1.5.x and 2.x. he requests blocker bug owners get their patches in asap and since check approval will be granted daily that they be ready to check their patches in as soon as they are approved. automatic configure updated back preed announces that the machine that does the automatic autoconf/configure generation (egg.build.mozilla.org) is back up. gecko 1.9a1 triage meetings vlad announced...
... discussion november 29th gecko 1.9/gran paradiso status meeting other than annoucing the meeting, this thread discusses where else can info about what happens at the meetings be found (since the agenda often seems bare). m.d.planning and dev news blog are suggested. ...
Threats - Archive of obsolete content
example, a mail which appears to be to be sent from a bank, asking to verify your identity by giving away your private information. ddos network attack. the volume and strength of ddos attacks are growing as hackers try to bring organizations offline or steal their data by flooding websites and networks with spurious traffic. original document information author(s): ella deon lackey last updated date: 2012 copyright information: © 2012 red hat, inc. link: red hat certificate system common criteria certification 8.1: deployment, planning, and installation original document information author(s): joint task force transformation initiative title: national institute of standards and technology (nist) special publication 800-30 revision 1, guide for conducting risk assessments la...
...ate: 2012 copyright information: © 2012 red hat, inc. ...
...cial publication 800-30 revision 1, guide for conducting risk assessments last updated date: september 2012 copyright information: this document is not subject to copyright. original document information author(s): karen scarfone, wayne jansen, and miles tracy title: national institute of standards and technology (nist) special publication 800-123, guide to general server security last updated date: july 2008 copyright information: this document is not subject to copyright. ...
Object.observe() - Archive of obsolete content
to be observed. callback the function called each time changes are made, with the following argument: changes an array of objects each representing a change. the properties of these change objects are: name: the name of the property which was changed. object: the changed object after the change was made. type: a string indicating the type of change taking place. one of "add", "update", or "delete". oldvalue: only for "update" and "delete" types. the value before the change. acceptlist the list of types of changes to be observed on the given object for the given callback. if omitted, the array ["add", "update", "delete", "reconfigure", "setprototype", "preventextensions"] will be used. return value the object to be observed. description callback is called e...
...escription callback is called each time a change is made to obj, with an array of all changes in the order in which they occurred. ...
...proto__', object: <obj>, type: 'setprototype', oldvalue: <prototype>}] object.seal(obj); // [ // {name: 'foo', object: <obj>, type: 'reconfigure'}, // {name: 'bar', object: <obj>, type: 'reconfigure'}, // {object: <obj>, type: 'preventextensions'} // ] data binding // a user model var user = { id: 0, name: 'brendan eich', title: 'mr.' }; // create a greeting for the user function updategreeting() { user.greeting = 'hello, ' + user.title + ' ' + user.name + '!'; } updategreeting(); object.observe(user, function(changes) { changes.foreach(function(change) { // any time name or title change, update the greeting if (change.name === 'name' || change.name === 'title') { updategreeting(); } }); }); custom change type // a point on a 2d plane var point = {x: ...
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
erver-side script block to expose a particular server-side function to the browser. this statement is of the form <functionname>.proxy = true. ensure the server-side function name is contained within the jaxer.proxies array. generally it's a best practice to use either the second or third strategy since in this case you are exposing only what's needed to the client. see listing 5 for an update to listing 1 to reflect this. listing 5 - demonstration of server-proxy <script runat="server"> function notexposed() { // runs on the server, hidden from the browser return "can't see me!"; } function exposed() { // runs on the server, callable from the browser return "exposed to the browser"; } exposed.proxy = true; // tell jaxer this function is ok to be called f...
...ng the dom server-side <script runat="server"> window.onserverload = function() { document.getelementbyid( "out-logger" ).innerhtml = jaxer.file.read( "dump.txt" ); } </script> the code in listing 7 is executed server-side and takes advantage of the onserverload event which ensures that we have a complete dom before trying to access it. this code is simple in that it updates the innerhtml of the logging div with the contents of a text file. the contents of this file are obtained through the file i/o capabilities exposed by jaxer which is what we'll examine next. file i/o jaxer ships with a comprehensive filesystem i/o capability that is very useful. there are numerous methods in this namespace which allow for a simple, yet powerful approach...
... listing 8 - submitting comment data <script> function formhandler() { // get the form values var name = txt_name.getvalue(); var email = txt_email.getvalue(); var message = txt_message.getvalue(); // if the form passes validation client-side, submit results to the processor if( validatecomments( name, email, message ) ) { formprocessor( name, email, message ); // update the logger with the most recent entry document.getelementbyid( "out-logger" ).innerhtml += "name: " + name + "<br/>email: " + email + "<br/>message: " + message + "<br/><br/>"; } else { ext.msg.alert( "error", "please enter the required fields" ); } } </script> <!-- processes the form contents --> <script runat="server"> function formprocessor( name, email, message ) { // perform the same...
Archive of obsolete content
er current. gecko compatibility handbook ** notes ** - the solution quick reference needs more attention. - i'm also looking for a way to organize all that information. - some inline examples were removed because of technical limitations. they are actually replaced by ''-(example removed)-'' the goal of this handbook is to help you update websites to work with standards-based browsers and properly detect gecko. getting the page url in npapi plugin sometimes, you want to restrict an npapi plugin to be loadable only from a certain url or domain or scheme. or whenever you make network requests yourself, you almost always need to enforce same-origin policy. index of archived content ...
... list of mozilla-based applications the following is a list of all known active applications that are built using mozilla technologies. this list is likely to be incomplete since we think there are many dark matter projects that we don't know about. if you have information about a new project or extra information about an existing project, please feel free to update this page. localizing an extension this article expands upon the previous samples on extension writing by adding localization support to our stock watcher extension. performing a few simple steps makes your extension much easier to localize into various languages without having to edit the xul or javascript files themselves. makefile - ...
...rin central, please see the basics of web services summary: a current hot topic on the web right now are web services. this short guide will allow you to learn more about web services. themes archived theme documentation. updating an extension to support multiple mozilla applications this article shows how to take an existing extension and update it so that it can be used in additional mozilla applications. we'll build upon the stock watcher extension created in earlier articles in this series, updating it so it can also be used in thunderbird and sunbird (previous versions worked only in firefox). using firebug and jquery (screencast) note: this screencast is originally from: http://ej...
Building up a basic demo with PlayCanvas editor - Game development
double click on it, you'll be moved to a code editor. as you can see, the file contains some boilerplate code already: pc.script.create('boxanimation', function (app) { // creates a new boxanimation instance var boxanimation = function (entity) { this.entity = entity; }; boxanimation.prototype = { // called once after all resources are loaded and before the first update initialize: function () { }, // called every frame, dt is time in seconds since last update update: function (dt) { } }; return boxanimation; }); the most interesting part is the update() function, which is where we can put any code that we want repeated on every frame. add the following line inside this function, to rotate the cube on every fram...
... for cylinder. first: create a new script asset. name it cylinderanimation.js. double click the script icon to launch the code editor. this time instead of rotating the object we will try to scale it. for that we'll need a timer to store the total amount of time passed since the start of the animation. add this code to the initialize() function: this.timer = 0; and those two lines to the update() function: this.timer += dt; this.entity.setlocalscale(1, math.abs(math.sin(this.timer)), 1); the setlocalscale() method applies the given values to the x, y and z axes of the object. in our case we're modifying the scale of the cylinder on the y axis, giving it as a value the math.sin() of the timer, with math.abs() applied to the result of that to have the values always above zero (0-1; sin ...
...o add the cylinderanimation.js file to the cylinder object to apply the given animations. the cone time to play with the last object — the cone. create a coneanimation.js file and double click it to open it in the editor. next, add the following line to the initialize() function: this.timer = 0; to move the cone up and down we will use the setposition() method — add the code below to the update() function: this.timer += dt; this.entity.setposition(2, math.sin(this.timer*2), 0); the position of the cone will be animated on each frame by being passed the math.sin() value of the timer at each point in time — we have doubled the this.timer value to make it move higher. add the coneanimation.js script to the cone object, as before. test the demo out launch the demo to see the effects ...
Desktop mouse and keyboard controls - Game development
we can also offer firing control alternatives. for cursor keys the natural shooting button would be on the other side of the keyboard, so the player can use the other hand — for example the x key. for w a s d keys it can be the space bar: this.keyfire1 = this.input.keyboard.addkey(...
...ment key options. we can also offer firing control alternatives. for cursor keys the natural shooting button would be on the other side of the keyboard, so the player can use the other hand — for example the x key. ...
...re2 = this.input.keyboard.addkey(phaser.keycode.spacebar); in the update() function we can easily check if any of those two were pressed on each frame: if(this.keyfire1.isdown || this.keyfire2.isdown) { // fire the weapon } if yes, then it's time to shoot some bullets! we can even define a secret cheat button: this.keycheat = this.input.keyboard.addkey(phaser.keycode.c); and then in the update() function whenever c is pressed we'll do this: if(this.keycheat.isdown) { this.player.health = this.player.maxhealth; } we can set the health of the player to maximum. remember: it's a secret, so don't tell anyone! how to play we've implemented the controls, and now we should inform the player about their options to control the game — they wouldn't know about them otherwise. when showi...
Implementing game control mechanisms - Game development
e javascript files split as a separate states — boot.js, preloader.js, mainmenu.js and game.js — these are loaded into the index file in this exact order. the first one initializes phaser, the second preloads all the assets, the third one controls the main menu welcoming the player, and the fourth controls the actual gameplay. every state has its own default methods: preload(), create(), and update(). the first one is needed for preloading required assets, create() is executed once the state had started, and update() is executed on every frame. for example, you can define a button in the create() function: create: function() { // ... var buttonenclave = this.add.button(10, 10, 'logo-enclave', this.clickenclave, this); // ... } it will be created once at the start of the game, and wil...
...) is executed on every frame. for example, you can define a button in the create() function: create: function() { // ... var buttonenclave = this.add.button(10, 10, 'logo-enclave', this.clickenclave, this); // ... } it will be created once at the start of the game, and will execute this.clickenclave() action assigned to it when clicked, but you can also use the mouse's pointer value in the update() function to make an action: update: function() { // ... if(this.game.input.mousepointer.isdown) { // do something } // ... } this will be executed whenever the mouse button is pressed, and it will be checked against the input's isdown boolean variable on every frame of the game. that should give you some understanding of the project structure. we'll be playing mostly with the mainm...
...put.mousepointer.isdown) { // do something } // ... } this will be executed whenever the mouse button is pressed, and it will be checked against the input's isdown boolean variable on every frame of the game. that should give you some understanding of the project structure. we'll be playing mostly with the mainmenu.js and game.js files, and we'll explain the code inside the create() and update() methods in much more detail in later articles. pure javascript demo there's also a small online demo with full source code available on github where the basic support for the control mechanisms described in the articles is implemented in pure javascript. it will be explained in the given articles themselves below, but you can play with it already, and use the code however you want for learnin...
Efficient animation for web games - Game development
to keep unnecessary work outside your animation functions. for example, it may make sense for animation setup to happen in a settimeout/cleartimeout callback rather than a requestanimationframe callback. though it is possibly overkill for simple games, you may also want to consider using web worker threads. it is worth trying to batch similar operations, and to schedule them at a time when screen updates are unlikely to occur, or when such updates are of a more subtle nature. modern console games, for example, tend to prioritise framerate during player movement and combat, but may prioritise image quality or physics detail when compromise to framerate and input response would be less noticeable. measure performance there are some popular animation-related libraries and ui toolkits with animati...
...ing scope-creep. it does one thing, and it does it well. animator.js is a fire-and-forget style animation library, designed to be used with games, or other situations where you need many, synchronised, custom animations. it includes a handful of built-in tweening functions, the facility to add your own, and helper functions for animating object properties. ...
...when you request a redraw outside of animations, the animator’s activeanimations property is queried first to avod mistakenly drawing multiple times in a single animation frame. this gives nice, synchronised animations at a very low cost. puzzowl isn’t out yet, but here’s a little screencast of it running on a nexus 5: note: this article was originally written and published by ...
Collision detection - Game development
and the ball changes its direction. the problem is that the bricks are staying where they are. we have to figure out a way to get rid of the ones we've already hit with the ball. we can do that by adding an extra parameter to indicate whether we want to paint each brick on the screen or not. in the part of the code where we initialize the bricks, let's add a status property to each brick object. ...
...bricks = []; for(var c=0; c<brickcolumncount; c++) { bricks[c] = []; for(var r=0; r<brickrowcount; r++) { bricks[c][r] = { x: 0, y: 0, status: 1 }; } } next we'll check the value of each brick's status property in the drawbricks() function before drawing it — if status is 1, then draw it, but if it's 0, then it was hit by the ball and we don't want it on the screen anymore. ...
...x.closepath(); } } } } tracking and updating the status in the collision detection function now we need to involve the brick status property in the collisiondetection() function: if the brick is active (its status is 1) we will check whether the collision happens; if a collision does occur we'll set the status of the given brick to 0 so it won't be painted on the screen. ...
CSS and JavaScript accessibility best practices - Learn web development
tain ways, according to their functionality, and these common conventions are expected by users. as an example, a screen reader user can't navigate a page via heading elements if the developer hasn't appropriately used heading elements to markup the content. by the same token, a heading loses its visual purpose if you style it so it doesn't look like a heading. the rule of thumb is that you can update the styling of a page feature to fit in your design, but don't change it so much that it no longer looks or behaves as expected. the following sections summarize the main html features to consider. "standard" text content structure headings, paragraphs, lists — the core text content of your page: <h1>heading</h1> <p>paragraph</p> <ul> <li>my list</li> <li>has two items.</li> </ul> som...
...ur design. as an example, you might want to make sure your main content area can handle bigger text (maybe it will start to scroll to allow it all to be seen), and won't just hide it, or break completely. javascript javascript can also break accessibility, depending on how it is used. modern javascript is a powerful language, and we can do so much with it these days, from simple content and ui updates to fully-fledged 2d and 3d games. there is no rule that says all content has to be 100% accessible to all people — you just need to do what you can, and make your apps as accessible as possible. simple content and functionality is arguably easy to make accessible — for example text, images, tables, forms and push button that activate functions. as we looked at in our html: a good basis for ...
...mented in this simple demo. we've made this form validation pretty accessible too. ...
Legacy layout methods - Learn web development
h with 6.25%. we need to do the same with our gutter width: 20 / 960 = 0.02083333333 so we need to replace the 20 pixel margin-left on our .col rule and the 20 pixel padding-right on .wrapper with 2.08333333%. updating our grid to get started in this section, make a new copy of your previous example page, or make a local copy of our simple-grid-finished.html code to use as a starting point. ...
...make a local copy of our simple-grid-finished.html code to use as a starting point. update the second css rule (with the .wrapper selector) as follows: body { width: 90%; max-width: 980px; margin: 0 auto; } .wrapper { padding-right: 2.08333333%; } not only have we given it a percentage width, we have also added a max-width property in order to stop the layout becoming too wide. next, update the fourth css rule (with the .col selector) like so: .col { float: left; margin-left: 2.08333333%; width: 6.25%; background: rgb(255, 150, 150); } now comes the slightly more laborious part — we need to update all our .col.span rules to use percentages rather than pixel widths. ...
..., update the fourth css rule (with the .col selector) like so: .col { float: left; margin-left: 2.08333333%; width: 6.25%; background: rgb(255, 150, 150); } now comes the slightly more laborious part — we need to update all our .col.span rules to use percentages rather than pixel widths. this takes a bit of time with a calculator; to save you some effort, we've done it for you below. update the bottom block of css rules with the following: /* two column widths (12.5%) plus one gutter width (2.08333333%) */ .col.span2 { width: 14.58333333%; } /* three column widths (18.75%) plus two gutter widths (4.1666666) */ .col.span3 { width: 22.91666666%; } /* and so on... */ .col.span4 { width: 31.24999999%; } .col.span5 { width: 39.58333332%; } .col.span6 { width: 47.91666665%; } .col.span7 ...
Positioning - Learn web development
t flow — nothing special to see here." to demonstrate this, and get your example set up for future sections, first add a class of positioned to the second <p> in the html: <p class="positioned"> ... </p> now add the following rule to the bottom of your css: .positioned { position: static; background: yellow; } if you now save and refresh, you'll see no difference at all, except for the updated background color of the 2nd paragraph. this is fine — as we said before, static positioning is the default behavior! note: you can see the example at this point live at 1_static-positioning.html (see source code). relative positioning relative positioning is the first position type we'll take a look at. this is very similar to static positioning, except that once the positioned element ha...
...t this point live at 1_static-positioning.html (see source code). relative positioning relative positioning is the first position type we'll take a look at. this is very similar to static positioning, except that once the positioned element has taken its place in the normal layout flow, you can then modify its final position, including making it overlap other elements on the page. go ahead and update the position declaration in your code: position: relative; if you save and refresh at this stage, you won't see a change in the result at all. so how do you modify the element's position? you need to use the top, bottom, left, and right properties, which we'll explain in the next section. introducing top, bottom, left, and right top, bottom, left, and right are used alongside position to spe...
... fixed containing block due to its transform property being different from none. this means that you can create useful ui items that are fixed in place, like persisting navigation menus that are always visible no matter how much the page scrolls. let's put together a simple example to show what we mean. first of all, delete the existing p:nth-of-type(1) and .positioned rules from your css. now, update the body rule to remove the position: relative; declaration and add a fixed height, like so: body { width: 500px; height: 1400px; margin: 0 auto; } now we're going to give the <h1> element position: fixed;, and get it to sit at the top of the viewport. add the following rule to your css: h1 { position: fixed; top: 0; width: 500px; margin-top: 0; background: white; padding: 10...
What is a Domain Name? - Learn web development
a given domain name is available, go to a domain name registrar's website. most of them provide a “whois” service that tells you whether a domain name is available. ...
...org: $ whois mozilla.org domain name:mozilla.org domain id: d1409563-lror creation date: 1998-01-24t05:00:00z updated date: 2013-12-08t01:16:57z registry expiry date: 2015-01-23t05:00:00z sponsoring registrar:markmonitor inc. (r37-lror) sponsoring registrar iana id: 292 whois server: referral url: domain status: clientdeleteprohibited domain status: clienttransferprohibited domain status: clientupdateprohibited registrant id:mmr-33684 registrant name:dns admin registrant organization:mozilla foundation registrant street: 650 castro st ste 300 registrant city:mountain view registrant state/province:ca registrant postal code:94041 registrant country:us registrant phone:+1.6509030800 as you can see, i can't register mozilla.org because the mozilla foundation has already registered it. on the o...
...e in some countries registrars may be forced to close the domain if they cannot provide a valid address. 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. whenever your registrar creates or updates any information for a given domain, the information must be refreshed in every dns database. 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). thus, it takes some time for dns servers that know about this domain...
Example 4 - Learn web development
ct.classlist.add('active'); }; function toggleoptlist(select, show) { var optlist = select.queryselector('.optlist'); optlist.classlist.toggle('hidden'); } function highlightoption(select, option) { var optionlist = select.queryselectorall('.option'); optionlist.foreach(function (other) { other.classlist.remove('highlight'); }); option.classlist.add('highlight'); }; function updatevalue(select, index) { var nativewidget = select.previouselementsibling; var value = select.queryselector('.value'); var optionlist = select.queryselectorall('.option'); nativewidget.selectedindex = index; value.innerhtml = optionlist[index].innerhtml; highlightoption(select, optionlist[index]); }; function getindex(select) { var nativewidget = select.previouselementsibling; ret...
...lur', function (event) { deactivateselect(select); }); }); }); window.addeventlistener('load', function () { var selectlist = document.queryselectorall('.select'); selectlist.foreach(function (select) { var optionlist = select.queryselectorall('.option'), selectedindex = getindex(select); select.tabindex = 0; select.previouselementsibling.tabindex = -1; updatevalue(select, selectedindex); optionlist.foreach(function (option, index) { option.addeventlistener('click', function (event) { updatevalue(select, index); }); }); select.addeventlistener('keyup', function (event) { var length = optionlist.length, index = getindex(select); if (event.keycode === 27) { deactivateselect(select); } if (ev...
...function (event) { updatevalue(select, index); }); }); select.addeventlistener('keyup', function (event) { var length = optionlist.length, index = getindex(select); if (event.keycode === 27) { deactivateselect(select); } if (event.keycode === 40 && index < length - 1) { index++; } if (event.keycode === 38 && index > 0) { index--; } updatevalue(select, index); }); }); }); result ...
Example 5 - Learn web development
ct.classlist.add('active'); }; function toggleoptlist(select, show) { var optlist = select.queryselector('.optlist'); optlist.classlist.toggle('hidden'); } function highlightoption(select, option) { var optionlist = select.queryselectorall('.option'); optionlist.foreach(function (other) { other.classlist.remove('highlight'); }); option.classlist.add('highlight'); }; function updatevalue(select, index) { var nativewidget = select.previouselementsibling; var value = select.queryselector('.value'); var optionlist = select.queryselectorall('.option'); optionlist.foreach(function (other) { other.setattribute('aria-selected', 'false'); }); optionlist[index].setattribute('aria-selected', 'true'); nativewidget.selectedindex = index; value.innerhtml = optionli...
... form.classlist.remove("no-widget"); form.classlist.add("widget"); }); window.addeventlistener('load', function () { var selectlist = document.queryselectorall('.select'); selectlist.foreach(function (select) { var optionlist = select.queryselectorall('.option'), selectedindex = getindex(select); select.tabindex = 0; select.previouselementsibling.tabindex = -1; updatevalue(select, selectedindex); optionlist.foreach(function (option, index) { option.addeventlistener('mouseover', function () { highlightoption(select, option); }); option.addeventlistener('click', function (event) { updatevalue(select, index); }); }); select.addeventlistener('click', function (event) { toggleoptlist(select); }); ...
...tener('blur', function (event) { deactivateselect(select); }); select.addeventlistener('keyup', function (event) { var length = optionlist.length, index = getindex(select); if (event.keycode === 27) { deactivateselect(select); } if (event.keycode === 40 && index < length - 1) { index++; } if (event.keycode === 38 && index > 0) { index--; } updatevalue(select, index); }); }); }); result ...
Adding vector graphics to the Web - Learn web development
label { margin: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); const output = document.queryselector('.output'); let code = textarea.value; let userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution...
...) { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solution'; } updatecode(); }); const htmlsolution = ''; let solutionentry = htmlsolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27...
...const caretpos = textarea.selectionstart; const front = (textarea.value).substring(0, caretpos); const back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.onkeyup = function(){ // 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(); }; summary ...
Introduction to web APIs - Learn web development
e dom (document object model) api, which allows you to manipulate html and css — creating, removing and changing html, dynamically applying new styles to your page, etc. every time you see a popup window appear on a page or some new content displayed, for example, that's the dom in action. find out more about these types of api in manipulating documents. apis that fetch data from the server to update small sections of a webpage on their own are very commonly used. this seemingly small detail has had a huge impact on the performance and behaviour of sites — if you just need to update a stock listing or list of available new stories, doing it instantly without having to reload the whole entire page from the server can make the site or app feel much more responsive and "snappy". apis that make...
...re responsive and "snappy". apis that make this possible include xmlhttprequest and the fetch api. you may also come across the term ajax, which describes this technique. find out more about such apis in fetching data from the server. apis for drawing and manipulating graphics are now widely supported in browsers — the most popular ones are canvas and webgl, which allow you to programmatically update the pixel data contained in an html <canvas> element to create 2d and 3d scenes. for example, you might draw shapes such as rectangles or circles, import an image onto the canvas, and apply a filter to it such as sepia or grayscale using the canvas api, or create a complex 3d scene with lighting and textures using webgl. such apis are often combined with apis for creating animation loops (such as...
... grabbing video from your web camera to be manipulated via a canvas (see above) or displayed on someone else's computer in a web conference, or adding effects to audio tracks (such as gain, distortion, panning, etc). device apis are basically apis for manipulating and retrieving data from modern device hardware in a way that is useful for web apps. examples include telling the user that a useful update is available on a web app via system notifications (see the notifications api) or vibration hardware (see the vibration api). 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. there ar...
Properly configuring server MIME types - Learn web development
background by default, many web servers are configured to report a mime type of text/plain or application/octet-stream for unknown content types. as new content types are invented or added to web servers, web administrators may fail to add the new mime types to their web server's configuration. this is a major source of problems for users of gecko-based browsers, which respect the mime types as reported by web servers and web applications. ...
...t the top of your doget or dopost method, where response is a reference to the httpservletresponse. ...
...re response is a reference to the httpservletresponse. ...
Introduction to client-side frameworks - Learn web development
tically simple in isolation. we can iterate over the data to render it; we can add to an object to make a new task; we can use an identifier to find, edit, or delete a task. when we remember that the application has to let the user to do all of these things through the browser, however, some cracks start to show. the real problem is this: every time we change our application’s state, we need to update the ui to match. we can examine the difficulty of this problem by looking at just one feature of our todo list app: rendering a list of tasks. the verbosity of dom changes building html elements and rendering them in the browser at the appropriate time takes a surprising amount of code. let's say that our state is an array of objects structured like this: const state = [ { id: 'todo-0',...
...yle our list-items! working directly with the dom, as in this example, requires understanding many things about how the dom works: how to make elements; how to change their properties; how to put elements inside of each other; how to get them on the page. none of this code actually handles user interactions, or addresses adding or deleting a task. if we add those features, we have to remember to update our ui in the right time and in the right way. javascript frameworks were created to make this kind of work a little easier — they exist to provide a better developer experience. they don't bring brand-new powers to javascript; they give you easier access to javascript's powers so you can build for today's web. if you want to see code samples from this section in action, you can check out a w...
...dress bar changes. you can save this new url and come back to the page later on, or share it with others so they can easily find the same page. your browser remembers your navigation history and allows you to navigate back and forth, too. this is called server-side routing. modern web applications typically do not fetch and render new html files — they load a single html shell, and continually update the dom inside it (referred to as single page apps, or spas) without navigating users to new addresses on the web. each new pseudo-webpage is usually called a view, and by default, no routing is done. when an spa is complex enough, and renders enough unique views, it's important to bring routing functionality into your application. people are used to being able to link to specific pages in an ap...
Framework main features - Learn web development
xample, consider a button that counts how many times it has been clicked. this component should be responsible for tracking its own count state, and could be written like this: function counterbutton() { const [count] = usestate(0); return ( <button>clicked {count} times</button> ); } usestate() is a react hook which, given an initial data value, will keep track of that value as it is updated. the code will be initially rendered like so in the browser: <button>clicked 0 times</button> the usestate() call keeps track of the count value in a robust way across the app, without you needing to write code to do that yourself. events in order to be interactive, components need ways to respond to browser events, so our applications can respond to our users. frameworks each provide their ...
...ng to write code to do that yourself. events in order to be interactive, components need ways to respond to browser events, so our applications can respond to our users. frameworks each provide their own syntax for listening to browser events, which reference the names of the equivalent native browser events. in react, listening for the click event requires a special property, onclick. let’s update our counterbutton code from above to allow it to count clicks: function counterbutton() { const [count, setcount] = usestate(0); return ( <button onclick={() => setcount(count + 1)}>clicked {count} times</button> ); } in this version we are using additional usestate() functionality to create a special setcount() function, which we can invoke to update the value of count. we call this ...
...s for you, you typically don't interact with the dom yourself. this abstraction away from the dom is more complex and more memory-intensive than updating the dom yourself, but without it, frameworks could not allow you to program in the declarative way they’re known for. the virtual dom is an approach whereby information about your browser's dom is stored in javascript memory. your application updates this copy of the dom, then compares it to the "real" dom — the dom that is actually rendered for your users — in order to decide what to render. the application builds a "diff" to compare the differences between the updated virtual dom and the currently rendered dom, and uses that diff to apply updates to the real dom. both react and vue utilize a virtual dom model, but they do not apply the...
Componentizing our React app - Learn web development
{false} /> <todo name="repeat" completed={false} /> as before, we must go back to todo.js to actually use these props. change the defaultchecked attribute on the <input /> so that its value is equal to the completed prop. once you’re done, the todo component's <input /> element will read like this: <input id="todo-0" type="checkbox" defaultchecked={props.completed} /> and your browser should update to show only eat being checked: if you change each <todo /> component’s completed prop, your browser will check or uncheck the equivalent rendered checkboxes accordingly. gimme some id, please right now, our <todo /> component gives every task an id attribute of todo-0. this is bad html because id attributes must be unique (they are used as unique identifiers for document fragments, by css...
...s to keep track of which one is which in order to render them properly. react tries to do its own guesswork to keep track of things, but we can help it out by passing a key prop to our <todo /> components. key is a special prop that's managed by react – you cannot use the word key for any other purpose. because keys should be unique, we're going to re-use the id of each task object as its key. update your tasklist constant like so: const tasklist = props.tasks.map(task => ( <todo id={task.id} name={task.name} completed={task.completed} key={task.id} /> ) ); you should always pass a unique key to anything you render with iteration. nothing obvious will change in your browser, but if you do not use unique keys, react will log warnings to your console and your...
...button; note: you might notice that we are making the same mistake here as we first made for the <todo /> component, in that each button will be the same. that’s fine! we’re going to fix up this component later on, in back to the filter buttons. importing all our components let's make use of our new components. add some more import statements to the top of app.js, to import them. then, update the return statement of app() so that it renders our components. when you’re done, app.js will read like this: import react from "react"; import form from "./components/form"; import filterbutton from "./components/filterbutton"; import todo from "./components/todo"; function app(props) { const tasklist = props.tasks.map(task => ( <todo id={task.id} name={task.name} ...
Creating our first Vue component - Learn web development
regular html attribute: <to-do-item label="my todo item"></to-do-item> now you'll see the label in your app, and the warning won't be spat out in the console again. so that's props in a nutshell. next we'll move on to how vue persists data state. vue's data object if you change the value of the label prop passed into the <to-do-item></to-do-item> call in your app component, you should see it update. this is great. we have a checkbox, with an updatable label. however, we're currently not doing anything with the "done" prop — we can check the checkboxes in the ui, but nowhere in the app are we recording whether a todo item is actually done. to achieve this, we want to bind the component's done prop to the checked attribute on the <input> element, so that it can serve as a record of whether...
...his works in arrow functions (binding to the parent’s context), you wouldn’t be able to access any of the necessary attributes from inside data if you used an arrow function. so don’t use an arrow function for the data property. so let's add a data property to our todoitem component. this will return an object containing a single property that we'll call isdone, whose value is this.done. update the component object like so: export default { props: { label: { required: true, type: string }, done: { default: false, type: boolean } }, data() { return { isdone: this.done }; } }; vue does a little magic here — it binds all of your props directly to the component instance, so we don’t have to call this.props.done. it also binds other attributes (data, which...
...bute on the <input> element. both of the following are equivalent: <input type="checkbox" id="todo-item" v-bind:checked="isdone" /> <input type="checkbox" id="todo-item" :checked="isdone" /> you're free to use whichever pattern you would like. it's best to keep it consistent though. because the shorthand syntax is more commonly used, this tutorial will stick to that pattern. so let's do this. update your <input> element now to replace checked="false" with :checked="isdone". test out your component by passing :done="true" to the todoitem call in app.vue. note that you need to use the v-bind syntax, because otherwise true is passed as a string. the displayed checkbox should be checked. <template> <div id="app"> <h1>my to-do list</h1> <ul> <li> <to-do-item label="my to...
Understanding client-side JavaScript frameworks - Learn web development
y new todo items. along the way, we'll look at using events in ember, creating component classes to contain javascript code to control interactive features, and setting up a service to keep track of the data state of our app. 4. ember interactivity: footer functionality, conditional rendering now it's time to start tackling the footer functionality in our app. here we'll get the todo counter to update to show the correct number of todos still to complete, and correctly apply styling to completed todos (i.e. where the checkbox has been checked). we'll also wire up our "clear completed" button. along the way, we'll learn about using conditional rendering in our templates. 5. routing in ember in this article we learn about routing or url-based filtering as it is sometimes referred to. we'll use...
...cies changes. 7. vue conditional rendering: editing existing todos now it is time to add one of the major parts of functionality that we're still missing — the ability to edit existing todo items. to do this, we will take advantage of vue's conditional rendering capabilities — namely v-if and v-else — to allow us to toggle between the existing todo item view and an edit view where you can update todo item labels. we'll also look at adding functionality to delete todo items. 8. focus management with vue refs we are nearly done with vue. the last bit of functionality to look at is focus management, or put another way, how we can improve our app's keyboard accessibility. we'll look at using vue refs to handle this — an advanced feature that allows you to have direct access to the underl...
...article we'll be using variables and props to make our app dynamic, allowing us to add and delete todos, mark them as complete, and filter them by status. 4. componentizing our svelte app the central objective of this article is to look at how to break our app into manageable components and share information between them. we'll componentize our app, then add more functionality to allow users to update existing components. 5. advanced svelte: reactivity, lifecycle, accessibility in this article we will add the app's final features and further componentize our app. we will learn how to deal with reactivity issues related to updating objects and arrays. to avoid common pitfalls, we'll have to dig a little deeper into svelte's reactivity system. we'll also look at solving some accessibility focu...
Implementing feature detection - Learn web development
res you need feature detects for. then when you click the build button, you'll download a custom build containing only those feature detects, making for a much smaller file size. css let's have a look at how modernizr works in terms of selectively applying css. first, make a copy of supports-feature-detect.html and supports-styling.css. save them as modernizr-css.html and modernizr-css.css. update your <link> element in your html so it points to the correct css file (you should also update your <title> element to something more suitable!): <link href="modernizr-css.css" rel="stylesheet"> above this <link> element, add a <script> element to apply the modernizr library to the page, as shown below. this needs to be applied to the page before any css (or javascript) that might make use of...
...age before any css (or javascript) that might make use of it. <script src="modernizr-custom.js"></script> now edit your opening <html> tag, so that it looks like this: <html class="no-js"> at this point, try loading your page, and you'll get an idea of how modernizr works for css features. if you look at the dom inspector of your browser's developer tools, you'll see that modernizr has updated your <html> class value like so: <html class="js no-htmlimports sizes flash transferables applicationcache blobconstructor blob-constructor cookies cors ...and loads more values!> it now contains a large number of classes that indicate the support status of different technology features. as an example, if the browser didn't support flexbox at all, <html> would be given a class name of no-flexb...
...ou search through the class list, you'll also see others relating to flexbox, like: flexboxlegacy for the old flexbox spec (2009). flexboxtweener for 2011 in between syntax supported by ie10. flexwrap for the flex-wrap property, which isn't present in some implementations. note: you can find a list of what all the class names mean — see features detected by modernizr. moving on, let's update our css to use modernizr rather than @supports. go into modernizr-css.css, and replace the two @supports blocks with the following: /* properties for browsers with modern flexbox */ .flexbox main { display: flex; } .flexbox main div { padding-right: 4%; flex: 1; } .flexbox main div:last-child { padding-right: 0; } /* fallbacks for browsers that don't support modern flexbox */ .no-fl...
Handling common JavaScript problems - Learn web development
message we saw before the console.log() output shows that the superheroes object doesn't appear to contain anything. a very common problem with async requests like this is when you try to do something with the response object before it has actually been returned from the network. ...
...ou can examine the environment in its current state and see what is going on. let's get to work. the error is now being thrown at line 51. click on line number 51 in the center panel to add a breakpoint to it (you'll see a blue arrow appear over the top of it). now refresh the page (cmd/ctrl + r) — the browser will pause execution of the code at line 51. at this point, the right-hand side will update to show some very useful information. under breakpoints, you'll see the details of the break-point you have set. under call stack, you'll see a few entries — this is basically a list of the series of functions that were invoked to cause the current function to be invoked. at the top, we have showheroes() the function we are currently in, and second we have onload, which stores the event h...
...information in here. expand the showheroes scope — you can see from this that the heroes variable is undefined, indicating that accessing the members property of jsonobj (first line of the function) didn't work. you can also see that the jsonobj variable is storing a text string, not a json object. exploring further down the call stack, click onload in the call stack section. the view will update to show the request.onload function in the center panel, and its scopes in the scopes section. if you expand the onload scope, you'll see that the superheroes variable is a text string too, not an object. this settles it — our xmlhttprequest call is returning the json as text, not json. we'd like you to try fixing this problem yourself. to give you a clue, you can either tell the xmlhttprequ...
Learn web development
a server-side app using two popular frameworks: django (python) and express (node.js). getting our code examples the code examples you'll encounter in the learning area are all available on github. if you want to copy them all to your computer, the easiest way is to download a zip of the latest master code branch. if you prefer to copy the repo in a more flexible way that allows for automatic updates, you can follow the more complex instructions: install git on your machine. this is the underlying version control system software that github works on top of. open your computer's command prompt (windows) or terminal (linux, macos). to copy the learning area repo to a folder called learning-area in the current location your command prompt/terminal is pointing to, use the following command:...
...ommand prompt (windows) or terminal (linux, macos). to copy the learning area repo to a folder called learning-area in the current location your command prompt/terminal is pointing to, use the following command: git clone https://github.com/mdn/learning-area you can now enter the directory and find the files you are after (either using your finder/file explorer or the cd command). ...
...now enter the directory and find the files you are after (either using your finder/file explorer or the cd command). you can update the learning-area repository with any changes made to the master version on github with the following steps: in your command prompt/terminal, go inside the learning-area directory using cd. for example, if you were in the parent directory: cd learning-area update the repository using the following command: git pull contact us if you want to get in touch with us about anything, the best way is to drop us a message on our discourse forum. we'd like to hear from you about anything you think is wrong or missing on the site, requests for new learning topics, requests for help with items you don't understand, or any other questions or concerns. if you'r...
Displaying Places information using views
pe_bookmarks; var uri = histserv.queriestoquerystring([query], 1, opts); var tree = document.getelementbyid("mytree"); tree.place = uri; these two examples use the built-in tree view, but the point is to demonstrate the use of the place attribute and property. in this regard the built-in menu and toolbar views are no different. when a view's underlying data changes, the view will automatically update itself so that it displays the new data. this update is handled by logic between the view and its results. all places views implement or own an instance of interface nsinavhistoryresultviewer, which is the point of interaction between a view and its results. results themselves observe places changes, and if on a places change a result determines that its data specifically has changed, it notifies...
...of its own, the built-in places tree view's view. this view is an object that implements three interfaces: from most specific to most general, nsinavhistoryresulttreeviewer, nsinavhistoryresultobserver , and nsitreeview. nsinavhistoryresulttreeviewer maps between row indices and the nsinavhistoryresultnode objects contained in the rows. nsinavhistoryresultobserver notifies observing clients about updates when the underlying data changes. it's not so useful for our purposes here. nsitreeview provides a high-level interface for trees in general. finally, the built-in tree view implements several convenience methods and properties of its own. you therefore have four points of interaction with the built-in places tree view: the convenience methods and properties implemented directly on the view...
...f nsinavhistoryresultobserver. if your view implements nsinavhistoryresultobserver, then you can pass your viewer object. if your view contains an internal instance of nsinavhistoryresultobserver, you would pass it instead. (the three built-in views take this approach.) the results object then communicates to your view via this instance, notifying it about changes in the underlying data so it can update its display. var bmserv = components.classes["@mozilla.org/browser/nav-bookmarks-service;1"]. getservice(components.interfaces.nsinavbookmarksservice); var histserv = components.classes["@mozilla.org/browser/nav-history-service;1"]. getservice(components.interfaces.nsinavhistoryservice); var opts = histserv.getnewqueryoptions(); var query = histserv.getnewquery(); query.setfolders([...
Performance best practices for Firefox front-end engineers
for example, change dom node attributes (either directly or by adding or removing classes from elements), and can also add, remove, or delete dom nodes. because styles are normally scoped to the entire document, the cost of doing these style calculations is proportional to the number of dom nodes in the document (and the number of styles being applied). it is expected that over time, script will update the dom, requiring us to recalculate styles. normally, the changes to the dom just result in the standard style calculation occurring immediately after the javascript has finished running during the 16ms window, inside the "style" step. that's the ideal scenario. however, it's possible for script to do things that force multiple style calculations (or style flushes) to occur synchronously during...
...s. the first time a document (xul or html) loads, we parse the markup, and then apply styles. once the styles have been calculated, we then need to calculate where things are going to be placed on the page. this layout step can be seen in the “16ms” pipeline graphic above, and occurs just before we paint things to be composited for the user to see. it is expected that over time, script will update the dom, requiring us to recalculate styles, and then update layout. normally, however, the changes to the dom just result in the standard style calculation that occurs immediately after the javascript has finished running during the 16ms window. interruptible reflow since the early days, gecko has had the notion of interruptible reflow. this is a special type of content-only reflow that checks...
...use uninterruptible layout has the potential to be much worse (see next section). to repeat, only interruptible reflows in web content can be interrupted. uninterruptible reflow uninterruptible reflow is what we want to avoid at all costs. uninterruptible reflow occurs when some dom node’s styles have changed such that the size or position of one or more nodes in the document will need to be updated, and then javascript asks for the size or position of anything. since everything is pending a reflow, the answer isn't available, so everything stalls until the reflow is complete and the script can be given an answer. flushing layout also means that styles must be flushed to calculate the most up-to-date state of things, so it's a double-whammy. here’s a simple example, cribbed from this blo...
DownloadTarget
a downloadtarget object represents the target of a download, for example a file in the global downloads directory, or a file in the system temporary directory. method overview promise refresh() properties attribute type description exists read only boolean indicates whether or not the target file exists. this is a dynamic property, which is updated when the download is completed or when the download.refresh() method is called. you can use this instead of using file system calls to check for the existence of the file in order to reduce io overhead. path read only string the path of the target file. partfilepath read only string the path of the ".part" file containing the data downloaded so far, or null to dis...
... transfer instead. for downloads of multiple files, such as downloading a web page and its required media to disk, the meaning of this property is undefined. it currently indicates the size of the main file (such as the html document) rather than the sum of all of the files' sizes, but you must not rely upon this behavior, as it is subject to change. this is a dynamic property, which is updated when the download finishes or whenever the download.refresh() method is called. you can use this value from the front-end to reduce file i/o that would be required to check the file directly. methods refresh() updates the state of a finished, failed, or canceled download based on the current state as indicated by the file system. if the download is in progress or has been finalized,...
...end to reduce file i/o that would be required to check the file directly. methods refresh() updates the state of a finished, failed, or canceled download based on the current state as indicated by the file system. if the download is in progress or has been finalized, this method does nothing and returns a resolved promise. calling this method lets the download object's properties be updated if the user moves or deletes the target file or its associated ".part" file, which contains a partially-downloaded file's contents. promise refresh(); parameters none. promise resolves to undefined when the state of the download has been updated. promise can be rejected with never. ...
Localization content best practices
er) and just drop the (entity name/key) reference. land good quality strings don't land temporary strings. if you already know that your strings are temporary, they shouldn't be exposed to the localization process. this would waste everybody's time and create unnecessary frustration: localizers have to translate strings that are destined to change, developers will need to use new ids later to update them. if you're reviewing a patch, check also strings for grammar errors, capitalization or inconsistencies. for example, use the single unicode …, and not three dots. if you have any doubts about the quality of strings, ask a copywriter to do a copy review of this text. ideally, all strings landing in code should originate from approved ux wireframes, any copy review should be part of the ini...
...ization files (.dtd, .properties). one possible way to test a patch for localizability issues is to alter the en-us localization files, adding extraneous characters to the original strings: this can help to identify both hard-coded strings and "flexibility issues" in the ui. changing existing strings updating entity names if you are changing a string such that its meaning has changed, you must update the entity or property name for the string to match the new meaning. if your changes are relevant only for english — for example, to correct a typographical error or to make letter case consistent — then there is generally no need to update the entity name. changing the string id will invalidate the existing translation, the new string will be reported as missing in all tools, and localizers...
...typographical error or to make letter case consistent — then there is generally no need to update the entity name. changing the string id will invalidate the existing translation, the new string will be reported as missing in all tools, and localizers will have to retranslate it. given the diversity of tools used by localization teams, this is the only reliable method to ensure that localizers update existing localizations. if you change the entity or property name of a string, you must also update all instances where that entity or property name is used in the source code, including localization comments. if you change the entity or property name of a string, and the string has an accompanying access key, command key, or tooltip, you should update their names as well for consistency. this ...
Localizing with Mozilla Translator
s and translation memory to leverage your work from previous translations, thus cutting time and effort when localizing new versions of mozilla applications. getting started with mozillatranslator mt uses products as groups of localization files with a common root directory (for instance, you may have a product for thunderbird, other for seamonkey, other for dom, other for toolkit, etc.) you update your repository copy using your favorite repository tool, and then update the product(s) in mt. this will remove obsolete strings and files from the internal database of mt, and will present you with a list of new and updated strings. if you are starting a new localization, all strings will be marked as new or updated.mt puts a fuzzy flag on each flag and saves it in its database. all this means...
...tform can't be part of a partial glossary (because they are not components), and platform neutral itself can't be selected either, since it is not a component, but a platform. for these few files, you will have to export them individually and reimport them. if you are a ''not so good'' mt user, however, you can just create a new product (or several ones; see next recipe to know why), run file -> update on them (you'll get a list of all the strings) and then run edit -> autotranslate. most of the strings will be automatically filled, although if you do this you should review them, because for en-us strings with several possible translations, mt will choose one of them, which could not be the one you want. from cvs to mercurial in mt so, you have a firefox product in mt with a platform neutra...
...ld be able to adjust your current mt product paths so you can keep using it just like with cvs. keep in mind that mt doesn't really know if you are using cvs, svn, or mercurial. it is just instructed to read directory subtrees and ignore "cvs" and ".svn" directories it finds. if you have opted for the first solution, you will find yourself with some new products completely untranslated (once you update each of them). to migrate the existing translation in the old product, you need to export partial glossaries from the old product, selecting the ''link'' origin (see the previous section) and importing them into the ''link'' target. defining symbolic links for browser this is an example just for browser, without shared components, but it should suffice to get the idea. ; assuming we are in...
SVN for Localizers
ewvc interface. after you commit your changes, wait 15 minutes and check the staging website for your locale. your recent changes should now be visible online. you will have the chance to see how the localized website will look when it's pushed to prod (i.e., a website that regular visitors will see). when localizing websites, l10n-drivers will always add needed files to your repository or update your files with new strings in english. it's very important for you to update your working copy with the newest files from mozilla svn repository before you start making changes. enter the following command from the command-line: svn update your local svn repository (i.e., working directory) will be updated with the newest files from the url you initially cloned your repository from. it's ver...
...y cloned your repository from. it's very important that you do this often. as a general rule, you should at least do it before translating anything. sometimes mistakes happen and you need to start over. go back to the root of your working directory and execute this command: svn revert * this is a really helpful command because it reverts all of your changes to your working directory's last updated state. this is a huge blessing if you have been updating frequently. it's a nightmare if you haven't because it throws away all of your recent hard work. keep this in mind because if you did a lot of work and you made some errors in just one file, maybe it would be wiser to simply correct those errors instead of reverting your working directory and losing all your work. note: sometimes you'll ...
...mare if you haven't because it throws away all of your recent hard work. keep this in mind because if you did a lot of work and you made some errors in just one file, maybe it would be wiser to simply correct those errors instead of reverting your working directory and losing all your work. note: sometimes you'll find references to commands in abbreviated form (svn ci = svn commit, svn up = svn update, svn co = svn checkout, etc.) commit doesn't work, what's wrong? make you sure you're checking out the repository with https:// make sure you're adding a commit message when running svn commit. commits with an empty message will be rejected. svn accounts are disabled after 6 months of inactivity. to be used again, they need to be reenabled. if you have any doubts, ping l10n-drivers on ir...
Cryptography functions
3.2 and later pk11_isreadonly mxr 3.2 and later pk11_isremovable mxr 3.12 and later pk11_ivfromparam mxr 3.2 and later pk11_keygen mxr 3.2 and later pk11_linkgenericobject mxr 3.9.2 and later pk11_listcerts mxr 3.2 and later. updated 3.8 with new options. see bug 215186 pk11_listfixedkeysinslot mxr 3.4 and later pk11_listprivkeysinslot mxr 3.4 and later pk11_listpublickeysinslot mxr 3.4 and later pk11_loadprivkey mxr 3.4 and later pk11_logoutall mxr 3.4 and later pk11_mak...
... 3.9.3 and later pk11_pubencryptraw mxr 3.2 and later pk11_pubunwrapsymkey mxr 3.2 and later pk11_pubunwrapsymkeywithflags mxr 3.6 and later pk11_pubunwrapsymkeywithflagsperm 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_restorecontext mxr 3.2 and later pk11_savecontext mxr 3.2 and later pk11_savecontextalloc ...
...xr 3.2 and later pk11_traverseslotcerts mxr 3.4 and later pk11_unlinkgenericobject mxr 3.9.2 and later pk11_unwrapsymkey mxr 3.2 and later pk11_unwrapsymkeywithflags mxr 3.2 and later pk11_unwrapsymkeywithflagsperm mxr 3.9 and later pk11_updateslotattribute mxr 3.8 and later pk11_userenableslot mxr 3.8 and later pk11_userdisableslot mxr 3.8 and later pk11_verify mxr 3.2 and later pk11_verifykeyok mxr 3.2 and later pk11_waitfortokenevent mxr 3.7 and later pk11_wrapsymkey ...
NSS 3.14 release notes
tsrtpcipher (in ssl.h) ssl_setrtpciphers (in ssl.h) support for aes-gcm support for aes-gcm has been added to the nss pkcs #11 module (softoken), based upon the draft 7 of pkcs #11 v2.30. warning: because of ambiguity in the current draft text, applications should only use gcm in single-part mode (c_encrypt/c_decrypt). they should not use multi-part apis (c_encryptupdate/c_decryptupdate). support for application-defined certificate chain validation callback when using libpkix to better support per-application security policies, a new callback has been added for applications that use libpkix to verify certificates. applications may use this callback to inform libpkix whether or not candidate certificate chains meet application-specific securit...
...these changes have the observed...
...these changes have the observed effect of doubl...
NSS 3.15 release notes
ent and server sockets. tls client applications may enable this via a call to ssl_optionsetdefault(ssl_enable_ocsp_stapling, pr_true); added function secitem_reallocitemv2. it replaces function secitem_reallocitem, which is now declared as obsolete. support for single-operation (eg: not multi-part) symmetric key encryption and decryption, via pk11_encrypt and pk11_decrypt. certutil has been updated to support creating name constraints extensions. new functions in ssl.h ssl_peerstapledocspresponse - returns the server's stapled ocsp response, when used with a tls client socket that negotiated the status_request extension. ssl_setstapledocspresponses - set's a stapled ocsp response for a tls server socket to return when clients send the status_request extension. ...
...ameconstraintsextension, added in nss 3.10. in secitem.h secitem_allocarray secitem_duparray secitem_freearray secitem_zfreearray - utility functions to handle the allocation and deallocation of secitemarrays secitem_reallocitemv2 - replaces secitem_reallocitem, which is now obsolete. secitem_reallocitemv2 better matches caller expectations, in that it updates item->len on allocation. for more details of the issues with secitem_reallocitem, see bug 298649 and bug 298938. in pk11pub.h pk11_decrypt - performs decryption as a single pkcs#11 operation (eg: not multi-part). this is necessary for aes-gcm. pk11_encrypt - performs encryption as a single pkcs#11 operation (eg: not multi-part). this is necessary for aes-gcm. ...
... ssl_enable_ocsp_stapling - used with ssl_optionset to configure tls client sockets to request the certificate_status extension (eg: ocsp stapling) when set to pr_true notable changes in nss 3.15 secitem_reallocitem is now deprecated. please consider using secitem_reallocitemv2 in all future code. nss has migrated from cvs to the mercurial source control management system. updated build instructions are available at migration to hg as part of this migration, the source code directory layout has been re-organized. the list of root ca certificates in the nssckbi module has been updated. the default implementation of ssl_authcertificate has been updated to add certificate status responses stapled by the tls server to the ocsp cache. applications t...
NSS 3.18.1 release notes
ow. distribution information the hg tag is nss_3_18_1_rtm. nss 3.18.1 requires nspr 4.10.8 or newer. nss 3.18.1 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_18_1_rtm/src/ new in nss 3.18.1 no new functionality is introduced in this release. this is a patch release to update the list of root ca certificates. notable changes in nss 3.18.1 the following ca certificate had the websites and code signing trust bits restored to their original state to allow more time to develop a better transition strategy for affected sites. the websites and code signing trust bits were turned off in nss 3.18. but when firefox 38 went into beta, there was a huge spike in the number of...
...bsites and code signing trust bits restored to their original state to allow more time to develop a better transition strategy for affected sites. the websites and code signing trust bits were turned off in nss 3.18. but when firefox 38 went into beta, there was a huge spike in the number of certificate verification errors attributed to this change. so, to give website administrators more time to update their web servers, we reverted the trust bits back to being enabled. ou = equifax secure certificate authority sha1 fingerprint: d2:32:09:ad:23:d3:14:23:21:74:e4:0d:7f:9d:62:13:97:86:63:3a the following ca certificate was removed after discussion about it in the mozilla.dev.security.policy forum. cn = e-guven kok elektronik sertifika hizmet saglayicisi ...
...:5e:84:b3:80:7e:4b:b1:fd:99:41:34 the following intermediate ca certificate has been added as actively distrusted because it was misused to issue certificates for domain names the holder did not own or control. cn=mcsholding test, o=mcsholding, c=eg sha1 fingerprint: e1:f3:59:1e:76:98:65:c4:e4:47:ac:c3:7e:af:c9:e2:bf:e4:c5:76 the version number of the updated root ca list has been set to 2.4 bugs fixed in nss 3.18.1 this bugzilla query returns all the bugs fixed in nss 3.18.1: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.18.1 compatibility nss 3.18.1 shared libraries are backward compatible with all older nss 3.18 shared libraries. a program linked with ...
NSS 3.48 release notes
517d1f6732a2d5ab97c533ec70779ee3270a62fb4ac4238372460e6f01e88 upcoming changes in nss 3.49 the legacy dbm database, libnssdbm, will no longer be built by default. see bug 1594933 for details. ...
... bug 1591178 - add entrust root certification authority - g4 certificate to nss bug 1590001 - prevent negotiation of versions lower than 1.3 after helloretryrequest bug 1596450 - added a simplified and unified mac implementation for hmac and cmac behind pkcs#11 bug 1522203 - remove an old pentium pro performance workaround bug 1592557 - fix prng known-answer-test scripts bug 1586176 - encryptupdate should use maxout not block size (cve-2019-11745) bug 1593141 - add `notbefore` or similar "beginning-of-validity-period" parameter to mozilla::pkix::trustdomain::checkrevocation bug 1591363 - fix a pbkdf2 memory leak in nsc_generatekey if key length > max_key_len (256) bug 1592869 - use arm neon for ctr_xor bug 1566131 - ensure sha-1 fallback disabled in tls 1.2 bug 1577803 - mark pkcs#11 t...
...led in tls 1.2 bug 1577803 - mark pkcs#11 token as friendly if it implements ckp_public_certificates_token bug 1566126 - power ghash vector acceleration bug 1589073 - use of new pr_assert_arg in certdb.c bug 1590495 - fix a crash in pk11_makecertfromhandle bug 1591742 - ensure des iv length is valid before usage from pkcs#11 bug 1588567 - enable mozilla::pkix gtests in nss ci bug 1591315 - update nsc_decrypt length in constant time bug 1562671 - increase nss mp kdf default iteration count, by default for modern key4 storage, optionally for legacy key3.db storage bug 1590972 - use -std=c99 rather than -std=gnu99 bug 1590676 - fix build if arm doesn't support neon bug 1575411 - enable tls extended master secret by default bug 1590970 - ssl_settimefunc has incomplete coverage bug 15906...
NSS 3.50 release notes
istribution information the hg tag is nss_3_50_rtm. nss 3.50 requires nspr 4.25 or newer. nss 3.50 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_50_rtm/src/ other releases are available in nss releases. notable changes in nss 3.50 verified primitives from hacl* were updated, bringing performance improvements for several platforms. note that intel processors with sse4 but without avx are currently unable to use the improved chacha20/poly1305 due to a build issue; such platforms will fall-back to less optimized algorithms. see bug 1609569 for details. updated dtls 1.3 implementation to draft-30. see bug 1599514 for details. added nist sp800-108 kbkdf - p...
...ith sse4 but without avx are currently unable to use the improved chacha20/poly1305 due to a build issue; such platforms will fall-back to less optimized algorithms. see bug 1609569 for details. updated dtls 1.3 implementation to draft-30. see bug 1599514 for details. added nist sp800-108 kbkdf - pkcs#11 implementation. see bug 1599603 for details. bugs fixed in nss 3.50 bug 1599514 - update dtls 1.3 implementation to draft-30 bug 1603438 - fix native tools build failure due to lack of zlib include dir if external bug 1599603 - nist sp800-108 kbkdf - pkcs#11 implementation bug 1606992 - cache the most recent pbkdf1 password hash, to speed up repeated sdr operations, important with the increased kdf iteration counts. nss 3.49.1 sped up pbkdf2 operations, though pbkdf1 operations ar...
...f chacha20, poly1305, and 64-bit curve25519 bug 1608327 - two problems with neon-specific code in freebl bug 1575843 - detect aarch64 cpu features on freebsd bug 1607099 - remove the buildbot configuration bug 1585429 - add more hkdf test vectors bug 1573911 - add more rsa test vectors bug 1605314 - compare all 8 bytes of an mp_digit when clamping in windows assembly/mp_comba bug 1604596 - update wycheproof vectors and add support for cbc, p256-ecdh, and cmac tests bug 1608493 - use aes-ni for non-gcm aes ciphers on platforms with no assembly-optimized implementation, such as macos. bug 1547639 - update zlib in nss to 1.2.11 bug 1609181 - detect arm (32-bit) cpu features on freebsd bug 1602386 - fix build on freebsd/powerpc* bug 1608151 - introduce nss_disable_altivec bug 1612623 - ...
NSS 3.55 release notes
with verifiable implementations from fiat-crypto and ecckiila. special thanks to the network and information security group (nisec) at tampere university. pk11_findcertinslot is added. with this function, a given slot can be queried with a der-encoded certificate, providing performance and usability improvements over other mechanisms. see bug 1649633 for more details. dtls 1.3 implementation is updated to draft-38. see bug 1647752 for details. nspr dependency updated to 4.27. known issues on some platforms, using the makefile builds fails to locate seccomon.h; ensure you are using make all rather than just make. another potential workaround is to use the gyp-based build.sh script. if this affects you, please help us narrow down the cause in bug 1653975. bugs fixed in nss 3.55 bug 1...
...ero bytes (sanitizer fix). bug 1649322 - don't memcpy zero bytes (sanitizer fix). bug 1653202 - fix initialization bug in blapitest when compiled with nss_disable_deprecated_seed. bug 1646594 - fix avx2 detection in makefile builds. bug 1649633 - add pk11_findcertinslot to search a given slot for a der-encoded certificate. bug 1651520 - fix slotlock race in nsc_gettokeninfo. bug 1647752 - update dtls 1.3 implementation to draft-38. bug 1649190 - run cipher, sdr, and ocsp tests under standard test cycle in ci. bug 1649226 - add wycheproof ecdsa tests. bug 1637222 - consistently enforce iv requirements for des and 3des. bug 1067214 - enforce minimum pkcs#1 v1.5 padding length in rsa_checksignrecover. bug 1643528 - fix compilation error with -werror=strict-prototypes. bug 164632...
...t cycle in ci. bug 1649226 - add wycheproof ecdsa tests. bug 1637222 - consistently enforce iv requirements for des and 3des. bug 1067214 - enforce minimum pkcs#1 v1.5 padding length in rsa_checksignrecover. bug 1643528 - fix compilation error with -werror=strict-prototypes. bug 1646324 - advertise pkcs#1 schemes for certificates in the signature_algorithms extension. bug 1652331 - update nss 3.55 nspr version to 4.27. this bugzilla query returns all the bugs fixed in nss 3.55: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.55 compatibility nss 3.55 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will ...
NSS API Guidelines
publickey() parameter ordering most functions will have a 'natural' ordering for parameters. to keep consistency we should have some minimal parameter consistency. for most functions, they can be seen as operating on a particular object. this object, that the function is operating on, should come first. for instance, in most ssl functions this is the nspr socket, or the ssl socket structure: update, final, encrypt, decrypt type functions operating on their state contexts, etc. all encrypt and decrypt functions, which return data inline, should have a consistent signature: secstatus my_functionname(mycontext *context, unsigned char *outbuf, secbufferlen *outlen, secbufferlenmaxoutlength, unsigned char...
... secbufferlen *outlen, secbufferlenmaxoutlength, unsigned char *inbuf, secbufferleninlen) encrypt and decrypt like functions which have different properties, additional parameters, callbacks, etc., should insert their additional parameters between the context (first parameter) and the output buffer. ...
... secbufferlen *outlen, secbufferlenmaxoutlength, unsigned char *inbuf, secbufferleninlen) encrypt and decrypt like functions which have different properties, additional parameters, callbacks, etc., should insert their additional parameters between the context (first parameter) and the output buffer. ...
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
_with_rsa_encryption, pk); if (!sgn) { pr_fprintf(pr_stderr, "unable to create context for signing\n"); rv = secfailure; goto cleanup; } rv = sgn_begin(sgn); if (rv != secsuccess) { pr_fprintf(pr_stderr, "problem while sgn_begin\n"); goto cleanup; } while ((nb = pr_read(infile, ibuf, sizeof(ibuf))) > 0) { rv = sgn_update(sgn, ibuf, nb); if (rv != secsuccess) { pr_fprintf(pr_stderr, "problem while sgn_update\n"); goto cleanup; } } rv = sgn_end(sgn, res); if (rv != secsuccess) { pr_fprintf(pr_stderr, "problem while sgn_end\n"); goto cleanup; } cleanup: if (infile) { pr_close(infile); } if (sgn) { sgn_...
... pwdata); if (!vfy) { pr_fprintf(pr_stderr, "unable to create context for verifying signature\n"); rv = secfailure; goto cleanup; } rv = vfy_begin(vfy); if (rv != secsuccess) { pr_fprintf(pr_stderr, "problem while vfy_begin\n"); goto cleanup; } while ((nb = pr_read(infile, ibuf, sizeof(ibuf))) > 0) { rv = vfy_update(vfy, ibuf, nb); if (rv != secsuccess) { pr_fprintf(pr_stderr, "problem while vfy_update\n"); goto cleanup; } } rv = vfy_end(vfy); if (rv != secsuccess) { pr_fprintf(pr_stderr, "problem while vfy_end\n"); goto cleanup; } cleanup: if (infile) { pr_close(infile); } if (vfy) { vfy_destr...
...aparams; void *params; seckeyprivatekey *privkey = null; secstatus rv; unsigned char randbuf[blocksize + 1]; rv = generaterandom(randbuf, blocksize); if (rv != secsuccess) { fprintf(stderr, "error while generating the random numbers : %s\n", port_errortostring(rv)); goto cleanup; } pk11_randomupdate(randbuf, blocksize); switch (keytype) { case rsakey: rsaparams.keysizeinbits = size; rsaparams.pe = publicexponent; mechanism = ckm_rsa_pkcs_key_pair_gen; algtag = sec_oid_pkcs1_md5_with_rsa_encryption; params = &rsaparams; break; default:...
sample2
goto cleanup; } /* sign using private key */ sgn = sgn_newcontext(sec_oid_pkcs1_md5_with_rsa_encryption, pk); if (!sgn) { pr_fprintf(pr_stderr, "unable to create context for signing\n"); rv = secfailure; goto cleanup; } rv = sgn_begin(sgn); if (rv != secsuccess) { pr_fprintf(pr_stderr, "problem while sgn_begin\n"); goto cleanup; } while ((nb = pr_read(infile, ibuf, sizeof(ibuf))) > 0) { rv = sgn_update(sgn, ibuf, nb); if (rv != secsuccess) { pr_fprintf(pr_stderr, "problem while sgn_update\n"); goto cleanup; } } rv = sgn_end(sgn, res); if (rv != secsuccess) { pr_fprintf(pr_stderr, "problem while sgn_end\n"); goto cleanup; } cleanup: if (infile) { pr_close(infile); } if (sgn) { sgn_destroycontext(sgn, pr_true); } return rv; } /* * verify the signature using public key */ secstatus verifydata(cons...
...to cleanup; } vfy = vfy_createcontext(pk, sigitem, sec_oid_pkcs1_md5_with_rsa_encryption, pwdata); if (!vfy) { pr_fprintf(pr_stderr, "unable to create context for verifying signature\n"); rv = secfailure; goto cleanup; } rv = vfy_begin(vfy); if (rv != secsuccess) { pr_fprintf(pr_stderr, "problem while vfy_begin\n"); goto cleanup; } while ((nb = pr_read(infile, ibuf, sizeof(ibuf))) > 0) { rv = vfy_update(vfy, ibuf, nb); if (rv != secsuccess) { pr_fprintf(pr_stderr, "problem while vfy_update\n"); goto cleanup; } } rv = vfy_end(vfy); if (rv != secsuccess) { pr_fprintf(pr_stderr, "problem while vfy_end\n"); goto cleanup; } cleanup: if (infile) { pr_close(infile); } if (vfy) { vfy_destroycontext(vfy, pr_true); } return rv; } /* * write cryptographic parameters to header file */ secstatus writetoheade...
...this may take a few moments...\n\n"); privkey = pk11_generatekeypair(slot, mechanism,...
Notes on TLS - SSL 3.0 Intolerant Servers
ased browsers. see bug 59321. servers currently known to exhibit this intolerant behavior as of this writing, this problem has been reported for the following servers: (wherever there is an upgraded version which fixes the problem, it is indicated by an asterisked remark in the parentheses. ) domino-go-webserver/4.6.2.6 (and perhaps some later versions) ibm_http_server/1.3.6.3 or earlier (* update to 1.3.6.4) ibm_http_server/1.3.12.1 or earlier (* update to 1.3.12.2) java web server 2 osu/3.2 - decthreads http server for openvm stronghold/2.2 webmail v. 3.6.1 by infinite technologies (* update available) n.b. there might be servers other than those listed above which exhibit this problem. if you find such a server, feel free to add it to this page. for up-to-date information, you ca...
... free to add it to this page. for up-to-date information, you can read this bug 59321 which keeps a list of tls/ssl 3.0 intolerant servers. users: how to avoid this problem? netscape 6.1 preview release 1, or mozilla 0.9.1 and earlier these versions shipped with the tls option turned on as the default but with no way to deal with the problem servers. if you are using these old versions, please update to the latest netscape or mozilla versions. you can also avoid such a problem by editing an existing profile -- check the preference option setting at: edit | preferences | privacy and security | ssl | enable tls, and turn it off if it is on for these earlier browsers. netscape 6.1 or mozilla 0.9.2 and later these browsers shipped with the tls option on but also included a graceful rollback mec...
...der ssl certificate information. for instance, to check https://bugzilla.mozilla.org/, then visit http://toolbar.netcraft.com/site_rep...a.mozilla.org/. add the information on such a server (software, url) to bug 59321 at bugzilla. (note: you will be asked to provide your email address before you can file a bug at bugzilla.) original document information author : katsuhiko momoi last updated date: january 27th, 2003 copyright © 2001-2003 netscape. all rights reserved. ...
Python binding for NSS
n they are loaded, but earlier code failed to to that. it's is not likely that an previous code was failing to pass initialization data or the der_is_signed flag so this change should be backwards compatible. fix bug #922247, pkcs12decoder.database_import() method. importing into a nss database would sometimes fail or segfault. error codes and descriptions were updated from upstream nspr & nss. the password callback did not allow for breaking out of a password prompting loop, now if none is returned from the password callback the password prompting is terminated. nss.nss_shutdown_context now called from initcontext destructor, this assures the context is shutdown even if the programmer forgot to. it's still best to explicitl...
...cess. add prnetaddr_port() utility to hide host vs. network byte order requirements when accessing the port inside a prnetaddr and simplify accessing the ipv4 vs. ipv6 port variants. replace the use of pr_initializenetaddr() with pr_setnetaddr(), the later properly handles ipv6, the former did not. rename networkaddress.addr to networkaddress.pr_netaddr for naming consistency. ...
... replace incorrect use of free() with pymem_free for string data returned by python's utf-8 encoder. add header dependency information to setup.py so modules will be rebuilt when header files change. add utility tuple_str() to convert a tuple to a string representation by calling str() on each object in the tuple. ...
S/MIME functions
nss_cmscontentinfo_setcontent_envelopeddata mxr 3.2 and later nss_cmscontentinfo_setcontent_signeddata mxr 3.2 and later nss_cmsdecoder_cancel mxr 3.2 and later nss_cmsdecoder_finish mxr 3.2 and later nss_cmsdecoder_start mxr 3.2 and later nss_cmsdecoder_update mxr 3.2 and later nss_cmsdigestcontext_cancel mxr 3.2 and later nss_cmsdigestcontext_finishmultiple mxr 3.2 and later nss_cmsdigestcontext_finishsingle mxr 3.2 and later nss_cmsdigestcontext_startmultiple mxr 3.2 and later nss_cmsdigestcontext_startsingle ...
...ext_cancel mxr 3.2 and later nss_cmsdigestcontext_finishmultiple mxr 3.2 and later nss_cmsdigestcontext_finishsingle mxr 3.2 and later nss_cmsdigestcontext_startmultiple mxr 3.2 and later nss_cmsdigestcontext_startsingle mxr 3.2 and later nss_cmsdigestcontext_update mxr 3.2 and later nss_cmsdigesteddata_create mxr 3.2 and later nss_cmsdigesteddata_destroy mxr 3.2 and later nss_cmsdigesteddata_getcontentinfo mxr 3.2 and later nss_cmsderencode mxr 3.2 and later nss_cmsencoder_cancel mxr 3.2 and later ...
...r 3.2 and later nss_cmsdigesteddata_getcontentinfo mxr 3.2 and later nss_cmsderencode mxr 3.2 and later nss_cmsencoder_cancel mxr 3.2 and later nss_cmsencoder_finish mxr 3.2 and later nss_cmsencoder_start mxr 3.2 and later nss_cmsencoder_update mxr 3.2 and later nss_cmsencrypteddata_create mxr 3.2 and later nss_cmsencrypteddata_destroy mxr 3.2 and later nss_cmsencrypteddata_getcontentinfo mxr 3.2 and later nss_cmsenvelopeddata_addrecipient mxr 3.2 and later nss_cmsenvelopeddata_create mxr ...
Rhino Debugger
r whenever the execution is about to return from a function or script. moving up and down the stack the lower-left (dockable) pane in the debugger main window contains a combo-box labeled "context:" which displays the current stack of the executing script. you may move up and down the stack by selecting an entry in the combo-box. when you select a stack frame the variables and watch windows are updated to reflect the names and values of the variables visible at that scope. setting and clearing breakpoints the main desktop of the debugger contains file windows which display the contents of each script you are debugging. you may set a breakpoint in a script by doing one of the following: place the cursor on the line at which you want to set a breakpoint and right-click with the mouse. this...
...ontains a tab-pane with two tabs, labeled "this" and "locals". each pane contains a tree-table which displays the properties of the current object and currently visible local variables, respectively. this the properties of the current object are displayed in the this table. if a property is itself a javascript object the property may be expanded to show its sub-properties. ...
...the property may be expanded to show its sub-properties. the this table is updated each time control returns to the debugger or when you change the stack location in the context: window. locals the local variables of the current function are displayed in the locals table. if a variable is itself a javascript object the variable may be expanded to show its sub-properties. the locals table is updated each time control returns to the debugger or when you change the stack location in the context: window watch window you may enter arbitrary javascript expressions in the watch: table located in the lower-right (dockable) pane in the debugger main window. the expressions you enter are re-evaluated in the current scope and their current values displayed each time control returns to the debugge...
SpiderMonkey 1.8.5
easy to detect and updating the code is a fairly straightforward job. here is a list of the most significant changes. previous versions of spidermonkey supported two types of native functions: jsnative and jsfastnative. all support for the slow native function type has been removed, and the fast signature has been renamed to jsnative. embeddings that defined jsnatives in previous versions must update all those functions to the new signature. getters and setters of type jspropertyop took an id parameter of type jsval. the type of the parameter has been changed to jsid. many getters and setters simply ignore the id anyway; if the value is needed, use js_idtovalue. the type of setters has changed from jspropertyop to jsstrictpropertyop (to accomodate es5 strict mode). to migrate, simply add a ...
...ely interchange jsid and jsval. they are no longer compatible; using js_valuetoid and js_idtovalue to convert between the two is mandatory. jsnative, jsfastnative previous versions of jsapi supported two types of native functions -- jsnative and jsfastnative. the so-called "slow natives" are no longer supported; as such jsfastnative has been renamed to jsnative and relevant interfaces have been updated accordingly. embedders converting functions from old-jsnative to new-jsnative (jsfastnative) should study the jsfastnative documentation thoroughly, and pay particular that they do not reference negative indices of argv in spidermonkey 1.8.5; the js_callee, js_this, etc. macros must be used instead. see bug 581263. global objects global objects have been specialized, and must be be created with ...
...ncodestringtobuffer (not an exhaustive list). numbers spidermonkey 1.8.5 now stores integers up to 32-bits in the jsval. this means that the int_fits_in_jsval macro is always returns true (be careful to only use this macro with jsints, not 64-bit integers). the jsval now also stores jsdoubles directly, rather than storing them on the heap. the jsval_to_double and double_to_jsval macros have been updated to work directly on jsdoubles rather than their pointers, and the js_newdoublevalue and js_newdouble interfaces have been removed. javascript shell changes there are many new built-in functions in the javascript shell, mostly useful for testing spidermonkey. the scatter function has been removed, and a shell worker class (similar to html dom workers) has been added. known issues mac os x 10.5 (l...
Web Replay
devtools' debugger and console can be used to inspect and control the replay. ...
...eplaying process extensions during initialization the child process spawns a thread that does not participate in the recording — any ipc or other system calls it performs are live, even when replaying. this thread sends and receives messages from the middleman. messages describe actions the child process is able to do independently from the recording; currently this includes sending graphics updates, taking and restoring process snapshots, and responding to debugger requests. rewinding infrastructure a child process can be rewound to an earlier state in response to a message from the middleman. after a recording process rewinds, it becomes a replaying process. rewinding happens by periodically taking memory snapshots during execution, and then later restoring them. care must be taken f...
...here are the main differences: explicit commands must be sent to the debugger to control execution. the replayresumebackward() and replayresumeforward() members may be called to resume execution, and the replaypause() member may be called to pause execution at the next opportunity. a child process can only pause at breakpoints and at snapshot points (currently these only happen when graphics updates are performed, at which point there is no js on the stack). there is a new onpopframe handler, which is needed when doing reverse-step-in operations. operations on the debuggee which require interaction with the system will fail. these operations may be property accesses, evals, or object calls, and an example is accessing the font property of a canvasrenderingcontext2d. failed operations cu...
Mozilla Projects
umber of functions and capabilities, including: mccoy mccoy uses xulrunner which is bound to break, for details see this post. mozilla calls mccoy a "simple system" which is a clear sign that something probably is not working, and indeed, is not. ...
...mccoy mccoy uses xulrunner which is bound to break, for details see this post. mozilla calls mccoy a "simple system" which is a clear sign that something probably is not working, and indeed, is not. mccoy is an application that allows add-on authors to provide secure updates to their users. applications periodically look for and install updates to their add-ons. it's important that the update information retrieved has not been tampered with since being written by the add-on author. specifically, it focuses on the process of digitally signing update manifests so the applications can verify the integrity of a manifest retrieved over normally insecure channels. midas m...
...or sync (which is a misnomer, since it doesn't do any profiling), and it should not be confused with the similarly named tests in talos. web replay web replay allows firefox content processes to record their behavior, replay it later, and rewind to earlier states. replaying processes preserve all the same js behavior, dom structures, graphical updates, and most other behaviors that occurred while recording. webreplayroadmap this document describes existing, planned, and potential features for the firefox developer tools that are based on web replay, along with their ui. the low level, yet flexible architecture (described here) provides an extremely powerful platform for implemen...
Manipulating bookmarks using Places
renced by the id newbkmkid. the item uri similarly, you can obtain the uri corresponding to a given bookmark item by calling the nsinavbookmarksservice.getbookmarkuri() method. var thisuri = bmsvc.getbookmarkuri(newbkmkid); assuming you've run all the code samples previous to this one, this will output "http://google.com". you can use the nsinavbookmarksservice.changebookmarkuri() method to update the uri for a given bookmark item: var uri = ios.newuri("http://mozilla.com/", null, null); bmsvc.changebookmarkuri(newbkmkid, uri); this example changes the bookmark to refer to the mozilla web site instead of google. note: all annotations, tags, and so forth are kept when the bookmark's uri is changed. checking to see if a uri is bookmarked if you want to see if a given uri is already boo...
... set up an observer to listen for changes related to bookmarks, you will need to create an nsinavbookmarkobserver object and use the nsinavbookmarksservice.addobserver() and nsinavbookmarksservice.removeobserver() methods. note that this example takes advantage of xpcomutils to generate the nsisupports.queryinterface() method. ...
...hanges related to bookmarks, you will need to create an nsinavbookmarkobserver object and use the nsinavbookmarksservice.addobserver() and nsinavbookmarksservice.removeobserver() methods. note that this example takes advantage of xpcomutils to generate the nsisupports.queryinterface() method. ...
Observer Notifications
nsiappwindow called just after a xul window is made visible. browsing-context-discarded browsingcontext called while a browsingcontext is being discarded. by this point, the browsingcontext will have been detached from its browsingcontextgroup and parent windowcontext, and removed from any browsingcontext tree it was a part of. this is sent before browsingcontext::closed() is updated. window-global-created windowglobalparent called just after a windowglobalparent is initialized. a windowglobal actor has a lifetime matching that of an nsglobalwindowinner. window-global-destroyed windowglobalparent called just before a windowglobalparent is destroyed. by this point, the wgp being destroyed will have cleaned up most of its state, including its brow...
...e login manager's database. passwordmgr-storage-changed hostsavingenabled host saving has been enabled. passwordmgr-storage-changed hostsavingdisabled host saving has been disabled. places this topic indicates when actions related to places (the history and bookmarks database) occur. topic data description places-autocomplete-feedback-updated sent when places updates the location bar's autocompletion display. places-connection-closed sent after places has closed its database connection. once this has been sent, no places features will work. places-connection-closing sent as the last notification before the places service closes its database connection. warning: this is for internal use...
...en the user requests to preview a lightweight theme, but before existing windows are styled with the new theme. lightweight-theme-change-requested json sent to indicate that the user has chosen a new theme in the add-ons manager, but before the change takes effect. lightweight-theme-changed - sent after the current theme is changed. lightweight-theme-styling-update json sent when the current theme being used is changed; this is sent even when the user is previewing a theme, not just when the theme is actually selected. lightweight-theme-list-changed - the list of available lightweight themes has changed. developer tools these topics let you know about things that have happened related to firefox's built-in developer tools. ...
amIInstallTrigger
constant value description skin 1 locale 2 content 4 package 7 methods enabled() tests if installation is enabled.
....3 / seamonkey 2.1) method overview boolean enabled(); boolean install(in nsivariant aargs, [optional] in amiinstallcallback acallback); boolean installchrome(in pruint32 atype, in astring aurl, in astring askin); deprecated since gecko 2.0 boolean startsoftwareupdate(in astring aurl, [optional] in print32 aflags); deprecated since gecko 2.0 boolean updateenabled(); deprecated since gecko 2.0 constants retained for backwards compatibility. constant value description skin 1 locale 2 content 4 package 7 methods enabled() tests if installation is enabled. boolean enabled(); parameters none. return value install() starts a new installation of a...
...ng a new add-on. this method is deprecated, please use install() in the future. boolean installchrome( in pruint32 atype, in astring aurl, in astring askin ); parameters atype unused, retained for backwards compatibility. aurl the url of the add-on. askin unused, retained for backwards compatibility. return value true if the installation was successfully started. startsoftwareupdate starts installing a new add-on. boolean startsoftwareupdate( in astring aurl, in print32 aflags optional ); parameters aurl the url of the add-on. aflags optional unused, retained for backwards compatibility. return value true if the installation was successfully started. updateenabled tests if installation is enabled. boolean updateenabled(); parameters none. return value...
mozIVisitInfoCallback
void handleerror( in nsresult aresultcode, in moziplaceinfo aplaceinfo ); parameters aresultcode nsresult indicating the reason why...
...leerror() called when a moziplaceinfo couldn't be processed. void handleerror( in nsresult aresultcode, in moziplaceinfo aplaceinfo ); parameters aresultcode nsresult indicating the reason why the change failed. aplaceinfo the information that was unable to be processed. handleresult() called for each visit added, title change, or guid change when passed to moziasynchistory.updateplaces(). if more than one operation is done for a given visit, this method is only called once (for all changes at once). void handleresult( in moziplaceinfo aplaceinfo ); parameters aplaceinfo the information that was entered into the database. oncomplete() obsolete since gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) called for each visit added...
..., this method is only called once (for all changes at once). void handleresult( in moziplaceinfo aplaceinfo ); parameters aplaceinfo the information that was entered into the database. oncomplete() obsolete since gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) called for each visit added, title change, or guid change when passed to moziasynchistory.updateplaces(). void oncomplete( in nsresult aresultcode, in moziplaceinfo aplaceinfo ); parameters aresultcode nsresult of the change indicating success or failure reason. aplaceinfo the information that was being entered into the database. notes this method was replaced by the separate handleresult() and handleerror() methods in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonk...
nsIAutoCompleteObserver
toolkit/components/autocomplete/public/nsiautocompletesearch.idlscriptable please add a summary to this article. ...
...result the search result object. ...
...pdatesearchresult(in nsiautocompletesearch search, in nsiautocompleteresult result); methods onsearchresult() called when a search is complete and the results are ready. void onsearchresult( in nsiautocompletesearch search, in nsiautocompleteresult result ); parameters search the search object that processed this search. result the search result object. onupdatesearchresult() called to update with new results. void onupdatesearchresult( in nsiautocompletesearch search, in nsiautocompleteresult result ); parameters search the search object that processed this search. result the search result object. ...
ExtensionManager (Toolkit)
the extensionmanager follows the nsiextensionmanager api. note: this api is obsolete starting in gecko 2.0, and has been replaced by the new add-on manager. ...
... the extensionmanager follows the nsiextensionmanager api. note: this api is obsolete starting in gecko 2.0, and has been replaced by the new add-on manager. ...
... the extensionmanager follows the nsiextensionmanager api. note: this api is obsolete starting in gecko 2.0, and has been replaced by the new add-on manager. ...
nsIGeolocationProvider
ion has been discovered. 1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) this must be called on the main thread interface provides location information to the nsgeolocator via the nsidomgeolocationcallback interface. after startup() is called, any geo location change should call callback.update(). the nsigeolocationprovider interface provides information about the current users location to interested parties via nsigeolocationupdate. after the provider has been initialized, any changes to location should call callback.onrequest(). you may find the wifi access point monitoring service useful if you wish to implement support for wifi-based location services. see dom/src/geolocation/networ...
...uld call callback.onrequest(). you may find the wifi access point monitoring service useful if you wish to implement support for wifi-based location services. see dom/src/geolocation/networkgeolocationprovider.js for an example of how to write a geolocation provider. method overview boolean isready(); obsolete since gecko 1.9.2 void shutdown(); void startup(); void watch(in nsigeolocationupdate callback); methods isready() obsolete since gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) reports whether or not the device is ready and has a position. boolean isready(); parameters none. return value true if the device is ready and has a position available to return; otherwise false. shutdown() shuts down the location device. void shutdown(); parameters...
...ready and has a position available to return; otherwise false. shutdown() shuts down the location device. void shutdown(); parameters none. startup() start up the provider. this is called before any other method and may be called multiple times. void startup(); parameters none. watch() attaches a callback listener to be notified when a location change is observed. void watch( in nsigeolocationupdate callback ); parameters callback an nsigeolocationupdate to be notified when position changes. your location provider should call this routine whenever new position data is available. see also using geolocation w3c geolocation specification ...
nsILivemarkService
long long createlivemark( in long long folder, in astring name, in nsiuri siteuri, in nsiuri feeduri, in long index ); parameters folder the id of the parent folder. name the name to show when displaying the livemark. siteuri the uri of the site from which the livemark was created. feeduri the uri of the...
... see also places livemark service nsinavbookmarksservice ...
...identifies a folder that isn't a livemark container; also if the siteuri argument isn't a valid nsiuri object (or null) start() this method starts the livemark refresh timer. being able to manually control this allows activity such as bookmarks import to occur without kicking off http traffic. void start(); parameters none. stopupdatelivemarks() stop the livemark refresh timer. void stopupdatelivemarks(); parameters none. see also places livemark service nsinavbookmarksservice ...
nsIMicrosummaryGenerator
ryservice.idlscriptable this interface provides access to a microsummary that has been installed in firefox. 1.0 66 introduced gecko 1.8 obsolete gecko 6.0 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) warning: microsummary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview long calculateupdateinterval(in nsidomnode apagecontent); boolean equals(in nsimicrosummarygenerator aother); astring generatemicrosummary(in nsidomnode apagecontent); attributes attribute type description loaded boolean has the generator itself (which may be a remote resource) been loaded. read only. localuri nsiuri for generators installed by the user or bundled with the browser, the local uri points...
... generator. read only. needspagecontent boolean whether or not this generator needs page content to generate a microsummary. microsummaries generated by xslt templates need page content, while those which represent the actual microsummary do not. read only. uri nsiuri the canonical location and unique identifier of the generator. it tells us where the generator comes from and where to go for updates. read only. for generators referenced by web pages via <link> tags, this uri is the url specified by the tag. for generators installed via nsisidebar.addmicrosummarygenerator(), this uri is a urn of the form urn:source:<url>, where <url> is the remote location from which we installed the generator. for generators installed via some other mechanism (for example an extension that dynamically creat...
...r generators installed via some other mechanism (for example an extension that dynamically creates generators), this uri is a urn in a form of the extension's own choosing, with the only restriction being that the uri be globally unique. to ensure this, we recommend that such extensions incorporate uuids created by nsiuuidgenerator into the urns of the generators they create. methods calculateupdateinterval() calculates the interval until the microsummary should be updated for the next time, depending on the page content. if the generator doesn't specify an interval, null is returned. long calculateupdateinterval( in nsidomnode apagecontent ); parameters apagecontent the content of the page being summarized. return value the interval in milliseconds until the next update request. equals...
nsIMicrosummaryObserver
onelementappended() called when an element is appended to a microsummary set. void onelementappe...
... / seamonkey 2.3) method overview void oncontentloaded(in nsimicrosummary microsummary); void onelementappended(in nsimicrosummary microsummary); void onerror(in nsimicrosummary microsummary); methods oncontentloaded() called when an observed microsummary updates its content. since an observer might watch multiple microsummaries at the same time, the microsummary whose content has been updated gets passed to this handler. void oncontentloaded( in nsimicrosummary microsummary ); parameters microsummary the microsummary whose content has just been updated. onelementappended() called when an element is appended to a microsummary set. void onelementappended( in nsimicrosummary microsummary ); parameters microsummary the microsummary that has just been appended to the set. onerro...
...ry microsummary ); parameters microsummary the microsummary whose content has just been updated. onelementappended() called when an element is appended to a microsummary set. void onelementappended( in nsimicrosummary microsummary ); parameters microsummary the microsummary that has just been appended to the set. onerror() called when an observed microsummary encounters an error during an update. void onerror( in nsimicrosummary microsummary ); parameters microsummary the microsumary which could not be updated. see also microsummary topics creating a microsummary ...
nsIMsgDatabase
d long len2); native code only! ...
... speed up saved search folders. ...
...lders. ...
nsINavHistoryResultObserver
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 11.0 (firefox 11.0 / thunderbird 11.0 / seamonkey 2.8) note: in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1), this interface replaced the older nsinavhistoryresultviewer interface, which only allowed one client at a time. ...
...ributes attribute type description result nsinavhistoryresult the nsinavhistoryresult this observer monitors. although this attribute is read-write, you should not alter it directly; instead, call nsinavhistoryresult.addobserver() to add an observer to a result. methods batching() lets the observer know when a batch operation in places is about to start or end. the observer can then pause updates or events until the batch is completed, so that it won't handle the large number of updates that are about to be notified. this is especially useful when updating user interfaces, to avoid flicker or continuous selection changes, which may result in performance degradation (for example, if updating a view for each update). void batching( in boolean atogglemode ); parameters atogglemode speci...
...title the new title of the node. nodeurichanged() called right after the uri of a node has changed. void nodeurichanged( in nsinavhistoryresultnode anode, in autf8string anewuri ); parameters anode the node whose uri has changed. anewuri the node's new uri. sortingchanged() this is called to indicate to the ui that the sort has changed to the given mode. for trees, for example, this would update the column headers to reflect the sorting. for many other types of views, this will not be applicable. void sortingchanged( in unsigned short sortingmode ); parameters sortingmode one of the nsinavhistoryqueryoptions.sorting methods, indicating the new sorting mode. ...
nsISelectionPrivate
see the idl file linked above for up-to-date information. ...
... void endbatchchanges(); parameters none. native code only!getcachedframeoffset returns cached value for nstextframe::getpointfromoffset. void getcachedframeoffset( in nsiframe aframe, in print32 inoffset, in nspointref apoint ); parameters aframe inoffset apoint getenumerator() nsienumerator getenumerator(); paramete...
...sshell native code only!settextrangestyle set the painting style for the range. the range must be a range in the selection. the textrangestyle will be used by text frame when it is painting the selection. void settextrangestyle( in nsidomrange range, in consttextrangestyleref textrangestyle ); parameters range textrangestyle startbatchchanges() will stop user interface updates while multiple selection methods are called. call endbatchchanges() to resume user interface updates. void startbatchchanges(); parameters none. tostringwithformat() wstring tostringwithformat( in string formattype, in unsigned long flags, in print32 wrapcolumn ); parameters formattype flags wrapcolumn return value ...
Mail and RDF
mozilla mail exposes many of it's data structures to rdf through a few datasources. this allows exposure of mailnews-specific data to user interface using rdf templates. you should learn about rdf before reading this document or you will be hopelessly confused. overview of mail rdf graph the root resource for all accounts, folders and messages is the rdf resource named msgaccounts:/. from this resource, you can follow a number of arcs to find servers, folders, and finally messages. ...
...ng? what else do we store?) datasources are created when each window's javascript is loaded by declaring the datasource variables in the source javascript as global variables. in the document's onload= handler the datasources are attached to their respective widgets by setting the database property on each rdf template's parent element. reflecting data to rdf in order to have a dynamic ui that updates when the underlying content changes, a datasource must implement two key methods of reflecting data into rdf. answering queries: when rdf asks for information about a resource, datasources answer with the results of the query. asynchronously notifying rdf when the data itself changes, rdf needs to be notified. the details answering queries mail uses rdf resource factories to attach mail-...
...folder datasource registers itself with the mail session as a folder listener rdf template registers itself with the datasource as a content observer. notification: folder data changes. folder notifies mail session that it's data changed. mail session notifies folder listeners that the folder has changed. folder datasource notifies rdf content observers of the changes. content observers update ui. an aside: rational behind the design after reviewing this design, it might seem unnecessary to have the double-levels of notification/registration. why can't folders directly notify the rdf content observers when things change? here is the rational behind this design: it keeps all rdf datasource-related code in one place and out of the messages and folders themselves. this allows the m...
Mail composition back end
by richard h. ...
... ns_imethod onstatus(const char *amsgid, - the message id for the message being sent const prunichar *amsg) = 0; - a message concerning the status of the send operation onstopsending the onstopsending interface is called when the sending operation has completed. this will be called in the case of both success and failure. ...
... createandsendmessage the onprogress interface is called with progress notification of the send later operation. ns_imethod onprogress( pruint32 acurrentmessage, - the current message being sent pruint32 atotalmessage) = 0; - the total messages to be sent createandsendmessage the onstatus gives the listener status updates for the current operation. ns_imethod onstatus( const prunichar *amsg) = 0; - the progress so far createandsendmessage the onstopsending interface is called when the send later operation has completed. ns_imethod onstopsending( nsresult astatus, - the resulting status for the send operation ...
Mail event system
interfaces the key interfaces here are: nsifolder.idl is an interface for storing a hierarchy of objects with properties. this interface is not (should not be) mail-related. ...
... interfaces the key interfaces here are: nsifolder.idl is an interface for storing a hierarchy of objects with properties. this interface is not (should not be) mail-related. nsifolders each store individual lists of folder listeners which are maintained with addlistener() and removelistener(). ...
...sages": this->notifyintpropertychanged(ktotalmessagesatom, 4, 5);. notifypropertychanged broadcasts this event to each its nsifolderlisteners by calling onitemintpropertychanged on each listener: listener->onintpropertychanged(this, ktotalmessagesatom, 4, 5); the dialog is one of these folder-specific listeners. in its implementation of onintpropertychanged, it uses this information to update the message count in the dialog. notifypropertychanged then broadcasts this event to the mail session: mailsession->onintpropertychanged(this, ktotalmessagesatom, 4, 5); the mail session rebroadcasts this information to each of the global listeners that has been registered with it. for each global listener, it calls onintpropertychanged: listener->onintpropertychanged(folder, ktotalmes...
Plugin Roadmap for Firefox - Plugins
with firefox 56 in september 2017, firefox for android will remove all support for plugins (bug 1381916). 2019 in september 2019, firefox 69 will remove the "always activate" flash option so we always ask for user permission before activating flash on a website. 2020 in december 2020, flash support will be completely removed from consumer versions of firefox. adobe will stop shipping security updates for flash at the end of 2020. see also mozilla firefox october 2015 - npapi plugins in firefox july 2016 - reducing adobe flash usage in firefox july 2017 - firefox roadmap for flash end-of-life adobe flash november 2015 - flash, html5 and open web standards july 2017 - flash & the future of interactive content google chrome flash roadmap sep 2013 - saying goodbye to our old ...
... 2020. ...
...deprecation november 2014 - the final countdown for npapi august 2016 - flash and chrome december 2016 - roll-out plan for html5 by default july 2017 - saying goodbye to flash in chrome microsoft edge and internet explorer april 2016 - putting users in control of flash december 2016 - extending user control of flash with click-to-run july 2017 - flash on windows timeline august 2019 - update on removing flash from microsoft edge and internet explorer apple safari june 2016 - next steps for legacy plug-ins july 2017 - adobe announces flash distribution and updates to end ...
Debugging service workers - Firefox Developer Tools
ur service worker in any case, when the service worker is successfully registered, you'll see information about it displayed in the application > service workers view (along with any other service workers registered on the same domain): this gives you a variety of information about your service worker: the url that the service worker is registered on. that last time the service worker was updated (if the service has not been updated, this is when it was first installed). the path to the service worker source file. the server worker’s status, which can be one of the following: stopped: the service worker is installed, but not currently running. when the service worker is stopped, a start button is provided to start it running, allowing you to trigger the service worker lifecycle...
... allowing you to trigger the service worker lifecycle. running: the service worker is running. there are a couple of other useful controls on this view, too. unregister on the right-hand side of the service workers view there is an unregister button, which when pressed unregisters the service worker. this is very useful because, once registered, the service worker will not necessarily update to the new version immediately, which can make debugging a pain. from updating your service worker: if your service worker has previously been installed, but then a new version of the worker is available on refresh or page load, the new version is installed in the background, but not yet activated. it is only activated when there are no longer any pages loaded that are still using the old servi...
...s you two options: delete all — delete all caches under this origin. delete "name of cache" — delete only the highlighted cache. you can also click on one of the individual items stored in the cache, then right/ctrl click on it to get options for deleting just that item, or every item in the cache. these options make it much easier to remove a cache if it is required for testing a code update. it is also worth knowing that if you are testing an app's offline capabilities, you'll be able to see whether requests are being retrieved from a service worker-initiated cache rather than from the network by looking at network monitor. resources retrieved from the cache are indicated with service worker in the transferred column. note: there is currently a bug whereby the network monitor ...
Animating CSS properties - Firefox Developer Tools
can also give better performance, as they give the browser more control over when to render frames, and to drop frames if necessary. however, the performance cost of modifying a css property can vary from one property to another. animating expensive css properties can result in jank as the browser struggles to hit a smooth frame rate. the css rendering waterfall the process the browser uses to update the page when a css property has changed can be described as a waterfall consisting of the following steps: recalculate style: every time a css property for an element changes, the browser must recalculate computed styles. layout: next, the browser uses the computed styles to figure out the position and geometry for the elements. this operation is labeled "layout" but is also sometimes call...
...the elements. this operation is labeled "layout" but is also sometimes called "reflow". paint: finally, the browser needs to repaint the elements to the screen. one last step is not shown in this sequence: the page may be split into layers, which are painted independently and then combined in a process called "composition". this sequence needs to fit into a single frame, since the screen isn't updated until it is complete. it's commonly accepted that 60 frames per second is the rate at which animations will appear smooth. for a rate of 60 frames per second, that gives the browser 16.7 milliseconds to execute the complete flow. css property cost in the context of the rendering waterfall, some properties are more expensive than others: property type cost examples ...
...rigger a style recalculation, a layout and a repaint. left max-width border-width margin-left font-size properties that don't affect geometry or position, but are not rendered in their own layer, do not trigger a layout. color properties that are rendered in their own layer don't even trigger a repaint, because the update is handled in composition. transform opacity the css triggers website shows how much of the waterfall is triggered for each css property, with information for most css properties by browser engine. an example: margin versus transform in this section we'll see how the waterfall can highlight the difference between animating using margin and animating using transform. the i...
Waterfall - Firefox Developer Tools
f thing your site is doing: javascript-heavy sites will have a lot of orange, while visually dynamic sites will have a lot of purple and green. but there are common patterns which can alert you to possible performance problems. rendering waterfall one pattern that you'll often see in the waterfall view is something like this: this is a visualization of the basic algorithm the browser uses to update the page in response to some event: javascript function call: some event - for example, a dom event - causes some javascript in the page to run. the javascript changes some of the page's dom or cssom. recalculate style: if the browser thinks the computed styles for page elements have changed, it must then recalculate them. layout: next, the browser uses the computed styles to figure out the ...
...the elements. this operation is labeled "layout" but is also sometimes called "reflow". paint: finally, the browser needs to repaint the elements to the screen. one last step is not shown in this sequence: the page may be split into layers, which are painted independently and then combined in a process called "composition". this sequence needs to fit into a single frame, since the screen isn't updated until it is complete. it's commonly accepted that 60 frames per second is the rate at which animations will appear smooth. for a rate of 60 frames per second, that gives the browser 16.7 milliseconds to execute the complete flow. importantly for responsiveness, the browser doesn't always have to go through every step: css animations update the page without having to run any javascript. not ...
...esn't even have to repaint when the element is moved: the new position of the element is handled in composition. the animating css properties article shows how animating different css properties can give different performance outcomes, and how the waterfall can help signal that. blocking javascript by default, a site's javascript is executed in the same thread that the browser uses for layout updates, repaints, dom events, and so on. this means that long-running javascript functions can cause unresponsiveness (jank): animations may not be smooth, or the site might even freeze. using the frame rate tool and the waterfall together, it's easy to see when long-running javascript is causing responsiveness problems. in the screenshot below, we've zoomed in on a js function that's caused a drop in...
AudioContext.createMediaElementSource() - Web APIs
mymediaelement an htmlmediaelement object that you want to feed into an audio processing graph to manipulate. returns a mediaelementaudiosourcenode. example this simple example creates a source from an <audio> element using createmediaelementsource(), then passes the audio through a gainnode before feeding it into the audiodestinationnode for playback. when the mouse pointer is moved, the updatepage() function is invoked, which calculates the current gain as a ratio of mouse y position divided by overall window height. you can therefore increase and decrease the volume of the playing music by moving the mouse pointer up and down. note: you can also view this example running live, or view the source. var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var myaudio ...
...e.pagey : event.clienty + (document.documentelement.scrolltop ? document.documentelement.scrolltop : document.body.scrolltop); gainnode.gain.value = cury/height; } // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination, so we can play the // music and adjust the volume using the mouse cursor sou...
...e.pagey : event.clienty + (document.documentelement.scrolltop ? document.documentelement.scrolltop : document.body.scrolltop); gainnode.gain.value = cury/height; } // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination, so we can play the // music and adjust the volume using the mouse cursor source.connect(gainnode);...
Gamepad.timestamp - Web APIs
Web › API › Gamepad › timestamp
note: this property is not currently supported anywhere. ...
... note: this property is not currently supported anywhere. ...
... note: this property is not currently supported anywhere. syntax readonly attribute domhighrestimestamp timestamp; example var gp = navigator.getgamepads()[0]; console.log(gp.timestamp); value a domhighrestimestamp. ...
HTMLDialogElement.close() - Web APIs
return value void. ...
... id="favanimal" name="favanimal"> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select></p> </section> <menu> <button id="cancel" type="reset">cancel</button> <button type="submit">confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var cancelbutton = document.getelementbyid('cancel'); var dialog = document.getelementbyid('favdialog'); dialog.returnvalue = 'favanimal'; function opencheck(dialog) { if(dialog.open) { console.log('dialog open'); ...
... updatebutton = document.getelementbyid('updatedetails'); var cancelbutton = document.getelementbyid('cancel'); var dialog = document.getelementbyid('favdialog'); dialog.returnvalue = 'favanimal'; function opencheck(dialog) { if(dialog.open) { console.log('dialog open'); } else { console.log('dialog closed'); } } // update button opens a modal dialog updatebutton.addeventlistener('click', function() { dialog.showmodal(); opencheck(dialog); }); // form cancel button closes the dialog box cancelbutton.addeventlistener('click', function() { dialog.close('animalnotchosen'); opencheck(dialog); }); })(); </script> note: you can find this example on g...
HTMLDialogElement.returnValue - Web APIs
<p><label>favorite animal: <select name="favanimal" required> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select> </label></p> <menu> <button>cancel</button> <button>confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var dialog = document.getelementbyid('favdialog'); dialog.returnvalue = 'favanimal'; function opencheck(dialog) { if (dialog.open) { console.log('dialog open'); } else { console.log('dialog closed'); ...
... specifications specification status comment ...
... specifications specification status comment html living standardthe definition of 'returnvalue' in t...
IDBRequest.readyState - Web APIs
ate; value the idbrequestreadystate of the request, which takes one of the following two values: value meaning pending the request is pending. done the request is done. example the following example requests a given record title, onsuccess gets the associated record from the idbobjectstore (made available as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store in another request. the readystate of the 2nd request is logged to the developer console. for a full working example, see our to-do notifications app (view example live.) var title = "walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todoli...
..."walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as it's title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objectstoretitlerequest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item // back into the database var updatetitlerequest = objectstore.put(data); // log the source of this request console.log("the readystate of this request is " + updatetitlerequest.readystate); // when this new request succeeds, run the displaydata() // function again t...
...he notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item // back into the database var updatetitlerequest = objectstore.put(data); // log the source of this request console.log("the readystate of this request is " + updatetitlerequest.readystate); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; specifications specification status comment indexed database api 2.0the definition of 'readystate' in that specification. recommendation indexed database api draftthe definition of 'readystate' in that specification. recommendation browser compatibility ...
IDBRequest.source - Web APIs
Web › API › IDBRequest › source
ers. syntax var idbindex = request.source; var idbcursor = request.source; var idbobjectstore = request.source; value an object representing the source of the request, such as an idbindex, idbobjectstore or idbcursor. example the following example requests a given record title, onsuccess gets the associated record from the idbobjectstore (made available as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store in another request. the source of the 2nd request is logged to the developer console. for a full working example, see our to-do notifications app (view example live.) var title = "walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist')...
... "walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as its title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objectstoretitlerequest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item // back into the database var updatetitlerequest = objectstore.put(data); // log the source of this request console.log("the source of this request is " + updatetitlerequest.source); // when this new request succeeds, run the displaydata() // function again to update ...
...value in the object to "yes" data.notified = "yes"; // create another request that inserts the item // back into the database var updatetitlerequest = objectstore.put(data); // log the source of this request console.log("the source of this request is " + updatetitlerequest.source); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; specifications specification status comment indexed database api 2.0the definition of 'source' in that specification. recommendation indexed database api draftthe definition of 'source' in that specification. recommendation browser compatibility the compatibility table on this p...
Checking when a deadline is due - Web APIs
vent) { note.innerhtml += '<li>new item added to database.</li>'; title.value = ''; hours.value = null; minutes.value = null; day.value = 01; month.value = 'january'; year.value = 2020; }; } this next section creates a log message to say the new item addition is successful, and resets the form so it's ready for the next task to be entered. // update the display of data to show the newly added item, by running displaydata() again. displaydata(); }; last of all, we run the displaydata() function, which updates the display of data in the app to show the new task that was just entered. checking whether a deadline has been reached at this point our data is in the database; now we want to check whether any of the the deadlines have been reach...
..., but our data might. the notified == "no" check is designed to make sure you will only get one notification per to-do item. ...
...be set off on it again // first open up a tranaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as it's title var request = objectstore.get(title); request.onsuccess = function() { // grab the data object returned as the result var data = request.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 requestupdate = objectstore.put(data); // when this new request succeeds, run the displaydata() function again to update the display requestupdate.onsuccess = function() { displaydata(); } if the checks all match...
MediaElementAudioSourceNode - Web APIs
iaelement read only the htmlmediaelement used when constructing this mediastreamaudiosourcenode. methods inherits methods from its parent, audionode. example this simple example creates a source from an <audio> element using createmediaelementsource(), then passes the audio through a gainnode before feeding it into the audiodestinationnode for playback. when the mouse pointer is moved, the updatepage() function is invoked, which calculates the current gain as a ratio of mouse y position divided by overall window height. you can therefore increase and decrease the volume of the playing music by moving the mouse pointer up and down. note: you can also view this example running live, or view the source. var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var myaudio ...
...e.pagey : event.clienty + (document.documentelement.scrolltop ? document.documentelement.scrolltop : document.body.scrolltop); gainnode.gain.value = cury/height; } // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination, so we can play the // music and adjust the volume using the mouse cursor sou...
...e.pagey : event.clienty + (document.documentelement.scrolltop ? document.documentelement.scrolltop : document.body.scrolltop); gainnode.gain.value = cury/height; } // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination, so we can play the // music and adjust the volume using the mouse cursor source.connect(gainnode);...
PaymentRequest: shippingoptionchange event - Web APIs
shipping information, and for which shipping options are offered, the shippingoptionchange event is sent to the paymentrequest whenever the user chooses a shipping option from the list of available options. the string identifying the currently-selected shipping option can be found in the shippingoption property. bubbles no cancelable no interface paymentrequestupdateevent event handler property onshippingoptionchange examples this code snippet sets up a handler for the shippingoptionchange event. the code recalculates the total charge for the payment based on the selected shipping option. for example, if there are three options (such as "free ground shipping", "2-day air", and "next day"), each time the user chooses one of those options, t...
...pping", "2-day air", and "next day"), each time the user chooses one of those options, this event handler is called to recalculate the total based on the changed shipping option. paymentrequest.addeventlistener("shippingoptionchange", event => { const value = calculatenewtotal(paymentrequest.shippingoption); const total = { currency: "eur", label: "total due", value, }; event.updatewith({ total }); }, false); after caling a custom function, calculatenewtotal(), to compute the updated total based on the newly-selected shipping option as specified by the shippingoption. the revised total is submitted back to the payment request by calling the event's updatewith() method. you can also create an event handler for shippingoptionchange using its corresponding event handler prop...
...payment request by calling the event's updatewith() method. you can also create an event handler for shippingoptionchange using its corresponding event handler property, onshippingoptionchange: paymentrequest.onshippingoptionchange = event => { const value = calculatenewtotal(paymentrequest.shippingoption); const total = { currency: "eur", label: "total due", value, }; event.updatewith({ total }); }; specifications specification status comment payment request apithe definition of 'shippingoptionchange' in that specification. candidate recommendation initial definition. ...
PaymentResponse.shippingOption - Web APIs
mentrequest interface returns the id attribute of the shipping option selected by the user. this option is only present when the requestshipping option is set to true in the paymentoptions object passed to the paymentrequest constructor. syntax var shippingoption = paymentrequest.shippingoption; example in the example below, the paymentrequest.onshippingaoptionchange event is called. ...
...example in the example below, the paymentrequest.onshippingaoptionchange event is called. it calls updatedetails() to toggle the shipping method between "standard" and "express". // initialization of paymentrequest arguments are excerpted for brevity. var payment = new paymentrequest(supportedinstruments, details, options); request.addeventlistener('shippingoptionchange', function(evt) { evt.updatewith(new promise(function(resolve, reject) { updatedetails(details, request.shippingoption, resolve, reject); })); }); payment.show().then(function(paymentresponse) { // processing of paymentresponse exerpted for the same of brevity. ...
...er('shippingoptionchange', function(evt) { evt.updatewith(new promise(function(resolve, reject) { updatedetails(details, request.shippingoption, resolve, reject); })); }); payment.show().then(function(paymentresponse) { // processing of paymentresponse exerpted for the same of brevity. ...
RTCPeerConnection: signalingstatechange event - Web APIs
an signalingstatechange event is sent to an rtcpeerconnection to notify it that its signaling state, as indicated by the signalingstate property, has changed. ...
...nt handler property rtcpeerconnection.onsignalingstatechange examples given an rtcpeerconnection, pc, and an updatestatus() function that presents status information to the user, this code sets up an event handler to let the user know when the ice negotiation process finishes up. ...
...nt handler to let the user know when the ice negotiation process finishes up. pc.addeventlistener("signalingstatechange", ev => { switch(pc.signalingstate) { case "stable": updatestatus("ice negotiation complete"); break; } }, false); using onsignalingstatechange, it looks like this: pc.onsignalingstatechange = ev => { switch(pc.signalingstate) { case "stable": updatestatus("ice negotiation complete"); break; } }; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'signalingstatechange' in that specification. candidate recommendation ...
SVGLength - Web APIs
Web › API › SVGLength
ing the pc units defined in css2. properties name type description unittype unsigned short the type of the value as specified by one of the svg_lengthtype_* constants defined on this interface. value float the value as a floating point value, in user units. setting this attribute will cause valueinspecifiedunits and valueasstring to be updated automatically to reflect this setting. exceptions on setting: a domexception with code no_modification_allowed_err is raised when the length corresponds to a read only attribute or when the object itself is read only. valueinspecifiedunits float the value as a floating point value, in the units expressed by unittype. setting this attribute will cause value and valuea...
...y to reflect this setting. exceptions on setting: a domexception with code no_modification_allowed_err is raised when the length corresponds to a read only attribute or when the object itself is read only. valueinspecifiedunits float the value as a floating point value, in the units expressed by unittype. setting this attribute will cause value and valueasstring to be updated automatically to reflect this setting. exceptions on setting: a domexception with code no_modification_allowed_err is raised when the length corresponds to a read only attribute or when the object itself is read only. valueasstring domstring the value as a string value, in the units expressed by unittype. setting this attribute will cause value, valueinspecifiedunits...
...flect this setting. exceptions on setting: a domexception with code no_modification_allowed_err is raised when the length corresponds to a read only attribute or when the object itself is read only. valueasstring domstring the value as a string value, in the units expressed by unittype. setting this attribute will cause value, valueinspecifiedunits, and unittype to be updated automatically to reflect this setting. exceptions on setting: a domexception with code syntax_err is raised if the assigned string cannot be parsed as a valid <length>. a domexception with code no_modification_allowed_err is raised when the length corresponds to a read only attribute or when the object itself is read only. methods name & arguments ...
ServiceWorkerContainer - Web APIs
most importantly, it exposes the serviceworkercontainer.register() method used to register service workers, and the serviceworkercontainer.controller property used to determine whether or not the current page is actively controlled. ...
...error fired whenever an error occurs in the associated service workers. also available via the serviceworkercontainer.onerror property. message occurs when incoming messages are received by the serviceworkercontainer object (e.g. via a messageport.postmessage() call.) also available via the serviceworkercontainer.onmessage property. methods serviceworkercontainer.register() creates or updates a serviceworkerregistration for the given scripturl. serviceworkercontainer.getregistration() gets a serviceworkerregistration object whose scope matches the provided document url. the method returns a promise that resolves to a serviceworkerregistration or undefined. serviceworkercontainer.getregistrations() returns all serviceworkerregistration objects associated with a serviceworkercont...
...ther the current page is controlled // by an existing service worker, and when that // controller changes. // first, do a one-off check if there's currently a // service worker in control. if (navigator.serviceworker.controller) { console.log('this page is currently controlled by:', navigator.serviceworker.controller); } // then, register a handler to detect when a new or // updated service worker takes control. navigator.serviceworker.oncontrollerchange = function() { console.log('this page is now controlled by:', navigator.serviceworker.controller); }; } else { console.log('service workers are not supported.'); } specifications specification status comment service workersthe definition of 'serviceworkercontainer' in that specification. ...
Visual Viewport API - Web APIs
code below is based on the sample the specification, though it adds a few things that make it function better. it shows a function called viewporthandler(). when called it queries the offsetleft and height properties for values it uses in a css translate() method. you invoke this function by passing it to both event calls. ...
...adds a few things that make it function better. it shows a function called viewporthandler(). when called it queries the offsetleft and height properties for values it uses in a css translate() method. you invoke this function by passing it to both event calls. one thing that may not be clear in this example is the use of the pendingupdate flag and the call to requestanimationframe(). ...
...sing it to both event calls. one thing that may not be clear in this example is the use of the pendingupdate flag and the call to requestanimationframe(). the pendingupdate flag serves to prevent multiple invocations of the transfrom that can occur when onresize and onscroll fire at the same time. using requestanimationframe() ensures that the transform ocurrs before the next render. let pendingupdate = false; function viewporthandler(event) { if (pendingupdate) return; pendingupdate = true; requestanimationframe(() => { pendingupdate = false; var layoutviewport = document.getelementbyid('layoutviewport'); // since the bar is position: fixed we need to offset it by the // visual viewport's offset from the layout viewport origin. var viewport = event.target; var...
WebGLRenderingContext.isEnabled() - Web APIs
abled(cap); parameters cap a glenum specifying which webgl capability to test. possible values: constant description gl.blend blending of the computed fragment color values. see webglrenderingcontext.blendfunc(). gl.cull_face culling of polygons. see webglrenderingcontext.cullface(). gl.depth_test depth comparisons and updates to the depth buffer. see webglrenderingcontext.depthfunc(). gl.dither dithering of color components before they get written to the color buffer. gl.polygon_offset_fill adding an offset to depth values of polygon's fragments. see webglrenderingcontext.polygonoffset(). gl.sample_alpha_to_coverage computation of a temporary coverage value determined b...
...mporary coverage value determined by the alpha value. gl.sample_coverage anding the fragment's coverage with the temporary coverage value. see webglrenderingcontext.samplecoverage(). gl.scissor_test scissor test that discards fragments that are outside of the scissor rectangle. see webglrenderingcontext.scissor(). gl.stencil_test stencil testing and updates to the stencil buffer. see webglrenderingcontext.stencilfunc(). when using a webgl 2 context, the following values are available additionally: constant description gl.rasterizer_discard primitives are discarded immediately before the rasterization stage, but after the optional transform feedback stage. gl.clear() commands are ignored. ...
...ons specification status comment webgl 1.0the definition of 'isenabled' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glisenabled' in that specification. standard man page of the (similar) opengl es 2.0 api. webgl 2.0the definition of 'isenabled' in that specification. editor's draft updated definition for webgl 2. opengl es 3.0the definition of 'glisenabled' in that specification. standard man page of the (similar) opengl es 3.0 api. ...
Using textures in WebGL - Web APIs
hed loading copy it into the texture. // function loadtexture(gl, url) { const texture = gl.createtexture(); gl.bindtexture(gl.texture_2d, texture); // because images have to be download over the internet // they might take a moment until they are ready. // until then put a single pixel in the texture so we can // use it immediately. when the image has finished downloading // we'll update the texture with the contents of the image. const level = 0; const internalformat = gl.rgba; const width = 1; const height = 1; const border = 0; const srcformat = gl.rgba; const srctype = gl.unsigned_byte; const pixel = new uint8array([0, 0, 255, 255]); // opaque blue gl.teximage2d(gl.texture_2d, level, internalformat, width, height, border, srcformat, srctype,...
...ertex of each face. note that the texture coordinates range from 0.0 to 1.0; the dimensions of textures are normalized to a range of 0.0 to 1.0 regardless of their actual size, for the purpose of texture mapping. once we've set up the texture mapping array, we pass the array into the buffer, so that webgl has that data ready for its use. updating the shaders the shader program also needs to be updated to use the textures instead of solid colors. the vertex shader we need to replace the vertex shader so that instead of fetching color data, it instead fetches the texture coordinate data. const vssource = ` attribute vec4 avertexposition; attribute vec2 atexturecoord; uniform mat4 umodelviewmatrix; uniform mat4 uprojectionmatrix; varying highp vec2 vtexturecoord; ...
...tion = uprojectionmatrix * umodelviewmatrix * avertexposition; vtexturecoord = atexturecoord; } `; the key change here is that instead of fetching the vertex color, we're fetching the texture coordinates and passing them to the vertex shader; this will indicate the location within the texture corresponding to the vertex. ...
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
ere's time in which the remote peer might attempt to send an offer of its own, causing us to leave the stable state and enter the have-remote-offer state, which means we are now waiting for a response to the offer. but once it receives the offer we just sent, so is the remote peer. this leaves both peers in a state in which the connection attempt cannot be completed. ...
... just sent, so is the remote peer. this leaves both peers in a state in which the connection attempt cannot be completed. ...
... an sdp description, it's simply delivered to the ice layer by passing it into the rtcpeerconnection method addicecandidate(). if an error occurs here and we didn't just discard an offer due to being the impolite peer during a collision, we throw the error so the caller can handle it. otherwise, we drop the error, ignoring it, since it doesn't matter in this context. perfect negotiation with the updated api the updated code takes advantage of the fact that you can now call setlocaldescription() with no parameters so it just does the right thing for you, as well as the fact that setremotedescription() automatically rolls back if necessary. this lets us get rid of the need to use a promise to keep the timing in order, since the rollback becomes an essentially atomic part of the setremotedescript...
Movement, orientation, and motion: A WebXR example - Web APIs
elviewmatrix: gl.getuniformlocation(shaderprogram, 'umodelviewmatrix'), normalmatrix: gl.getuniformlocation(shaderprogram, 'unormalmatrix'), usampler: gl.getuniformlocation(shaderprogram, 'usampler') }, }; buffers = initbuffers(gl); texture = loadtexture(gl, 'https://cdn.glitch.com/a9381af1-18a9-495e-ad01-afddfd15d000%2ffirefox-logo-solid.png?v=1575659351244'); xrsession.updaterenderstate({ baselayer: new xrwebgllayer(xrsession, gl) }); if (session_type == "immersive-vr") { refspacetype = "local"; } else { refspacetype = "viewer"; } mat4.fromtranslation(cubematrix, viewerstartposition); vec3.copy(cubeorientation, viewerstartorientation); xrsession.requestreferencespace(refspacetype) .then((refspace) => { xrreferencespace = refspace.ge...
... code, so refer to lighting in webgl and its preceding articles creating 3d objects using webgl and using textures in webgl. then our loadtexture() function is called to load the texture file. now that the rendering structures and data are loaded, we start preparing to run the xrsession. we connect the session to the webgl layer so it konws what to use as a rendering surface by calling xrsession.updaterenderstate() with a baselayer set to a new xrwebgllayer. we then look at the value of the session_type constant to see whether the webxr context should be immersive or inline. immersive sessions use the local reference space, while inline sessions use the viewer reference space. the glmatrix library's fromtranslation() function for 4x4 matrices is used to convert the viewer's start position as...
...to call a function called sessionended(). function sessionended() { xrbutton.innertext = "enter webxr"; if (animationframerequestid) { xrsession.cancelanimationframe(animationframerequestid); animationframerequestid = 0; } xrsession = null; } we can also call sessionended() directly if we wish to programmatically end the webxr session. in either case, the label of the button is updated to indicate that a click will start a session, and then, if there is a pending request for an animation frame, we cancel it by calling cancelanimationframe once that's done, the value of xrsession is changed to null to indicate that we're done with the session. implementing the controls now let's take a look at the code that handles turning keyboard and mouse events into something usable for ...
Starting up and shutting down a WebXR session - Web APIs
as published a webxr polyfill which you can use to simulate webxr on browsers which don't have support for the webxr apis. if the browser supports the older webvr api, that is used. otherwise, the polyfill falls back to an implementation which uses google's cardboard vr api. the polyfill is maintained alongside the specification, and is kept up to date with the specification. additionally, it is updated to maintain compatibility with browsers as their support for webxr and other technologies related to it and to the implementation of the polyfill change over time. be sure to read the readme carefully; the polyfill comes in several versions depending on what degree of compatibility with newer javascript features your target browsers include. webxr api emulator extension the mozilla webxr team...
...s: async function runsession(session) { let worlddata; session.addeventlistener("end", onsessionend); let canvas = document.queryselector("canvas"); gl = canvas.getcontext("webgl", { xrcompatible: true }); // set up webgl data and such worlddata = loadglprograms(session, "worlddata.xml"); if (!worlddata) { return null; } // finish configuring webgl worlddata.session.updaterenderstate({ baselayer: new xrwebgllayer(worlddata.session, gl) }); // start rendering the scene referencespace = await worlddata.session.requestreferencespace("unbounded"); worlddata.referencespace = referencespace.getoffsetreferencespace( new xrrigidtransform(worlddata.playerspawnposition, worlddata.playerspawnorientation)); worlddata.animationframerequestid = worlddata.
...t, a handler for the end event is set up. then the rendering canvas is obtained and a reference to its webgl context is retrieved, specifying the xrcompatible option when calling getcontext(). next, any data and setup needed for the webgl renderer is performed before then configuring webgl to use the framebuffer of the webgl context as its own framebuffer. this is done using the xrsession method updaterenderstate() to set the render state's baselayer to a newly-created xrwebgllayer encapsulating the webgl context. preparing to render the scene at this point, the xrsession itself has been fully configured, so we can begin rendering. first, we need a reference space within which coordinates for the world will be stated. we can get the initial reference space for the session by calling the xrses...
Advanced techniques: Creating and sequencing audio - Web APIs
trol these using range inputs on the interface: <label for="attack">attack</label> <input name="attack" id="attack" type="range" min="0" max="1" value="0.2" step="0.1" /> <label for="release">release</label> <input name="release" id="release" type="range" min="0" max="1" value="0.5" step="0.1" /> now we can create some variables over in javascript and have them change when the input values are updated: let attacktime = 0.2; const attackcontrol = document.queryselector('#attack'); attackcontrol.addeventlistener('input', function() { attacktime = number(this.value); }, false); let releasetime = 0.5; const releasecontrol = document.queryselector('#release'); releasecontrol.addeventlistener('input', function() { releasetime = number(this.value); }, false); the final playsweep() functio...
...the final version looks like this: function playsample(audiocontext, audiobuffer) { const samplesource = audiocontext.createbuffersource(); samplesource.buffer = audiobuffer; samplesource.playbackrate.setvalueattime(playbackrate, audioctx.currenttime); samplesource.connect(audiocontext.destination) samplesource.start(); ...
...revious two functions. function scheduler() { // while there are notes that will need to play before the next interval, schedule them and advance the pointer. while (nextnotetime < audioctx.currenttime + scheduleaheadtime ) { schedulenote(currentnote, nextnotetime); nextnote(); } timerid = window.settimeout(scheduler, lookahead); } we also need a draw function to update the ui, so we can see when the beat progresses. let lastnotedrawn = 3; function draw() { let drawnote = lastnotedrawn; let currenttime = audioctx.currenttime; while (notesinqueue.length && notesinqueue[0].time < currenttime) { drawnote = notesinqueue[0].note; notesinqueue.splice(0,1); // remove note from queue } // we only need to draw if the note has mov...
Using the Web Audio API - Web APIs
e volume. this can be done using a gainnode, which represents how big our sound wave is. there are two ways you can create nodes with the web audio api. you can use the factory method on the context itself (e.g. audiocontext.creategain()) or via a constructor of the node (e.g. new gainnode()). we'll use the factory method in our code: const gainnode = audiocontext.creategain(); now we have to update our audio graph from before, so the input is connected to the gain, then the gain node is connected to the destination: track.connect(gainnode).connect(audiocontext.destination); this will make our audio graph look like this: the default value for gain is 1; this keeps the current volume the same. gain can be set to a minimum of about -3.4 and a max of about 3.4. here we'll allow the boombo...
... 0 (this will effectively mute our sound). let's give the user control to do this — we'll use a range input: <input type="range" id="volume" min="0" max="2" value="1" step="0.01"> note: range inputs are a really handy input type for updating values on audio nodes. you can specify a range's values and use them directly with the audio node's parameters. so let's grab this input's value and update the gain value when the input node has its value changed by the user: const volumecontrol = document.queryselector('#volume'); volumecontrol.addeventlistener('input', function() { gainnode.gain.value = this.value; }, false); note: the values of node objects (e.g. gainnode.gain) are not simple values; they are actually objects of type audioparam — these called parameters. this is why we...
...n) are not simple values; they are actually objects of type audioparam — these called parameters. this is why we have to set gainnode.gain's value property, rather than just setting the value on gain directly. this enables them to be much more flexible, allowing for passing the parameter a specific set of values to change between over a set period of time, for example. great, now the user can update the track's volume! the gain node is the perfect node to use if you want to add mute functionality. adding stereo panning to our app let's add another modification node to practise what we've just learnt. there's a stereopannernode node, which changes the balance of the sound between the left and right speakers, if the user has stereo capabilities. note: the stereopannernode is for simple cas...
Window.requestAnimationFrame() - Web APIs
this will request that your animation function be called before the browser performs the next repaint. ...
...this will request that your animation function be called before the browser performs the next repaint. the number of callbacks is usually 60 times per second, but will generally match the display refresh rate in most web browsers as per w3c recommendation. ...
...(1000 µs). be sure to always use the first argument (or some other method for getting the current time) to calculate how much the animation will progress in a frame, otherwise the animation will run faster on high refresh rate screens. check the example below for a way to do this. syntax window.requestanimationframe(callback); parameters callback the function to call when it's time to update your animation for the next repaint. the callback function is passed one single argument, a domhighrestimestamp similar to the one returned by performance.now(), indicating the point in time when requestanimationframe() starts to execute callback functions. return value a long integer value, the request id, that uniquely identifies the entry in the callback list. this is a non-zero value, but ...
Window.screenLeft - Web APIs
Web › API › Window › screenLeft
estanimationframe() to constantly redraw the circle in the same physical position on the screen, even if the window position is moved. ...
...the circle in the same physical position on the screen, even if the window position is moved. ...
....screentop + canvaselem.offsettop; function positionelem() { let newleft = window.screenleft + canvaselem.offsetleft; let newtop = window.screentop + canvaselem.offsettop; let leftupdate = initialleft - newleft; let topupdate = initialtop - newtop; ctx.fillstyle = 'rgb(0, 0, 0)'; ctx.fillrect(0, 0, width, height); ctx.fillstyle = 'rgb(0, 0, 255)'; ctx.beginpath(); ctx.arc(leftupdate + (width/2), topupdate + (height/2) + 35, 50, degtorad(0), degtorad(360), false); ctx.fill(); pelem.textcontent = 'window.screenleft: ' + window.screenleft + ', window.screentop: ' + window.screentop; window.requestanimationframe(positionelem); } window.requestanimationframe(positionelem); also in the code we include a snippet that detects whether screenleft is supported, and if not, po...
Window.screenTop - Web APIs
Web › API › Window › screenTop
estanimationframe() to constantly redraw the circle in the same physical position on the screen, even if the window position is moved. ...
...the circle in the same physical position on the screen, even if the window position is moved. ...
....screentop + canvaselem.offsettop; function positionelem() { let newleft = window.screenleft + canvaselem.offsetleft; let newtop = window.screentop + canvaselem.offsettop; let leftupdate = initialleft - newleft; let topupdate = initialtop - newtop; ctx.fillstyle = 'rgb(0, 0, 0)'; ctx.fillrect(0, 0, width, height); ctx.fillstyle = 'rgb(0, 0, 255)'; ctx.beginpath(); ctx.arc(leftupdate + (width/2), topupdate + (height/2) + 35, 50, degtorad(0), degtorad(360), false); ctx.fill(); pelem.textcontent = 'window.screenleft: ' + window.screenleft + ', window.screentop: ' + window.screentop; window.requestanimationframe(positionelem); } window.requestanimationframe(positionelem); also in the code we include a snippet that detects whether screenleft is supported, and if not, po...
Using XMLHttpRequest - Web APIs
t transfers follows the specification for progress events: these events implement the progressevent interface. the actual events you can monitor to determine the state of an ongoing transfer are: progress the amount of data that has been retrieved has changed. load the transfer is complete; all data is now in the response var oreq = new xmlhttprequest(); oreq.addeventlistener("progress", updateprogress); oreq.addeventlistener("load", transfercomplete); oreq.addeventlistener("error", transferfailed); oreq.addeventlistener("abort", transfercanceled); oreq.open(); // ... // progress on transfers from the server to the client (downloads) function updateprogress (oevent) { if (oevent.lengthcomputable) { var percentcomplete = oevent.loaded / oevent.total * 100; // ... } else { ...
...."); } function transfercanceled(evt) { console.log("the transfer has been canceled by the user."); } lines 3-6 add event listeners for the various events that are sent while performing a data transfer using xmlhttprequest. note: you need to add the event listeners before calling open() on the request. otherwise the progress events will not fire. the progress event handler, specified by the updateprogress() function in this example, receives the total number of bytes to transfer as well as the number of bytes transferred so far in the event's total and loaded fields. however, if the lengthcomputable field is false, the total length is not known and will be zero. progress events exist for both download and upload transfers. the download events are fired on the xmlhttprequest object itself,...
...e lengthcomputable field is false, the total length is not known and will be zero. progress events exist for both download and upload transfers. the download events are fired on the xmlhttprequest object itself, as shown in the above sample. the upload events are fired on the xmlhttprequest.upload object, as shown below: var oreq = new xmlhttprequest(); oreq.upload.addeventlistener("progress", updateprogress); oreq.upload.addeventlistener("load", transfercomplete); oreq.upload.addeventlistener("error", transferfailed); oreq.upload.addeventlistener("abort", transfercanceled); oreq.open(); note: progress events are not available for the file: protocol. note: starting in gecko 9.0, progress events can now be relied upon to come in for every chunk of data received, including the last chunk i...
ARIA: feed role - Accessibility
article>s or have role article. each article within a feed should be focusable, with tabindex of 0 or -1. an article should be scrolled into view when it, or a descendant element, receives focus. if the addition of articles occupies the main browser thread, make sure to set aria-busy="true" on the feed itself, and make sure to set it back to false when processing ends, or the user may not see the updates. to ensure good user experience, avoid inserting or removing articles in the middle of a feed, load new articles before the user has reached the end of the feed, and provide keyboard commands for moving focus among articles so that keyboard users can navigate through your feed. see keyboard interactions below. if the number of articles is known, set aria-setsize on the articles themselves. how...
...he feed has no visible title, the feed element has a label specified with aria-label. if it does, see aria-labelledby. aria-labelledby if the feed has a visible title, the feed element has aria-labelledby referring to the element containing the title. if not, add an aria-label. aria-busy when busy, such as when articles are being added or removed from the feed, set aria-busy="true" during the update operation. make sure it's reset to false when the operation is complete or the changes may not become visible. article each section of content in a feed should be contained in an <article> or element with role article. each article should have an aria-labelledby referring to the article title or other child that can serve as a distinguishing label. each article should preferably have aria-descr...
... the feed and an aria-setsize set to a value that represents either the total number of articles that have been loaded or the total number in the feed, depending on which value is more helpful to users. if the total number in the feed is not known, set aria-setsize="-1". required javascript features none, except as required by any attributes. for example, setting aria-busy to true during the update operation if needed, and then to false upon completion. examples example implementation of feed pattern specifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'feed' in that specification. recommendation screen reader support coming soon ...
An overview of accessible web applications and widgets - Accessibility
using generic elements such as <div> and <span>. while this results in a widget that looks like its desktop counterpart, there usually isn't enough semantic information in the markup to be usable by an assistive technology. the problem dynamic content on a web page can be particularly problematic for users who, for whatever reason, are unable to view the screen. stock tickers, live twitter feed updates, progress indicators, and similar content modify the dom in ways that an assistive technology (at) may not be aware of. that's where aria comes in. example 1: markup for a tabs widget built without aria labeling. there's no information in the markup to describe the widget's form and function. <!-- this is a tabs widget. how would you know, looking only at the markup? --> <ol> <li id="ch1tab"...
...="tp1" class="tooltip" role="tooltip" aria-hidden="true">your first name is optional</div> </div> the css for this markup is shown in example 2b. note that there is no custom classname used, only the status of the aria-hidden attribute on line 1. example 2b. ...
...s optional</div> </div> the css for this markup is shown in example 2b. note that there is no custom classname used, only the status of the aria-hidden attribute on line 1. example 2b. attribute-based selector for indicating state div.tooltip[aria-hidden="true"] { display: none; } the javascript to update the aria-hidden property has the form shown in example 2c. note that the script only updates the aria-hidden attribute (line 2); it does not need to also add or remove a custom classname. example 2c. javascript to update the aria-checked attribute var showtip = function(el) { el.setattribute('aria-hidden', 'false'); } role changes aria allows developers to declare a semantic role for an element that otherwise offers incorrect or no semantics. the role of an element should not cha...
CSS Grid Layout and Progressive Enhancement - CSS: Cascading Style Sheets
id-row-span. this version does not include auto-placement capability, or grid template areas. some simple grid layouts could be implemented for ie10, through to edge 15, using the -ms properties. as these properties are vendor prefixed, they will not effect any browser supporting the up to date and unprefixed specification. autoprefixer grid layout support the popular tool autoprefixer has been updated to support the -ms- grid version. by default, grid prefixes are disabled, but you can enable it with grid: true option. autoprefixer({ grid: 'autoplace' }) grid prefixes are disabled by default because some properties can’t be prefixed. is it safe to use css grids for my layout? as with any front-end technology choice, the decision to use css grid layout will come down to the browsers your...
...d by default because some properties can’t be prefixed. is it safe to use css grids for my layout? as with any front-end technology choice, the decision to use css grid layout will come down to the browsers your site visitors are typically using. if they tend to use up-to-date versions of firefox, chrome, opera, and safari, then it would make sense to start using css grids once those browsers update. if your site serves a market sector that is tied to older browsers, however, it may not make sense yet. however, my suggestion is not to make assumptions based on how new specifications have been rolled out in browsers in the past. css grid layout is very different, in terms of the amount of time it has been in development, and the work of the various browser vendors to ensure that what ships wo...
......
Cubic Bezier Generator - CSS: Cascading Style Sheets
<html> <canvas id="bezier" width="336" height="336"> </canvas> <form> <label for="x1">x1 = </label><input onchange="updatecanvas();" type="text" maxlength=6 id="x1" value="0.79" class='field'> <label for="y1">y1 = </label><input onchange="updatecanvas();return true;" type="text" maxlength=6 id="y1" value="0.33" class='field'> <label for="x2">x2 = </label><input onchange="updatecanvas();return true;" type="text" maxlength=6 id="x2" value="0.14" class='field'> <label for="y2">y2 = </label><input onchange="updatecanvas();return true;" type="text" maxlength=6 id="y2" value="0.53" class='field'> <br> <output id="output">log</output> </form> </html> .field { width: 40px; } function updatecanvas() { var x1 = d...
...this is not really yet a useful tool, but will be! ...
...this is not really yet a useful tool, but will be! ...
Used value - CSS: Cascading Style Sheets
nd properties (e.g., background) are consistent with those of their component properties (e.g., background-color or background-size) and with position and float. note: the getcomputedstyle() dom api returns the resolved value, which may either be the computed value or the used value, depending on the property. ...
...it width: 50%.</p> <p class="show-used-width">..</p> <div id="width-inherit"> <p>explicit width: inherit.</p> <p class="show-used-width">..</p> </div> </div> </div> css #no-width { width: auto; } #width-50 { width: 50%; } #width-inherit { width: inherit; } /* make results easier to see */ div { border: 1px solid red; padding: 8px; } javascript function updateusedwidth(id) { var div = document.queryselector(`#${id}`); var par = div.queryselector('.show-used-width'); var wid = window.getcomputedstyle(div)["width"]; par.textcontent = `used width: ${wid}.`; } function updateallusedwidths() { updateusedwidth("no-width"); updateusedwidth("width-50"); updateusedwidth("width-inherit"); } updateallusedwidths(); window.addeventlistener('resize',...
...sedwidth(id) { var div = document.queryselector(`#${id}`); var par = div.queryselector('.show-used-width'); var wid = window.getcomputedstyle(div)["width"]; par.textcontent = `used width: ${wid}.`; } function updateallusedwidths() { updateusedwidth("no-width"); updateusedwidth("width-50"); updateusedwidth("width-inherit"); } updateallusedwidths(); window.addeventlistener('resize', updateallusedwidths); result difference from computed value css 2.0 defined only computed value as the last step in a property's calculation. then, css 2.1 introduced the distinct definition of used value. an element could then explicitly inherit a width/height of a parent, whose computed value is a percentage. for css properties that don't depend on layout (e.g., display, font-size, or line-heigh...
Video player styling basics - Developer guides
in the previous cross browser video player article we described how to build a cross-browser html5 video player using the media and fullscreen apis. this follow-up article looks at how to style this custom player, including making it responsive. the example in action you can find the code for the updated, styled example on github, and view it live. preliminary modifications from the original example this section summarises the modifications that were made to the original video player example to make the styling task easier, before the bulk of the work was started. html markup there are a few changes that were made to the html markup shown in the previous article. the custom video controls and <progress> element are now contained within <div> elements, rather than residing insid...
...ght:65%; } .controls progress span { width:0%; height:100%; display:inline-block; background-color:#2a84cd; } a .data-state class is also used here when a <progress> element is being "faked"; when it's in this state the background colour needs to be set. the internal <span> element used as the actual progressing part of the faked progress bar has its width initially set to 0% (it is updated via javascript) and it also has its background colour set. there are some browser-specific properties that need to be set to ensure that firefox and chrome use the required colour for the progress bar: .controls progress::-moz-progress-bar { background-color:#0095dd; } .controls progress::-webkit-progress-value { background-color:#0095dd; } although the same properties are set to the s...
...there is a reason for this! even though the ...
<dialog>: The Dialog element - HTML: Hypertext Markup Language
Web › HTML › Element › dialog
t the form. the ::backdrop css pseudo-element can be used to style behind a <dialog> element when the dialog is displayed with htmldialogelement.showmodal(). for example, to dim unreachable content behind the modal dialog. examples simple example <dialog open> <p>greetings, one and all!</p> </dialog> advanced example this example opens a pop-up dialog box that contains a form, when the "update details" button is clicked. html <!-- simple pop-up dialog box containing a form --> <dialog id="favdialog"> <form method="dialog"> <p><label>favorite animal: <select> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select> </label></p> <menu> <button value="cancel">cancel...
..."dialog"> <p><label>favorite animal: <select> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select> </label></p> <menu> <button value="cancel">cancel</button> <button id="confirmbtn" value="default">confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <output aria-live="polite"></output> javascript var updatebutton = document.getelementbyid('updatedetails'); var favdialog = document.getelementbyid('favdialog'); var outputbox = document.queryselector('output'); var selectel = document.queryselector('select'); var confirmbtn = document.getelementbyid('confirmbtn'); // "update details" button opens the...
...tails</button> </menu> <output aria-live="polite"></output> javascript var updatebutton = document.getelementbyid('updatedetails'); var favdialog = document.getelementbyid('favdialog'); var outputbox = document.queryselector('output'); var selectel = document.queryselector('select'); var confirmbtn = document.getelementbyid('confirmbtn'); // "update details" button opens the <dialog> modally updatebutton.addeventlistener('click', function onopen() { if (typeof favdialog.showmodal === "function") { favdialog.showmodal(); } else { alert("the <dialog> api is not supported by this browser"); } }); // "favorite animal" input sets the value of the submit button selectel.addeventlistener('change', function onselect(e) { confirmbtn.value = selectel.value; }); // "confirm" button of ...
<input type="checkbox"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › checkbox
x when submitting the form, if the checkbox is currently toggled on checked a boolean attribute indicating whether or not this checkbox is checked by default (when the page loads). it does not indicate whether this checkbox is currently checked: if the checkbox’s state is changed, this content attribute does not reflect the change. (only the htmlinputelement’s checked idl attribute is updated.) note: unlike other input controls, a checkboxes value is only included in the submitted data if the checkbox is currently checked. if it is, then the value of the checkbox's value attribute is reported as the input's value. unlike other browsers, firefox by default persists the dynamic checked state of an <input> across page loads. use the autocomplete attribute to control this feature. i...
...ate is used to state that collecting the ingredients has started, but the recipe is not yet complete. ...
...ting the ingredients has started, but the recipe is not yet complete. ...
<input type="file"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › file
nput.style.opacity = 0; note: opacity is used to hide the file input instead of visibility: hidden or display: none, because assistive technology interprets the latter two styles to mean the file input isn't interactive. next, we add an event listener to the input to listen for changes to its selected value changes (in this case, when files are selected). the event listener invokes our custom updateimagedisplay() function. input.addeventlistener('change', updateimagedisplay); whenever the updateimagedisplay() function is invoked, we: use a while loop to empty the previous contents of the preview <div>. grab the filelist object that contains the information on all the selected files, and store it in a variable called curfiles. check to see if no files were selected, by checking if curf...
...t the browser reports the size in absolute bytes). generate a thumbnail preview of the image by calling url.createobjecturl(curfiles[i]). then, insert the image into the list item too by creating a new <img> and setting its src to the thumbnail. if the file type is invalid, we display a message inside a list item telling the user that they need to select a different file type. ...
...ent('p'); if(validfiletype(file)) { para.textcontent = `file name ${file.name}, file size ${returnfilesize(file.size)}.`; const image = document.createelement('img'); image.src = url.createobjecturl(file); listitem.appendchild(image); listitem.appendchild(para); } else { para.textcontent = `file name ${file.name}: not a valid file type. update your selection.`; listitem.appendchild(para); } list.appendchild(listitem); } } } the custom validfiletype() function takes a file object as a parameter, then uses array.prototype.includes() to check if any value in the filetypes matches the file's type property. if a match is found, the function returns true. if no match is found, it returns false. // https://develop...
<video>: The Video Embed element - HTML: Hypertext Markup Language
Web › HTML › Element › video
but estimates that not enough data has been loaded to play the media up to its end without having to stop for further buffering of content. canplaythrough the browser estimates it can play the media up to its end without stopping for content buffering. complete the rendering of an offlineaudiocontext is terminated. durationchange the duration attribute has been updated. emptied the media has become empty; for example, this event is sent if the media has already been loaded (or partially loaded), and the load() method is called to reload it. ended playback has stopped because the end of the media was reached. loadeddata the first frame of the media has finished loading. loadedmetadata the metadata has been loaded.
.... progress fired periodically as the browser loads a resource. ratechange the playback rate has changed. seeked a seek operation completed. seeking a seek operation began. stalled the user agent is trying to fetch media data, but data is unexpectedly not forthcoming. suspend media data loading has been suspended. timeupdate the time indicated by the currenttime attribute has been updated. volumechange the volume has changed. waiting playback has stopped because of a temporary lack of data usage notes browsers don't all support the same video formats; you can provide multiple sources inside nested <source> elements, and the browser will then use the first one it understands. <video...
...ix this problem for the apache web server by adding the extension used by your video files (".webm" is the most common one) to the mime type "video/webm" via the "mime.types" file in "/etc/apache" or via the "addtype" configuration directive in httpd.conf. addtype video/webm .webm your web host may provide an easy interface to mime type configuration changes for new technologies until a global update naturally occurs. accessibility concerns videos should provide both captions and transcripts that accurately describe its content (see adding captions and subtitles to html5 video for more information on how to implement these). captions allow people who are experiencing hearing loss to understand a video's audio content as the video is being played, while transcripts allow people who need addi...
HTTP response status codes - HTTP
Web › HTTP › Status
http response status codes indicate whether a specific http request has been successfully completed. responses are grouped in five classes: informational responses (100–199), successful responses (200–299), redirects (300–399), client errors (400–499), and server errors (500–599). the below status codes are defined by section 10 of rfc 2616. you can find an updated specification in rfc 7231. if you receive a response that is not in this list, it is a non-standard response, possibly custom to the server's software. information responses 100 continue this interim response indicates that everything so far is ok and that the client should continue the request, or ignore the response if the request is already finished. 101 switching protocol this code is sent in respons...
...turned meta-information is not exactly the same as is available from the origin server, but is collected from a local or a third-party copy. this is mostly used for mirrors or backups of another resource. except for that specific case, the "200 ok" response is preferred to this status. 204 no content there is no content to send for this request, but the headers may be useful. the user-agent may update its cached headers for this resource with the new ones. 205 reset content tells the user-agent to reset the document which sent this request. 206 partial content this response code is used when the range header is sent from the client to request only part of a resource. 207 multi-status (webdav) conveys information about multiple resources, for situations where multiple status codes might b...
...d. 426 upgrade required the server refuses to perform the request using the current protocol but might be willing to do so after the client upgrades to a different protocol. the server sends an upgrade header in a 426 response to indicate the required protocol(s). 428 precondition required the origin server requires the request to be conditional. this response is intended to prevent the 'lost update' problem, where a client gets a resource's state, modifies it, and puts it back to the server, when meanwhile a third party has modified the state on the server, leading to a conflict. 429 too many requests the user has sent too many requests in a given amount of time ("rate limiting"). 431 request header fields too large the server is unwilling to process the request because its header field...
Regular expressions - JavaScript
ent substring. split() uses a regular expression or a fixed string to break a string into an array of substrings. when you want to know whether a pattern is found in a string, use the test() or search() methods; for more information (but slower execution) use the exec() or match() methods. if you use exec() or match() and if the match succeeds, these methods return an array and update properties of the associated regular expression object and also of the predefined regular expression object, regexp. if the match fails, the exec() method returns null (which coerces to false). in the following example, the script uses the exec() method to find a match in a string. var myre = /d(b+)d/g; var myarray = myre.exec('cdbbdbsbz'); if you do not need to access the properties of the r...
...('cdbbdbsbz') outputs array [ 'dbbd', 'bb', index: 1, input: 'cdbbdbsbz' ]. (see different behaviors for further info about the different behaviors.) if you want to construct the regular expression from a string, yet another alternative is this script: var myre = new regexp('d(b+)d', 'g'); var myarray = myre.exec('cdbbdbsbz'); with these scripts, the match succeeds and returns the array and updates the properties shown in the following table. results of regular expression execution. object property or index description in this example myarray the matched string and all remembered substrings. ['dbbd', 'bb', index: 1, input: 'cdbbdbsbz'] index the 0-based index of the match in the input string. 1 input the original string.
...based index of the match in the input string. 1 input the original string. 'cdbbdbsbz' [0] the last matched characters. 'dbbd' myre lastindex the index at which to start the next match. (this property is set only if the regular expression uses the g option, described in advanced searching with flags.) 5 source the text of the pattern. updated at the time that the regular expression is created, not executed. 'd(b+)d' as shown in the second form of this example, you can use a regular expression created with an object initializer without assigning it to a variable. if you do, however, every occurrence is a new regular expression. for this reason, if you use this form without assigning it to a variable, you cannot subsequently ...
The arguments object - JavaScript
on that accepts rest, default, or destructured parameters. doing so will throw a syntax error. non-strict functions that are passed only simple parameters (that is, not rest, default, or restructured parameters) will sync the value of variables new values in the body of the function with the arguments object, and vice versa: function func(a) { arguments[0] = 99; // updating arguments[0] also updates a console.log(a); } func(10); // 99 and also: function func(a) { a = 99; // updating a also updates arguments[0] console.log(arguments[0]); } func(10); // 99 conversely, non-strict functions that are passed rest, default, or destructured parameters will not sync new values assigned to argument variables in the function body with the arguments object. instead, the arguments object in n...
...dy with the arguments object. ...
... ...
Introduction to progressive web apps - Progressive web apps (PWAs)
mers. is it worth doing all that? absolutely! with a relatively small amount of effort required to implement the core pwa features, the benefits are huge. for example: a decrease in loading times after the app has been installed, thanks to caching with service workers, along with saving precious bandwidth and time. pwas have near-instantaneous loading (from the second visit). the ability to update only the content that has changed when an app update is available. in contrast, with a native app, even the slightest modification can force the user to download the entire application again. a look and feel that is more integrated with the native platform—app icons on the home screen or app launcher, applications that automatically run in full screen mode, etc. re-engaging with users through...
... this for years with best practices such as progressive enhancement. by using progressive enhancement, pwas are cross-browser. this means developers should take into account the differences in implementation of some pwa features and technologies between different browser implementations. ...
...es and technologies between different browser implementations. re-engageability one major advantage of native platforms is the ease with which users can be re-engaged by updates and new content, even when they aren't looking at the app or using their devices. modern web apps can now do this too, using new technologies such as service workers for controlling pages, the web push api for sending updates straight from server to app via a service worker, and the notifications api for generating system notifications to help engage users when they're not actively using their web browser. responsiveness responsive web apps use technologies like media queries and viewport to make sure that their uis will fit any form factor: desktop, mobile, tablet, or whatever comes next. safety the web plat...
Using the WebAssembly JavaScript API - WebAssembly
when the time comes to call a function pointer, the webassembly caller supplies the index, which can then be safety bounds checked against the table before indexing and calling the indexed function reference. thus, tables are currently a rather low-level primitive used to compile low-level programming language features safely and portably. tables can be mutated via table.prototype.set(), which updates one of the values in a table, and table.prototype.grow(), which increases the number of values that can be stored in a table. this allows the indirectly-callable set of functions to change over time, which is necessary for dynamic linking techniques. the mutations are immediately accessible via table.prototype.get() in javascript, and to wasm modules. a table example let’s look at a simple...
... multiplicity now we’ve demonstrated usage of the main key webassembly building blocks, this is a good place to mention the concept of multiplicity. th...
...ssembly.global({value:'i32', mutable:true}, 0); webassembly.instantiatestreaming(fetch('global.wasm'), { js: { global } }) .then(({instance}) => { asserteq("getting initial value from wasm", instance.exports.getglobal(), 0); global.value = 42; asserteq("getting js-updated value from wasm", instance.exports.getglobal(), 42); instance.exports.incglobal(); asserteq("getting wasm-updated value from js", global.value, 43); }); note: you can see the example running live on github; see also the source code. multiplicity now we’ve demonstrated usage of the main key webassembly building blocks, this is a good place to mention the concept of multiplicity. this provides webassembly with a multitude of advances in terms of architectural efficiency: one module can have n instan...
SDK API Lifecycle - Archive of obsolete content
o retire old apis when they're no longer optimal or supported by the underlying platform. the api lifecycle aims to balance these competing demands. it has two main components: a stability index that defines how stable each module is a deprecation process that defines when and how stable sdk apis can be changed or removed from future versions of the sdk while giving developers enough time to update their code. stability index the stability index is adopted from node.js. the sdk uses only four of the six values defined by node.js: experimental the module is not yet stabilized. you can try it out and provide feedback, but we may change or remove it in future versions without having to pass through a formal deprecation process. unstable the api is in the process of ...
...ompatibility should not be expected. don’t start using it, and plan to migrate away from this module to its replacement. the stability index for each module is written into that module’s metadata structure, and is displayed at the top of each module's documentation page. deprecation process deprecation in the chosen release, the sdk team will communicate the module's deprecation: update the module's stability index to be "deprecated" include a deprecation notice in the release notes, the add-ons blog, and the jetpack google group. the deprecation notice should point developers at a migration guide. migration the deprecation period defaults to 18 weeks (that is, three releases) although in some cases, generally those out of our control, it might be shorter than this. during ...
platform/xpcom - Archive of obsolete content
apper = components.classesbyid[id].createinstance(ci.nsisupports); var helloworld = wrapper.wrappedjsobject; console.log(helloworld.hello()); replacing factories if the factory you create has the same contract id as an existing registered factory, then your factory will replace the existing one. however, the components.classes object commonly used to look up factories by contract id will not be updated at run time. to access the replacement factory you need to do something like this: var id = components.manager.queryinterface(ci.nsicomponentregistrar). contractidtocid('@me.org/helloworld'); var wrapper = components.classesbyid[id].createinstance(ci.nsisupports); the xpcom module exports a function factorybycontract to simplify this technique: var wrapper = xpcom.factorybycontract('@me.org...
...or service identified by the class id. factorybycontract(contract) given a contract id this function returns the associated factory or service. if the factory or service isn't registered, this function throws components.results.ns_error_factory_not_registered. this function is similar to the standard components.classes[contractid] with one significant difference: that components.classes is not updated at runtime. so if a factory is registered with the contract id "@me.org/mycomponent", and another factory is already registered with that contract id, then: components.classes["@me.org/mycomponent"] will return the old factory, while: xpcom.factorybycontract("@me.org/mycomponent") will return the new one. parameters contract : string contract id of the factory or service to retrieve. re...
ui/frame - Archive of obsolete content
, title: "city info", items: [frame] }); from add-on to all frames to send a message from the add-on code to all frames, attached to all open browser windows, you can use frame.postmessage(). ...
... all browser windows with that city's current weather (it just reads this from a dictionary, where in a real case it might ask a web service): var { frame } = require("sdk/ui/frame"); var { toolbar } = require("sdk/ui/toolbar"); var weather = { "london" : "rainy", "toronto" : "snowy", "san francisco" : "foggy" } var frame = new frame({ url: "./city-info.html", onmessage: (e) => { updateweather(e.data); } }); var toolbar = toolbar({ name: "city-info", title: "city info", items: [frame] }); function updateweather(location) { frame.postmessage(weather[location], frame.url); } to listen to these messages in the frame script, add a listener to the window's message event: window.addeventlistener("message", updateweather, false); function updateweather(message) { var l...
cfx to jpm - Archive of obsolete content
.js. it replaces the old cfx tool. you can use jpm from firefox 38 onwards. this article highlights the main differences between cfx and jpm. a guide to working with jpm if you're already familiar with cfx. installation cfx is python-based and is distributed as a zip file. jpm is node-js-based and is distributed through npm. so for jpm you don't need python, but you do need npm. to get new updates of cfx you download and extract a new zip file, while to get the new version of jpm, use npm update. for jpm installation instructions, see the installation section in the jpm reference. activation you need to call cfx activate before you can use cfx, and this only works in the current command shell: if you open a new shell you have to call activate again. with jpm, you don't need to activat...
...ost respects, add-ons created with cfx will work fine with jpm. however, there are a few differences you have to know about. add-on id the add-on id is a unique identifier for your add-on. in a built xpi, it's the id field in the add-on's install manifest (install.rdf) file. the id is used for a variety of purposes. for example: addons.mozilla.org uses it to distinguish between new add-ons and updates to existing add-ons, and the simple-storage module uses it to figure out which stored data belongs to which add-on. id handling with cfx when you use cfx, the id is taken from the id field in the add-on's package.json file. you can edit this file to create your own id, but if you don't, cfx will generate one for you, which will look something like "jid1-f3boogbjqje67a". add-on ids need to be ...
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
you know that you are going to build a large, complex extension, you would do well to consider the approach described in this article. one final note: i've only tried these techniques inside firefox, but they'll probably work more or less unchanged on other gecko-based platforms like thunderbird or seamonkey. if someone can confirm this and/or provide guidelines for what's different, i'll update the article to incorporate this information. bambi meets mozilla none of this is for the faint of heart. in particular, the initial step involves building mozilla, which is a huge - nay, gargantuan! - project. many intelligent developers have been driven to the brink of insanity trying to build it for the first time. if you're not an experienced c++ developer, i wouldn't even bother...
...r the library. this works well for libraries that have a straightforward make process without extensive configuration. a good example of this is the sqlite library included in the mozilla build tree at db/sqlite. by adapting the makefile in this way, the library is created as part of the standard mozilla build process, which eliminates additional build steps. the downside is that you will need to update the modified makefile any time a new version of the library is released. for libraries that have complex configuration processes, use a non-standard compiler or have other special characteristics, it may be unfeasible to create a mozilla-compliant makefile. in this case, i would recommend placing the entire library distribution inside the project or subproject that uses it. so if library acmelib...
Appendix B: Install and Uninstall Scripts - Archive of obsolete content
it can be used to write or copy necessary files to the profile folder, like the initial db the add-on will use for storage. a few others require cleanup code to be run after the add-on is uninstalled. ...
...case you would need to declare the first run preference in your default preferences file, with a default value of false. you should also change the preference value before you run any other first run code. keep in mind that the user could have set multiple firefox windows to open at startup, so there's a race condition on which window will run the first run code. if you need to run code on every update, or some of them, the code would be very similar. instead of a boolean preference, it would be best to use a string preference with the last-installed add-on version. and then do a version comparison to decide which code to run. the current version number can be hard-coded in the first run function, or you can use the add-on manager to dynamically get it. this can get tricky with the firefox 4 ad...
Appendix C: Avoiding using eval in Add-ons - Archive of obsolete content
is almost always unnecessary, and many times even a security vulnerability. moreover, code using eval is harder to parse for a human mind, is often pretty complex, and relies on assumptions that are not necessarily true in the future or even now. this article is aimed at presenting alternatives to common eval uses in add-ons and other javascript code. add-on authors are strongly encouraged to update their code to eliminate all instances of eval, no matter if the add-on is to be hosted in the mozilla add-ons gallery or not. in order to host your add-on with mozilla it is crucial to minimize or completely eliminate eval use in order to receive a positive review and have your add-on made public. if it cannot be easily proven that an eval() call is benign and necessary because there are no viabl...
...mmand() xul elements that have a command (oncommand or command attribute) assigned will also have a working docommand method. document.getelementbyid("mymenu").docommand(); alternative: just hard-code what should happen if you know that the current version of the application will call { executesomething(); executesomethingelse();} then just do the same in your code. of course, you'll need to update your add-on if the application changes. accessing properties via computed names not that common anymore, but still existing, are add-ons or other javascript programs that access object properties using eval when the property name is not a literal, but computed on the fly. //do not use! eval("myaddon.phrases.word" + word + " = '" + phrase + "';"); again, this is not only unnecessarily hard to ...
Signing an XPI - Archive of obsolete content
certificate. see signing an extension for a practical guide. introduction this article describes how to sign your own firefox extensions with a code-signing certificate on a windows platform. it was developed from the linux article so you want to sign your xpi package? by mozdev group's pete collins. this article is a mirror of the original, with minor reformatting, some new info and all links updated in march 2010. get network security services 1. download the latest network security services (nss) package from the mozilla ftp site at https://ftp.mozilla.org/pub/mozilla.or.../nss/releases/. for windows, you'll want the nss-3.11.4.zip package in the nss_3_11_4_rtm/msvc6.0/winnt5.0_opt.obj/ folder - it is by 2010 the only one with the right binaries. 2. extract the contents of the archive f...
...l: pkcs12 import successful c:\projects\codesigning> certutil -l -d . mytestcert u,u,cu certum root ca ct,c,c certum level iii ca c,c,c code signing (certum) u,u,u you should notice that the existing certificate has been updated. sign extension with real certificate this is a repeat of the earlier steps using the real certificate's details. here's the output on a test directory: c:\projects\codesigning>signtool -d . -k "code signing (certum)" -p ******* test using certificate directory: . generating test/meta-inf/manifest.mf file.. --> test.txt generating zigbert.sf file.. tree "test" signed successfully incorporati...
Autodial for Windows NT - Archive of obsolete content
introduction this document is intended to explain how the autodial helper feature implemented for bug 93002 works and why it works that way. a brief history of autodial on windows in the consumer versions of windows, (windows 95, windows 98, windows me) autodial for all applications is controlled from the control panel, in the internet options applet, under the tab connections. if you turn on the autodial feature, windows will automatically dial whenever any application tries to access a network address that can't be reached. technically, this control panel applet (internet options) is part of internet explorer. ...
... interaction with the autodial service to work a little more reliably. i don't see a need to expose this pref in the ui, but perhaps it should be there. or pehaps we should assume mozilla users can configure the autodial service and disable the helper by default, but netscape users need a little more help, and enable it for them. original document information author(s): benjamin chuang last updated date: october 2, 2002 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Creating a Firefox sidebar extension - Archive of obsolete content
the content, locale and skin folders are packed into emptysidebar.jar, which should be created in the chrome folder. on unix systems: ~/src/emptysidebar$ cd chrome ~/src/emptysidebar/chrome$ zip -r emptysidebar.jar content/ locale/ on windows systems, use a zip tool to create emptysidebar.zip and then rename to emptysidebar.jar. since we are packaging the extension with a jar file, we need to update the chrome.manifest file to take to jar file into consideration: example 7. chrome.manifest content emptysidebar jar:chrome/emptysidebar.jar!/content/ locale emptysidebar en-us jar:chrome/emptysidebar.jar!/locale/ skin emptysidebar classic/1.0 jar:chrome/emptysidebar.jar!/skin/ overlay chrome://browser/content/browser.xul chrome://emptysidebar/content/firefoxoverlay.xul finally, create ...
...talled. you can download the empty sidebar project to use as a basis for your own sidebars. the emptysidebar extension resources code snippets:sidebar building an extension creating applications with mozilla packaging firefox/thunderbird extensions creating a firefox 1 sidebar original document information author: j.c. wesdorp <jcwesdorp . at . occidopagus.nl> - may 30, 2005. updated for firefox 2 - dec 12, 2006. permission granted to migrate in jan 2006, including permission to relicense under the cc:by-sa. original source: http://occidopagus.nl/firefox/emptysidebar/ ...
Enabling the behavior - updating the status periodically - Archive of obsolete content
now that we have code to retrieve tinderbox status and update the icon, we need to run it periodically. function loadtinderboxstatus() { gxmlhttprequest = new xmlhttprequest(); gxmlhttprequest.onload = updatetinderboxstatus; gxmlhttprequest.open("get", "http://tinderbox.mozilla.org/seamonkey/panel.html"); gxmlhttprequest.send(null); window.settimeout(loadtinderboxstatus, 60000); } window.settimeout(loadtinderboxstatus, 1000); window.settimeout schedules functions to run at some future time. we use it inside the loadtinderboxstatus function to make that function run a second (1,000 milliseconds) after startup and a minute (60,000 milliseconds) after each invocation. ...
...end(null); window.settimeout(loadtinderboxstatus, 60000); } window.settimeout(loadtinderboxstatus, 1000); window.settimeout schedules functions to run at some future time. we use it inside the loadtinderboxstatus function to make that function run a second (1,000 milliseconds) after startup and a minute (60,000 milliseconds) after each invocation. this allows users to get relatively frequent updates about tinderbox without overloading the tinderbox server or slowing down mozilla with requests. our code is now ready to run, but mozilla doesn't know about it yet. to enable its functionality, we have to add a reference to our javascript code into navigator.xul, just as we put a reference to our css code into that file back in specifying the appearance. put the javascript code into a file call...
Getting Started - Archive of obsolete content
s is the most critical directory in a theme. skin\classic\help help contains all the files for theming the help dialog window. skin\classic\messenger messenger contains styles of the mail client. skin\classic\messenger-newsblog messenger-newsblog contains the only css file. skin\classic\mozapps mozapps contains all the styles and icons for the browser peripherals, such as the extension manager or update wizard. skin\classic\navigator navigator contains some icons and styles for all sm components. install your new theme before you can see the changes you make to a seamonkey theme (since live edits are restrictively difficult to set up) you must first learn how to repackage the classic theme to make it installable. for the sake of this discussion we will call your theme "my_theme", though you can...
...or. this file is a small xml database that describes the skin. <description about="urn:mozilla:install-manifest"> <em:id>{themes_uuid}</em:id> <em:version>themes_version</em:version> the first section requires that you establish a uuid for your theme and that you give your theme a version number. once you've done this, insert the information as above, and scroll down. ...
Creating a hybrid CD - Archive of obsolete content
as a cross platform product, releases of mozilla on cd should also work on any platform. the cd should support hfs (macintosh), joliet (win32), and rock ridge (unix). many mozilla files have long file names which makes creating the cd on a macintosh difficult because the hfs filesystem limits the length of file names to 32 characters. the utility mkhybrid lets you create hybrid cds that work with all three filesystems. mkhybrid was written by james pearson and is is a component of the latest versions of cdrecord. i used version 1.8.1a03 although you'll probably want to get a newer one. ...
... ...
Creating a Release Tag - Archive of obsolete content
here are directions for creating a release from a linux system. note that there are a couple of extra files for win32 and macintosh that aren't pulled by the normal script and need to be pulled by hand. the mini-branch is created so you can check in the build scripts with the necessary changes without touching the original branch. check out mozilla from the branch you want to tag. remember to also check out extra mac and win32 files that aren't normally checked out on linux or the tag won't build on those platforms. ...
...anch and change it from the branch you originally pulled from to the new tag you are creating. mozilla/client.mk check the build scripts back in to the mini-branch. cvs ci mozilla/client.mk create the tag. find . -type d \! -name cvs | xargs -l -p10 cvs tag -l mozilla_0_9_4_1_release >& ../taglog original document information author(s): dawn endico last updated date: november 1, 2005 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Creating a Skin for Firefox/Getting Started - Archive of obsolete content
otten about promptly. skin\classic\global global contains almost all of the important css files that define the appearance of the browser. this is the most critical directory in a theme. skin\classic\help help contains all the files for theming the help dialog window. skin\classic\mozapps mozapps contains all the styles and icons for the browser peripherals, such as the extension manager or update wizard. install your new theme before you can see the changes you make to a firefox theme (since live edits are restrictively difficult to set up) you must first learn how to repackage the classic theme to make it installable. for the sake of this discussion we will call your theme "my_theme", though you can replace that with any name. copying the necessary files the first step is to move al...
... this file is a small xml database that describes the skin. <description about="urn:mozilla:install-manifest"> <em:id>{themes_uuid}</em:id> <em:version>themes_version</em:version> the first section requires that you establish a uuid for your theme and that you give your theme a version number. once you've done this, insert the information as above, and scroll down. ...
Developing New Mozilla Features - Archive of obsolete content
tips for contributing new features to mozilla. learn the codebase and coding practices before you start your feature include learning time in your schedule. mozilla is a complex codebase. our portability requirements may be new to even seasoned developers. our cross-platform component model (“xpcom”) is similar to com, but you’ll want to make sure you use it well before going too far with your project. and of course, we have a set of coding practices to help everyone live together. life will be much easier if your team has one or more members who are already familiar with and to the mozilla world. ...
...rs rather than everyone in the tree. we’re committed to this style of development, but recognize that vigilance is necessary to make sure newcomers and their features don’t get lost. if you’re having a particularly bad experience or if you’ve got suggestions on how to improve our process, please let mozilla.org staff know. original document information author(s): mitchell baker last updated date: october 30, 2004 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Editor Embedding Guide - Archive of obsolete content
below is the sequence of steps that need to be followed for the same: 1. get the nsicommandmanager from the nsiwebbrowser using do_getinterface: nscomptr<nsicommandmanager> commandmanager; nsiwebbrowser->do_getinterface(getter_addrefs(commandmgr)); 2. call a command -- docommand: commandmanager->docommand(acommand, acommandparams);...
...etbooleanvalue getlongvalue getdoublevalue getstringvalue getcstringvalue getisupportsvalue all of these take pointers to values except for getstringvalue which demands a reference to an nsastring. commandparam->getbooleanvalue("state_enabled",&boolval); original document information authors: michael judge (mjudge@netscape.com) contributor: kathleen brade (brade@netscape.com) last updated date: march 27, 2003 original document: a guide to embedding the gecko editor ...
Document Loading - From Load Start to Finding a Handler - Archive of obsolete content
" coords="721,113,821,157" href="#necko"> <area alt="nsuriloader" coords="23,335,215,455" href="#nsuriloader"> <area coords="227,515,485,575" href="#nsiuricontentlistener"> <area alt="nsdocshell" coords="47,83,203,153" href="#nsdocshell"></map> this block diagram is out of date as of january 2012 with regard to some minor control flow shuffling in nsuriloader. the prose description below has been updated. the changes do not affect functionality and the step numbers in the diagram are still accurate. guided tour during startup and component initialization, components register themselves with the uriloader via registercontentlistener. these registered listeners are used later during content dispatch. api calls to load a new uri. these can come in via nsiwebnavigation (a scriptable embedding i...
...just need to pump data into it and let the downstream nsdocumentopeninfo handle the final dispatch. if we still do not have a stream listener, that means that we failed to find an nsiuricontentlistener or nsicontenthandler for this type. give the load to the helper app service; this will return an nsistreamlistener that we can use. original document information author(s): boris zbarsky last updated date: october 24, 2003 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
HTTP Class Overview - Archive of obsolete content
this document provides an overview of the classes used by the mozilla http implementation. it's meant as a guide to developers wishing to understand or extend the mozilla http implementation. ...
... ...
Helper Apps (and a bit of Save As) - Archive of obsolete content
bird's eye view flow of control uriloader tries to find a content listener for the mime type in question. when this fails, uriloader asks an nsiexternalhelperappservice to handle the load. the nsexternalhelperappservice looks up the nsimimeinfo for the load and creates an nsihelperapplauncher to manage the load. the nsexternalapphandler (which implements nsihelperapplauncher) uses the nsimimeinfo and an nsihelperapplauncherdialog to decide what to do with the data. the nsexternalapphandler does whatever it decided to do. ...
...r choices better. gnome integration for unix. future work fix the deficiencies in nsimimeinfo. better support for mailcap syntax. possible kde integration. possibly reflecting the os settings in our helper app preferences (readonly? writable?). have a way for users to override things in the "not overridable" built-in list. original document information author(s): boris zbarsky last updated date: september 12, 2002 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Menu - Archive of obsolete content
Archive › Mozilla › Jetpack › UI › Menu
nuitem constructor is exposed, because jetpack automatically boxes simple javascript objects into menuitem objects. creating menuitems to pass a new menuitem into the api, pass one of the following types: null a simple menu separator. (note that any falsey value will suffice, including undefined, null, and the empty string. null is recommended because it stands out.) function a menuitem that will update itself when its menu is shown. the function is invoked just before the item's menu is shown and when the items array of the item's menu is retrieved. it must return a non-function menuitem. if the item belongs to a context menu, the function is called as function(context) and otherwise function(). context is an object describing the context in which the menu was shown. string a simple menuitem wi...
...ttp://example.com/ice-cream.png", menu: new jetpack.menu(["vanilla", "chocolate", "pistachio", null, "none"]), command: function (menuitem) jetpack.notifications.show(menuitem.label) }); add an item to the hyperlink context menu that tweets the link: jetpack.menu.context.page.on("a").add(function (context) { return { label: "tweet", command: function () jetpack.lib.twitter.statuses.update({ status: context.node.href }) }; )); add an item to the page's context menu depending on some complex criteria that can't be completely expressed via a css selector: jetpack.menu.context.page.beforeshow = function (menu, context) { menu.reset(); if (matchesmycriteria(context)) menu.add("match!"); }; add an item to both the hyperlink context menu and the image context menu: ...
jspage - Archive of obsolete content
st",url:this.get("action")},a));},get:function(a){if(a||!this.retrieve("send")){if(a||!this.retrieve("send:options")){this.set("send",a); }this.store("send",new request(this.retrieve("send:options")));}return this.retrieve("send");}};element.implement({send:function(a){var b=this.get("send"); b.send({data:this,url:a||b.options.url});return this;}});request.html=new class({extends:request,options:{update:false,append:false,evalscripts:true,filter:false},processhtml:function(c){var b=c.match(/<body[^>]*>([\s\s]*?)<\/body>/i); c=(b)?b[1]:c;var a=new element("div");return $try(function(){var d="<root>"+c+"</root>",g;if(browser.engine.trident){g=new activexobject("microsoft.xmldom"); g.async=false;g.loadxml(d);}else{g=new domparser().parsefromstring(d,"text/xml");}d=g.getelementsbytagname("root")[0];...
...d){return null;}for(var f=0,e=d.childnodes.length; f<e;f++){var h=element.clone(d.childnodes[f],true,true);if(h){a.grab(h);}}return a;})||a.set("html",c);},success:function(d){var c=this.options,b=this.response; b.html=d.stripscripts(function(e){b.javascript=e;});var a=this.processhtml(b.html);b.tree=a.childnodes;b.elements=a.getelements("*");if(c.filter){b.tree=b.elements.filter(c.filter); }if(c.update){document.id(c.update).empty().set("html",b.html);}else{if(c.append){document.id(c.append).adopt(a.getchildren());}}if(c.evalscripts){$exec(b.javascript); }this.onsuccess(b.tree,b.elements,b.html,b.javascript);}});element.properties.load={set:function(a){var b=this.retrieve("load");if(b){b.cancel();}return this.eliminate("load").store("load:options",$extend({data:this,link:"cancel",update:this,me...
RDF Datasource How-To - Archive of obsolete content
to the tree element, http://foo.bar.com/, the graph will be traversed and content will be constructed using the pattern specified within the template tags. for a complete description of how content is built from rdf, see the xul:template guide. ...
...r a complete description of how content is built from rdf, see the xul:template guide. 1 as of this writing, it is not currently possible to implement javascript xpcom components; however, it may soon be possible to do so via xpconnect. ...
Space Manager Detailed Design - Archive of obsolete content
nd unavailable in a band of space. the client provides a vertical offset, the yoffset, that corresponds to the band that is of interest. this will be the y offset of the frame that is being reflowed. the caller also provides a collection of banddata objects (an array) and the number of items that the collection can handle. if the collection is too small, then an error is returned and the count is updated to indicate the size required. the algorithm to provide the band data is as follows: get a vertical offset in world coordinates (instead of frame-relative coordinates) by adding the y-origin of the spacemanager to the y offset passed in if the (adjusted) y value passed in is greater than the greatest band being managed, then all space is available so a single trapezoid is returned,marked as a...
...he left edge to be that of the previous bandrect) and remove the previous bandrect. if the current band or prior band had a rect occupied by the frame,then try to join the two bands via joinbands finally, destroy the frameinfo for the frame. cross-component algorithms tech notes original document information author(s): marc attinasi other contributors: david baron, josh soref last updated date: november 25, 2005 ...
Standalone XPCOM - Archive of obsolete content
standalone xpcom is a tree configuration that builds a minimal set of libraries (shared mostly) that can be used to get all features of xpcom. the contents of this standalone xpcom in general are: nspr : mozilla/nsprpub xpcom : mozilla/xpcom note 1: xpcom apis are not frozen yet. by xpcom 1.0 release they will be. note 2: xpcom standalone differs from the xpcom built with mozilla. hence cannot be used with the mozilla browser. ...
...lone xpcom and the xpcom that ships with the mozilla browser. the one functional difference is that xpt files cannot be read from .zip files in standalone xpcom. todo for v 1.0 optional exclusion of specific features into standalone xpcom like registry, xpconnect. tweeking these options will cause reduction in memory requirements and size. get xpcom/tests directory upto date and documented. update this document for mac. api freeze and documentation original document information author: suresh duddi last updated date: 15 may 2000 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Table Cellmap - Archive of obsolete content
is attribute is one ("1"). the value zero ("0") means that the cell spans all columns from the current column to the last column of the column group (colgroup) in which the cell is defined. the handling of zero spans introduces overhead as one can not mark in advance the corresponding cells as spanned by the zero spans. the current solution is to use nscellmap::getdataat with a special argument aupdatezerospan to repair the cellmap if it encounters a empty cell (nsnull), by looking for a origin of a zero row- or colspan that spans the queried place in the cellmap. this can produce enormous costs once the cellmap contains large holes that are not caused by zero spans, this is at least a o2(n) algorithm. the following routines seem to be hot spots performance wise: nscellmap::colhasspanningcell...
...ap::colhasspanningcells nscellmap::rowhasspanningcells nscellmap::rowisspannedinto users of nscellmap::getdataat outside nscellmap.cpp the border collapse code relies on the cellmap. the collapsing of rows and columns uses the cellmap. and finally the line iterator methods which are used for arrow navigation through a table. original document information author(s): bernd mielke last updated date: september 27, 2003 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Table Layout Regression Tests - Archive of obsolete content
andards1.rgd failed. the first regression test has failed and it is marked so. adding new regression tests once you have checked in the code: please add your testcase for the bug to the regression tests. a testcase should only contain local files. place the images in table/images block/images or (don't forget cvs commit -kb) and the test file in the table/bugs or block/bugs directory. update the rtest.lst file in the corresponding directory in order to include your file. additional notes there is a special type of frame dumps - the printing regression tests, they are invoked by the -prt command line argument to the viewer and include first a display then a frame dump taking into account the printer pages. please contact if you need help with running those tests. i would like to th...
...they are invoked by the -prt command line argument to the viewer and include first a display then a frame dump taking into account the printer pages. please contact if you need help with running those tests. i would like to thank chris karnaze for his guidance and fantasai for her language support. original document information author(s): bernd mielke other contributors: boris zbarsky last updated date: february 5, 2007 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
URIs and URLs - Archive of obsolete content
overview handling network and locally retrievable resources is a central part of necko. ...
... by an internet-based server or a scheme-specific registry of naming authorities. ... the structure of a registry-based naming authority is specific to the uri scheme, but constrained to the allowed characters for an authority component. are not supported. references main reference for uris, urls and url-parsing is rfc 2396. original document information author(s): andreas otte last updated date: january 2, 2002 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Using addresses of stack variables with NSPR threads on win16 - Archive of obsolete content
pr_true); rv = pr_jointhread(thread); return (pr_success == rv) ? 0 : 1; } this is a completely correct (albeit trivial) program that will run predictably on all nspr platforms other than win-16. on win-16, the thread's attempt to address the <tt>shareddata</tt> through the pointer shared will provide interesting (though always incorrect) results. it's difficult to tell exaclty where the updated <tt>counter</tt> is being stored. the only portable manner to write this program requires that the shared structure be allocated from the heap. well, that isn't so hard to remember, is it? what is probably more likely to cause problems is passing addresses of automatically allocated variables to a function that wends its way though arbitrary amounts of convoluted logic, and finds its way into an...
...ocated variables to a function that wends its way though arbitrary amounts of convoluted logic, and finds its way into an object that is shared. ...
XBL 1.0 Reference - Archive of obsolete content
this example is targeted to demonstrate the xbl usage rather than to be a practically useful application. for this reason it contains many comments and some blocks could be avoided in a more compact solution yet used here for demonstration purposes. notes.html notes.xml notes.css view this example download all files (.zip archive)...
... yet used here for demonstration purposes. ...
Install script template - Archive of obsolete content
var plid = "@myplugin.com/myplugin,version=5.3"; var version = "5.3.0.0"; var mimetype = "application/x-my-plugin"; var suffix = "my"; var suf...
... var plid = "@myplugin.com/myplugin,version=5.3"; var version = "5.3.0.0"; var mimetype = "application/x-my-plugin"; var suffix = "my"; var suffix_description = "my plugin files"; var company_name = "mypluginco"; var plugin_description = "my exempla...
Windows Install - Archive of obsolete content
// subkeys have to exist before values can be put in. var subkey; // the name of the subkey you are poking around in var valname; // the name of the value you want to look at var value; ...
...8dot3ini != null) { for(i = 0; i < listlongfilepaths.length; i++) { flongfilepath = getfolder(fprogram, listlongfilepaths[i]); sshortfilepath = file.windowsgetshortname(flongfilepath); if(sshortfilepath) { fren8dot3ini.writestring("rename", sshortfilepath, flongfilepath); binicreated = true; } } if(binicreated) updatewinreg4ren8dot3() ; } return(0); } // main var srdest; var err; var fprogram; srdest = 449; err = initinstall(prettyname, regname, "6.0.0.2000110801"); logcomment("initinstall: " + err); fprogram = getfolder("program"); logcomment("fprogram: " + fprogram); if(verifydiskspace(fprogram, srdest)) { setpackagefolder(fprogram); err = adddirectory("", "6.0.0.2000110801", "bin", // di...
addDirectory - Archive of obsolete content
ryname, string xpisourcepath, object localdirspec, string relativelocalpath); public int adddirectory ( string registryname, string version, string xpisourcepath, object localdirspec, string relativelocalpath); public int adddirectory ( string registryname, string version, string xpisourcepath, object localdirspec, string relativelocalpath, boolean forceupdate); public int adddirectory ( string registryname, installversion version, string xpisourcepath, object localdirspec, string relativelocalpath, boolean forceupdate); parameters the adddirectory method has the following parameters: registryname the pathname in the client version registry for the root directory of the files that are to be installed.this parameter ca...
...s of this method without a version argument the value from initinstall will be used. xpisourcepath a string specifying the location of the directory within the xpi file.an empty string ("") causes the creation of a subdirectory node in the registry without actually unpacking any files, which may be useful when you are updating a package that contains subcomponents that could also be updated separately. when xpisourcepath is an empty string, registryname cannot be null. localdirspec an object representing a directory. the file is installed under this directory on the user's computer. you create this object by passing a string representing the directory to the getfolder method. subdir the name of a directory to append to localdirspec, using '/' as the path...
addFile - Archive of obsolete content
addfile unpacks a single subcomponent into a temporary location. queues the subcomponent for addition to the client version registry and installation to its final destination. ...
...llation to its final destination. ...
patch - Archive of obsolete content
method of install object syntax int patch ( string registryname, string xpisourcepath, object localdirspec, string relativelocalpath); int patch ( string registryname, installversion version, string xpisourcepath, object localdirspec, string relativelocalpath); int patch ( string registryname, string version, string xpisourcepath, object localdirspec, string relativelocalpath); parameters the patch method has the following parameters: registryname the pathname in the client version registry for the component that is to be patched.this parameter can be an absolute pathname, such as /royalairways/royalsw/executable or a relative pathname, such as executable. ...
...hname relative to the localdirspec parameter that identifies the subcomponent that is to be patched. you must always use forward slashes (/) in this pathname, regardless of the convention of the underlying operating system. if this parameter is blank or null, xpisourcepath is used. returns an integer error code. for a list of possible values, see return codes. description the patch method to update an existing component by applying a set of differences between two known versions. the set of differences is in gdiff format and is created by the nsdiff utility. a patch can only be applied between two known versions. 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 compa...
XPInstall API reference - Archive of obsolete content
rofile getwinregistry initinstall loadresources logcomment patch performinstall refreshplugins registerchrome reseterror setpackagefolder installtrigger no properties methods compareversion enabled getversion install installchrome startsoftwareupdate installversion properties methods compareto init tostring file no properties methods copy dircreate dirgetparent dirremove dirrename diskspaceavailable execute exists isdirectory isfile macalias moddate moddatechanged ...
... setrootkey setvalue setvaluenumber setvaluestring valueexists winregvalue constructor other information return codes see complete list examples trigger scripts and install scripts code samples file.macalias file.windowsshortcut install.adddirectory install.addfile installtrigger.installchrome installtrigger.startsoftwareupdate windows install ...
A XUL Bestiary - Archive of obsolete content
head, the links, the body, any tags, are available as nodes whose attributes can be got and set. there are, unfortunately, different document object models corresponding to different types of documents and also to different proprietary notions about what in a document should be exposed programmatically. the w3c has standardized on a particular dom and already has a candidate recommendation for an updated version. this is the dom that is reflected in xul and in the mozilla browser. at the highest level in the tree of nodes that is the dom sits the window object itself. the window has child nodes like the document itself, a history object which records the pages a user has seen, frame nodes, and so on, all of which are accessible programmatically. with the dramatic improvements in the object mode...
...files. ...
sizemode - Archive of obsolete content
maximized the window is maximized, and occupies the full size of the screen. normal the window appears in a normal state at the desired size. this attribute is used to save and restore the state of a window (together with the persist attribute) and for css styles (e.g. to hide the resizer grippy on maximized windows). note: when a window is minimized, the sizemode attribute is not updated. this is done so that if a window is closed while minimized, its persisted sizemode attribute wouldn't be minimized. setting this attribute does not change the window state. use window.maximize(), window.restore(), or window.minimize() to change the window state. to get the window state from javascript code, use window.windowstate. listen to the sizemodechange event dispatched to the dom windo...
... the window state. to get the window state from javascript code, use window.windowstate. listen to the sizemodechange event dispatched to the dom window to get notified when the window state changes. note: prior to gecko 13.0, this did not work on mac os x. note: prior to gecko 1.9.2, this was not always reliable. issues with this attribute (at least on firefox 3): sizemode is only updated when the value of the persist attribute on the root element (such as <window>) contains sizemode. ...
Attribute (XUL) - Archive of obsolete content
onaccesskeyextra1 buttonaccesskeyextra2 buttonaccesskeyhelp buttonalign buttondir buttondisabledaccept buttonlabelaccept buttonlabelcancel buttonlabeldisclosure buttonlabelextra1 buttonlabelextra2 buttonlabelhelp buttonorient buttonpack buttons checked checkstate clicktoscroll class closebutton closemenu coalesceduplicatearcs collapse collapsed color cols command commandupdater completedefaultindex container containment contentcontextmenu contenttooltip context contextmenu control crop curpos current currentset customindex customizable cycler datasources decimalplaces default defaultbutton defaultset description dir disableautocomplete disableautoselect disableclose disabled disablehistory disablekeynavigation disablesecurity dlgtype drag...
...kedpanel max maxheight maxlength maxpos maxrows maxwidth member menu menuactive min minheight minresultsforpopup minwidth mode modifiers mousethrough movetoclick multiline multiple name negate newlines next noautofocus noautohide noinitialfocus nomatch norestorefocus object observes onbeforeaccept onbookmarkgroup onchange onclick onclosetab oncommand oncommandupdate ondialogaccept ondialogcancel ondialogclosure ondialogextra1 ondialogextra2 ondialoghelp onerror onerrorcommand onextra1 onextra2 oninput onload onnewtab onpageadvanced onpagehide onpagerewound onpageshow onpaneload onpopuphidden onpopuphiding onpopupshowing onpopupshown onsearchcomplete onselect ontextcommand ontextentered ontextrevert ontextreverted onunload onwiza...
textbox (Toolkit autocomplete) - Archive of obsolete content
e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. disablekeynavigation type: boolean if this attribute is not used, the user can navigate to specific items within the element by pressing keys corresponding to letters in the item's label. this is done incrementally, so typing more letters with select more specific items. this feature may be disabled by setting this attribute to true. note: for seamonkey 2.0 and al...
...ues. there are several attributes that allow the number textbox to be configured, including decimalplaces, min, max, increment, wraparound, hidespinbuttons, and textbox.value. password a textbox that hides what is typed, used for entering passwords. search a textbox intended for searching. the command event will fire as the user modifies the value. a listener for the command event should update search results. if the searchbutton attribute is set to true, the command event is only fired if the user presses the search button or presses the enter key. you may specify grey text to appear when the search box is empty using the emptytext attribute, and a timeout may be set for the command event using the timeout attribute (defaults to 500). timed this textbox will fire a command event ...
Textbox (XPFE autocomplete) - Archive of obsolete content
e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. disablehistory obsolete since gecko 2.0 type: boolean note: applies to: thunderbird and seamonkeyif false, an arrow button will appear on the end of the textbox which will open a dropdown menu of all available results. the default value is true, hiding the dropdown button. this attribute only works correctly in seamonkey 1.x; for thunderbird and seamonkey 2.0 you shou...
...ues. there are several attributes that allow the number textbox to be configured, including decimalplaces, min, max, increment, wraparound, hidespinbuttons, and textbox.value. password a textbox that hides what is typed, used for entering passwords. search a textbox intended for searching. the command event will fire as the user modifies the value. a listener for the command event should update search results. if the searchbutton attribute is set to true, the command event is only fired if the user presses the search button or presses the enter key. you may specify grey text to appear when the search box is empty using the emptytext attribute, and a timeout may be set for the command event using the timeout attribute (defaults to 500). timed this textbox will fire a command event ...
Commands - Archive of obsolete content
l often use a single controller for multiple related commands. the iscommandenabled method returns true if the command should be enabled. in this case, we check if there is a selected item in the listbox and return true if there is. if there is no selection, false is returned. if you delete all the rows in the example, the delete command will become disabled. you may have to click the listbox to update the menu in this simple example. the docommand method will be called when the delete menu item is selected, and this will cause the selected row in the listbox to be deleted. nothing needs to happen for the onevent method, so no code is added for this method. override default controller we attach this controller to the listbox by calling the appendcontroller method of the listbox's controllers.
... « previousnext » ...
Install Scripts - Archive of obsolete content
« previousnext » this section describes the install script. creating an install script note: for firefox extensions, install.js are no longer used. you should create a install.rdf instead. you will usually want some form of control over your install process. for example, you may wish to check versions of files and only install updated files, or perhaps you wish to apply patches to existing files. the install script is even flexible enough to allow you to uninstall files. for this reason, installers include an install script to handle the installation process. the installer script must be called install.js and must be placed at the top level of the installer archive. the script will contain javascript code which calls a number of install functions. in an html document, or a xu...
...use of this, you can easily specify a number of files to be installed, come across some kind of error, and abort the whole process without modifying the user's system. the component registry mozilla maintains a file which is a registry of all the components that are currently installed. components include new chrome packages, skins and plugins. when a new component is installed, the registry gets updated. the registry also stores the set of files and version information about the installed components. that way, it is easier to check if a version of your component is already present and only update it if necessary. the component registry works somewhat like the windows registry does. it consists of a hierarchy of keys and values. you don't need to know much about it to create xul applications unl...
Modifying a XUL Interface - Archive of obsolete content
ton in the group and well as change it. changing a element disabled or enabled it is common to disable particular fields that don't apply in a given situation. for example, in a preferences dialog, one might have the choice of several possibilities, but one choice allows additional customization. here is an example of how to create this type of interface. ...
... might have the choice of several possibilities, but one choice allows additional customization. here is an example of how to create this type of interface. example 7 : source view <script> function updatestate(){ var name = document.getelementbyid("name"); var sindex = document.getelementbyid("group").selectedindex; name.disabled = sindex == 0; } </script> <radiogroup id="group" onselect="updatestate();"> <radio label="random name" selected="true"/> <hbox> <radio label="specify a name:"/> <textbox id="name" value="jim" disabled="true"/> </hbox> </radiogroup> in this example a function updatestate() is called whenever a select event is fired on the radio group. this will happen whenever a radio button is selected. this function will retrieve the currently selected radio ele...
More Event Handlers - Archive of obsolete content
the coordinates of the mouse position where the event occurred. there are two sets of coordinates. the first is the screenx and screeny properties and are relative to the top left corner of the screen. the second set, clientx and clienty, are relative to the top left corner of the document. here is an example which displays the current mouse coordinates: example 4 : source view <script> function updatemousecoordinates(e){ var text = "x:" + e.clientx + " y:" + e.clienty; document.getelementbyid("xy").value = text; } </script> <label id="xy"/> <hbox width="400" height="400" onmousemove="updatemousecoordinates(event);"/> in this example, the size of the box has been set explicitly so the effect is easier to see. the event handler gets the clientx and clienty properties and creates a string f...
...if you move the mouse quickly across the border of the box, you might notice that the coordinates don't generally stop right at 400. ...
Skinning XUL Files by Hand - Archive of obsolete content
applications such as the mozilla browser. what you have done manually in this article will be done dynamically and much more completely by a mechanism called thechrome registry. this needs rewording: , which, like the windows registry, is a database in which information about a user's software and environment can be recorded and accessed as necessary. software components and users will be able to update the chrome registry and change the global skin. and with the advent of new css2 conventions like positioning, the changes you can make to the presentation and behavior of the basic structure in a xul file is dramatic. the syntax for creating all this information with text -- added to the distributed nature and the sheer volume of text required to define a single chrome -- can sometimes make the ...
...ion of these interfaces is equally democratic. ...
The Implementation of the Application Object Model - Archive of obsolete content
y. this capability is desirable for two reasons. what is local/remote merging good for? the first reason to have local/remote merging is that a remote file must be able to reference local data and have it merged in with the information that it specified. an example of this feature is a downloadable file that describes the user's main bookmarks folder. because the file lives remotely, it can be updated whenever the owner of the web site sees fit. a site admin could add new bookmarks to the file, and then the user would pick them up. however, in order for this to work, the local bookmarks have to be merged in with the remote bookmarks specified by the site. the second reason to have local/remote merging is to save state and/or to record customizations that the user has made to his or her user i...
...aces. this layer would serve several useful functions. first of all it could streamline the redundancy in the interface methods and present a new interface for pluggable content that was much smaller and easier to plug into than the 4-5 interfaces required if directly implementing the content tree interfaces. furthermore, should the content tree interfaces change, only this layer would need to be updated. the pluggable content, safe behind this layer, wouldn't have to change at all. one natural solution to try for implementing such a layer might be inheritance. however, in this xpcom world, where each type of pluggable content is off in its own dll, there's no clean way to inherit functionality from some base class implementation, when that implementation must necessarily reside in a different d...
menulist - Archive of obsolete content
dth, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } disableautoselect type: boolean if this attribute is true or omitted, the selected item on the menu will update to match what the user entered in the textbox. if the text does not match any of the items in the list, the menu selection is cleared. if this attribute is false, the selection is never updated to match the text box. this attribute applies only to editable menulists. disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled.
...e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. editable type: boolean indicates that the value of the menulist can be modified by typing directly into the value field. this is rendered as a textbox with a drop-down arrow beside it. the user may enter text into the textbox or select one of the choices by clicking from the drop-down. focused type: boolean this attribute is true if the element is focused. ...
preference - Archive of obsolete content
e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. instantapply type: boolean if true, the preference will be changed as soon as the user interface is modified. inverted type: boolean for boolean preferences, if this attribute is set to true, it indicates that the value of the preference is the reverse of the user interface element attached to it. for instance, checking the checkbox disables the preference in...
...be written to preferences based on the current state of the supplied element. this function calls onsynctopreference. boolean iselementeditable(in domelement element) returns true, if the given element is "editable" (see below). void setelementvalue(in domelement element); initializes the supplied element from the value stored in the preference. this function calls onsyncfrompreference. void updateelements(); update all elements that observe this preference. inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(...
toolbar - Archive of obsolete content
s on the toolbar. this will be modified when the user customizes the toolbar. the value of this attribute should be a comma-separated list of item ids from the toolbarpalette or, additionally, any of the following strings: "separator", "spring", "spacer". customindex not in seamonkey 1.x type: integer this value is the index of the toolbar in the list of the custom toolbars. the value is updated automatically by the toolbar customization dialog. customizable not in seamonkey 1.x type: boolean set this attribute to true on toolbars that can be customized. this causes the set of buttons to be persisted across sessions. defaultset not in seamonkey 1.x type: comma-separated list of item ids the default set of displayed items on the toolbar. this should be set to a comma-se...
...of strings holds a comma-separated list of the ids of the items currently on the toolbar. for spacers, separators, and flexible spacers the following strings are used instead of ids: "spacer", "separator", "spring". an empty toolbar has a currentset value of "__empty". you may change the current set of items by setting this property. be careful, as setting this property doesn't automatically update the currentset attribute. firstpermanentchild not in seamonkey 1.x type: element the first permanent child of the toolbar. a permanent child is one that is not customizable and remains on the toolbar. items that are placed directly inside the toolbar without being in the toolbarpalette are permanent. lastpermanentchild not in seamonkey 1.x type: element the last permanent child ...
tree - Archive of obsolete content
Archive › Mozilla › XUL › tree
within the treechildren element. in this situation, a content view (which implements the interface nsitreecontentview) which is a more specialized type of view, uses the treeitem elements and their descendants to determine the data to display in the tree. however, the treeitems are not displayed directly; they are used only as data to the content view. however, the content view will automatically update the tree if treeitems are changed. rdf tree nsitreeview, nsixultreebuilder no this tree is generated from an rdf datasource. it is used when a tree has a datasources attribute, and has dont-build-content in its flags attribute. for this tree, the data comes directly from the rdf datasource. dom treeitems are not created. even though the template uses treeitem elements to define ...
...e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. disablekeynavigation type: boolean if this attribute is not used, the user can navigate to specific items within the element by pressing keys corresponding to letters in the item's label. this is done incrementally, so typing more letters with select more specific items. this feature may be disabled by setting this attribute to true. editable type: boolean indi...
CommandLine - Archive of obsolete content
toolkit.singletonwindowtype for more information), the last example still applies the first time your application is launched. however, if you'd like to retrieve the latest command line arguments (to open a file for example), a possible solution is to create your own command line handler. for the sake of simplicity, the proposed solution involves the observer service to notify observers that the updated arguments are available. a similar and better way to implement this solution is by defining argument specific handlers with registering and unregistering functions in your command line handler service. this has the advantage to accumulate unhandled arguments until a specific handler is added. this approach has been used in songbird. example notice the changes since gecko 2.0 (component registr...
...ss"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="main" title="&window.title;" windowtype="xulmine" style="width: 300px; height: 350px;" persist="screenx screeny width height sizemode"> <script type="application/javascript" src="cmdline.js" /> ... </window> original document information author: georges-etienne legendre last updated date: august 21st, 2007 ...
XUL Explorer - Archive of obsolete content
or. the xul can be loaded from and saved to files. a xul validator and the error console are both available to help debug problems. the help menu provides access to xul information on mdc. there is even simple “keyword” help lookup for xul elements. roadmap features: the preview pane can be toggled with the editor. previewing in a popup window is still available. option to automatically update the preview as the editor changes. indicator in the statusbar shows errors. double-click to display error console. option to specify the snippet used to load the editor on startup. option to include a user snippet file. the snippets are merged with the built-in snippets at startup. double-click or drag-and-drop to insert a snippet file > new allows user to pick any “template” snippet, as...
...explorer:planning#feature_planning_for_xul_explorer. ...
Mozilla.dev.apps.firefox-2006-09-29 - Archive of obsolete content
binding tab bar to new theme discussion about how to bind a new theme to a tab bar without losing its original binding. ...
...e distributor university students working on cache distribution project - looking for help for how to tap the http requests. there have been no responses so far. can't view keith olbermann videos a user inability to launch videos, worked fine for others, ended up being a flash version problem. firefox 2 on windows vista discussion about the "state of affairs" of firefox 2 on windows vista rc1 - update for rc1 listed in update history as 'install pending' right-click "copy email address" - bug 353102 a proposed bug fix to the 'copy email address' bug how to use the rss feeds discovery & parsing tool in another open source project? a user looking to be pointed in the right direction of how to use the rss feeds discovery & parsing tool. meetings none this week. authors sara minchella (...
2006-09-29 - Archive of obsolete content
binding tab bar to new theme discussion about how to bind a new theme to a tab bar without losing its original binding. ...
...e distributor university students working on cache distribution project - looking for help for how to tap the http requests. there have been no responses so far. can't view keith olbermann videos a user inability to launch videos, worked fine for others, ended up being a flash version problem. firefox 2 on windows vista discussion about the "state of affairs" of firefox 2 on windows vista rc1 - update for rc1 listed in update history as 'install pending' right-click "copy email address" - bug 353102 a proposed bug fix to the 'copy email address' bug how to use the rss feeds discovery & parsing tool in another open source project? a user looking to be pointed in the right direction of how to use the rss feeds discovery & parsing tool. meetings none this week. authors sara minchella (...
2006-11-24 - Archive of obsolete content
summary: mozilla.dev.apps.firefox - november 17, 2006 - november 24, 2006 announcements none this week. discussions microsummary w/ script a user created patch that will allow script to run in a sandbox during the update of a microsummary. they would like to discuss the use of it in bug 361026 rich results for searches a proposal for a search tool that gives users a quicker path to specific information they are looking for. ...
... 24, 2006 announcements none this week. discussions microsummary w/ script a user created patch that will allow script to run in a sandbox during the update of a microsummary. they would like to discuss the use of it in bug 361026 rich results for searches a proposal for a search tool that gives users a quicker path to specific information they are looking for. trunk builds + winxp update = broken? a user questions if there is something broken in a nightly build since the user keeps getting this error from the trunk: "firefox.exe - application error: the application failed to initialize properly." removal of false positives in firefox 2 phishing a user inquires how to remove false positives from the firefox phising filters. meetings none this week. authors sara minche...
2006-10-06 - Archive of obsolete content
3c code. q & a q: walt experienced an unusual behaviour in his build and wanted to perform an experiment to figure out the problem, but he couldn't find the mozilla.org's config file. a: robert helmer pointed out the mozilla.org's config file could be found here and to look for -->mozconfig<---------------------------------------- -->end mozconfig<---------------------------------------- updated: developer documentation issues for thunderbird 2 eric shepherd has requested feedback for any developer documentation issues that might need dealing with for thunderbird 2. discussion highlights: ziga sancin suggests writing an introductory article for potential developers containing basic project information (history, list of main developers, project goals, roadmap and available communicati...
...uctures along with documentation about extracting them. brian king also mentions that documentation on handling message headers on the ui side would be helpful. cédric corazza recommends that the proposed documention should be made available on the l10n cvs once it reaches a decent stage so that localizers can get a head-start on the localization before the final version is made available. updated : need ui to rearrange tags peter lairo suggested some ui should be available for rearranging tags. related: bug 342065 meetings none for this week. ...
2006-10-06 - Archive of obsolete content
preed followed up and said that the checker was run and "build is go for launch". re: sunbird and lightning 0.3rc1 available sunbird and lightning 0.3rc1 is announced. this launches a (misguided?) discussion and comparison of sunbird and lightning to outlook. ...
...ions work with ff2. also invites people to file bugs about extensions that don't work. also invites people to help extension developers test for compatibility (link to a bunch of extension compatability bugs) discussions reining in the release process a discussion of what can be done to speed up the release process. the new roadmap - will there be something sometime? simon paquet asked for an update of the road map and either update or removal of the planning blog. adam gutherie replied that cbeard's blog post from nov 2005 is as close to a roadmap as exists right now and agrees that needs to be done about this. re: plan to hold trunk closed for lack of talkback dbaron mentioned that maybe trunk should be closed because of lack of talkbacks received ( bug 354835 is suspected). pal-moz offe...
NPEvent - Archive of obsolete content
event type. lparam 32 bit field for the windows event parameter; parameter value depends upon event type. eventrecord npevent on mac os npevent is defined as an eventrecord data structure, which has the following fields: what integer representing an event type. both windowed and windowless plug-ins receive the same events. values: 0 nullevent 1 mousedown 2 mouseup 3 keydown 4 keyup 5 autokey 6 updateevt 7 diskevt 8 activateevt 15 osevt 23 khighlevelevent getfocusevent 0, 1 (true, false) losefocusevent adjustcursorevent 0, 1 (true, false) for information about these events, see the mac os developer documentation. message longint. additional information about the event. type of information depends on the event type. undefined for null, mouseup, and mousedown events. when longint. ticks sin...
... the npevent object represents an event passed by npp_handleevent() to a windowless plug-in. this structure is defined as eventrecord, the event type used by mac os. on mac os, plug-ins receive the same events for both windowed and windowless plug-ins, as follows. mouse events: sent if the mouse is within the bounds of the instance. key events: sent if the instance has text focus (see below). update events: sent if the update region intersects the instance's bounds. activate events: sent to all instances in the window being activate or deactivated. suspend/resume events: sent to all instances in all windows. null events: sent to all instances in all windows. in addition to these standard types, the browser provides three additional event types that can be passed in the what field of the ...
Shipping a plugin as a Toolkit bundle - Archive of obsolete content
says which versions of an application the plugin is compatible with. it includes the application id and the minimum and maximum version of the application that the plugin works with. there can be multiple targetapplication blocks listed. the unpack property is necessary to tell applications using newer versions of gecko to unpack the plugin because dlls can't be loaded from xpi files. ...
...plication id and the minimum and maximum version of the application that the plugin works with. there can be multiple targetapplication blocks listed. the unpack property is necessary to tell applications using newer versions of gecko to unpack the plugin because dlls can't be loaded from xpi files. providing updates when plugins are packaged in this way they can make use of the built in add-on update system. this allows a remote update file to be read periodically and an updated version of the plugin offered to the user or to mark the plugin as compatible with a wider range of applications. this is performed by including an updateurl in the install manifest. this should point to an update.rdf file on the internet which will include the updated versions and version information for the plugin. ...
NSPR Release Engineering Guide - Archive of obsolete content
this paper is for engineers performing formal release for the netscape portable runtime (nspr) across all platforms. nspr generally follows the iplanet product lifecycle. ...
...o /share/builds/components/nspr20/.vx.y.z in /share/builds/components/nspr20/ run the following scripts: explode.pl rename.sh symlink.sh rtm bits rename the .vx.y.z directory to vx.y.z (remove the hidden directory 'dot'). copy /share/builds/components/nspr20/vx.y.z/* to /share/systems/mozilla/pub/nspr/vx.y.z/ original document information author: larryh@netscape.com last updated date: september 20, 2000 1 copying files to /share/builds/components requires that one be logged on to a machine named "smithers" as user "svbld". the password to this account is restricted to a small set of designated release engineers. ...
Updating an extension to support multiple Mozilla applications - Archive of obsolete content
we'll build upon the stock watcher extension created in earlier articles in this series, updating it so it can also be used in thunderbird and sunbird (previous versions worked only in firefox). ...
...rough 2.0.0.x, sunbird versions 0.2 through 0.4.x. after inserting this code, you can successfully install the extension into any (or all) of firefox, thunderbird, and sunbird, but you won't see any effect in thunderbird and sunbird. that's because there's nothing telling those two applications what to do with the chrome provided by the extension. that's where the chrome manifest comes into play. update the chrome manifest remember way back in the first article in this series when we created our chrome manifest, which we haven't touched since? it's time to touch it. as you may (or may not) recall, that file tells the application what xul code your extension's interface needs to overlay onto. for firefox, we overlaid onto browser.xul, which describes a firefox browser window. we need to add lines...
Browser Feature Detection - Archive of obsolete content
note: this reprinted article was originally part of the devedge site. ...
... note: this reprinted article was originally part of the devedge site. ...
Processing XML with E4X - Archive of obsolete content
attribute names as well as attribute values: var a = 'att'; var b = <b {a}='value'/>; alert(b); // gives: <b att="value"/> ...one cannot interpolate a whole expression at once (e.g., <b {a}>.) after executing the above example, the variable languages references an xml object corresponding to the <languages> node in the xml document. ...
...l syntax without needing to create a well-formed xml document, using the following syntax: var xmllist = <> <lang>javascript</lang> <lang>python</lang> </>; the += operator can be used to append new elements to an xmllist within a document: languages.lang += <lang>ruby</lang>; note that unlike node lists returned by regular dom methods, xmllists are static and are not automatically updated to reflect changes in the dom. if you create an xmllist as a subset of an existing xml object and then modify the original xml object, the xmllist will not reflect those changes; you will need to re-create it to get the most recent updates: var languages = <languages> <lang>javascript</lang> <lang>python</lang> </languages>; var lang = languages.lang; alert(lang.length()); // alerts ...
ECMAScript 2016 to ES.Next support in Mozilla - Archive of obsolete content
(may 2019) ecmascript next refers to new features of the ecma-262 standard (commonly referred to as javascript) introduced after ecmascript 2015. new versions of ecmascript specifications are released yearly. so far, es2016, es2017, and es2018 have been released. this year, the es2019 specification will be released and es2020 is the current ecmascript draft specification. you can see the latest proposals on the tc39/ecma262 github repository. a channel for feedback on ecmascript standards is es-discuss. below is a list of features in es2016+ and what version of firefox they were implemented in. ...
...array.flatmap() (firefox 62) object.fromentries() (firefox 63) string.trimstart() and string.trimend() (firefox 61) optional catch binding (firefox 58) function.tostring() revision (firefox 54) symbol.description (firefox 63) well-formed json.stringify() (firefox 64) ecmascript 2020 this is the current es.next version. implemented proposals not in es.next this section needs to be updated to reflect current changes. (may 2019) the following features are already implemented, but only available in the firefox nightly channel and not yet included in a draft edition of an ecmascript specification. additions to the arraybuffer object arraybuffer.transfer() (spec) new typedobject objects based on typed objects draft, and exposed via a global typedobject object, e.g. typedobje...
New in JavaScript 1.7 - Archive of obsolete content
using javascript 1.7 in order to use some of the new features of javascript 1.7, you need to specify that you wish to use javascript 1.7. ...
... might use those keywords as variable or function names. the features that do not introduce new keywords (destructuring assignment and array comprehensions) can be used without specifying the javascript version. new features in javascript 1.7 the following features added with javascript 1.7 were not part of an ecma-262 standard at the time. in more recent firefox versions, the implementation is updated to work with semantics as specified in ecmascript edition 6. please see the reference pages for differences. iterators and generators array comprehensions let statement (support for let expression was dropped in gecko 41, see bug 1023609). const statement destructuring assignment (support for js1.7 style destructuring for-in was dropped in gecko 40, see bug 1083498). ...
Object.unobserve() - Archive of obsolete content
strawman proposal specification. ...
...strawman proposal specification. ...
XForms Select Element - Archive of obsolete content
st - default representation (xhtml/xul) check group- used when appearance = 'full' (xhtml/xul) list displaying a listbox is the default representation (xhtml/xul). characteristics analogous widgets are <html:select size="5" multiple="true"/> and <xul:listbox seltype="multiple"/> visual grouping by choices element isn't implemented if incremental attribute value is false, the bound node is updated when the select control is blurred (i.e. loses focus), otherwise it is updated upon item selection check group the select is represented as group of checkboxes (xhtml/xul). characteristics appearance attribute contains the value full there are no analogue widgets in xhtml or in xul visual grouping by choices element is supported if incremental attribute value is false then bound node is ...
...d when the select control is blurred (i.e. loses focus), otherwise it is updated upon item selection check group the select is represented as group of checkboxes (xhtml/xul). ...
Windows Media in Netscape - Archive of obsolete content
rd way of writing scripts that handle information sent by a plugin or control. a good illustration of the use of this non-standard script element syntax is in creating closed captioning of media content. automatic closed captioning does not work in netscape 7.1 as it does in ie. in ie, a named html element such as a div may be given to the windows media player control and it will be automatically updated with caption data. this does not work in gecko because it requires ie dom functionality that has not been implemented. fortunately, windows media player also fires a scriptcommand() event for closed captioning, which means content may update the caption manually with a small piece of javascript. for example, in ie it is possible to do this: player.closedcaption.captioningid = "captext"; here, "...
...min-object-usage.html sample shows a minimalist control manipulated by scripting and html buttons. an object element creates the controls. the embedded-audio-video.html shows both scripting the control and callbacks. closecap-outtakes.html shows the closed captioning workaround and scripting. original document information authors: arun ranganathan, bob clary, ian oeschger last updated date: 30 jun 2003 copyright information: copyright © 2001-2003 netscape. all rights reserved. ...
Common causes of memory leaks in extensions - Extensions
ing a reference to leakref will prevent // that function object from being garbage collected and hence // will leak the whole bootstrap compartment. document.body.someproperty = leakref; } see also kris maglione's guide to cleaning up bootstrapped extensions. failing to clean up event listeners extensions can be disabled and removed by user actions, but it also happens when an add-on is updated. if a bootstrapped (restartless) extension fails to clean up event listeners when disabled or removed, the listeners will still reference the enclosing scope — usually the bootstrap.js sandbox — and therefore keep that scope (and its enclosing compartment) alive until the window is unloaded. if the window in question is browser.xul or some long-lived web app such as gmail, the leaked compart...
...meters or other interfaces and will keep strong references around. please see the corresponding documentation of these services on how to properly unregister/remove your observers and components during unload. forgetting to unload javascript modules in restartless add-ons another common cause of leaks is forgetting to unload javascript code modules in bootstrapped add-ons. when your add-on gets updated and re-enabled, the previous module version that is still loaded will be used, which might break your add-on entirely. the following example shows how to unload your modules again (bootstrap.js): components.utils.import("resource://gre/modules/services.jsm"); function startup(data, reason) { // this assumes your add-on did register some chrome components.utils.import("chrome://myaddon/con...
Audio for Web games - Game development
dy to go. to do this we can just play and instantly pause the larger piece of audio. you'll also reduce the number of server requests and save bandwidth. var myaudio = document.createelement("audio"); myaudio.src = "mysprite.mp3"; myaudio.play(); myaudio.pause(); you'll need to sample the current time to know when to stop. if you space your individual sounds by at least 500ms then using the timeupdate event (which fires every 250ms) should be sufficient. your files may be slightly longer than they strictly need to be, but silence compresses well. here's an example of an audio sprite player — first let's set up the user interface in html: <audio id="myaudio" src="https://udn.realityripple.com/samples/f0/2909c16512.mp3"></audio> <button data-start="18" data-stop="19">0</button> <button data-...
... note: on mobile we may need to trigger this code from a user-initiated event such as a start button being pressed, as described above. note: watch out for bit rates. encoding your audio at lower bit rates means smaller file sizes but lower se...
Bounce off the walls - Game development
llision we will check whether the ball is touching (colliding with) the wall, and if so, we will change the direction of its movement accordingly. to make the calculations easier let's define a variable called ballradius that will hold the radius of the drawn circle and be used for calculations. add this to your code, somewhere below the existing variable declarations: var ballradius = 10; now update the line that draws the ball inside the drawball() function to this: ctx.arc(x, y, ballradius, 0, math.pi*2); bouncing off the top and bottom there are four walls to bounce the ball off — let's focus on the top one first. we need to check, on every frame, whether the ball is touching the top edge of the canvas — if yes, we'll reverse the ball movement so it will start to move in the opposi...
...blem however — when the ball hits each wall it sinks into it slightly before changing direction: this is because we're calculating the collision point of the wall and the center of the ball, while we should be doing it for its circumference. the ball should bounce right after if touches the wall, not when it's already halfway in the wall, so let's adjust our statements a bit to include that. update the last code you added to this: if(x + dx > canvas.width-ballradius || x + dx < ballradius) { dx = -dx; } if(y + dy > canvas.height-ballradius || y + dy < ballradius) { dy = -dy; } when the distance between the center of the ball and the edge of the wall is exactly the same as the radius of the ball, it will change the movement direction. subtracting the radius from one edge's width an...
Animations and tweens - Game development
e above array says that we are displaying frame 0, then 1, then 0, etc. the framerate, in fps. since we are running the animation at 24fps and there are 9 frames, the animation will display just under three times per second. ...
...will display just under three times per second. applying the animation when the ball hits the paddle in the arcade.collide() method call that handles the collision between the ball and the paddle (the first line inside update(), see below) we can add an extra parameter that specifies a function to be executed every time the collision happens, in the same fashion as the ballhitbrick() function. update the first line inside update() as shown below: function update() { game.physics.arcade.collide(ball, paddle, ballhitpaddle); game.physics.arcade.collide(ball, bricks, ballhitbrick); paddle.x = game.input.x || game.world.width*0.5; } then we can create the ballhitpaddle() function (having ball and paddle as default parameters), playing the wobble animation when it is called. add the...
Move the ball - Game development
his is the 4th step out of 16 of the gamedev phaser tutorial. you can find the source code as it should look after completing this lesson at gamedev-phaser-content-kit/demos/lesson04.html. we have our blue ball printed on screen, but it's doing nothing — it would be cool to make it move somehow. this article covers how to do just that. ...
...on at gamedev-phaser-content-kit/demos/lesson04.html. we have our blue ball printed on screen, but it's doing nothing — it would be cool to make it move somehow. this article covers how to do just that. updating the ball's position on each frame remember the update() function and its definition? the code inside it is executed on every frame, so it's a perfect place to put the code that will update the ball's position on screen. add the following new lines of the code inside update(), as shown: function update() { ball.x += 1; ball.y += 1; } the code above adds 1 to the x and y properties representing the the ball coordinates on the canvas, on each frame. reload index.html and you should see the ball rolling across the screen. compare your code you can check the finished code f...
Physics - Game development
our ball for the physics system — phaser object physics is not enabled by default. add the following line at the bottom of the create() function: game.physics.enable(ball, phaser.physics.arcade); next, if we want to move our ball on the screen, we can set velocity on its body. add the following line, again at the bottom of create(): ball.body.velocity.set(150, 150); removing our previous update instructions remember to remove our old method of adding values to x and y from the update() function: function update() { ball.x += 1; ball.y += 1; } we are now handling this properly, with a physics engine. final code check the latest code should look like this: var ball; function preload() { game.scale.scalemode = phaser.scalemanager.show_all; game.scale.pagealignhorizo...
...at the moment, the physics engine has gravity and friction set to zero. adding gravity would result in the ball falling down while friction would eventually stop the ball. fun with physics you can do much more with physics, for example by adding ball.body.gravity.y = 100; you will set the...
OTA - MDN Web Docs Glossary: Definitions of Web-related terms
over the air (ota) refers to automatic updating of software on connected devices from a central server. all device owners receiving a given set of updates are on the same "channel", and each device often can access several channels (e.g. for production or engineering builds). ...
... over the air (ota) refers to automatic updating of software on connected devices from a central server. all device owners receiving a given set of updates are on the same "channel", and each device often can access several channels (e.g. for production or engineering builds). ...
Accessible multimedia - Learn web development
the total media duration, or if the media is not playing, when the fwd button is pressed. if either conditions are true, we simply stop the video, to avoid the user interface going wrong if they attempt to fast forward when the video is not playing, or fast forward past the end of the video. ...
...it works out the number of minutes and seconds from the given currenttime value (which is in seconds), adds a leading 0 if either the minute or second value is less than 10, and then creates the display readout and adds it to the time label. further reading this gives you a basic idea of how to add custom player functionality to video/audio player inst...
CSS values and units - Learn web development
opaque. in the example below i have added a background image to the containing block of our colored boxes. i have then set the boxes to have different opacity values — notice how the background shows through more when the alpha channel value is smaller. in this example, try changing the alpha channel values to see how it affects the color output. note: at some point modern browsers were updated so that rgba() and rgb(), and hsl() and hsla() (see below), became pure aliases of each other and started to behave exactly the same. so for example both rgba() and rgb() accept colors with and without alpha channel values. try changing the above example's rgba() functions to rgb() and see if the colors still work! which style you use is up to you, but separating out non-transparent and transpar...
...g the angles round a color wheel. saturation: how saturated is the color? this takes a value from 0–100%, where 0 is no color (it will appear as a shade of grey), and 100% is full color saturation lightness: how light or bright is the color? this takes a value from 0–100%, where 0 is no light (it will appear completely black) and 100% is full light (it will appear completely white) we can update the rgb example to use hsl colors like this: just as rgb has rgba, hsl has an hsla equivalent, which gives you the same ability to specify the alpha channel. i've demonstrated this below by changing my rgba example to use hsla colors. you can use any of these color values in your projects. it is likely that for most projects you will decide on a color palette and then use those colors —...
Client-side form validation - Learn web development
optionally followed by any number of bs, followed by c. ( ac , abc, abbbbbc, and so on). a|b — matches one character that is a or b. abc|xyz — matches exactly abc or exactly xyz (but not abcxyz or a or y, and so on). there are many more possibilities that we don't cover here. for a complete list and many examples, consult our regular expressions documentation. let's implement an example. ...
...ntation. let's implement an example. update your html to add a pattern attribute like this: <form> <label for="choose">would you prefer a banana or a cherry?</label> <input id="choose" name="i_like" required pattern="[bb]anana|[cc]herry"> <button>submit</button> </form> input:invalid { border: 2px dashed red; } input:valid { border: 2px solid black; } this gives us the following update — try it out: note: you can find this example live on github as fruit-pattern.html (see also the source code.) in this example, the <input> element accepts one of four possible values: the strings "banana", "banana", "cherry", or "cherry". regular expressions are case-sensitive, but we've made it support capitalized as well as lower-case versions using an extra "aa" pattern nested inside ...
The HTML5 input types - Learn web development
an <output> element — to contain the current value (we'll also look at this element in the next article). you could display an input value or the output of a calculation inside any element, but <output> is special — like <label>, it can take a for attribute that allows you to associate it with the element or elements that the output value came from. to actually display the current value, and update it as it changed, you must use javascript, but this is relatively easy to do: const price = document.queryselector('#price'); const output = document.queryselector('.price-output'); output.textcontent = price.value; price.addeventlistener('input', function() { output.textcontent = price.value; }); here we store references to the range input and the output in two variables. then we immediate...
...'); output.textcontent = price.value; price.addeventlistener('input', function() { output.textcontent = price.value; }); here we store references to the range input and the output in two variables. then we immediately set the output's textcontent to the current value of the input. finally, an event listener is set to ensure that whenever the range slider is moved, the output's textcontent is updated to the new value. note: range inputs are not supported in versions of internet explorer below 10. date and time pickers gathering date and time values has traditionally been a nightmare for web developers. for good user experience, it is important to provide a calendar selection ui, enabling users to select dates without necessating context switching to a native calendar application or pote...
Test your skills: HTML5 controls - Learn web development
ions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. html5 controls 1 first let's explore some of the new html5 input types. create appropriate inputs for a user to update their details for: email website phone number favourite color try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. html5 controls 2 next, we want you to implement a slider control to allow the user to choose a maximum number of people to invite to their party. implement a b...
...rty. implement a basic slider control to go along with the provided label. give it a minimum value of 1, maximum value of 30, and initial value of 10. create a corresponding output element to put the current value of the slider into. give it a class of invite-output, and semantically associate it with the input. if you do this correctly, the javascript included on the page will automatically update the output value when the slider is moved. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. assessment or further help you can practice these examples in the interactive editors above. if you would like your work assessed, or are stuck and want to ask for help: put your work...
Your first form - Learn web development
think about designing them, and the basic html elements you'll need for simple cases. what are web forms? web forms are one of the main points of interaction between a user and a web site or application. forms allow users to enter data, which is generally sent to a web server for processing and storage (see sending form data later in the module), or used on the client-side to immediately update the interface in some way (for example, add another item to a list, or show or hide a ui feature). a web form's html is made up of one or more form controls (sometimes called widgets), plus some additional elements to help structure the overall form — they are often referred to as html forms. the controls can be single or multi-line text fields, dropdown boxes, buttons, checkboxes, or radio bu...
... the <li> elements are there to conveniently structure our code and make styling easier (see later in the article). for usability and accessibility, we include an explicit label for each form control. note the use of the for attribute on all <label> elements, which takes as its value the id of the form control with which it is associated — this is how you ...
Graceful asynchronous programming with Promises - Learn web development
it then calls getusermedia(), asking for a stream that has both video and audio tracks, then once that's been obtained, sets up a video element to show the stream coming from the camera as a "self view," then takes each of the stream's tracks and adds them to the webrtc rtcpeerconnection representing a conn...
...g that a call is being attempted. it then calls getusermedia(), asking for a stream that has both video and audio tracks, then once that's been obtained, sets up a video element to show the stream coming from the camera as a "self view," then takes each of the stream's tracks and adds them to the webrtc rtcpeerconnection representing a connection to another user. after that, the status display is updated to say "connected". if getusermedia() fails, the catch block runs. this uses setstatusmessage() to update the status box to indicate that an error occurred. the important thing here is that the getusermedia() call returns almost immediately, even if the camera stream hasn't been obtained yet. even if the handlecallbutton() function has already returned to the code that called it, when getuserm...
Test your skills: Functions - Learn web development
he provided <canvas> (reference variable canvas, context available in ctx), based on the five provided input variables: x — the x coordinate of the rectangle. y — the y coordinate of the rectangle. width — the width of the rectangle. height — the height of the rectangle. color — the color of the rectangle. you'll want to clear the canvas before drawing, so that when the code is updated in the case of the live version, you don't get lots of rectangles drawn on top of one another. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. functions 3 in this task, you return to the problem posed in task 1, with the aim of improving it. the three improvements we want you t...
...n your own editor or in an online editor. functions 3 in this task, you return to the problem posed in task 1, with the aim of improving it. the three improvements we want you to make are: refactor the code that generates the random number into a separate function called random(), which takes as parameters two generic bounds that the random number should be between, and returns the result. update the choosename() function so that it makes use of the random number function, takes the array to choose from as a parameter (making it more flexible), and returns the result. print the returned result into the paragraph (para)'s textcontent. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an onli...
JavaScript object basics - Learn web development
e that's already in your file, then saving and refreshing: const person = {}; now open your browser's javascript console, enter person into it, and press enter/return. you should get a result similar to one of the below lines: [object object] object { } { } congratulations, you've just created your first object. job done! but this is an empty object, so we can't really do much with it. let's update the javascript object in our file to look like this: const person = { name: ['bob', 'smith'], age: 32, gender: 'male', interests: ['music', 'skiing'], bio: function() { alert(this.name[0] + ' ' + this.name[1] + ' is ' + this.age + ' years old. he likes ' + this.interests[0] + ' and ' + this.interests[1] + '.'); }, greeting: function() { alert('hi! i\'m ' + this.name[0] + '.
...lly the same thing — instead of using an index number to select an item, you are using the name associated with each member's value. it is no wonder that objects are sometimes called associative arrays — they map strings to values in the same way that arrays map numbers to values. ...
Object prototypes - Learn web development
{ alert(this.name.first + ' has left the building. bye for now!'); }; save the code and load the page in the browser, and try entering the following into the text input: person1.farewell(); you should get an alert message displayed, featuring the person's name as defined inside the constructor. this is really useful, but what is even more useful is that the whole inheritance chain has updated dynamically, automatically making this new method available on all object instances derived from the constructor. think about this for a moment. in our code we define the constructor, then we create an instance object from the constructor, then we add a new method to the constructor's prototype: function person(first, last, age, gender, interests) { // property and method definitions } le...
...t, last, age, gender, interests) { // property and method definitions } let person1 = new person('tammi', 'smith', 32, 'neutral', ['music', 'skiing', 'kickboxing']); person.prototype.farewell = function() { alert(this.name.first + ' has left the building. bye for now!'); }; but the farewell() method is still available on the person1 object instance — its members have been automatically updated to include the newly defined farewell() method. note: if you are having trouble getting this example to work, have a look at our oojs-class-prototype.html example (see it running live also). you will rarely see properties defined on the prototype property, because they are not very flexible when defined like this. for example you could add a property like so: person.prototype.fullname = 'bo...
Introduction to the server side - Learn web development
you to tailor website content for individual users. dynamic sites can highlight content that is more relevant based on user preferences and habits. 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. it can even allow interaction with users of the site, sending notifications and updates via email or through other channels. all of these capabilities enable much deeper engagement with users. in the modern world of web development, learning about server-side development is highly recommended. what is server-side website programming? web browsers communicate with web servers using the hypertext transfer protocol (http). when you click a link on a web page, submit a form, or run ...
... burden on the server and the amount of data that needs to be sent). the server is not limited to sending information from databases, and might alternatively return the result of software tools, or data from communications services. the content can even be targeted for the type of client device that is receiving it. because the information is in a database, it can also more easily be shared and updated with other business systems (for example, when products are sold either online or in a shop, the shop might update its database of inventory). note: your imagination doesn't have to work hard to see the benefit of server-side code for efficient storage and delivery of information: go to amazon or some other e-commerce site. search for a number of keywords and note how the page structure do...
Ember resources and troubleshooting - Learn web development
how do i debug what's going on in the framework? for framework-specific things, there is the ember-inspector add-on, which allows inspection of: routes & controllers components services promises data (i.e: from a remote api — from ember-data, by default) deprecation information render performance for general javascript debugging, check out our guides on javascrip...
...these try to solve the problems of mut by introducing more obvious / "less magic" concepts, avoiding build-time transforms and implicit glimmer vm behavior. with ember-set-helper: <checkbox @value={{this.somedata}} @ontoggle={{set this "somedata" (not this.somedata)}} /> with ember-box: {{#let (box this.somedata) as |somedata|}} <checkbox @value={{unwrap somedata}} @ontoggle={{update somedata (not this.somedata)}} /> {{/let}} note that none of these solutions are particularly common among members of the community, and as a whole, people are still trying to figure out an ergonomic and simple api for setting data in a template-only context, without backing js. what is the purpose of controllers? controllers are singletons, which may help manage the rendering context of the...
Git and GitHub - Learn web development
sitories and several tools for working with them. this module aims to teach you what you need to know about both of them. overview vcses are essential for software development: it is rare that you will work on a project completely on your own, and as soon as you start working with other people you start to run the risk of conflicting with each other's work — this is when both of you try to update the same piece of code at the same time. you need to have some kind of mechanism in place to manage the occurences, and help avoid loss of work as a result. when working on a project on your own or with others, you'll want to be able to back up the code in a central place, so it is not lost if your computer breaks. you will also want to be able to roll back to earlier versions if a problem is l...
...u want to contribute to someone else's code. this guide explains how. about pull requests (from github) a useful guide to managing pull requests, the way that your suggested code changes are delivered to people's repositories for consideration. mastering issues (from github) issues are like a forum for your github project, where people can ask questions and report problems, and you can manage updates (for example assigning people to fix issues, clarifying the issue, letting people know things are fixed). this articles gives you what you need to know about issues. note: there is a lot more that you can do with git and github, but we feel that the above represents the minimum you need to know to start using git effectively. as you get deeper into git, you'll start to realise that it is easy...
Index
extension’s code hard to read. 684 themes add-ons, look & feel, themes themes allow you to change the look and feel of the user interface and personalize it to your tastes. learn how to create and share themes! 685 obsolete add-ons, archive, look & feel, obsolete, themes this page contains theme documents and resources that we don't expect will ever be updated, but which we're keeping for the time being as potential source material for updated docs. 686 theme concepts theme, add-on themes developed using the webextensions api in firefox enable you to change the look of the browser by adding images to the header area of the firefox browser; this is the area behind the menu bar, toolbars, address bar, search bar, and tab strip. ...
...ibution. 688 third party library usage add-ons, extensions, review policy to complete the review process at addons.mozilla.org (amo), reviewers must be able to verify the code in your extension. you may include third-party libraries in your extension. in that case, when you upload your extension to amo, you will need to provide links to the library source code. 689 updates firefox supports automated updates to add-ons using json update manifests. add-ons hosted on amo automatically receive updates to new versions posted there. other add-ons must specify the location of their update manifests. ...
How Mozilla's build system works
ctures are then read by a build backend generator, which then converts them into files, function calls, and so on. in the case of a make backend, the generator writes out makefiles. when config.status runs, you'll see the following output: reticulating splines... finished reading 1096 moz.build files into 1276 descriptors in 2.40s backend executed in 2.39s 2188 total backend files. 0 created; 1 updated; 2187 unchanged total wall time: 5.03s; cpu time: 3.79s; efficiency: 75% what this is saying is that a total of 1,096 moz.build files were read. altogether, 1,276 data structures describing the build configuration were derived from them. it took 2.40s wall time just to read these files and produce the data structures. the 1,276 data structures were fed into the build backend, which then determi...
...ogether, 1,276 data structures describing the build configuration were derived from them. it took 2.40s wall time just to read these files and produce the data structures. the 1,276 data structures were fed into the build backend, which then determined it had to manage 2,188 files derived from those data structures. most of the files already existed and didn't need to be changed. however, one was updated as a result of the new configuration. the whole process took 5.03s. of this, only 3.79s were in cpu time. this means we spent roughly 25% of the time waiting on i/o. phase 3: invocation of the build backend when most people think of the build system, they think of phase 3. this is where we take all the code in the tree and produce the firefox binary program file or the application you are crea...
Listening to events on all tabs
on changed. awebprogress the progress instance responsible for handling the events. arequest the nsirequest object representing the associated request. alocation an nsiuri object indicating the tab's new uri. aflags optional: this is a value which explains the situation or the reason why the location has changed. ...
... awebprogress the progress instance responsible for handling the events. arequest the nsirequest object representing the associated request. acurselfprogress the current progress for the request indicated by the request parameter. ...
Working with Mozilla source code
ode. this isn't a good way to download the code, but is a great way to search it. navigating the mozilla source code learn about the various folders in the mozilla source tree, and how to find what you're looking for. bugs for newcomers if you are new to the project and want something to work on, look here. interface development guide guidelines and documentation for how to create and update xpcom interfaces. the firefox codebase: css guidelines this document contains guidelines defining how css inside the firefox codebase should be written, it is notably relevant for firefox front-end engineers. svg cleanup guide guidelines and best practices for shipping new svgs. try servers mozilla products build on at least three platforms. if you don't have access to them all, you can use...
...st practices for shipping new svgs. try servers mozilla products build on at least three platforms. if you don't have access to them all, you can use the try servers to test your patches and make sure the tests pass. creating a patch once you've made a change to the mozilla code, the next step (after making sure it works) is to create a patch and submit it for review. this article needs to be updated fully for mercurial. getting commit access to the source code feel ready to join the few, the proud, the committers? find out how to get check-in access to the mozilla code. ...
Multiple Firefox profiles
t want a secondary profile for testing websites, apps, or other projects on different firefox channels. for example, you might want to have some extensions installed for web development, but not for general-purpose web browsing. while using the nightly channel, you may encounter some add-ons that have become temporarily incompatible with new api changes, until the add-on developer has a chance to update them. you can remove such add-ons from your profile for nightly use while keeping them for use with other profiles. for qa, testing, and bug triaging contributors, you may want to have multiple development versions of firefox installed, each with its own profile. creating new profiles for testing can keep you from losing your preferences, bookmarks, and history. it takes little time to set up a ...
...le keeping them for use with other profiles. for qa, testing, and bug triaging contributors, you may want to have multiple development versions of firefox installed, each with its own profile. creating new profiles for testing can keep you from losing your preferences, bookmarks, and history. it takes little time to set up a new profile, and once it is complete, all of your firefox versions will update separately and can be run simultaneously. available browser development channels there are four available browser channels, each at a different level of stability and development. the four channels are release, beta, developer edition, and nightly. the release channel is recommended for most users, as it is the "official release" channel. however, for those more adventurous, you can try one of ...
Using the Browser API
Mozilla › Gecko › Chrome › API › Browser API › Using
arted loading, and we change the button to a cross to indicate "stop". when the mozbrowserloadend event fires, the latest page request has finished loading, and at this point we want to change the icon back to the reload icon (in this case we are just using a capital "r"). notice that this is also where we call the canmovebwd() and canmovefwd() functions we discussed earlier — it makes sense to update the status of the back and forward buttons after each page reload. in addition, the background of the controls ui bar is changed to the background color of the site that has just loaded, to provide a more integrated experience — this can be read out of the event object's e.detail.backgroundcolor value. when the front page of https://developer.mozilla.org is loaded, for example, the e.detail.ba...
...o the background color of the site that has just loaded, to provide a more integrated experience — this can be read out of the event object's e.detail.backgroundcolor value. when the front page of https://developer.mozilla.org is loaded, for example, the e.detail.backgroundcolor value reported is rgb(0, 83, 159). back to the stop/reload button — updating the icon is nice, but we also need to update the functionality that is invoked when each icon is displayed. we do this with the following function, which runs the htmliframeelement.stop() method to stop the page loading if the button is displaying a cross, and the htmliframeelement.reload() method to reload the page otherwise. stopreload.addeventlistener('touchend',function() { if(stopreload.textcontent === 'x') { browser.stop(); }...
MozBeforePaint
the specified window during the current refresh interval should be considered to have started running. with that value in hand, you can then schedule all your subsequent animation frames. whenever you're ready to refresh your animation, you call the window.requestanimationframe() method. once you've called this, the mozbeforepaint event will be fired one time, when it's time for animations to be updated for the window's next animation frame. the timestamp property of this event will be set to the time when the animation frame is sampled; this is relevant when trying to synchronize mozrequestanimationframe animations with smil animations or css transitions. this allows multiple animations to remain in sync with one another within the context of a given window. frame rate control mozbeforepai...
...when the animation sequence completes, removes the event listener. you may take a look at this example live if you like. ...
Introduction to Layout in Mozilla
rs.reason set based on rc’s type incremental reflow propagate damage to frames later “in the flow” incremental reflow multiple reflow commands are batched nsreflowpath maintains a tree of target frames amortize state recovery and damage propagation cost painting as reflow proceeds through the frame hierarchy, areas are invalidated via nsiviewmanager::updateview unless immediate, invalid areas are coalesced and processed asynchronously via os expose event native expose event dispatched to widget; widget delegates to the view manager view manager paints views back-to-front, invoking presshell’s paint method presshell::paint walks from the view to the frame; invokes nsiframe::paint for each layer incrementalism single-threaded ...
... ...
Add-on Manager
getinstallforurl("http://www.foo.com/test.xpi", function(ainstall) { // ainstall is an instance of addoninstall ainstall.install(); }, "application/x-xpinstall"); the progress of addoninstalls can be monitored using an installlistener. a listener can be registered either for a specific install using the addlistener() method or for all installs using the addinstalllistener() method. finding updates add-ons can be checked for updates using the findupdates() method. it must be passed an updatelistener to receive information about compatibility information and new update information. any available update is returned as an addoninstall which is ready to be downloaded and installed. detecting add-on changes requires gecko 7.0(firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) you can a...
...and new update information. any available update is returned as an addoninstall which is ready to be downloaded and installed. detecting add-on changes requires gecko 7.0(firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) you can also get lists of add-ons that, at startup, were changed in various ways. the getstartupchanges() method lets you find out which add-ons were installed, removed, updated, enabled, or disabled at application startup. for example, to take a look at the add-ons that were disabled at startup: components.utils.import("resource://gre/modules/addonmanager.jsm"); let addonids = addonmanager.getstartupchanges(addonmanager.startup_change_disabled); if (addonids.length > 0) { // addonids is now an array of the add-on ids that have been disabled alert("note: " + addoni...
Log.jsm
progress is tracked in bugzilla using dependencies of bug 451283. the log.jsm javascript code module (formerly named log4moz.js) provides a log4j style api for logging log messages to various endpoints, such as the browser console or a file on disk. to use it, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/log.jsm"); basic usage components.utils.import("resource://gre/modules/log.jsm"); // get a logger, give it a name unique to this chunk of code. ...
... logmessage(); length: 4 keys of prototype: leveldesc logger(); length: 2 keys of prototype: addappender(); level logstructured(); name parent removeappender(); updateappenders(); and the methods mentioned below: logger methods loggerrepository(); length: 0 keys of prototype: getlogger(); rootlogger storagestreamappender(); length: 1 keys of prototype: doappend(); getinputstream(); ...
Bootstrapping a new locale
below $cd ab-cd/browser/chrome/browser) may be needs $cp -r mozilla-1.9.x/browser/locales/ ab-cd and then $mv ab-cd/en-us ab-cd/browser and the same for the others the commands seems symbolic and not real ... see also structure expected more below. ...
... l10n-drivers, please visit the url for your repo. you can do this by entering the following url into your browser: $ https://bitbucket.org/mozillal10n/ab-cd/overview/ (where ab-cd will be replaced by your locale code) at that main page of your newly created bit bucket repo, you'll see the hg commands, $ hg clone http://bitbucket.org/mozillal10n/ab-cd/ ... ...
Localizing with Koala
llowing commands: c:\users\stas> cd c:\mozilla\l10n\application\firefox c:\mozilla\l10n\application\firefox> rmdir 3.6 c:\mozilla\l10n\application\firefox> hg clone http://hg.mozilla.org/releases/mozilla-1.9.2 3.6 requesting all changes adding changesets adding manifests adding file changes added 33099 changesets with 158636 changes to 50664 files (+9 heads) updating working directory 40357 files updated, 0 files merged, 0 files removed, 0 files unresolved configure the locale locale id: x-testing (put your locale's code) version: 3.6 location: choose the folder where you want to keep the localized files or leave empty for now check "mercurial" if you wish to use mercurial to keep the revision history of your files (very recommended) existing localizations: url: if you're editing an existi...
... than the dtd files. they're just a simple key=value mapping. save the file to save your work. re-running the comparison a common scheme of working with the compare-locales tools (included in koala) is to incrementally translate and commit the files and then re-run comparison to see what is left to be translated. to make sure you're always translating the most recent en-us reference, you should update the source repository before you start working. open koala's start page. in "last used compares" click "update repo" to update the en-us repository to the most recent version. or, you can select firefox (3.6), en-us (included) and x-testing (3.6) in the "open" section below, and click "update repos" on the right. koala will re-run the comparison of your local localization files with the newest ...
Mozilla MathML Project
the mozilla mathml project is mozilla's project to build and enhance mathml support within firefox and other mozilla-based applications. for a quick overview, see the slides for the innovation fairs at mozilla summit 2013. updates status of each tag result of the mathml 3 testsuite unofficial nightly builds with mathml patches applied (maintained by bill gianopoulos) more updates and archived content community view mozilla forums... mailing list newsgroup rss feed irc channel wiki used by contributors - check out the latest developments and help us improving mathml in mozilla. links installing fonts for mozilla's mathml engine mathml version 3.0 - w3c recommendation, 21 october 2010 w3c mathml test suite - designed to check the implementation of each element one...
...y demonstration of some interesting upshots from building natively upon the browser environment. various mathml tests - these pages were imported from layout/mathml/tests/. blog with comments that include mathml. create mathml documents authoring mathml editors converters stylesheets original document information author(s): roger b. sidje other contributors: frédéric wang last updated date: april 4, 2010 copyright information: portions of this content are © 1999–2010 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Mozilla DOM Hacking Guide
and is not absolutely necessary, so you might want to skip this section if you don't have too much time (and i suppose you don't). user's guide to class info warning: this document has not yet been reviewed by the dom gurus, it might contain some errors. specifically, due to some changes that happened around, april 2002, some things that were not possible before are now possible. i will try to update this guide as soon as possible. please send any comment to fabian guisset. when should domclassinfo be used to add a new interface to an existing dom object to expose a new dom object to javascript to add a new js external constructor, like "new image()" to bypass the default behavior of xpconnect to implement a "replaceable" property to mess with the prototypes of dom objects example...
.... resources of interest the xpidl reference mapping dom objects to their c++ class modularization techniques scriptable helper flags this chapter has not been written yet. if you want to help please contact me! security features implementation this chapter has not been written yet. if you want to help please contact me! original document information author(s): fabian guisset last updated date: september 27, 2007 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Scroll-linked effects
ty.) you can find a sampling of such effects at css scroll api: use cases. these effects work well in browsers where the scrolling is done synchronously on the browser's main thread. however, most browsers now support some sort of asynchronous scrolling in order to provide a consistent 60 frames per second experience to the user. in the asynchronous scrolling model, the visual scroll position is updated in the compositor thread and is visible to the user before the scroll event is updated in the dom and fired on the main thread. this means that the effects implemented will lag a little bit behind what the user sees the scroll position to be. this can cause the effect to be laggy, janky, or jittery — in short, something we want to avoid. below are a couple of examples of effects that would no...
...tery visual effect. one way to implement this without the scroll event listener is to use the css property designed for this purpose: <body style="height: 5000px"> <div id="toolbar" style="position: sticky; top: 0px; margin-top: 100px; width: 100px; height: 20px; background-color: green"></div> </body> this version works well with asynchronous scrolling because position of the "toolbar" div is updated by the browser as the user scrolls. example 2: scroll snapping below is an implementation of scroll snapping, where the scroll position snaps to a particular destination when the user's scrolling stops near that destination. <body style="height: 5000px"> <script> function snap(destination) { if (math.abs(destination - window.scrolly) < 3) { scrollto(window.scrollx, de...
A brief guide to Mozilla preferences
browser/app/profile/firefox.js - defaults specific to firefox browser/app/profile/firefox-branding.js - defaults specific to the specific kind of firefox being installed (nightly, aurora, beta, release) browser/defaults/preferences/firefox-l10n.js - defaults specific to the installed languag...
...zilla platform services/common/services-common.js - preferences for some shared services code, this should arguably be included in some other file defaults/pref/services-sync.js - default preferences for firefox sync, also oddly misplaced browser/app/profile/channel-prefs.js - a file indicating the user's update channel. this is kept separate from other preferences because it can affect how updates are applied. browser/app/profile/firefox.js - defaults specific to firefox browser/app/profile/firefox-branding.js - defaults specific to the specific kind of firefox being installed (nightly, aurora, beta, release) browser/defaults/preferences/firefox-l10n.js - defaults specific to the installed language of firefox. none of the other preference files contain locale-specific preferences. ...
Patches and pushes
h your patch file to the bug by clicking the "add an attachment" link. once attached and labeled as a patch, open the attachment details. in the attachment details, select the ? from the dropdown menu next to the review flag. this will display a text box to assign the review to someone. enter :flod as the requestee. review, commit, & land address any review comments made by the reviewers and update the patch until it receives an r+ rating. if the r+ is "with nits" (i.e., that's short for nit-picky requests), fix those before committing. also, no new patch attachment will be needed. commit the patch to your aurora repo. only commit the changes you have reviewed. use a commit message that mentions the bug number, describes the change, and mentions the reviewer. for example: h...
... the change, and mentions the reviewer. for example: hg ci -m "bug 654321, copied the comment from the doc without reading, r=nobody" path-to-changed-files close the bug, copying the url to your change in the closing comment. write up something like this for your comment: landed this on aurora, http://hg.mozilla.org/releases/l10n/mozilla-aurora/ab-cd/rev/adfe1234feac, marking fixed. update your sign-offs on the l10n dashboard to include the change into the next release. and that's it! it can be considered a bit complicated at first, but after you do it the first time, it gets easier and easier after that :-) ...
Localization Use Cases
eturn; } // kb - 3 kb (nearest ones), mb, gb - 1.2 mb (nearest tenth) var fixeddigits = (size < 1024 * 1024) ? ...
...nes), mb, gb - 1.2 mb (nearest tenth) var fixeddigits = (size < 1024 * 1024) ? ...
Optimizing Applications For NSPR
guration of digital unix v4.0b. ...
... the same signals that nspr uses to suspend threads in preparation for garbage collection. no solution in hand. ...
NSS 3.12.6 release notes
ws packet sniffers to decrypt tls connections. see documentation. note: the code must be built with trace defined to use this functionality. bugs fixed the following bugs have been fixed in nss 3.12.6. ...
...pression rfc 3749 bug 494603: update nss's copy of sqlite3 to 3.6.22 to get numerous bug fixes bug 496993: add accessor functions for ssl_implementedciphers bug 515279: cert_pkixverifycert considers a certificate revoked if cert_processocspresponse fails for any reason bug 515870: gcc compiler warnings in nss 3.12.4 bug 518255: the input buffer for sgn_update should be declared const bug 519550: allow the specification of an alternate library for sqlite bug 524167: crash in [[@ find_objects_by_template - nsstoken_findcertificatebyissuerandserialnumber] bug 526910: maxresponselength (initialized to pkix_default_max_response_length) is too small for downloading some crls. bug 527759: add multiple roots to nss (single ...
NSS 3.19.3 release notes
ow. distribution information the hg tag is nss_3_19_3_rtm. nss 3.19.3 requires nspr 4.10.8 or newer. nss 3.19.3 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_19_3_rtm/src/ new in nss 3.19.3 no new functionality is introduced in this release. this is a patch release to update the list of root ca certificates. notable changes in nss 3.19.3 the following ca certificates were removed cn = buypass class 3 ca 1 sha1 fingerprint: 61:57:3a:11:df:0e:d8:7e:d5:92:65:22:ea:d0:56:d7:44:b3:23:71 cn = tÜrktrust elektronik sertifika hizmet saÄŸlayıcısı sha1 fingerprint: 79:98:a3:08:e1:4d:65:85:e6:c2:1e:15:3a:71:9f:ba:5a:d3:4a:d9 ...
...a program linked with ...
NSS 3.21 release notes
the sections "security fixes" and "acknowledgements" have been added. introduction the nss team has released network security services (nss) 3.21, which is a minor release. distribution information the hg tag is nss_3_21_rtm. nss 3.21 requires nspr 4.10.10 or newer. nss 3.21 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_21_rtm/src/ security fixes in nss 3.21 bug 1158489 / cve-2015-7575 - prevent md5 downgrade in tls 1.2 signatures. ...
...wosign g2 sha1 fingerprint: fb:ed:dc:90:65:b7:27:20:37:bc:55:0c:9c:56:de:bb:f2:78:94:e1 cn = ca wosign ecc root sha1 fingerprint: d2:7a:d2:be:ed:94:c0:a1:3c:c7:25:21:ea:5d:71:be:81:19:f3:2b cn = oiste wisekey global root gb ca sha1 fingerprint: 0f:f9:40:76:18:d3:d7:6a:4b:98:f0:a8:35:9e:0c:fd:27:ac:cc:ed the version number of the updated root ca list has been set to 2.6 bugs fixed in nss 3.21 this bugzilla query returns all the bugs fixed in nss 3.21: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.21 acknowledgements the nss development team would like to thank karthikeyan bhargavan from inria for responsibly disclosing the issue in b...
NSS 3.28.1 release notes
ow. distribution information the hg tag is nss_3_28_1_rtm. nss 3.28.1 requires nspr 4.13.1 or newer. nss 3.28.1 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_28_1_rtm/src/ new in nss 3.28.1 no new functionality is introduced in this release. this is a patch release to update the list of root ca certificates, and address a minor tls compatibility issue, that some applications experienced with nss 3.28. notable changes in nss 3.28.1 the following ca certificates were removed cn = buypass class 2 ca 1 sha-256 fingerprint: 0f:4e:9c:dd:26:4b:02:55:50:d1:70:80:63:40:21:4f:e9:44:34:c9:b0:2f:69:7e:c7:10:fc:5f:ea:fb:5e:38 cn = root ca generali...
... bugs fixed in nss 3.28.1 bug 1296697 - december 2016 batch of root ca changes bug 1322496 - internal error assert when the other side closes connection before reading eoed compatibility nss 3.28.1 shared libraries are backward comp...
NSS 3.28.5 release notes
ow. distribution information the hg tag is nss_3_28_5_rtm. nss 3.28.5 requires nspr 4.13.1 or newer. nss 3.28.5 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_28_5_rtm/src/ new in nss 3.28.5 no new functionality is introduced in this release. this is a patch release to update the list of root ca certificates. it backports the changes that were initially released in nss version 3.30.2. notable changes in nss 3.28.5 the following ca certificates were removed: o = japanese government, ou = applicationca sha-256 fingerprint: 2d:47:43:7d:e1:79:51:21:5a:12:f3:c5:8e:51:c7:29:a5:80:26:ef:1f:cc:0a:5f:b3:d9:dc:01:2f:60:0d:19 cn = wellssecure pub...
... (the version numbers 2.12 and 2.13 for the root ca list have been skipped.) bugs fixed in nss 3.28.5 bug 1350859 - march 2017 batch of root ca changes. bug 1349705 - implemented domain name constraints for ca: tubitak kamu sm ssl kok sertifikasi - surum 1. compatibility nss 3.28.5 shared libraries are backward compatible with all older nss 3.x shared...
NSS 3.30.2 release notes
elow. distribution information the hg tag is nss_3_30_2_rtm. nss 3.30.2 requires nspr 4.14 or newer. nss 3.30.2 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_30_2_rtm/src/ new in nss 3.30.2 no new functionality is introduced in this release. this is a patch release to update the list of root ca certificates. notable changes in nss 3.30.2 the following ca certificates were removed: o = japanese government, ou = applicationca sha-256 fingerprint: 2d:47:43:7d:e1:79:51:21:5a:12:f3:c5:8e:51:c7:29:a5:80:26:ef:1f:cc:0a:5f:b3:d9:dc:01:2f:60:0d:19 cn = wellssecure public root certificate authority sha-256 fingerprint: a7:12:72:ae:aa:...
...0:35:dd:94:57 trust flags: email cn = tubitak kamu sm ssl kok sertifikasi - surum 1 sha-256 fingerprint: 46:ed:c3:68:90:46:d5:3a:45:3f:b3:10:4a:b8:0d:ca:ec:65:8b:26:60:ea:16:29:dd:7e:86:79:90:64:87:16 trust flags: websites technically constrained to: gov.tr, k12.tr, pol.tr, mil.tr, tsk.tr, kep.tr, bel.tr, edu.tr, org.tr the version number of the updated root ca list has been set to 2.14 (the version numbers 2.12 and 2.13 for the root ca list have been skipped.) bugs fixed in nss 3.30.2 bug 1350859 - march 2017 batch of root ca changes bug 1349705 - implemented domain name constraints for ca: tubitak kamu sm ssl kok sertifikasi - surum 1 compatibility nss 3.30.2 shared libraries are backward compatible with all older nss 3.x shared li...
NSS 3.37 release notes
services (nss) 3.37, which is a minor release. distribution information the hg tag is nss_3_37_rtm. nss 3.37 requires nspr 4.19 or newer. nss 3.37 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_37_rtm/src/ notable changes in nss 3.37 the tls 1.3 implementation was updated to draft 28. an issue where nss erroneously accepted hrr requests was resolved. this issue was found by oss fuzz. added hacl* poly1305 32-bit the code to support the npn protocol, which had already been disabled in a previous release, has been fully removed. nss allows servers now to register alpn handling callbacks to select a protocol. nss supports opening sql dat...
...3.37, this alternative implementation for linux/unix can be selected in "make" builds by defining the environment variable nss_seed_only_dev_urandom. with nss 3.37, this alternative implementation for linux has been enhanced to use the glibc function getentropy(), instead of reading from /dev/urandom directly, if the build and runtime linux platform supports it. the ca certificates list was updated to version 2.24. the following ca certificates were removed: cn = s-trust universal root ca sha-256 fingerprint: d8:0f:ef:91:0a:e3:f1:04:72:3b:04:5c:ec:2d:01:9f:44:1c:e6:21:3a:df:15:67:91:e7:0c:17:90:11:0a:31 cn = tc trustcenter class 3 ca ii sha-256 fingerprint: 8d:a0:84:fc:f9:9c:e0:77:22:f8:9b:32:05:93:98:06:fa:5c:b8:11:e1:c8:13:f6:a1:08:c7:d3:36:b3:40:8e...
NSS 3.51.1 release notes
hes only. distribution information the hg tag is nss_3_51_1_rtm. nss 3.51.1 requires nspr 4.25 or newer. nss 3.51.1 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_51_1_rtm/src/ other releases are available in nss releases. notable changes in nss 3.51.1 bug 1617968 - update delegated credentials implementation to draft-07. bugs fixed in nss 3.51.1 bug 1619102 - add workaround option to include both dtls and tls versions in dtls supported_versions. bug 1619056 - update readme: tls 1.3 is not experimental anymore. bug 1618739 - don't assert fuzzer behavior in ssl_parsesessionticket. bug 1618915 - fix ubsan issue in ssl_parsesessionticket. bug 1608245 - consis...
... compatibility nss 3.51.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.51.1 shared libraries without recompiling or relinking. ...
NSS 3.51 release notes
dmitry baryshkov victor tapia distribution information the hg tag is nss_3_51_rtm. nss 3.51 requires nspr 4.25 or newer. nss 3.51 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_51_rtm/src/ other releases are available in nss releases. notable changes in nss 3.51 updated dtls 1.3 implementation to draft-34. see bug 1608892 for details. bugs fixed in nss 3.51 bug 1608892 - update dtls 1.3 implementation to draft-34. bug 1611209 - correct swapped pkcs11 values of ckm_aes_cmac and ckm_aes_cmac_general bug 1612259 - complete integration of wycheproof ecdh test cases bug 1614183 - check if ppc __has_include(<sys/auxv.h>) bug 1614786 - fix a compilation error...
... guaranteed to be null-terminated bug 1561337 - correct a warning for comparison of integers of different signs: 'int' and 'unsigned long' in security/nss/lib/freebl/ecl/ecp_25519.c:88 bug 1609751 - add test for mp_int clamping bug 1582169 - don't attempt to read the fips_enabled flag on the machine unless nss was built with fips enabled bug 1431940 - fix a null pointer dereference in blake2b_update bug 1617387 - fix compiler warning in secsign.c bug 1618400 - fix a openbsd/arm64 compilation error: unused variable 'getauxval' bug 1610687 - fix a crash on unaligned cmaccontext.aes.keyschedule when using aes-ni intrinsics this bugzilla query returns all the bugs fixed in nss 3.51: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced...
NSS 3.56 release notes
a minor release. distribution information the hg tag is nss_3_56_rtm. nss 3.56 requires nspr 4.28 or newer. nss 3.56 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_56_rtm/src/ other releases are available in nss releases. notable changes in nss 3.56 nspr dependency updated to 4.28. the known issue where makefile builds failed to locate seccomon.h was fixed in bug 1653975. bugs fixed in nss 3.56 bug 1650702 - support sha-1 hw acceleration on armv8 bug 1656981 - use mpi comba and mulq optimizations on x86-64 macos. bug 1654142 - add cpu feature detection for intel sha extension. bug 1648822 - add stricter validation of dh keys in fips mode. bug 1656986 - p...
...ls. bug 1652032 - fix failure to build in windows arm64 makefile cross-compilation. bug 1625791 - fix deadlock issue in nssslot_istokenpresent. bug 1653975 - fix 3.53 regression by setting "all" as the default makefile target. bug 1659792 - fix broken libpkix tests with unexpired paypal cert. bug 1659814 - fix interop.sh failures with newer tls-interop commit and dependencies. bug 1656519 - update nspr dependency to 4.28. this bugzilla query returns all the bugs fixed in nss 3.56: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.56 compatibility nss 3.56 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work w...
NSS Developer Tutorial
e character types (char16_t and char32_t). nss source should only include ascii text. escape non-printing characters (with \x if there is no special escape such as \r, \n, and \t) and avoid defining string literals that use non-ascii characters. one line comments starting with // are permitted. check with nss-dev@ before using a language feature not already used, if you are uncertain. please update this list if you do. these restrictions are different for c++ unit tests, which can use most c++11 features. the mozilla c++ language features guide, and the chromium c++ usage guide, list c++ features that are known to be widely available and compatible. you should limit features to those that appear in both guides. ask on nss-dev@ if you think this is restrictive, or if you wish to prohibit a...
...umber of nss developers, who have broad understanding of nss. one review is usually enough for the review to pass. for critical code reviews, such as a patch release of a stable branch, two reviews may be more reasonable. for new features, especially those that appear controversial, try to find a reviewer from a different company or organization than your own, to avoid any perceptions of bias. update nss in mozilla-inbound and mozilla-central the procedure is documented at https://developer.mozilla.org/docs/updating_nspr_or_nss_in_mozilla-central. if it is necessary to apply private patches, please document them in <tree>/security/patches/readme. ...
NSS Sample Code sample3
, 0xbc, sizeof data); /* create a context for hashing (digesting) */ context = pk11_createdigestcontext(sec_oid_md5); if (!context) { cout << "createdigestcontext failed" << endl; goto done; } s = pk11_digestbegin(context); if (s != secsuccess) { cout << "digestbegin failed" << endl; goto done; } s = pk11_digestop(context, data, sizeof data); if (s != secsuccess) { cout << "digestupdate failed" << endl; goto done; } s = pk11_digestfinal(context, digest, &len, sizeof digest); if (s != secsuccess) { cout << "digestfinal failed" << endl; goto done; } /* print digest */ printdigest(digest, len); pk11_destroycontext(context, pr_true); context = 0; /* * part 2 - hashing with included secret key */ cout << "part 2 -- hashing with included secret key" << endl;...
...&noparams); if (!context) { cout << "createdigestcontext failed" << endl; goto done; } s = pk11_digestbegin(context); if (s != secsuccess) { cout << "digestbegin failed" << endl; goto done; } s = pk11_digestkey(context, key); if (s != secsuccess) { cout << "digestkey failed" << endl; goto done; } s = pk11_digestop(context, data, sizeof data); if (s != secsuccess) { cout << "digestupdate failed" << endl; goto done; } s = pk11_digestfinal(context, digest, &len, sizeof digest); if (s != secsuccess) { cout << "digestfinal failed" << endl; goto done; } /* print digest */ printdigest(digest, len); pk11_destroycontext(context, pr_true); context = 0; /* * part 3 - mac (with secret key) */ cout << "part 3 -- mac (with secret key)" << endl; /* initialize data...
PKCS 7 functions
mxr 3.2 and later sec_pkcs7createsigneddata mxr 3.2 and later sec_pkcs7decodeitem mxr 3.2 and later sec_pkcs7decoderabort mxr 3.9 and later sec_pkcs7decoderfinish mxr 3.2 and later sec_pkcs7decoderstart mxr 3.2 and later sec_pkcs7decoderupdate mxr 3.2 and later sec_pkcs7decryptcontents mxr 3.2 and later sec_pkcs7destroycontentinfo mxr 3.2 and later sec_pkcs7encode mxr 3.3 and later sec_pkcs7encodeitem mxr 3.9.3 and later sec_pkcs7encoderabort mxr 3.9 and later sec_pkcs7e...
...fo mxr 3.2 and later sec_pkcs7encode mxr 3.3 and later sec_pkcs7encodeitem mxr 3.9.3 and later sec_pkcs7encoderabort mxr 3.9 and later sec_pkcs7encoderfinish mxr 3.2 and later sec_pkcs7encoderstart mxr 3.2 and later sec_pkcs7encoderupdate mxr 3.2 and later sec_pkcs7getcertificatelist mxr 3.2 and later sec_pkcs7getcontent mxr 3.2 and later sec_pkcs7getencryptionalgorithm mxr 3.2 and later sec_pkcs7getsignercommonname mxr 3.4 and later sec_pkcs7getsigneremailaddress mxr 3.4 and later...
Build instructions
nstructions should work for all platforms (with some platform-specific changes as noted). build instructions for recent versions (mercurial) clone the nspr and nss repositories. hg clone https://hg.mozilla.org/projects/nspr hg clone https://hg.mozilla.org/projects/nss if you want to build a releases other than the tips of these repositories, then switch to the release tags: cd nspr hg update nspr_4_9_5_rtm cd ../nss hg update nss_3_14_2_rtm cd .. set environment variables: if you want a non-debug optimized build, set build_opt=1 in your environment. otherwise, you get a debug build. on windows, if you want a debug build with the system's debug rtl libraries, set use_debug_rtl=1 in your environment. on unix platforms, except alpha/osf1, if you want a build for the system'...
...s, set use_debug_rtl=1 in your environment. on unix platforms, except alpha/osf1, if you want a build for the system's 64-bit abi, set use_64=1 in your environment. by default, nss builds for the 32-bit environment on all platforms except alpha/osf1. to build with gcc on platforms other than linux and windows, you need to set two more environment variables: ns_use_gcc=1 no_mdupdate=1 for hp-ux, you must set the environment variable use_pthreads to 1. cd nss gmake nss_build_all the output of the build will be in the dist directory alongside the nspr and nss directories. for information on troubleshooting the build system, see troubleshooting nss and jss build systems. build instructions for older versions (cvs) set the environment variable cvsroot ...
Migration to HG
mozilla/security" has been removed and files now live at the top level. in addition for nss, we have merged the contents of directories mozilla/dbm and mozilla/security/dbm into the new directory lib/dbm. besides the new layout, the build system hasn't changed. most parts of the nss build instructions remain valid, especially the instructions about setting environment variables. updated instructions for building nss with nspr can be found at: /docs/nss_reference/building_and_installing_nss/build_instructions it's best to refer to the above document to learn about the various environment variables that you might have to set to build on your platform (this part hasn't changed). however, below is a brief summary that shows how to checkout the source code and build b...
... because of the changes described above, we have decided to use a new series of (minor) version numbers. the first releases using the new code layout will be nspr 4.10 and nss 3.15 ...
NSS reference
ed to perform signature verification. encryption/decryption hashing key generation generate keys, key pairs, and domain parameters. random number generation this api consists of the two routines used for pseudorandom number generation -- pk11_generaterandomonslot and pk11_generaterandom -- and the two routines used for seeding pseudorandom number generation -- pk11_seedrandom and pk11_randomupdate. pkcs #11 functions based on pkcs #11 functions in the ssl reference and "crypto functions" in nss public functions. secmod_loadusermodule secmod_unloadusermodule secmod_closeuserdb secmod_openuserdb pk11_findcertfromnickname pk11_findkeybyanycert pk11_getslotname pk11_gettokenname pk11_ishw pk11_ispresent pk11_isreadonly pk11_setpasswordfunc ssl functions based on "ssl functio...
... documentation." used to exchange data such as private keys and certificates between two parties. sec_pkcs12createexportcontext sec_pkcs12createpasswordprivsafe sec_pkcs12createunencryptedsafe sec_pkcs12addcertandkey sec_pkcs12addpasswordintegrity sec_pkcs12enablecipher sec_pkcs12encode sec_pkcs12destroyexportcontext sec_pkcs12decoderstart sec_pkcs12decoderimportbags sec_pkcs12decoderupdate sec_pkcs12decoderfinish sec_pkcs12decodervalidatebags sec_pkcs12decoderverify sec_pkcs12decodergetcerts sec_pkcs12decodersettargettokencas sec_pkcs12decoderiterateinit sec_pkcs12decoderiteratenext sec_pkcs12isencryptionallowed sec_pkcs12setpreferredcipher nspr functions a small number of nspr functions are required for using the certificate verification and ssl functions in nss. thes...
Necko Architecture
necko is a modular networking library developed as part of the mozilla project. necko has been designed to accommodate pluggable protocols so developers can contribute their own protocol libraries that can be dynamically loaded and used by applications utilizing necko. necko provides the following libraries: necko - core networking functionality. ...
... ...
Necko Interfaces Overview
nsiioservice central necko service manages protocol handlers thin layer over protocol handlers provides interface for creating uri objects from uri strings maps uri scheme to appropriate nsiprotocolhandler impl nsiuri (nsiurl, nsifileurl, nsistandardurl) represents an uri, with getters and setters for various uri parts (eg. scheme, host, path, ...) per protocol implementation necko provides uri impl's for common uri formats (see nsstandardurl, nssimpleuri) nsichannel : nsirequest represents a logical connection to the resource identified by a nsiuri per protocol implementation single use (ie. ...
... ...
Multithreading in Necko
necko's primary interfaces are not thread safe. there has not yet been a need to make necko entirely thread safe as most of mozilla (and especially most of gecko) run only on the main/primordial thread. in the future, necko may be made thread safe to support changes to gecko that would put some other processing work on background threads (eg. multithreaded image decoding). however, most necko protocols utilize background threads. background threads are used to manage all i/o operations (with the exception of few cases). most simple protocol handlers (eg. file, finger, datetime) do not worry about threading issues. ...
...dow is created with a message pump on a background thread for processing wsa asynchronous dns events. in this way, necko takes advantage of the platforms specific routines for dns lookups. the default implementation does not spawn a worker thread, and instead simply calls pr_getipnodebyname (essentially equivalent to gethostbyname). original document information author(s): darin fisher last updated date: december 10, 2001 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Hacking Tips
n to authorize user scripts, and if so will print out directions. break on valgrind errors sometimes, a bug can be reproduced under valgrind but hardly under gdb. one way to investigate is to let valgrind start gdb for you, the other way documented here is to let valgrind act as a gdb server which can be manipulated from the gdb remote. $ valgrind --smc-check=all-non-file --vex-iropt-register-updates=allregs-at-mem-access --vgdb-error=0 ./js … this command will tell you how to start gdb as a remote. be aware that functions which are usually dumping some output will do it in the shell where valgrind is started and not in the shell where gdb is started. thus functions such as js::dumpbacktrace, when called from gdb, will print their output in the shell containing valgrind. adding spew for ...
...running "python reduce.py js_shell /tmp/tl-data.json tl-reduced". where js_shell is a real shell. using callgrind (js shell) as spidermonkey just-in-time compiler are rewriting the executed program, valgrind should be informed from the command line by adding --smc-check=all-non-file. $ valgrind --tool=callgrind --callgrind-out-file=bench.clg \ --smc-check=all-non-file --vex-iropt-register-updates=allregs-at-mem-access ./js ./run.js the output file can then be use with kcachegrind which provides a graphical view of the call graph. using ionmonkey spew (js shell) ionmonkey spew is extremely verbose (not as much as the infer spew), but you can filter it to focus on the list of compiled scripts or channels, ionmonkey spew channels can be selected with the ionflags environment variable, a...
JSAPI User Guide
(cx, &scriptobj); /* scriptobj becomes unreachable and will eventually be collected. */ return false; } security many applications use spidermonkey to run untrusted code. in designing this kind of application, it's important to think through the security concerns ahead of time. your application will need to do several things. deploy security updates - firefox automatically installs updates, so security fixes are deployed as soon as they are available. unless you also regularly deploy spidermonkey security updates, a determined hacker could use publicly known bugs in the engine to attack your application. note that the kind of attack we're talking about here is where a hacker uses javascript to attack the c++ code of the engine itself (or yo...
...here, almost any other object or function in that sandbox. there is no way to fix it except to destroy both sandboxes and start over. a second drawback is that the system doesn't automatically respond to changes in user privileges. suppose user a is not an administrator, so you set up sandbox a with no administrator functionality. if you promote user a to be an admin, spidermonkey won't magically update sandbox a to have the administrator classes and functions you didn't define before. your application will have to do that explicitly. conversely, if you want to strip user a's administrator privileges, but you have already given administrator functions to user a's scripts, that's even worse. you have no choice but to destroy user a's sandbox and start over. fine-grained security another way to ...
JS_ExecuteRegExp
obj js::handleobject a pointer to a global object. reobj js::handleobject a pointer to a regexp object. chars const char16_t * a pointer to the string contains a input string. length size_t the length of bytes or chars, in characters. indexp size_t * in/out parameter. a pointer to the lastindex for the execution, and received the updated lastindex. test bool pass true to avoid creating match result array and store boolean value to rval. rval js::mutablehandlevalue out parameter. receives the result match result array or boolean value. description js_executeregexp and js_newregexpobjectnostatics execute the regexp object, reobj, to the specified input string, chars, from *indexp index. if test...
...the regexp object, reobj, to the specified input string, chars, from *indexp index. 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. js_executeregexp updates the built-in regexp object's properties. 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 ...
SpiderMonkey 1.8.7
ely interchange jsid and jsval. they are no longer compatible; using js_valuetoid and js_idtovalue to convert between the two is mandatory. jsnative, jsfastnative previous versions of jsapi supported two types of native functions -- jsnative and jsfastnative. the so-called "slow natives" are no longer supported; as such jsfastnative has been renamed to jsnative and relevant interfaces have been updated accordingly. embedders converting functions from old-jsnative to new-jsnative (jsfastnative) should study the jsfastnative documentation thoroughly, and pay particular that they do not reference negative indices of argv in spidermonkey 1.8.5; the js_callee, js_this, etc. macros must be used instead. see bug 581263. global objects global objects have been specialized, and must be be created with ...
...codestringtobuffer (not an exhaustive list). numbers spidermonkey 1.8.5 now stores integers up to 32-bits in the jsval. this means that the int_fits_in_jsval macro is always returns true (be careful to only use this macro with jsints, not 64-bit integers). the jsval now also stores jsdoubles directly, rather than storing them on the heap. the jsval_to_double and double_to_jsval macros have been updated to work directly on jsdoubles rather than their pointers, and the js_newdoublevalue and js_newdouble interfaces have been removed. javascript shell changes there are many new built-in functions in the javascript shell, mostly useful for testing spidermonkey. the scatter function has been removed, and a shell worker class (similar to html dom workers) has been added. known issues mac os x 10.5 (l...
SpiderMonkey 31
these types, with the appropriate parametrizations, can roughly be substituted for plain types of gc things (values, string/object pointers, etc.). the jsbool type has been removed, along with the corresponding js_true and js_false constants. they have been replaced by bool, true, and false respectively. many jsclass and js::class instances are now explicitly const, and several apis have been updated to use const jsclass * and const js::class * pointers. all references to shortid/tinyid have been removed. that includes the apis js_definepropertywithtinyid and js_defineucpropertywithtinyid as well as the jspropertydescriptor structure and the matching jsprop_shortid flag. these and other changes are explained in detail below. new javascript language features javascript 31 includes signif...
...se const jsclass * and const js::class * pointers. all references to shortid/tinyid have been removed. that includes the apis js_definepropertywithtinyid and js_defineucpropertywithtinyid as well as the jspropertydescriptor structure and the matching jsprop_shortid flag. these and other changes are explained in detail below. new javascript language features javascript 31 includes significant updates to language features, yo. new c++ apis jsapi is now a c++-only api. please note that spidermonkey reserves the js:: namespace for itself (and the js:: namespace for internal use). js_init is a new function which must be used to initialize the js engine before any jsruntimes are created or other jsapi methods are called. this method pairs with the existing (currently non-mandatory) js_shutd...
WebReplayRoadmap
to this workflow. the bug only needs to be reproduced in a recording tab once, and then console logs can be added which apply throughout the entire recording. this is based on the logpoints feature in the debugger, which can be enabled with the devtools.debugger.features.log-points preference. set a breakpoint and right click on it to change it to a log point. in a non-recording tab this will update the console whenever the log point's location executes in the future. in a recording tab, however, this will update the console with messages for every time the location has ever been hit. this requires scanning the recording and the console will not update immediately. these messages will show up on the timeline and can be seeked to in the same way as other console messages. dom/css integrat...
...icular dom events occur, and -- in the same manner as logpoints -- logging them to the console and allowing them to be seeked to later. similarly, when the debugger supports dom mutation breakpoints (bug 1547692), the recording can be searched for dom mutations, and mutations can be logged to the console and seeked to later. allowing css to be changed while paused somewhere in the recording and update graphics with the effects of those changes. object watching (not yet implemented) it would be nice to log the changes to a specific object or one of its properties, so that the points of those changes can be seeked to later. bookmarks (not yet implemented) it would be nice to be able to bookmark points in the recording so that they show up on the timeline and can be seeked to later. code pa...
Redis Tips
o by keys are strings or they are nil. nil values will be given as null in node, not undefined. but some commands only work with numbers (like incr); for these, if your key can't be parsed as a number, it's an error: redis> set foo pie ok redis> incr foo (error) err value is not an integer or out of range atomic counters i guess that sounds like geiger counters. i mean counters you can update atomically. get key set key value exists key setnx key value incr key incrby key int incrbyfloat key float getset key value get and set are fairly obvious. setnx sets a value on a key only if there is no existing value. this is so useful. and it is a single, atomic command. redis> get foo (nil) redis> setnx foo 17 (integer) 1 redis> get foo "17" redis> setnx foo 42 (integer) 0 ...
... zrange gives you everything in the zset, in order of score, from the beginning offset to the end offset. (0 from the front, -1 from the end.) as you can see, the scores are sorted smallest to biggest. to get the most recent, you can use zrevrange: > r.zrevrange('last-login', 0, -1, print); ["lloyd", "zcarter", "jparsons"] to see the scores, use the optional withscores...
A Web PKI x509 certificate primer
to have your own ca, we recommend building 3 certificates: a long term root cert, a medium term intermediate cert, and a short term end-entity cert. this type of hierarchy allows for a relatively simple long term root to be distributed to clients, and some flexibility on the intermediate cert so that you can change parameters based on best practices and security research. generate your ca root update *.example.com and *.example.net below to match your domains. assumptions: you are the domain owner of *.example.com and *.example.net. your computer is not connected to the internet. steps to generate your ca root certificate: generate key "openssl genpkey -algorithm rsa -out rootkey.pem -pkeyopt rsa_keygen_bits:4096" 4096 is considered secure for the next 15 years. gener...
... generate key "openssl genpkey -algorithm rsa -out eekey.pem -pkeyopt rsa_keygen_bits: 2048" 2048 is considered secure for the next 4 years. generate csr "openssl req -new -key key.pem -days 1096 -extensions v3_ca -batch -out example.csr - utf8 -subj '/cn=www.example.com' make a new certificate signing request (csr) that will b...
Embedded Dialog API
ko's default dialog components, that application must override every dialog in the component. however note that the complete set of all dialogs is implemented in several different components, so an application need not override every single dialog in gecko to override some. apologies, but at this time there is no complete list of all dialogs and the components in which they reside. stay tuned for updates. however, it's nearly accurate to claim that the majority of all dialogs and alerts posed by gecko do reside in a single generic component, nsipromptservice (nsipromptservice). an mfc example is implemented in promptservice.cpp. a powerplant example is implemented in promptservice.cpp. (testgtkembed doesn't override promptservice; it uses the default dialogs.) both are source for a library set u...
...ew coding conventions on these dialog-posing interfaces. ...
History Service Design
bookmarks, every url is unique in this table and is associated with a place id, commonly used as the foreign key on other tables. this table has common attributes for a page like typed, hidden and frecency. certain scheme are excluded from history, so they will never be added, for example: about, view-source, chrome. if a page can be added we first check if it exists already, then it is added or updated accordingly to the previous check, and common attributes are set based on concurrent visit properties. typed means the page as a typed visit, hidden means the page should not be shown in autocomplete, while frecency is the relevance the page will have in locationbar queries. finally observers are notified a new visit has been added. every visit is identified by its visit date, and a visit type ...
...to. these objects can be directly instantiated and built, setting their attributes, but places allows a more readable and manageable form for queries: place query uris. query uris (for example place:querytype=0&sort=8&maxresults=10) can be easily built and read by users (through a built-in advanced search builder ui) and can be bookmarked, creating a so called smart bookmark. a smart bookmark can update itself automatically when bookmarks or visits change, providing a sort of saved search. once places receives a place: uri or a query object an internal query builder checks for the requested options and make up a real sql query that is executed with storage apis. many queries can be executed and combined at the same time. an history container node is built (the so-called rootnode), this node wil...
Using the Places history service
d-coding your own query strings. nsinavhistoryservice.querystringtoqueries: converts a serialized query ("place:" uri) back to the actual query objects and options. miscellaneous nsinavhistoryservice.addobserver: adds a history observer, which will be notified of changes to the history system. nsinavhistoryservice.removeobserver: removes a previously added observer. nsinavhistoryservice.beginupdatebatch: call when you will be making many small changes to the history system. observers generally stop updating ui when they are inside a batch, potentially making the operations faster. if you are just doing a few changes, it is probably better to not use a batch since incremental updates are not done. be sure to call endupdatebatch when you are done or the ui will be permanently broken. nsinavh...
...you will be making many small changes to the history system. observers generally stop updating ui when they are inside a batch, potentially making the operations faster. if you are just doing a few changes, it is probably better to not use a batch since incremental updates are not done. be sure to call endupdatebatch when you are done or the ui will be permanently broken. nsinavhistoryservice.endupdatebatch: ends a batch operation previously started with beginupdatebatch. see also manipulating bookmarks using places ...
Using the Places keywords API
using the places keywords api the places keywords api allows to assign a keyword to an url. keywords represent an alias for the given url in the autocomplete (aka awesomebar) field, with smart replacement of query terms. a keyword can only be associated to a given url, it's not possible to associate the same keyword with multiple urls (doing so will just update the url it's pointing to). each keyword can be associated with post data, in such a case a post action will be executed when the given url is selected from the awesomebar. different keywords can reference the same url, if their post data differ. keywords in firefox are currently created through the add keyword for this search contextual menu option in form text fields. note this is the same feature previously known as bookmark keywor...
...o post data. placesutils.keywords.insert({ keyword: "my_keyword", url: "http://www.example.com/" postdata: "post+data=1&test=2" }).then(() => { /* success */ }, e => { /* failure */ }); note that setting an already existing keyword to a different url, will silently update the existing keyword to the new url. fetching an entry by keyword the fetch() method acceps a keyword string (or an object having a keywords property) and might resolve to a keyword entry with the following properties: keyword: string representing the keyword url: the url represeted by the keyword postdata: optional post data string. not defined if there's no post data. if no keyword exi...
Finishing the Component
uture, the nsifoo interface requires a major change, and methods are reordered, some are added, others are removed. moreover, since this interface was never supposed to be used by clients other than gecko or mozilla, the maintainers of the interface don't know that it's being used, and don't change the iid of the interface. when your component runs in a version of gecko in which this interface is updated, your method calls will be routed through a different v-table than the one the component expected, most likely resulting in a crash. below, the component is compiled against a version of the nsifoo interface that has three methods. the component calls the method testa and passes an integer, 10. this works fine in any gecko installation where a contract guarantees that the interface that was com...
... once you have made sure that your component builds with the new header file, you must derive the weblock class from the interface nsicontentpolicy, which you can do by simply adding a public declaration when defining the class. at the same time, you can add the macro ns_decl_nsicontentpolicy to the class declaration that provides all of the methods defined in the interface nsicontentpolicy. ...
Using XPCOM Utilities to Make Things Easier
ion of this nsisimpleenumerator class doesn't include any methods other than the contructor and destructor. instead, the class uses the ns_decl_ macro[nsisupports-warning]. using these declaration macros not only saves a tremendous amount of time when you're writing the code, it can also save time if you make changes to your idl file, since the c++ header file will then automatically include the updated list of methods to be supported. the ns_init_isupports macro is also a bit of a special case. historically, it gets called in the constructor for your class and sets mrefcnt to zero. however, a change in xpcom that occurred before mozilla 1.3 makes ns_init_isupports no longer necessary: mrefcnt's type has been changed from an integer to a class that provides its own auto-initialization. if you...
... ns_ok; } the first thing that this method does is check to see that the caller passed a valid address. if not, it doesn't even try to continue. next, it calls another method on an object that is presumed to exist in this context. you can call a .get() method on the nscomptr and have it returned for use as a raw pointer. this raw pointer can then be assigned to a variable and have its reference updated by ns_if_addref. be very careful with the result of .get(), however. you should never call release on this result because it may result in a crash. instead, to explicitly release the object being held by a nscomptr, you can assign zero to that pointer. another nice feature of smart pointers - the part that makes them smart - is that you can queryinterface them quite easily. for example, there a...
IAccessibleText
bounding box of the referenced character. return value e_invalidarg if bad [in] passed, [out] values are 0s. s_ok. ncharacters() returns total number of characters. [propget] hresult ncharacters( [out] long ncharacters ); parameters ncharacters missing description return value s_ok. newtext() returns any inserted text(). provided for use by the ::ia2_event_text_inserted and ::ia2_event_text_updated event handlers. this data is only guaranteed to be valid while the thread notifying the event continues. once the handler has returned, the validity of the data depends on how the server manages the life cycle of its objects. also, note that the server may have different life cycle management strategies for controls depending on whether or not a control manages its children. lists, trees, and ta...
... of the character that is rendered on to the display at that point. coordtype screen coordinates or window coordinates. offset index of the character under the given point or -1 if the point is invalid or there is no character under the point. return value e_invalidarg if bad [in] passed, [out] value is 0. s_ok. oldtext() returns any removed text(). provided for use by the ia2_event_text_removed/updated event handlers. this data is only guaranteed to be valid while the thread notifying the event continues. once the handler has returned, the validity of the data depends on how the server manages the life cycle of its objects. also, note that the server may have different life cycle management strategies for controls depending on whether or not a control manages its children. lists, trees, and ta...
mozIRegistry
n libreg (for "compatibility") and a fancier rdf-based one. open issues we have identified two open issues, neither of which appear to be so hard that it we won't be able to solve them in a timely fashion: if and when we remove what is currently a static binding of clsids, there will be the risk that required clsids won't be present. a corollary is that the build/install process will require updates to user "registry" to enable new class implementations to be accessible. our current build/install process doesn't quite step up to these problems as of yet. there are some bootstrapping issues related to using the service manager to access the moziregistry interface. currently, nsiservicemanager requires a clsid to access a service which hardcodes the implementation of that service. this issue...
...breg .reg file(s), the shared libraries installed, additional components accessible via the 'net, etc. 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. it will also facilitate building a browser-based application that will allow people to display and edit its contents. original document information author: bill law last updated date: january 21, 1999 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
nsIBrowserHistory
ibute was removed in gecko 15.0 because it was only used to determine if there were any entries at all anyway, so the nsinavhistoryservice.hashistoryentries attribute is better for this. methods addpagewithdetails() obsolete since gecko 15.0 (firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) note: this method was removed in gecko 15.0. you should use moziasynchistory.updateplaces() instead. this method adds a page to the history with specific time stamp information. it is called by history importing code and is used in the history migration tool. void addpagewithdetails( in nsiuri auri, in wstring atitle, in long long alastvisited ); parameters auri the page that will be added to the history. atitle the title of the page. alastvisited when the pag...
...atch operation doesn't make sense anymore. void removepages( [array, size_is(alength)] in nsiuri auris, in unsigned long alength, in boolean adobatchnotify /* parameter removed in gecko 9.0 */ ); parameters auris an array of page uris to be removed from history. alength the number of pages listed in the auris array. adobatchnotify obsolete since gecko 9.0 if set to true, the beginupdatebatch and endupdatebatch events are sent; otherwise, no notification of changes to the history is provided. this parameter was removed in gecko 9.0. removepagesbytimeframe() removes all pages within the given timeframe, using a batch. void removepagesbytimeframe( in long long abegintime, in long long aendtime ); parameters abegintime the time of the first page to remove, in microsec...
nsICRLInfo
security/manager/ssl/public/nsicrlinfo.idlscriptable information on a certificate revocation list (crl) issued by a certificate authority (ca). inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description lastfetchurl autf8string the url this crl was last fetched from. read only. lastupdate prtime the time this crl was created at. read only. ...
... security/manager/ssl/public/nsicrlinfo.idlscriptable information on a certificate revocation list (crl) issued by a certificate authority (ca). inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description lastfetchurl autf8string the url this crl was last fetched from. read only. lastupdate prtime the time this crl was created at. read only. lastupdatelocale astring lastupdate formatted as a human readable string formatted according to the environment locale. read only. nameindb astring the key identifying the crl in the database. read only. nextupdate prtime the time the suggested next update for this crl. read only. nextupdatelocale astring nextupdate formatted as a human readable string formatted according to the environment locale. re...
nsICategoryManager
ries.join("\n"); dump(entriesstring + "\n"); disable currently loaded plugins by type this snippet here shows how to disable plugins that are currently loaded for the file type of pdf. the second portion of this snippet disables plugins from loading in the future, it does not user the category manager but it is included for completness of the example. ...
...ing in the future, it does not user the category manager but it is included for completness of the example. var content_type = 'application/pdf'; // update the category manager in case the plugins are already loaded. ...
nsIDOMWindowInternal
indow in the dom. 66 introduced gecko 1.0 deprecated gecko 8.0 inherits from: nsidomwindow last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) in gecko 8.0 this interface was merged into the nsidomwindow interface. this interface no longer has any members; it exists solely to prevent add-ons that reference it from failing completely. add-ons should be updated to use nsidomwindow instead. it provides many of the common functions used in javascript such as alert() or open(). note: because most of nsidomwindowinternal's functions and attributes are well documented in window, those articles are linked to rather than re-documented. however, they are not guaranteed to document all available arguments (i.e. see window.prompt). method overview firefo...
...terface's open() method loads the specified resource into the browsing context (window, <iframe> or tab) with the specified name. ...
nsIEditorSpellCheck
void addwordtodictionary( in wstring word ); parameters word the word to add to the current personal dictionary. canspellcheck() determines whether or not spell checking can be enabled. boolean canspellcheck(); parameters none. return value returns true if spell checki...
...hecking specific parts of the document. uninitspellchecker() call this to release the spell checking object. it will also save the current selected language as the default for future use. if you have called canspellcheck() but not initspellchecker(), you can still call this function to clear the cached spell check object, and no preferences are saved. void uninitspellchecker(); parameters none. updatecurrentdictionary() updates the dictionary in use to be sure it corresponds to what the editor needs. void updatecurrentdictionary(); parameters none. remarks prior to gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6), this method took one parameter, a reference to the nsieditor for which to update the spell checker. now that spell checker settings are per-site, this method takes no param...
nsIFrameLoader
this can be used to decide what operations may or may not be allowed on the loader's docshell. read only. docshell...
...ype the type of mouse event to send. ax the x coordinate of the mouse. ay the y coordinate of the mouse. abutton which button was clicked, if any. aclickcount the number of clicks comprising the mouse button event, if any. amodifiers the modifier keys in effect at the time of the event. aignorerootscrollframe optional whether or not to ignore the root scroll frame. native code only!updatepositionandsize updates the position and size of the subdocument loaded by this frameloader. void updatepositionandsize( in nsiframe aiframe ); parameters aiframe the nsiframe for the content node that owns this frameloader. see also content process event handling nsiframeloaderowner nsiframemessagelistener nsichromeframemessagemanager nsidomwindowutils ...
nsIHTMLEditor
returninparagraphcreatesnewparagraph boolean a boolean indicating if a return key pressed in a paragraph creates another paragraph or just inserts a <br...
...tle setinlineproperty() void setinlineproperty( in nsiatom aproperty, in astring aattribute, in astring avalue ); parameters aproperty aattribute avalue setparagraphformat() insert a block paragraph tag around selection. void setparagraphformat( in astring aparagraphformat ); parameters aparagraphformat "p", "h1" to "h6", "address", "pre", or "blockquote" updatebaseurl() set the baseurl for the document to the current url but only if the page doesn't have a <base> tag this should be done after the document url has changed, such as after saving a file this is used as base for relativizing link and image urls. void updatebaseurl(); parameters none. ...
nsINavHistoryResult
containerresultnode the root of the results. this container gives you access to all the results in the tree. note: keep in mind that you need to open containers for their results to be valid. when a result goes out of scope it will continue to observe changes till it is cycle collected. while the result waits to be collected it will stay in memory, and continue to update itself, potentially causing unwanted additional work. when you close the root node the result will stop observing changes, so it is good practice to close the root node when you are done with a result, since that will avoid unwanted performance hits. read only. sortingannotation autf8string the annotation to use in sort_by_annotation_* sorting modes; you must set this ...
...ted performance hits. read only. sortingannotation autf8string the annotation to use in sort_by_annotation_* sorting modes; you must set this value before setting the sortingmode attribute. sortingmode unsigned short specifies the sorting mode for the result. this value must be one of nsinavhistoryqueryoptions.sort_by_*. changing this value updates the corresponding options for the result so that reusing the current options and queries will always return results based on the current view. suppressnotifications boolean if true, notifications are suppressed. this is used to prevent rapid flickering of changes when performing batch or temporary operations on the result structure. viewer nsina...
nsISupports proxies
such as a progress meter or a confirmation dialog. how can a separate non-ui thread act as if it was on the ui thread? herein lays the utility of nsisupports proxies. i believe that other people working on mozilla need similar solutions. in this document, i will try to explain how to use nsisupports proxies. how do i use it? the api has changed in mozilla 1.9, but the prose below hasn't been updated yet. see xpcom/proxy/public/nsiproxyobjectmanager.idl for the updated interface and its documentation. see also . from a users point of view, you need only to look at the nsiproxyobjectmanager. it has two entry points: ns_imethod getproxyforobject(nsieventqueue *destqueue, const nsiid & iid, nsisupports *object, ...
... ...
nsIWinAppHelper
/ thunderbird 3.1 / fennec 1.0) implemented by: @mozilla.org/xre/app-info;1. to create an instance, use: var xulappinfo = components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsiwinapphelper); the nsixulappinfo and nsixulruntime interfaces are also implemented by "xre/app-info". method overview void fixreg(); obsolete since gecko 1.9 void postupdate(in nsilocalfile logfile); obsolete since gecko 1.9.2 attributes attribute type description usercanelevate boolean read only. returns true only if all the following conditions are all true at once: the operating system is at least windows vista user account control is enabled the user is an administrator the application is not already running with elevated permissions otherwise it retu...
...indows vista user account control is enabled the user is an administrator the application is not already running with elevated permissions otherwise it returns false. methods fixreg() obsolete since gecko 1.9 (firefox 3) invokes helper.exe with the /fixreg parameter. note that this parameter was never actually supported. void fixreg(); parameters none. postupdate() obsolete since gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) invokes helper.exe with the /postupdate parameter. this updates the uninstallation log so that the application can be uninstalled correctly after an update. void postupdate( in nsilocalfile logfile ); parameters logfile the file to use for the uninstallation log. the path is passed to helper.exe as the...
nsIXULAppInfo
did acstring the application's build id/date, for example "2004051604". for xulrunner applications, this will be different than the build id of the platform. be careful about which one you want. read only. id acstring the xul application's uuid. can be an empty string, if id is not set. has to be defined for advanced application features such as the extension manager and update service. this has traditionally been in the form "{aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee}" but for new applications a more readable form is encouraged: "appname@vendor.tld". only the following characters are allowed: a-z a-z 0-9 - . @ _ { } * read only. name acstring the name of the application. this must be ascii, and is normally mixed-case, for example "firefox", "thunderbird"...
...xed-case, for example "mozilla". can be an empty string if vendor is not set. read only. version acstring the xul application's version, for example "0.8.0+" or "3.7a1pre". it is different than the version of gecko or the xulrunner platform. be careful about which one you want! can be an empty string, but a valid value is required for xul applications using the extension manager or update service. read only. example display the application and the gecko version in an alert box: var info = components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsixulappinfo); alert("application version: " + info.version + "\n" + "gecko version: " + info.platformversion); example this example here uses nsixulappinfo to get the version of the current...
Address book sync client design
by richard h. pizzarro <rhp@netscape.com> contents overview client side sync logic public interfaces overview there is an component available in the mozilla tree for performing synchronization operations against a server based address book. ...
...obile device. // crc - crc of the record last time we synced. // flags - operation to apply to this record. add // if it's new, mod if it's been modified, // ret if it was already sent to the server // but an error occured, etc. // // step 1: // when the user begins a sync, run through the local database and update the // sync mapping table. if the crc has changed, mark the entry modified, if // it's a new record, add an entry and mark it new, if a record was deleted, // mark the entry deleted, etc. // // sync approach - server handles all conflict resolution: // // step 2: // using the sync mapping table and the local records database, generate the change // list to send to the server. mark any ...
Thunderbird Binaries
y builds that can destroy your data or harm it. they should only be used for testing purposes. if you wish to use a nightly build on your main profile, you should make sure you back up your profile. nightly builds from the comm-central trunk the trunk is the central source code that is used for continuous and ongoing development. trunk builds contain the very latest bleeding-edge changes and updates, as well as 64-bit builds for windows. latest english trunk builds are available at: https://archive.mozilla.org/pub/thunderbird/nightly/latest-comm-central/ latest localized trunk builds are available at: https://archive.mozilla.org/pub/thunderbird/nightly/latest-comm-central-l10n/ note: please use http://ftp.stage.mozaws.net/pub/thunderbird/nightly/latest-comm-central/ because the above two...
...a.org/pub/thunderbird/nightly/latest-comm-central-l10n/ note: please use http://ftp.stage.mozaws.net/pub/thunderbird/nightly/latest-comm-central/ because the above two links currently do not work. frequently asked questions what is the trunk? the trunk is the central source code that is used for continuous and ongoing development. trunk builds contain the very latest bleeding-edge changes and updates. the trunk can be very unstable at times, so it's good to ask around before using trunk builds. what is a branch? branches are "forks" in the code, split from the trunk and destined to become end-user releases. at conception, a branch contains everything that the trunk contains, but from that point onwards, only certain fixes or changes will be accepted. therefore, over time, the branch become...
Building a Thunderbird extension 6: Adding JavaScript
ottom of the thunderbird window. depending on the installed theme the result will look something like this: modify xul elements with javascript save the following javascript code into the content/ folder next to your myhelloworld.xul file and name it overlay.js. window.addeventlistener("load", function(e) { startup(); }, false); window.setinterval( function() { startup(); }, 60000); //update date every minute function startup() { var mypanel = document.getelementbyid("my-panel"); var date = new date(); var day = date.getday(); var datestring = date.getfullyear() + "." + (date.getmonth()+1) + "." + date.getdate(); mypanel.label = "date: " + datestring; } the first part registers a new event listener that will be executed automatically when thunderbird loads. the event listener ...
...panel from the document's dom tree. it then uses javascript's date class to get the current date, which it converts into a string that has the format of yyyy.mm.dd. because the month is zero-based we also need to add one to the month. finally the label of our panel is set to "date: " and concatenated with the date string that contains the formatted date. we use the function window.setinterval to update the date in case thunderbird is left running for more than one day. this allows us to call the startup function repeatedly with an interval of 60000ms (every minute). further documentation more functions for the dom objects are listed on: dom/window (api reference for the window object) dom/document (api reference for the document object) gecko dom reference (overview of all dom objects in...
Toolkit version format
the following preferences: app.extensions.version, extensions.lastappversion versions returned by nsixulappinfo. application.ini in xulrunner applications appversion flag in chrome manifests. you can use nsiversioncomparator to compare versions from your application. ...
... the following preferences: app.extensions.version, extensions.lastappversion versions returned by nsixulappinfo. application.ini in xulrunner applications appversion flag in chrome manifests. you can use nsiversioncomparator to compare versions from your application. ...
Version, UI, and Status Information - Plugins
« previousnext » this chapter describes the functions that allow a plug-in to display a message on the status line, get agent information, and check on the current version of the plug-in api and the browser. displaying a status line message users are accustomed to checking the ui status line at the bottom of the browser window for updates on the progress of an operation or the url of a link on the page. you can also use the status line to notify the user of plug-in-related information. the user might appreciate seeing the percentage completed of the current operation or the url of a button or other link object when the cursor is over it, all of which the browser shows. in fact, your plug-in interface should be consistent with the rest of the browser in this way. to accomplish t...
...ding a plug-in when the browser starts up, it loads all the plug-ins it finds in the plugins directory for the platform. if you call npn_reloadplugins, the browser reloads all plug-ins in the plugins directory without restarting. this causes the browser to install a new plug-in and load it, or remove a plug-in, without having to restart. consider using this function as part of the plug-in's smartupdate process. void npn_reloadplugins(npbool reloadpages); the reloadpages parameter is a boolean that indicates whether to reload the page (true) or not (false). « previousnext » ...
Edit fonts - Firefox Developer Tools
this article provides a tour of the font tools available in the firefox devtools. this tool contains several useful features for viewing and manipulating fonts applied to any document loaded in the browser including inspection of all fonts applied to the page, and precise adjustment of variable font axis values. note: the updated font tools as shown in this article are available in firefox 63 onwards; if you are using an older version of firefox the tools will not look or behave quite the same, but they will be similar (most notably the font editor will not be available). the fonts tab the fonts tab is located on the right-hand side of the page inspector when it is docked to the bottom of the screen. when it is docked to the right or left sides of the screen, the fonts tab appears beneath ...
...oviding control to alter the value of each one. this is very useful for quickly finding out what axes are available in a particular font — they can vary quite dramatically as font designers can implement basically anything they like. you can adjust the axes individually or, if the font designer has included defined instances, you can select one from the "instance" drop-down list and view the updates live on your page. here are a couple of examples of fonts with different axes defined: in the following example, you can see that the font "cheee variable" includes settings for yeast and gravity. these are custom axes defined by the font designer. the first image shows the font as it is used on the page with default settings. the second image shows the same font after selecting the "hi y...
about:debugging (before Firefox 68) - Firefox Developer Tools
on will stay installed until you restart firefox. the big advantages of this method, compared with installing an add-on from an xpi, are: you don't have to rebuild an xpi and reinstall when you change the add-on's code you can load an add-on without signing it and without needing to disable signing. updating a temporary add-on if you install the add-on in this way, what happens when you update the add-on's files? before firefox 48 if you change files that are loaded on demand, like content scripts or popups, then changes you make are picked up automatically, and you'll see them the next time the content script is loaded or the popup is shown. if you change files that stay loaded the whole time, like background scripts, then you can pick up changes you've made by disabling and then...
...ll see one button, labeled "start": click this to start the service worker. clicking "debug" connects the javascript debugger and console to this worker. you can set breakpoints, step through code, watch variables, evaluate code, and so on: registering workers at first, you won't see any workers listed under service workers or shared workers. as soon as a worker is registered, the listing is updated: before firefox 47, service workers were only shown when they were actually running. unregistering service workers new in firefox 48. starting in firefox 48, you'll see a link named "unregister" next to each registered service worker: click the link to unregister the service worker. sending push events to service workers sending push events in about:debugging is new in firefox 47...
about:debugging - Firefox Developer Tools
isplayed: location the location of the extension's source code on your local system. extension id the temporary id assigned to the extension. internal uuid the internal uuid assigned to the extension. manifest url if you click the link, the manifest for this extension is loaded in a new tab. updating a temporary extension if you install an extension in this way, what happens when you update the extension? if you change files that are loaded on demand, like content scripts or popups, then changes you make are picked up automatically, and you'll see them the next time the content script is loaded or the popup is shown. for other changes, click the reload button. this does what it says: reloads any persistent scripts, such as background scripts parses the manifest.json fil...
...fore cannot be used or debugged. service workers can be unavailable if the dom.serviceworkers.enable preference is set to false in about:config. connection to firefox for android 68 releases of firefox for android that are based on version 68 cannot be debugged from desktop firefox versions 69 or later, because of the difference in release versions. ...
AudioParam.value - Web APIs
Web › API › AudioParam › value
.log(source.playbackrate.value === rate); in this case, the log output will be true. value of a property which is changing over time the value of an audioparam can either be fixed or can vary over time. this is reflected by the value getter, which returns the value of the parameter as of the audio rendering engine's most recent render quantum, or moment at which audio buffers are processed and updated. in addition to processing audio buffers, each render quantum updates the value of each audioparam as needed given the current time and any established time-based parameter value changes. upon first creating the parameter, its value is set to its default value, given by audioparam.defaultvalue. this is the parameter's value at a time of 0.0 seconds, and will remain the parameter's value until ...
... been used, the parameter's value is changed to the value given. if the current time equals or exceeds the time specified by a previous call to setvalueattime(), the value is changed to the value passed into setvalueattime(). if any gradiated or ramped value changing methods have been called and the current time is within the time range over which the graduated change should occur, the value is updated based on the appropriate algorithm. these ramped or gradiated value-changing methods include linearramptovalueattime(), settargetattime(), and setvaluecurveattime(). thus, the value of a parameter is maintained to accurately reflect the state of the parameter over time. example this example instantly changes the volume of a gainnode to 40%. const audioctx = new audiocontext(); const gainnod...
AudioTrackList.onchange - Web APIs
enabled flags. note: you can also add a handler for the change event using addeventlistener(). syntax audiotracklist.onchange = eventhandler; value set onchange to a function that should be called whenever tracks are enabled or disabled on the media element. ...
...isabled on the media element. example this snippet establishes a handler for the change event that looks at each of the tracks in the list, calling a function to update the state of a user interface control that indicates the current state of the track. var tracklist = document.queryselector("video").audiotracks; tracklist.onchange = function(event) { tracklist.foreach(function(track) { updatetrackenabledbutton(track.id, track.enabled); }); }; the updatetrackenabledbutton(), in this example, should be a function that finds a user interface control using the track's id (perhaps the app uses the track id as the control element's id) and the track's enabled flag to determine which state the control should be in now. specifications specification status comment ...
BatteryManager - Web APIs
a number representing the remaining time in seconds until the battery is completely discharged and the system will suspend. batterymanager.level read only a number representing the system's battery charge level scaled to a value between 0.0 and 1.0. event handlers batterymanager.onchargingchange a handler for the chargingchange event; this event is sent when the battery charging state is updated. batterymanager.onchargingtimechange a handler for the chargingtimechange event; this event is sent when the battery charging time is updated batterymanager.ondischargingtimechange a handler for the dischargingtimechange event; this event is sent when the battery discharging time is updated. batterymanager.onlevelchange a handler for the levelchange event; this event is sent when the batte...
... methods inherited from eventtarget: eventtarget.addeventlistener() registers an event handler of a specific event type on the eventtarget. eventtarget.removeeventlistener() removes an event listener from the eventtarget. ...
BluetoothRemoteGATTCharacteristic.value - Web APIs
syntax var value = bluetoothremotegattcharacteristic.value returns the currently cached characteristic value. ...
... syntax var value = bluetoothremotegattcharacteristic.value returns the currently cached characteristic value. ...
A basic ray-caster - Web APIs
overview and tutorial i found here at mdn are great, but nobody had written about animation yet, so i thought i'd try a port of a basic raycaster i'd worked on a while ago, and see what sort of performance we can expect from a javascript-controlled pixel buffer. how? the basic idea is to use setinterval() at some arbitrary delay that corresponds to a desired frame rate. after every interval an update function will repaint the canvas showing the current view. i know i could have started with a simpler example, but i'm sure the canvas tutorial will get to that, and i wanted to see if i could do this. so every update, the raycaster looks to see if you've pressed any keys lately, to conserve calculations by not casting if you're idle. if you have, then the canvas is cleared, the ground and sky a...
...as the rays intersect walls, then they render a vertical sliver of canvas in the color of the wall they've hit, blended with a darker version of the color according to the distance to the wall. ...
Basic animations - Web APIs
by using the canvas methods directly or by calling custom functions. in normal circumstances, we only see these results appear on the canvas when the script finishes executing. for instance, it isn't possible to do an animation from within a for loop. that means we need a way to execute our drawing functions over a period of time. there are two ways to control an animation like this. scheduled updates first there's the window.setinterval(), window.settimeout(), and window.requestanimationframe() functions, which can be used to call a specific function over a set period of time. setinterval(function, delay) starts repeatedly executing the function specified by function every delay milliseconds. settimeout(function, delay) executes the function specified by function in delay milliseconds...
...tion over a set period of time. setinterval(function, delay) starts repeatedly executing the function specified by function every delay milliseconds. settimeout(function, delay) executes the function specified by function in delay milliseconds. requestanimationframe(callback) tells the browser that you wish to perform an animation and requests that the browser call a specified function to update an animation before the next repaint. if you don't want any user interaction you can use the setinterval() function which repeatedly executes the supplied code. if we wanted to make a game, we could use keyboard or mouse events to control the animation and use settimeout(). by setting eventlisteners, we catch any user interaction and execute our animation functions. in the examples below, we'...
Introduction to the DOM - Web APIs
ent in the header in which you can place functions that test the interface, a few html elements with attributes that you can retrieve, set, or otherwise manipulate, and the web user interface necessary to call those functions from the browser. you can use this test page or create a similar one to test the dom interfaces you are interested in and see how they work on the browser platform. you can update the contents of the test() function as needed, create more buttons, or add elements as necessary. <html> <head> <title>dom tests</title> <script> function setbodyattr(attr, value) { if (document.body) document.body[attr] = value; else throw new error("no support"); } </script> </head> <body> <div style="margin: .5in; height: 400px;"> <p><b><tt>text</tt></b></p> ...
... of interfaces in a single page—for example, a "suite" of properties that affect the colors of a web page—you can create a similar test page with a whole console of buttons, textfields, and other html elements. the following screenshot gives you some idea of how interfaces can be grouped together for testing. figure 0.1 sample dom test page in this example, the drop-down menus dynamically update such dom—accessible aspects of the web page as its background color (bgcolor), the color of the hyperlinks (alink), and color of the text (text). however, you design your test pages, testing the interfaces as you read about them is an important part of learning how to use the dom effectively. ...
EventSource - Web APIs
event is fired. unlike websockets, server-sent events are unidirectional; that is, data messages are delivered in one direction, from the server to the client (such as a user's web browser). that makes them an excellent choice when there's no need to send data from the client to the server in message form. for example, eventsource is a useful approach for handling things like social media status updates, news feeds, or delivering data into a client-side storage mechanism like indexeddb or web storage. when not used over http/2, sse suffers from a limitation to the maximum number of open connections, which can be specially painful when opening various tabs as the limit is per browser and set to a very low number (6). the issue has been marked as "won't fix" in chrome and firefox. this limit is...
...nts, you'll require a listener for each type of event sent. const sse = new eventsource('/api/v1/sse'); /* this will listen only for events * similar to the following: * * event: notice * data: useful data * id: someid * */ sse.addeventlistener("notice", function(e) { console.log(e.data) }) /* similarly, this will listen for events * with the field `event: update` */ sse.addeventlistener("update", function(e) { console.log(e.data) }) /* the event "message" is a special case, as it * will capture events without an event field * as well as events that have the specific type * `event: message` it will not trigger on any * other event type. */ sse.addeventlistener("message", function(e) { console.log(e.data) }) specifi...
FetchEvent - Web APIs
extendableevent.waituntil() extends the lifetime of the event. used to notify the browser of tasks that extend beyond the returning of a response, such as streaming and caching. examples this fetch event uses the browser default for non-get requests. for get requests it tries to return a match in the cache, and falls back to the network. if it finds a match in the cache, it asynchronously updates the cache for next time. self.addeventlistener('fetch', event => { // let the browser do its default thing // for non-get requests. if (event.request.method != 'get') return; // prevent the default, and handle the request ourselves. event.respondwith(async function() { // try to get the response from a cache. const cache = await caches.open('dynamic-v1'); const cachedresp...
... if (event.request.method != 'get') return; // prevent the default, and handle the request ourselves. event.respondwith(async function() { // try to get the response from a cache. const cache = await caches.open('dynamic-v1'); const cachedresponse = await cache.match(event.request); if (cachedresponse) { // if we found a match in the cache, return it, but also // update the entry in the cache in the background. event.waituntil(cache.add(event.request)); return cachedresponse; } // if we didn't find a match in the cache, use the network. return fetch(event.request); }()); }); specifications specification status comment service workersthe definition of 'fetchevent()' in that specification. working draft in...
HTMLDialogElement.open - Web APIs
id="favanimal" name="favanimal"> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select></p> </section> <menu> <button id="cancel" type="reset">cancel</button> <button type="submit">confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var cancelbutton = document.getelementbyid('cancel'); var dialog = document.getelementbyid('favdialog'); dialog.returnvalue = 'favanimal'; function opencheck(dialog) { if(dialog.open) { console.log('dialog open'); ...
... updatebutton = document.getelementbyid('updatedetails'); var cancelbutton = document.getelementbyid('cancel'); var dialog = document.getelementbyid('favdialog'); dialog.returnvalue = 'favanimal'; function opencheck(dialog) { if(dialog.open) { console.log('dialog open'); } else { console.log('dialog closed'); } } // update button opens a modal dialog updatebutton.addeventlistener('click', function() { dialog.showmodal(); opencheck(dialog); }); // form cancel button closes the dialog box cancelbutton.addeventlistener('click', function() { dialog.close('animalnotchosen'); opencheck(dialog); }); })(); </script> note: you can find this example on g...
HTMLDialogElement.show() - Web APIs
id="favanimal" name="favanimal"> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select></p> </section> <menu> <button id="cancel" type="reset">cancel</button> <button type="submit">confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var cancelbutton = document.getelementbyid('cancel'); var dialog = document.getelementbyid('favdialog'); dialog.returnvalue = 'favanimal'; function opencheck(dialog) { if(dialog.open) { console.log('dialog open'); ...
... updatebutton = document.getelementbyid('updatedetails'); var cancelbutton = document.getelementbyid('cancel'); var dialog = document.getelementbyid('favdialog'); dialog.returnvalue = 'favanimal'; function opencheck(dialog) { if(dialog.open) { console.log('dialog open'); } else { console.log('dialog closed'); } } // update button opens a modal dialog updatebutton.addeventlistener('click', function() { dialog.showmodal(); opencheck(dialog); }); // form cancel button closes the dialog box cancelbutton.addeventlistener('click', function() { dialog.close('animalnotchosen'); opencheck(dialog); }); })(); </script> specifications specificatio...
HTMLDialogElement.showModal() - Web APIs
id="favanimal" name="favanimal"> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select></p> </section> <menu> <button id="cancel" type="reset">cancel</button> <button type="submit">confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var cancelbutton = document.getelementbyid('cancel'); var dialog = document.getelementbyid('favdialog'); dialog.returnvalue = 'favanimal'; function opencheck(dialog) { if(dialog.open) { console.log('dialog open'); ...
... updatebutton = document.getelementbyid('updatedetails'); var cancelbutton = document.getelementbyid('cancel'); var dialog = document.getelementbyid('favdialog'); dialog.returnvalue = 'favanimal'; function opencheck(dialog) { if(dialog.open) { console.log('dialog open'); } else { console.log('dialog closed'); } } // update button opens a modal dialog updatebutton.addeventlistener('click', function() { dialog.showmodal(); opencheck(dialog); }); // form cancel button closes the dialog box cancelbutton.addeventlistener('click', function() { dialog.close('animalnotchosen'); opencheck(dialog); }); })(); </script> note: you can find this example on g...
HTMLDialogElement - Web APIs
id="favanimal" name="favanimal"> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select></p> </section> <menu> <button id="cancel" type="reset">cancel</button> <button type="submit">confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var cancelbutton = document.getelementbyid('cancel'); var dialog = document.getelementbyid('favdialog'); dialog.returnvalue = 'favanimal'; function opencheck(dialog) { if(dialog.open) { console.log('dialog open'); ...
... updatebutton = document.getelementbyid('updatedetails'); var cancelbutton = document.getelementbyid('cancel'); var dialog = document.getelementbyid('favdialog'); dialog.returnvalue = 'favanimal'; function opencheck(dialog) { if(dialog.open) { console.log('dialog open'); } else { console.log('dialog closed'); } } // update button opens a modal dialog updatebutton.addeventlistener('click', function() { dialog.showmodal(); opencheck(dialog); }); // form cancel button closes the dialog box cancelbutton.addeventlistener('click', function() { dialog.close('animalnotchosen'); opencheck(dialog); }); })(); </script> note: you can find this example on g...
HTMLElement: beforeinput event - Web APIs
tenteditable and designmode, the event target is the editing host. if these properties apply to multiple elements, the editing host is the nearest ancestor element whose parent isn't editable. ...
...update the dom element examples this example logs current value of the element immediately before replacing that value with the new one applied to the <input> element. html <input placeholder="enter some text" name="name"/> <p id="values"></p> javascript const input = document.queryselector('input'); const log = document.getelementbyid('values'); input.addeventlistener('beforeinput', updatevalue); function updatevalue(e) { log.textcontent = e.target.value; } result specifications specification status ui eventsthe definition of 'beforeinput event' in that specification. working draft ...
HTMLFormElement.elements - Web APIs
mlformcontrolscollection is based. note: similarly, you can get a list of all of the forms contained within a given document using the document's forms property. syntax nodelist = htmlformelement.elements value an htmlformcontrolscollection containing all non-image controls in the form. this is a live collection; if form controls are added to or removed from the form, this collection will update to reflect the change. the form controls in the returned collection are in the same order in which they appear in the form by following a preorder, depth-first traversal of the tree. this is called tree order. the elements included by htmlformelement.elements and htmlformelement.length are the following: <button> <fieldset> <input> (with the exception that any whose type is "image" are omi...
...ng form controls this example gets the form's element list, then iterates over the list, looking for <input> elements of type "text" so that some form of processing can be performed on them. ...
HTMLImageElement.height - Web APIs
mage of a clock using the srcset attribute. one is 200px wide and the other is 400px wide. further, the sizes attribute is provided to specify the width at which the image should be drawn given the viewport's width. html specifically, for viewports up to 400px wide, the image is drawn at a width of 200px; otherwise, it's drawn at 300px. <p>image height: <span class="size">?</span>px (resize to update)</p> <img src="/files/17373/clock-demo-200px.png" alt="clock" srcset="/files/17373/clock-demo-200px.png 200w, /files/17374/clock-demo-400px.png 400w" sizes="(max-width: 400px) 200px, 300px"> javascript the javascript code looks at the height to determine the height of the image given the width at which it's currently drawn. var clockimage = document.queryselector("i...
...t="clock" srcset="/files/17373/clock-demo-200px.png 200w, /files/17374/clock-demo-400px.png 400w" sizes="(max-width: 400px) 200px, 300px"> javascript the javascript code looks at the height to determine the height of the image given the width at which it's currently drawn. var clockimage = document.queryselector("img"); let output = document.queryselector(".size"); const updateheight = event => { output.innertext = clockimage.height; }; window.addeventlistener("load", updateheight); window.addeventlistener("resize", updateheight); result this example may be easier to try out in its own window. specifications specification status comment html living standardthe definition of 'htmlimageelement.height' in that specification. living st...
HTMLImageElement.width - Web APIs
image of a clock using the srcset attribute. one is 200px wide and the other is 400px wide. further, the sizes attribute is provided to specify the width at which the image should be drawn given the viewport's width. html specifically, for viewports up to 400px wide, the image is drawn at a width of 200px; otherwise, it's drawn at 400px. <p>image width: <span class="size">?</span>px (resize to update)</p> <img src="/files/16864/clock-demo-200px.png" alt="clock" srcset="/files/16864/clock-demo-200px.png 200w, /files/16797/clock-demo-400px.png 400w" sizes="(max-width: 400px) 200px, 400px"> javascript the javascript code looks at the width to determine the width of the image at the moment. this is done in the window's load and resize event handlers, in order to alwa...
... /files/16797/clock-demo-400px.png 400w" sizes="(max-width: 400px) 200px, 400px"> javascript the javascript code looks at the width to determine the width of the image at the moment. this is done in the window's load and resize event handlers, in order to always provide this information. var clockimage = document.queryselector("img"); let output = document.queryselector(".size"); const updatewidth = event => { output.innertext = clockimage.width; }; window.addeventlistener("load", updatewidth); window.addeventlistener("resize", updatewidth); result this example may be easier to try out in its own window. specifications specification status comment html living standardthe definition of 'htmlimageelement.width' in that specification. living standar...
HTMLInputElement.setRangeText() - Web APIs
st before the inserted text. "end" moves the selection to just after the inserted text. "preserve" attempts to preserve the selection. this is the default. example click the button in this example to replace part of the text in the text box. the newly inserted text will be highlighted (selected) afterwards. ...
... the selection to just after the inserted text. "preserve" attempts to preserve the selection. this is the default. example click the button in this example to replace part of the text in the text box. the newly inserted text will be highlighted (selected) afterwards. html <input type="text" id="text-box" size="30" value="this text has not been updated."> <button onclick="selecttext()">update text</button> javascript function selecttext() { const input = document.getelementbyid('text-box'); input.focus(); input.setrangetext('already', 14, 17, 'select'); } result specifications specification status comment html living standardthe definition of 'htmlinputelement.setselectionrange()' in that specification. living standard no change ...
HTMLMediaElement - Web APIs
, but estimates that not enough data has been loaded to play the media up to its end without having to stop for further buffering of content canplaythrough fired when the user agent can play the media, and estimates that enough data has been loaded to play the media up to its end without having to stop for further buffering of content. durationchange fired when the duration attribute has been updated. emptied fired when the media has become empty; for example, when the media has already been loaded (or partially loaded), and the htmlmediaelement.load() method is called to reload it. ended fired when playback stops when end of the media (<audio> or <video>) is reached or because no further data is available. error fired when the resource could not be loaded due to an error. loadeddata ...
...ck of data progress fired periodically as the browser loads a resource. ratechange fired when the playback rate has changed. seeked fired when a seek operation completes seeking fired when a seek operation begins stalled fired when the user agent is trying to fetch media data, but data is unexpectedly not forthcoming. suspend fired when the media data loading has been suspended. timeupdate fired when the time indicated by the currenttime attribute has been updated volumechange fired when the volume has changed. waiting fired when playback has stopped because of a temporary lack of data specifications specification status comment encrypted media extensionsthe definition of 'encrypted media extensions' in that specification. recommendation ad...
Drag Operations - Web APIs
set either the effectallowed, dropeffect property, or both at the same time, if you wish to be more specific about the type of operation that will performed. naturally, changing either property will have no effect if you do not cancel the event as well. drop feedback there are several ways in which you can indicate to the user that a drop is allowed at a certain location. ...
...for simple highlighting, you can use the :-moz-drag-over css pseudoclass on a drop target. ...
Working with the History API - Web APIs
te event won't be fired because the page has been reloaded. the page itself will look like bar.html. if the user clicks back once again, the url will change to http://mozilla.org/foo.html, and the document will get a popstate event, this time with a null state object. here too, going back doesn't change the document's contents from what they were in the previous step, although the document might update its contents manually upon receiving the popstate event. note: calling history.back() normally behaves the same way as clicking the back button. but there is one important exception: after using history.pushstate(), calling history.back() does not raise a popstate event. clicking the browser's back button (still) does. the pushstate() method pushstate() takes three parameters: a state objec...
... other documents, it creates an element with a null namespace uri. the replacestate() method history.replacestate() operates exactly like history.pushstate(), except that replacestate() modifies the current history entry instead of creating a new one. note that this doesn't prevent the creation of a new entry in the global browser history. replacestate() is particularly useful when you want to update the state object or url of the current history entry in response to some user action. note: in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) through gecko 5.0 (firefox 5.0 / thunderbird 5.0 / seamonkey 2.2), the passed object is serialized using json. starting in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3), the object is serialized using the structured clone algorithm. th...
IDBRequest.error - Web APIs
Web › API › IDBRequest › error
n the request is being executed, but you might also encounter other problems when the request is being made. for example, if the the request failed and the result is not available, the invalidstateerror exception is thrown. example the following example requests a given record title, onsuccess gets the associated record from the idbobjectstore (made available as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store. also included at the bottom is an onerror function that reports what the error was if the request fails. for a full working example, see our to-do notifications app (view example live.) var title = "walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todolist'], "readwrite").obj...
....) var title = "walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist'); // get the do-do list with the specified title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objectstoretitlerequest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item // back into the database var updatetitlerequest = objectstore.put(data); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; objectstoretitlerequest.one...
IDBRequest.onerror - Web APIs
r event, fired when a request returns an error. the event handler takes one parameter, an error event with type="error". note: this feature is available in web workers. syntax request.onerror = function(event) { ... }; example the following example requests a given record title, onsuccess gets the associated record from the idbobjectstore (made available as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store. also included at the bottom is an onerror function that reports what the error was if the request fails. for a full working example, see our to-do notifications app (view example live.) var title = "walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todolist'], "readwrite").obj...
..."walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as it's title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objectstoretitlerequest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item back // into the database var updatetitlerequest = objectstore.put(data); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; objectstoretitlerequest.one...
IDBRequest.onsuccess - Web APIs
ult of a request is successfully returned. the event handler takes one parameter, a success event with type="success". note: this feature is available in web workers. syntax request.onsuccess = function(event) { ... }; example the following example requests a given record title, onsuccess gets the associated record from the idbobjectstore (made available as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store. for a full working example, see our to-do notifications app (view example live.) var title = "walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as it's title var objectstoretitl...
..."walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as it's title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objectstoretitlerequest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item back // into the database var updatetitlerequest = objectstore.put(data); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; specifications sp...
IDBRequest.result - Web APIs
Web › API › IDBRequest › result
e result of the request. if the request failed and the result is not available, an invalidstateerror exception is thrown. note: this feature is available in web workers. syntax var myresult = request.result; value any example the following example requests a given record title, onsuccess gets the associated record from the idbobjectstore (made available as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store. for a full working example, see our to-do notifications app (view example live.) var title = "walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as it's title var objectstoretitl...
..."walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as it's title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objectstoretitlerequest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item // back into the database var updatetitlerequest = objectstore.put(data); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; specifications sp...
Basic concepts - Web APIs
version when a database is first created, its version is the integer 1. each database has one version at a time; a database can't exist in multiple versions at once. the only way to change the version is by opening it with a greater version than the current one. this will start a versionchange transaction and fire an upgradeneeded event. the only place where the schema of the database can be updated is inside the handler of that event. note: this definition describes the most recent specification, which is only implemented in up-to-date browsers. old browsers implemented the now deprecated and removed idbdatabase.setversion() method. database connection an operation created by opening a database. a given database can have multiple connections at the same time. transaction an atomic s...
...e operation. index an index is a specialized object store for looking up records in another object store, called the referenced object store. the index is a persistent key-value storage where the value part of its records is the key part of a record in the referenced object store. the records in an index are automatically populated whenever records in the referenced object store are inserted, updated, or deleted. each record in an index can point to only one record in its referenced object store, but several indexes can reference the same object store. when the object store changes, all indexes that refer to the object store are automatically updated. alternatively, you can also look up records in an object store using the key. to learn more on using indexes, see using indexeddb. for th...
IndexedDB API - Web APIs
stem, like an sql-based rdbms. however, unlike sql-based rdbmses, which use fixed-column tables, indexeddb is a javascript-based object-oriented database. indexeddb lets you store and retrieve objects that are indexed with a key; any objects supported by the structured clone algorithm can be stored. you need to specify the database schema, open a connection to your database, and then retrieve and update data within a series of transactions. read more about the concepts behind indexeddb. learn to use indexeddb asynchronously from first principles with our using indexeddb guide. combine indexeddb for storing data offline with service workers for storing assets offline, as outlined in making pwas work offline with service workers. note: like most web storage solutions, indexeddb follows a s...
... events with the following custom interface: idbversionchangeevent the idbversionchangeevent interface indicates that the version of the database has changed, as the result of an idbopendbrequest.onupgradeneeded event handler function. obsolete interfaces an early version of the specification also defined the following, now removed, interfaces. they are still documented in case you need to update previously written code: idbversionchangerequest represents a request to change the version of a database. the way to change the version of the database has since changed (by calling idbfactory.open without also calling idbdatabase.setversion), and the interface idbopendbrequest now has the functionality of the removed idbversionchangerequest. idbdatabaseexception represents exception ...
enabled - Web APIs
bled for this client machine. method of installtrigger object syntax boolean enabled (); parameters none returns true if software installation is enabled for this client machine; otherwise, false. ...
...flects the value of the software installation preference in the user interface, and of the xpinstall.enabled preference in pref.js. ...
InstallTrigger - Web APIs
alltrigger interface is an interesting outlier in the apps api; it's included in this api but are inherited from the old mozilla xpinstall technology for installing add-ons. it is used for triggering the download and installation of an add-on (or anything packaged in an .xpi file) from a web page, using javascript code to kick off the install process. note: this article needs to be updated somewhat. overview for very simple installations, the install methods on the installtrigger object may be all that's needed in the installation script. for more complex installations, you may need to use the install and/or file installation objects. in either case, you must trigger the installation process by creating a web page script in which installtrigger metho...
...achine. getversion returns an object representing the version number from the client version registry for the specified component. it is used in both trigger scripts and installation scripts. install installs one or more xpi files on the local machine. installchrome installs new skin or locale packages in netscape 6 and mozilla. startsoftwareupdate triggers the downloading and installation of the software at the specified url. ...
MediaSession.setPositionState() - Web APIs
if the object is empty, the existing playback state information is cleared. ...
...ace that provides details about ongoing media. this can be particularly useful if your code implements a player for type of media not directly supported by the browser. call this method on the navigator object's mediasession object. syntax navigator.mediasession.setpositionstate(statedict); parameters statedict optional an object conforming to the mediapositionstate dictionary, providing updated information about the playback position and speed of the document's ongoing media. if the object is empty, the existing playback state information is cleared. return value undefined. exceptions typeerror this error can occur in an array of circumstances: the specified mediapositionstate object's duration is missing, negative, or null. position is missing or null, or is either ne...
MediaSource.duration - Web APIs
cted. exceptions the following exceptions may be thrown when setting a new value for this property. exception explanation invalidaccesserror an attempt was made to set a duration value that was negative, or nan. invalidstateerror mediasource.readystate is not equal to open, or one or more of the sourcebuffer objects in mediasource.sourcebuffers are being updated (i.e. their sourcebuffer.updating property is true.) example the following snippet is based on a simple example written by nick desaulniers (view the full demo live, or download the source for further investigation.) function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(assetur...
... specifications specification status comment media source extensionsthe definition of 'duration' in that specification. recommendation initial defini...
MediaSource.endOfStream() - Web APIs
e that a parsing error has occured while fetching media data; maybe the data is corrupt, or is encoded using a codec that the browser doesn't know how to decode. return value undefined exceptions exception explanation invalidstateerror mediasource.readystate is not equal to open, or one or more of the sourcebuffer objects in mediasource.sourcebuffers are being updated (i.e. their sourcebuffer.updating property is true.) example the following snippet is from a simple example written by nick desaulniers (view the full demo live, or download the source for further investigation.) var asseturl = 'frag_bunny.mp4'; // need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4...
... recommendation initial definition. ...
Navigator.registerProtocolHandler() - Web APIs
the navigator method registerprotocolhandler() lets web sites register their ability to open or handle particular url schemes (aka protocols). for example, this api lets webmail sites open mailto: urls, or voip sites open tel: urls. syntax navigator.registerprotocolhandler(scheme, url, title); note: recently updated to navigator.registerprotocolhandler(scheme, url), but no browsers currently support this version. parameters scheme a string containing the protocol the site wishes to handle. for example, you can register to handle sms text message links by passing the "sms" scheme. url a string containing the url of the handler. this url must include %s, as a placeholder that will be replaced with the escaped url to be handled. note: the handler url must us the https scheme...
... human-readable title string for the handler. this will be displayed to the user, such as prompting “allow this site to handle [scheme] links?” or listing registered handlers in the browser’s settings. note: the title has been removed from the spec due to spoofing concerns, but all current browsers still require it. it is recommended to always set the title, since browsers that support the updated spec most likely will be backwards-compatible and still accept the title (but not use it). exceptions securityerror the user agent blocked the registration. this might happen if: the registered scheme (protocol) is invalid, such as a scheme the browser handles itself (https:, about:, etc.) the handler url’s origin does not match the origin of the page calling this api. the brows...
PaymentAddress.country - Web APIs
that field contains an addresserrors-compliant object whose country property is a string indicating the validation error that occurred and, if possible, suggests how to fix it. specifications specification status comment payment request apithe definition of 'paymentaddress.coun...
...that field contains an addresserrors-compliant object whose country property is a string indicating the validation error that occurred and, if possible, suggests how to fix it. specifications specification status comment payment request apithe definition of 'paymentaddress.country' in that...
PaymentDetailsBase - Web APIs
it is never directly used by developers and is included here only to be used as the basis for those documents. properties displayitemsoptional an array of paymentitem objects, each describing one line item for the payment request. these represent the line items on a receipt or invoice. modifiersoptional an array of paymentdetailsmodifier objects, each describing a modifier for particular payment method identifiers. for example, you can use one to adjust the total payment amount based on the selected payment method ("5% cash discount!"). ...
...based on the selected payment method ("5% cash discount!"). shippingoptionsoptional an array of paymentshippingoption objects, each describing one available shipping option from which the user may choose. derived dictionaries the following dictionaries include paymentdetailsbase. paymentdetailsinit provides payment information when calling the paymentrequest() constructor. paymentdetailsupdate provides updated payment details while the payment user interface is being handled. this can be delivered to the payment interface using either paymentdetailsupdateevent.updatewith() or by returning it from the optional detailsupdate promise provided to the paymentrequest.show() call that begins the user interaction. specifications specification status comment payment ...
PaymentMethodChangeEvent - Web APIs
uments (e.g., a user selects a "store" card to make a purchase while using apple pay). constructor paymentmethodchangeevent() creates and returns a new paymentmethodchangeevent object, optionally initialized with values taken from a given paymentmethodchangeeventinit dictionary. properties in addition to the properties below, this interface includes properties inherited from paymentrequestupdateevent. methoddetails read only secure context an object containing payment method-specific data useful when handling a payment method change. if no such information is available, this value is null. methodname read only secure context a domstring containing the payment method identifier, a string which uniquely identifies a particular payment method. this identifier is usually a url used d...
...ame read only secure context a domstring containing the payment method identifier, a string which uniquely identifies a particular payment method. this identifier is usually a url used during the payment process, but may be a standardized non-url string as well, such as basic-card. the default value is the empty string, "". methods this interface includes methods inherited from paymentrequestupdateevent. specifications specification status comment payment request apithe definition of 'paymentmethodchangeevent' in that specification. candidate recommendation initial definition. ...
PaymentRequest.onshippingaddresschange - Web APIs
request.addeventlistener('shippingaddresschange', shippingaddresschangeevent => { ... }); paymentrequest.onshippingaddresschange = function(shippingaddresschangeevent) { ... }; examples the shippingaddresschange event is triggered by a user-agent controlled interaction. if the address stored by the user agent changes at any time during a payment process, the event is triggered. to make sure an updated address is included when sending payment information to the server, you should add event listeners for a paymentrequest object after instantiation, but before the call to show(). // initialization of paymentrequest arguments are excerpted for clarity. var payment = new paymentrequest(supportedinstruments, details, options); request.addeventlistener('shippingaddresschange', function(evt) { ev...
...address is included when sending payment information to the server, you should add event listeners for a paymentrequest object after instantiation, but before the call to show(). // initialization of paymentrequest arguments are excerpted for clarity. var payment = new paymentrequest(supportedinstruments, details, options); request.addeventlistener('shippingaddresschange', function(evt) { evt.updatewith(new promise(function(resolve) { updatedetails(details, request.shippingaddress, resolve); })); }); payment.show().then(function(paymentresponse) { // processing of paymentresponse exerpted for the same of clarity. }).catch(function(err) { console.error("uh oh, something bad happened", err.message); }); specifications specification status comment payment r...
PaymentRequest.onshippingoptionchange - Web APIs
aymentrequest.addeventlistener('shippingoptionchange', shippingoptionchangeevent => { ... }); paymentrequest.onshippingoptionchange = function(shippingoptionchangeevent) { ... }; examples the shippingoptionchange event is triggered by a user-agent controlled interaction. if the option stored by the user agent changes at any time during a payment process, the event is triggered. to make sure an updated option is included when sending payment information to the server, you should add event listeners for a paymentrequest object after instantiation, but before the call to show(). // initialization of paymentrequest arguments are excerpted for clarity. var request = new paymentrequest(supportedinstruments, details, options); // when user selects a shipping address request.addeventlistener('shipp...
...ing payment information to the server, you should add event listeners for a paymentrequest object after instantiation, but before the call to show(). // initialization of paymentrequest arguments are excerpted for clarity. ...
PaymentResponse: payerdetailchange event - Web APIs
ntresponse object when the user makes changes to their personal information while filling out a payment request form. the event handler for payerdetailchange should check each value in the form that has changed and ensure that the values are valid. ...
...rm. the event handler for payerdetailchange should check each value in the form that has changed and ensure that the values are valid. if any are invalid, appropriate error messages should be configured and the retry() method should be called on the paymentresponse to ask the user to update the invalid entries. ...
Payment Request API - Web APIs
ad the allowpaymentrequest attribute set on them. interfaces paymentaddress an object that contains address information; used for billing and shipping addresses, for example. paymentrequest an object that provides the api for creating and managing the user agent's payment interface. paymentrequestevent an event delivered to a payment handler when a paymentrequest is made. paymentrequestupdateevent enables the web page to update the details of the payment request in response to a user action. paymentmethodchangeevent represents the user changing payment instrument (e.g., switching from a credit card to debit card). paymentresponse an object returned after the user selects a payment method and approves a payment request. merchantvalidationevent represents the browser requiring th...
... handler (e.g., registered as allowed to use apple pay). dictionaries addresserrors a dictionary containing strings providing descriptive explanations of any errors in any paymentaddress entries which have errors. payererrors a dictionary containing strings providing descriptive explanations of any errors in related to paymentresponse's email, phone, and name attributes. paymentdetailsupdate an object describing changes that need to be made to the payment details in the event that the server needs to update information following the instantiation of the payment interface but before the user begins to interact with it. related dictionaries for the basic card specification basiccardchangedetails an object providing redacted address information that is provided as the methoddetai...
PointerEvent - Web APIs
own the event is fired when a pointer becomes active. for mouse, it is fired when the device transitions from no buttons depressed to at least one button depressed. for touch, it is fired when physical contact is made with the digitizer. for pen, it is fired when the stylus makes physical contact with the digitizer. pointermove this event is fired when a pointer changes coordinates. pointerrawupdate this event is fired when any of a pointer's properties change. pointerup this event is fired when a pointer is no longer active. pointercancel a browser fires this event if it concludes the pointer will no longer be able to generate events (for example the related device is deactived). pointerout this event is fired for several reasons including: pointing device is moved out of the hit t...
...pointerleave event. example examples of each property, event type, and global event handler are included in their respective reference pages. specifications specification status comment pointer events – level 3the definition of 'pointerevent' in that specification. editor's draft added the getcoalescedevents() and getpredictedevents() methods and pointerrawupdate event. pointer events – level 2the definition of 'pointerevent' in that specification. recommendation added the twist and tangentialpressure properties. pointer eventsthe definition of 'pointerevent' in that specification. obsolete initial definition. ...
Using Pointer Events - Web APIs
ng some of the event's processing in the ongoingtouches for later processing, the start point is drawn as a small circle. we're using a 4-pixel wide line, so a 4 pixel radius circle will show up neatly. drawing as the pointers move each time one or more pointers moves, a pointermove event is delivered, resulting in our handlemove() function being called. its responsibility in this example is to update the cached touch information and to draw a line from the previous position to the current position of each touch. function handlemove(evt) { var el = document.getelementsbytagname("canvas")[0]; var ctx = el.getcontext("2d"); var color = colorfortouch(evt); var idx = ongoingtouchindexbyid(evt.pointerid); log("continuing touch: idx = " + idx); if (idx >= 0) { ctx.beginpath(); ...
...the result is that we stop tracking that touch point. handling canceled touches if the user's finger wanders into browser ui, or the touch otherwise needs to be canceled, the pointercancel event is sent, and we call the handlecancel() function below. function handlecancel(evt) { log("pointercancel: id = " + evt.pointerid); var idx = ongoingtouchindexbyid(evt.pointerid); ong...
RTCPeerConnection.createOffer() - Web APIs
tion of an sdp offer for the purpose of starting a new webrtc connection to a remote peer. the sdp offer includes information about any mediastreamtracks already attached to the webrtc session, codec, and options supported by the browser, and any candidates already gathered by the ice agent, for the purpose of being sent over the signaling channel to a potential peer to request a connection or to update the configuration of an existing connection. the return value is a promise which, when the offer has been created, is resolved with a rtcsessiondescription object containing the newly-created offer. syntax apromise = mypeerconnection.createoffer([options]); mypeerconnection.createoffer(successcallback, failurecallback, [options]) parameters options optional an rtcofferoptions dictiona...
...or other non-voice transmission, this can cause loss of important low-volume sounds. also, emergency calls should never cut audio when quiet. this option defaults to true (voice activity detection enabled). deprecated parameters in older code and documentation, you may see a callback-based version of this function. this has been deprecated and its use is strongly discouraged. you should update any existing code to use the promise-based version of createoffer() instead. the parameters for this form of createoffer() are described below, to aid in updating existing code. successcallback an rtcsessiondescriptioncallback which will be passed a single rtcsessiondescription object describing the newly-created offer. errorcallback an rtcpeerconnectionerrorcallback which will be pass...
RTCRtpSender.setParameters() - Web APIs
the setparameters() method of the rtcrtpsender interface applies changes the configuration of sender's track, which is the mediastreamtrack for which the rtcrtpsender is responsible. in other words, setparameters() updates the configuration of the rtp transmission as well as the encoding configuration for a specific media track on the webrtc connection. syntax var promise = rtcrtpsender.setparameters(parameters) parameters parameters an object conforming with the rtcrtpsendparameters dictionary, specifying options for the rtcrtpsender; these include potential codecs that could be use for encoding the sender's track. the available options are: degradationpreference specifies the preferred way the webrtc layer should handle optimizing bandwidth against quality in constrained-band...
...tytype enumerated type which indicates the encoding's priority. the default value is low. transactionid a string containing a unique id for the last set of parameters applied; this value is used to ensure that setparameters() can only be called to alter changes made by a specific previous call to getparameters(). return value a promise that resolves when the rtcrtpsender.track property is updated with the given parameters. exceptions if an error occurs, the returned promise is rejected with the appropriate exception from the list below. invalidmodificationerror one of the following problems was detected: the number of encodings specified in the parameters object's encodings property does not match the number of encodings currently listed for the rtcrtpsender. you cannot change ...
Storage.setItem() - Web APIs
Web › API › Storage › setItem
keyvalue a domstring containing the value you want to give the key you are creating/updating. return value undefined. exceptions setitem() may throw an exception if the storage is full. particularly, in mobile safari (since ios 5) it always throws when the user enters private mode. ...
... keyvalue a domstring containing the value you want to give the key you are creating/updating. return value undefined. exceptions setitem() may throw an exception if the storage is full. particularly, in mobile safari (since ios 5) it always throws when the user enters private mode. ...
Storage - Web APIs
Web › API › Storage
storage.length read only returns an integer representing the number of data items stored in the storage object. methods storage.key() when passed a number n, this method will return the name of the nth key in the storage. storage.getitem() when passed a key name, will return that key's value. storage.setitem() when passed a key name and value, will add that key to the storage, or update that key's value if it already exists. storage.removeitem() when passed a key name, will remove that key from the storage. storage.clear() when invoked, will empty all keys out of the storage. examples here we access a storage object by calling localstorage. we first test whether the local storage contains data items using !localstorage.getitem('bgcolor'). if it does, we run a function cal...
... remove that key from the storage. storage.clear() when invoked, will empty all keys out of the storage. examples here we access a storage object by calling localstorage. we first test whether the local storage contains data items using !localstorage.getitem('bgcolor'). if it does, we run a function called setstyles() that grabs the data items using storage.getitem() and uses those values to update page styles. if it doesn't, we run another function, populatestorage(), which uses storage.setitem() to set the item values, then runs setstyles(). if(!localstorage.getitem('bgcolor')) { populatestorage(); } setstyles(); function populatestorage() { localstorage.setitem('bgcolor', document.getelementbyid('bgcolor').value); localstorage.setitem('font', document.getelementbyid('font').value...
SubtleCrypto.exportKey() - Web APIs
"] ).then((key) => { const exportbutton = document.queryselector(".raw"); exportbutton.addeventlistener("click", () => { exportcryptokey(key); }); }); pkcs #8 export this example exports an rsa private signing key as a pkcs #8 object. the exported key is then pem-encoded. see the complete code on github. /* convert an arraybuffer into a string from https://developers.google.com/web/updates/2012/06/how-to-convert-arraybuffer-to-and-from-string */ function ab2str(buf) { return string.fromcharcode.apply(null, new uint8array(buf)); } /* export the given key and write it into the "exported-key" space. */ async function exportcryptokey(key) { const exported = await window.crypto.subtle.exportkey( "pkcs8", key ); const exportedasstring = ab2str(exported); const exporte...
...{ const exportbutton = document.queryselector(".pkcs8"); exportbutton.addeventlistener("click", () => { exportcryptokey(keypair.privatekey); }); }); subjectpublickeyinfo export this example exports an rsa public encryption key as a pem-encoded subjectpublickeyinfo object. see the complete code on github. /* convert an arraybuffer into a string from https://developers.google.com/web/updates/2012/06/how-to-convert-arraybuffer-to-and-from-string */ function ab2str(buf) { return string.fromcharcode.apply(null, new uint8array(buf)); } /* export the given key and write it into the "exported-key" space. */ async function exportcryptokey(key) { const exported = await window.crypto.subtle.exportkey( "spki", key ); const exportedasstring = ab2str(exported); const exported...
SubtleCrypto.importKey() - Web APIs
resenting the secret key. */ function importsecretkey(rawkey) { return window.crypto.subtle.importkey( "raw", rawkey, "aes-gcm", true, ["encrypt", "decrypt"] ); } pkcs #8 import this example imports an rsa private signing key from a pem-encoded pkcs #8 object. see the complete code on github. ...
...096-bit key for systems that require long-term security moduluslength: 2048, publicexponent: new uint8array([1, 0, 1]), hash: "sha-256", }, true, ["sign"] ); } subjectpublickeyinfo import this example imports an rsa public encryption key from a pem-encoded subjectpublickeyinfo object. see the complete code on github. ...
Touch events - Web APIs
ects in the list, pushing them onto an array of active touchpoints and drawing the start point for the draw as a small circle; we're using a 4-pixel wide line, so a 4-pixel radius circle will show up neatly. drawing as the touches move each time one or more fingers move, a touchmove event is delivered, resulting in our handlemove() function being called. its responsibility in this example is to update the cached touch information and to draw a line from the previous position to the current position of each touch. function handlemove(evt) { evt.preventdefault(); var el = document.getelementbyid("canvas"); var ctx = el.getcontext("2d"); var touches = evt.changedtouches; for (var i = 0; i < touches.length; i++) { var color = colorfortouch(touches[i]); var idx = ongoingtouchind...
...the result is that we stop tracking that touchpoint. handling canceled touches if the user's finger wanders into browser ui, or the touch otherwise needs to be canceled, the touchcancel event is sent, and we call the handlecancel() function below. function handlecancel(evt) { evt.preventdefault(); console.log("touchcancel."); var touches = evt.changedtouches; for (var i ...
VideoTrackList.onchange - Web APIs
to look at their videotrack.selected flags. note: you can also add a handler for the change event using addeventlistener(). syntax videotracklist.onchange = eventhandler; value set onchange to a function that should be called whenever a track is made active. ...
...never a track is made active. example this snippet establishes a handler for the change event that looks at each of the tracks in the list, calling a function to update the state of a user interface control that indicates the current state of the track. var tracklist = document.queryselector("video").videotracks; tracklist.onchange = function(event) { tracklist.foreach(function(track) { updatetrackselectedbutton(track.id, track.selected); }); }; the updatetrackselectedbutton(), in this example, should be a function that finds a user interface control using the track's id (perhaps the app uses the track id as the control element's id) and the track's selected flag to determine which state the control should be in now. specifications specification status comment ...
WebGLRenderingContext.disable() - Web APIs
um specifying which webgl capability to disable. possible values: constant description gl.blend deactivates blending of the computed fragment color values. see webglrenderingcontext.blendfunc(). gl.cull_face deactivates culling of polygons. see webglrenderingcontext.cullface(). gl.depth_test deactivates depth comparisons and updates to the depth buffer. see webglrenderingcontext.depthfunc(). gl.dither deactivates dithering of color components before they get written to the color buffer. gl.polygon_offset_fill deactivates adding an offset to depth values of polygon's fragments. see webglrenderingcontext.polygonoffset(). gl.sample_alpha_to_coverage deactivates the computation of...
... alpha value. gl.sample_coverage deactivates anding the fragment's coverage with the temporary coverage value. see webglrenderingcontext.samplecoverage(). gl.scissor_test deactivates the scissor test that discards fragments that are outside of the scissor rectangle. see webglrenderingcontext.scissor(). gl.stencil_test deactivates stencil testing and updates to the stencil buffer. see webglrenderingcontext.stencilfunc(). when using a webgl 2 context, the following values are available additionally: constant description gl.rasterizer_discard deactivates that primitives are discarded immediately before the rasterization stage, but after the optional transform feedback stage. gl.clear() commands are ign...
WebGLRenderingContext.enable() - Web APIs
a glenum specifying which webgl capability to enable. possible values: constant description gl.blend activates blending of the computed fragment color values. see webglrenderingcontext.blendfunc(). gl.cull_face activates culling of polygons. see webglrenderingcontext.cullface(). gl.depth_test activates depth comparisons and updates to the depth buffer. see webglrenderingcontext.depthfunc(). gl.dither activates dithering of color components before they get written to the color buffer. gl.polygon_offset_fill activates adding an offset to depth values of polygon's fragments. see webglrenderingcontext.polygonoffset(). gl.sample_alpha_to_coverage activates the computation of a tem...
...by the alpha value. gl.sample_coverage activates anding the fragment's coverage with the temporary coverage value. see webglrenderingcontext.samplecoverage(). gl.scissor_test activates the scissor test that discards fragments that are outside of the scissor rectangle. see webglrenderingcontext.scissor(). gl.stencil_test activates stencil testing and updates to the stencil buffer. see webglrenderingcontext.stencilfunc(). when using a webgl 2 context, the following values are available additionally: constant description gl.rasterizer_discard primitives are discarded immediately before the rasterization stage, but after the optional transform feedback stage. gl.clear() commands are ignored. ...
WebGLRenderingContext - Web APIs
ng of front and/or back writing of individual bits in the stencil planes. webglrenderingcontext.stencilop() sets both the front and back-facing stencil test actions. webglrenderingcontext.stencilopseparate() sets the front and/or back-facing stencil test actions. buffers webglrenderingcontext.bindbuffer() binds a webglbuffer object to a given target. webglrenderingcontext.bufferdata() updates buffer data. webglrenderingcontext.buffersubdata() updates buffer data starting at a passed offset. webglrenderingcontext.createbuffer() creates a webglbuffer object. webglrenderingcontext.deletebuffer() deletes a webglbuffer object. webglrenderingcontext.getbufferparameter() returns information about the buffer. webglrenderingcontext.isbuffer() returns a boolean indicating if the pass...
...exture object. webglrenderingcontext.generatemipmap() generates a set of mipmaps for a webgltexture object. webglrenderingcontext.gettexparameter() returns information about the texture. webglrenderingcontext.istexture() returns a boolean indicating if the passed webgltexture is valid. webglrenderingcontext.teximage2d() specifies a 2d texture image. webglrenderingcontext.texsubimage2d() updates a sub-rectangle of the current webgltexture. webglrenderingcontext.texparameterf() sets texture parameters. webglrenderingcontext.texparameteri() sets texture parameters. programs and shaders webglrenderingcontext.attachshader() attaches a webglshader to a webglprogram. webglrenderingcontext.bindattriblocation() binds a generic vertex index to a named attribute variable. webglrender...
A basic 2D WebGL animation example - Web APIs
our shape and the avertexposition attribute used to deliver vertexes one by one into the vertex shader, we're ready to draw the shape by calling drawarrays(). at this point, the frame has been drawn. all that's left to do is to schedule to draw the next one. that's done here by calling requestanimationframe(), which asks that a callback function be executed the next time the browser is ready to update the screen. our requestanimationframe() callback receives as input a single parameter, currenttime, which specifies the time at which the frame drawing began. we use that and the saved time at which the last frame was drawn, previoustime, along with the number of degrees per second the square should rotate (degreespersecond) to calculate the new value of currentangle. then the value of previoust...
...reen. our requestanimationframe() callback receives as input a single parameter, currenttime, which specifies the time at which the frame drawing began. we use that and the saved time at which the last frame was drawn, previoustime, along with the number of degrees per second the square should rotate (degreespersecond) to calculate the new value of currentangle. then the value of previoustime is updated and we call animatescene() to draw the next frame (and in turn schedule the next frame to be drawn, ad infinitum). result this is a pretty simple example, since it's just drawing one simple object, but the concepts used here extend to much more complex animations. ...
Matrix math for the web - Web APIs
or speed or memory management. these functions create a lot of new arrays, which can be particularly expensive for real-time operations due to garbage collection. in real production code it would be best to use optimized functions. glmatrix is an example of a library that has a focus on speed and performance. the focus in the glmatrix library is to have target arrays that are allocated before the update loop. translation matrix a translation matrix is based upon the identity matrix, and is used in 3d graphics to move a point or object in one or more of the three directions (x, y, and/or z). the easiest way to think of a translation is like picking up a coffee cup. the coffee cup must be kept upright and oriented the same way so that no coffee is spilled. it can move up in the air off the tabl...
...o a fixed width and height and is centered on the page. the <div> has a transition set for the transform so that matrix is animated in making it easy to see what is being done. <div id='move-me' class='transformable'> <h2>move me with a matrix</h2> <p>lorem ipsum dolor sit amet, consectetur adipisicing elit...</p> </div> finally, for each of the examples we will generate a 4x4 matrix, then update the <div>'s style to have a transform applied to it, set to a matrix3d. bear in mind that even though the matrix is made up of 4 rows and 4 columns, it collapses into a single line of 16 values. matrices are always stored in one-dimensional lists in javascript. // create the matrix3d style property from a matrix array function matrixarraytocssmatrix(array) { return 'matrix3d(' + array.join(','...
Animating objects with WebGL - Web APIs
e glmatrix library to perform its matrix and vertex math. you'll need to include it if you create your own project based on this code. our sample loads a copy from a cdn in our html's <head>. making the square rotate let's start by making the square rotate. the first thing we'll need is a variable in which to track the current rotation of the square: var squarerotation = 0.0; now we need to update the drawscene() function to apply the current rotation to the square when drawing it. after translating to the initial drawing position for the square, we apply the rotation like this: mat4.rotate(modelviewmatrix, // destination matrix modelviewmatrix, // matrix to rotate squarerotation, // amount to rotate in radians [0, 0, 1]); // axis to r...
...mationframe(render); this code uses requestanimationframe to ask the browser to call the function "render" on each frame. requestanimationframe passes us the time in milliseconds since the page loaded. we convert that to seconds and then subtract from it the last time to compute deltatime which is the number of second since the last frame was rendered. at the end of drawscene we add the code to update squarerotation. squarerotation += deltatime; this code uses the amount of time that's passed since the last time we updated the value of squarerotation to determine how far to rotate the square. view the complete code | open this demo on a new page « previousnext » ...
Using bounded reference spaces - Web APIs
then... xrsession.requestanimationframe(ondrawframe); } if you compare this code to the code used in examples using unbounded reference spaces, you'll confirm that, indeed, the biggest difference is the reference sp...
...h to simulate a human's perspective on the scene, you probably want to move the viewpoint upward by a distance that approximates human eye level by transforming it by providing an appropriate transform matrix to the xrreferencespace method requestoffsetreferencespace(). ...
Inputs and input sources - Web APIs
animationframerequest = session.requestanimationframe(drawframe); /* draw the frame here */ } the drawframe() function shown here is the callback invoked when it's time to draw the frame, as established by calling the the xrsession method requestanimationframe(). it calls a function applyexternalinputs() which we'll define momentarily; it takes the avatar object and uses its information to update the avatar's reference frame. after that, everything proceeds as usual, getting the viewer's pose from the updated reference frame, requesting the next frame callback through requestanimationframe(), and then continuing to set up webgl and draw the scene. the drawing and other related code can be found in the example movement, orientation, and motion. the applyexternalinputs() method takes the ...
...from the updated reference frame, requesting the next frame callback through requestanimationframe(), and then continuing to set up webgl and draw the scene. the drawing and other related code can be found in the example movement, orientation, and motion. the applyexternalinputs() method takes the avatar object replaces its referencespace property with a new reference space that incorporates the updated deltas. function applyexternalinputs(avatar) { if (!avatar.posdelta.x && !avatar.posdelta.y && !avatar.posdelta.z) { return; // player hasn't moved with keyboard } let newtransform = new xrrigidtransform( { x: avatar.posdelta.x, y: avatar.posdelta.y, z: avatar.posdelta.z } ); avatar.referencespace = avatar.referencespace.getoffsetreferencespace(newtransform); } ...
Using the Web Speech API - Web APIs
this is achieved by calling speechrecognition.start(). the foreach() method is used to output colored indicators showing what colors to try saying. var diagnostic = document.queryselector('.output'); var bg = document.queryselector('html'); var...
... { var char = event.utterance.text.charat(event.charindex); console.log('speech paused at character ' + event.charindex + ' of "' + event.utterance.text + '", which is "' + char + '".'); } finally, we call blur() on the text input. this is mainly to hide the keyboard on firefox os. inputtxt.blur(); } updating the displayed pitch and rate values the last part of the code simply updates the pitch/rate values displayed in the ui, each time the slider positions are moved. pitch.onchange = function() { pitchvalue.textcontent = pitch.value; } rate.onchange = function() { ratevalue.textcontent = rate.value; } ...
XRReferenceSpace: reset event - Web APIs
nt event handler property onreset usage notes the reset event indicates that the coordinate system has been reset or reconfigured by changing the reference space's origin, moving and rotating it as indicated by the event's transform property. the event is sent before any animation frame callbacks are executed to render the pending frame, to ensure that those callbacks have the updated coordinate system available. there are a number of reasons why a reset might occur. most common among them are the following: the user has manually reset the coordinate system, such as by requesting that the headset recalibrate itself to ensure that the facing direction and hand controllers are synchronized with the user's actual position and facing. this is primarily an issue for local or l...
...). however, if that kind of "teleportation" is being used, you actually want to avoid jumping the user's position after tracking recovery, this can introduce additional and potentially jarring jumping. instead of allowing this to happen, you can integrate the emulatedposition into the teleportation offset calculated prior to calling getoffsetreferencespace() to create a new reference space whose updated effective origin is adjusted by the distance the viewer's position jumped since the previous frame. this way, the user's position only changes once rather than twice. the effect of discontinuity size the reset event won't be fired when the discontinuity is small enough that the device is able to regain tracking within the same tracking area. nor will be be fired at an unbounded reference space...
XRRenderStateInit - Web APIs
all distances are specified as floating-point values in meters; you can specify a value of 50 centimeters using a value of 0.5, for example. properties baselayer optional an xrwebgllayer object from which the webxr compositor will obtain imagery. this is null by default. ...
...x for an inline xrsession. the projection matrix calculation also takes into account the output canvas's aspect ratio. this property must not be specified for immersive sessions, so the value is null by default for immersive sessions. the default value is otherwise π * 0.5 (half of the value of pi). usage notes any properties not specified in the xrrenderstateinit compliant object passed into updaterenderstate() are left at their current values. specifications specification status comment webxr device apithe definition of 'xrrenderstateinit' in that specification. working draft initial definition. ...
XRSession.requestAnimationFrame() - Web APIs
splay. the specified callback is executed once before the next repaint; if you wish for it to be executed for the following repaint, you must call requestanimationframe() again. this can be done from within the callback itself. the callback takes two parameters as inputs: an xrframe describing the state of all tracked objects for the session, and a time stamp you can use to compute any animation updates needed. you can cancel a previously scheduled animation by calling cancelanimationframe(). note: despite the obvious similarities between these methods and the global requestanimationframe() function provided by the window interface, you must not treat these as interchangeable. there is no guarantee that the latter will work at all while an immersive xr session is underway. syntax requesti...
...animationframe() function provided by the window interface, you must not treat these as interchangeable. there is no guarantee that the latter will work at all while an immersive xr session is underway. syntax requestid = xrsession.requestanimationframe(animationframecallback); parameters animationframecallback a function which is called before the next repaint in order to allow you to update and render the xr scene based on elapsed time, animation, user input changes, and so forth. the callback receives as input two parameters: time a domhighrestimestamp indicating the time offset at which the updated viewer state was received from the webxr device. xrframe an xrframe object describing the state of the objects being tracked by the session. this can be used to obtain the po...
XRWebGLLayer.getNativeFramebufferScaleFactor() static method - Web APIs
when the returned promise resolves, we proceed by calling xrwebgllayer's getnativeframebufferscalefactor() static function to get the scale factor needed to reach the native resolution, and we then pass that into the webgllayer() constructor as the value of the framebuffe...
...et the scale factor needed to reach the native resolution, and we then pass that into the webgllayer() constructor as the value of the framebufferscalefactor property in its layerinit dictionary, which is an xrwebgllayerinit object. that gets us a new xrwebgllayer object representing a rendering surface we can use for the xrsession; we set it as the rendering surface for xrsession by calling its updaterenderstate() method, passing the new gllayer in using the xrrenderstate dictionary's xrrenderstate.baselayer property. the result is a rendering context that looks like the diagram below: each time the xrviewerpose's views are iterated over for rendering, the rendering loop obtains an xrview for the left eye which has its top-left corner at (0, 0) with its width and height being 1280x1440 pixe...
XSL Transformations in Mozilla FAQ - Web APIs
dom, those honor media just like in pages without xslt. how do i do transformnode? there is transformtodocument and transformtofragment starting with mozilla 1.2 final, see using the mozilla javascript interface to xsl transformations. ...
... see the building transformiix standalone page. ...
Web APIs
Web › API
yboardlayoutmap keyframeeffect keyframeeffectoptions l largestcontentfulpaint layoutshift layoutshiftattribution linearaccelerationsensor linkstyle localfilesystem localfilesystemsync localmediastream location lock lockmanager lockedfile m midiaccess midiconnectionevent midiinput midiinputmap midimessageevent midioutputmap mscandidatewindowhide mscandidatewindowshow mscandidatewindowupdate msgestureevent msgraphicstrust msmanipulationevent msrangecollection mssitemodeevent magnetometer mathmlelement mediacapabilities mediacapabilitiesinfo mediaconfiguration mediadecodingconfiguration mediadeviceinfo mediadevices mediaelementaudiosourcenode mediaencodingconfiguration mediaerror mediaimage mediakeymessageevent mediakeysession mediakeystatusmap mediakeysystemaccess media...
...exture_float_linear oes_texture_half_float oes_texture_half_float_linear oes_vertex_array_object ovr_multiview2 offlineaudiocompletionevent offlineaudiocontext offscreencanvas orientationsensor oscillatornode overconstrainederror p pagetransitionevent paintworklet pannernode parentnode passwordcredential path2d payererrors paymentaddress paymentcurrencyamount paymentdetailsbase paymentdetailsupdate paymentitem paymentmethodchangeevent paymentrequest paymentrequestevent paymentrequestupdateevent paymentresponse paymentvalidationerrors pbkdf2params performance performanceentry performanceeventtiming performanceframetiming performancelongtasktiming performancemark performancemeasure performancenavigation performancenavigationtiming performanceobserver performanceobserverentrylist perfo...
Using the log role - Accessibility
old information may disappear. for example, chat logs, messaging history or an error log. in contrast to other types of live region, this role is sequentially ordered and new information is only added to the end of the log. when this role is added to an element, the browser will send out an accessible log event to assistive technology products which can then notify the user about it. by default updates contain only the changes to the live region and these are announced when the user is idle. where the user needs to hear the entire live region upon a change aria-atomic="true" should be set. to have announcements made as soon as possible and where the user may be interrupted, aria-live="assertive" can be set for more aggressive updates. possible effects on user agents and assistive technology ...
...ble log event using the operating system's accessibility api if it supports it. assistive technology products should listen for such an event and notify the user accordingly: screen readers should announce changes inside a log when the user is idle, unless aria-live=”assertive” has been set and in which case the user may be interrupted. screen magnifiers may visually indicate that a log update has occurred. note: opinons may differ on how assistive technology should handle this technique. the information provided above is one of those opinions and therefore not normative. examples example 1: adding the role in the html code the snippet below shows how the log role is added directly into the html source code. <div id="liveregion" class="region" role="log"></div> example 2: snipp...
Using the progressbar role - Accessibility
e application is making progress toward completing the requested action. if the actual value of the progressbar can be determined, the developer has to indicate this progress using the aria-valuenow, aria-valuemin, and aria-valuemax attributes. if the progress value is indeterminate, the developer should omit the aria-valuenow attribute. as the task progresses, the aria-valuenow value has to be updated dynamically to indicate this progress to assistive technology products. if the progressbar is describing the loading progress of a particular region of a page, the author should use aria-describedby to point to the status, and set the aria-busy attribute to true on the region until it is finished loading. it is not possible for the user to alter the value of a progressbar because it is always ...
... of aria-valuemin and aria-valuemax, unless aria-valuetext is specified. it is best to set the values for aria-valuemin, aria-valuemax, and aria-valuenow in a manner that is appropriate for this calculation. note: elements with the role progressbar have an implicit aria-readonly value of true. possible effects on user agents and assistive technology screen readers should announce the progress updates as they occur. if the progress bar is labeled, the label text should be mentioned as well. note: opinions may differ on how assistive technology should handle this. the information provided above is one of those opinions and therefore not normative. examples example 1: basic progressbar with percentage values <div role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">20...
ARIA: alert role - Accessibility
the alert role is added to the node containing an alert message, not the element causing the alert to be triggered. alerts are assertive live regions. ...
... the alert role is added to the node containing an alert message, not the element causing the alert to be triggered. alerts are assertive live regions. setting role="alert" is equivalent to setting aria-live="assertive" and aria-atomic="true". ...
ARIA: dialog role - Accessibility
dialogs are generally placed on top of the rest of the page content using an overlay. dialogs can be either non-modal (it's still possible to interact with content outside of the dialog) or modal (only the content in the dialog can be interacted with). <div role="dialog" aria-labelledby="dialog1title" aria-describedby="dialog1desc"> <h2 id="dialog1title">your personal details were successfully updated</h2> <p id="dialog1desc">you can change your details at any time in the user account section.</p> <button>close</button> </div> description marking up a dialog element with the dialog role helps assistive technology identify the dialog's content as being grouped and separated from the rest of the page content. however, adding role="dialog" alone is not sufficient to make a dialog accessibl...
...to the role="dialog" element. additionally, if the dialog contains additional descriptive text besides the dialog title, this text can be associated with the dialog using the aria-describedby attribute. this approach is shown in the code snippet below: <div role="dialog" aria-labelledby="dialog1title" aria-describedby="dialog1desc"> <h2 id="dialog1title">your personal details were successfully updated</h2> <p id="dialog1desc">you can change your details at any time in the user account section.</p> <button>close</button> </div> keep in mind that a dialog's title and description text do not have to be focusable in order to be perceived by screen readers operating in a non-virtual mode. the combination of the aria dialog role and labeling techniques should make the screen reader announce th...
ARIA: listbox role - Accessibility
r selects an option, the following must occur: deselect the previously selected option, setting the aria-selected to false, or removing the attribute altogether, changing the appearance of the newly unselected option to appear not selected. select the newly selected option, setting aria-selected="true" on the option and changing the appearance of the newly selected option to appear selected. ...
...ion in a multi select listbox when the user clicks on an option, hits space when focused on an option, or otherwise toggles the state of an option, the following must occur: toggle the aria-selected state of the currently focused option, changing the state of the aria-selected to true if it was false or false if it was true. change the appearance of the option to reflect it's selected state update the aria-activedescendant value on the listbox to the id of the option the user just interacted with, even if they toggled the option to be unselected. the first rule of aria use is you can use a native feature with the semantics and behavior you require already built in, instead of re-purposing an element and adding an aria role, state or property to make it accessible, then do so. the <sele...
Keyboard-navigable JavaScript widgets - Accessibility
to "0" requires also updating the previously selected item to tabindex="-1". this technique involves programmatically moving focus in response to key events and updating the tabindex to reflect the currently focused item. to do this: bind a key down handler to each element in the group, and when an arrow key is used to move to another element: programmatically apply focus to the new element, update the tabindex of the focused element to "0", and update the tabindex of the previously focused element to "-1". here's an example of a wai-aria tree view using this technique. tips use element.focus() to set focus do not use createevent(), initevent() and dispatchevent() to send focus to an element. dom focus events are considered informational only: generated by the system after something i...
...is works. general guidelines use onkeydown to trap key events, not onkeypress ie will not fire keypress events for non-alphanumeric keys. use onkeydown instead. ensure that keyboard and mouse produce the same experience to ensure that the user experience is consistent regardless of input device, keyboard and mouse event handlers should share code where appropriate. for example, the code that updates the tabindex or the styling when users navigate using the arrow keys should also be used by mouse click handlers to produce the same changes. ensure that the keyboard can be used to activate element to ensure that the keyboard can be used to activate elements, any handlers bound to mouse events should also be bound to keyboard events. for example, to ensure that the enter key will activate an ...
Text labels and names - Accessibility
aria role="dialog" or role="alertdialog"; you can use the aria-label or aria-labelledby attributes to provide a label. examples the following example shows a simple dialog box, defined as such using role="dialog" and labelled using aria-labelledby. <div role="dialog" aria-labelledby="dialog1title" aria-describedby="dialog1desc"> <h2 id="dialog1title">your personal details were successfully updated</h2> <p id="dialog1desc">you can change your details at any time in the user account section.</p> <button>close</button> </div> if the dialog box doesn't have a heading, you can instead use aria-label to contain the label text: <div role="dialog" aria-label="personal details updated confirmation"> <p>your personal details were successfully updated. you can change your details at any ...
...determine its content, which can be a time consuming and potentially confusing process. examples the title for the reference article about the <title> element is as follows: <title>&lt;title&gt;: the document title element - html: hypertext markup language</title> another example might look like so: <title>fill in your details to register — mygov services</title> to help the user, you can update the page title value to reflect significant page state changes (such as form validation problems): <title>2 errors — fill in your details to register — mygov services</title> see also <title> embedded content must be labeled make sure that elements that embed content have a title attribute that describes the embedded content. this includes the <embed> and <object> elements. these ele...
@media - CSS: Cascading Style Sheets
Web › CSS › @media
e page added in media queries level 5. prefers-reduced-transparency the user prefers reduced transparency added in media queries level 5. resolution pixel density of the output device scan scanning process of the output device scripting detects whether scripting (i.e. javascript) is available added in media queries level 5. update how frequently the output device can modify the appearance of content added in media queries level 4. width width of the viewport including width of scrollbar accessibility concerns to best accommodate people who adjust a site's text size, use ems when you need a <length> for your media queries. both em and px are valid units, but em works better if the user changes...
...s-contrast, and prefers-color-scheme media features. css working group drafts github issues css conditional rules module level 3the definition of '@media' in that specification. defines the basic syntax of the @media rule. css working group drafts github issues media queries level 4the definition of '@media' in that specification. adds scripting, pointer, hover, update, overflow-block, and overflow-inline media features. deprecates all media types except for screen, print, speech, and all. makes the syntax more flexible by adding, among other things, the or keyword. css working group drafts github issues media queriesthe definition of '@media' in that specification. css level 2 (revision 1)the definition of '@media' in...
Backwards Compatibility of Flexbox - CSS: Cascading Style Sheets
prefix. the idea of these prefixes was to allow implementations of the spec to be tested and explored by browser engineers and web developers alike without clashing with other implementations. the idea was not to use the experimental implementations in production code. ...
...uction code. however, prefixes ultimately were used in production code, and changes to the experimental specification caused people to need to update their sites to keep up. in 2009, the specification looked quite different. to create a flex container you would use display: box and there were a number of box-* properties, which did things that you will recognise from flexbox today. there was an update to the spec that updated the syntax to display: flexbox — this was again vendor-prefixed. ultimately the specification was updated to define display: flex as the way to create a flex container. browser support for the up-to-date version of the specification is excellent from this point forward. there are a few old articles in existence that refer to the older versions of flexbox, which are pr...
display - CSS: Cascading Style Sheets
Web › CSS › display
specifications specification status comment css display module level 3the definition of 'displa...
... black; color: white; margin: 1px; } article, span { padding: 10px; border-radius: 7px; } article, div { margin: 20px; } javascript const articles = document.queryselectorall('.container'); const select = document.queryselector('select'); function updatedisplay() { articles.foreach((article) => { article.style.display = select.value; }); } select.addeventlistener('change', updatedisplay); updatedisplay(); result note: you can find more examples in the pages for each separate display data type, linked above. specifications specification status comment css display module level 3the definition of 'display' in that specification. candidate recommendation added run-in, flow, flow-root, contents, and multi-keyword values. css ...
<filter-function> - CSS: Cascading Style Sheets
the image transparent. saturate() super-saturates or desaturates the input image. sepia() converts the image to sepia. examples filter function comparison this example provides a simple graphic, along with a select menu to allow you to choose between the different types of filter function, and a slider to allow you to vary the values used inside the filter function. updating the controls updates the filter effect in real time, allowing you to investigate the effects of different filters. html <div></div> <ul> <li> <label for="filter-select">choose a filter function:</label> <select id="filter-select"> <option selected>blur</option> <option>brightness</option> <option>contrast</option> <option>drop-shadow</option> <option>grayscale</option> ...
...(filter === 'drop-shadow') { divelem.style.filter = `${selectelem.value}(${math.round(slider.value)}${slider.getattribute('data-unit')} ${math.round(slider.value)}${slider.getattribute('data-unit')} ${math.round(math.abs(slider.value/2))}${slider.getattribute('data-unit')})`; } else { divelem.style.filter = `${selectelem.value}(${slider.value}${slider.getattribute('data-unit')}`; } updateoutput(); updatecurvalue(); } function updateoutput() { output.textcontent = slider.value; } function updatecurvalue() { curvalue.textcontent = `filter: ${divelem.style.filter}`; } setslider(selectelem.value); setdiv(selectelem.value); result specifications specification status filter effects module level 1the definition of 'filter-function' in that specifica...
font-style - CSS: Cascading Style Sheets
mdn understanding wcag, guid...
...margin-bottom: 0; } javascript let slantlabel = document.queryselector('label[for="slant"]'); let slantinput = document.queryselector('#slant'); let sampletext = document.queryselector('.sample'); function update() { let slant = `oblique ${slantinput.value}deg`; slantlabel.textcontent = `font-style: ${slant};`; sampletext.style.fontstyle = slant; } slantinput.addeventlistener('input', update); update(); accessibility concerns large sections of text set with a font-style value of italic may be difficult for people with cognitive concerns such as dyslexia to read. mdn understanding wcag, guideline 1.4 explanations w3c understanding wcag 2.1 formal definition initial valuenormalapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed va...
place-content - CSS: Cascading Style Sheets
<option value="center" selected>center</option> <option value="start">start</option> <option value="end">end</option> <option value="flex-start">flex-start</option> <option value="flex-end">flex-end</option> <option value="left">left</option> <option value="right">right</option> <option value="safe">safe</option> <option value="unsafe">unsafe</option> </select><code>;</code> var update = function () { document.getelementbyid("container").style.placecontent = document.getelementbyid("aligncontentalignment").value + " " + document.getelementbyid("justifycontentalignment").value; } var aligncontentalignment = document.getelementbyid("aligncontentalignment"); aligncontentalignment.addeventlistener("change", update); var justifycontentalignment = document.getelementbyid("justi...
...nt = document.getelementbyid("aligncontentalignment").value + " " + document.getelementbyid("justifycontentalignment").value; } var aligncontentalignment = document.getelementbyid("aligncontentalignment"); aligncontentalignment.addeventlistener("change", update); var justifycontentalignment = document.getelementbyid("justifycontentalignment"); justifycontentalignment.addeventlistener("change", update); var writingm = document.getelementbyid("writingmode"); writingm.addeventlistener("change", function (evt) { document.getelementbyid("container").style.writingmode = evt.target.value; }); var direction = document.getelementbyid("direction"); direction.addeventlistener("change", function (evt) { document.getelementbyid("container").style.direction = evt.target.value; }); css #container...
transition-timing-function - CSS: Cascading Style Sheets
th: 12em; min-width: 12em; margin-bottom: 4px; background-color: black; border: 1px solid red; color: white; transition-property: all; transition-duration: 7s; } .parent > div.box1{ width: 90vw; min-width: 24em; background-color: magenta; color: yellow; border: 1px solid orange; transition-property: all; transition-duration: 2s; } function updatetransition() { var els = document.queryselectorall(".parent > div[class]"); for(var c = els.length, i = 0; i < c; i++) { els[i].classlist.toggle("box1"); } } var intervalid = window.setinterval(updatetransition, 10000); .ease { transition-timing-function: ease; } .easein { transition-timing-function: ease-in; } .easeout { transition-timing-function: ease-out; } .easeinout {...
...idth: 12em; min-width: 12em; margin-bottom: 4px; background-color: black; border: 1px solid red; color: white; transition-property: all; transition-duration:7s; } .parent > div.box1{ width: 90vw; min-width: 24em; background-color: magenta; color: yellow; border: 1px solid orange; transition-property: all; transition-duration:2s; } function updatetransition() { var els = document.queryselectorall(".parent > div[class]"); for(var c = els.length, i = 0; i < c; i++) { els[i].classlist.toggle("box1"); } } var intervalid = window.setinterval(updatetransition, 10000); .jump-start { transition-timing-function: steps(5, jump-start); } .jump-end { transition-timing-function: steps(5, jump-end); } .jump-none { transition-timi...
Making content editable - Developer guides
ted markup between browsers. for example, even something as simple as what happens when you press enter/return to create a new line of text inside an editable element was handled differently across the major browsers (firefox inserted <br> elements, ie/opera used <p>, chrome/safari used <div>). fortunately, in modern browsers things are somewhat more consistent. as of firefox 60, firefox will be updated to wrap the separate lines in <div> elements, matching the behavior of chrome, modern opera, edge, and safari. try it out in the above example. note: internet explorer, which is no longer being developed, uses <p> elements instead of <div>. if you want to use a different paragraph separator, the above browsers all support document.execcommand, which provides a defaultparagraphseparator comm...
...ides a defaultparagraphseparator command to allow you to change it. for example, to use <p> elements: document.execcommand("defaultparagraphseparator", false, "p"); additionally, firefox supports the non-standard argument, br, for defaultparagraphseparator since firefox 55. this is useful if your web application expects the older firefox behavior, and you don't want to or don't have the time to update it to use the new behavior. you can use the older firefox behavior with this line: document.execcommand("defaultparagraphseparator", false, "br"); security for security reasons, firefox doesn't let javascript code use clipboard related features (copy, paste, etc.) by default. you can enable them by setting the preferences shown below using about:config: user_pref("capability.policy.policyname...
A hybrid approach - Developer guides
s can make it more time-consuming to develop than other approaches. with proper planning, though, the code can still be organized in a maintainable way. another downside is that because this approach relies on responsive design, it typically works best on a new project or one that has an existing flexible layout, not as a retrofit. similarly, because it uses user-agent detection, you will have to update your detection rules as time goes on. when it is right to choose this option combining server-side and client-side techniques is something that is always worth considering; there are so many options that one must just weigh the pros and cons of each individual technique employed. in many cases, the added complexity of the hybrid approach is not even necessary. for example, you may not even nee...
...very page on the site should look great at a wide variety of resolutions, being built with responsive design in mind. future plans include exploring serving images based on user-agent. so far there is not much to see for mobile, since things are still in the formative stages of development, but you can always watch the new mozilla.org grow up on github. subscribe to the mozilla webdev blog for updates about our progress. summary no approach is a one-size-fits-all solution. web applications that want to heavily modify the content or user flow for mobile users should probably go for a separate mobile site. content-oriented pages that don’t need to modify their content for mobile users will be satisfied with responsive design. if you need to slightly alter the site’s message for mobile use...
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
Web › HTML › Element › audio
but estimates that not enough data has been loaded to play the media up to its end without having to stop for further buffering of content. canplaythrough the browser estimates it can play the media up to its end without stopping for content buffering. complete the rendering of an offlineaudiocontext is terminated. durationchange the duration attribute has been updated. emptied the media has become empty; for example, this event is sent if the media has already been loaded (or partially loaded), and the load() method is called to reload it. ended playback has stopped because the end of the media was reached. loadeddata the first frame of the media has finished loading. loadedmetadata the metadata has been loaded.
...is ready to start after having been paused or delayed due to lack of data. ratechange the playback rate has changed. seeked a seek operation completed. seeking a seek operation began. stalled the user agent is trying to fetch media data, but data is unexpectedly not forthcoming. suspend media data loading has been suspended. timeupdate the time indicated by the currenttime attribute has been updated. volumechange the volume has changed. waiting playback has stopped because of a temporary lack of data usage notes browsers don't all support the same file types and audio codecs; you can provide multiple sources inside nested <source> elements, and the browser will then use the first one it unders...
<hgroup> - HTML: Hypertext Markup Language
Web › HTML › Element › hgroup
dary heading (and with the same or similar punctuation before any other secondary headings an <hgroup> might be shown in a rendered outline in with the primary heading followed by parentheses around the secondary heading(s) consider the following html document: <!doctype html> <title>html standard</title> <body> <hgroup id="document-title"> <h1>html</h1> <h2>living standard — last updated 12 august 2016</h2> </hgroup> <p>some intro to the document.</p> <h2>table of contents</h2> <ol id=toc>...</ol> <h2>first section</h2> <p>some intro to the first section.</p> </body> a rendered outline for that document might look like the following: that is, the rendered outline might show the primary title, html, followed by a colon and space, followed by the secondary title, l...
...</hgroup> <p>some intro to the document.</p> <h2>table of contents</h2> <ol id=toc>...</ol> <h2>first section</h2> <p>some intro to the first section.</p> </body> a rendered outline for that document might look like the following: that is, the rendered outline might show the primary title, html, followed by a colon and space, followed by the secondary title, living standard — last updated 12 august 2016. or, the rendered outline for that document might instead look like the following: that is, the rendered outline might show the primary title, html, followed by the secondary title shown in parentheses: (living standard — last updated 12 august 2016). examples <hgroup id="document-title"> <h1>html</h1> <h2>living standard — last updated 12 august 2016</h2> </hgroup> ...
<input type="datetime-local"> - HTML: Hypertext Markup Language
there are two equally close options. for datetime-local inputs, the value of step is given in seconds, with a scaling factor of 1000 (since the underlying numeric value is in milliseconds). the default value of step is 60, indicating 60 seconds (or 1 minute, or 60,000 milliseconds). at this time, it's unclear what a value of any means for step when used with datetime-local inputs. this will be updated as soon as that information is determined. using datetime-local inputs date/time inputs sound convenient at first glance; they provide an easy ui for choosing dates and times, and they normalize the data format sent to the server, regardless of the user's locale. however, there are issues with <input type="datetime-local"> because of the limited browser support. we'll look at basic and more c...
... specifications specification status comments html living standardthe d...
<input type="time"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › time
arance chrome and opera in chrome/opera the time control is simple, with slots to enter hours and minutes in 12 or 24-hour format depending on operating system locale, and up and down arrows to increment and decrement the currently selected component. in some versions, an "x" button is provided to clear the control's value. 12-hour 24-hour chrome 83 in chrome 83, the ui controls have been updated with a new look and feel. the new element is functionally identical to the old one, but has a similar ui to edge. 24-hour firefox firefox's time control is very similar to chrome's, except that it doesn't have the up and down arrows. it also uses a 12- or 24-hour format for inputting times, based on system locale. an "x" button is provided to clear the control's value. 12-hour 24-hour ...
...tive direction when there are two equally close options. for time inputs, the value of step is given in seconds, with a scaling factor of 1000 (since the underlying numeric value is in milliseconds). the default value of step is 60, indicating 60 seconds (or 1 minute, or 60,000 milliseconds). at this time, it's unclear what a value of any means for step when used with time inputs. this will be updated as soon as that information is determined. using time inputs although among the date and time input types time has the widest browser support, it is not yet approaching universal, so it is likely that you'll need to provide an alternative method for entering the date and time, so that safari users (and users of other non-supporting browsers) can still easily enter time values. we'll look at b...
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
Web › HTML › Element › input
io button is the currently selected one in the group of same-named radio buttons. if present on a checkbox type, it indicates that the checkbox is checked by default (when the page loads). it does not indicate whether this checkbox is currently checked: if the checkbox’s state is changed, this content attribute does not reflect the change. (only the htmlinputelement’s checked idl attribute is updated.) note: unlike other input controls, a checkboxes and radio buttons value are only included in the submitted data if they are currently checked. if they are, the name and the value(s) of the checked controls are submitted. for example, if a checkbox whose name is fruit has a value of cherry, and the checkbox is checked, the form data submitted will include fruit=cherry. if the checkbox isn...
...ction and text substitutions. incremental the boolean attribute incremental is a webkit and blink extension (so supported by safari, opera, chrome, etc.) which, if present, tells the user agent to process the input as a live search. as the user edits the value of the field, the user agent sends search events to the htmlinputelement object representing the search box. this allows your code to update the search results in real time as the user edits the search. if incremental is not specified, the search event is only sent when the user explicitly initiates a search (such as by pressing the enter or return key while editing the field). the search event is rate-limited so that it is not sent more more frequently than an implementation-defined interval. mozactionhint a mozilla extension, ...
HTML documentation index - HTML: Hypertext Markup Language
Web › HTML › Index
fundamental to domain-specific information, such as people, organizations, events, and locations. microformats use supporting vocabularies to describe objects and name-value pairs to assign values to their properties. the properties are carried in class attributes that can be added to any html element, while the data values re-use html element content and semantic attributes. microformats2 is an update to microformats that provides a simpler way of annotating html structured syntax & vocabularies than previous approaches of using rdfa and microdata which require learning new attributes. 235 preloading content with rel="preload" guide, html, javascript, link, media, performance, web performance, as, preload, rel the preload value of the <link> element's rel attribute lets yo...
...nce, web performance, as, preload, rel the preload value of the <link> element's rel attribute lets you declare fetch requests in the html's <head>, specifying resources that your page will need very soon, which you want to start loading early in the page lifecycle, before browsers' main rendering machinery kicks in. 236 quirks mode and standards mode gecko, guide, html, needsupdate, web development, web standards, xhtml in the old days of the web, pages were typically written in two versions: one for netscape navigator, and one for microsoft internet explorer. when the web standards were made at w3c, browsers could not just start using them, as doing so would break most existing sites on the web. browsers therefore introduced two modes to treat new standards compliant...
Tk - HTTP
Web › HTTP › Headers › Tk
tk response header indicates the tracking status that applied to the corresponding request. header type response header forbidden header name no syntax tk: ! (under construction) tk: ? (dynamic) tk: g (gateway or multiple parties) tk: n (not tracking) tk: t (tracking) tk: c (tracking with consent) tk: p (potential consent) tk: d (disregarding dnt) tk: u (updated) directives ! under construction. the origin server is currently testing its communication of tracking status. ? dynamic. the origin server needs more information to determine tracking status. g gateway or multiple parties. the server is acting as a gateway to an exchange involving multiple parties. n not tracking. t tracking. c tracking with consent. the origin server believes i...
...er, user agent, or device, but promises not to use or share any dnt:1 data until such consent has been determined, and further promises to delete or permanently de-identify within 48 hours any dnt:1 data received for which such consent has not been received. d disregarding dnt. the origin server is unable or unwilling to respect a tracking preference received from the requesting user agent. u updated. the request resulted in a potential change to the tracking status applicable to this user, user agent, or device. examples a tk header for a resource that claims not to be tracking would look like: tk: n specifications specification status comment tracking preference expression (dnt)the definition of 'tk header field' in that specification. obsolete initial d...
An overview of HTTP - HTTP
Web › HTTP › Overview
olved over time. it is an application layer protocol that is sent over tcp, or over a tls-encrypted tcp connection, though any reliable transport protocol could theoretically be used. due to its extensibility, it is used to not only fetch hypertext documents, but also images and videos or to post content to servers, like with html form results. http can also be used to fetch parts of documents to update web pages on demand. components of http-based systems http is a client-server protocol: requests are sent by one entity, the user-agent (or a proxy on behalf of it). most of the time the user-agent is a web browser, but it can be anything, for example a robot that crawls the web to populate and maintain a search engine index. each individual request is sent to a server, which handles it and pr...
... the page. it then parses this file, making additional requests corresponding to execution scripts, layout information (css) to display, and sub-resources contained within the page (usually images and videos). the web browser then mixes these resources to present to the user a complete document, the web page. scripts executed by the browser can fetch more resources in later phases and the browser updates the web page accordingly. a web page is a hypertext document. this means some parts of displayed text are links which can be activated (usually by a click of the mouse) to fetch a new web page, allowing the user to direct their user-agent and navigate through the web. the browser translates these directions in http requests, and further interprets the http responses to present the user with a c...
Redirections in HTTP - HTTP
users rarely notice the redirection. there are several types of redirects, sorted into three categories: permanent redirections temporary redirections special redirections permanent redirections these redirections are meant to last forever. they imply that the original url should no longer be used, and replaced with the new one.search engine robots, rss readers, and other crawlers will update the original url for the resource. code text method handling typical use case 301 moved permanently get methods unchanged. others may or may not be changed to get.[1] reorganization of a web site. 308 permanent redirect method and body not changed. reorganization of a web site, with non-get links/operations. [1] the specificati...
...edirect from common synonyms or frequent typos of your domains. moving to a new domain for example, your company was renamed, but you want existing links or bookmarks to still find you under the new name. forcing https requests to the http:// version of your site will redirect to the https:// version of your site. keeping links alive when you restructure web sites, urls change. even if you update your site's links to match the new urls, you have no control over the urls used by external resources. you don't want to break these links, as they bring valuable users and help your seo, so you set up redirects from the old urls to the new ones. this technique does work for internal links, but try to avoid having internal redirects. a redirect has a significant performance cost (as an extra h...
Array.prototype.indexOf() - JavaScript
1); // -1 array.indexof(2, -3); // 0 finding all the occurrences of an element var indices = []; var array = ['a', 'b', 'a', 'c', 'a', 'd']; var element = 'a'; var idx = array.indexof(element); while (idx != -1) { indices.push(idx); idx = array.indexof(element, idx + 1); } console.log(indices); // [0, 2, 4] finding if an element exists in the array or not and updating the array function updatevegetablescollection (veggies, veggie) { if (veggies.indexof(veggie) === -1) { veggies.push(veggie); console.log('new veggies collection is : ' + veggies); } else if (veggies.indexof(veggie) > -1) { console.log(veggie + ' already exists in the veggies collection.'); } } var veggies = ['potato', 'tomato', 'chillies', 'green-pepper']; updatevegetablescollection(...
... specifications specification ecmascript (ecma-262)the definition of 'array.prototype.indexof' in that specification. ...
Array - JavaScript
true: console.log(years['2'] != years['02']) relationship between length and numerical properties a javascript array's length property and numerical properties are connected. several of the built-in array methods (e.g., join(), slice(), indexof(), etc.) take into account the value of an array's length property when they're called. ...
...rray's length property when they're called. other methods (e.g., push(), splice(), etc.) also result in updates to an array's length property. const fruits = [] fruits.push('banana', 'apple', 'peach') console.log(fruits.length) // 3 when setting a property on a javascript array when the property is a valid array index and that index is outside the current bounds of the array, the engine will update the array's length property accordingly: fruits[5] = 'mango' console.log(fruits[5]) // 'mango' console.log(object.keys(fruits)) // ['0', '1', '2', '5'] console.log(fruits.length) // 6 increasing the length. fruits.length = 10 console.log(fruits) // ['banana', 'apple', 'peach', empty x 2, 'mango', empty x 4] console.log(object.keys(fruits)) // ['0', '1', '2', '5...
Date.prototype.setHours() - JavaScript
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...o specify the minutesvalue. msvalue optional. ideally, a number between 0 and 999, representing the milliseconds. if a value greater than 999 is provided, the datetime will be incremented by the extra milliseconds. if you specify the msvalue parameter, you must also specify the minutesvalue and secondsvalue. return value the number of milliseconds between january 1, 1970 00:00:00 utc and the updated date. description if you do not specify the minutesvalue, secondsvalue, and msvalue parameters, the values returned from the getminutes(), getseconds(), and getmilliseconds() methods are used. if a parameter you specify is outside of the expected range, sethours() attempts to update the date information in the date object accordingly. for example, if you use 100 for secondsvalue, the minutes ...
Date.prototype.setUTCHours() - JavaScript
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...an integer between 0 and 59, representing the seconds. if you specify the secondsvalue parameter, you must also specify the minutesvalue. msvalue optional. a number between 0 and 999, representing the milliseconds. if you specify the msvalue parameter, you must also specify the minutesvalue and secondsvalue. return value the number of milliseconds between january 1, 1970 00:00:00 utc and the updated date. description if you do not specify the minutesvalue, secondsvalue, and msvalue parameters, the values returned from the getutcminutes(), getutcseconds(), and getutcmilliseconds() methods are used. if a parameter you specify is outside of the expected range, setutchours() attempts to update the date information in the date object accordingly. for example, if you use 100 for secondsvalue, ...
Map.prototype.set() - JavaScript
the set() method adds or updates an element with a specified key and a value to a map object. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax mymap.set(key, value) parameters key the key of the element to add to the map object. value the value of the element to add to the map object. return value the map object. ...
...e clone https://github.com/mdn/interactive-examples and send us a pull request. syntax mymap.set(key, value) parameters key the key of the element to add to the map object. value the value of the element to add to the map object. return value the map object. examples using set() let mymap = new map() // add new elements to the map mymap.set('bar', 'foo') mymap.set(1, 'foobar') // update an element in the map mymap.set('bar', 'baz') using the set() with chaining since the set() method returns back the same map object, you can chain the method call like below: // add new elements to the map with chaining. mymap.set('bar', 'foo') .set(1, 'foobar') .set(2, 'baz'); specifications specification ecmascript (ecma-262)the definition of 'map.prototype.se...
WebAssembly.Global() constructor - JavaScript
specifications specification webassembly javascript interfacethe definition of 'webassembly.global() constructor' in that specific...
...ssembly.global({value:'i32', mutable:true}, 0); webassembly.instantiatestreaming(fetch('global.wasm'), { js: { global } }) .then(({instance}) => { asserteq("getting initial value from wasm", instance.exports.getglobal(), 0); global.value = 42; asserteq("getting js-updated value from wasm", instance.exports.getglobal(), 42); instance.exports.incglobal(); asserteq("getting wasm-updated value from js", global.value, 43); }); note: you can see the example running live on github; see also the source code. specifications specification webassembly javascript interfacethe definition of 'webassembly.global() constructor' in that specification. browser compatibility the compatibility table on this page is generated from structured data. if you'd lik...
WebAssembly.Global - JavaScript
specifications specification webassembly javascript interfacethe definition of 'webassembly.global()' in that specification. ...
...ssembly.global({value:'i32', mutable:true}, 0); webassembly.instantiatestreaming(fetch('global.wasm'), { js: { global } }) .then(({instance}) => { asserteq("getting initial value from wasm", instance.exports.getglobal(), 0); global.value = 42; asserteq("getting js-updated value from wasm", instance.exports.getglobal(), 42); instance.exports.incglobal(); asserteq("getting wasm-updated value from js", global.value, 43); }); note: you can see the example running live on github; see also the source code. specifications specification webassembly javascript interfacethe definition of 'webassembly.global()' in that specification. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contrib...
serviceworker - Web app manifests
this is the only required member of the serviceworker member. ...
... member. scope a string representing a url that defines a service worker's registration scope; that is, what range of urls a service worker can control. this is usually a relative url, relative to the base url of the application. by default, the scope value for a service worker registration is set to the directory where the service worker script is located. type ? update_via_cache whether the user agent cache should be bypassed when fetching the service worker. ...
MathML documentation index - MathML
Web › MathML › Index
cs using the mathml language. just like html, mathml is described with tags and attributes. html becomes verbose when your document contains advanced structures like lists or tables but fortunately there are many generators from simple notations, wysiwyg editors and other content management systems to help writing web pages. 3 examples beginner, example, guide, mathml, needsbeginnerupdate below you'll find some examples you can look at to help you to understand how to use mathml to display increasingly complex mathematical concepts in web content. 4 mathml: deriving the quadratic formula beginner, education, example, guide, html5, mathml, needsbeginnerupdate this page outlines the derivation of the quadratic formula. 5 proving the pythagorean ...
... use mathml to display increasingly complex mathematical concepts in web content. 4 mathml: deriving the quadratic formula beginner, education, example, guide, html5, mathml, needsbeginnerupdate this page outlines the derivation of the quadratic formula. 5 proving the pythagorean theorem beginner, example, guide, html5 math, math education, mathml, needsbeginnerupdate we will now prove the pythagorean theorem: 6 mathml attribute reference mathml, mathml reference this is an alphabetical list of mathml attributes. more details for each attribute are available on particular element pages. 7 values guide, mathml, mathml reference several mathml presentation elements have attributes that accept length values used for...
Critical rendering path - Web Performance
resized. layout performance is impacted by the dom -- the greater the number of nodes, the longer layout takes. layout can become a bottleneck, leading to jank if required during scrolling or other animations. while a 20ms delay on load or orientation change may be fine, it will lead to jank on animation or scroll. any time the render tree is modified, such as by added nodes, altered content, or updated box model styles on a node, layout occurs. to reduce the frequency and duration of layout events, batch updates and avoid animating box model properties. paint the last step is painting the pixels to the screen. once the render tree is created and layout occurs, the pixels can be painted to the screen. onload, the entire screen is painted. after that, only impacted areas of the screen will be...
...tes and avoid animating box model properties. paint the last step is painting the pixels to the screen. once the render tree is created and layout occurs, the pixels can be painted to the screen. onload, the entire screen is painted. after that, only impacted areas of the screen will be repainted, as browsers are optimized to repaint the minimum area required. paint time depends on what kind of updates are being applied to the render tree. while painting is a very fast process, and therefore likely not the most impactful place to focus on in improving performance, it is important to remember to allow for both layout and re-paint times when measuring how long an animation frame may take. the styles applied to each node increase the paint time, but removing style that increases the paint by 0.00...
Optimizing startup performance - Web Performance
ion because usually the operating system handles that for you, or the app is the only thing that matters which is currently running, depending on the operating environment. the source application might have a main loop that can easily be made to operate asynchronously (by running each main loop iteration separately); startup is often just a continuous, monolithic procedure that might periodically update a progress meter. while you can use web workers to run even very large, long-duration chunks of javascript code asynchronously, there's a huge caveat that: workers don't have access to webgl or audio, and they can't send synchronous messages to the main thread, so you can't even proxy those apis to the main thread. this all means that unless you can easily pull out the "pure calculation" chunks ...
...p. data size do your best to optimize the size of your game data; smaller level files will download and be processed faster than larger ones. subjective factors anything you can do to help keep the user engaged during the startup process will help make the time seem to go by faster. for games, consider having background music playing or a nice splash screen displayed. in between calculations, update your progress indicator, make changes to the display, or anything else you might be able to do to help the user feel like your app is doing something instead of sitting there quietly. ...
Progressive web app structure - Progressive web apps (PWAs)
ng (ssr) means a website is rendered on the server, so it offers quicker first load, but navigating between pages requires downloading new html content. it works great across browsers, but it suffers in terms of time navigating between pages and therefore general perceived performance — loading a page requires a new round trip to the server. ...
...the first page load is quick because of the ssr, and the navigation between pages is smooth because the client can re-render the page with only the parts that have changed. pwas can be built using any approach you like, but some will work better than the others. ...
Structural overview of progressive web apps - Progressive web apps (PWAs)
ng (ssr) means a website is rendered on the server, so it offers quicker first load, but navigating between pages requires downloading new html content. it works great across browsers, but it suffers in terms of time navigating between pages and therefore general perceived performance — loading a page requires a new round trip to the server. client-side rendering (csr) allows the website to be updated in the browser almost instantly when navigating to different pages, but requires more of an initial download hit and extra rendering on the client at the beginning. the website is slower on an initial visit, but can be faster to navigate. the best results tend to come when you use both client-side and server-side rendering; you can render a web site on the server, cache its contents, and then ...
...d in the browser almost instantly when navigating to different pages, but requires more of an initial download hit and extra rendering on the client at the beginning. the website is slower on an initial visit, but can be faster to navigate. the best results tend to come when you use both client-side and server-side rendering; you can render a web site on the server, cache its contents, and then update the rendering on the client side as needed. the first page load is quick because of the ssr, and the navigation between pages is smooth because the client can re-render the page with only the parts that have changed. pwas can be built using any approach you like, but some will work better than the others. the most popular approach is the app shell concept, which mixes ssr and csr in exactly the ...
Program ID - Archive of obsolete content
the program id is a unique identifier for your add-on. when you package your add-on for distribution using jpm xpi, it will become the id field in the add-on's install manifest. the id is used for a variety of purposes. for example: addons.mozilla.org uses it to distinguish between new add-ons and updates to existing add-ons, and the simple-storage module uses it to figure out which stored data belongs to which add-on. when you create an xpi with jpm xpi: if the package.json does not include an id field, then the id written into the install.rdf is the value of the name field prepended with "@". if the package.json does include an id field, and it contains "@", then this is written into the install.rdf as the add-on id. if the package.json does include an id field, and it does not contain...
request - Archive of obsolete content
for more advanced usage, check out the net/xhr module, based on the browser's xmlhttprequest object. globals constructors request(options) this constructor creates a request object that can be used to make network requests. the constructor takes a single parameter options which is used to set several properties on the resulting request. parameters options : object optional options: name type url string,url this is the url to which the request will be made. ...
ui/sidebar - Archive of obsolete content
/sidebar.html" }); you can include javascript and css from the html as you would with any web page, for example using <script> and <link> tags containing a path relative to the html file itself. <!doctype html> <html> <head> <link href="stuff.css" type="text/css" rel="stylesheet"> </head> <body> <script type="text/javascript" src="stuff.js"></script> </body> </html> you can update the sidebar's content by setting the sidebar's url property. this will change the sidebar's content across all windows. communicating with sidebar scripts you can't directly access your sidebar's content from your main add-on code, but you can send messages between your main add-on code and scripts loaded into your sidebar. on the sidebar end of the conversation, sidebar scripts get a global v...
Release notes - Archive of obsolete content
efox 31 and firefox 32. this will not include any uplifts made after this release entered aurora. bugs fixed between firefox 31 and firefox 32. this will not include any uplifts made after this release entered aurora. firefox 31 highlights add-on debugger added the ability to convert between high-level browserwindow objects and dom windows, and between high-level tab objects and xul tabs. updated the default theme used for panels on mac os x. added contentstyle and contentstylefile options to panel. details github commits made between firefox 30 and firefox 31. this will not include any uplifts made after this release entered aurora. bugs fixed between firefox 30 and firefox 31. this will not include any uplifts made after this release entered aurora. firefox 30 highlights adde...
Creating annotations - Archive of obsolete content
etelementbyid('annotation-box'); textarea.onkeyup = function(event) { if (event.keycode == 13) { self.postmessage(textarea.value); textarea.value = ''; } }; self.on('message', function() { var textarea = document.getelementbyid('annotation-box'); textarea.value = ''; textarea.focus(); }); save this inside data/editor as annotation-editor.js. updating main.js again now we'll update main.js again to create the editor and use it. first, import the panel module: var panels = require('sdk/panel'); then add the following code to the main() function: 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) { ...
Using third-party modules (jpm) - Archive of obsolete content
st git command installed. the add-on sdk is extensible by design: you can use the modules that ship inside firefox, but you can also create your own modules and make them available for anyone else to use. before the jpm tool was available, there wasn't any package manager for these community-developed modules, so it wasn't obvious where to find community-developed modules, or how to install and update them. with jpm, we use npm as the package manager for sdk modules that don't ship inside firefox. module developers can publish sdk modules to npm, and add-on developers can install them from npm and build them into their add-ons. this article explains how to use npm-hosted third-party sdk modules with jpm. we'll use the menuitem package to add a new menu item to firefox. summary first, while...
Localization - Archive of obsolete content
ties file, and return "hello!". however, this approach makes it difficult to maintain an add-on which has many localizations, because you're using the default language strings both as user interface strings and as keys to look up your translations. this means that if you want to change the wording of a string in the default language, or fix a typo, then you break all your locale files. locale updater the locale updater add-on makes it easier to update locale files. once you've installed it, open the add-on manager, and you'll see a new button labeled "update l10n" next to each add-on you've installed: click the button and you'll be prompted for a new .properties file for that add-on. if you provide a new file, the add-on's locale data will be updated with the new file. limitations the ...
Bootstrapped extensions - Archive of obsolete content
ontain several specific functions, which are called by the browser to manage the extension. the script gets executed in a privileged sandbox, which is cached until the extension is shut down. startup called when the extension needs to start itself up. this happens at application launch time, when the extension is enabled after being disabled or after it has been shut down in order to install an update. as such, this can be called many times during the lifetime of the application. this is when your add-on should inject its ui, start up any tasks it may need running and so forth. void startup( data, reason ); parameters data a bootstrap data structure. reason one of the reason constants, indicating why the extension is being started up. this will be one of app_startup, addon_disabl...
Finding window handles - Archive of obsolete content
e_window); } yet another way to find a window handle (parent window handle) this method is for people who want to get the top level window hwnd from the window object in javascript. comparing to the method above, by using this method, you don't have to compile your component with nsiwidget.h and other bunchs of h files that should not be exposed to outside, and could change every time firefox updates, all you need is nsibasewindow.idl(it's not in gecko_sdk, get this from the latest firefox source, or http://mxr.mozilla.org/mozilla/sourc...basewindow.idl), and use xpidl to compile it to .h file, although that's stll a unfrozen interface, but it should be a lot better. notice that by using only the c++ part of this code will get the the parent window handle of the nsibasewindow you give as a p...
JavaScript timers - Archive of obsolete content
t of the window for the next animation frame. documentation settimeout() calls a function or executes a code snippet after specified delay. setinterval() calls a function or executes a code snippet repeatedly, with a fixed time delay between each call to that function. setimmediate() calls a function immediately after the browser has completed other operations, such as events and display updates. cleartimeout() clears the delay set by settimeout(). clearinterval() cancels repeated action which was set up using setinterval(). clearimmediate() cancels the immediate actions, just like cleartimeout() for settimeout(). using javascript timers within animations (javascript daemons management) in computer science a daemon is a task that runs as a background process, rather than being u...
Toolbar - Archive of obsolete content
by default. the user has to drag it onto the toolbar. the following code will place your button on the toolbar by default. this should only be done on the first run of your add-on after installation so that if the user decides to remove your button, it doesn't show up again every time they start the application. notes insert your button by default only once, at first run, or when an extension update adds a new button. please only add your button by default if it adds real value to the user and will be a frequent entry point to your extension. you must not insert your toolbar button between any of the following elements: the combined back/forward button, the location bar, the stop botton, or the reload button. these elements have special behaviors when placed next to eachother, and will bre...
Extension Etiquette - Archive of obsolete content
site and they ask for focus, they should get it. overriding their request isn't very nice. about dialogs there is a default popup about dialog that is created from install.rdf data; creating a new xul about box is usually unnecessary. you can decrease download size by omitting a customized about box. make one only if you have a special feature that needs to be included — for example, a custom updater. theming if you have xul buttons in your extension that do functions similar to ones that already exist in a browser — for example, a feed reader that reloads and stops — use icons from the browser's theme. the icons makes the extension lighter, while providing more consistency, especially for users using different themes. extension icons unique icons are usually worth their download wei...
Inline options - Archive of obsolete content
eference, but attached to a command --> <setting title="do something" type="control"> <button id="myaddon-button" label="click me" oncommand="alert('thank you!');"/> </setting> setting element changed notifications most of the setting elements (it might be all i havent really looked), support oninputchanged attribute. so like for the type="file", once a user browses and picks a file, when it updates the label it will trigger the oninputchanged attribute. so if you would like to do some changes to the xul on the inline options page you can do so. the this value is the setting xul element. see mxr for what all this holds: http://mxr.mozilla.org/mozilla-release/source/toolkit/mozapps/extensions/content/setting.xml for example you can fire this.inputchanged() etc etc. <setting pref="extens...
Migrating raw components to add-ons - Archive of obsolete content
sions of firefox with which they are compatible, leading to poor integration and instability as users upgrade their firefox installations. the firefox extension mechanism allows you to do everything that you could do through direct component drops, but also gives you and your users extra flexibility and more sophisticated versioning support. as we roll this new behavior out, this document will be updated with additional information addressing scenarios we see developers encountering. simple migration if your goal is just to get your raw component working properly as an extension, you can do this in three steps: create a new add-on using the instructions here. as you'll see, add-ons give you much more flexibility than simply loading a component, but in order to get started, all you'll need is yo...
Appendix: What you should know about open-source software licenses - Archive of obsolete content
gpl. do you enthusiastically support the free software movement? → choose the gpl. do you want your code to be embedded in a certain oss project? → choose the same license as that project. none of the above: choose the modified bsd license. the title hints at matsumoto’s diagnostic approach, since it mentions “free software.” this is slightly different from open source. (matsumoto updated his free software license diagnostic for a special open-source section in the january 2007 edition of softbank’s open source magazine.) if a company is considering releasing its own software as open source, it should consider dual-licensing or the cpl. applying a license to original works if you want to release your own code as open-source, here’s what you do next. insert the license de...
Adding menus and submenus - Archive of obsolete content
un into bugs when adding, removing, enabling and disabling menu items dynamically, specially the root menu items (file, edit, view, etc). you should carefully test this behavior to make sure it works properly in your extension. images in menu items may not appear, showing only a narrow segment of the image instead. this seems to happen when remote images are used. menu items are not dynamically updated while they are open. for example, you could have a menuitem that tells you the current time and is updated every second. on other systems you would be able to see the item update itself without having to close the menu and then reopen. this is not the case on mac os. « previousnext » this tutorial was kindly donated to mozilla by appcoast. ...
Appendix F: Monitoring DOM changes - Archive of obsolete content
support older browsers will need to provide fallbacks. for more information, see this blog post on the issues at hand. non-mutation triggers it is usually possible to tell when a mutation has occurred or is about to occur without resorting to mutation events or observers. most of these methods are specific to a particular site or codebase. hashchange and popstate events most ajax-heavy sites update the url when they significantly change their content, either via a change to the fragment identifier (hash) or more recently via the history.pushstate method. the former triggers a hashchange event while the latter triggers a popstate event. event listeners for those events are the preferred method for detecting dom modifications when feasible. often times, this must be used in combination with ...
Connecting to Remote Content - Archive of obsolete content
er data. they help you to track http/https requests and responses occurring in firefox. after installation, you can find a tamper data menu item in the menu bar: tools > tamper data or view > sidebar > tamper data once you open the tamper data view, all requests and responses will begin to appear in it. you can discover some interesting things about firefox like this, such as the automatic update urls for extensions, and the behavior of web applications such as gmail. if you click on the "start tamper" button, for every request made you will get a popup dialog for tampering with it before it is sent. you can use it to view or even modify the data in a request, and then inspect the result. this can be a lot of work because there is a lot of web activity in a normal firefox window, so use ...
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
t in the given document. ...
Handling Preferences - Archive of obsolete content
number of sources. each source is a js file that contains some special functions not available in regular code. 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. this is where the user's settings are stored. this file is updated when preferences are modified by the user. user preferences: the file user.js in the user's profile directory holds additional preferences the user has set. this file is never written to by firefox, but you may wish to set preferences manually in this file to override other settings. lockfile settings: these preferences are stored in a file that usually has the name mozilla.cfg or netscape.cfg...
Introduction - Archive of obsolete content
ssful open source projects in history, combining the openness, standards-compliance and sophistication of open source with the focus on user experience and powerful outreach more commonly seen in less open companies. version 1.0 of firefox was released in november 2004, version 2.0 in october 2006, and version 3.0 in june 2008. this tutorial was written after firefox 3 was released, and has been updated with time. while most of it should still work for creating extensions in firefox 3 (and even firefox 2), it is strongly recommended that you aim to support modern firefox versions, to encourage users to stay up to date with security fixes. a release that is more than 6 months old is likely vulnerable to published security bugs. firefox and other mozilla applications can be seen as composed of t...
Local Storage - Archive of obsolete content
or the simplest tasks, and it currently sees little maintenance, so we don't recommend using it unless you really have to. you'll still need to understand at least a little about rdf when you read the documentation about templates. templates templates are a very powerful tool in firefox. they allow you to automatically generate xul content using information from a datasource, and automatically update the content once the datasource changes. they were designed with rdf datasources in mind, but since firefox 3 they have been extended to support sqlite datasources as well. handling templates can also be complicated, but it is worth the effort if you need to display long lists or trees with complex data. if you manage to get your display code to use templates, you will have saved a lot of coding...
Mozilla Documentation Roadmap - Archive of obsolete content
s, including regular expression search and file path search. you'll be able to navigate the full source tree, inspect the change history for all files, and link to specific code lines. it takes a little getting used to, specially learning how to choose the best search queries, but it's an invaluable resource of information. mozilla blogs several mozilla community members maintain blogs that are updated frequently, often including information on api changes, bug fixes, useful tools and future release plans. many of the tips and tricks included in this tutorial were discovered by reading these blogs. there are several useful feeds that you can follow using a feed reader, such as thunderbird. here are some important feeds you should consider following: planet mozilla. this is the ultimate sou...
Useful Mozilla Community Sites - Archive of obsolete content
nominate it an editor will review it and see if it is appropriate for the public amo site, where everyone can see it and install it. the review process often takes a few weeks. just be patient and make sure your extension follows amo's policies when you nominate it. you can still get a good number of downloads while being in the sandbox. one of the main advantages of using amo is that it handles updates automatically for published add-ons. you just need to upload a new version of your extension, and once it's approved it will be pushed as an update to all your users. if you decide to host your own extension, you'll have to learn about the update system in order to push your own updates. babelzilla babelzilla is a worldwide community of localizers. developers submit their extensions using the ...
Performance best practices in extensions - Archive of obsolete content
mory for any excessive memory usage. for example, bug 719601 featured a "system principal" javascript compartment containing 100s of mbs of memory, which is much larger than usual. avoid writing slow css read the "writing efficient css" guide. remember that any selector in your rule which might match many different nodes is a source of inefficiency during either selector matching or dynamic update processing. this is especially bad for the latter if the selector can dynamically start or stop matching. avoid unqualified ":hover" like the plague. avoid dom mutation event listeners dom mutation event listeners are extremely expensive and, once added to a document even briefly, significantly harm its performance. as mutation events are officially deprecated, and there are many alternatives,...
Session store API - Archive of obsolete content
used to display a message to the console. this event is sent just before a tab is restored. an event of type sstabrestored fires each time a tab has finished restoring. it's worth noting that this event is sent even if tab loading at startup is deferred until the user selects the tab. firefox 3 note in firefox 3 and later, if you need to detect when a tab is about to be closed so that you can update data associated with the tab before it is closed, you can watch for the "sstabclosing" event, which is sent to the tab. restoring without restarting firefox 3.6 note this section applies to firefox 3.6 and later. firefox 3.6 knows how to save session store data when the last browser window closes, even if there are still other windows open. similarly, it can now restore the user's session ...
Setting up an extension development environment - Archive of obsolete content
ugger can be used to debug the javascript code of extensions. the devtools.chrome.enabled preference must also be set to true for the browser debugger to be enabled. devtools.debugger.prompt-connection = false. this prevents the browser debugger from prompting for connection permission every time. extensions.logging.enabled = true. this will send more detailed information about installation and update problems to the error console. (note that the extension manager automatically restarts the application at startup sometimes, which may mean you won't have time to see the messages logged before the automatic restart happens. to see them, prevent the automatic restart by setting the environment no_em_restart to 1 before starting the application.) nglayout.debug.disable_xul_fastload = true. for ge...
Using Dependent Libraries In Extension Components - Archive of obsolete content
(path); if (ns_failed(rv)) return rv; //at this point, we would have used prlibrary *lib; library->load(&lib); //but we can't use that in os x. instead, we use nsaddimage. nsaddimage(path.get(), nsaddimage_option_return_on_error | nsaddimage_option_with_searching | nsaddimage_option_match_filename_by_installname); // 1) we don't care if this failed! if you update your dependencies in your component, // but forget to remove a dependant library in the stubloader, then we don't want to // fail loading the component since the dependant library isn't required. // // 2) we are going to leak this library. we don't care about that either. // nsaddimage adds the image to the process. when the process terminates, the library // will be pro...
Add-ons - Archive of obsolete content
l manifests an install manifest is the file an add-on manager-enabled xul application (e.g. firefox or thunderbird) uses to determine information about an add-on as it is being installed. it contains metadata identifying the add-on, providing information about who created it, where more information can be found about it, which versions of what applications it is compatible with, how it should be updated, and so on. interaction between privileged and non-privileged pages an easy way to send data from a web page to an extension is by using custom dom events. in your extension's browser.xul overlay, write code which listens for a custom dom event. here we call the event myextensionevent. legacy add-ons this section contains links to documentation for legacy technology for add-on development, i...
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
om a database will probably require less labor to convert than sorting through hundreds of flat html files that have mixed structures. whatever the situation, if the conversion is something deemed worthwhile, it's an excellent opportunity to restructure your data the right way, so it can ultimately be as flexible as you need it to be. original document information author(s): eric a. meyer last updated date: october 11th, 2002 copyright information: 2001-2003 netscape ...
Underscores in class and ID Names - Archive of obsolete content
all rights reserved. note: this reprinted article was originally part of the devedge site. ...
Case Sensitivity in class and id Names - Archive of obsolete content
note: this reprinted article was originally part of the devedge site. ...
Creating a status bar extension - Archive of obsolete content
me description em:name the extension's name. this name is displayed in the extensions window. em:description a short, one-line description of the extension. this text is also displayed in the extensions window. em:creator the author's name. homepageurl the url of a web site the user can visit to get information about the extension, or to look for updates. this is not a required field, but including it is a nice thing to do. target application information it's also necessary to include information that identifies the application or applications in which your extension is designed to run. although this sample extension only works in firefox, it's entirely possible to create extensions that work in multiple xul-based applications. it's also n...
cached - Archive of obsolete content
property type description target eventtarget (dom element) the event target (the topmost target in the dom tree). read only. type string the type of event. read only. canbubble boolean does the event normally bubble? read only. cancelable boolean is it possible to cancel the event? read only. related events checking noupdate downloading progress cached updateready obsolete error ...
checking - Archive of obsolete content
the checking event is fired when the user agent is checking for an update, or attempting to download the cache manifest for the first time. general info specification offline interface event bubbles no cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree). read only. type string the type of event. read only. canbubble boolean does the event normally bubble? read only. cancelable boolean is it possible to cancel the event? read only. related events checking noupdate downloading progress cached updateready obsolete error ...
error - Archive of obsolete content
property type description target eventtarget (dom element) the event target (the topmost target in the dom tree). read only. type string the type of event. read only. canbubble boolean does the event normally bubble? read only. cancelable boolean is it possible to cancel the event? read only. related events checking noupdate downloading progress cached updateready obsolete error ...
obsolete - Archive of obsolete content
property type description target eventtarget (dom element) the event target (the topmost target in the dom tree). read only. type string the type of event. read only. canbubble boolean does the event normally bubble? read only. cancelable boolean is it possible to cancel the event? read only. related events checking noupdate downloading progress cached updateready obsolete error ...
progress - Archive of obsolete content
d long (long) the number of bytes transferred since the beginning of the operation. this doesn't include headers and other overhead, but only the content itself. read only. total unsigned long (long) the total number of bytes of content that will be transferred during the operation. if the total size is unknown, this value is zero. read only. related events checking noupdate downloading progress cached updateready obsolete error ...
Events - Archive of obsolete content
archived event pages domsubtreemodifiedmozaudioavailablemozbeforeresizemozorientationcachedchargingchangechargingtimechangecheckingdischargingtimechangedownloadingerrorlevelchangenoupdateobsoleteprogressupdateready ...
Defining Cross-Browser Tooltips - Archive of obsolete content
ers. authors able to run content-rewriting proxy servers can use them to dynamically alter outgoing content to ensure both the title and alt attributes are present. related links html 4.01 specification: 13.8 how to specify alternate text html 4.01 specification: 7.4.3 the title attribute bug 25537 original document information author(s): eric a. meyer, netscape communications last updated date: published 16 aug 2002 copyright information: copyright © 2001-2003 netscape. all rights reserved. note: this reprinted article was originally part of the devedge site. ...
Images, Tables, and Mysterious Gaps - Archive of obsolete content
it is quite possible to sidestep this strange effect of standards support. the best solution may be to ensure that images are always in a cell by themselves, thus allowing authors to make them block-level, but as always this will depend on the author's design. related links gecko's almost standards mode mozilla's quirks mode original document information author(s): eric a. meyer last updated date: march 21st, 2003 copyright © 2001-2003 netscape. ...
Installing plugins to Gecko embedding browsers on Windows - Archive of obsolete content
software\mozilla\compuserve 7.0 you'll find: "plugins folders"="c:\\program files\\common files\\csshare\\plugins0942" "product"="compuserve" "version"="7.0" "displayname"="compuserve 7.0" the product, version, and displayname string values are currently only written by compuserve 7.0, and they are written alongside the geckover string value. original document information last updated date: june 18, 2002 copyright information: portions of this content are © 1998–2006 by individual mozilla.org contributors; content available under a creative commons license ...
Monitoring WiFi access points - Archive of obsolete content
ody> </html> the nsiwifilistener object the first thing the code above does is to prototype the listener object that will be receiving notifications of changes to the access point list. this object is described in lines 11 through 40 in the code above. the onchange() method (lines 13 through 27) begins by enabling universalxpconnect privileges, then clearing out the div (d) that will receive the updated list of access points. then the loop in lines 19-22 iterates over the list of access points received in the accesspoints array and adds them to the html in the div. then the c div is updated with the number of times the list has been refreshed. the onerror() method simply opens an alert that displays the error code received. starting to monitor access points to start monitoring the access points...
No Proxy For configuration - Archive of obsolete content
et note that you don't need to (read shouldn't) put a * for all hosts with that domain ending. corollary- a no_proxies_on entry of netscape.com will be applicable to all hosts ending at netscape.com including foonetscape.com but an entry of .netscape.com will specifically be applicable to all hosts in the domain of netscape.com. original document information author(s): benjamin chuang last updated date: november 2, 2005 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Notes on HTML Reflow - Archive of obsolete content
y two adapter classes: nsboxframe and nsboxtoblockadaptor. nsboxframe nsboxframe is an html frame that "wraps" a xul box. its purpose is to convert html reflows their box analog. nsboxtoblockadaptor nsboxtoblockadaptor is a xul box that wraps an html block frame, used to convert changes in the box layout into html reflows. original document information author(s): chris waterson last updated date: december 4, 2004 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
How Thunderbird and Firefox find their configuration files - Archive of obsolete content
unlike mozilla's binary registry.dat file, thunderbird's and firefox' profiles.ini file is a readable text file. here is an example of what this may look like: [general] startwithlastprofile=1 [profile0] name=default isrelative=1 path=profiles/default.uda if you want to point this to a location of your choice (for example h:\thunderbird), you need to perform to changes: set isrelative to be 0 update the path to point to the desired place. note: for absolute paths thunderbird uses dos'ish backslashes (\) rather than unixish slashes (/). you'd obtain a file such as the following: [general] startwithlastprofile=1 [profile0] name=default isrelative=0 path=h:\thunderbird a discussion about this file can be found here ...
Bonsai - Archive of obsolete content
t should be enough to get you started. play around with the various options on the main bonsai query page. if you're updating our cvs tree you'll need to learn about hacking with bonsai. bonsai source code the source code to the bonsai tool itself is also available, check out the information available at the bonsai project page. original document information author(s): jamie zawinski last updated date: september 8, 2004 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Bookmark Keywords - Archive of obsolete content
us, like fedex tracking fedex ups tracking ups of course, these are just a beginning. any web site that you commonly search is a candidate for its own keymark. acknowledgements thanks to asa dotzler and his article how cool are custom keywords?, which provided the inspiration to write this article. original document information author(s): eric a. meyer, netscape communications last updated date: published 15 mar 2002 copyright information: copyright © 2001-2003 netscape. all rights reserved. note: this reprinted article was originally part of the devedge site. ...
Building TransforMiiX standalone - Archive of obsolete content
e from testing unneeded libs. make -f client.mk build as usual. of course, make -f client.mk checks out and builds just transformiix alright. ...
Adding the structure - Archive of obsolete content
d of status information. graphical panels (like the one we are creating here that displays an icon) are given the statusbarpanel-iconic class so they can be styled accordingly by the css stylesheet that defines these elements' appearance. the status attribute is not part of the xul definition for the statusbarpanel element, but is used by our extension to store the current tinderbox state. we'll update the value of that attribute each time we retrieve tinderbox's status from the server, and we'll define css rules that change the appearance of the icon depending on the value of that attribute. all xul elements can be given custom attributes in addition to the ones the xul rendering engine recognizes which get ignored by the engine, so adding this custom attribute does not create any problems or ...
Enabling the behavior - updating the status bar panel - Archive of obsolete content
in order for loadtinderboxstatus() to have any effect we need to define a matching updatetinderboxstatus() function. function updatetinderboxstatus() { var icon = document.getelementbyid('tinderbox-status'); if (gxmlhttprequest.responsetext.match("ee0000")) icon.setattribute("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. the color red...
Making it into a dynamic overlay and packaging it up for distribution - Archive of obsolete content
now that we have a static overlay we're in good shape to create a xpi package that installs our extension as a dynamic overlay. xpis have a complex structure designed to separate ui layers from each other. to make our xpi we'll start out by creating a directory to hold the files we're going to add to the xpi. then we'll modify urls in our files so they point to the right place. ...
Creating a Mozilla Extension - Archive of obsolete content
...
install.rdf - Archive of obsolete content
rsion> </description> </em:targetapplication> <!-- front end metadata --> <em:name>my_theme</em:name> <em:description>my first theme</em:description> <!-- front end integration hooks (used by theme manager)--> <em:creator>john johnson</em:creator> <em:contributor>john johnson</em:contributor> <em:homepageurl>https://mycoolskin.com/</em:homepageurl> <em:updateurl>https://mycoolskin.com/</em:updateurl> <em:abouturl>https://mycoolskin.com/</em:abouturl> <em:internalname>my_theme</em:internalname> </description> </rdf> ...
Creating a Skin for Mozilla - Archive of obsolete content
original location: http://www.eightlines.com/neil/mozskin ...
Installing Dehydra - Archive of obsolete content
ides scripting capabilities for dehydra. gcc 4.5, with the package gcc-4.5-plugin-dev installed. (alternately, build from source) a modern linux distribution. dehydra is not supported on mac os x. building spidermonkey it is recommended that you use spidermonkey revision aurora_base_20110705 when building dehydra. cd $home hg clone http://hg.mozilla.org/mozilla-central/ cd mozilla-central hg update aurora_base_20110705 cd js/src autoconf-2.13 mkdir $home/obj-js cd $home/obj-js $home/mozilla-central/js/src/configure --enable-optimize --disable-debug make it has to be checked whether later/newer branches (like aurora_base_20120131) are working, too. please also note that autoconf v2.13 is really needed: it does not work with e.g. v2.68. there is no need for some installation after make. you ...
External CVS snapshots in mozilla-central - Archive of obsolete content
software modules that it depends on. the following list of directories (incomplete) contain them. those directories shall be considered read-only, changes shall be delivered to the upstream software projects. eventually we'd like to have acls, but as of today there is no protection for accidental commits to those directories. such changes will get overwritten without warning on importing the next updated version. nspr nsprpub nss dbm security/dbm security/coreconf security/nss special procedures must be used to update these to newer snapshots of the upstream software projects. the procedure for nspr and nss is documented here. ...
JSS build instructions for OSX 10.6 - Archive of obsolete content
cvs login cvs co -r nspr_4_8_7_rtm nspr cvs co -r nss_3_12_9_with_ckbi_1_82_rtm nss cvs co -r jss_4_3_2_rtm jss build nss for 32 and 64: cd mozilla/security/ns...
Repackaging Firefox - Archive of obsolete content
ension. we call this extension a "distro extension" (sometimes abbreviated as "dex"), because it is used to create a new "distribution" of firefox, with different branding, etc. using an extension makes it far easier to keep track of your changes easily when the time comes to upgrade to new versions of firefox, and also ensures, when set-up correctly, that users are able to safely receive firefox updates from mozilla. more about this below. while the aim of this article is not to fully document how to make an extension (for that, try this section of the mozilla developer center), here is a basic tutorial to get you started, and some tips specific for creating a dex. if you already have an extension that you want to bundle with firefox, and don't want to bundle an extra extension solely to set ...
Style System Overview - Archive of obsolete content
ld the entire world. we could at least do what we do for sheet addition/removal, or slightly better, by searching the rule tree (only one rule this time) instead of rebuilding it. lots of room for optimization here. (but beware didsetstylecontext) the style system style sheets & rules ↓ rule tree ↓ style context interface original document information author(s): david baron last updated date: june 6, 2003 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Gecko Coding Help Wanted - Archive of obsolete content
aluable and will help you learn the way around the codebase. we've done a lot, but there's a lot more to do. roc is willing to work closely with anyone with reasonable c++ experience to get them started on this. just send him mail. not up for coding yet? join the gecko bugathon and help save gecko engineers from imminent doom! original document information author(s): fantasai last updated date: may 4, 2004 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Hidden prefs - Archive of obsolete content
this page has been flagged by editors or users as needing technical review. until it is fully reviewed, it may contain inaccurate or incorrect information. address book "get map" button pref ("mail.addr_book.mapit_url.format" ) the format for this pref is: @a1 == address, part 1 @a2 == address, part 2 @ci == city @st == state @zi == zip code @co == country if the pref is set to "", no "get map" button will appear in the addressbook card preview pane. ...
Introducing the Audio API extension - Archive of obsolete content
.3)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. deprecated since gecko 22 (firefox 22 / thunderbird 22 / seamonkey 2.19)this feature has been removed from the web standards. though some browsers may still support it, it is in the process of being dropped. avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. be aware that this feature may cease to work at any time. please note that this document describes a non-standard experimental api. this api has been deprecated since gecko 22, disabled since gecko 28, and removed from gecko 31. you should use the web audio api instead. reading aud...
CRMF Request object - Archive of obsolete content
on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. deprecatedthis feature has been removed from the web standards. though some browsers may still support it, it is in the process of being dropped. avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. be aware that this feature may cease to work at any time. warning: the features mentioned in this article are deleted proprietary mozilla extensions, and are not supported in any other browser. they won't work in firefox 34 or later. use <keygen> or the future web crypto api inst...
generateCRMFRequest() - Archive of obsolete content
on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. deprecatedthis feature has been removed from the web standards. though some browsers may still support it, it is in the process of being dropped. avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. be aware that this feature may cease to work at any time. warning: the features mentioned in this article are deleted proprietary mozilla extensions, and are not supported in any other browser. they won't work in firefox 34 or later. use <keygen> or the future web crypto api inst...
importUserCertificates - Archive of obsolete content
on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. deprecatedthis feature has been removed from the web standards. though some browsers may still support it, it is in the process of being dropped. avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. be aware that this feature may cease to work at any time. warning: the features mentioned in this article are deleted proprietary mozilla extensions, and are not supported in any other browser. they won't work in firefox 34 or later. use <keygen> or the future web crypto api inst...
popChallengeResponse - Archive of obsolete content
on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. deprecatedthis feature has been removed from the web standards. though some browsers may still support it, it is in the process of being dropped. avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. be aware that this feature may cease to work at any time. warning: the features mentioned in this article are deleted proprietary mozilla extensions, and are not supported in any other browser. they won't work in firefox 34 or later. use <keygen> or the future web crypto api inst...
JavaScript crypto - Archive of obsolete content
on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. deprecatedthis feature has been removed from the web standards. though some browsers may still support it, it is in the process of being dropped. avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. be aware that this feature may cease to work at any time. warning: the features mentioned in this article are deleted proprietary mozilla extensions, and are not supported in any other browser. they won't work in firefox 34 or later. use <keygen> or the future web crypto api inst...
Java in Firefox Extensions - Archive of obsolete content
n from xul is to maintain a singleton (some singular java object) across all firefox windows. if you call java from xul, then each firefox window will have its own class loader and hence its own "singleton". the following approach is taken from the extension xquseme (note you must use the latest version, currently still in the sandbox, as prior versions only worked with liveconnect before java 6 update 11) which borrows some of the code of the java firefox extension in order to grant full privileges to java within a firefox extension, but it is easier to understand and doesn't require creation of a xpcom component. [note: a simpler hello world version than that below is now available at http://brett-zamir.me/java_demo/ ] for privileges, the basic procedure is: download and include http://simi...
slideBar - Archive of obsolete content
they allow quick access to a wide range of both temporary and permanent information at the side of your browser window. when a slidebar feature is selected, its contents will be revealed from behind the current web page. ...
Mac OS X Build Prerequisites/fink - Archive of obsolete content
sw by default. the installer should configure the fink environment for you, making it available in any new terminal window. if you perform a major operating system upgrade on your computer, such as an upgrade from tiger to leopard, you should remove the /sw directory and re-install fink and the packages below. libidl, glib using fink. libidl is included in the orbit installation. $ sudo apt-get update $ sudo apt-get install orbit orbit-dev glib autoconf-2.13 using fink. autoconf is installed at /sw/bin/autoconf. do not install the autoconf2.5 or autoconf2.54 packages. $ sudo apt-get install autoconf ...
Makefile.mozextension.2 - Archive of obsolete content
n)</version> <description>$(project_desc)</description> <creator>$(project_author)</creator> <contributor>here is a place for you who helped me</contributor> <homepageurl>http://$(project).mozdev.org/</homepageurl> <optionsurl>chrome://$(project)/content/settings.xul</optionsurl> <abouturl>chrome://$(project)/content/about.xul</abouturl> <iconurl>chrome://$(project)/skin/mainicon.png</iconurl> <updateurl>http://$(project).mozdev.org/update.rdf</updateurl> <type>2</type> <targetapplication> <description> <id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</id> <minversion>2.0</minversion> <maxversion>9.0</maxversion> </description> </targetapplication> </description> </rdf> endef export install_rdf install.rdf: @echo generating $(project)/install.rdf @echo "$$install_rdf" > $(proje...
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
ent apis for the same functionality, you can often find multiple if() else() blocks throughout the code to differentiate between the browsers. the following code shows blocks designated for internet explorer: . . . var elm; if (ns4) elm = document.layers["myid"]; else if (ie4) elm = document.all["myid"] the above code isn't extensible, so if you want it to support a new browser, you must update these blocks throughout the web application. the easiest way to eliminate the need to recode for a new browser is to abstract out functionality. rather than multiple if() else() blocks, you increase efficiency by taking common tasks and abstracting them out into their own functions. not only does this make the code easier to read, it simplifies adding support for new clients: var elm = getelmby...
Mozilla Application Framework - Archive of obsolete content
tion suite like mozblog, and web applications like the mozilla amazon browser. mozilla has been ported to more than a dozen platforms including windows (95, 98, nt, 2000, xp, ce), mac os x, linux, solaris, beos, openvms, os/2, aix, and hp-ux. you can build simple but powerful mozilla-based applications using just javascript and xul. original document information author(s): myk melez last updated date: march 3, 2003 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Porting NSPR to Unix Platforms - Archive of obsolete content
</tt> <tt>cvar2</tt> <tt>./join -d</tt> <tt>perf</tt> <tt>./switch -d</tt> <tt>intrupt -d</tt> for i/o: <tt>cltsrv -d</tt>, <tt>cltsrv -gd</tt> <tt>socket</tt> <tt>testfile -d</tt> <tt>tmocon -d</tt> '<tt>tmoacc -d</tt>' in conjunction with '<tt>writev -d</tt>' miscellaneous: <tt>dlltest -d</tt> <tt>forktest</tt> original document information author: larryh@netscape.com last updated date: 16 july 1998 ...
BlogPosts - Archive of obsolete content
just browsing: mozilla prism update thanscorner: mozilla prism - webrunner with pazzaz mozilla prism - a revolution in web apps thanscorner: mozilla webrunner 0.7 site specific browsers webrunner using webrunner webrunner + gears = offline desktop reader webrunner 0.5 webrunner 0.5 - mac support webrunner 0.5 - linux install webrunner, google reader, and google notebook distraction free gtd - 32+ web app files for online todo lists mozilla webrunner: a one-window, tabless browser with no url bar webrunner becomes prism - a mozilla labs project mozilla labs: prism alex faaborg: prism mozilla prism: bringing web apps to the desktop everyone should use site specific browsers mozilla prism portable (spanish) prism, l'avenir des applications web selon mozilla (french) mozilla prism : bundle c...
Extensions - Archive of obsolete content
ructure: webrunner.xulporting an existing extension since there aren't many extensions designed explicitly for prism, you may need to port your favorite extensions. this usually means extracting and editing the install.rdf file to add prism as a target application. you may also need to modify the extension's overlay to be able to work with the prism ui. many archive tools, like 7zip, can edit and update a file in the archive without needing to manually extract it and add it back into the xpi. installing prism supports a basic add-on user interface which allows a user to manage extensions. using this dialog, a user just launches a webapp and opens the add-ons dialog. then install the extension by either dragging and dropping the extension onto the dialog, or by clicking the “install…” butto...
Priority Content - Archive of obsolete content
the list of completed documents is available through the devedge page. if you would like to sign up to do the migration of any of these works, just "edit" this page and add your name to the "migrators" list for the piece. if there is devedge content you think should be migrated that isn't currently on this list, feel free to add it. note: use example at sample:original document information to credit original authors. devedge devedge mirror note: if you're digging around the mirror and see anything there that you think should be migrated to devmo that isn't on this list, feel free to add it below. a raw list of everything that has not been migrated at all appears there. ...
Hacking wiki - Archive of obsolete content
>. for example: [snip] include("extensions/breadcrumbs.php"); include("extensions/titleoverride.php"); include("extensions/abbr.php"); include("extensions/object.php"); include("extensions/kbd.php"); ?> tbd installing/configuring rss and doxygen extensions - anything special needs to be done? the title-override / breadcrumbs extensions need an additional table created. to configure it, run <tt>update-devmo.php</tt> from the command line. the following worked for me (from the <tt>www</tt> directory): /path/to/php -f ./maintenance/update-devmo.php done you should have a working install of the mdc wiki now. if you have problems with setting up the mdc wiki (and not the web server or php or mediawiki), feel free to ask in #devmo. random tips you can set the file to log by putting something...
New Skin Notes - Archive of obsolete content
e' better with page width (so large whitespace area's are non-existant), suggest min-width:some-em-size; width: 88%; and max-width set to 95% or something like that. --callek i tried this, but it gets totally screwed up in ie for some reason. i'll try again, but can't guarantee this will be fixed for the initial upgrades. --dria took two days, but i finally got this sorted out. when the skin is updated on test/docs, editform textarea should be resizeable in all browsers. yay! --dria wordpress skins need footer information. -- dria when a page is redirected, need to say-so and what it was redirected from, (see document for an example of such.) this is only an issue in mw1.5 so far. devmo skin vs cavendish skin --callek i can probably pull-off this patch if needed (quickly), so dria or ot...
Proxy UI - Archive of obsolete content
t can have an empty configuration (auto url and manual) will be disabled if the prefs are blank. selecting an enabled item sets the menu selection and the proxy mode (network.proxy.type) selecting a disabled item is not allowed. selecting "proxy configuration..." opens the preferences panel to "advanced > proxies" (tbdescribed: changing the prefs values). unfiled bug: changing proxy mode does not update the menu. mouseover when online, the tooltip will include the current proxy mode: code http://mxr.mozilla.org/seamonkey/sou...ityoverlay.xul bugs bug 243624 reference network.proxy.type ...
Frequently Asked Questions - Archive of obsolete content
(note it may already be built in). clicking on the link above should then take you straight there. if you'd prefer to contact us by email you can send an email to our newsgroup mozilla.dev.tech.svg which is archived here. alternatively you can email any of us directly of course (see the preceeding question for our email addresses). original document information author(s): jonathan watt last updated date: november 6, 2006 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
File object - Archive of obsolete content
script access to the file object is exactly equivalent to giving the script access to the unix shell or dos command interpreter. filesystem access is implemented with nspr i/o functions, and as such shares many semantics. pipelines are implemented with the popen() system call. there is currently no support for p2open()-like semantics. here is the original proposal for this object, and a status update from december 1998: http://www.mozilla.org/js/js-file-object.html created by the file constructor: new file(); new file(filename); parameters filename name of the file we want to work with. directories and pipelines are considered special files. pipelines either begin or end with the pipe (|) symbol. description filenames are specified as strings that have an implementation defined for...
Static Analysis for Windows Code under Linux - Archive of obsolete content
many vista only features on windows, so we should disable some components to make it buildable with mingw32. ac_add_options --enable-debug ac_add_options --disable-optimize ac_add_options --disable-tests ac_add_options --disable-embedding-tests ac_add_options --disable-installer ac_add_options --disable-accessibility ac_add_options --disable-vista-sdk-requirements ac_add_options --disable-updater #change this to where your libidl-config file locate. host_libidl_config=/usr/bin/libidl-config #config your moztools position glib_prefix=$home/moztools libidl_prefix=$home/moztools #disable xpcom stdcall calling convention because of gcc 4.3.0 bug cppflags="-dmoz_disable_xpcom_stdcall" #specify the cxx and static analysis #point cxx to the cross compile g++ with plugin support cxx=$home/min...
String Quick Reference - Archive of obsolete content
...
Supporting private browsing mode - Archive of obsolete content
st entered private browsing mode! }, onexitprivatebrowsing : function() { // we have just left private browsing mode! } }; canceling shutting off private browsing mode extensions can prevent private browsing mode from being shut off. an extension might wish to do this if it's currently in the middle of an operation that prevents safely turning off private browsing (such as a database update operation, for example). to do this, simply watch for the private browsing private-browsing-cancel-vote notification with the subject "exit", and set its data field to true to cancel the operation, like this: var os = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); os.addobserver(function (asubject, atopic, adata) { ...
Table Layout Strategy - Archive of obsolete content
body></tbody>foobar <table border width="200px"> <col width="40%"><col width="80%"> <tbody> <tr><td>foo</td><td>bar</td></tr> </tbody> </table> the algorithm tries to satisfy the requirements on a first come first serve base. the second table has <col width="40%"><col>. ie and opera handle this pretty much the same as mozilla. original document information author(s): bernd mielke last updated date: september 27, 2003 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Tamarin Build System Documentation - Archive of obsolete content
code and builds all of the shell executables, any errors will stop the phase and a red box will appear on the slave where the error occurred. the compile phase takes about 20-25 minutes. the smoke phase runs a set of tests on each platform until 2 minute is exceeded. the set of smoke tests can contain any shell build and any test suite (including performance). the smoke test list is constantly updated to contain the most recent failures, most frequent failures, and the newest testcases. the idea is to catch test failures in a few minutes rather than running the complete test run (1h 45m). the smoke test including downloading the shell takes about 3-4 minutes. the test phase runs all functional testcases including acceptance tests, cmdline tests, and selftests. the acceptance tests are the ...
The new nsString class implementation (1999) - Archive of obsolete content
...
Using cross commit - Archive of obsolete content
: land something simultaneously on the trunk and mozilla_1_8_branch # modify the files (probably by applying the patch) patch -p0 < ~/caret.patch # commit on trunk and branch at once # make sure to use -m "commit message" when doing so tools/cross-commit -m "fix some sort of security bug" layout/base/nscaret.h land something on two other branches that has already landed on the trunk # update to the first branch you want to land on cvs update -rmozilla_1_8_branch layout/base/nscaret.h # modify the files (probably by applying the patch) patch -p0 < ~/caret.patch # commit on all the branches at once # make sure to use -m "commit message" when doing so tools/cross-commit --moz18 --branch mozilla_1_8_0_branch -m "fix some sort of security bug" layout/base/nscaret.h notes note t...
Venkman - Archive of obsolete content
irc.mozilla.org report a bug in venkman if you find a problem with venkman, please follow directives mentioned at venkman faq section 5.4 and then you may report a bug on javascript debugger component. related topics javascript, web development, developing mozilla original document information author(s): robert ginda other contributors: doctor unclear last updated date: july 13, 2007 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Mozilla Web Developer Community - Archive of obsolete content
ial case for web standards a list apart, for people who make websites mozilla technology evangelism, get involved with mozilla evangelism you may also find helpful information on the w3c mailing lists newsletter there is no newsletter planned at this time. archived devedge newsletters are at http://devedge-temp.mozilla.org/community/news/ feeds recent changes rss feed warning: this feed is updated very often. mozilla developer news feed actually, there are no other feeds available for developer.mozilla.org. looking for feed ideas? the list of old devedge feeds is at http://devedge-temp.mozilla.org/comm.../feedlist.html feedback hendrix mdnproduct feedback bugzilla - report a bug in a mozilla product for questions related to this website (but not technical questions), please send you...
XBL - Archive of obsolete content
gets from existing xul, html, svg, and other primitives using xbl. specifications xbl 1.0 is specified in xbl 1.0 reference. unfortunately, the actual implementation in mozilla is different from the specification, and there's no known document available describing the differences. hopefully, the reference will be updated to describe those differences. xbl 1.0 is a mozilla-specific technology, and not a w3c standard. at least two standards spawned from it have died: sxbl and xbl 2.0. warning: sxbl and xbl 2.0 have died. w3c sxbl (currently a working draft, 2005) stands for svg's xml binding language. it is supposed to incl...
Creating XPI Installer Modules - Archive of obsolete content
there exist a lot of zip archivers/unarchivers. for unix, you can either use the preinstalled zip tool, or e.g. ...
Mac stub installer - Archive of obsolete content
l.js. ...
Unix stub installer - Archive of obsolete content
ll at: <http://lxr.mozilla.org/seamonkey/sou.../makeall.pl#75> you can test it by changing your current working directory to mozilla/xpinstall/packager/unix and running "perl deliver.pl" on the shell prompt. the resulting stub and full installers will be delivered to "mozilla/installer/{stub,sea}". original document information author(s): samir gehani other contributors: curt patrick last updated date: march 12, 2003 copyright information: copyright (c) samir gehani, curt patrick ...
Windows stub installer - Archive of obsolete content
can test it by changing your current working directory to mozilla/xpinstall/wizard/windows/builder and running "perl build.pl" on the shell prompt. the resulting stub installer and packages will be delivered to "mozilla/dist/win32obj_d/installer". run setup.exe there to launch the stub installer. original document information author(s): samir gehani other contributors: curt patrick last updated date: march 12, 2003 copyright information: copyright (c) samir gehani, curt patrick ...
Install Wizards (aka: Stub Installers) - Archive of obsolete content
e stub installer hands off one-by-one a series of xpis to install. ...
Examples - Archive of obsolete content
examples trigger scripts and install scripts describes typical kinds of script that use the xpinstall api. the following samples demonstrate some of the principal installation functions in the xpinstall api: file.macalias file.windowsshortcut [install.]adddirectory [install.]addfile installtrigger.installchrome installtrigger.startsoftwareupdate windows install example ...
compareTo - Archive of obsolete content
} ...
confirm - Archive of obsolete content
abutton2title custom title for button 2. acheckmsg a string to display as a checkbox label. acheckstate an object with a boolean value property representing the state of the checkbox: when the dialog box is shown, its checkbox will be checked when this object's value is true. after the user presses a button (or closes the window), the value property is updated according to the checkbox. var check = { value: false }; var button = confirm("are you sure you want to install foobar 0.1?", "confirm", std_yes_no_buttons, null, null, null, "install fluxcompensator 0.4 as well", check); returns the return value is...
Properties - Archive of obsolete content
df manifest. in particular plugin developers should see how to package a plugin as an extension. properties archive full local path of the archive after it is downloaded to the platform specific temp folder. (e.g. c:\temp\argstest.xpi) arguments args can be passed in through the triggering apis by attaching a ? and then the rg string to the xpi url: (e.g. startsoftwareupdate("http://webserver/argstest.xpi?argument_string") will result in the value of install.arguments being argument_string #). note that spaces in the arg string are legal. everything after the question mark is treated as one string which becomes the install.arguments property. buildid the application build id in the form 20041231. note that due to branching (different versions of gecko w...
Return Codes - Archive of obsolete content
name code explanation success 0 success. reboot_needed 999 the files were installed, but one or more components were in use. restart the computer and the application to complete the installation process. ...
XPJS Components Proposal - Archive of obsolete content
er to load up a new instance of the .js file and start over. ...
Mozilla E4X - Archive of obsolete content
javascript (ecma-262, iso-16262). e4x marries xml and javascript syntax, and extends javascript to include namespaces, qualified names, and xml elements and lists. e4x also adds new javascript operators for filtering xml lists, and for enumerating xml children and descendants. another e4x feature: the ability to bind a w3c dom document to a new xml object, reflecting the dom in e4x terms so that updates to either the dom or the e4x object hierarchy show up in the other. questions and discussion mozilla e4x - discussion ...
XTech 2005 Presentations - Archive of obsolete content
javascript (ecma-262, iso-16262). e4x marries xml and javascript syntax, and extends javascript to include namespaces, qualified names, and xml elements and lists. e4x also adds new javascript operators for filtering xml lists, and for enumerating xml children and descendants. another e4x feature: the ability to bind a w3c dom document to a new xml object, reflecting the dom in e4x terms so that updates to either the dom or the e4x object hierarchy show up in the other. directions of the mozilla rdf engine: website scripting, standards conformance and perfomance - axel hecht this presentation showed new developments in the mozilla rdf engine. these include plans to expose the rdf api to public web content, as well as performance and correctness improvements. rich web: svg and canvas in...
XTech 2006 Presentations - Archive of obsolete content
eb user interfaces (slides, slides as one page) - david baron a discussion of problems with existing standards and potential improvements in two areas: layout systems for user interfaces (rather than documents) and mechanisms for reordering content to allow the author to use good markup and appropriate layout. microsummaries in firefox and on the web - myk melez microsummaries are regularly-updated compilations of the most important and timely information on web pages. this talk demonstrates how firefox will incorporate microsummaries into its ui, starting with bookmark labels. svg and canvas: graphics for web apps - vladimir vukićević this presentation examines some of the strengths and weaknesses of the html 'canvas' and svg for adding rich graphical capabilities to web applicatio...
customindex - Archive of obsolete content
...
disableautoselect - Archive of obsolete content
« xul reference home disableautoselect type: boolean if this attribute is true or omitted, the selected item on the menu will update to match what the user entered in the textbox. if the text does not match any of the items in the list, the menu selection is cleared. if this attribute is false, the selection is never updated to match the text box. this attribute applies only to editable menulists. ...
disabled - Archive of obsolete content
e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. // disabling an element document.getelementbyid('buttonremove').setattribute("disabled", "disabled"); // enabling back an element by removing the "disabled" attribute document.getelementbyid('buttonremove').removeattribute("disabled"); firefox 3.5 note for keyset elements, support for this attribute was added in firefox 3.5. ...
emptytext - Archive of obsolete content
...
preference-editable - Archive of obsolete content
see the pref system documentation for more information. ...
state - Archive of obsolete content
open the content either before or after the splitter, depending on the value of the collapsed attribute, is currently displayed. collapsed the content either before or after the splitter is collapsed and is not visible. ...
statusbar - Archive of obsolete content
...
targets - Archive of obsolete content
« xul reference home targets type: comma-separated list of element ids a comma-separated list of element ids that the command updater will update upon. if this attribute is not specified, or you set it to the value '*', all elements are valid. the command update will only occur when the event occurs to one of the specified elements. ...
textbox.type - Archive of obsolete content
ues. there are several attributes that allow the number textbox to be configured, including decimalplaces, min, max, increment, wraparound, hidespinbuttons, and textbox.value. password a textbox that hides what is typed, used for entering passwords. search a textbox intended for searching. the command event will fire as the user modifies the value. a listener for the command event should update search results. if the searchbutton attribute is set to true, the command event is only fired if the user presses the search button or presses the enter key. you may specify grey text to appear when the search box is empty using the emptytext attribute, and a timeout may be set for the command event using the timeout attribute (defaults to 500). timed this textbox will fire a command event ...
textbox.value - Archive of obsolete content
« xul reference home value type: string the default value entered in a textbox. the attribute only holds the default value and is never modified when the user enters text. to get the updated value, use the value property. for number boxes, the default is 0 or the minimum value returned by the min property, whichever is higher. see also value ...
Working With Directories - Archive of obsolete content
rectoryentries (nsifile.attributes) property is an enumeration, you can iterate over the items by using nsisimpleenumerator.hasmoreelements() and nsisimpleenumerator.getnext(). for each item, nsifile.isfile() is called to check if an item is a file and lastmodifiedtime (nsifile.attributes) attribute is compared with the time of the lastmod reference. if the time is higher, the lastmod variable is updated as needed. the result is that lastmod will be set to the file with the latest modification time. nsifile.isfile() is used to ensure that the modification times are only examined for files, and not subdirectories. but you could iterate over subdirectories as well. the following example returns an array of all of a directory's subdirectories: function getsubdirs() { var arr = []; var items = i...
Introduction to XUL - Archive of obsolete content
hole system is then configured with different locale-specific dtds, and the correct dtd will be chosen for a given xml file at runtime, depending on the current locale settings. mozilla will make that decision automatically if the localized xml file specifies its dtd using a chrome url, as outlined in xul localizability issues. original document information author(s): danm@netscape.com last updated date: january 31, 2005 copyright information: copyright (c) danm@netscape.com ...
Special per-platform menu considerations - Archive of obsolete content
s the about dialog for the application. menu_mac_services a menu which provides system services. menu_mac_hide_app selecting this item will hide the application. menu_mac_hide_others selecting this item will hide all other applications except this one. menu_mac_show_all selecting this item will show the windows for all applications. checkforupdates the item that opens the update dialog for the application, for applications that have one (such as seamonkey; firefox does not have this item). the last five items aren't normally used but are listed for completeness. here is an example: <menubar> <menu label="tools"> <menupopup> <menuitem label="spell check"/> <menuitem id="menu_preferences" label="preferences" ...
PopupEvents - Archive of obsolete content
called whenever the outer menupopup is opened and when the inner menupopup is opened. the bubbling of events applies to all popup events. the popupshown event the popupshown event is fired once a popup is already visible. when calling either the openpopup or openpopupatscreen methods, the popup will not actually be open before that method returns. the popupshown event will be fired when the ui is updated and the popup is visible. one possible use of the popupshown event is to open another menu. this technique, as shown in the following example, is needed if you wish to open a submenu programmatically. this is because you cannot open a submenu directly without first opening the parent menu. <script> function openfilemenu() { var filemenu = document.getelementbyid("file-menu"); filemenu.addev...
currentSet - Archive of obsolete content
...
emptyText - Archive of obsolete content
...
Special Condition Tests - Archive of obsolete content
ghbourhood" type="menu" datasources="template-guide-streets.rdf" containment="http://www.xulplanet.com/rdf/address" ref="http://www.xulplanet.com/rdf/myneighbourhood"> the houses do have a value for the 'http://www.xulplanet.com/rdf/address' predicate, so they will also be considered to be containers as well, resulting in another level of menus. of course, we will need to update the predicates and labels to retrieve the right data. but this example demonstrates that something different is indeed happening. emptiness tests the second special condition attribute tests for empty containers. this invloves setting the isempty attribute on a rule to either true or false. setting it to true will match all empty containers, that is, containers with no children. setting it to fal...
Template Builder Interface - Archive of obsolete content
s is convenient when you want to simply add a new datasource to an existing template without reloading existing data. if you do want to reload the data, you can call the builder's refresh method: tree.builder.refresh(); this will reload the datasource attached to the template. if there is more than one datasource, as above, all of them will be reloaded. due to the nature of the way templates are updated, you don't usually need to rebuild a template after a refresh call, although there may situtations where this will be necessary. if you do plan on determining the datasources dynamically, it is common to start with an empty datasource using the special uri 'rdf:null'. <tree datasources="rdf:null" ref="http://www.xulplanet.com/rdf/myphotos"> this will create a composite datasource with no dataso...
Complete - Archive of obsolete content
work in any future version of the application. to adopt this approach, set the maxversion to a large number like 99. the problem with this approach is that when changes in an application do make the extension fail, users might have bad experiences ranging from error messages that they cannot understand to crashes and data loss. for more information about version checks, see: extension versioning, update and compatibility the installed jar to use disk space efficiently on the end user's computer, the three directories (content, locale, skin) are packed in a jar file. it is normally uncompressed, trading off some disk space for speed. this jar file will be installed as-is on the end user's computer, and unpacked at run-time by the application. to tell the application that the files it needs are in...
Box Objects - Archive of obsolete content
of the element that is just inside any borders, which is inconsistent with the other four boxobject position and size references, which include borders as part of the element. the values are always the position and sizes as currently displayed, so the values will be different if the element is moved or resized. for example, a flexible element will change in size and the box object dimensions will update accordingly. the following example shows this. example 1 : source view <button label="click me" oncommand="alert('the width is ' + this.boxobject.width);"/> you can use the width and height attributes of the element to specify the element's width and height, respectively. note that retrieving these values will return the size only if it was explicitly specified. these properties will re...
Creating a Skin - Archive of obsolete content
modifying userchrome.css is not guaranteed to work between versions of firefox and may lead to hard-to-diagnose bugs. use at your own risk! this section describes how to create a simple skin. for simplicity, we'll only apply it to the find files dialog. a simple skin the image below shows the current find files dialog. let's create a skin that we can apply to it. normally, a skin would apply to the entire application, but we'll focus on just the find files dialog to make it easier. for this reason, we'll modify only the file findfile.css rather than the global.css file. this section assumes that you are starting with the classic skin. ...
Focus and Selection - Archive of obsolete content
','enter your phone number.'); } </script> <textbox id="tbox1"/> <textbox id="tbox2" onfocus="displayfocus();"/> <description id="sbar" value=""/> the focus event, when it occurs, will call the displayfocus function. this function will change the value of the text label. we could extend this example to remove the text when the blur event occurs. typically, you will use focus and blur events to update parts of the interface as the user selects elements. for instance, you might update a total as the user enters values in other fields, or use focus events to validate certain values. don't display an alert during a focus or blur event as this will be distracting for the user and is poor user interface design. you can also add event handlers dynamically using the dom function addeventlistener. you...
Modifying the Default Skin - Archive of obsolete content
support for the userchrome.css file and any of its elements described below are not guaranteed in future versions of firefox. using it may lead to hard-to-diagnose bugs or crashes. use at your own risk! this section describes how to modify the skin of a window. ...
Templates - Archive of obsolete content
buttons, one for each top-level bookmark. you can see that the template contains a single button. this single button is used as a basis for all the buttons that need to be created. you can see in the image that the set of buttons has been created, one for each bookmark. try adding a bookmark in the browser while you have the example window open. you'll notice that the buttons in the example get updated instantly. (you may have to focus the window for it to change.) container and datasources the template itself is placed inside a vertical box. the box has two special attributes that allow it to be used for templates, which are used to specify where the data comes from. the first attribute on the box is the datasources attribute. this is used to declare what rdf datasource will be providing th...
The Chrome URL - Archive of obsolete content
part of a locale by using 'locale' instead of 'content'. when you open a chrome url, mozilla looks through its list of installed packages and tries to locate the jar file or directory that matches the package name and part. the mapping between chrome urls and jar files are specified in the manifest files stored in the chrome directory. if you were to move the file messenger.jar somewhere else and update the manifest file accordingly, thunderbird will still work since it doesn't rely on its specific installed location. by using chrome urls we can leave details like this to mozilla. similarly, if the user changes their theme, the 'skin' part of the chrome url translates to a different set of files, yet the xul and scripts don't need to change. here are some more examples. note how none of the urls...
Tree View Details - Archive of obsolete content
empty container will be displayed with a twisty next to it so that the user may open and close the row to see child items. empty containers will not have a twisty, but will still be treated like a container. when the user clicks the twisty to open a row, the tree will call the view's toggleopenstate method. the view should then perform any necessary operations to retrieve the child rows and then update the tree with the new rows. note: as of this writing (gecko 2.0), custom nsitreeview implementations must be prepared to handle a call to toggleopenstate for any row index which returns true for a call to iscontainer, regardless of whether the container is empty. review of the methods here is a review of the methods needed to implement hierarchical views: getlevel(row) hasnextsibling(row, a...
XBL Attribute Inheritance - Archive of obsolete content
"flex"/> <xul:button xbl:inherits="label"/> when the content is generated, the textbox grabs the flex attribute from the searchbox and the button grabs the label attribute from the searchbox. this allows both the flexibility of the textbox and the label of the button to be different for each use of the binding. in addition, changing the value of the attributes on the searchbox with a script will update the textbox and button also. you can add the inherits attribute to as many elements as you wish, to inherit any number of attributes. note how the inherits attribute has been placed in the xbl namespace, by prefixing it with 'xbl:'. the namespace should be declared somewhere earlier, usually on the bindings element. the next example demonstrates this. <bindings xmlns:xbl="http://www.mozilla.org/x...
XBL Example - Archive of obsolete content
ater. page property next, a property that holds the current page will be added. when getting this custom property, it will need to retrieve the value of the selectedindex attribute of the deck, which holds the number of the currently displayed page. similarly, when setting this property, it will need to change the selectedindex attribute of the deck. in addition, the text widget will need to be updated to display which page is the current one. <property name="page" onget="return parseint(document.getanonymousnodes(this)[0].childnodes[0].getattribute('selectedindex'));" onset="return this.setpage(val);"/> the page property gets its value by looking at the first element of the anonymous array. this returns the vertical box, so to get the deck, we need to get the first child node of th...
Using Remote XUL - Archive of obsolete content
bedding the menu bar into the pages; (we can use xbl to embed xul into html pages to get around the limitations of iframes.) integrating the search function into the menu bar so you don't have to go to a separate page to use it; hiding the html-based navigation for users who can see the xul-based navigation; storing the menu structure and items in a remote rdf datasource to make them easier to update and reuse. original document information last updated date: december 7, 2002 ...
Using nsIXULAppInfo - Archive of obsolete content
= appinfo.platformversion; var platformbuildid = appinfo.platformbuildid; getting nsixulappinfo in xpcshell tests in firefox 21, a testing module was added that provides access to app info during the execution of xpcshell tests. see bug 809920, and in summary: // work around the fact that xpcshell doesn't have a proper app-info xpcom object. cu.import("resource://testing-common/appinfo.jsm"); updateappinfo(); older versions as stated above, older mozilla 1.7-based applications do not support nsixulappinfo. you'll have to write additional code if you choose to support those versions. for example, firefox and thunderbird 1.0 stored their id in the app.id preference (and their version in app.version), so you could use code like this to find out what application you're running under: functio...
Using the Editor from XUL - Archive of obsolete content
character. ...
Writing Skinnable XUL and CSS - Archive of obsolete content
an using <html:img>. ...
XUL Questions and Answers - Archive of obsolete content
; i++) { var thisuri=browsers[i].currenturi.spec; // do something with it. } the person can get the titles too using the .contenttitle tag. how to add and remove values to/from, set up inside a <prefwindow> container to handle the preference? <prefwindow> can contain any control, just like a regular window. some of them can be tied to a preference so that the preference is automatically updated as the control is manipulated. others, like <listbox>, cannot be so tied, but one can always write a script that updates preferences explicitly, via nsiprefbranch interface. can a xul template be used for rss? you should be able to use a xul template to display feeds, although you may have to write the feed data to an rdf datasource first. specifying window.onload function to specify a f...
XULBrowserWindow - Archive of obsolete content
in order to do so it implements the following interfaces: nsisupports nsixulbrowserwindow nsiwebprogresslistener nsiwebprogresslistener2 nsisupportsweakreference note: this page is not complete at this time. see the linked interfaces for the definition of the implemented methods. you may also wish to refer to the implementation of xulbrowserwindow in browser/base/content/browser.js. ...
XUL element attributes - Archive of obsolete content
e matches an element. preference-editable mozilla 1.8 type: boolean if true, the element may be used as one that modifies a preference in a prefwindow. the preference attribute may be used to connect to a preference element. this is useful for custom elements implemented in xbl. the element should fire change, command, or input event when the value is changed so that the preference will update accordingly. see the pref system documentation for more information. querytype type: string indicates the type of datasource used in a template. firefox 3 provides 3 built-in datasources: 'rdf', default, 'xml' and 'storage'. extensions may provide support for additional datasources. ref type: uri for template-generated elements, this attribute is used to specify the root rdf ...
XML - Archive of obsolete content
atform web applications, application serving, web appliances and embedded systems, and all sort of other things. like all really good technologies, xul and its xp cousins are already being used in ways not imagined by their creators and growing propitiously out of control. author: ian t. oeschger other documents: xml in mozilla original document information author(s): ian t. oeschger last updated date: november 13, 2001 copyright information: copyright (c) ian t. oeschger ...
XUL Coding Style Guidelines - Archive of obsolete content
n xul language spec and xul window language. ...
XUL Event Propagation - Archive of obsolete content
er attribute for getting events. ...
arrowscrollbox - Archive of obsolete content
e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. smoothscroll type: boolean true initially enables smooth scrolling for the corresponding arrowscrollbox, false disables it. currently, smooth scrolling supports horizontal arrowscrollboxes only. tabindex type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. ele...
broadcaster - Archive of obsolete content
] a broadcaster is used when you want multiple elements to share one or more attribute values, or when you want elements to respond to a state change. any elements that are observing the broadcaster will share the attributes placed on the broadcaster. for instance, if the broadcaster has a label attribute, the observers will use that label. if the label changes, the labels of the observers will update automatically. an onbroadcast event will be sent to the observers when a change is made. for menuitems or buttons that just want to have their disabled status set when the feature should be disabled, you should use a command element instead. more information is available in the broadcasters and observers xul tutorial. examples (example needed) attributes inherited from xul element align...
button - Archive of obsolete content
e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. dlgtype type: one of the values below the dialog type of the button, used only when the button is in a dialog box. you can use this feature to replace the standard dialog box buttons with custom buttons, yet the dialog event methods will still function. for example, if the dlgtype is set to accept, the button will replace the dialog box's accept button, which is usual...
checkbox - Archive of obsolete content
e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. src type: uri set this to an uri pointing to an image to appear in the checkbox. if this attribute is left out, no image appears. you can have both an image and a label. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menulist.va...
colorpicker - Archive of obsolete content
e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. color type: color string the currently selected color. this is modified when the user selects a color. you can assign a string of the form #rrggbb to this property to change the selected color. overview an onchange attribute is an event listener to the object for the event change. a change event is fired in different ways for different xul input elements as list...
command - Archive of obsolete content
e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. oncommand type: script code this event handler is called when the command is activated. this occurs when a user selects a ...
datepicker - Archive of obsolete content
e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. firstdayofweek type: integer which day of the week to display as the first day in the grid. the values range from 0 to 6, where 0 is sunday and 6 is saturday. the default value is determined by the locale, so only use this attribute if you want to override it. readonly type: boolean if set to true, then the user cannot change the value of the element. however...
description - Archive of obsolete content
e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. tabindex type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tabindex are later in the tab sequence. value type: string the string attribute allows you to associate a data value with an element. it is not used for any specific purpose, but you can access...
key - Archive of obsolete content
Archive › Mozilla › XUL › key
e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. key type: character the character that must be pressed. this should be set to a displayable character. keycode type: string key code for keys that do not have displayable characters, such as the enter key or function keys, use this attribute instead of the key attribute. valid keys are listed at keyboard shortcuts. keytext type: string a label for th...
keyset - Archive of obsolete content
e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, toolt...
label - Archive of obsolete content
Archive › Mozilla › XUL › label
e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. href type: string defines a url to open when this element is clicked. requires the class attribute to include text-link. value type: string the text to be used for the label. properties accesskey type: character gets and sets the value of the accesskey attribute. accessibletype type: integer a value indica...
listbox - Archive of obsolete content
e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. disablekeynavigation type: boolean if this attribute is not used, the user can navigate to specific items within the element by pressing keys corresponding to letters in the item's label. this is done incrementally, so typing more letters with select more specific items. this feature may be disabled by setting this attribute to true. preference type: id connect...
listcell - Archive of obsolete content
e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute ...
listhead - Archive of obsolete content
e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, p...
listheader - Archive of obsolete content
e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container,...
listitem - Archive of obsolete content
e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is...
menu - Archive of obsolete content
Archive › Mozilla › XUL › menu
e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. menuactive type: boolean this attribute is set on an item in a menu when it is being hovered over. typcially, the theme wi...
menubar - Archive of obsolete content
"edit-popup"> <menuitem label="undo"/> <menuitem label="redo"/> </menupopup> </menu> </menubar> attributes grippyhidden seamonkey only type: boolean when set to true, the grippy will be hidden. when set to false, the default, the grippy will be shown. statusbar type: id if you set this attribute to the id of a statusbar element, the label on the statusbar will update to the statustext of the items on the menu as the user moves the mouse over them. properties accessibletype type: integer a value indicating the type of accessibility object for the element. statusbar type: id of statusbar element gets and sets the value of the statusbar attribute. inherited properties align, , allowevents, , boxobject, builder, , , , classn...
menuitem - Archive of obsolete content
e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. note: the menuitem must have a class of menuitem-iconic for the image to appear. key type: id set to the id of a key element whose key shortcut is displayed in ...
menuseparator - Archive of obsolete content
e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute ...
prefpane - Archive of obsolete content
referenceforelement( uielement ) return type: preference element returns the preference element to which a user interface element is attached. void userchangedvalue(in domelement element); the user changed the value in a widget that the preferences system does not automatically track state changes for (1) and the preference element associated with the widget should be updated based on the state held by the widget. for example, if you are using a listbox and the user changes the contents of the listbox (such as adding or removing an item) and you want to sync the changes back to a preference, you must write an onsynctopreference handler for your listbox that returns the value to be written to the preference element, and then call the userchangedvalue function every ti...
radio - Archive of obsolete content
Archive › Mozilla › XUL › radio
e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. focused type: boolean this attribute is true if the element is focused. group type: string group name buttons with type="radio" and the same value for their group attribute are put into the same group. only one button from each group can be checked at a time. if the user selects one the buttons, the others in the group are unchecked. image type: uri...
radiogroup - Archive of obsolete content
e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. focused type: boolean this attribute is true if the element is focused. preference type: id connects the element to a corresponding preference. this attribute only has any effect when used inside a prefwindow. more information is available in the preferences system article. tabindex type: integer the tab order of the element. the tab order is the ord...
richlistbox - Archive of obsolete content
e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. disablekeynavigation type: boolean if this attribute is not used, the user can navigate to specific items within the element by pressing keys corresponding to letters in the item's label. this is done incrementally, so typing more letters with select more specific items. this feature may be disabled by setting this attribute to true. preference type: id conne...
richlistitem - Archive of obsolete content
e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. searchlabel type: string text used for 'find-as-you-type' (fayt) searching. in situations where the search text is ambiguous or missing, searchlabel can be used to give context to fayt. if searchlabel is not present, fayt falls back to use the label property. selected type: boolean indicates whether the element is selected or not. this value is read-only. to...
scale - Archive of obsolete content
Archive › Mozilla › XUL › scale
e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. increment type: integer the amount by which the curpos (for scroll bars) or value (for number boxes and scale) attribute changes when the arrows are clicked(or scales are dragged). the default value is 1. min type: integer the minimum value the control's value may take. the default value is 0. type: integer ...
splitter - Archive of obsolete content
plitter is repositioned. closest the element immediately to the left or above the splitter resizes. farthest the element that is the farthest away from the splitter to the left or above the splitter resizes. flex the closest flexible element resizes. state type: one of the values below indicates whether the splitter has collapsed content or not. this attribute will be updated automatically as the splitter is moved, and is generally used in a stylesheet to apply a different appearance for each state. open the content either before or after the splitter, depending on the value of the collapsed attribute, is currently displayed. collapsed the content either before or after the splitter is collapsed and is not visible. dragging the user is current adjusti...
tab - Archive of obsolete content
Archive › Mozilla › XUL › tab
e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. fadein type: boolean this attribute is set to true if the tab is fading in or out. this typically means that the tab is in the process of appearing or disappearing. first-tab type: boolean this attribute will be set to true for the first tab. this attribute should not be set manually, but is useful in a theme if the first tab should be styled differently. ...
tabs - Archive of obsolete content
Archive › Mozilla › XUL › tabs
e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. onclosetab type: script code this script will be called when the close tab button is clicked. onnewtab not in firefox type: script code this script will be called when the new tab button is clicked. onselect type: script code this event is sent to the tabs element when this tab is changed. selectedindex type: integer gets and sets the inde...
timepicker - Archive of obsolete content
e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. hideseconds type: boolean indicates whether to show the seconds field. readonly type: boolean if set to true, then the user cannot change the value of the element. however, the value may still be modified by a script. increment type: integer indicates the number of minutes to skip each time the arrows are pressed. th...
toolbarbutton - Archive of obsolete content
e case. the disabled attribute is allowed only for form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. dlgtype type: one of the values below the dialog type of the button, used only when the button is in a dialog box. you can use this feature to replace the standard dialog box buttons with custom buttons, yet the dialog event methods will still function. for example, if the dlgtype is set to accept, the button will replace the dialog box's accept button, which is usuall...
window - Archive of obsolete content
maximized the window is maximized, and occupies the full size of the screen. normal the window appears in a normal state at the desired size. this attribute is used to save and restore the state of a window (together with the persist attribute) and for css styles (e.g. to hide the resizer grippy on maximized windows). note: when a window is minimized, the sizemode attribute is not updated. this is done so that if a window is closed while minimized, its persisted sizemode attribute wouldn't be minimized. setting this attribute does not change the window state. use window.maximize(), window.restore(), or window.minimize() to change the window state. to get the window state from javascript code, use window.windowstate. listen to the sizemodechange event dispatched to the dom windo...
XULRunner 1.8.0.1 Release Notes - Archive of obsolete content
system requirements before installing, make sure your computer meets the system requirements. ...
Building XULRunner with Python - Archive of obsolete content
the built xulrunner can then be found asc:\projects\obj-xulrunner\dist\bin\xulrunner.exe. using python in xul applications add the following to yourprefs.js during develop...
Creating a Windows Inno Setup installer for XULRunner applications - Archive of obsolete content
pp's .iss file sample as follows: ; script generated by the inno setup script wizard. ...
Debugging a XULRunner Application - Archive of obsolete content
enu item or a toolbar button). make it call start_venkman() when activated. troubleshooting x-jsd is not a registered protocol if the message "x-jsd is not a registered protocol" appears when trying to open *.js files in venkman, then add an empty file called .autoreg in the same directory as your xulrunner binary. if .autoreg already exists, then edit it to force the last modified time to be updated. xulrunner will then notice the new components file. when adding a component to a xulrunner application, change the buildid in application.ini. function toopenwindowbytype is not defined if you get an error that "function toopenwindowbytype is not defined" you may add the following function to your scripts (doesn't seem to be in the venkman overlay): function toopenwindowbytype(intype, uri) ...
Deploying XULRunner - Archive of obsolete content
xulrunner (this is the "stub executable"... you should copy this file from /library/frameworks/xul.framework/versions/1.8/xulrunner.) libmozglue.dylib (the main xul library) ... other executables and libraries the core changes to xul and gecko that require this new file layout were implemented in gecko 34, except that the xulrunner application was not updated to know about the change, so it will report an error: "unable to load xpcom." xulrunner was fixed in gecko 39. see this blog post for additional background about this change. xulrunner 38 and earlier in xulrunner 38 and earlier, xulrunner is provided in a mac os x framework bundle, which is placed in your application bundle's frameworks directory. the complete bundle structure is as follows: ...
Dialogs in XULRunner - Archive of obsolete content
native page setup and print dialogs. ...
Getting started with XULRunner - Archive of obsolete content
ndle. note: in xulrunner 2.0, the chrome.manifest is now used to register xpcom components in addition to its previous uses. part of this change means the /chrome/chrome.manifest is no longer considered the "root" manifest. xulrunner will not check that folder location for a root-level chrome.manifest. you need to move your existing chrome.manifest to the application root folder, remembering to update the relative paths within the file. you could also just create a new application root-level manifest that includes the /chrome/chrome.manifest, which is what this tutorial will do. step 4: set up application.ini the application.ini file acts as the xulrunner entry point for your application. it specifies how your application intends to use the xulrunner platform as well as configure some inform...
How to enable locale switching in a XULRunner application - Archive of obsolete content
.createelementns(xul_ns, "listitem"); listitem.setattribute("value", locale); listitem.setattribute("label", locale); if (locale == selectedlocale) { // is this the current locale? selecteditem = listitem; } localelistbox.appendchild(listitem); } // highlight current locale localelistbox.selecteditem = selecteditem; } catch (err) { alert (err); } 4. code to update the locale user preference and restart the application mozilla xulrunner doesn't allow runtime switching of the locale, therefore the application must be restarted to activate the new choice. here is an example event handler which is fired when the user clicks on the button to change the locale. it saves the new locale to the user application preferences (thereby overriding the default prefs.js a...
Make your xulrunner app match the system locale - Archive of obsolete content
the first step is to get the code we're about to write to run before any of the locale specific resources are loaded. democracy does this by creating a command line handler called democracyclh, and then creating a new object of our pybridge component. ...
XULRunner tips - Archive of obsolete content
nfirm.xul"); pref("xpinstall.dialog.progress.skin", "chrome://mozapps/content/extensions/extensions.xul?type=themes"); pref("xpinstall.dialog.progress.chrome", "chrome://mozapps/content/extensions/extensions.xul?type=extensions"); pref("xpinstall.dialog.progress.type.skin", "extension:manager-themes"); pref("xpinstall.dialog.progress.type.chrome", "extension:manager-extensions"); pref("extensions.update.enabled", true); pref("extensions.update.interval", 86400); pref("extensions.dss.enabled", false); pref("extensions.dss.switchpending", false); pref("extensions.ignoremtimechanges", false); pref("extensions.logging.enabled", false); pref("general.skins.selectedskin", "classic/1.0"); // nb these point at amo pref("extensions.update.url", "chrome://mozapps/locale/extensions/extensions.properties");...
What XULRunner Provides - Archive of obsolete content
applications (primarily firefox and thunderbird), as well as providing an embedding mechanism. ...
Windows and menus in XULRunner - Archive of obsolete content
ings xul offers for application ui. ...
application/http-index-format specification - Archive of obsolete content
...
Archived Mozilla and build documentation - Archive of obsolete content
roposed standard from the mozilla security team for defining how security tools can interact with browsers in a more useful and usable way. plugin architecture this page contains some notes on how plugins work internally in gecko. it is mainly of interest to gecko developers. porting nspr to unix platforms last modified 16 july 1998 priority content update: i've removed documents from this list that have been migrated into the wiki. the list of completed documents is available through the devedge page. prism prism is a simple xulrunner-based browser that hosts web applications without the normal web browser user interface. prism is based on a concept called site-specific browsers (ssb). an ssb is designed to work exclusive...
2006-09-29 - Archive of obsolete content
details are available for calendar only and for calendar and core. discussions no discussions available this week. meetings sept. ...
2006-10-13 - Archive of obsolete content
4519 is a wontfix. (user feels print belongs on the context menu along with back, reload, etc.) questions about programming for firefox a student questions how to create an extension that changes fonts, and how to capture website content before it is displayed. firefox add-on wanted user is inquiring if there is such an application to automatically save pieces of a webpage everytime is it updated. firefox 2.0 should re-implement modal window.open to support web 2.0 user would like the option to show pop-up windows, using window.open(), from inside untrusted script, to be re-implemented. this function was disabled, see bug: https://bugzilla.mozilla.org/show_bug.cgi?id=180048 meetings none this week. authors sara minchella (sara) dave manley (senemanley) back to summary list...
2006-10-13 - Archive of obsolete content
discussions shared training.dat & message filters jon-mikel is looking for suggestions on sharing spam filter data and message filters between machines easily. ...
2006-10-27 - Archive of obsolete content
iro_libs = -l$(libxul_dist)/lib -lmozcairo -lmozlibpixman \ -l/usr/sfw/lib -lxrender -lfreetype -lfontconfig october 27: alex replied to masaki posting, stating that he was going to use the work around that he provided and would provide feedback if it was successful or not. later that day alex able to successful complete his firefox 2 build by using masaki'swork around that he had posted. update-packaging october 27: atachi.hayash wanted to know if you use msys would update-packaging work. click here to view the errorthat he receives when trying to update-packaging. error building firefox-2.0rc3 october 27: chotu atwork is trying to build firefox-2.0rc3 on uclinux running on a mips processor. during his build he receives an error which he has tried to find a solution by using googl...
2006-12-01 - Archive of obsolete content
paul reed announced that: the server which performs the automatic autoconf/configure generation is back online. j. ...
2006-10-27 - Archive of obsolete content
summary: mozilla.dev.l10n - october 27, 2006 announcements drafts of eulas for several lanugages available for review drafts of eulas for several lanugages available for review final ff release already announced a french site has already announced final ff 2.0 and gives download links on its own site. update check failing in firefox 2.0 if add-on type is 8 testing a custom update.rdf file for a langpack using the official version of firefox 2.0 rc 3. discussions developing a spelling dictionary developing a spelling dictionary. alternative german locale while the alternative locale is active, the auto update of firefox stops working. problem with belarusian firefox 2 rc3 the broken message is displayed after user tries to visit non-existing site. meetings ...
2006-09-22 - Archive of obsolete content
22nd internal rc1 testing complete firefox 2 internal rc1 testing concluded on sept. 25th. areas tested and results available at the above link. discussions discussion of l10n builds some discussion about the firefox 2 rc1 l10n builds happened, including why some locales are missing. ...
2006-11-24 - Archive of obsolete content
announcments bon echo status mike beltzner posted a small to-do list with regards to bon echo firefox 1.5.0.9/2.0.0.1 jay patel posted an update of bugs for the firefox 1.5.0.9/2.0.0.1 releases discussion non-ascii rendering performance boris zbarsky made some suggestions on how to improve international font rendering cvs commit access changes a large discussion went on about changes to policies surrounding cvs commit access project drivers and technical oversight mike connor suggested ways to better organize project management, policy making, and technical oversight. others gave input on this as well meetings because of the firefox summit last week there is no project status meeting this week november 22 gecko 1.9/gran paradiso status meeting: (agenda) ...
2006-10-06 - Archive of obsolete content
build is go for launch. vista testers - needed to test firefox and thunderbird in vista. any test case ideas specific to vista are welcomed. check posting for details. firefox 2 rc2 testing - tim riley announced the l10n builds were completed last night. to help out with testing meet in irc chat room #qa. test results will be posted here. ...
2006-10-20 - Archive of obsolete content
announced by tim on friday october 13, 2006. help required designing new home for quality.mozilla.org - talented web designers and/or artists interested in helping the design for quality.mozilla.org please read this posting. ...
2006-10-27 - Archive of obsolete content
summary: mozilla.dev.quality - october 20-october 27, 2006 announcements firefox & thunderbird 1.5.0.8 candidate builds available for testing! - with firefox 2.0 out the door, it's time to make sure that all 1.5.0.x users are updated with the latest and greatest in stability and security fixes! testers are needed. discussions need to unit test innerhtml - someone needs to unit test innerhtml. he recommends that a non-xpcshell environment is needed really badly, but the big issue is that the xpcshell doesn't have an event loop, so nothing asynchronous can be tested. cross-domain testing - someone is suggesting that there needs to be some way of running cross-domain tests (security, web compat, etc), and is wondering if it's possible with the current test http server? update welcom...
2006-11-17 - Archive of obsolete content
summary: mozilla.dev.security - november 11, 2006 to november 17, 2006 return to mozilla-dev-security announcements none during this week. discussions how to detect firefox updates externally? micahc asked if there is an easier way to detect if firefox is installed and fully patched on any given machine, externally. extended validation certificates a note as to how opera is handling extended validation certificates http://labs.opera.com/news/2006/10/09/ fwd: re: mozilla questions regarding the ev standard gervase markham posted a summary of questions emailed to kelvin yiu about the extended validation certificates. meetings none during this week. ...
mozilla-dev-tech-js-engine - Archive of obsolete content
2006-09-22 2006-09-29 2006-10-06 2006-10-13 2006-10-20 *no updates see faq instead 2006-10-27 *no updates see faq instead 2006-11-03 2006-11-10 2006-11-17 2006-11-24 2006-12-01 js-engine faq ...
2006-11-24 - Archive of obsolete content
summary: mozilla.dev.tech.layout - november 17 - november 24, 2006 announcements none this week. discussions backed out view manager hierarchy unification discussion aboutthe view manager hierarchy unification and the problems with tp regressions that occuring whenever update batching interacts it. see bigid 360789 new linebreaker interface new linebreaker current interface is unworkable when it comes to using thai and uax#14. meetings none this week. ...
2006-11-10 - Archive of obsolete content
summary: mozilla.dev.tech.xpcom - oct 04-nov 10, 2006 announcements xptcall changes in process - ports owners needed if you maintain an xptcall port, you are needed to submit a patch to that bug 349002 with xptcall updates. discussions developing an extension like xmlhttprequest / nsidocument / mozilla_internal_api a discussion on how to develop an extension similar to xmlhttprequest but for a different protocol than http, emulating the asynchronous aspect. meetings none during this week. ...
2006-10-20 - Archive of obsolete content
. location of files discussion about where are the calendar files stored and can they be moved. handling of multiple calendars discusstion regarding the bug when handling multiple calendars calendar views improving the looking of calendar view. for example improving the left pane, so that user can switch between mail and calendar. problem with creating / updating / exporting events how to add/update events in "home" calendar meetings planning the next calendar release meet regarding the views of next calendar release. authors mark paruzel yi (eric) shen [back to weekly summaries ] ...
NPN_ForceRedraw - Archive of obsolete content
syntax #include <npapi.h> void npn_forceredraw(npp instance); parameters the function has the following parameters: instance plug-in instance for which the function forces redrawing. description once a region of a windowless plugin has been invalidated with npn_invalidaterect() or npn_invalidateregion(), a plug-in can call npn_forceredraw() to force a paint message. this causes a synchronous update event or paint message for the plug-in. browsers may ignore this request. see also drawing and event handling npn_invalidaterect() npn_invalidateregion() npp_handleevent() npp ...
NPN_GetValue - Archive of obsolete content
npnvnetscapewindow: ms windows and unix/x11 only: ms windows: gets the native window on which plug-in drawing occurs; returns hwnd unix/x11: gets the browser toplevel window in which the plug-in is displayed; returns window npnvjavascriptenabledbool: tells whether javascript is enabled; true=javascript enabled, false=not enabled npnvasdenabledbool: tells whether smartupdate (former name: asd) is enabled; true=smartupdate enabled, false=not enabled npnvisofflinebool: tells whether offline mode is enabled; true=offline mode enabled, false=not enabled npnvtoolkit: npnvsupportsxembedbool: npnvwindownpobject: returns the npobject * pointer for the dom window object; see getting the page url in npapi plugin for a rough example npnvpluginelementnpobject: ...
NPN_InvalidateRect - Archive of obsolete content
of. invalidrect the area to invalidate, specified in a coordinate system that originates at the top left of the plug-in's content area. description before a windowless plug-in can repaint or refresh part of its drawing area, the plug-in must first invalidate the area with either npn_invalidaterect() or npn_invalidateregion(). npn_invalidaterect() causes the npp_handleevent() method to pass an update event or a paint message to the plug-in. after calling this method, the plug-in receives a paint message asynchronously. the browser redraws invalid areas of the document and any windowless plug-ins at regularly timed intervals. to immediately send a paint message, the plug-in can call npn_forceredraw() after calling this method. see also npn_forceredraw() npn_invalidateregion() nprect npp ...
NPN_InvalidateRegion - Archive of obsolete content
ug-in instance. invalidregion the area to invalidate, specified in a coordinate system that originates at the top left of the plug-in. description before a windowless plug-in can repaint or refresh part of its drawing area, the plug-in must first invalidate the area with either npn_invalidaterect() or npn_invalidateregion(). npn_invalidateregion() causes the npp_handleevent() method to pass an update event or a paint message to the plug-in. if a plug-in calls this method, it receives a paint message later. the browser redraws invalid areas of the document and windowless plug-ins at regularly timed intervals. to force a paint message, the plug-in can call npn_forceredraw() after calling this method. see also npn_forceredraw() npn_invalidaterect() npregion npp ...
NPRect - Archive of obsolete content
summary represents a rectangular area of a plug-in's content area. syntax typedef struct _nprect { uint16 top; uint16 left; uint16 bottom; uint16 right; } nprect; fields the data structure has the following fields: top, left, bottom, right the top, left, bottom, and right sides of the rectangle. description nprect defines the bounding box of the area of the plug-in window to be updated, painted, invalidated, or clipped to. see also npn_forceredraw() npn_invalidaterect() npn_invalidateregion() npregion npwindow ...
NPRegion - Archive of obsolete content
« gecko plugin api reference « browser side plug-in api summary represents a platform-defined region of a page. syntax windows: typedef hrgn npregion; mac os x: typedef rgnhandle npregion; note: this may need to be updated for the cocoa event model. xwindows: typedef region npregion; description npregion defines the region of the plug-in window to be updated, painted, invalidated, or clipped to. for information about the region type definition used by your platform, see your platform documentation. see also npn_forceredraw() npn_invalidaterect() npn_invalidateregion() npwindow nprect ...
Samples and Test Cases - Archive of obsolete content
however, even if one cannot build the samples they can still be very valuable as code references. there is a guide to compiling the npruntime sample in visual studio. ...
Adobe Flash - Archive of obsolete content
that declares (arbitrarily) that macromedia will fix flash to be scriptable in mach-o browsers (on os x) by version 12. this is currently not the case, but 12 is a sufficiently high version number (current versions are version 6r.79) to allow for some leeway for fixing this down the road. when information about when this problem on mac os x will be addressed becomes available, the constant can be updated to reflect something less arbitrary. a complete code listing which expands on the above approach can be found in the flashversion.js file used in the samples. performance and flash as is the case with any plug-in content, flash content has the potential to slow down or even completely stall not just the tab it's running in, but the entire browser and even the entire computer it's being used on...
Supporting private browsing in plugins - Archive of obsolete content
potentially private information may include (but is not necessarily limited to) history information for downloaded data. ...
Why use RSS - Archive of obsolete content
ss. there are, in fact, many reasons to use rss, but the two biggest reasons can be broadly dictated by: #1 (obviously only use it if) it fits your needs and #2 it has a huge amount of momentum -- everyone is using it. rss has a huge amount of momentum. people are using it to syndicate all sorts of things: news articles, blogs, bookmarks, internet radio shows, internet television shows, software updates, e-mails, mailing lists, music playlists, and more. if it is episodic, it can be syndicated with rss. software that reads and can make use of rss is also everywhere. mozilla firefox has some support for rss (with it's live bookmark technology.). there are too many desktop and web-based rss aggregators out there to list them all. also, custom-made software is also making use of rss. rss aggrega...
0.90 - Archive of obsolete content
Archive › RSS › Version › 0.90
<title>mozilla dot org</title> <link>http://www.mozilla.org</link> <description>the mozilla organization web site</description> </channel> <image> <title>mozilla</title> <url>http://www.mozilla.org/images/moz.gif</url> <link>http://www.mozilla.org</link> </image> <item> <title>new status updates</title> <link>http://www.mozilla.org/status/</link> </item> <item> <title>bugzilla reorganized</title> <link>http://www.mozilla.org/bugs/</link> </item> <item> <title>mozilla party, 2.0!</title> <link>http://www.mozilla.org/party/1999/</link> </item> <item> <title>unix platf...
Confidentiality, Integrity, and Availability - Archive of obsolete content
...
Security Controls - Archive of obsolete content
event the threat from successfully breaching the system. a combination of network-based and host-based controls is generally most effective at providing consistent protection. original document information author(s): u.s. department of commerce title: federal information processing standard publication 200, minimum security requirements for federal information and information systems last updated date: march 2006 copyright information: this document is not subject to copyright. original document information author(s): karen scarfone, wayne jansen, and miles tracy title: nist special publication 800-123, guide to general server security last updated date: july 2008 copyright information: this document is not subject to copyright. ...
Digital Signatures - Archive of obsolete content
rivate key has not been compromised or out of the owner's control. this quality of digital signatures provides a high degree of nonrepudiation; that is, digital signatures make it difficult for the signer to deny having signed the data. in some situations, a digital signature may be as legally binding as a handwritten signature. original document information author(s): ella deon lackey last updated date: 2012 copyright information: © 2012 red hat, inc. link: red hat certificate system common criteria certification 8.1: deployment, planning, and installation ...
Encryption and Decryption - Archive of obsolete content
those values. because it is relatively trivial to break an rsa key, an rsa public-key encryption cipher must have a very long key, at least 1024 bits, to be considered cryptographically strong. on the other hand, symmetric-key ciphers can achieve approximately the same level of strength with an 80-bit key for most algorithms. original document information author(s): ella deon lackey last updated date: 2012 copyright information: © 2012 red hat, inc. link: red hat certificate system common criteria certification 8.1: deployment, planning, and installation ...
Introduction to Public-Key Cryptography - Archive of obsolete content
g end entity requests, authenticating them, and forwarding them to the ca. after receiving a response from the ca, the ra notifies the end entity of the results. ras can be helpful in scaling an pki across different departments, geographical areas, or other operational units with varying policies and authentication requirements. original document information author(s): ella deon lackey last updated date: 2012 copyright information: © 2012 red hat, inc. link: red hat certificate system common criteria certification 8.1: deployment, planning, and installation ...
Introduction to SSL - Archive of obsolete content
server's access control lists (acls) and establishes a connection with appropriate access. if the server doesn't get to step 6 for any reason, the user identified by the certificate cannot be authenticated, and the user is not allowed to access any server resources that require authentication. original document information author(s): [author names] other contributors: giacomo magnini last updated date: september 26, 2005 copyright information: © 2001 sun microsystems, inc. used by permission. © 2005 red hat, inc. all rights reserved. ...
SSL and TLS - Archive of obsolete content
192 7860 384-511 256 15360 512+ the information in this table is from the national institute of standards and technology (nist). for more information, see http://csrc.nist.gov/publications/nistpubs/800-57/sp800-57-part1.pdf. for more information on ecc, see rfc 4492, section 5.6.1, table 2. original document information author(s): ella deon lackey last updated date: 2012 copyright information: © 2012 red hat, inc. link: red hat certificate system common criteria certification 8.1: deployment, planning, and installation ...
TCP/IP Security - Archive of obsolete content
server to the client, but it can be performed mutually. replay protection. the same data is not delivered multiple times, and data is not delivered grossly out of order. original document information author(s): sheila frankel, paul hoffman, angela orebaugh, and richard park title: national institute of standards and technology (nist) special publication 800-113, guide to ssl vpns last updated date: july 2008 copyright information: this document is not subject to copyright. ...
Table Reflow Internals - Archive of obsolete content
the overflow lines mechanism (mentioned above) for its continued children there are two splitting scenarios for a table an incomplete cells block causes the cell, row, row group, table, outer table to be incomplete a truncated row or a row that started too far down the page causes the row group, table, outer table to be incomplete. original document information author(s): chris karnaze last updated aug 7, 2002 ...
Common Firefox theme issues and solutions - Archive of obsolete content
ox no longer supports -moz-transition style property. use css standard transition property instead (supported by firefox since firefox 4). resources amo editors theme testing guidelines when developing and testing your themes, please refer to the theme testing guidelines amo editors use to review themes. this guide will help you thoroughly test your theme to find and fix issues before you push updates to amo. this is document is a work in progress so feedback and/or suggestions is appreciated. mdn css reference mozilla's developer network maintains a great css reference. amo themes forum we'd like to encourage you to participate in the amo (addons.mozilla.org) forums theme forum. mozillazine themes forum mozillazine is not an official mozilla website, but it does have the largest commu...
install.rdf - Archive of obsolete content
in_ff_version</em:minversion> <em:maxversion>max_ff_version</em:maxversion> </description> </em:targetapplication> <!-- front end metadata --> <!-- my_theme --> <em:name>my_theme</em:name> <em:description>my_theme</em:description> <em:creator>your_name</em:creator> <em:contributor>contributors_names</em:contributor> <em:homepageurl>themes_homepage</em:homepageurl> <em:updateurl> url_of_update_location </em:updateurl> <em:abouturl> url_of_about_page </em:abouturl> <!-- front end integration hooks (used by theme manager)--> <em:internalname>my_theme</em:internalname> </description> </rdf> ...
Theme changes in Firefox 3.5 - Archive of obsolete content
affected files details scrollbar.xml, xulscrollbars.css the <gripper> element was removed from the scrollbar thumb button by bug 448704. for the windows and linux native default themes, the gripper is now drawn as a part of the background of the scrollbar thumb widget. ...
Theme changes in Firefox 3 - Archive of obsolete content
this article covers the changes that need to be made to update a firefox theme to work properly in firefox 3. note: we could use an article called updating themes for firefox 3 that would serve as a how-to guide for updating themes. if anyone with theming experience would like to write one, please do! browser changes requiring theme updates there are a number of changed and deleted files in the browser that may require you to make changes to your theme. the table lists both the changed xul file and the theme's corresponding css file that you might need to update. filename css file details changes to the default theme the table below lists changes made in the default theme for firefox 3; you can use this information as a starting point for figu...
Using IO Timeout And Interrupt On NT - Archive of obsolete content
, that should fundamentally solve this problem. ...
Using SSH to connect to CVS - Archive of obsolete content
. do file a server operations bug in bugzilla and attach yourid_dsa.pub to the bug. setting up cvs to use ssh in your system's environment, make sure thatcvs_rsh is set to whatever your ssh binary is called; a full path is not necessary if ssh is already in your path. replace pserver with ext in your cvsroot environment variable. if you wish to keep your previous pserver trees, you'll need to update the root files in each cvs subdirectory in your tree. this can be done using a unix-style find and perl: find . -name root -exec perl -p -i -e "s/pserver/ext/" {} \; dealing with firewalls do not attempt to perform the steps in this section unless you have first verified that you can access cvs.mozilla.org from outside of the firewall. only proceed with these steps once you are certain you ca...
Developing cross-browser and cross-platform pages - Archive of obsolete content
("internet explorer"); }; while this kind of checking in the above code can work in a crude sense, sharp readers may wonder what happens when internet explorer 8 is released or when an opera 8.x user visits the page or even when an user with any non-netscape browser starting with a "8" character in the appversion string visits that page. as new browsers are released, it becomes necessary to make updates to such code which attempts to narrow down the browser and browser version and to make the appropriate switches. another major problem with this approach is that the browser identity can be "spoofed" because, in many modern browsers, the navigator.appversion and navigator.useragent string properties are user configurable strings. for example, firefox 1.x users and users of any/all mozilla-ba...
Summary of Changes - Archive of obsolete content
for a complete discussion of these items, see the sections in which they are described. ...
Using Web Standards in your Web Pages - Archive of obsolete content
or those wishing to perfect their web pages. contents benefits of using web standards making your page using web standards - how to using the w3c dom developing cross browser and cross platform pages using xmlhttprequest summary of changes references original document information author(s): mike cowperthwaite, marcio galli, jim ley, ian oeschger, simon paquet, gérard talbot last updated date: may 29, 2008 copyright information: portions of this content are © 1998–2008 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Browser Detection and Cross Browser Support - Archive of obsolete content
text transfer protocol -- http 1.0 rfc 2068 - hypertext transfer protocol -- http 1.1 [mozilla's quirks mode] css enhancements in internet explorer 6 w3c w3c markup w3c technical recommendations w3c html 4.01 w3c css 1 w3c css 2 w3c dom core 2 w3c dom html 2 w3c dom style 2 original document information author(s): bob clary last updated date: 10 feb 2003 ...
Debug - Archive of obsolete content
lback stack associated with a previously specified asynchronous operation has completed. debug.mstraceasynccallbackstarting associates the callback stack with a previously specified asynchronous operation. debug.mstraceasyncoperationcompleted indicates that an asynchronous operation has completed. debug.mstraceasyncoperationstarting initiates a trace for an asynchronous operation. debug.msupdateasynccallbackrelation updates the relationship status between a synchronous work item and the associated asynchronous operation. debug.write sends strings to the script debugger. debug.writeln sends strings to the script debugger, followed by a newline character. examples print the value of a variable this example uses the write function to display the value of the variable. var counter ...
New in JavaScript 1.8.1 - Archive of obsolete content
the following is a changelog for javascript 1.8.1. this version was included in firefox 3.5. javascript 1.8.1 is a modest update syntactically to javascript; the main change in this release is the addition of the tracemonkey just-in-time compiler, which improves performance. new features in javascript 1.8.1 object.getprototypeof() support for native json string.prototype.trim() string.prototype.trimleft() string.prototype.trimright() changed functionality in javascript 1.8.1 implicit setting of properties in object and array initializers no longer execute setters in javascript. this makes the behavior of setting the values of properties more predictable. ...
ECMAScript 5 support in Mozilla - Archive of obsolete content
e. supported features added in javascript 1.8.5 (gecko 2, firefox 4 and later) firefox 4 has full ecmascript 5 support including the object.* methods and strict mode. see new in javascript 1.8.5. added in javascript 1.8.1 (gecko 1.9.1, firefox 3.5) native json support object.getprototypeof() method. string.trim() method, which trims whitespace from both ends of the string. gecko 1.9.1.4 updated the implementation of json.stringify() to be compliant with ecmascript 5. improvements laid out by ecmascript 5 have been made in the parsing algorithm that prevents evaluating xhtml as javascript code in certain circumstances. added in javascript 1.6 (gecko 1.8, firefox 1.5) new array methods offering several improved methods for manipulating arrays -- have been part of javascript since jav...
Archived JavaScript Reference - Archive of obsolete content
array based on an existing one. however, it has been removed from the standard and the firefox implementation. do not use it!array.observe()the array.observe() method was used for asynchronously observing changes to arrays, similar to object.observe() for objects. it provided a stream of changes in order of occurrence. it's equivalent to object.observe() invoked with the accept type list ["add", "update", "delete", "splice"]. however, this api has been deprecated and removed from browsers. you can use the more general proxy object instead.array.unobserve()the array.unobserve() method was used to remove observers set by array.observe(), but has been deprecated and removed from browsers. you can use the more general proxy object instead.arraybuffer.transfer()the static arraybuffer.transfer() metho...
LiveConnect Overview - Archive of obsolete content
code accesses a java data member or method and fails, the java exception is passed on to javascript for you to handle. beginning with javascript 1.4, you can catch this exception in a try...catch statement. (although this functionality (along with some others) had been broken in gecko 1.9 (see bug 391642) as the mozilla-specific liveconnect code had not been maintained inside mozilla, with java 6 update 11 and 12 building support for reliance on mozilla's implementation of the generic (and cross-browser) npapi plugin code, this has again been fixed.) for example, suppose you are using the java forname method to assign the name of a java class to a variable called theclass. the forname method throws an exception if the value you pass it does not evaluate to the name of a java class. place the for...
LiveConnect - Archive of obsolete content
n overview for liveconnect. liveconnect reference the java classes used for liveconnect, along with their constructors and methods. java in firefox extensions community view mozilla.dev.tech.java forums... 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 restored (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 restored api. the reimplementation also restores the ability to use try-catch...
Properly Using CSS and JavaScript in XHTML Documents - Archive of obsolete content
...
Standards-Compliant Authoring Tools - Archive of obsolete content
ugging for compatibility with standards-based browsers. newer versions of microsoft frontpage™ have improved, however be sure not to rely on frontpage-specific extensions for critical website content or functionality. some versions of microsoft word create invalid html code that only works with internet explorer. always be sure to validate your web pages. original document information last updated date: january 30th, 2003 copyright © 2001-2003 netscape. all rights reserved. related links validators html central ...
Styling the Amazing Netscape Fish Cam Page - Archive of obsolete content
all rights reserved. note: this reprinted article was originally part of the devedge site. ...
XForms Custom Controls Examples - Archive of obsolete content
<getter> if (!this._domparser) this._domparser = new domparser(); return this._domparser; </getter> </property> <method name="refresh"> <body> // get new value, parse, and import it. ...
RFE to the Custom Controls Interfaces - Archive of obsolete content
custom controls page to get familiar with custom controls mechanism. in short, we have the following interfaces: nsixformsaccessors - serves to get/set the value of the instance data node that the xforms element is bound to as well as getting the various states of that node nsixformsdelegate - used to obtain the nsixformsaccessors interface nsixformsuiwidget - used by the xforms processor to update the value/state of an xforms element when its bound node's value/state is changed our current mechanism that allows authors to build custom controls assumes that the controls will be bound to instance nodes of simple content type. this means that the bound node is not allowed to contain element nodes. if you need to have a custom control that works with complext content or you find our interface...
XForms Range Element - Archive of obsolete content
...
XForms Secret Element - Archive of obsolete content
type derived from these. representations the xforms secret element is represented by a password field. the password field is a text field, the value of which is hidden by asterisks (xhtml/xul). characteristics analogous widgets are <xhtml:input type="password"/> and <xul:textbox type="password"/> if the incremental attribute is present and has the value true, then the bound instance node is updated on every user input. please keep in mind that the instance data will hold exactly what the user gave as input. any other xform control bound to that data will show that data 'as is'. ...
XForms Textarea Element - Archive of obsolete content
false. type restrictions the textarea element can be bound to a node of type xsd:string or any type derived from it. representations the xforms textarea element is represented by a multiline text field (xhtml/xul). characteristics analogous widgets are <xhtml:textarea/> and <xul:textbox multiline="true"/> if the incremental attribute has the value true, then the bound instance node is updated on every user input. ...
Archived open Web documentation - Archive of obsolete content
t isn't hosted anywhere (i thought the github reference contained the code) but inserted a faster implementation above while retaining the rest of the document. iterator the iterator function returns an object which implements legacy iterator protocol and iterates over enumerable properties of an object. liveconnect (please update or remove as needed.) msx emulator (jsmsx) old proxy api proxies are objects for which the programmer has to define the semantics in javascript. the default object semantics are implemented in the javascript engine, often written in lower-level languages like c++. proxies let the programmer define most of the behavior of an object in...
Choosing Standards Compliance Over Proprietary Practices - Archive of obsolete content
en the owner of the de facto changes focus or direction, or abandons the de facto altogether and renders the standard stagnate. on the other hand, by adopting open technology standards and participating in the development and direction of those standards, an organization is providing a path for future development, growth and revenue. original document information author(s): beth epperson last updated date: 7 november 2014 ...
Correctly Using Titles With External Stylesheets - Archive of obsolete content
...
Fixing Incorrectly Sized List Item Markers - Archive of obsolete content
make list item markers match the font size of the content, use one of the suggested rules. in situations where validation is a priority, segregate the rule into a separate stylesheet so that the rule will not confuse css validators run against the main stylesheet. related links bug 110360 bug 97351 original document information author(s): eric a. meyer, netscape communications last updated date: published 04 oct 2002; revised 07 mar 2003 copyright information: copyright © 2001-2003 netscape. all rights reserved. note: this reprinted article was originally part of the devedge site. ...
Fixing Table Inheritance in Quirks Mode - Archive of obsolete content
in "quirks" mode. it is also fully valid css2 and so will validate without incident. recommendations in situations where authors must put a document into "quirks" mode but wish to enforce correct font inheritance into tables, use the demonstrated rule. related resources mozilla's doctype sniffing original document information author(s): eric a. meyer, netscape communications last updated date: published 26 nov 2002 copyright information: copyright © 2001-2003 netscape. all rights reserved. note: this reprinted article was originally part of the devedge site. ...
Issues Arising From Arbitrary-Element hover - Archive of obsolete content
es prevents hover styles from being applied to non-hyperlink anchors. thus, a:hover should always be used instead of just :hover, and a:link:hover (and a:visited:hover) are preferred to the simpler a:hover related links the dynamic pseudo-classes: :hover, :active, and :focus :hover pseudo-class (msdn) original document information author(s): eric a. meyer, netscape communications last updated date: published 07 mar 2003; revised 21 mar 2003 copyright information: copyright © 2001-2003 netscape. all rights reserved. note: this reprinted article was originally part of the devedge site. ...
Mozilla's DOCTYPE sniffing - Archive of obsolete content
trius presentational//en". ...
Popup Window Controls - Archive of obsolete content
indow. you can also use either the advanced features in the document object model (dom) or innerhtml to create the appropriate html. example the example tag links to devedge-temp.mozilla.org this example illustrates detecting suppressed popup windows as well as an approach for replacing popup windows with inline html using innerhtml. original document information author(s): bob clary last updated date: december 5th, 2002 copyright © 2001-2003 netscape. ...
RDF in Fifty Words or Less - Archive of obsolete content
the rdf engine folds the rdf into the graph at the appropriate place, and the tree control that actually implements the ui to the bookmarks is notified that it should begin drawing some icons for the latest message about yam soup from aunt helga. this isexactly how smartmail works. contact: chris waterson (waterson@netscape.com) original document information author(s): chris waterson last updated date: november 19, 1998 copyright information: copyright (c) chris waterson interwiki language link ...
RDF in Mozilla FAQ - Archive of obsolete content
terson with urls if you are aware of other examples to which we ought to link! ...
Styling Abbreviations and Acronyms - Archive of obsolete content
ent and leaving it for a moment will cause the contents of the title attribute to appear as a tooltip next to the mouse pointer. removing the underline from these elements will rob readers of an indication that there is extra information available. related links web content accessibility guidelines 1.0 original document information author(s): eric a. meyer, netscape communications last updated date: published 09 aug 2002 copyright information: copyright © 2001-2003 netscape. all rights reserved. note: this reprinted article was originally part of the devedge site. ...
Using the Right Markup to Invoke Plugins - Archive of obsolete content
r not makes no difference -- the browser willalways consult with the plugin finder service to determine if it has a plugin to handle the missing mime type. if the preference is unchecked, the plugin finder service will be consulted only if the web page authordoes not specify either of these attributes. original document information author(s): arun k. ranganathan, netscape communications last updated date: 14. nov 2002 copyright information: copyright © 2001-2003 netscape. all rights reserved. link: http://devedge-temp.mozilla.org/view.../index_en.html references general -- specifications html 4.01 specification xhtml 1.0 specification object element html 4.01 specification on object element embed element plugin api reference on embed element on devedge-temp java htm...
Obsolete: XPCOM-based scripting for NPAPI plugins - Archive of obsolete content
...
Index - Game development
pressive web technology demos for you to get inspiration from, and generally have fun with. a testament to what can be done with javascript, webgl, and related technologies. 4 index meta found 74 pages: 5 introduction to html5 game development (summary) firefox os, games, html5, mobile games built with html5 work on smartphones, tablets, pcs and smart tvs.update your game whenever you want.players can play the game anywhere, anytime. 6 introduction to game development for the web firefox os, games, guide, mobile no summary! 7 publishing games games, html5, javascript, monetization, promotion, distribution, publishing this series of articles looks at the options you have when you want to publish and distribute you...
Introduction to game development for the Web - Game development
the web as well as other media, taking advantage of the web's inherent linkability and shareability to reach new customers. you have control where it matters: payments. you don't have to hand over 30% of your revenues to someone else just because your game is in their ecosystem. instead, charge what you want and use whatever payment processing service you like. again with more control, you can update your game whenever you want. no waiting breathlessly for approval while someone hidden within another company decides whether or not your critical bug fix will ship today or tomorrow. control your analytics! instead of relying on someone else to make all the decisions about what analytics you need, you can collect your own -- or choose the third party that you like the best -- to gather informat...
Game distribution - Game development
multiple devices. this can range from low-end smartphones or tablets, through laptops and desktop computers, to smart tvs, watches or even a fridge if it can handle a modern enough browser. you don't need to have separate teams to work on the same title targeting different platforms with only one code base to worry about. you can spend more time and money on promotion and monetization. instant updates you don't have to wait several days to have your game's code updated. if your user finds a bug, you can quickly fix it, update the system and refresh the game on your server to provide players with the updated code almost instantly. 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. you can just send them a direct ...
Building up a basic demo with A-Frame - Game development
imation is being repeated indefinitely. moving we could use the <a-animation> to change the position of the third shape, or we could use javascript instead. add this code at the end of the <script> tag: var t = 0; function render() { t += 0.01; requestanimationframe(render); cylinder.setattribute('position', '3 '+(math.sin(t*2)+1)+' 0'); } render(); we're using the render() function to update the cylinder's position on every frame. try changing the given values on the y axis and see how it affects the movement. conclusion everything is rendered properly and animating — congratulations on building your first a-frame scene! here's how the final version looks and works: if you have a vr device available, now is a good time to try out your scene with it too. note: you can also ch...
Building up a basic demo with Babylon.js - Game development
g. in a game something is usually happening — we can see animations and such — so let's try to breathe a little life into those shapes by animating them. animation we already used position and rotation to adjust the position of the shapes; we could also scale them. to show actual animation, we need to make changes to these values inside the rendering loop at the end of our code, so they are updated on every frame. define a helper variable — t — that we will use for animations, just before the renderloop, and decrement it on every frame inside the loop, like this: var t = 0; var renderloop = function () { scene.render(); t -= 0.01; // animation code goes here }; engine.runrenderloop(renderloop); the t variable will be incremented on every rendered frame. rotation applyi...
Building up a basic demo with Three.js - Game development
s a little boring though. in a game, something is usually happening. we might see animations and such. so let's try breathing a little life into these shapes, by animating them! animation we already used rotation, to adjust the position of the cube. we can also scale the shapes, or change their positions. to show animation, we need to make changes to these values inside the render loop, so they update on each frame. rotation rotating is straighforward. you add a value to a given direction of rotation on each frame. add this line of code, right after the requestanimationframe() invocation inside the render function: cube.rotation.y += 0.01; this rotates the cube on every frame, by a tiny bit, so the animation looks smooth. scaling we can also scale an object. applying a constant value, w...
WebVR — Virtual Reality for the Web - Game development
can set up the scene, getting the eye parameters, setting the field of view, etc. for example: function setcustomfov(up,right,down,left) { var testfov = new vrfieldofview(up,right,down,left); ghmd.setfieldofview(testfov,testfov,0.01,10000.0); } the gpositionsensor variable holds the positionsensorvrdevice — using this you can get the current position or orientation state (for example to update the scene view on every frame), or reset the sensor. for example, the below code outputs position information on the screen: function setview() { var posstate = gpositionsensor.getstate(); if(posstate.hasposition) { pospara.textcontent = 'position: x' + roundtotwo(posstate.position.x) + " y" + roundtotwo(posstate.position.y) + " z" ...
Mobile touch controls - Game development
ame.plugins.add(phaser.virtualjoystick); this.stick = this.pad.addstick(30, 30, 80, 'generic'); in the create() function of the game state we're creating a virtual pad and a generic stick that has four directional virtual buttons by default. this is placed 30 pixels from the top and left edges of the screen and is 80 pixels wide. the stick being pressed can be handled during the gameplay in the update function like so: if(this.stick.isdown) { // move the player } we can adjust the player's velocity based on the current angle of the stick and move him appropriately. summary that covers adding touch controls for mobile; in the next article we'll see how to add keyboard and mouse support. overview: control mechanisms next ...
Game over - Game development
.reload(); clearinterval(interval); // needed for chrome to end game } letting the paddle hit the ball the last thing to do in this lesson is to create some kind of collision detection between the ball and the paddle, so it can bounce off it and get back into the play area. the easiest thing to do is to check whether the center of the ball is between the left and right edges of the paddle. ...
Mouse controls - Game development
controls too. listening for mouse movement listening for mouse movement is even easier than listening for key presses: all we need is the listener for the mousemove event. add the following line in the same place as the other event listeners, just below the keyup event: document.addeventlistener("mousemove", mousemovehandler, false); anchoring the paddle movement to the mouse movement we can update the paddle position based on the pointer coordinates — the following handler function will do exactly that. add the following function to your code, below the previous line you added: function mousemovehandler(e) { var relativex = e.clientx - canvas.offsetleft; if(relativex > 0 && relativex < canvas.width) { paddlex = relativex - paddlewidth/2; } } in this function we firs...
Track the score and win - Game development
n more awesome the game could award points for every brick a user hits, and keep count of the total score. counting the score if you can see your score throughout the game, eventually you can impress your friends. you need a variable to record the score. add the following into your javascript, after the rest of your variables: var score = 0; you also need a drawscore() function, to create and update the score display. add the following after the collisiondetection() function: function drawscore() { ctx.font = "16px arial"; ctx.fillstyle = "#0095dd"; ctx.filltext("score: "+score, 8, 20); } drawing text on a canvas is similar to drawing a shape. the font definition looks exactly like the one in css — you can set the size and font type in the font() method. then use fillstyle() ...
Build the brick field - Game development
creen. the newly created brick is enabled for the arcade physics engine, it's body is set to be immovable (so it won't move when hit by the ball), and we're also setting the anchor to be in the middle and adding the brick to the group. the problem currently is that we're painting all the bricks in one place, at coordinates (0,0). what we need to do is draw each brick at its own x and y position. ...
Buttons - Game development
line, and remove it. you only want the ball to move when the button is pressed, not before! keeping the paddle still before the game starts it works as expected, but we can still move the paddle when the game hasn't started yet, which looks a bit silly. to stop this, we can take advantage of the playing variable and make the paddle movable only when the game has started. to do that, adjust the update() function like so: function update() { game.physics.arcade.collide(ball, paddle, ballhitpaddle); game.physics.arcade.collide(ball, bricks, ballhitbrick); if(playing) { paddle.x = game.input.x || game.world.width*0.5; } } that way the paddle is immovable after everything is loaded and prepared, but before the start of the actual game. compare your code you can check t...
Collision detection - Game development
— the collision detection between the ball and the bricks. luckily enough we can use the physics engine to check collisions not only between single objects (like the ball and the paddle), but also between an object and the group. brick/ball collision detection the physics engine makes everything a lot easier — we just need to add two simple pieces of code. first, add a new line inside your update() function that checks for collision detection between ball and bricks, as shown below: function update() { game.physics.arcade.collide(ball, paddle); game.physics.arcade.collide(ball, bricks, ballhitbrick); paddle.x = game.input.x || game.world.width*0.5; } the ball's position is calculated against the positions of all the bricks in the group. the third, optional parameter is the ...
Extra lives - Game development
felosttext. if we ever want to change the font size or color we will have to do it in multiple places. ...
Scaling - Game development
lesson at gamedev-phaser-content-kit/demos/lesson02.html. scaling refers to how the game canvas will scale on different screen sizes. we can make the game scale to fit on any screen size automatically during the preload stage, so we don't have to worry about it later. the phaser scale object there's a special scale object available in phaser with a few handy methods and properties available. update your existing preload() function as follows: function preload() { game.scale.scalemode = phaser.scalemanager.show_all; game.scale.pagealignhorizontally = true; game.scale.pagealignvertically = true; } scalemode has a few different options available for how the canvas can be scaled: no_scale — nothing is scaled. exact_fit — scale the canvas to fill all the available space bo...
The score - Game development
meters: the x and y coordinates to draw the text at. the actual text that will be rendered. the font style to render the text with. the last parameter looks very similar to css styling. in our case the score text will be blue, sized at 18 pixels, and use the arial font. updating the score when bricks are destroyed we will increase the number of points every time the ball hits a brick and update the scoretext to display the current score. this can be done using the settext() method — add the two new lines seen below to the ballhitbrick() function: function ballhitbrick(ball, brick) { brick.kill(); score += 10; scoretext.settext('points: '+score); } that's it for now — reload your index.html and check that the score updates on every brick hit. compare your code you ca...
Ajax - MDN Web Docs Glossary: Definitions of Web-related terms
ajax, which initially stood for asynchronous javascript and xml, is a programming practice of building complex, dynamic webpages using a technology known as xmlhttprequest. ajax allows you to update parts of the dom of an html page instead without the need for a full page refresh. ajax also lets you work asynchronously, meaning your code continues to run while the targeted part of your web page is trying to reload (compared to synchronously, which blocks your code from running until that part of your page is done reloading). with interactive websites and modern web standards, ajax is gradually being replaced by functions within javascript frameworks and the official fetch api standard. ...
CRUD - MDN Web Docs Glossary: Definitions of Web-related terms
it is a mnemonic for the four basic functions of persistent storage. crud typically refers to operations performed in a database or datastore, but it can also apply to higher level functions of an application such as soft deletes where data is not actually deleted but marked as deleted via a status. ...
Canvas - MDN Web Docs Glossary: Definitions of Web-related terms
it provides an empty graphic zone on which specific javascript apis can draw (such as canvas 2d or webgl). ...
Delta - MDN Web Docs Glossary: Definitions of Web-related terms
cal or virtual object. it's also used when describing changes in the volume or frequency of sound waves. for example, when describing how far an object on the screen moves left-to-right, one might use the term delta x or Δx. likewise, given the new value of x and its old value, you might compute the delta like this: let deltax = newx - oldx; more commonly, you receive the delta and use it to update a saved previous condition: let newx = oldx + deltax; learn more technical reference mouse wheel events (wheelevent offer the amount the wheel moved since the last event in its deltax, deltay, and deltaz properties, for example. ...
Google Chrome - MDN Web Docs Glossary: Definitions of Web-related terms
chrome supports its own layout called blink. note that the ios version of chrome uses that platform's webview, not blink. learn more general knowledge google chrome on wikipedia for chrome users use one of these links if you're an everyday user. android ios desktop for web developers if you want to try the latest chrome features, install one of the pre-stable builds. google pushes updates frequently and has designed the distributions to run side-by-side with the stable version. visit the chrome releases blog to learn what's new. chrome dev for android chrome canary for desktop. ...
Houdini - MDN Web Docs Glossary: Definitions of Web-related terms
eb standards specifications to define them and without waiting for every browser to fully implement the features. while many of the features houdini enables can be created with javascript, interacting directly with the cssom before javascript is enabled provides for faster parse times. browsers create the cssom — including layout, paint, and composite processes — before applying any style updates found in scripts: layout, paint, and composite processes are repeated for updated javascript styles to be implemented. houdini code doesn't wait for that first rendering cycle to be complete. rather, it is included in that first cycle, creating renderable, understandable styles. see also houdini houdini: an introduction cssom css paint api css typed om ...
Layout viewport - MDN Web Docs Glossary: Definitions of Web-related terms
seen, while the visual viewport represents what is currently visible on the user's display device. this becomes important, for example, on mobile devices, where a pinching gesture can usually be used to zoom in and out on a site's contents. the rendered document doesn't change in any way, so the layout viewport remains the same as the user adjusts the zoom level. instead, the visual viewport is updated to indicate the area of the page that they can see. learn more general knowledge visual viewport api viewport on wikipedia a tale of two viewports (quirksmode) viewport in the mdn glossary visual viewport in the mdn glossary ...
RSS - MDN Web Docs Glossary: Definitions of Web-related terms
rss (really simple syndication) refers to several xml document formats designed for publishing site updates. when you subscribe to a website's rss feed, the website sends information and updates to your rss reader in an rss document called a feed, so you don't need to check all your favorite websites manually. learn more general knowledge rss on wikipedia technical reference latest specification ...
Reflow - MDN Web Docs Glossary: Definitions of Web-related terms
learn more google article "minimizing browser reflow" ...
SPA (Single-page application) - MDN Web Docs Glossary: Definitions of Web-related terms
this therefore allows users to use websites without loading whole new pages from the server, which can result in performance gains and a more dynamic experience, with some tradeoff disadvantages such as seo, more effort required to maintain state, implement navigation, and do meaningful performance monitoring. ...
TURN - MDN Web Docs Glossary: Definitions of Web-related terms
turn (traversal using relays around nat) is a protocol enabling a computer to receive and send data from behind a network address translator (nat) or firewall. turn is used by webrtc to allow any two devices on the internet to enter a peer-to-peer connection. learn more general knowledge turn on wikipedia webrtc protocols technical reference specification specification update for ipv6 ...
WebDAV - MDN Web Docs Glossary: Definitions of Web-related terms
webdav is rarely used alone, but two extensions are very common: caldav (remote-access calendar) and carddav (remote-access address book). webdav allows clients to add, delete, and retrieve webpage metadata (e.g. ...
WebSockets - MDN Web Docs Glossary: Definitions of Web-related terms
websocket is a protocol that allows for a persistent tcp connection between server and client so they can exchange data at any time. any client or server application can use websocket, but principally web browsers and web servers. through websocket, servers can pass data to a client without prior client request, allowing for dynamic content updates. learn more general knowledge websocket on wikipedia technical reference websocket reference on mdn learn about it writing websocket client applications writing websocket servers ...
XInclude - MDN Web Docs Glossary: Definitions of Web-related terms
request2.open('get', href, false); request2.setrequestheader('if-modified-since', 'thu, 1 jan 1970 00:00:00 gmt'); request2.setrequestheader('cache-control', 'no-cache'); request2.send(null); response = request2[responsetype]; // update the response for processing } // replace xinclude with the response as text var textnode = docu.createtextnode(response); xincludeparent.replacechild(textnode, xinclude); } // replace xinclude in doc with response now (as plain text ...
Test your skills: CSS and JavaScript accessibility - Learn web development
accessibility 2 in this next task you are presented with a simple bit of content — just headings and paragraphs. there are accessibility issues with the colors and sizing of the text; we'd like you to: 1. explain what the problems are, and what the guidelines are that state the acceptable values for color and sizing. 2. select new values for the color and font-size that fix the problem. 3. update the css with these new values to fix the problem. 4. test the code to make sure the problem is now fixed. explain what tools or methods you used to select the new values and test the code. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. javascript accessibility 1 in our final t...
Test your skills: HTML accessibility - Learn web development
, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. html accessibility 1 in this task we will test your understanding of text semantics, and why they are good for accessibility. the given text is a simple information panel with action buttons, but the html is really bad. we want you to update it use appropriate semantic html. you don't need to worry too much about recreating the exact same look and text sizing, as long as the semantics are good. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. html accessibility 2 in the second task, you have a form containing three i...
Test your skills: WAI-ARIA - Learn web development
ript skilltest. as before, we have a simple app that presents a list of animal names. clicking one of the animal names causes a further description of that animal to appear in a box below the list. here, we are starting with a mouse- and keyboard-accessible version. the problem we have now is that when the dom changes to show a new decription, screenreaders cannot see what has changed. can you update it so that description changes are annouced by the screenreader? download the starting point for this task to work in your own editor or in an online editor. assessment or further help you can practice these examples in the interactive editors above. if you would like your work assessed, or are stuck and want to ask for help: put your work into an online shareable editor such as codepen,...
What is accessibility? - Learn web development
nd often, ideally running automated tests to pick up on programmatically detectable missing features (such as missing image alternative text or bad link text — see element relationships and context) and doing some testing with disabled user groups to see how well more complex site features work for them. for example: is my date picker widget usable by people using screen readers? if content updates dynamically, do visually impaired people know about it? are my ui buttons accessible using the keyboard and on touch interfaces? you can and should keep a note of potential problem areas in your content that will need work to make it accessible, make sure it is tested thoroughly, and think about solutions/alternatives. text content (as you'll see in the next article) is easy, but what about y...
Accessibility - Learn web development
to allow for accessible web experiences, but if misused they can significantly harm accessibility. this article outlines some css and javascript best practices that should be considered to ensure that even complex content is as accessible as possible. wai-aria basics following on from the previous article, sometimes making complex ui controls that involve unsemantic html and dynamic javascript-updated content can be difficult. wai-aria is a technology that can help with such problems by adding in further semantics that browsers and assistive technologies can recognize and use to let users know what is going on. here we'll show how to use it at a basic level to improve accessibility. accessible multimedia another category of content that can create accessibility problems is multimedia — vi...
Debugging CSS - Learn web development
f, you can edit their values. perhaps you want to see if another color looks better, or wish to tweak the size of something? devtools can save you a lot of time editing a stylesheet and reloading the page. with box1 selected, click on the swatch (the small colored circle) that shows the color applied to the border. a color picker will open up and you can try out some different colors; these will update in real time on the page. in a similar fashion, you could change the width or style of the border. adding a new property you can add properties using the devtools. perhaps you have realised that you don't want your box to inherit the <body> element's font size, and want to set its own specific size? you can try this out in devtools before adding it to your css file. you can click the closing...
Pseudo-classes and pseudo-elements - Learn web development
y words will fit on a line — as that will change if the screen width or font-size changes — it is impossible to robustly do this by adding html. the ::first-line pseudo-element selector will do this for you reliably — if the number of words increases and decreases it will still only select the first line. it acts as if a <span> was magically wrapped around that first formatted line, and updated each time the line length changed. you can see that this selects the first line of both paragraphs. combining pseudo-classes and pseudo-elements if you wanted to make the first line of the first paragraph bold you could chain the :first-child and ::first-line selectors together. try editing the previous live example so it uses the following css. we are saying that we want to select the first ...
How CSS works - Learn web development
ollowing css to it: span { border: 1px solid black; background-color: lime; } the browser will parse the html and create a dom from it, then parse the css. since the only rule available in the css has a span selector, the browser will be able to sort the css very quickly! it will apply that rule to each one of the three <span>s, then paint the final visual representation to the screen. the updated output is as follows: in our debugging css article in the next module we will be using browser devtools to debug css problems, and will learn more about how the browser interprets css. what happens if a browser encounters css it doesn't understand? in an earlier lesson i mentioned that browsers do not all implement new css at the same time. in addition, many people are not using the latest ...
Web fonts - Learn web development
ter the generator has finished processing, you should get a zip file to download — save it in the same directory as your html and css. implementing the code in your demo at this point, unzip the webfont kit you just generated. inside the unzipped directory you'll see three useful items: multiple versions of each font: (for example .ttf, .woff, .woff2, etc.; the exact fonts provided will be updated over time as browser support requirements change). as mentioned above, multiple fonts are needed for cross browser support — this is fontsquirrel's way of making sure you've got everything you need. a demo html file for each font — load these in your browser to see what the font will look like in different usage contexts. a stylesheet.css file, which contains the generated @font-face code ...
How do you make sure your website works properly? - Learn web development
why we didn't see the image. http statuses servers respond with a status message whenever they receive a request. here are the most common statuses: 200: ok the resource you asked for was delivered. 301: moved permanently the resource has moved to a new location. you won't see this much in your browser, but it's good to know about "301" since search engines use this information a lot to update their indexes. 304: not modified the file has not changed since the last time you asked for it, so your browser can display the version from its cache, resulting in faster response times and more efficient use of bandwidth. 403: forbidden you aren't allowed to display the resource. usually it has to do with a configuration mistake (e.g. your hosting provider forgot to give you access rights t...
How do you host your website on Google App Engine? - Learn web development
e app engine. creating a google cloud platform project to use google's tools for your own site or app, you need to create a new project on google cloud platform. this requires having a google account. go to the app engine dashboard on the google cloud platform console and press the create button. if you've not created a project before, you'll need to select whether you want to receive email updates or not, agree to the terms of service, and then you should be able to continue. enter a name for the project, edit your project id and note it down. for this tutorial, the following values are used: project name: gae sample site project id: gaesamplesite click the create button to create your project. creating an application each cloud platform project can contain one app engi...
How much does it cost to do something on the Web? - Learn web development
host with a full domain name, and spontaneous, less strategic, content on a free host service. professional website agencies and hosting if you desire a professional website, you will likely ask a web agency to do it for you. ...
What is a web server? - Learn web development
her a static or a dynamic web server. a static web server, or stack, consists of a computer (hardware) with an http server (software). we call it "static" because the server sends its hosted files as-is to your browser. a dynamic web server consists of a static web server plus extra software, most commonly an application server and a database. we call it "dynamic" because the application server updates the hosted files before sending content to your browser via the http server. for example, to produce the final webpages you see in the browser, the application server might fill an html template with content from a database. sites like mdn or wikipedia have thousands of webpages. typically, these kinds of sites are composed of only a few html templates and a giant database, rather than thousand...
HTML forms in legacy browsers - Learn web development
all web developers learn very quickly (and sometimes painfully) that the web is a very rough place for them. our worst curse is legacy browsers. okay, let's admit it, when we said "legacy browser" we all have in mind safari or old versions of internet explorer, but they are far from the only ones. in the mobile world, when neither the browser nor the os can be updated such as on older android phones or iphones, the stock browsers that don't update are also legacy browsers. dealing with this wilderness is part of the job. fortunately, there are a few tricks to know that can help you to solve most of the problems caused by legacy browsers. and html5 <input> types don't fail when not supported: they fall back to type=text. learn about the issues to understand common patterns, it helps t...
Sending forms through JavaScript - Learn web development
d send xml as an exchange format, which has since been superceded by json. but neither xml nor json fit into form data request encoding. form data (application/x-www-form-urlencoded) is made of url-encoded lists of key/value pairs. for transmitting binary data, the http request is reshaped into multipart/form-data. note: the fetch api is often used in place of xhr these days — it is a modern, updated version of xhr, which works in a similar fashion but has some advantages. most of the xhr code you'll see in this article could be swapped out for fetch. if you control the front-end (the code that's executed in the browser) and the back-end (the code which is executed on the server), you can send json/xml and process them however you want. but if you want to use a third party service, you ne...
Styling web forms - Learn web development
ment, one after another. overall layout first, we prepare by defining our @font-face rules, and all the basic styles set on the <body> and <form> elements. ...
JavaScript basics - Learn web development
s mozilla is cool, null. this happens because—when you cancel the prompt—the value is set as null. null is a special value in javascript that refers to the absence of a value. also, try clicking ok without entering a name. you should end up with a title that reads mozilla is cool, for fairly obvious reasons. to avoid these problems, you could check that the user hasn't entered a blank name. update your setusername() function to this: function setusername() { let myname = prompt('please enter your name.'); if(!myname) { setusername(); } else { localstorage.setitem('name', myname); myheading.innerhtml = 'mozilla is cool, ' + myname; } } in human language, this means: if myname has no value, run setusername() again from the start. if it does have a value (if the above st...
The web and web standards - Learn web development
imating things, or laying out a page in a certain way. as a simple example, the following code would turn our html paragraph red: p { color: red; } in the house analogy, css is like the paint, wallpaper, carpets and paintings you'd use to make the house look nice. javascript is the programming language we use to add interactivity to web sites, from dynamic style switching, to fetching updates from the server, right through to complex 3d graphics. 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 ...
Use JavaScript within a webpage - Learn web development
hardly ever predict just how long it will take for users or browsers to complete an process (especially asynchronous actions such as loading resources). keep animations subtle and brief with no flashing. flashing is annoying and can cause seizures. additionally, if an animation lasts more than a couple seconds, give the user a way to cancel it. let users initiate interactions. that means, don't update content, redirect, or refresh automatically. don't use carousels or display popups without warning. have a plan b for users without javascript. people may have javascript turned off to improve speed and security, and users often face network issues that prevent loading scripts. moreover, third-party scripts (ads, tracking scripts, browser extensions) might break your scripts. at a minimum,...
Video and audio content - Learn web development
s, just like they may not support all the same formats the desktop version does. on top of that, both desktop and mobile browsers may be designed to offload handling of media playback (either for all media or only for specific types it can't handle internally). this means media support is partly dependent on what software the user has installed. so how do we do this? take a look at the following updated example (try it live here, also): <video controls> <source src="rabbit320.mp4" type="video/mp4"> <source src="rabbit320.webm" type="video/webm"> <p>your browser doesn't support html5 video. here is a <a href="rabbit320.mp4">link to the video</a> instead.</p> </video> here we've taken the src attribute out of the actual <video> tag, and instead included separate <source> elements that poi...
HTML table basics - Learn web development
Learn › HTML › Tables › Basics
chine. the content of every table is enclosed by these two tags : <table></table>. add these inside the body of your html. the smallest container inside a table is a table cell, which is created by a <td> element ('td' stands for 'table data'). add the following inside your table tags: <td>hi, i'm your first cell.</td> if we want a row of four cells, we need to copy these tags three times. update the contents of your table to look like so: <td>hi, i'm your first cell.</td> <td>i'm your second cell.</td> <td>i'm your third cell.</td> <td>i'm your fourth cell.</td> as you will see, the cells are not placed underneath each other, rather they are automatically aligned with each other on the same row. each <td> element creates a single cell and together they make up the first row. every ...
How to contribute to the Learning Area on MDN - Learn web development
this backup is maintained by andrew sachen of realityripple software. it may see periodical improvements or updates, and may eventually even be cleaned up (and de-archived) for better uxp focus, but for now, it's a historical snapshot for reference, not a living website. ...
Choosing the right approach - Learn web development
peration multiple sequential operations multiple simultaneous operations no yes no (unless it is the same one) no code example the following function creates a new date() object, extracts a time string out of it using tolocaletimestring(), and then displays it in the ui. we then run it once per second using setinterval(), creating the effect of a digital clock that updates once per second (see this live, and also see the source): function displaytime() { let date = new date(); let time = date.tolocaletimestring(); document.getelementbyid('demo').textcontent = time; } const createclock = setinterval(displaytime, 1000); pitfalls the frame rate isn't optimized for the system the animation is running on, and can be somewhat inefficient. unless you need ...
General asynchronous programming concepts - Learn web development
ion dates in a separate worker thread. now when you click the button, the browser is able to display the paragraph before the dates have finished calculating. the first operation no longer blocks the second. asynchronous code web workers are pretty useful, but they do have their limitations. a major one is they are not able to access the dom — you can't get a worker to directly do anything to update the ui. we couldn't render our 1 million blue circles inside our worker; it can basically just do the number crunching. the second problem is that although code run in a worker is not blocking, it is still basically synchronous. this becomes a problem when a function relies on the results of multiple previous processes to function. consider the following thread diagrams: main thread: task a -->...
Manipulating documents - Learn web development
to expand on those features because they are a somewhat archaic and difficult way to manipulate style. there are much easier ways. the first way is to add inline styles directly onto elements you want to dynamically style. this is done with the htmlelement.style property, which contains inline styling information for each element in the document. you can set properties of this object to directly update element styles. as an example, try adding these lines to our ongoing example: para.style.color = 'white'; para.style.backgroundcolor = 'black'; para.style.padding = '10px'; para.style.width = '250px'; para.style.textalign = 'center'; reload the page and you'll see that the styles have been applied to the paragraph. if you look at that paragraph in your browser's page inspector/dom inspect...
Video and Audio APIs - Learn web development
if the current time is not within 3 seconds of the start of the video, we simply remove three seconds from the current time by executing media.currenttime -= 3. so in effect, we are rewinding the video by 3 seconds, once every 200 milliseconds. updating the elapsed time the very last piece of our media player to implement is the time elapsed displays. to do this we'll run a function to update the time displays every time the timeupdate event is fired on the <video> element. the frequency with which this event fires depends on your browser, cpu power, etc (see this stackoverflow post). add the following addeventlistener() line just below the others: media.addeventlistener('timeupdate', settime); now to define the settime() function. add the following at the bottom of your file: fun...
Client-side web APIs - Learn web development
of apis for controlling html and styling information that makes heavy use of the document object. in this article, we'll look at how to use the dom in detail, along with some other interesting apis that can alter your environment in interesting ways. fetching data from the server another very common task in modern websites and applications is retrieving individual data items from the server to update sections of a webpage without having to load an entirely new page. this seemingly small detail has had a huge impact on the performance and behavior of sites. in this article, we'll explain the concept, and look at technologies that make it possible, such as xmlhttprequest and the fetch api. third party apis the apis we've covered so far are built into the browser, but not all apis are. many l...
Test your skills: Math - Learn web development
line of code that takes result and formats it to 2 decimal places, storing the result of this in a variable called finalresult. check the data type of finalresult using typeof; you'll probably see that it is actually of string type! write a line of code that converts it to a number type, storing the result in a variable called finalnumber. the value of finalnumber needs to be 10.42. go back and update the original calculations you were provided with so that they give this final result. don't update the numbers or the operators. download the starting point for this task to work in your own editor or in an online editor. math 3 in the final task for this article, we want you to write some tests. you've got three groups, each consisting of a statement and two variables. for each one, writ...
Test your skills: Strings - Learn web development
e green eggs and ham.", and store it in a variable called revisedquote. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. strings 3 in the next string task, you are given the same quote that you ended up with in the previous task, but it is somewhat broken! we want you to fix and update it, like so: change the casing to correct sentence case (all lowercase, except for upper case first letter). store the new quote in a variable called fixedquote. in fixedquote, replace "green eggs and ham" with another food that you really don't like. there is one more small fix to do — add a full stop onto the end of the quote, and save the final version in a variable called finalquote. ...
Storing the information you need — Variables - Learn web development
se reasons and more, we recommend that you use let as much as possible in your code, rather than var. there is no reason to use var, unless you need to support old versions of internet explorer with your code (it doesn't support let until version 11; the modern windows edge browser supports let just fine). updating a variable once a variable has been initialized with a value, you can change (or update) that value by simply giving it a different value. try entering the following lines into your console: myname = 'bob'; myage = 40; an aside on variable naming rules you can call a variable pretty much anything you like, but there are limitations. generally, you should stick to just using latin characters (0-9, a-z, a-z) and the underscore character. you shouldn't use other characters becaus...
Solve common problems in your JavaScript code - Learn web development
? what are strings? what is an array? what is a loop? what is a function? what is an event? what is an object? what is json? what is a web api? what is the dom? basic use cases general how do you add javascript to your page? how do you add comments to javascript code? variables how do you declare a variable? how do you initialize a variable with a value? how do you update a variable's value? (also see assignment operators) what data types can values have in javascript? what does 'loosely typed' mean? math what types of number do you have to deal with in web development? how do you do basic math in javascript? what is operator precedence, and how is it handled in javascript? how do you increment and decrement values in javascript? how do you compare valu...
Inheritance in JavaScript - Learn web development
the source code, you'll also see bio() and farewell() methods defined. later you'll see how these can be inherited by other constructors. say we wanted to create a teacher class, like the one we described in our initial object-oriented definition, which inherits all the members from person, but also includes: a new property, subject — this will contain the subject the teacher teaches. an updated greeting() method, which sounds a bit more formal than the standard greeting() method — more suitable for a teacher addressing some students at school. defining a teacher() constructor function the first thing we need to do is create a teacher() constructor — add the following below the existing code: function teacher(first, last, age, gender, interests, subject) { person.call(this, fi...
Working with JSON - Learn web development
we are going to load it into our page, and use some nifty dom manipulation to display it, like this: obtaining the json to obtain the json, we use an api called xmlhttprequest (often called xhr). this is a very useful javascript object that allows us to make network requests to retrieve resources from a server via javascript (e.g. images, text, json, even html snippets), meaning that we can update small sections of content without having to reload the entire page. this has led to more responsive web pages, and sounds exciting, but it is beyond the scope of this article to teach it in much more detail. to start with, we store the url of the json we want to retrieve in a variable. add the following at the bottom of your javascript code: let requesturl = 'https://mdn.github.io/learning-a...
Test your skills: Object basics - Learn web development
ure out the answer (or into the browser's javascript console, in the case of the downloadable version). object basics 1 in this task you are provided with an object literal, and your tasks are to store the value of the name property inside the catname variable, using bracket notation. run the greeting() method using dot notation (it will log the greeting to the browser devtools' console). update the color property value to black. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. object basics 2 in our next task, we want you to have a go at creating your own object literal to represent one of your favourite bands. the required members are: name: a string representing t...
JavaScript — Dynamic client-side scripting - Learn web development
looking to become a front-end web developer? we have put together a course that includes all the essential information you need to work towards your goal. ...
Measuring performance - Learn web development
ber of different tools available to help you improve performance. these can generally be classified into two categories: tools that indicate or measure performance, such as pagespeed insights or the firefox network monitor and performance monitor. these tools show you how fast or slow your web app or site load. they also indicate areas that can be improved to optimize your web app. tools that update code so that your web app or site will perform better. for example, bundling tools pack your code into single files to reduce the number of http requests or minifiers that remove all whitespace from your code to make the files smaller. we'll talk about both categories in this course. and as well as talking about performance metrics we will of course talk about the metrics that you'll use to mea...
Perceived performance - Learn web development
e user feels, but metrics are useful in guaging improvements (and regressions). relevant measurements include first meaningful paint (fmp), largest contentful paint (lcp), time to interactive (tti), render start, dom interactive, and speed index. first paint is reported by the browser and provides the time, in ms, of when the page starts changing; but this change can be a simple background color update or something even less noticable. it doesn’t indicate completeness and may report a time when nothing visible is painted. first contentful paint (fcp) reports the time when the browser first rendered anything of signifigance, be that text, foreground or background image, or a canvas or svg; capturing the very beginning of the loading experience. but, just because there's content, doesn't mean i...
Learning area release notes - Learn web development
ding what kind of tools exist, the command line, package managers, and how to assemble your own functioning tool chain. march 2020 you'll now find "test your skills" assessments accompanying the articles in the following modules: css building blocks javascript first steps javascript building blocks introducing javascript objects january 2020 the html forms module has been significantly updated: it has been retitled web forms, and moved out of the html topic area to recognise that it covers more than just html form elements — it also covers styling, validation, the basics of how to send data and process it on the server, and more besides. it has new examples available and techniques covered. it has a new structure to make for a more effective learning experience. more "test yo...
Server-side web frameworks - Learn web development
$', views.index), # example: /best/myteamname/5/ url(r'^best/(?p<team_name>\w.+?)/(?p<team_number>[0-9]+)/$', views.best), ] make it easy to access data in the request data can be encoded in an http request in a number of ways. an http get request to get files or data from the server may encode what data is required in url parameters or within the url structure. an http post request to update a resource on the server will instead include the update information as "post data" within the body of the request. the http request may also include information about the current session or user in a client-side cookie. web frameworks provide programming-language-appropriate mechanisms to access this information. for example, the httprequest object that django passes to every view function cont...
Server-side website programming - Learn web development
es use some kind of server-side technology to dynamically display data as required. for example, imagine how many products are available on amazon, and imagine how many posts have been written on facebook. displaying all of these using different static pages would be extremely inefficient, so instead such sites display static templates (built using html, css, and javascript), and then dynamically update the data displayed inside those templates when needed, such as when you want to view a different product on amazon. in the modern world of web development, learning about server-side development is highly recommended. learning pathway getting started with server-side programming is usually easier than client-side development, because dynamic websites tend to perform a lot of very similar opera...
React resources - Learn web development
n testing create-react-app provides some tools for testing your application out of the box — you may have deleted the relevant files earlier in the tutorial. the documentation for create-react-app covers some basics for testing. routing while routing is traditionally handled by a server and not an application on the user's computer, it is possible to configure a web application to read and update the browser's location, and render certain user interfaces. this is called client-side routing. it's possible to create many unique routes for your application (such as /home, /dashboard, or login/). the react community has produced two major libraries for client-side routing: react router and reach router. react router is well-suited to applications with complex routing needs, and it meets s...
Getting started with Vue - Learn web development
as the attributes, custom components, and data-management. development script (unoptimized, but includes console warnings. great for development <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> production script (optimized version, minimal console warnings. it is recommended that you specify a version number when including vue on your site so that any framework updates do not break your live site without you knowing.) <script src="/static/external/29/29296ccacaa9ed35ed168fc51e36f54fd6f8db9c7786bbf38cc59a27229ba5c2.svg"></script> however, this approach has some limitations. to build more complex apps, you’ll want to use the vue npm package. this will let you use advanced features of vue and take advantage of bundlers like webpack. to make building apps...
Rendering a list of Vue components - Learn web development
component attributes. this means we can pass the fields of our item objects to our todoitem component — just remember to use the v-bind syntax. this is really useful, as we want our todo items to display their label properties as their label, not a static label of "my todo item". in addition, we want their checked status to reflect their done properties, not always be set to done="false". ...
Introduction to automated testing - Learn web development
that node comes with node package manager (npm), which allows you to easily install packages, share your own packages with others, and run useful scripts on your projects. once the install completes, test that node is installed by typing the following into the terminal, which returns the installed versions of node and npm: node -v npm -v if you've got node/npm already installed, you should update them to their latest versions. to update node, the most reliable way is to download and install an updated installer package from their website (see link above). to update npm, use the following command in your terminal: npm install npm@latest -g note: if the above command fails with permissions errors, fixing npm permissions should sort you out. to start using node/npm-based packages on...
Strategies for carrying out testing - Learn web development
least some of the browsers you should test. this can form a good basis for a support chart. for example, if you live in western europe or north america, you will know that a lot of people use windows and mac desktops/laptops, where the main browsers are chrome, firefox, safari, ie, and edge. you probably want to just test the latest versions of the first three, as these browsers receive regular updates. for edge and ie, you probably want to test the last couple of versions; these should all go in the a grade tier. note: you can only have one version of ie or edge installed on a machine at once, so you will probably have to use virtual machine, or other strategy to do the testing you need. see virtual machines later on. lots of people use ios and android, so you probably also want to test t...
Command line crash course - Learn web development
rs tucked away in the cloud (it’s not really a cloud), to microcomputers like the raspberry pi zero, and even to mobile phones. it provides direct access to the computer’s underlying file system and low-level features, and is therefore incredibly useful for performing complex tasks rapidly, if you know what you are doing. it is also useful for automation — for example to write a command to update the titles of hundreds of files instantly, say from “ch01-xxxx.png” to “ch02-xxxx.png”. if you updated the file names using your finder or explorer gui app, it would take you a long time. anyway, the terminal is not going away anytime soon. what does the terminal look like? below you can see some of the different flavours of programs that are available that can get you to a terminal. ...
Introducing a complete toolchain - Learn web development
error that reads error: enoent: no such file or directory, stop the process using ctrl + c and then try re-running it. the server is now running on the url that was printed (in this case localhost:1234). go to this url in your browser and you will see the example app running! another clever trick parcel has up its sleeve is that any changes to your source code will now trigger an update in the browser. to try this out: load up the file src/components/app.js in your favorite text editor. search for the text "near misses", and replace it with something silly like "flying pigs". save the file, then go straight back to the app running in your browser. you’ll notice that the browser has automatically refreshed, and the line “<date> there will be <number> near mi...
Client-side tooling overview - Learn web development
package manager to manage your dependencies for example, it is a good idea to go to the npm homepage and search for the type of tool you are looking for, for example try searching for "date" if you want a date formating utility, or "formatter" if you are searching for a general code formatter. pay attention to the popularity, quality, and maintenance scores, and how recently the package was last updated. also click through to the tool pages to find out how many monthly downloads a package has, and whether it has good documentation that you can use to figure out whether it does what you need it to do. based on these criteria, the date-fns library looks like a good date formatting tool to use. you'll see this tool in action and learn more about package managers in general in chapter 3 of this mod...
Mozilla accessibility architecture
ogram shutdown, when the nsaccessibilityservice observes ns_xpcom_shutdown_observer_id, it iterates through the doc accessibles in gglobaldocaccessiblecache and destroys all of the doc accessibles them. challenges of the accessibility cache there are some tricky issues when dealing with the accessibility cache: remaining valid: changes in a given document, or the destruction of documents must update or shutdown parts of the cache. we use dom mutation events to listen for document changes, and invalidate the appropriate part of each cache. we must be careful: if the dom mutation events are incomplete, then our cache will not be a correct mirror of the dom. if we do not shut down nodes that go away, we cause more memory footprint than necessary. accessibles with no dom node: some accessible ...
Accessibility information for UI designers and developers
for this, as they are often too low in contrast. it is more helpful to describe what an input element is for in text just above or underneath the input. error recovery when you detect users provide unexpected input, explain what is wrong and, if possible, how to correct it. this is specifically important in these cases: the user input is about legal commitments or financial transactions it updates or removes the user's data in a system when recording tests responses in those cases, ensure users can change submissions, automatically check for errors. or provide an opportunity to review the input before submitting it. use default controls controls that are built into browsers come with a lot of accessibility for free. for example, the select element displays an ideal mobile interface o...
Mozilla’s UAAG evaluation report
s a very rich set of accessibility guidelines, that broadly define how accessibility should be implemented by any user agent, i.e. software that renders web content. the uaag is not the basis for any government accessibility regulations at this time. this document is based on the september 12, 2001 candidate recommendation of uaag 1.0. this may be different from the most recent version, check for updates on the user agent working group home page. look to the "techniques" document for real-world implementation examples of each checkpoint. this uaag evaluation report covers nightly builds of the mozilla web browser itself, running on windows 2000, as of february 20, 2002. we are claiming to support html 4, css 2, png, jpg and gif. this evaluation does not cover mailnews or composer. there may be a...
Obsolete
this page contains theme documents and resources that we don't expect will ever be updated, but which we're keeping for the time being as potential source material for updated docs. creating a skin for firefox uuid contents.rdf install.rdf theme changes in firefox 2 theme changes in firefox 3 theme changes in firefox 3.5 theme changes in firefox 4 building a theme common theme issues and their solutions making sure your theme works with rtl locales creating a skin for seamonkey 2 dom inspector inspectorwidget force rtl yet another theme tutorial ...
Adding a new word to the en-US dictionary
...
Adding phishing protection data providers
.lookupurl the url to use to look up urls to see if they're block-listed. this request must be encrypted using the private key returned by the keyurl request. optional preferences browser.safebrowsing.provider.idnum.reporturl an url used for reporting when users visit phishing pages and whether or not they decided to heed the warning or to ignore it. browser.safebrowsing.provider.idnum.updateurl an url used to request an updated list of phishing sites. the server either provides a full list or incremental updates in order to bring the client's tables up to date. browser.safebrowsing.provider.idnum.reportgenericurl not currently used; intended for use in reporting other issues with the phishing protection service. browser.safebrowsing.provider.idnum.reporterrorurl an url to ...
A bird's-eye view of the Mozilla framework
it examines what happens when the user performs a simple user interface (ui) action such as clicking a link in the contents panel of the help viewer window shown below. the article focuses on the architecture of the overall framework supporting the mozilla application suite, not the architecture of the individual applications themselves. prerequisites this article assumes you have access to mozilla sources and are familiar with the directory structure of the source tree. ...
Chrome registration
chanism to automatically protect their code against malicious content that they might access. see safely accessing content dom from chrome for details. this flag is enabled by default since firefox 1.5. disabling it manually was possible by specifying xpcnativewrappers=no until firefox 4. note: support for this flag has been removed in gecko 2.0. you can no longer disable xpcnativewrappers. to update your add-on to work without this flag: if your add-on depends upon xbl bindings attached to content objects (that is, it needs to be able to call functions or get and set properties created by the xbl binding), you'll need to use the object's wrappedjsobject property to obtain a wrapped object. if you need to call functions or access properties defined by the content -- for example, if your a...
Cookies Preferences in Mozilla
f for users with older profiles (before mozilla 1.7). if you have the old-style prefs, they will be migrated when starting the application. (the old prefs are network.cookie.lifetime.enabled, network.cookie.lifetime.behavior, and network.cookie.warnaboutcookies.) true = prefs have been migrated false = migrate prefs on next startup original document information author(s): mike connor last updated date: may 22, 2004 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Cookies in Mozilla
suggestions as to needed documentation can be directed to mike connor. creating a cookie log steps to create and attach a cookie log in order to aid in triaging a bug in cookies. cookies preferences in mozilla documentation on what the preferences used by the cookies code actually do. original document information author(s): mike connor last updated date: march 15, 2004 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Creating a Language Pack
ed. let's unpack it $ make unpack again, for 64-bit mac, append moz_pkg_platform=mac to this command. at the end of the process, you should see the following success message. ... done unpacking let's check which revision the binary was built from. $ make ident fx_revision 237dccbcb967 buildid 20091126033851 you can now go back to your source hg clone. $ cd ../../../mozilla-aurora and update the source code to this revision. $ hg update -r 237dccbcb967 3 files updated, 0 files merged, 0 files removed, 0 files unresolved the source code has been updated to the revision the binary was built from. let's go to the build directory again and continue the repacking. $ cd ../obj-firefox-build/browser/locales we will now merge the localized files from x-testing locale with the en-us fil...
Creating reftest-based unit tests
ly one part of testing rendering. another part is testing invalidation - testing that when a document is changed after it has finished loading and displaying, that the browser correctly "invalidates" the parts of the screen that should change so that the screen displays the correct output the next time it is repainted. invalidation tests check both that the internal state of the document has been updated correctly, and that the browser then correctly invalidates and repaints the appropriate parts of the screen. in order to test invalidation it is important that invalidation tests let the document completely finish loading and displaying before making the changes for which invalidation and repainting is to be tested. making the changes before the document has completely finished loading and pain...
Creating Sandboxed HTTP Connections
topic. adata: null for the two topics. since the observers get notified for the registered topic for any connection, the listener needs to make sure that the notification is for the http connection our code created. 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). // create an nsiobserver implementor var listener = { observe : function(asubject, atopic, adata) { // make sure it is our connection first. if (asubject == gchannel) { var httpchannel = asubject.queryinterface(components.interfaces.nsihttpchannel); if (atopic == "http-on-modify-request") { // ... } else if (atopic == "http-on-...
Debugging Frame Reflow
ike stray lines. os2 is very vulnerable to pixel alignment errors as text is drawn on pixel boundaries. gecko_display_reflow_indent_undisplayed_frames setting this option via set gecko_display_reflow_indent_undisplayed_frames = 1 will cause an advance of the indent even for frames which are blocked via the reflow rules file. original document information author(s): bernd mielke last updated date: december 4, 2004 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Debugging JavaScript
...
Debugging Table Reflow
ump** colindex=3 isanonymous=0 constraint=0 widths=360 540 -1 -1 -1 -1 -1 -1 -1 465 **end col dump** ***end table dump*** the column dump is implemented in nstablecolframe.cpp in the routine:void nstablecolframe::dump(print32 aindent). debug_table_reflow_timing needs to be written original document information author(s): bernd mielke other contributors: bernd mielke, josh soref last updated date: november 20, 2005 ...
Debugging on Mac OS X
setting it up. note also that since xcode 7.3.1 it doesn't seem to be possible to have the xcode project live outside the source tree. if you try to do that then xcode will simply copy the source files under the project directory rather than link to them (still the case in xcode 10?) which breaks debugging and the possibility to modify-rebuild-relaunch from inside xcode. these steps were last updated for xcode 10.3: open xcode, and create a new project with file > new project. select the "cross-platform" tab then under the "other" template group select the "empty" project type. the click next. name the project and click next. create/select a temporary directory to contain the project and then click create. before going any further, close the project (file > close project) and open finder...
Debugging on Windows
the interrupt code in memory (which causes you to break into debugger) to be a nop (no operation). you do this by running the program in the debugger until you hit an assertion. you should see some assembly code. one assemly code instruction reads "int 3". check the memory address for that line. now open memory view. type/copy/drag the memory address of "int 3" into the memory view to get it to update on that part of the memory. change the value of the memory to "90", close the memory view and hit "f5" to continue. confused? see the screenshot below: vc++ 7.0? automatically handling assertions without a debugger attached when an assertion happens and there is not a debugger attached, a small helper application (windbgdlg.exe) is run. that application can automatically select a response t...
Debugging
orted tools that you can use when debugging. documentation topics debugging on top of the mozilla platform debugging javascript code how to debug javascript code, with a focus on debugging code in the mozilla project itself. debugging a xulrunner application tips and suggestions that will help you debug your xulrunner based application. debugging update problems learn how to debug update problems in mozilla-based applications. debugging the mozilla platform using debuggers with mozilla debugging mozilla on windows faq questions (and answers) about debugging mozilla on windows. debugging mozilla on os x questions (and answers) about debugging mozilla on os x. debugging mozilla with gdb gdb i...
Configuring Build Options
s --enable-warnings-as-errors this makes compiler warnings into errors which fail the build. this can be useful since certain warnings coincide with reviewbot lints which must be fixed before merging. ac_add_options --with-ccache=/path/to/.mozbuild/sccache/sccache this enables sccache to speed up builds. this saves a considerable amount of time directly after a clobber build, so pulling in new updates and rebasing is less time-consuming. example mozconfig files mozilla's official builds use mozconfig files from the appropriate directory within each repository. warning: these mozconfig files are taken from production builds and are provided as examples only. it is recommended to use the default build options, and only change the properties from the list above as needed. the production...
Old Thunderbird build
object directory name of obj-x86_64-apple-darwin10.7.3/. the thunderbird executable in particular, and its dependencies, are located under the dist/bin folder under the object directory. to run the executable from your comm-central working directory: windows: obj-.../dist/bin/thunderbird.exe linux: obj-.../dist/bin/thunderbird os x: obj-.../dist/daily.app/contents/macos/thunderbird how to update and build again in your comm-central directory, run the same command as before: python client.py checkout then just re-run the mach command above. this will only recompile files that changed, but it's still a long haul. rebuilding to build after making changes, run ./mozilla/mach build again. this will only rebuild what is necessary for these changes. it is also possible to rebuild speci...
Simple Instantbird build
directory name of obj-x86_64-apple-darwin10.7.3/. the instantbird executable in particular, and its dependencies, are located under the dist/bin folder under the object directory. to run the executable from your comm-central working directory: windows: obj-.../dist/bin/instantbird.exe linux: obj-.../dist/bin/instantbird os x: obj-.../dist/instantbird.app/contents/macos/instantbird how to update and build again simply re-run the mach command above. this will only recompile files that changed. incremental builds when you are working on your own patches, an incremental build is often enough, and is very fast indeed. this will only rebuild a particular folder. so, for instantbird, you would run mach build im which has been configured to automatically rebuild /chat as well. upstream ch...
Simple Thunderbird build
object directory name of obj-x86_64-apple-darwin10.7.3/. the thunderbird executable in particular, and its dependencies are located under the dist/bin folder under the object directory. to run the executable from your comm-central working directory: windows: obj-.../dist/bin/thunderbird.exe linux: obj-.../dist/bin/thunderbird macos: obj-.../dist/daily.app/contents/macos/thunderbird how to update and build again in your source directory: hg pull -u cd comm hg pull -u cd .. or same commands shorter: hg pull -u; (cd comm; hg pull -u) then just re-run the mach command above. this will only recompile files that changed, but it's still a long haul. rebuilding to build after making changes, run ./mach build again. this will only rebuild what is necessary for these changes. it is als...
The Firefox codebase: CSS Guidelines
copy-pasting older code, it happens that the code in question contains unnecessary overrides. this could be because the css that it was overriding got removed in the meantime. in this case, simply dropping the override should work. it is also good practice to look at whether the rule you are overriding is still needed: maybe the ux spec for the component has changed and that rule can actually be updated or removed. when this is the case, don't be afraid to remove or update that rule. once the two things above have been checked, check if the other rule you are overriding contains !important, if that is case, try putting it in question, because it might have become obsolete. afterwards, check the specificity of the other selector; if it is causing your rule to be overriden, you can try reducing...
Eclipse CDT Manual Setup
ifferent things (we'll get to the details below). whenever you create a new workspace for a mozilla source tree, you should be sure to turn off the following two settings in the workspace preferences (window > preferences, or eclipse > preferences) before creating a project in that workspace: in "general > workspace", disable "build automatically" in "c/c++ > indexer", disable "automatically update the index" turning off automatic indexing prevents the cpu intensive indexer from running at various stages during the steps below before we're ready. select "general > content types", expand "text > c source file > c++ source file", click "add" and add "*.mm". eclipse cdt doesn't currently understand objective-c files (although there is a project that promises to add objective-c support), so ...
Reviewer Checklist
and volatility; livelock and deadlock; ownership. [fennec: all view methods should be touched only on ui thread.] [fennec: activity lifecycle awareness (works with "never keep activities"). also test with oom-fennec (https://hg.mozilla.org/users/blassey_mozilla.com/oom-fennec/)]. compatibility version files, databases, messages tag messages with ids to disambiguate callers. idl uuids are updated when the interface is updated. android permissions should be 'grouped' into a common release to avoid breaking auto-updates. android apis added since froyo should be guarded by a version check. preffability if the feature being worked on is covered by prefs, make sure they are hooked up. if working on a new feature, consider adding prefs to control the behavior. consider adding prefs to...
Developer guide
d instructions how to build firefox, thunderbird, seamonkey, or other mozilla applications. development process overview an overview of the entire mozilla development process. managing multiple profiles when working with prerelease versions of firefox, it's often helpful to have multiple firefox profiles, such as one for each channel, or for different kinds of testing. getting documentation updated how to ensure that documentation is kept up to date as you develop. mozilla modules and module ownership this article provides information about mozilla's modules, what the role of a module owner is, and how module owners are selected. code snippets useful code samples for a wide variety of things you might need to figure out how to do. mozilla development strategies tips for how to make ...
Experimental features in Firefox
sically functional. see bug 840640 for more details. release channel version added enabled by default? nightly 53 yes developer edition 53 no beta 53 no release 53 no preference name dom.dialog_element.enabled global attribute: inputmode our implementation of the inputmode global attribute has been updated as per the whatwg spec (bug 1509527), but we still need to make other changes too, like making it available on contenteditable content. see also bug 1205133 for details. release channel version added enabled by default? nightly 75 yes developer edition 75 no beta 75 no release 75 no preference name dom.fo...
Limitations of chrome scripts
laces where your add-on uses compatibility shims by setting the dom.ipc.shims.enabledwarnings preference and watching the browser console as you use the add-on. the rest of this page documents patterns that don't work in multiprocess firefox as well as how are shims try to paper over the problem. for each pattern we've noted: whether a shim exists and what kind of behavior it provides how to update your add-on so you don't need the shim gbrowser.contentwindow, window.content... without the shim all apis in the chrome process that provide direct access to content objects will no longer work. for example: // chrome code gbrowser.contentwindow; // null gbrowser.contentdocument; // null gbrowser.selectedbrowser.contentwindow; // null window.conten...
Communicating with frame scripts
me event, and keep the browser message manager in an array, so we can send it messages: var messagemanagers = []; ... ...
Multiprocess Firefox
ate between chrome code and web content. cross process object wrappers cross process object wrappers are a migration aid, giving chrome code synchronous access to web content. limitations of chrome scripts practices that will no longer work in chrome code, and how to update them. limitations of frame scripts practices that will not work inside frame scripts, and what to do instead. ...
Storage access policy: Block cookies from trackers
will not be included in this documentation, but may nevertheless impact the functionality of domains classified as trackers. we recommend sites test with firefox nightly, as this includes the newest version of our protections. as described above, note that nightly may include additional protections that end up getting removed or changed before they reach our release users. we’ll keep this page updated with the newest information as we strengthen our protections. these protections are on by default in nightly. the cookie policy can be enabled in other versions of firefox through the content blocking settings (these steps will vary by version; the linked documentation includes a dropdown to select the appropriate firefox version). report broken sites if you find a website broken as a result ...
Security best practices for Firefox front-end engineers
n with template strings, for example: bar.innerhtml = escapehtml`<a href='${url}'>about</a>`; in system-privileged chrome code, any kind of remaining scripts will still be removed by our sanitizer. appendix list of disallowed dom apis innerhtml outerhtml insertadjacenthtml() createcontextualfragment() document.write() document.writeln() please take a look at the repository for an updated list ...
Firefox and the "about" protocol
see firefox reader view for clutter-free web pages about:rights displays rights information about:robots special page showing notes about robots about:serviceworkers displays currently running service workers about:studies lists the shield studies that are installed ...
mozbrowsercaretstatechanged
se.) cancut: a boolean indicating whether the cut command is available (true) or not (false.) cancopy: a boolean indicating whether the copy command is available (true) or not (false.) canpaste: a boolean indicating whether the paste command is available (true) or not (false.) reason a domstring that defines the reason for the state being changed. possible values are visibilitychange, updateposition, longpressonemptycontent, taponcaret, presscaret, and releasecaret. zoomfactor a number defining the current zoom factor in the browser <iframe>. collapsed a boolean indicating whether the current selection is collapsed (true) or not (false.) caretvisible a boolean indicating whether the caret is currently visible (true) or not (false.) selectionvisible a boolean indicating whethe...
mozbrowserloadend
n the firefox os platform. although implementations may change in the future and it is not supported widely across browsers, it is suitable for use in code dedicated to firefox os apps. the mozbrowserloadend event is fired when the browser <iframe> has finished loading all its assets, or has failed to load. this can be used when the embedder wants to stop spinning a loading indicator, or update the ui in some other way to indicate loading is complete. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles r...
mozbrowserloadstart
t on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the mozbrowserloadstart event is fired when the browser <iframe> starts to load a new page. this can be used when the embedder wants to start spinning a loading indicator, or update the ui in some other way to indicate loading has started. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring t...
mozbrowserlocationchange
rty returns an anonymous javascript object with the following properties: url a domstring representing the url of the new location. cangoback a boolean that defines whether it's possible to go back in the navigation history (true) or not (false). cangoforward a boolean that defines whether it's possible to go forward in the navigation history (true) or not (false). example this example updates the url bar so that it will always display the correct url for the current location. var browser = document.queryselector("iframe"); browser.addeventlistener('mozbrowserlocationchange', function (event) { urlbar.value = event.detail.url; }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserlo...
Overview of Mozilla embedding APIs
terface definition: nsiclipboardcommands interface status... ...
Roll your own browser: An embedding how-to
back end wed to a cocoa front end. ...
Gecko SDK
and tools used to develop general xpcom components which add functionality to the existing platform, whereas xulrunner is a framework which can be used to run standalone or embedded applications based on the mozilla framework. the gecko sdk contains all of the necessary tools and headers for making scriptable npapi plugins including the xpidl compiler/linker and the latest npapi.h. get the sdk updates there is no need to download or rebuild the gecko sdk corresponding to security updates of mozilla (e.g., mozilla 1.7.3) since the headers and glue libs in the gecko sdk are usually not changed as a result of security updates. you do have to get and distribute the newest gecko components (gklayout.dll etc.), though. downloading for gecko versions before 2.0, you should choose the gecko sdk ve...
Gecko's "Almost Standards" Mode
ttempting to migrate to validated markup using either html 4.01 or xhtml 1.0, and who are still using image-in-table design concepts, make sure to use a doctype that will trigger "almost standards" mode. also on mdc images, tables, and mysterious gaps mozilla's doctype sniffing mozilla's quirks mode original document information author(s): eric a. meyer, netscape communications last updated date: published 08 nov 2002 copyright information: copyright © 2001-2003 netscape. all rights reserved. note: this reprinted article was originally part of the devedge site. ...
Hacking with Bonsai
ok place. before the tree is opened, there is a car pool lane where people who have been off on a branch and need a stable tip to merge in can pull the tip for their merge. these people, when they check in, will be "on the hook" for the next day's build. the car pool lane is only available to those who arrange access ahead of time with the release team. when the tree is re-opened, the web page is updated and the hook is cleared. use the bonsai query tool to see what's been checked in to the tree lately and to look at differences between versions. read the introduction to bonsai for more information about queries. the rules no checkins when the tree is closed unless you are fixing a build problem at the request of a build person. if you are on the hook, your top priority is to be available to t...
How Mozilla determines MIME Types
d, this is where the application in the "open with" field comes from, and also where the description of the type comes from. if this also failed, the extras are searched again, and will supply the extension-list and a description of the mime type. related information document loading - from load start to finding a handler original document information author(s): christian biesinger last updated date: march 7, 2005 copyright information: copyright (c) christian biesinger ...
Implementing QueryInterface
d(nsiy)) ) foundinterface = ns_static_cast(nsiy*, this); // ...as many cases as needed... else if ( aiid.equals(ns_get_iid(nsisupports)) ) // ... thanks special thanks to heikki toivonen, chris waterson, and john bandhauer for valuable feedback that significantly improved the implementations presented here. original document information author(s): scott collins last updated date: may 8, 2003 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Integrated Authentication
s the trusted sites to use ntlm authentification. if you wish to use non-fully-qualified entries of the form mydomain.com in the above preferences for ntlm and spnego authentication, you will also need to set the preferences network.automatic-ntlm-auth.allow-non-fqdn and network.negotiate-auth.allow-non-fqdn (respectively) to true. original document information author(s): darin fisher last updated date: december 27, 2005 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Internationalized Domain Names (IDN) Support in Mozilla Browsers
ge number of sites making it easier for average internet users to find web sites. ...
JavaScript-DOM Prototypes in Mozilla
will be set up by the resolving code (nswindowsh::globalresolve()). ...
AddonInstall
size of any necessary downloads or -1 if unknown. certificate nsix509cert if the add-on to be installed is signed this is the certificate of the signer. only available after downloading is complete. certname string if the add-on to be installed is signed this is the simple display name of the signer. existingaddon addon the addon that this install will update. may be null if it isn't updating anything installed. this is guaranteed to be correct after downloading is complete but may be set earlier. addon addon the full addon that this install will install. only available after downloading is complete. methods install() starts or continues the install process. the process will continue in the background until it fails, completes,...
AddonListener
ers addon the addon that has been uninstalled onoperationcancelled() called when a pending operation for an add-on is cancelled. void onoperationcancelled( in addon addon, ) parameters addon the addon that has had a pending operation cancelled onpropertychanged() called when one or more properties of addon has changed. only applies to the following properties: applybackgroundupdates void onpropertychanged( in addon addon, in string properties[] ) parameters addon the addon that has had its properties changed properties an array of the names of properties that changed. ...
Download
contenttype string the mime type of the download, for example "text/plain", or null if the mime type is not available. this property may be populated or changed while the download is in progress, using the mime type provided by the server. currentbytes read only number number of bytes currently transferred. this value starts at zero, and may be updated regardless of the value of hasprogress. note: you shouldn't rely on this property being equal to totalbytes to determine whether the download is completed. you should use the individual state properties instead, since this value may not be updated after the last piece of data is transferred. error read only downloaderror when the download fails, this is set to a downloa...
DownloadList
load adownload); promise addview(object aview); promise removeview(object aview); void removefinished([optional] function afilterfn); methods getall() retrieves a snapshot of the downloads that are currently in the list. the returned array does not change when downloads are added or removed, though the download objects it contains are still updated in real time. promise<array<download>> getall(); parameters none. promise resolves to an array of download objects. add() adds a new download to the end of the items list. note: when a download is added to the list, its onchange event is registered by the list, thus it cannot be used to monitor the download. to receive change notifications for downloads that are added to the list, use the ad...
PopupNotifications.jsm
secondaryactions, options); properties attribute type description ispanelopen boolean returns true if the notification panel is currently visible, false if it is not. methods locationchange() the consumer can call this method to let the popup notification module know that the current browser's location has changed. this lets the notification service update the active notifications as appropriate. note: you shouldn't need to call this when using the popupnotifications object in firefox windows; firefox code takes care of this automatically. void locationchange(); parameters none. getnotification() retrieve a notification object associated with the browser/id pair. notification getnotification( string id xulelement browser ); parameters ...
Deferred
ke in exception handling. note: this argument should not be a promise. specifying a rejected promise would make the rejection reason equal to the rejected promise itself, and not its rejection reason. backwards and forwards compatible helper this deferred function can be used for backwards and forwards compatibility, due to a change that took place in firefox 30. ...
Sqlite.jsm
is simple to modify the parameter count or positions without fixing all users of the statement. objects/named parameters are a little safer because changes in the order of parameters in the statement won't change how values are bound to those parameters. when onrow is not defined, the full results of the operation are buffered before the caller is notified of statement completion. for insert, update, and delete statements, this is not relevant. however, it can have drastic implications for select statements. if your select statement could return lots of data, this buffering of returned rows could result in excessive memory usage. therefore, it's recommended to use onrow with select statements. along with a result row, onrow is passed a cancel function as its second argument. consumers o...
openLocationLastURL.jsm
need to import the code module into your javascript scope: components.utils.import("resource:///modules/openlocationlasturl.jsm"); once you've imported the module, you can then use the openlocationlasturl object it exports. this object lets you fetch and change the url that is placed in the "open location" dialog box when it opens. if the user is not in private browsing mode, this automatically updates the value of the general.open_location.last_url preference. note: this module automatically handles private browsing mode for you. the value preserved across accesses is not preserved when the user exits private browsing mode. using the openlocationlasturl object to get or set the value of the open location edit box, simply read the value of, or set the value of, the openlocationlasturl.value ...
source-editor.jsm
you can then use this value to detect when the contents of the text are different from your most recent save. in addition, when this value changes, the "dirtychanged" event is sent. editorelement element the element containing the editor. when using the default orion editor, this is a xul <xul:iframe> element. read only. lastfind ...
Application Translation with Mercurial
ping cd /c/mozilla/ create a new directory for the source code: mkdir mozilla-aurora initialize the new directory as new repository: hg init mozilla-aurora go into the new directory: cd mozilla-aurora unpack the source code: hg unbundle /path/to/the/downloaded/mozilla-aurora.hg this can take some time, mostly depending on the performance of the hard drive. extract the files: hg update obtaining the texts of your localization go back to the parent folder of mozilla-aurora: cd .. find the localization repository for your branch and language on http://hg.mozilla.org/ e.g. for aurora and german (language code 'de'), it is http://hg.mozilla.org/releases/l10n/mozilla-aurora/de/ copy that url to the clipboard. copy the repository to your computer by running the following com...
Localization and Plurals
e from the tools menu. to use it, list off the property files and properties that you want to check and click the button. the extension will load each property and display the plural forms in a table. selecting a table entry will populate the bottom box with sample uses of the word for some numbers. install pluralform checker v0.3 extension extension input it would be good to keep this list updated with all the words that need plural forms. people using the extension can then copy/paste this input. chrome://mozapps/locale/downloads/do...tes,hours,days chrome://mozapps/locale/downloads/do...dstitlepercent chrome://browser/locale/browser.prop...auseddownloads version history 0.1: initial version with pluralrule check, properties input loading, table generation, sample output display 0...
QA phase
ual builds. this file contains the necessary build instructions. ...
Release phase
you should now be able to push to the remote repository! commit, outgoing, and push you should try to commit your work regularly as you progress through the localization files. keep in mind that the hg commit command will sav...
Localization technical reviews
right as well as a measure of percentage in the middle column. first round approved! once your work is entirely approved, go out and celebrate! you've accomplished a massive undertaking and you deserve to be rewarded! go grab a drink with friends and enjoy your latest success! after you've finished celebrating your first approved release, it's time to start planning for the next one! when you update your localization for the next release, you'll need to put it through a different form of qa review called a sign-off review. visit the wiki page for sign-off reviews to learn what's involved when maintaining a localized mozilla product. ...
Uplifting a localization from Central to Aurora
c31fe9bc065a86aea2223ba48698f18ae7563ad gecko20b9_2011011018_relbranch here you can see that there are two changesets without a branch. so yes, you need to merge those two. hg merge if this just passes, you want to commit, and you probably want to use a commit message like "merging central and aurora". you can safely push this to l10n-central already, in particular if you don't plan to do further updates on aurora. you don't want to push this to aurora before there's been the notification that the status of aurora has been lifted up to beta. if hg merge starts asking you questions, you have a merge conflict. that indicates that the same string has different translations on l10n-central and aurora, and you really want to make sure that your aurora clone doesn't have quality issues. in particular,...
Web Localizability
lizability is important there are many reasons why you should start thinking about making your web app localizable as soon as possible. you will make localizer's life easier, for which they will be grateful. you will have quality content, localized and adapted to the needs of the local market. extending you web app to support new languages will be easy. the content will be easier to maintain and update. you will end up writing more semanticly-correct code, which is good for your seo. by reviewing your content and code for l12y, you will find and fix bugs in your original language too. ...
MathML3Testsuite
...
MathML Torture Test
ath { font-family: minion math; } .stixtwo math { font-family: stix two math; } .texgyrebonum math { font-family: tex gyre bonum math; } .texgyrepagella math { font-family: tex gyre pagella math; } .texgyreschola math { font-family: tex gyre schola math; } .texgyretermes math { font-family: tex gyre termes math; } .xits math { font-family: xits math; } javascript content function updatemathfont() { var mathfont = document.getelementbyid("mathfont").value; if (mathfont == "default") { document.body.removeattribute("class"); } else { document.body.setattribute("class", mathfont); } } function load() { document.getelementbyid("mathfont"). addeventlistener("change", updatemathfont, false) } window.addeventlistener("load", load, false); the follo...
Mozilla Port Blocking
js. see bug 85601. per protocol port blocking/enabling preferences. better user interface allow the user to decide if the blocking is really required. some kind of way to manage the ports which are blocked. more information nsioservice.cpp gbadportlist bug 83401 vulnerability note vu#476267 dougt@netscape.com original document information author(s): doug turner last updated date: august 15, 2007 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Mozilla Web Developer FAQ
. ...
Mozilla Development Tools
web interface to cvs. it lets developers and others edit pages on the mozilla.org web site without having to use cvs. doctor lets you edit pages in wysiwyg mode if the pages contain the <?doctor enable_wysiwyg_mode ?> processing instruction. access doctor by clicking the "edit this page" link at the bottom of any mozilla.org web page. original document information author(s): myk melez last updated date: november 8, 2005 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Mozilla Style System Documentation
n problems: the stylesheet representation uses way too much memory. other nsistylesheet implementations problems: some of the html style information is implemented in the content node classes. it should be consolidated so that the style system code can be moved back within the layout dll and nsistylecontext can be de-com-ified. original document information author(s): l. david baron last updated date: june 6, 2003 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Intel Power Gadget
or power consumption, rather than one that affects it, which makes it even less useful than most proxy measurements. intel power gadget can also log these results to a file. this feature has been used in energia, roberto vitillo's tool for systematically measuring differential power usage between different browsers. (an energia dashboard can be seen here; please note that the data has not been updated since early 2014.) version 3.0 (available on mac and windows, but not on linux) also exposes an api from which the same measurements can be extracted programmatically. at one point the gecko profiler used this api on windows to implement experimental package power estimates. unfortunately, the gecko profiler takes 1000 samples per second on desktop and is cpu intensive and so is likely to skew ...
JS::PerfMeasurement
r, but if the os cannot or will not measure all of the requested events, then only those events that will actually be measured have their bits set. all the counter variables for events that are not being measured will have the fixed value (uint64)-1. void start() call this on a perfmeasurement instance to start timing. void stop() and call this to stop timing again. the counter variables do not update in real time; they only change when stop is called. counter values are accumulated across many start/stop cycles, and you can modify their values if you want; stop simply adds counts read back from the os to whatever is already in each counter. void reset() resets all enabled counters to zero. uint64 cpu_cycles, uint64 instructions, etc. each potentially-measurable event corresponds to a regular...
Power profiling overview
ncore device, usually the gpu (not available on all processor models.) dram: main memory (not available on all processor models.) the following relationship holds: pp0 + pp1 <= pkg. dram is independent of the other three domains. these values are computed using a power model that uses processor-internal counts as inputs, and they have been verified as being fairly accurate. they are also updated frequently, at approximately 1,000 hz, though the variability in their update latency means that they are probably only accurate at lower frequencies, e.g. up to 20 hz or so. see section 14.9 of volume 3 of the intel software developer's manual for more details about rapl. tools that can take rapl readings include the following. tools/power/rapl: all planes; linux and mac. intel power gadge...
Profiling with the Firefox Profiler
te_profile.py somepath/profile.txt to graft symbols into the profile. mstange’s scripts do some fairly clever things to get those symbols – if your firefox was built by mozilla, then it will retrieve the symbols from the mozilla symbol server. if you built firefox yourself, it will attempt to use some cleverness3 to grab the symbols from your binary. your profile will now, hopefully, be updated with symbols. upload it for further analysis! i haven’t yet had the opportunity to try this, but i hope to next week. i’d be eager to hear people’s experience giving this a go – it might be a great tool in determining what’s going on in firefox when it’s hung! profiling threads the firefox profiler has rudimentary support for profiling multiple threads. to enable it, check th...
browser.altClickSave
the preference browser.altclicksave controls whether clicking a link while holding the alt key starts the download of that link. type:boolean default value: false exists by default: yes application support:firefox 13.0 status: active; last updated 2012-03-19 introduction: pushed to nightly on 2012-03-02 bugs: bug 713052 values true clicking a link while holding the alt key starts the download of that link. false (default) no action triggered (see bug 736985). ...
browser.dom.window.dump.file
browser.dom.window.dump.file redirects the ouput of window.dump() calls to a file whose address is specified in this preference if browser.dom.window.dump.enabled is set to true. changes require an application restart. type:string default value:none exists by default: no application support: gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) status: active; last updated 2012-03-18 introduction: pushed to nightly on 2009-04-24 bugs: bug 489938 values the value holds the file system path for the file in which the content of the window.dump() calls get written, e.g. c:\dump.txt . it will be created if it doesn't exist yet. the line breaks have to be in the argument of the dump function, else successive dump calls will get logged into the same line. related browser.do...
browser.download.lastDir.savePerSite
browser.download.lastdir.savepersite controls whether the directory preselected in the file picker for saving a file download is being remembered on a per-website (host) base. if set to true, the data is stored as content preference. type:boolean default value:true exists by default: no application support:firefox 11.0 status: active; last updated 2012-02-15 introduction: pushed to nightly on 2011-12-11 bugs: bug 702748 values true (default) the last used directory for the website (host) serving the file for download will be preselected in the file picker. 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 dire...
browser.pagethumbnails.capturing_disabled
true (default) the application doesn't create screenshots of visited web pages. ...
browser.search.context.loadInBackground
browser.search.context.loadinbackground controls whether a search from the context menu with "search <search engine> for <selected text>" opening a new tab will give focus to it and load it in the foreground or keep focus on the current tab and open it in the background. type:boolean default value:false exists by default: yes application support: firefox 13.0 status: active; last updated 2012-02-17 introduction: pushed to nightly on 2012-02-15 bugs: bug 727131 values true new tab with search results will be opened in the background, focus stays on the current tab. false (default) new tab with search results will be opened in the foreground. ...
browser.urlbar.formatting.enabled
the preference browser.urlbar.formatting.enabled controls whether the domain name including the top level domain is highlighted in the address bar by coloring it black and the other parts grey. type:boolean default value: true exists by default: yes application support:firefox 6.0 status: active; last updated 2012-04-03 introduction: pushed to nightly on 2011-05-03 bugs: bug 451833 values true (default) the domain name including the top level domain is highlighted in the address bar by coloring it black and the other parts grey. false all parts of the url are given the same color: black. ...
browser.urlbar.trimURLs
the preference browser.urlbar.trimurls controls whether the protocol http and the trailing slash behind domain name (if the open page is exactly the domain name) are hidden. type:boolean default value: true exists by default: yes application support:firefox 7.0 status: active; last updated 2012-04-03 introduction: pushed to nightly on 2011-06-23 bugs: bug 665580 values true (default) if the active url is exactly the domain name, the trailing slash (/) behind the top level domain will be hidden. if the address starts with http:// and neither starts with a ftp. subdomain nor contains @ (usually for ftp login information), the http:// prefix will be hidden. examples: https://www.example.org/ becomes https://www.example.org, http://www.example.org/foobar becomes www.examp...
dom.event.clipboardevents.enabled
s get notifications if the user copies, pastes, or cuts something from a web page, and it lets them know which part of the page had been selected. the emitting of the oncopy, oncut and onpaste events are controlled by this preference. type:boolean default value:true exists by default: no application support: gecko 13.0 (firefox 13.0 / thunderbird 13.0 / seamonkey 2.10) status: active; last updated 2012-02-15 introduction: pushed to nightly on 2012-02-14 bugs: bug 542938 values true (default) the oncopy, oncut and onpaste events are enabled for web content. false the oncopy, oncut and onpaste events are disabled for web content. ...
mail.tabs.drawInTitlebar
starting in thunderbird 17.0, the tabs are drawn in the title bar. the old behavior can be restored by setting the preference mail.tabs.drawintitlebar to false. type:boolean default value: true exists by default: yes application support:thunderbird 17.0 status: active; last updated 2012-09-17 introduction: pushed to daily on 2012-08-08 bugs: bug 771816 values true (default) the tabs are drawn in the title bar of the mail program. false the tabs are drawn in a separate tab bar, and the title bar shows the title of the current tab (e.g. the subject of the currently selected mail). ...
reader.parse-on-load.force-enabled
the preference reader.parse-on-load.force-enabled controls if the reader mode used in firefox mobile should be enabled independent of the memory available in the device. by default, the reader mode in firefox mobile is only enabled if the memory is greater than 384mb. type:boolean default value: false exists by default: yes application support:firefox mobile 23.0 status: active; last updated 2013-05-11 introduction: pushed to nightly on 2013-05-06 bugs: bug 867875 values true reader mode is enabled independent of memory available. false (default) reader mode is only enabled if memory available exceeds a threshold (currenlty 384mb). ...
ui.SpellCheckerUnderline
ui.spellcheckerunderline holds the colour which is used to underline words not recognized by the spellchecker. type:string default value:#ff0000 exists by default: no application support: gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) status: active; last updated 2012-02-21 introduction: pushed to nightly on 2009-04-03 bugs: bug 338209 values a color code like #ff0000 for red. ...
ui.SpellCheckerUnderlineStyle
ui.spellcheckerunderlinestyle holds the style which is used to underline words not recognized by the spellchecker. type:integer default value:5 exists by default: no application support: gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) status: active; last updated 2012-02-22 introduction: pushed to nightly on 2009-04-03 bugs: bug 338209 values the values are defined in nsstyleconsts.h. 0 no underlining 1 dotted 2 dashed 3 single solid line 4 two solid lines 5 (default) wavy ...
ui.alertNotificationOrigin
ui.alertnotificationorigin controls the position and direction from which popup notifications invoked by nsialertsservice are sliding in. ...
ui.textSelectBackground
ui.textselectbackground saves the color in which the background of a text selection in the user interface or in content will be styled. ...
ui.textSelectForeground
ui.textselectforeground saves the color in which the text of a text selection in the user interface or the content will be styled. ...
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. ...
Research and prep
elieve that localization teams are in the best position to provide recommendations on what local providers we can use for web services because you're in the market, work in the language, and know your users. this is, therefore, meant to be a guideline for how you should be formulating your recommendations. here's the basic process: file a bug under mozilla localizations>[your_locale] to request updates to your locale's productization preferences. if this is your first localization for a product, the l10n drivers will file this bug as part of the new product localization release process. it is your l10n team's responsibility to perform research and identify the most appropriate web services for your region and present them in your bug as your informed recommendations. if there's no existing c...
A guide to searching crash reports
is an extremely long tail. these results would be improved by using numeric ranges instead of individual values, but unfortunately that isn't supported. advanced usage the combination of searching and grouping is powerful. searches find crash reports that match particular criteria, and grouping organizes those crash reports into interesting groups. when a search is performed, the page's url is updated to include the search parameters. this means that the results of any search can be easily shared by copying and pasting the page's url. to become an expert at searching and grouping requires understanding the full range of the 100+ fields available for searching and grouping. one way to learn about them is to read lots of individual crash reports; note that all fields shown in the details tab o...
About NSPR
d 20 versions of unix and is still expanding. the basic api is stable and expected to remain that way. ...
Creating a Cookie Log
. close out of the command prompt/shell/terminal, and then launch firefox normally. finally, attach the cookie-log.txt file to the bug where it was requested (by clicking on create new attachment). it should be in c:\temp on windows, your home directory on linux, or the desktop on mac os x. thanks for helping us make firefox better! original document information author(s): mike connor last updated date: december 4, 2004 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
NSPR Contributor Guide
should prove that the added api items work as advertized. ...
NSPR Poll Method
readable if new_flags contains pr_poll_write, you should try pr_recv or pr_send when the underlying network transport is writable important do not use out_flags in any way other than testing if (new_flags & out_flags) is 0. this is how pr_poll (the primary user and hence the de facto specification of the poll method) uses out_flags. original document information author: wan teh chang last updated date: june 27, 2006 ...
NSPR's Position On Abrupt Thread Termination
to provide the illusion of concurrency within a process. ...
Nonblocking IO In NSPR
tream). ...
Process Forking in NSPR
may be replicated in the child process or only the calling kernel thread may be replicated. so, to be consistent across all platforms, it is suggested that when using fork in a nspr thread; the exec function should be called in the child process. no nspr functions should be called in the child process before the exec call is made. original document information author: alan o. freier last updated date: 1998 ...
Introduction to NSPR
not necessary to create a global thread explicitly unless you are planning to port your code only to platforms that provide threading services with which you are familiar or unless the thread will be executing code that might directly call blocking os functions. threads can also have "per-thread-data" attached to them. each thread has a built-in per-thread error number and error string that are updated when nspr operations fail. it's also possible for nspr clients to define their own per-thread-data. for details, see controlling per-thread private data. thread scheduling nspr threads are scheduled by priority and can be preempted or interrupted. the sections that follow briefly introduce the nspr approach to these three aspects of thread scheduling. setting thread priorities preempting t...
PR_AtomicSet
ts previous contents. syntax #include <pratom.h> print32 pr_atomicset( print32 *val, print32 newval); parameters the function has the following parameter: val a pointer to the value to be set. newval the new value to assign to the val parameter. returns the function returns the prior value of the referenced variable. description pr_atomicset first reads the value of var, then updates it with the supplied value. the returned value is the value that was readbefore memory was updated. the memory modification is unconditional--that is, it isn't a test and set operation. ...
PR_Open
e is created. if the file exists, this flag has no effect. pr_append 0x10 the file pointer is set to the end of the file prior to each write. pr_truncate 0x20 if the file exists, its length is truncated to 0. pr_sync 0x40 if set, each write will wait for both the file data and file status to be physically updated. pr_excl 0x80 with pr_create_file, if the file does not exist, the file is created. if the file already exists, no action and null is returned. mode when pr_create_file flag is set and the file is created, these flags define the access permission bits of the newly created file. this feature is currently only applicable on unix platforms. it i...
NSPR release process
set the nspr version number. five files need to be updated: configure.in, configure, repackage.sh, prinit.h, and vercheck.c. look at their cvs histories for examples. make a dummy change (add or remove a blank line) to mozilla/nsprpub/config/prdepend.h. make sure the nss tinderboxes (which also build and test nspr) are all green. the build+test cycles of the nss tinderboxes are very long, so you usually need to wait half a day for them to cycle through. create a beta cvs tag. the naming convention is nspr_x_y_z_betan for nspr x.y.z beta n. push the beta tag to mozilla-central for testing in firefox trunk builds. ideally you should test it for a week. remove "beta" from the nspr version number for the final release. usually you just need to update prinit.h. make a dummy change (add or r...
An overview of NSS Internals
pplication, you are able to register your own implementation of an http request callback interface, and nss can use your application code that supports proxies. when using hashing, encryption, and decryption functions, it is possible to stream data (as opposed to operating on a large buffer). create a context handle while providing all the parameters required for the operation, then call an “update” function multiple times to pass subsets of the input to nss. the data will be processed and either returned directly or sent to a callback function registered in the context. when done, you call a finalization function that will flush out any pending data and free the resources. this line is a placeholder for future sections that should explain how libpkix works and is designed. if you w...
Getting Started With NSS
w to write nss applications are the command line tools that are maintained by the nss developers. you can find them in subdirectory mozilla/security/nss/cmd or have a look at some basic nss sample code. a new set of samples is currently under development and review, see create new nss samples. you are welcome to download the samples via: hg clone https://hg.mozilla.org/projects/nss; cd nss; hg update samples_branch how to contribute ... (this section is still under construction, but there are many contribution opportunities) start by opening a bugzilla account at bugzilla.mozilla.org if you don't have one. nss :: libraries component for issues you'd like to work on. we maintain a list of nss bugs marked with a keyword "good-first-bug" that you can view. creating your patch seee our sec...
JSS
Mozilla › Projects › NSS › JSS
stay tuned! legacy jss information can still be found at: source: https://hg.mozilla.org/projects/jss issues: https://bugzilla.mozilla.org/buglist.cgi?product=jss wiki: /docs/mozilla/projects/nss/jss network security services for java (jss) is a ja...
NSS_3.12.1_release_notes.html
bug 430916: add sustaining asserts bug 431805: leak in nssarena_destroy() bug 431929: memory leaks on error paths in devutil.c bug 432303: replace pkix_pl_memcpy ...
NSS 3.12.4 release notes
from a p12 file leaves error code set to zero bug 492385: crash freeing named crl entry on shutdown bug 493135: bltest crashes if it can't open the input file bug 493364: can't build with --disable-dbm option when not cross-compiling bug 493693: sse2 instructions for bignum are not implemented on os/2 bug 493912: sqlite3_reset should be invoked in sdb_findobjectsinit when error occurs bug 494073: update rsa/dsa powerupself tests to be compliant for 2011 bug 494087: passing null as the value of cert_pi_trustanchors causes a crash in cert_pkixsetparam bug 494107: during nss_nodb_init(), softoken tries but fails to load libsqlite3.so crash [@ @0x0 ] bug 495097: sdb_mapsqlerror returns signed int bug 495103: nss_initreadwrite(sql:<dbdir>) causes nss to look for sql:<dbdir>/libnssckbi.so bug 495365: ...
NSS 3.12.5 release_notes
length), then the softoken default is used. these are equivalent to the parameters for pk11_configurepkcs11(). see the following struct in nss.h for details: nssinitparametersstr other new functions in secmod.h: secmod_getskipfirstflag secmod_getdefaultmoddbflag in prlink.h nss_securememcmp port_loadlibraryfromorigin modified functions sgn_update (see cryptohi.h) the parameter "input" of this function is changed from unsigned char * to const unsigned char *. pk11_configurepkcs11 (see nss.h) the name of some parameters have been slightly changed ("des" became "desc"). deprecated headers the header file key.h is deprecated. please use keyhi.h instead. additional documentation in pk11pub.h: the cal...
NSS 3.14.2 release notes
dq. if so, nss uses the optimized code path, reducing the cpu cycles per byte to 1/20 of what was required before the patch (https://bugzilla.mozilla.org/show_bug.cgi?id=805604 and https://crypto.stanford.edu/realworldcrypto/slides/gueron.pdf). support for other platforms, such as windows, will follow in a future nss release. (https://bugzilla.mozilla.org/show_bug.cgi?id=540986) sqlite has been updated to 3.7.15. note: please apply the patch in https://bugzilla.mozilla.org/show_bug.cgi?id=837799 if you build nss with the system sqlite library and your system sqlite library is older than 3.7.15. bug 816853 - when using libpkix for certificate validation, applications may now supply additional application-defined trust anchors to be used in addition to those from loaded security tokens, rather...
NSS 3.15.4 release notes
ssl_recommendedcanfalsestart ssl_setcanfalsestartcallback new types cert_rev_m_force_post_method_for_ocsp: when this flag is used, libpkix will never attempt to use the http get method for ocsp requests; it will always use post. new pkcs #11 mechanisms none. notable changes in nss 3.15.4 reordered the cipher suites offered in ssl/tls client hello messages to match modern best practices. updated the set of root ca certificates (version 1.96). improved ssl/tls false start. in addition to enabling the ssl_enable_false_start option, an application must now register a callback using the ssl_setcanfalsestartcallback function. when building on windows, os_target now defaults to win95. to use the winnt build configuration, specify os_target=winnt. bugs fixed in nss 3.15.4 a complete list of...
NSS 3.16.4 release notes
d includes a small number of bug fixes. notable changes in nss 3.16.4 the following 1024-bit root ca certificate was restored to allow more time to develop a better transition strategy for affected sites. it was removed in nss 3.16.3, but discussion in the mozilla.dev.security.policy forum led to the decision to keep this root included longer in order to give website administrators more time to update their web servers. cn = gte cybertrust global root sha1 fingerprint: 97:81:79:50:d8:1c:96:70:cc:34:d8:09:cf:79:44:31:36:7e:f4:74 in nss 3.16.3, the 1024-bit "entrust.net secure server certification authority" root ca certificate (sha1 fingerprint: 99:a6:9b:e6:1a:fe:88:6b:4d:2b:82:00:7c:b8:54:fc:31:7e:15:39) was removed. in nss 3.16.4, a 2048-bit intermediate ca cert...
NSS 3.16 release notes
7.2. bug 962760: libpkix should not include the common name of ca as dns names when evaluating name constraints. bug 981170: aeskeywrap_decrypt should not return secsuccess for invalid keys. bug 974693: fix a memory corruption in sec_pkcs12_new_asafe. bug 956082: if the nss_sdb_use_cache environment variable is set, skip the runtime test sdb_measureaccess. the built-in roots module has been updated to version 1.97, which adds, removes, and distrusts several certificates. the atob utility has been improved to automatically ignore lines of text that aren't in base64 format. the certutil utility has been improved to support creation of version 1 and version 2 certificates, in addition to the existing version 3 support. bugs fixed in nss 3.16 this bugzilla query returns all the bugs fixed i...
NSS 3.17.3 release notes
a program linked with o...
NSS 3.17 release notes
l_reuse_server_ecdhe_key option defaults to pr_true, which means the server's ephemeral ecdh key is reused for multiple handshakes. this option does not affect the tls client code, which always generates a fresh ephemeral ecdh key for each handshake. new macros in ssl.h ssl_reuse_server_ecdhe_key notable changes in nss 3.17 the manual pages for the certutil and pp tools have been updated to document the new parameters that had been added in nss 3.16.2. on windows, the new build variable use_static_rtl can be used to specify the static c runtime library should be used. by default the dynamic c runtime library is used. bugs fixed in nss 3.17 this bugzilla query returns all the bugs fixed in nss 3.17: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=compon...
NSS 3.18 release notes
a program linked with older nss...
NSS 3.19.2.2 release notes
nss 3.19.2.2 requires nspr 4.10.10 or newer. ...
NSS 3.19.2.3 release notes
nss 3.19.2.3 requires nspr 4.10.10 or newer. ...
NSS 3.19.2.4 release notes
nss 3.19.2.4 requires nspr 4.10.10 or newer. ...
NSS 3.22 release notes
set the nss_disable_gtests variable to 1 to disable building these tests. bugs fixed in nss 3.22 this bugzilla query returns all the bugs fixed in nss 3.22: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_mil...
NSS 3.23 release notes
l_setdowngradecheckversion - set maximum version for new serverrandom anti-downgrade mechanism. clients that perform a version downgrade (which is a dangerous practice) call this with the highest version number that they possibly support. this gives them access to the version downgrade protection from tls 1.3. notable changes in nss 3.23 the copy of sqlite shipped with nss has been updated to version 3.10.2 (bug 1234698) the list of tls extensions sent in the tls handshake has been reordered to increase compatibility of the extended master secret with servers (bug 1243641) the build time environment variable nss_enable_zlib has been renamed to nss_ssl_enable_zlib (bug 1243872). the build time environment variable nss_disable_chachapoly was added, which can be used to prevent co...
NSS 3.25 release notes
h nssckfwslot_getslotid nssckfwsession_getfwslot nssckfwinstance_destroysessionhandle nssckfwinstance_findsessionhandle notable changes in nss 3.25 an ssl socket can no longer be configured to allow both tls 1.3 and ssl v3. regression fix: nss no longer reports a failure if an application attempts to disable the ssl v2 protocol. the trusted ca certificate list has been updated to version 2.8. the following ca certificate was removed cn = sonera class1 ca sha-256 fingerprint: cd:80:82:84:cf:74:6f:f2:fd:6e:b5:8a:a1:d5:9c:4a:d4:b3:ca:56:fd:c6:27:4a:89:26:a7:83:5f:32:31:3d the following ca certificates were added cn = hellenic academic and research institutions rootca 2015 sha-256 fingerprint: a0:40:92:9a:02:ce:53:b4:ac:f4:f...
NSS 3.27 release notes
ps download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_27_rtm/src/ new in nss 3.27 new functionality allow custom named group priorities for tls key exchange handshake (ssl_namedgroupconfig). added support for rsa-pss signatures in tls 1.2 and tls 1.3 new functions in ssl.h ssl_namedgroupconfig notable changes in nss 3.27 update 2016-10-02: the maximum tls version supported has been increased to tls 1.3 (draft). although the maximum tls version enabled by default is still tls 1.2, there are applications that query the list of tls protocol versions supported by nss, and enable all supported versions. for those applications, updating to nss 3.27 may result in tls 1.3 (draft) to be enabled. the tls 1.3 (draft) ...
NSS 3.39 release notes
rfc 8446. previous versions of nss accepted an rsa pkcs#1 v1.5 signature where the digestinfo structure was missing the null parameter. starting with version 3.39, nss requires the encoding to contain the null parameter. the tstclnt and selfserv test utilities no longer accept the -z parameter, as support for tls compression was removed in a previous nss version. the ca certificates list was updated to version 2.26. the following ca certificates were added: ou = globalsign root ca - r6 sha-256 fingerprint: 2cabeafe37d06ca22aba7391c0033d25982952c453647349763a3ab5ad6ccf69 cn = oiste wisekey global root gc ca sha-256 fingerprint: 8560f91c3624daba9570b5fea0dbe36ff11a8323be9486854fb3f34a5571198d the following ca certificate was removed: ...
NSS 3.44.1 release notes
a program linked with older nss 3.x shared libraries will work with nss 3.44.1 shared libraries without recompil...
NSS 3.44.3 release notes
secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_44_3_rtm/src/ other releases are available in nss releases. new in nss 3.44.3 no new functionality is introduced in this release. bugs fixed in nss 3.44.3 bug 1579060 - don't set the constructed bit for issueruniqueid and subjectuniqueid in mozilla::pkix cve-2019-11745 - encryptupdate should use maxout, not block size this bugzilla query returns all the bugs fixed in nss 3.44: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.44 compatibility nss 3.44.3 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries ...
NSS 3.46 release notes
initialized warning in lgattr.c bug 1561558 - remove -wmaybe-uninitialized warning in httpserv.c bug 1561556 - remove -wmaybe-uninitialized warning in tls13esni.c bug 1561332 - ec.c:28 warning: comparison of integers of different signs: 'int' and 'unsigned long' bug 1564714 - print certutil commands during setup bug 1565013 - hacl image builder times out while fetching gpg key bug 1563786 - update hacl-star docker image to pull specific commit bug 1559012 - improve gcm perfomance using pmull2 bug 1528666 - correct resumption validation checks bug 1568803 - more tests for client certificate authentication bug 1564284 - support profile mobility across windows and linux bug 1573942 - gtest for pkcs11.txt with different breaking line formats bug 1575968 - add strsclnt option to enforce t...
NSS 3.47.1 release notes
.1 requires nspr 4.23 or newer. nss 3.47.1 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_47_1_rtm/src/ other releases are available in nss releases. new in nss 3.47.1 no new functionality is introduced in this release. ...
NSS 3.53 release notes
linking libfreeblpriv3.so in firefox on ppc64le bug 1636389 - relocate deprecated seed algorithm bug 1637083 - lib/ckfw: no such file or directory. stop. ...
NSS Sample Code Sample_1_Hashing
*/ printashex(outfile, digest, len); } while (0); /* cleanup */ if (hashcontext != null) hash_destroy(hashcontex...
NSS Sample Code Utilities_1
/* * seedfromnoisefile */ secstatus seedfromnoisefile(const char *noisefilename) { char buf[2048]; prfiledesc *fd; print32 count; fd = pr_open(noisefilename, pr_rdonly, 0); if (!fd) { fprintf(stderr, "failed to open noise file."); return secfailure; } do { count = pr_read(fd,buf,sizeof(buf)); if (count > 0) { pk11_randomupdate(buf,count); } } while (count > 0); pr_close(fd); return secsuccess; } /* * filesize */ long filesize(const char* filename) { struct stat stbuf; stat(filename, &stbuf); return stbuf.st_size; } /* * readderfromfile */ secstatus readderfromfile(secitem *der, const char *infilename, prbool ascii) { secstatus rv = secsuccess; prfiledesc *infile = n...
Hashing - sample 1
*/ printashex(outfile, digest, len); } while (0); /* cleanup */ if (hashcontext != null) hash_destroy(hashcontex...
Utilities for nss samples
/* * seedfromnoisefile */ secstatus seedfromnoisefile(const char *noisefilename) { char buf[2048]; prfiledesc *fd; print32 count; fd = pr_open(noisefilename, pr_rdonly, 0); if (!fd) { fprintf(stderr, "failed to open noise file."); return secfailure; } do { count = pr_read(fd,buf,sizeof(buf)); if (count > 0) { pk11_randomupdate(buf,count); } } while (count > 0); pr_close(fd); return secsuccess; } /* * filesize */ long filesize(const char* filename) { struct stat stbuf; stat(filename, &stbuf); return stbuf.st_size; } /* * readderfromfile */ secstatus readderfromfile(secitem *der, const char *infilename, prbool ascii) { secstatus rv = secsuccess; prfiledesc *infile = n...
sample1
*/ printashex(outfile, digest, len); } while (0); /* cleanup */ if (hashcontext != null) hash_des...
NSS Sample Code
hashing, mac sample code 4: pki encryption sample code 5: pki encryption with a raw public & private key in der format sample code 6: persistent symmetric keys in nss database these are very old examples in need of replacement. see https://bugzilla.mozilla.org/show_bug.cgi?id=490238 you are welcome to download the new samples via: hg clone https://hg.mozilla.org/projects/nss; cd nss; hg update samples_branch the new samples: /docs/mozilla/projects/nss/new_nss_samples ...
nss tech note4
/* free the secitem fields */ secitem_freeitem(&data.version, pr_false); ...
New NSS Samples
code this collection of sample code demonstrates how nss can be used for cryptographic operations, certificate handling, ssl, etc. it also demonstrates some best practices in the application of cryptography. these new examples are a work in progress. ...
PKCS11 FAQ
Mozilla › Projects › NSS › PKCS11 › FAQ
no special trust bits associated with them. nss is perfectly capable of using token certificates in place. which function does nss use to get login state information? nss calls c_getsessioninfo to get the login/logout state. nss never attempts to cache this information, because login state can change instantly without nss knowing about it (for example, when the user removes the card). you must update all sessions correctly when the state changes. not doing so is a common source of problems. i have noticed that nss sometimes use a session handle value of 0. is this an invalid session handle? a session handle of 0 is indeed invalid. in the past, nss uses the invalid session handle to mark problems with acquiring or using a session. there have been cases where nss would then use this handle to...
PKCS11 Implement
this document supplements the information in pkcs #11: cryptographic token interface standard, version 2.0 with guidelines for implementors of cryptographic modules who want their products to work with mozilla client software: how nss calls pkcs #11 functions. function-specific information organized in the same categories as the pkcs #11 specification. ...
PKCS 12 functions
sec_pkcs12decoderimportbags mxr 3.2 and later sec_pkcs12decoderiterateinit mxr 3.10 and later sec_pkcs12decoderiteratenext mxr 3.10 and later sec_pkcs12decodersettargettokencas mxr 3.8 and later sec_pkcs12decoderstart mxr 3.2 and later sec_pkcs12decoderupdate mxr 3.2 and later sec_pkcs12decodervalidatebags mxr 3.2 and later sec_pkcs12decoderverify mxr 3.2 and later sec_pkcs12destroyexportcontext mxr 3.2 and later sec_pkcs12enablecipher mxr 3.2 and later sec_pkcs12encode mxr 3.2 and later ...
FC_SignFinal
final finishes a multi-part signing operation by returning the complete signature and clearing the operation context. if psignature is null the length of the signature is returned and fc_signfinal may be called again with psignature set to retrieve the signature. a user must log into the token (to assume the nss user role) before calling fc_signfinal. return value examples see also fc_signupdate, nsc_signfinal ...
FC_SignInit
object_handle hkey ); parameters hsession [in] session handle. pmechanism [in] mechanism to be used for the subsequent signing operation. hkey [in] handle of the key to be used . description fc_signinit initializes a signature operation. a user must log into the token (to assume the nss user role) before calling fc_signinit. return value examples see also nsc_signinit fc_sign fc_signupdate fc_signfinal ...
FC_VerifyFinal
parameters hsession [in] session handle. ...
NSS tools : crlutil
tains spaces. if this argument is not used the output destination defaults to standard output. -t crl-type specify type of crl. possible types are: 0 - sec_krl_type, 1 - sec_crl_type. this option is obsolete -u url specify the url. crl generation script syntax crl generation script file has the following syntax: * line with comments should have # as a first symbol of a line * set "this update" or "next update" crl fields: update=yyyymmddhhmmssz nextupdate=yyyymmddhhmmssz field "next update" is optional. time should be in generalizedtime format (yyyymmddhhmmssz). for example: 20050204153000z * add an extension to a crl or a crl certificate entry: addext extension-name critical/non-critical [arg1[arg2 ...]] where: extension-name: string value of a name of known extensions. criti...
troubleshoot.html
ons. if you have suggestions for this page, please post them to mozilla.dev.tech.crypto. building nss having /usr/ucb/bin in the path before /usr/ccs/bin breaks the build on 64-bit solaris. the solaris compiler needs to be workshop-5.0 or greater. the 64-bit builds don't support gcc. if the build fails early on the gmakein coreconf try updating your cvs tree with -p: cd mozilla cvs update -p building a 32-bit version on a 64-bit may fail with: /usr/include/features.h:324:26: fatal error: bits/predefs.h: no such file or directory in this case remember to set use_64=1 testing nss the ssl stress test opens 2,048 tcp connections in quick succession. kernel data structures may remain allocated for these connections for up to two minutes. some systems may not be configure...
sslfnc.html
efault, and are defined in sslproto.h. the number of values in the table is contained in an external 16-bit integer named ssl_numimplementedciphers. the macro ssl_is_ssl2_cipher can be used to determine whether a particular value is an ssl2 or an ssl3 cipher. warning: using the external array ssl_implementedciphers[] directly is deprecated. it causes dynamic linking issues at run-time after an update of nss because the actual size of the array changes between releases. the recommended way of accessing the array is through the ssl_getimplementedciphers() and ssl_getnumimplementedciphers() accessors. by default, all ssl2 and 12 ssl3/tls cipher suites are enabled. however, this does not necessarily mean that they are all permitted. the ssl_cipherprefsetdefault function cannot override cipher ...
NSS_3.12.3_release_notes.html
bugs fixed the following bugs have been fixed in nss 3.12.3. bug 159483: cert name matching: rfc 2818 vs. backwards compatibility (wildcards) bug 334678: prng_fips1861.c redefines the macro bsize on hp-ux bug 335016: mpp_pprime (miller-rabin probabilistic primality test) may choose 0 or 1 as the random integer bug 347037: make shlibsign depend on the softoken only bug 371522: auto-update of crls stops after first update bug 380784: pk11mode in non fips mode failed. bug 394077: libpkix need to return revocation status of a cert bug 412468: modify certutil bug 417092: modify pkix_certselector api to return an error if cert was rejected. bug 426413: audit messages need distinct types bug 438870: free freebl hashing code of dependencies on nspr and libutil bug 439115: d...
NSS Tools dbck-tasks
mation about the user's certificates (no common names, email addresses, etc.). this file could be mailed to a mail alias to assist in finding the source of database corruption. the dbck tool should be able to repair a currupted database. there should be command-line options and, perhaps, an interactive mode to allow determine which certificates to keep. the dbck tool should be able to update a databa ...
NSS tools : crlutil
Mozilla › Projects › NSS › tools › crlutil
stination defaults to standard output. -t crl-type specify type of crl. possible types are: 0 - sec_krl_type, 1 - sec_crl_type. this option is obsolete -u url specify the url. crl generation script syntax crl generation script file has the following syntax: * line with comments should have # as a first symbol of a line * set "this update" or "next update" crl fields: update=yyyymmddhhmmssz nextupdate=yyyymmddhhmmssz field "next update" is optional. time should be in generalizedtime format (yyyymmddhhmmssz). for example: 20050204153000z * add an extension to a crl or a crl certificate entry: addext extension-name critical/non-critical [arg1[arg2 ...]] where: extension-name: string value of a name of know...
NSS tools : signtool
ude. -f commandfile specifies a text file containing netscape signing tool options and arguments in keyword=value format. all options and arguments can be expressed through this file. for more information about the syntax used with this file, see "tips and techniques". -i scriptname specifies the name of an installer script for smartupdate. this script installs files from the jar archive in the local system after smartupdate has validated the digital signature. for more details, see the description of -m that follows. the -i option provides a straightforward way to provide this information if you don't need to specify any metadata other than an installer script. -j director...
Necko FAQ
...
The Necko HTTP module
gives an overview of how http caching is implemented in necko. it answers some of the common questions concerning what is cached and for how long. ...
Proxies in Necko
y 2.6), proxy servers are not used when accessing hosts with no dots in their names, if manual proxy configuration is used and "<local>" is added to the "no proxy for:" text field field. to be written xxx missing paragraphs are about pac, and more details about http proxying, and maybe some more details about socks proxies. original document information author(s): christian biesinger last updated date: april 8, 2005 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
New in Rhino 1.7R4
update license to mpl 2.0 make string concatenation with + fast java class generation updates and fixes faster number to string conversion several regexp fixes regexp performance improvements es5 compliance fixes improved interpreter performance improved commonjs module implementation javascript 1.8 generator expressions many parser and ast fixes use javascript 1.7 as default version in rhino shell javaadapter improvements fixes in js to java access include mozilla test suite a list of bugs that were fixed since the previous release. ...
Rhino serialization
ss is then made available in the classpath so serialization works. this isn't that interesting an example since compiling a function to a class and then loading it accomplishes the same as serializing an interpreted function, but it becomes more relevant if you wish to serialize javascript objects that have references to compiled functions. original document information author: norris boyd last updated date: november 15, 2006 copyright information: portions of this content are © 1998–2006 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Creating JavaScript jstest reftests
he time of this writing, mozilla imports test262 tests in to the directory js/src/tests/test262. when importing test262, the test file's in-file metadata is translated from test262 format to a format readibly by the jstest harness. if you are contributing directly to test262, you must submit the tests in the test262 format, which you can see in the test262 git repository and read about here. an update script exists in the js/src/tests directories to fetch and reformat the test262 suite, see test262-update.py. writing a new test file please read the high level advice for test writing in the parent article here. jstests has a special requirement: the call to reportcompare in every jstest is required by the test harness. except in old tests or super strange new tests, it should be the la...
GC Rooting Guide
dle<t> but a bare pointer does not. js::handle<t> all gc thing pointers that are parameters to a function must be wrapped in js::handle<t>. a js::handle<t> is a reference to a js::rooted<t>, and is created implicitly by referencing a js::rooted<t>: it is not valid to create a js::handle<t> manually (the whole point of a handle is that it only reference pointers that the gc knows about so it can update them when they move). like js::rooted<t>, a js::handle<t> can be used as if it were the underlying pointer. since only a js::rooted<t> will cast to a js::handle<t>, the compiler will enforce correct rooting of any parameters passed to a function that may trigger gc. js::handle<t> exists because creating and destroying a js::rooted<t> is not free (though it only costs a few cycles). thus, it make...
SpiderMonkey Internals
r intercepting set operations on properties and running a debugger-supplied function that receives the old value and a pointer to the new one, which it can use to modify the new value being set. line number to pc and back mapping functions. the line-to-pc direction "rounds" toward the next bytecode generated from a line greater than or equal to the input line, and may return the pc of a for-loop update part, if given the line number of the loop body's closing brace. any line after the last one in a script or function maps to a pc one byte beyond the last bytecode in the script. an example, from perfect.js: function perfect(n) { print("the perfect numbers up to " + n + " are:"); // we build sumofdivisors[i] to hold a string expression for // the sum of the divisors of i, excluding i itsel...
JS::DeflateStringToUTF8Buffer
characters written to the buffer. description js::deflatestringtoutf8buffer encodes src as utf8. the caller must either ensure dst has enough space to encode the entire string, or pass the length of the buffer as dstlenp. in which case, the function will encode characters from the string until the buffer is exhausted. does not write the null terminator. if dstlenp is provided, it will be updated to hold the number of bytes written to the buffer. if numcharsp is provided, it will be updated to hold the number of unicode characters written to the buffer. this can be less than the length of the string, if the buffer is exhausted before the string is fully encoded. examples char16_t uchars[] = { 0xd83e, 0xdd8a, 0 }; js::rootedstring str(cx, js_newucstringcopyn(cx, uchars, 2)); if (!str) ...
JSPropertyOp
k is called each time javascript code assigns to the property using any assignment operator (=, +=, etc.) or the ++ or -- operators. it is also called when the property is set via jsapi functions such as js_setproperty. on entry, *vp contains the value being assigned to the property. the callback may modify *vp. on success, the callback returns true. if the property has a stored value, it is then updated to the value left in *vp after the callback. as of spidermonkey 1.7, the value of a property assignment expression, like (a.length = x), is the value of *vp after the setter is called. this is typically the value of the left-hand side after assignment, as opposed to the value of the right-hand side, as required by ecma 262-3 §11.13. this ecmascript incompatibility is observable when assigning ...
JS_SetInterruptCallback
r inside the callback handler if it re-enters the js engine. the embedding must ensure that the callback is disconnected before attempting such re-entry. js_setinterruptcallback sets a callback that can be called asynchronously. some common uses for an interrupt callback are: to run garbage collection periodically, by calling js_maybegc; to periodically take a break from script execution to update the ui (though note that mozilla does not do this, by design); to enforce application limits on the amount of time a script may run. (in this case, the callback may terminate the script by returning false.) js_getinterruptcallback returns the currently installed interrupt callback, or null if none is currently installed. js_requestinterruptcallback requests a callback set using js_setinterrup...
JS_SetOperationCallback
r inside the callback handler if it re-enters the js engine. the embedding must ensure that the callback is disconnected before attempting such re-entry. js_setoperationcallback sets a callback that can be called asynchronously. some common uses for an operation callback are: to run garbage collection periodically, by calling js_maybegc; to periodically take a break from script execution to update the ui (though note that mozilla does not do this, by design); to enforce application limits on the amount of time a script may run. (in this case, the callback may terminate the script by returning js_false.) js_getoperationcallback returns the currently installed operation callback, or null if none is currently installed. js_triggeroperationcallback triggers a callback set using js_setopera...
Stored value
in the jsapi, the stored value of an object property is its last known value. for a data property, this is exactly the same thing as the property's current 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. the new stored value is the result of getting or setting the property, after the getter or setter, if any, is called. js_defineproperty allows the application to specify a property's initial stored value. js_lookupproperty fetches a property's stored value without triggering its getter. properties with the jsprop_shared attribute do not have a stored value. es5 accessor properties, as in {get length() { return 0; }, ...
JSAPI reference
acer added in spidermonkey 1.8 obsolete since jsapi 23 js_call_object_tracer added in spidermonkey 1.8 obsolete since jsapi 23 js_call_string_tracer added in spidermonkey 1.8 obsolete since jsapi 23 js_call_double_tracer added in spidermonkey 1.8 obsolete since javascript 1.8.5 js_printtracethinginfo (debug-only) added in spidermonkey 1.8 obsolete since jsapi 16 miscellaneous gc apis: js_updatemalloccounter added in spidermonkey 17 js::setlargeallocationfailurecallback added in spidermonkey 31 js::setoutofmemorycallback added in spidermonkey 31 js_enumeratediagnosticmemoryregions added in spidermonkey 17 jsval_lock obsolete since jsapi 18 jsval_unlock obsolete since jsapi 18 js_lockgcthing obsolete since jsapi 21 js_lockgcthingrt obsolete since jsapi 22 js_unlockgcthing obsol...
SpiderMonkey 1.8.8
tected by the c/c++ compiler, so they are easy to detect and updating the code is a fairly straightforward job. here is a list of the most significant changes. a significant number of typedefs of built-in types, or of types which are now standardized, have been removed. these and other changes are explained in detail below. new javascript language features javascript 1.8.8 includes significant updates to language features, yo. typedef changes many types have been removed from the jsapi and replaced with simpler alternatives. including jsapi.h provides all these types, but more-specific headers also provide these types if you wish to use them in other code. obsolete typedef replacement type provided by uint8, int8, uint16, int16, uint32, int32, uint64, int64 ...
SpiderMonkey 17
detected by the c/c++ compiler, so they are easy to detect and updating the code is a fairly straightforward job. here is a list of the most significant changes. a significant number of typedefs of built-in types, or of types which are now standardized, have been removed. these and other changes are explained in detail below. new javascript language features javascript 17 includes significant updates to language features, yo. typedef changes many types have been removed from the jsapi and replaced with simpler alternatives. including jsapi.h provides all these types, but more-specific headers also provide these types if you wish to use them in other code. obsolete typedef replacement type provided by uint8, int8, uint16, int16, uint32, int32, uint64, int64 ...
SpiderMonkey 24
uire type signature changes to jsapi methods: specifically introducing js::rooted, js::handle, and js::mutablehandle types. these types, with the appropriate parametrizations, can roughly be substituted for plain types of gc things (values, string/object pointers, etc.). these and other changes are explained in detail below. new javascript language features javascript 24 includes significant updates to language features, yo. typedef changes the fixed-size integer types introduced in spidermonkey 17 are defined in one of the following ways (xxx update for msvc<10 deprecation): if the environment variable moz_custom_stdint_h is set, that file will be included to provide definitions for these types. the file must conform to the standard c99 <stdint.h> header interface in all respects, pr...
SpiderMonkey 38
unchanged functionality. applications will need significant changes, but most of those changes will be detected by the c/c++ compiler, so they are easy to detect and updating the code is a fairly straightforward job. here is a list of the most significant changes: .... these and other changes are explained in detail below. new javascript language features javascript 38 includes significant updates to language features, yo. new c++ apis jsapi is now a c++-only api. please note that spidermonkey reserves the js:: namespace for itself (and the js:: namespace for internal use). js::clonefunctionobject (bug 1088228) interned_string_to_jsid (bug 1045900) js::construct (bug 1017109) js::createerror (bug 984048) js::falsehandlevalue (bug 959787) js::handlesymbol (bug 645416) js::identi...
SpiderMonkey 45
l require significant changes, but most changes will be automatically detected by the c/c++ compiler, making them easy to detect and updating the code a relatively straightforward job. here is a list of the most significant changes: js::nullptr is obsolete. you should now use nullptr instead. (supporting decltype(nullptr)). new javascript language features javascript 45 includes significant updates to its language features, yo. new c++ apis jsapi is a c++ exclusive api. please note that spidermonkey reserves the js:: namespace for itself for public exports and the js:: namespace for internal use. js_setcurrentembeddertimefunction (bug 1159507) js_getcurrentembeddertime (bug 1159507) js_mayresolvestandardclass (bug 1155946) js_getiteratorprototype (bug 1225392) js_globallexicalsco...
Setting up CDT to work on SpiderMonkey
figure --enable-debug --disable-optimize --enable-debug-symbols note: if you want to use ccache, you can enable it by adding --with-ccache to the arguments list. due to a bug in cdt, you have to make a small change to cdt's build configuration as explained in step 3 below for that to work, though. step 2 - installing eclipse and setting up the project the following run-down is a condensed and updated version of what is explained in much more detail for the entire mozilla codebase. luckily, improvements in cdt have reduced the basic process to manageable five steps: download and extract "eclipse ide for c/c++ developers" from the eclipse downloads page. start eclipse and create a workspace somewhere. select "new > makefile project with existing code" from the "file" menu. give the proje...
Shell global objects
tack() function in the browser. arrayinfo(a1, a2, ...) report statistics about arrays. functions available only if enable_intl_api is defined addintlextras(obj) adds various not-yet-standardized intl functions as properties on the provided object (this should generally be intl itself). the added functions and their behavior are experimental: don't depend upon them unless you're willing to update your code if these experimental apis change underneath you. functions available if --fuzzing-safe is not specified clone(fun[, scope]) clone function object. getselfhostedvalue() get a self-hosted value by its name. note that these values don't get cached, so repeatedly getting the same value creates multiple distinct clones. line2pc([fun,] line) map line number to pc. pc2line(fun[, pc...
Exploitable crashes
other tools apple has a tool called "crashwrangler" that are still being maintained as of 2012. there is little public information about it, and it is hard to find even on the apple developer site. to get them go to the mac developer center downloads section -> other downloads -> search for "crashwrangler". microsoft released a debugger extension tool in 2009 called "!exploitable". it hasn't been updated since 2009. ...
Security and the jar protocol
this article discusses security concerns with the jar: protocol, which only firefox has ever implemented for web content. note: support for the jar: protocol was disabled by default for use from web content beginning in firefox 45, but re-enabled again because it broke the experience of ibm inotes users. inotes has since been updated so that it no longer needs remote jars, so they have been disabled again in firefox 55. you may re-enable the feature if necessary by setting the network.jar.block-remote-files preference to false. java archive (jar) files are simply zip compressed bundles of files. firefox 2.0.0.10 (and firefox 1.5.0.15) fixed a potential security issue in the same origin policy when the jar: protocol was used to load data. prior to this change, specifying the jar: pro...
Animated PNG graphics
Mozilla › Tech › APNG
start_frame to 'anim' to indicate which frame the animation should start on. removed num_frames from 'anim' chunk from 0.3 added 'actl', 'fdat', 'fctl' chunk descriptions as per the latest png-list discussion added section 4, "interactions with other png chunks"; described global and local palettes and transparency changed 'offs' chunk section to refer to more general chunks updated 'adat' description to indicate that all frames must either be in a single chunk, or that the first chunk must have empty data. added notice that each frame's region (x,y,width,height) must lie completely within the parent png canvas fixed dispose_op description (after, not before) changed dispose_op to render_op; added disposal description; added blend flag changed delay_time to ...
Gecko events
anged is supported: no event_text_caret_moved the caret has moved to a new position. is supported: yes event_text_changed this event indicates general text changes, i.e. changes to text that is exposed through the iaccessibletext and iaccessibleeditabletext interfaces. is supported: no event_text_inserted text was inserted. is supported: yes event_text_removed text was removed. event_text_updated text was updated. event_text_selection_changed the text selection changed. event_visible_data_changed a visibile data event indicates the change of the visual appearance of an accessible object. this includes for example most of the attributes available via the iaccessiblecomponent interface. event_text_column_changed the caret moved from one column to the next. event_section_changed the ca...
Retrieving part of the bookmarks tree
vhistoryqueryresultnode. before accessing the children of any result container, you must first open it, and then you can iterate the children. as long as the container is open, it will listen for notifications from the bookmarks system to keep itself up-to-date. when you're done, be sure to close the container to free up the resources. otherwise, it will continue to get observer notifications and update itself, slowing down the whole browser. var rootnode = result.root; rootnode.containeropen = true; // iterate over the immediate children of this folder and dump to console for (var i = 0; i < rootnode.childcount; i ++) { var node = rootnode.getchild(i); dump("child: " + node.title + "\n"); } // close a container after using it! rootnode.containeropen = false; if you encounter a node with ...
Using the Places livemark service
vemarkservice.setfeeduri() sets the uri of feed associated with a livemark container. note: the caller is responsible for reloading the livemark after changing its feed uri (since the contents are likely to be different given a different feed). livemarkservice.setfeeduri(newlvmkid, uri("http://foo.example.com/rss.xml")); //newlvmkid = see "create a new livemark" for more detail. update behavior five seconds after the browser starts up, the livemark service's update timer is started. the update timer fires immediately, and then every 15 minutes thereafter. when the update timer fires, it iterates over the list of livemarks, and will refresh a livemark *only* if it's expired. the expiration time for a livemark is determined by using information provided by the server when the fee...
places.sqlite Database Troubleshooting
sion number returned by the last pragma query. sqlite> .exit open a new shell for the new database: my_work_folder> sqlite3 places.sqlite sqlite> pragma integrity_check; if the result is not ok, the file cannot be recovered; stop here and please file a bug. let's fix the schema version. nn must be replaced with the number we had noted previously: sqlite> pragma user_version = nn; let's update the page_size value: sqlite> pragma journal_mode = truncate; sqlite> pragma page_size = 32768; sqlite> vacuum; sqlite> pragma journal_mode = wal; sqlite> .exit copy the new places.sqlite to the profile folder, overwriting the existing one. remove the places.sqlite-corrupt file. launch firefox. if the database is still broken (missing history, creating -corrupt file, ...), please file a bug.
Toolkit API
the mozilla toolkit is a set of programming interfaces (apis) built on top of gecko which provide advanced services to xul applications. ...
Fun With XBL and XPConnect
posed on the widget which in turn forwards the call to the xpcom object, passing in our implementation of nsiautocompletelistener. <handlers> <handler type="keypress" keycode="vk_return" value="autocomplete(anonymouscontent[0].value, this.autocompletelistener);"/> </handlers> </implementation> </binding> original document information author(s): scott macgregor last updated date: april 13, 2000 copyright information: copyright (c) scott macgregor ...
Generating GUIDs
firefox irc channel by /msging "uuid" to them. windows windows users can use the guidgen tool from microsoft to obtain a guid. (this tool is also part of ms visual c++) linux use /usr/bin/uuidgen. this can be found in package uuid-runtime (debian). mac os x use /usr/bin/uuidgen. perl jkeiser's mozilla tools include a uuid generator with output format of both c++ and idl style. sfink's update-uuids will change the uuid for a given interface and all of its descendants, updating all *.idl files within a directory tree. nsiuuidgenerator a uuid can be generated from privileged mozilla code using nsiuuidgenerator. see the linked page for details. com/xpcom format when #define-ing iids and cids in mozilla c++ code, you generally use the following format: // xxxxxxxx-xxxx-xxxx-xxxx-xxx...
Generic factory
...
Avoiding leaks in JavaScript XPCOM components
take every information on this site with a grain of salt, although most concepts and best practices still apply. using xpcom in javascript (also known as xpconnect) is an environment where memory management issues are not obvious. ...
An Overview of XPCOM
include one or more components. when two or more related components are grouped together in a binary library, the library is referred to as a module. modular, component-based programming makes software easier to develop and maintain and has some well-known advantages: benefit description reuse modular code can be reused in other applications and other contexts. updates you can update components without having to recompile the whole application. performance when code is modularized, modules that are not necessary right away can be "lazy loaded", or not loaded at all, which can improve the performance of your application. maintenance even when you are not updating a component, designing your application in a modular way can make it eas...
Setting up the Gecko SDK
uld have your new component installed. i used xpcomviewer, to make sure the class and the interface were showing. now you can use this component in your javascript extension. a makefile for unix on linux, the equivalent project settings are typically handled in a makefile. the makefile allows you to specify any number of options for your build environment, including the path and configuration updates you need to build with the gecko sdk. below is a listing for a makefile that configures your compiler to work with the sdk. explaining the details of the makefile is outside the scope of this appendix, but it modifies the same properties that are configured in the visual c++ project (see building a microsoft visual cpp project). for a listing of the commands that appear in this listing, see the...
XPCOM guide
Mozilla › Tech › XPCOM › Guide
is guide describes the available arrays as well as the enumerator classes that can be used to get to them. in this document the term array refers to a container for multiple objects with a numeric, zero-based index.xpcom changes in gecko 2.0several changes that affect xpcom component compatibility are taking place in gecko 2. this article details those changes, and provides suggestions for how to update your code.xpcom hashtable guidea hashtable is a data construct that stores a set of items. each item has a key that identifies the item. items are found, added, and removed from the hashtable by using the key. hashtables may seem like arrays, but there are important differences:xpcom stream guidein mozilla code, a stream is an object which represents access to a sequence of characters. it is not...
PyXPCOM
creating a python xpcom component an example of how to create a simple xpcom component with python. getting to know pyxpcom pyxpcom is a bridging technology between xpcom and python. this article gives you a head start to pyxpcom. note: the links to part ii and iii of this series are broken and i cannot find them on the ibm site. please update this page if/when the links can be found. history pyxpcom was initially developed by activestate tool corporation, and came out of their komodo project. current releases are now integrated with the mozilla build system. other resources pythonext - extension that provides pyxpcom samples - demo applications using pyxpcom community python-xpcom bindi...
XPCShell Reference
will set the version number (and return the old version number). see the above documentation on the -v command-line argument for more information. quit(exitcode) quit() exits the shell. you can specify arguments that will get translated to an exit code. quit(5) will exit xpcshell with a result code of 5. original document information author: david bradley <dbradley@netscape.com> last updated date: 17 march 2003 copyright information: portions of this content are © 1998–2008 by individual mozilla.org contributors; content available under a creative commons license. ...
Folders
, nsimapmailfolder, and nsnewsfolder. they all inherit from nsmsgdbfolder, which implements a lot of the core functionality. ...
IAccessibleTable
y as this will be of interest to assistive technology or script engines accessing data out of process or from other threads. servers only need to save the most recent row and column values associated with the change and a scope of the entire application is adequate. [propget] hresult modelchange( [out] ia2tablemodelchange modelchange ); parameters modelchange a struct of (type(insert, delete, update), firstrow, lastrow, firstcolumn, lastcolumn). return value s_false if there is nothing to return, [out] value is null. s_ok. ncolumns() returns the total number of columns in table. [propget] hresult ncolumns( [out] long columncount ); parameters columncount number of columns in table (including columns outside the current viewport) return value s_ok. nrows() returns the total number of ro...
IAccessibleTable2
y as this will be of interest to assistive technology or script engines accessing data out of process or from other threads. servers only need to save the most recent row and column values associated with the change and a scope of the entire application is adequate. [propget] hresult modelchange( [out] ia2tablemodelchange modelchange ); parameters modelchange a struct of (type(insert, delete, update), firstrow, lastrow, firstcolumn, lastcolumn). return value s_false if there is nothing to return, [out] value is null. s_ok. ncolumns() returns the total number of columns in table. [propget] hresult ncolumns( [out] long columncount ); parameters columncount number of columns in table (including columns outside the current viewport) return value s_ok. nrows() returns the total number of ro...
inIDOMUtils
his will be false if certain css white-space styles are in effect. isinheritedproperty() determines if the specified string names a css property that is inherited by default. boolean isinheritedproperty( in astring apropertyname ); parameters apropertyname the name of the css property. return value true if the property is inherited, otherwise false. parsestylesheet() parse css and update the style sheet in place. void parsestylesheet( in nsidomcssstylesheet asheet, in domstring ainput ); parameters asheet a domcssstylesheet. ainput a domstring. the new source string for the style sheet. return value void setcontentstate() sets the given element as the current owner of the specified state, and removes that state from the previous owner. void setcontentstate( i...
mozITXTToHTMLConv
the length of the buffer to scan. apos the character offset into the string at which to begin the scan. astartpos on return, indicates the offset to the first character of the first found url, or -1 if no url was found. aendpos on return, indicates the offset to the last character of the first found url, or -1 if no url was found. remarks you can call this method repeatedly, passing in updated values for apos, to locate all the urls in a string. ...
mozIThirdPartyUtil
rty with respect to the uri of the channel. if so, return. obtain the bottommost nsidomwindow, and its same-type parent if it exists, from the channel's notification callbacks. then: if the parent is the same as the bottommost window, and the channel has the load_document_uri flag set, return false. this represents the case where a toplevel load is occurring and the window's uri has not yet been updated. (we have already checked that auri is not foreign with respect to the channel uri.) otherwise, return the result of isthirdpartywindow() with arguments of the channel's bottommost window and the channel uri, respectively. therefore, both the channel's uri and each level in the window hierarchy associated with the channel is tested. for example, if auri is "http://mail.google.com/", achannel ...
nsIAccessibleEvent
nged. event_text_caret_moved 0x0033 0x002f the caret has moved to a new position. event_text_changed 0x0034 0x0030 this event indicates general text changes. that is, changes to text that is exposed through the iaccessibletext and iaccessibleeditabletext interfaces. event_text_inserted 0x0035 0x0031 text was inserted. event_text_removed 0x0036 0x0032 text was removed. event_text_updated 0x0037 0x0033 text was updated. event_text_selection_changed 0x0038 0x0034 the text selection changed. event_visible_data_changed 0x0039 0x0035 a visible data event indicates the change of the visual appearance of an accessible object. this includes for example most of the attributes available via the iaccessiblecomponent interface. event_text_column_changed 0x003a 0x0036 the caret...
nsICache
ere isn't an entry just fail. access granted - you can read from this descriptor. access_write 2 access requested - i have something new i want to write into the cache, make me a new entry and doom the old one, if any. access granted - you must write to this descriptor because the cache entry was just created for you. access_read_write 3 access requested - i want to read, but i'm willing to update an existing entry if necessary, or create a new one if none exists. access granted - you can read the descriptor to determine if it's valid, you may write if it needs updating. store_anywhere 0 the storage policy of a cache entry determines the device(s) to which it belongs. see nsicachesession and nsicacheentrydescriptor for more details. allows the cache entry to be stored in any device. the...
nsICacheSession
n acstring key, in nscacheaccessmode accessrequested, in boolean blockingmode); void doomentry(in acstring key, in nsicachelistener listener); attributes attribute type description doomentriesifexpired prbool expired entries will be doomed or evicted if this attribute is set to true. if false, expired entries will be returned (useful for offline mode and clients, such as http, that can update the valid lifetime of cached content). this attribute defaults to true. methods asyncopencacheentry() this method gives an asynchronous cache access. does not block the calling thread. instead, the listener will be notified when the descriptor is available. void asyncopencacheentry( in acstring key, in nscacheaccessmode accessrequested, in nsicachelistener listener, [optional] in boole...
nsIContentSecurityPolicy
ports, and not modify behavior. methods permitsancestry() verifies ancestry as permitted by the policy. calls to this may trigger violation reports when queried, so this value should not be cached. boolean permitsancestry( in nsidocshell docshell ); parameters docshell containing the protected resource. return value true if the frame's ancestors are all permitted by policy. refinepolicy() updates the policy currently stored in the content security policy to be "refined" or tightened by the one specified in the string policystring. void refinepolicy( in astring policystring, in nsiuri selfuri ); parameters policystring selfuri scanrequestdata() called after the content security policy object is created to fill in the appropriate request and request header information needed in ca...
nsIDOMGeoGeolocation
be called when the current position is available. errorcallback an nsidomgeopositionerrorcallback that is called if an error occurs while retrieving the position; this parameter is optional. options an nsidomgeopositionoptions object specifying options; this parameter is optional. watchposition() similar to getcurrentposition(), except it continues to call the callback with updated position information periodically until clearwatch() is called. unsigned short watchposition( in nsidomgeopositioncallback successcallback, [optional] in nsidomgeopositionerrorcallback errorcallback, [optional] in nsidomgeopositionoptions options ); parameters successcallback an nsidomgeopositioncallback that is to be called whenever new position information is available. er...
nsIDOMGeoPositionCallback
the nsidomgeopositioncallback interface is called when updated position information is available. you need to implement this interface to accept callbacks after using nsidomgeolocation.watchposition(). dom/interfaces/geolocation/nsidomgeopositioncallback.idlscriptable please add a summary to this article. last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method overview void handleevent(in nsidomgeoposition position); methods handleevent() called when new position information is available. void handleevent( in nsidomgeoposition position ); parameters position an nsidomgeoposition object indicating the updated location information. ...
nsIDOMParser
ent.baseuriobject), and a documenturi. these values are automatically determined as defined below, but if you work with domparser from privileged code, you can override the defaults by providing arguments to the domparser constructor or calling parser.init(). usually you don't need to do that. if you come across a situation when these matter, feel free to ask questions in mozilla.dev.tech.dom and update this documentation to mention these cases. when a domparser is instantiated by calling new domparser(), it inherits the calling code's principal (except that for chrome callers the principal is set to the null principal) and the documenturi and baseuri of the window the constructor came from. if the caller has universalxpconnect privileges, it can pass parameters to new domparser(). if fewer tha...
nsIDeviceMotionListener
see also mozorientation nsidomorientationevent nsidevicemotion nsidevicemotiondata ...
nsIDocShell
to unicode. this attribute lets you: see what converter was used when retrieving the document's data. override that character set for documents for which the specified fallback or auto-detected character set is incorrect. reading this value reports the encoding that was used when loading the data into the document. setting this attribute overrides the encoding; however, to update the dom or display of the content, you need have the data reparsed. overriding the character set also sets the fallback encoding for the container frame. note: prior to gecko 12.0, this attribute was part of a separate nsidoccharset interface. chromeeventhandler nsidomeventtarget events generated in the frame bubble up to its chromeeventhandler. in the case o...
nsIDragService
dragdrop_action_move 2 the drag and drop operation should move the object. dragdrop_action_link 4 the drag and drop operation should link the object. dragdrop_action_uninitialized 64 the action is not initialized. methods native code only!dragmoved programmatically changes the drag position of the drag session. this is used on mac and windows to update the position of a popup being used as a drag image during the drag operation. it's not used on gtk, which handles the drag popup itself. [noscript] void dragmoved( in long ax, in long ay ); parameters ax the x coordinate to which to move the popup being dragged. ay the y coordinate to which to move the popup being dragged. enddragsession() tells the drag service to end a drag sess...
nsIEffectiveTLDService
ent people. is "mail.intranet" actually a domain name? depends who you ask - for some people it is, others not. is "pretty.flowers" a domain name, according to getpublicsuffix()? depends on the age of the copy of the psl you are working with. the tld space is currently expanding at a fairly great rate, and the copy of the psl firefox has may not be totally up to date (because it's not dynamically updated data). method overview acstring getbasedomain(in nsiuri auri, [optional] in pruint32 aadditionalparts); acstring getbasedomainfromhost(in autf8string ahost, [optional] in pruint32 aadditionalparts); acstring getpublicsuffix(in nsiuri auri); acstring getpublicsuffixfromhost(in autf8string ahost); methods getbasedomain() returns the base domain of a u...
nsIFTPChannel
...
nsIFeedContainer
primary link for the feed or entry. links nsiarray an array of all links for a feed or entry. rights nsifeedtextconstruct the feed or entry's rights or license text. title nsifeedtextconstruct the feed or entry's title. keep in mind that some feeds have no title, and some use markup in their titles, so be cautious when decoding this attribute. updated astring a string containing the date the feed or entry was last updated, in rfc822 form. this string is parsable by javascript and mail code. methods normalize() synchronizes a container's fields with its convenience attributes. void normalize(); parameters none. see also nsiuri nsifeedtextconstruct interwiki link ...
nsIFeedEntry
res or other media that might be displayed inline in the entry. parent nsifeedcontainer a reference to the entry's parent, which is either a feed (nsifeed or another entry. published astring a string indicating the date on which the entry was published, in rfc822 format. this date is parsable by both javascript (via date.parse()) and mail code. note, that the related updated attribute is available from the nsifeedcontainer interface. summary nsifeedtextconstruct a summary of the feed entry's content. this is generated automatically using the entry's description, subtitle, summary, content, and appropriate extensions. see also nsifeedcontainer interwiki lin ...
nsIFocusManager
e focused element. this process repeats downwards until a non-frame element is found. constants constant value description flag_raise 1 flag_noscroll 2 do not scroll the element to focus into view. flag_noswitchframe 4 if attempting to change focus in a window that is not focused, do not switch focus to that window. instead, just update the focus within that window and leave the application focus as is. this flag will have no effect if a child window is focused and an attempt is made to adjust the focus in an ancestor, as the frame must be switched in this case. flag_bymouse 0x1000 focus is changing due to a mouse operation, for instance the mouse was clicked on an element. flag_bykey 0x2000 focus i...
nsILocalFile
ing only. pr_rdwr open for reading and writing. pr_create_file if the file does not exist, the file is created. if the file exists, this flag has no effect. pr_append the file pointer is set to the end of the file prior to each write. pr_truncate if the file exists, its length is truncated to 0. pr_sync if set, each write will wait for both the file data and file status to be physically updated. pr_excl with pr_create_file, if the file does not exist, the file is created. if the file already exists, no action and null is returned. delete_on_close file will be deleted when closed. mode a unix-style file permissions value. for example, the octal value 0600 may be used to limit read and write access to the current user of the system. this parameter may be ignored on systems that...
Building an Account Manager Extension
nel-devmo-account. prefpanel-devmo-account=devmo demo panel step4: the new panel and javascript the javascript for an account manager panel needs to implement at least the following functions. these functions are invoked by the account manager. function onpreinit(account, accountvalues) { } function oninit(pageid, serverid) { } function onaccepteditor() { } function onsave() { } function updatepage() {} step5: putting it all together // todo build an demo extension for this tutorial... how to build an xpcom component in javascript ...
nsIMsgWindowCommands
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) the javascript implementation of this used by thunderbird is given here. method overview void selectfolder(in acstring folderuri); void selectmessage(in acstring messageuri); void clearmsgpane(); methods selectfolder() this method is called by the backend to change the folder displayed in the message window. this could be as a result of clicking on a new mail alert, or by clicking a link to a newsgroup. ...
nsINavHistoryContainerResultNode
into this container. when closed, attempting to call getchild() or access childcount results in an error. when you're done reading the container's children, set this to false. for host and day groupings, doing this has no performance cost since the children have already been computed. for queries and bookmark folders, however, being open means they must keep themselves up-to-date by listening for updates and re-querying as needed. dynamiccontainertype autf8string a string representing the dynamic container api service responsible for this container. accessing this throws an exception if the node isn't a dynamic container. read only. haschildren boolean indicates whether or not the node can have children, and may be used whether the container is open or closed. when the container is closed, ...
nsINavHistoryResultViewer
r into which to insert the item. anode the node to insert into the container; it may be either a leaf or another container. anewindex the index at which to insert the item. remarks the item previously at the specified index (if any) as well as everything below it, is shifted down by one. sortingchanged() called when the sorting order is changed to a particular mode. for trees, this would update the column headers to reflect the altered sorting. void sortingchanged( in unsigned short sortingmode ); parameters sortingmode one of the nsinavhistoryqueryoptions.sort_by_* constants, indicating the softing mode. remarks this method is only called to update the sorting user interface. invalidateall() is called as well if the sorting changes, in order to cause the contents to upda...
nsINavHistoryService
nsiuri auri ); parameters auri the uri that needs to be added to the history system. return value returns true if this uri would be added to the history, otherwise returns false. addvisit() obsolete since gecko 22.0 (firefox 22.0 / thunderbird 22.0 / seamonkey 2.19) note: this method was removed in gecko 22.0. you should use the new async api moziasynchistory.updateplaces() instead. see this code for how a function to add visits and handle errors using the new api could look like. this method adds a visit for a specific page. this will probably not be commonly used other than for backup/restore type operations. if the uri does not have an entry in the history database already, one will be created with no visits, no title, hidden, not typed. adding a visit ...
nsIPlacesView
attribute type description hasselection boolean whether or not there are selected items. read only. insertionpoint insertionpoint the insertionpoint at which new items will be inserted upon drop, paste, or creation. read only. place string theuri (as a string) of the root place that the view displays. this may be modified dynamically to update the view. see displaying places information using views for examples. selectednode nsinavhistoryresultnode the selected node in the view. if there are multiple selected nodes, this is null. read only. methods getdragableselection() returns an array of selected nsinavhistoryresultnode objects that can be dragged from the view. nsinavhistoryresultnode[] getdragableselection...
nsIProtocolProxyService
ing from position 0). when resolve/asyncresolve is called, it generates a list of proxies for the given uri, and then it applies the proxy filters. the filters have the opportunity to modify the list of proxies. if two filters register for the same position, then the filters will be visited in the order in which they were registered. if the filter is already registered, then its position will be updated. after filters have been run, any disabled or disallowed proxies will be removed from the list. a proxy is disabled if it had previously failed-over to another proxy (see getfailoverforproxy()). a proxy is disallowed, for example, if it is a http proxy and the nsiprotocolhandler for the queried uri does not permit proxying via http. if a nsiprotocolhandler disallows all proxying, then filters ...
nsITextInputProcessor
key operation or representing a change of composition state. for example, the implementation of this interface manages modifier state and composition state, initializes dom events from minimum information, and doesn't dispatch some events if they are not necessary. this means that even when gecko changes the dom event behavior, it may not be necessary that the users of this interface need to be updated, i.e., the implementation of this class can be a cushion from the impact of gecko's change. you can create an instance of this interface with the following code: var tip = components.classes["@mozilla.org/text-input-processor;1"]. createinstance(components.interfaces.nsitextinputprocessor); next, you need to get the rights to create composition or dispatch keyboard events with be...
nsIUrlListManagerCallback
toolkit/components/url-classifier/public/nsiurllistmanager.idlscriptable interface for a class that manages updates of the url classifier database. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void handleevent(in acstring value); methods handleevent() void handleevent( in acstring value ); parameters value ...
nsIWebBrowserChrome
t of the loop if the window is destroyed. void exitmodaleventloop( in nsresult astatus ); parameters astatus the result code to return from showasmodal(). iswindowmodal() is the window modal (that is, currently executing a modal loop)? boolean iswindowmodal(); parameters none. return value true if it's a modal window. setstatus() called when the status text in the chrome needs to be updated. void setstatus( in unsigned long statustype, in wstring status ); parameters statustype indicates what is setting the text. status status string. null is an acceptable value meaning no status. showasmodal() shows the window as a modal window. void showasmodal(); parameters none. return value note: the function error code returned by this corresponds to the status value s...
nsIWebBrowserChrome2
lscriptable an extension to nsiwebbrowserchrome. 1.0 66 introduced gecko 1.9 inherits from: nsiwebbrowserchrome last changed in gecko 1.9 (firefox 3) method overview void setstatuswithcontext(in unsigned long statustype, in astring statustext, in nsisupports statuscontext); methods setstatuswithcontext() called when the status text in the chrome needs to be updated. this method may be called instead of nsiwebbrowserchrome.setstatus(). an implementor of this method, should still implement nsiwebbrowserchrome.setstatus(). void setstatuswithcontext( in unsigned long statustype, in astring statustext, in nsisupports statuscontext ); parameters statustype indicates what is setting the text. statustext status string. null is an acceptable...
nsIWebNavigation
ning of this flag is poorly defined. xxx no one uses this, so we should probably deprecate and remove it. load_flags_is_link 32 this flag specifies that the load should have the semantics of a link click. this flag is only applicable to loaduri. xxx the meaning of this flag is poorly defined. load_flags_bypass_history 64 this flag specifies that history should not be updated. this flag is only applicable to loaduri. load_flags_replace_history 128 this flag specifies that any existing history entry should be replaced. this flag is only applicable to loaduri. load_flags_bypass_cache 256 this flag specifies that the local web cache should be bypassed, but an intermediate proxy cache could still be used to satisfy the load. load_fl...
nsIXULBrowserWindow
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) the xulbrowserwindow attribute exists on the nsixulwindow interface although both firefox and seamonkey also store their nsixulbrowserwindow reference in the global xulbrowserwindow object accessible from javascript code. ...
nsIXULWindow
a docshell tree item and therefore can not be assured of what object it is. it could be an editor, a docshell, or a browser object. or down the road any other object that supports being a docshelltreeitem query accordingly to determine the capabilities. read only. xulbrowserwindow nsixulbrowserwindow provides access to the xulbrowserwindow object offering a way for the browser to update the user interface of the enclosing xul window. zlevel unsigned long one of the z level constants below. on some platforms, windows with a higher zlevel will be kept above windows with a lower zlevel. constants constant value description lowestz 0 loweredz 4 the z level of an independent window opened with the "alwayslowered" c...
nsMsgRuleActionType
defined in comm-central/ mailnews/ base/ search/ public/ nsmsgfiltercore.idl typedef long nsmsgruleactiontype; [scriptable, uuid(59af7696-1e28-4642-a400-fa327ae0b8d8)] interface nsmsgfilteraction { /* if you change these, you need to update filter.properties, look for filteractionx */ /* these longs are all actually of type nsmsgfilteractiontype */ const long custom=-1; /* see nsmsgfilteraction */ const long none=0; /* uninitialized state */ const long movetofolder=1; const long changepriority=2; const long delete=3; const long markread=4; const long killthread=5; const long watchthread=6; const long markflagged=7; const long label=8; const long reply=9; const long forward=10; const long stopexecution=11; ...
Status, Recent Changes, and Plans
...
Using nsCOMPtr
guide introduction using nscomptr summary reference manual the basics initialization and assignment using an nscomptr<t> as a t* efficiency and correctness compiler annoyances frequently asked questions buildtime errors runtime errors how do i... general bibliography original document information author(s): scott collins last updated date: december 11, 2001 copyright information: copyright © 1999, 2000 by the mozilla organization; use is subject to the mpl. portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Using nsIClassInfo
ementing nsiclassinfo, you don't need to do anything to activate the auto-interface magic which makes calling queryinterface unnecessary. it just happens. how do i make my c++ class implement nsiclassinfo? see nsiclassinfoimpl.h for instructions. how does nsiclassinfo work? that's also detailed in nsiclassinfoimpl.h. original document information authors: mike shaver, justin lebar last updated date: july 25, 2011 copyright information: portions of this content are © 1998–2011 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Using nsIDirectoryService
gistering components. if you want to use mpfilelocprovider, or something like it, to provide one fixed profile, just construct it and call its initialize method - it will register itself. again, if you do this, do not initialize the profile service - it's either one or the other. related pages code_snippets:file_i/o original document information authors: conrad carlen, doug turner last updated date: september 26, 2000 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Weak reference
hich would otherwise never be called. you might hold a raw pointer (without addrefing and releaseing it), and avoid using it in cases where it might dangle. see also the source xpcom/base/nsiweakreference.idl xpcom/glue/nsweakreference.h xpcom/glue/nsweakreference.cpp xpcom ownership guidelines using nscomptr original document information author: scott collins last updated date: september 23, 2000 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Working with Multiple Versions of Interfaces
in the extension that prompted this note, i needed to obtain the hwnd of the document (yes its on windows) in order to identify each particular extension instance. to do this i used the accessibility framework: hwnd gethwnd(nsidomnode *node){ hwnd self = null; nsresult rv; nscomptr<nsiaccessibleretrieval> refp; refp = do_createinstance( "@mozilla.org/accessibleretrieval;1", &rv); if (ns_failed(rv)){ return self; } //line 6. ...
XPCOM ownership guidelines
ng-pointers, children point back to their parents with non-owning-pointers. containers own the things they contain (and not the reverse). use nscomptrs to implement owning-pointers. it's explicit, efficient, and fairly bullet-proof. it's easier to write `getter's and `setter's; and you don't need to put anything in your destructor. original document information author: scott collins last updated date: may 8, 2003 copyright information: copyright© 1999 by netscape; use is subject to the npl. portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
XPCOM tasks
uthor's guide, and implementing queryinterface. writing and using components and modules. building ownership models that work (see xpcom ownership guidelines), using raw pointers, nscomptr (see the nscomptr user's manual), nsiweakreference (see nsiweakreference), nscweakreference, and (across threads) proxies (see nsisupports proxies). original document information author(s): unknown last updated date: may 8, 2003 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
XPCOM
asting to and from the clipboard.using the gecko sdkweak referencein xpcom, a weak reference is a special object that contains a pointer to an xpcom object, but doesnot keep that object alive. if the referent object is destroyed before the weak reference, the pointer inside the weak reference is set to nsnull.working with multiple versions of interfacesin this short note we illustrate how one can update an xpcom module in order for it to work in both firefox 2 and firefox 3, even if the interfaces have changed in the interim.working with out parameterswrappedjsobjectwrappedjsobject is a property sometimes available on xpconnect wrappers. when available, it lets you access the javascript object hidden by the wrapper.xpcom abixpcom abi is the binary interface of xpcom components. while xpcom compo...
XUL Overlays
Mozilla › Tech › XUL › Overlays
overlays provide a general mechanism for: adding ui for additional components, as described in the example above overriding small pieces of a xul file without having to resupply the whole ui reusing particular pieces of the ui xul files and overlays work together to describe a single master document. ...
Address Book examples
if you have it in its nsiabcard form, then you can delete it in the same way as per deleting a contact. if you have it in its nsiabdirectory form, then you can delete it like this: var abmanager = components.classes["@mozilla.org/abmanager;1"] ...
Autoconfiguration in Thunderbird
automatic setup. configuration file on harddisk local administrators may place a configuration file in the thunderbird installation folder. this is mainly intended for companies who install thunderbird on their employees' computers and want to enable easy account setup without having to set up a configuration server. this method is not practical for other use cases, because it is difficult to update the configuration file. guessing if all other mechanisms failed, thunderbird tries to guess the configuration, by trying common server names like imap.<domain>, smtp.<domain>, mail.<domain> etc., and, when a mail server answers, checking whether it supports ssl, starttls and encrypted passwords (cram-md5). manual configuration if guessing fails, the user must manually enter the configuratio...
Buddy icons in mail
seth spitzer mozilla is now able to show icons in the message header area and the addressbook card pane. for the message pane, the icon we will show is on disk at: <profile home>/nim/<value of pref aim.session.screenname>/picture/<screenname for sender email address>.gif when trying to determine the screenname for the sender, we search the addressbook that we are using for collection. ...
Cached compose window FAQ
seth spitzer (sspitzer@mozilla.org) what is the "cached" compose window? instead of destroying the mail compose window on send (or close) just to create a new one the next time, mozilla mail will "cache" the compose window on send (or close), and use that instead. the downsides are that we have had some bugs, it complicates and bloats the code, and it requires more testing. the upside is that is has been a major performance win why did you do this? back 0.9.7, we hit a wall with the compose window. ...
MailNews Filters
a parameter, add code to initialize the ui editing an existing filter here and to save to the filter here add your action to filter.properties so it will show up in the filter log. finally, add protocol-specific code to apply your filter action in the various applyfilterhit methods imap pop3 news and "after the fact" since seamonkey and thunderbird share the filter code, you will also need to update the seamonkey .dtd and .property files. i may have missed some places, but that's a start, anyway. it would be really nice if we had a mechanism for extensions to add their own filter actions. most if not all of the above pieces of code would be involved in the extension mechanism. ...
Mail client architecture overview
all of the links seem to be broken. ...
Spam filtering
seth spitzer the mozilla implement is based on paul graham's a plan for spam. 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". initially, the training.dat file is empty (there was discussion of shipping with a default file). on spam detection, the user can choose to move spam to a special "junk" folder. the user can configure junk mail can be automatically purged from the "junk" folder. ...
The libmime module
by richard h. pizzarro <rhp@netscape.com> this module, libmime, implements a general-purpose mime parser. one of the methods provided by this parser is the ability to emit an html representation of the data stream. the parser is object-oriented. there is a class for each mime type, and each class is responsible for parsing itself, and/or handing the input data off to one of its child objects. the definition of these classes is somewhat idiosyncratic and consists of an internally defined object system, instead of c++. ...
Building a Thunderbird extension 3: install manifest
or the top-level domain of your website. while this value is in email address format, it is not an email address. it should, however, be a unique value so that it does not conflict with other extensions. <em:name>my first extension</em:name>: the extension name is displayed in the thunderbird add-on manager. <em:version>1.0</em:version>: this is the version number of your extension. it must be updated each time you release a new version of your extension. it is not the thunderbird version number (which is stored in the minversion and maxversion fields). <em:creator>jenzed</em:creator>: this optional value is used to store the extension author's name. <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>: this element contains the version id of the application that this add on is developed f...
Theme Packaging
ifest"> <em:type>4</em:type> more properties </description> </rdf> required install.rdf properties your install.rdf file must have the following properties. see the install.rdf reference for more information: em:id em:version em:type em:targetapplication em:name em:internalname optional install.rdf properties em:description em:creator em:contributor em:homepageurl em:updateurl note that if your theme will be made available on the https://addons.mozilla.org website, it may not include an updateurl. sample install.rdf file <?xml version="1.0"?> <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <description about="urn:mozilla:install-manifest"> <em:id>{18b64b56-d42f-428d-a88c-baa413bc413f}</em:id> ...
Using the Multiple Accounts API
by alec flett alecf@flett.org structure servers identities storage creating new accounts smtp servers appendix a: listing of all preferences and properties structure the account system consists of: the account manager (nsimsgaccountmanager): there is a single account manager in the the client, which maintains the list of accounts, servers, etc. it is also responsible for the creation of any new account-related objects. the account manager maintains the main list of accounts. ...
libmime content type handlers
by richard h. pizzarro <rhp@netscape.com> contents overview api's plugin location/installation sample content type handler plugin overview the libmime module implements a general-purpose mime parser and one of the primary methods provided by the parser is the ability to emit an html representation of an input stream. the primary use of libmime is to parse and render rfc822 messages for use by the messenger component of seamonkey. a necessary capability of this module is to dynamically add the ability to decode and render various content types. ...
Using tab-modal prompts
prior to gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1), prompts (that is, alerts and other modal prompts) were window modal. that is, when an alert occurred, it blocked the user interface on all tabs in the window until the user dismissed the prompt. window-modal alert. gecko 2.0 introduces tab modal prompts, which only block the tab with which they're associated. only the window.alert() method gets this by default; you get this by default. tab-modal alert. ...
WebIDL bindings
t ints in the array.. sequence<t> sequence<> is a type declared in bindingdeclarations.h and exported to mozilla/dom/bindingdeclarations.h that is used to represent sequence arguments. it's some kind of typed array, but which exact kind is opaque to consumers. this allows the binding code to change the exact definition (e.g., to use auto arrays of different sizes and so forth) without having to update all the callees. callbackfunction callbackfunction is a type declared in callbackfunction.h and exported to mozilla/dom/callbackfunction.h that is used as a common base class for all the generated callback function representations. this class inherits from nsisupports, and consumers must make sure to cycle-collect it, since it keeps js objects alive. callbackinterface callbackinterface is a t...
Add to iPhoto
declare the apis i actually use, not all of them) as a javascript object containing all the types and methods that framework's api. note: in a few cases, this code takes the easy way out by using ctypes.voidptr_t instead of a typed pointer. that's not really the ideal way to do things but saved some time for this simple example. some of this may change as i refine the example in the future; i'll update the article if and when that happens. some global types there are a few global data types used by all of our frameworks. these are declared near the top of the code: const osstatus = ctypes.int32_t; const cfindex = ctypes.long; const optionbits = ctypes.uint32_t; osstatus used to represent the status code resulting from an operation. cfindex a core foundation long integer type used to r...
Standard OS Libraries
he list of the exposed symbols/functions can be found here: gnome developer :: gtk+ reference manual. example: ... // placeholder - example soon to come x11 x11 runs primarily on unix® and unix-like operating systems like linux, all of the bsd variants, sun solaris both native 32 and 64 bit support, solaris x86, mac os x (via darwin) as well as other platforms like os/2 and cygwin. there are updates that happen to x11; at the time of this writing, the latest version is 4.4.0. information on all releases can be found on its official page x11 resources. syntax and variable types are found on the documentation pages linked from this page. for example the documentation for v4.4.0 is seen here: x11 manual pages: section 3. example: xquerypointer get mouse cursor position and some extra informa...
Blocking By Domain - Plugins
rs, social media sites, and other utilities. top sites many popular sites work properly without plugins, but still prompt users for activation. in order to improve site performance and reduce the number of plugin prompts that users see, popular sites that show unnecessary plugin prompts or slow the browser down with unnecessary plugins will be added to the plugin block list. list contents and updates the plugin block lists are freely-licensed lists maintained by mozilla in github. the initial contents of the third-party plugin block list are based on disconnect's open source blocklist. subsequent updates to the list will be made using telemetry from firefox experiments. in general, sites will not be removed from the list unless there is an error that renders a site in a seriously defective ...
URLs - Plugins
usenet articles; alternate to news. prospero (prospero directory service) locates a resource on a prospero directory server. telnet (reference to interactive sessions) locates an interactive service. wais (wide area information servers) locates wais databases and their documents. wysiwyg placed before another url; displays a page that javascript has updated using document.write. for more information, see rfc 3986, "uniform resource identifier (uri): generic syntax", and the iana uri scheme registry. getting urls posting urls getting urls to retrieve a url and display it on a specified target page, use the npn_geturl, npn_geturlnotify, and npp_urlnotify functions. this section describes the methods and procedures used for getting the u...
3D view - Firefox Developer Tools
visible, so that you can see where your elements are located in relation to the visible content. you can click on elements to see their html in the html panel or the style panel. conversely, you can click on elements in the breadcrumb bar to change which element is selected in the 3d view. if you do not see the 3d button in the page inspector, it is possible that your graphics driver needs to be updated. see the blocklisted drivers page for more information. controlling the 3d view there are keyboard shortcuts and mouse controls available for the 3d view. function keyboard mouse zoom in/out + / - scroll wheel up/down rotate left/right a / d mouse left/right rotate up/down w / s mouse up/down pan left/right ← / → m...
DOM Inspector FAQ - Firefox Developer Tools
re is currently no way to inspect dynamically-applied rules for other pseudo-classes or any pseudo-elements from the dom inspector ui. you can, however, find any rule in its parent style sheet (e.g., to modify it) by using the style sheets viewer in the document pane, and locating it in the css rules viewer in the object pane. original document information author(s): christopher aillon last updated date: november 11, 2003 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
DOM Property Viewer - Firefox Developer Tools
property's name, and the right-hand side shows its value. up to three properties of an object and items of an array are displayed. if a property has more elements than this, you'll see a "more..." annotation, and will need to click the property to see all elements. a lock icon indicates that a property is not writable. refreshing the display if the dom changes you can hit the refresh button to update the display: filtering there is a search box within the toolbar: this filters the list to show only items which match the search term. items match the search term if their name contains the search term. matching is case-sensitive. ...
Debug worker threads - Firefox Developer Tools
read. inspecting worker code for example, see the selected item worker.js below — it is listed in a separate thread in the sources list, but appears in the source pane in the same way as main thread code when selected. setting breakpoints, etc. you can set a breakpoint (or logpoint) on any active worker thread: when execution is paused in a worker thread, the context of the debugger is updated to show the correct breakpoints, call stack, etc., just as you'd expect. ...
Debugger.Object - Firefox Developer Tools
d allows debugger code to access debuggee objects through the standard cross-compartment wrappers, rather than via debugger.object’s reflection-oriented interfaces. this method makes it easier to gradually adapt large code bases to this debugger api: adapted portions of the code can use debugger.object instances, but use this method to pass direct object references to code that has not yet been updated. forcelexicalinitializationbyname(binding) ifbinding is in an uninitialized state initialize it to undefined and return true, otherwise do nothing and return false. source metadata generated from file: js/src/doc/debugger/debugger.object.md watermark: sha256:7ae16a834e0883a95b4e0d227193293f6b6e4e4dd812c2570372a39c4c04897b changeset: 5572465c08a9+ ...
Debugger.Object - Firefox Developer Tools
...
Inspecting web sockets - Firefox Developer Tools
he list for just web socket connections. only requests with the 101 status code (websocket protocol handshake) are visible, which indicates that the server is switching to a web socket connection. clicking on a web socket request opens the usual sidebar to reveal additional details. choose the reponse tab to inspect web socket frames sent and received through the selected connection. the live-updated table shows data for sent (green arrow) and received (red arrow) frames. each frame expands on click, so you can inspect the formatted data. pausing web socket traffic you can use the pause/resume button in the network monitor toolbar to stop intercepting web socket traffic. this allows you to capture only the frames that you are interested in. filtering web socket frames to focus on speci...
Edit CSS filters - Firefox Developer Tools
ines, remove them individually, or drag the effects to change the order in which they are applied. you can also add new effects by selecting an effect from the dropdown list at the bottom of the dialog. once you have selected the effect you want to add, click the plus sign (+) to the right of the dropdown list. once you have added an effect, enter the settings you want and then press enter to update the effect. the change will be apparent as soon as youpress enter. saving filter presets from firefox 42 onwards, you can also add filters to a list of presets. the list of presets will be preserved between browser sessions, making it easy to apply the settings in the future. you can save the current filter to the preset list: click to edit the filter, display the preset list by clicking the...
Edit Shape Paths in CSS - Firefox Developer Tools
on to resize horizontally and vertically when you click on the shapes icon. inset() if the value of shape-outside is inset() then you are using the inset basic shape, which enables the creation of offset values pulling the content in from the margin box. each side of the rectangle can be targeted after clicking on the shapes icon to activate the shape path editor, and dragging each side will update the values for the top, right, bottom, and left offset values. polygon() if the value of shape-outside is polygon() then you are using the polygon basic shape. this is the most complex of the basic shape values, therefore the tool gives you more options when editing these: clicking on the shapes icon will activate the shapes path editor and give you the option to move any of the points of ...
UI Tour - Firefox Developer Tools
ment in the inspector. if more than one element has a given property applied to it, click the triangle to show all the occurences. to configure the set of browsers you want the compatibility view to check for, click settings at the bottom of the panel. untick the checkbox for any browser you are not interested in. as new browser versions are released, the version numbers in this list will be updated. fonts view the fonts view shows all the fonts in the page along with editable samples. see view fonts for more details. animations view the animations view gives you details of any animations applied to the selected element, and a controller to pause them: see work with animations for more details. ...
Paint Flashing Tool - Firefox Developer Tools
e page or moves the mouse pointer over an element with a :hover pseudo-class that changes the element's style. repainting can be an expensive operation, so the browser tries to minimise the amount of repainting that it needs to do. it tries to work out which parts of the screen are "damaged" and repaint only those. the browser also splits its model of the page into layers that it expects will be updated independently of each other. layers are painted independently and then composited, so a change in the appearance of one layer does not trigger a repaint in any other layers, and when only the relation of two layers changes (in an animation, for example) no repaints are required at all. the choices made by a web developer can hinder the browser here, causing it to trigger more repaints, and for ...
UI Tour - Firefox Developer Tools
these elements are synchronized, you can correlate events in one element with events in another. for example, in the screenshot below a long-running paint operation (shown as a green bar in the waterfall overview) corresponds to a drop in the frame rate: zooming in you can use the overview to select a slice of the recording to examine in more detail. select a slice, and the main view will be updated to contain just the part selected. in the screenshot below we've selected that drop in the frame rate, and can see the long-running paint operation in more detail: details pane the details pane shows whichever tool is currently selected. to switch to a different tool, use the buttons in the toolbar. waterfall the waterfall presents a view of the work the browser is doing during the recordi...
Performance - Firefox Developer Tools
ite's javascript. allocations see the allocations made by your code over the course of the recording. waterfall understand the work the browser's doing as the user interacts with your site. flame chart see which javascript functions are executing, and when, over the course of the recording. scenarios animating css properties uses the waterfall to understand how the browser updates a page, and how animating different css properties can affect performance. intensive javascript uses the frame rate and waterfall tools to highlight performance problems caused by long-running javascript, and how using workers can help in this situation. ...
Validators - Firefox Developer Tools
...
Web Audio Editor - Firefox Developer Tools
f you click on a node, it's highlighted and you get a node inspector on the right hand side. this list the values of that node's audioparam properties. for example, here's what the oscillatornode looks like: with the violent theremin demo, the frequency parameter is modified as the user moves the mouse left and right, and you can see this reflected in the node inspector. however, the value isn't updated in real time: you have to click the node again to see the updated value. if you click on a value in the node inspector you can modify it: press enter or tab and the new value takes effect immediately. bypassing nodes new in firefox 38. in the pane that shows you the node's details, there's an on/off button: click it, and the graph will be modified to bypass this node, so it will no longer...
ANGLE_instanced_arrays.vertexAttribDivisorANGLE() - Web APIs
imitives with ext.drawarraysinstancedangle() and ext.drawelementsinstancedangle(). note: when using webgl2, this method is available as gl.vertexattribdivisor() by default. syntax void ext.vertexattribdivisorangle(index, divisor); parameters index a gluint specifying the index of the generic vertex attributes. divisor a gluint specifying the number of instances that will pass between updates of the generic attribute. return value none. examples var ext = gl.getextension('angle_instanced_arrays'); ext.vertexattribdivisorangle(0, 2); specifications specification status comment angle_instanced_arraysthe definition of 'angle_instanced_arrays' in that specification. recommendation initial definition. ...
Animation - Web APIs
Web › API › Animation
otherwise be removed due to the browser's automatically removing filling animations behavior. animation.play() starts or resumes playing of an animation, or begins the animation again if it previously finished. animation.reverse() reverses playback direction, stopping at the start of the animation. if the animation is finished or unplayed, it will play from end to beginning. animation.updateplaybackrate() sets the speed of an animation after first synchronizing its playback position. automatically removing filling animations it is possible to trigger a large number of animations on the same element. if they are indefinite (i.e., forwards-filling), this can result in a huge animations list, which could create a memory leak. for this reason, modern browsers have implemented the par...
AnimationEffect - Web APIs
be passed to animation objects for playing, and keyframeeffectreadonly (which is used by css animations and transitions). methods animationeffect.gettiming() returns the effecttiming object associated with the animation containing all the animation's timing values. animationeffect.getcomputedtiming() returns the calculated timing properties for this animationeffect. animationeffect.updatetiming() updates the specified timing properties of this animationeffect. specifications specification status comment web animationsthe definition of 'animationeffect' in that specification. working draft editor's draft. ...
AudioContext.resume() - Web APIs
s when the context has resumed. the promise is rejected if the context has already been closed. example the following snippet is taken from our audiocontext states demo (see it running live.) when the suspend/resume button is clicked, the audiocontext.state is queried — if it is running, suspend() is called; if it is suspended, resume() is called. in each case, the text label of the button is updated as appropriate once the promise resolves. susresbtn.onclick = function() { if(audioctx.state === 'running') { audioctx.suspend().then(function() { susresbtn.textcontent = 'resume context'; }); } else if(audioctx.state === 'suspended') { audioctx.resume().then(function() { susresbtn.textcontent = 'suspend context'; }); } } specifications specificat...
AudioContext.suspend() - Web APIs
romise that resolves with void. the promise is rejected if the context has already been closed. example the following snippet is taken from our audiocontext states demo (see it running live.) when the suspend/resume button is clicked, the audiocontext.state is queried — if it is running, suspend() is called; if it is suspended, resume() is called. in each case, the text label of the button is updated as appropriate once the promise resolves. susresbtn.onclick = function() { if(audioctx.state === 'running') { audioctx.suspend().then(function() { susresbtn.textcontent = 'resume context'; }); } else if(audioctx.state === 'suspended') { audioctx.resume().then(function() { susresbtn.textcontent = 'suspend context'; }); } } specifications specificat...
AudioListener.dopplerFactor - Web APIs
actor = 1; value a double indicating the doppler effect's pitch shift value. the value is 1 by default. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values fo...
AudioListener.forwardX - Web APIs
; value an audioparam. its default value is 0, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values fo...
AudioListener.forwardY - Web APIs
; value an audioparam. its default value is 0, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values fo...
AudioListener.forwardZ - Web APIs
value an audioparam. its default value is -1, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values fo...
AudioListener.positionX - Web APIs
; value an audioparam. its default value is 0, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values fo...
AudioListener.positionY - Web APIs
; value an audioparam. its default value is 0, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values fo...
AudioListener.positionZ - Web APIs
; value an audioparam. its default value is 0, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values fo...
AudioListener.setOrientation() - Web APIs
diocontext(); var mylistener = audioctx.listener; mylistener.setorientation(0,0,-1,0,1,0); returns void. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values fo...
AudioListener.setPosition() - Web APIs
x = new audiocontext(); var mylistener = audioctx.listener; mylistener.setposition(1,1,1); returns void. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values fo...
AudioListener.speedOfSound - Web APIs
ew audiocontext(); var mylistener = audioctx.listener; mylistener.speedofsound = 343.3; value a double. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values fo...
AudioListener.upX - Web APIs
Web › API › AudioListener › upX
; value an audioparam. its default value is 0, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values fo...
AudioListener.upY - Web APIs
Web › API › AudioListener › upY
; value an audioparam. its default value is 1, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values fo...
AudioListener.upZ - Web APIs
Web › API › AudioListener › upZ
; value an audioparam. its default value is 0, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values fo...
AudioListener - Web APIs
x, y, z) can be achieved by setting positionx.value, positiony.value, and positionz.value respectively. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values fo...
AudioTrackList - Web APIs
ent's audio track list to get a media element's audiotracklist, use its audiotracks property. var audiotracks = document.queryselector("video").audiotracks; monitoring track count changes in this example, we have an app that displays information about the number of channels available. to keep it up to date, handlers for the addtrack and removetrack events are set up. audiotracks.onaddtrack = updatetrackcount; audiotracks.onremovetrack = updatetrackcount; function updatetrackcount(event) { trackcount = audiotracks.length; drawtrackcountindicator(trackcount); } specifications specification status comment html living standardthe definition of 'audiotracklist' in that specification. living standard html5the definition of 'audiotracklist' in t...
BaseAudioContext.createPanner() - Web APIs
tation of the person listening to the audio. syntax baseaudioctx.createpanner(); returns a pannernode. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values fo...
BaseAudioContext.createStereoPanner() - Web APIs
example in our stereopannernode example (see source code) html we have a simple <audio> element along with a slider <input> to increase and decrease pan value. in the javascript we create a mediaelementaudiosourcenode and a stereopannernode, and connect the two together using the connect() method. we then use an oninput event handler to change the value of the stereopannernode.pan parameter and update the pan value display when the slider is moved. moving the slider left and right while the music is playing pans the music across to the left and right speakers of the output, respectively. var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var myaudio = document.queryselector('audio'); var pancontrol = document.queryselector('.panning-control'); var panvalue = document.q...
BatteryManager.onchargingchange - Web APIs
syntax battery.onchargingchange = funcref where battery is a batterymanager object, and funcref is a function to be called when the chargingchange event occurs. ...
BatteryManager.onchargingtimechange - Web APIs
syntax battery.onchargingtimechange = funcref where battery is a batterymanager object, and funcref is a function to be called when the chargingtimechange event occurs. ...
BatteryManager.ondischargingtimechange - Web APIs
syntax battery.ondischargingtimechange = funcref where battery is a batterymanager object, and funcref is a function to be called when the dischargingtimechange event occurs. ...
BatteryManager.onlevelchange - Web APIs
syntax navigator.battery.onlevelchange = funcref where battery is a batterymanager object, and funcref is a function to be called when the levelchange event occurs. ...
BluetoothRemoteGATTCharacteristic - Web APIs
eristic.uuidread only returns a domstring containing the uuid of the characteristic, for example '00002a37-0000-1000-8000-00805f9b34fb' for the heart rate measurement characteristic. bluetoothremotegattcharacteristic.propertiesread only returns the properties of this characteristic. bluetoothremotegattcharacteristic.valueread only the currently cached characteristic value. this value gets updated when the value of the characteristic is read or updated via a notification or indication. methods bluetoothremotegattcharacteristic.getdescriptor() returns a promise that resolves to the first bluetoothgattdescriptor for a given descriptor uuid. bluetoothremotegattcharacteristic.getdescriptors() returns a promise that resolves to an array of all bluetoothgattdescriptor objects for a give...
value - Web APIs
syntax var characteristic = bluetoothremotegattdescriptor.characteristic returns an arraybuffer. specifications specification status comment web bluetooththe definition of 'value' in that specification. draft initial definition. browser compatibility the compatibility table on this page is generated from structured data. ...
BluetoothRemoteGATTDescriptor - Web APIs
ead only returns the bluetoothremotegattcharacteristic this descriptor belongs to. bluetoothremotegattdescriptor.uuidread only returns the uuid of the characteristic descriptor, for example '00002902-0000-1000-8000-00805f9b34fb' for theclient characteristic configuration descriptor. bluetoothremotegattdescriptor.valueread only returns the currently cached descriptor value. this value gets updated when the value of the descriptor is read. methods bluetoothremotegattdescriptor.readvalue() returns a promise that resolves to an arraybuffer holding a duplicate of the value property if it is available and supported. otherwise it throws an error. bluetoothremotegattdescriptor.writevalue() sets the value property to the bytes contained in an arraybuffer and returns a promise. specific...
CSSStyleDeclaration.setProperty() - Web APIs
contained inside the stylesheet, which are contained in the array found at stylesheet.cssrules; for each one, we check whether its cssstylerule.selectortext property is equal to the selector .box p, which indicates it is the one we want. if so, we store a reference to this cssstylerule object in a variable. we then use three functions to generate random values for the properties in question, and update the rule with these values. in each case, this is done with the setproperty() method, for example boxpararule.style.setproperty('border', newborder); html <div class="controls"> <button class="border">border</button> <button class="bgcolor">background</button> <button class="color">text</button> </div> <div class="box"> <p>box</p> </div> css html { background: orange; font-family:...
Using the CSS properties and values API - Web APIs
value may be until it's calculated, and because of that, it can't set up a transition from one value to another. when registered, though, you've told the browser what type of value it should expect, and because it knows that, it can then set up the transitions properly. gotchas there are two gotchas when registering a property. the first is that, once a property is registered, there's no way to update it, and trying to re-register it with javascript will throw an error indicating it's already been defined. second, unlike standard properties, registered properties aren't validated when they're parsed. rather, they're validated when they're computed. that means both that invalid values won't appear as invalid when inspecting the element's properties, and that including an invalid property after...
Using the CSS Typed Object Model - Web APIs
object containing the size property, which indicates how many properties are in the map. we iterate through the style map, creating a <dt> and <dd> for each property and value respectively. in browsers that support computedstylemap(), you'll see a list of all the css properties and values. in other browsers, you'll just see a link. did you realize how many default css properties a link had? update the javascript on line 2 to select the <p> rather than the <a>. you'll notice a difference in the margin-top and margin-bottom default computed values. .get() method / custom properties let's update our example to only retrieve a few properties and values. let's start by adding some css to our example, including a custom property and an inhertable property: p { font-weight: bold; } a { ...
Cache.delete() - Web APIs
Web › API › Cache › delete
ect has a vary header. it defaults to false. cachename: a domstring that represents a specific cache to search within. note that this option is ignored by cache.delete(). return value a promise that resolves to true if the cache entry is deleted, or false otherwise. examples caches.open('v1').then(function(cache) { cache.delete('/images/image.png').then(function(response) { someuiupdatefunction(); }); }) specifications specification status comment service workersthe definition of 'cache: delete' in that specification. working draft initial definition. ...
Cache - Web APIs
Web › API › Cache
ached, for example as part of the serviceworker life cycle. note that the cache interface is exposed to windowed scopes as well as workers. you don't have to use it in conjunction with service workers, even though it is defined in the service worker spec. an origin can have multiple, named cache objects. you are responsible for implementing how your script (e.g. in a serviceworker) handles cache updates. items in a cache do not get updated unless explicitly requested; they don’t expire unless deleted. use cachestorage.open() to open a specific named cache object and then call any of the cache methods to maintain the cache. you are also responsible for periodically purging cache entries. each browser has a hard limit on the amount of cache storage that a given origin can use. cache quota usag...
CanvasPattern.setTransform() - Web APIs
t'); pattern.settransform(matrix.rotate(-45).scale(1.5)); ctx.fillstyle = pattern; ctx.fillrect(0, 0, 400, 400); }; note that newer browser versions started to support dommatrix as an input to settransform(), so for example you could replace the svgmatrix in the above example with the following: const matrix = new dommatrix([1, .2, .8, 1, 0, 0]); edit the code below and see your changes update live in the canvas: playable code <canvas id="canvas" width="400" height="200" class="playable-canvas"></canvas> <svg id="svg1" style="display:none"></svg> <div class="playable-buttons"> <input id="edit" type="button" value="edit" /> <input id="reset" type="button" value="reset" /> </div> <textarea id="code" class="playable-code" style="height:120px"> var img = new image(); img.src = 'http...
CanvasRenderingContext2D.addHitRegion() - Web APIs
(if you don't see the full smiley, check the browser compatibility table to see if your current browser supports hit regions already; you might need to activate a preference.) playable code <canvas id="canvas" width="400" height="200" class="playable-canvas"></canvas> <div class="playable-buttons"> <input id="edit" type="button" value="edit" /> <input id="reset" type="b...
CanvasRenderingContext2D.scrollPathIntoView() - Web APIs
meters path a path2d path to use. examples using the scrollpathintoview method this example demonstrates the scrollpathintoview() method. ...
Drawing shapes with canvas - Web APIs
his can be useful when you want to build objects from several components, for example. path2d.addpath(path [, transform]) adds a path to the current path with an optional transformation matrix. path2d example in this example, we are creating a rectangle and a circle. both are stored as a path2d object, so that they are available for later usage. with the new path2d api, several methods got updated to optionally accept a path2d object to use instead of the current path. here, stroke and fill are used with a path argument to draw both objects onto the canvas, for example. <html> <body onload="draw();"> <canvas id="canvas" width="130" height="100"></canvas> </body> </html> function draw() { var canvas = document.getelementbyid('canvas'); if (canvas.getcontext) { var ctx = c...
Drawing text - Web APIs
om. the default value is alphabetic. direction = value directionality. possible values: ltr, rtl, inherit. the default value is inherit. these properties might be familiar to you, if you have worked with css before. the following diagram from the whatwg demonstrates the various baselines supported by the textbaseline property. ...
Clipboard.writeText() - Web APIs
clipboard apis is still in the process of being implemented. be sure to check the compatibility table as well as clipboard availability in clipboard for more information. syntax var promise = navigator.clipboard.writetext(newcliptext) parameters newcliptext the domstring to be written to the clipboard. return value a promise which is resolved once the clipboard's contents have been updated. the promise is rejected if the caller does not have permission to write to the clipboard. example this example sets the clipboard's contents to the string "<empty clipboard>". navigator.clipboard.writetext("<empty clipboard>").then(function() { /* clipboard successfully set */ }, function() { /* clipboard write failed */ }); specifications specification status comment ...
CompositionEvent.data - Web APIs
e compositionevent object. syntax mydata = compositionevent.data value a domstring representing the event data: for compositionstart events, this is the currently selected text that will be replaced by the string being composed. this value doesn't change even if content changes the selection range; rather, it indicates the string that was selected when composition started. for compositionupdate, this is the string as it stands currently as editing is ongoing. for compositionend events, this is the string as committed to the editor. specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'data' in that specification. obsolete initial definition. ...
CompositionEvent.initCompositionEvent() - Web APIs
the initcompositionevent() method of the compositionevent interface initializes the attributes of a compositionevent object instance. syntax compositioneventinstance.initcompositionevent(typearg, canbubblearg, cancelablearg, viewarg, dataarg, localearg) parameters typearg a domstring representing the type of composition event; this will be one of compositionstart, compositionupdate, or compositionend. canbubblearg a boolean specifying whether or not the event can bubble. cancelablearg a boolean shether or not the event can be canceled. viewarg the window object from which the event was generated. dataarg a domstring representing the value of the data attribute. localearg a domstring representing the value of the locale attribute. return value void. specifications ...
console.log() - Web APIs
Web › API › Console › log
ul when trying to see the full representation of the dom js object. there's more information in the chrome console api reference about this and other functions. logging objects don't use console.log(obj), use console.log(json.parse(json.stringify(obj))). this way you are sure you are seeing the value of obj at the moment you log it. otherwise, many browsers provide a live view that constantly updates as values change. this may not be what you want. specifications specification status comment console apithe definition of 'console.log()' in that specification. living standard initial definition ...
CustomElementRegistry.define() - Web APIs
| node.textcontent return text.split(/\s+/g).length; } var count = 'words: ' + countwords(wcparent); // create a shadow root var shadow = this.attachshadow({mode: 'open'}); // create text node and add word count to it var text = document.createelement('span'); text.textcontent = count; // append it to the shadow root shadow.appendchild(text); // update count when element content changes setinterval(function() { var count = 'words: ' + countwords(wcparent); text.textcontent = count; }, 200) } } // define the new element customelements.define('word-count', wordcount, { extends: 'p' }); <p is="word-count"></p> specifications specification status comment html living standardthe definition of 'custo...
CustomElementRegistry - Web APIs
specifications specification stat...
DOMTokenList - Web APIs
ing you to go through all keys of the key/value pairs contained in this object. domtokenlist.values() returns an iterator, allowing you to go through all values of the key/value pairs contained in this object. examples in the following simple example, we retrieve the list of classes set on a <p> element as a domtokenlist using element.classlist, add a class using domtokenlist.add(), and then update the node.textcontent of the <p> to equal the domtokenlist. first, the html: <p class="a b c"></p> now the javascript: let para = document.queryselector("p"); let classes = para.classlist; para.classlist.add("d"); para.textcontent = `paragraph classlist is "${classes}"`; the output looks like this: trimming of whitespace and removal of duplicates methods that modify the domtokenlist (such...
Detecting device orientation - Web APIs
for normalizing the accelerometer and gyroscope data on mobile devices. this is useful for overcoming some of the differences in device support for device orientation. window.addeventlistener("deviceorientation", handleorientation, true); after registering your event listener (in this case, a javascript function called handleorientation()), your listener function periodically gets called with updated orientation data. the orientation event contains four values: deviceorientationevent.absolute deviceorientationevent.alpha deviceorientationevent.beta deviceorientationevent.gamma the event handler function can look something like this: function handleorientation(event) { var absolute = event.absolute; var alpha = event.alpha; var beta = event.beta; var gamma = event.
DirectoryEntrySync - Web APIs
the directoryentrysync interface of the file system api represents a directory in a file system. it includes methods for creating, reading, looking up, and recursively removing files in a directory. this interface has been abandonned: it was on a standard track and it proves not a good idea. do not use it anymore. about this document this document was last updated on march 2, 2012 and follows the w3c specifications (working draft) drafted on april 19, 2011. this specification is pretty much abandoned, having failed to reach any substantial traction. basic concepts if you want to create subdirectories, you have to create each child directory in sequence. if you try to create a directory using a full path that includes parent directories that do not exist yet, you get an error. so creat...
DirectoryReaderSync - Web APIs
this specification is pretty much abandoned, having failed to reach any substantial traction. ...
Document.cookie - Web APIs
Web › API › Document › cookie
semicolon-separated list of all cookies (i.e. key=value pairs). note that each key and value may be surrounded by whitespace (space and tab characters): in fact, rfc 6265 mandates a single space after each semicolon, but some user agents may not abide by this. write a new cookie document.cookie = newcookie; in the code above, newcookie is a string of form key=value. note that you can only set/update a single cookie at a time using this method. consider also that: any of the following cookie attribute values can optionally follow the key-value pair, specifying the cookie to set/update, and preceded by a semi-colon separator: ;path=path (e.g., '/', '/mydir') if not specified, defaults to the current path of the current document location. note: prior to gecko 6.0, paths with ...
Document.getElementsByName() - Web APIs
name is the value of the name attribute of the element(s). ...
Document.getElementsByTagName() - Web APIs
syntax var elements = document.getelementsbytagname(name); elements is a live htmlcollection (but see the note below) of found elements in the order they appear in the tree. ...
Document: visibilitychange event - Web APIs
the visibilitychange event is fired at the document when the content of its tab have become visible or have been hidden. bubbles yes cancelable no interface event event handler property onvisibilitychange usage notes the event doesn't include the document's updated visibility status, but you can get that information from the document's visibilitystate property. examples this example begins playing a music track when the document becomes visible, and pauses the music when the document is no longer visible. document.addeventlistener("visibilitychange", function() { if (document.visibilitystate === 'visible') { backgroundmusic.play(); } else { backgroundmusic.pause(); } }); specifications specification status ...
Document - Web APIs
Web › API › Document
ent is raised. globaleventhandlers.onstalled is an eventhandler representing the code to be called when the stalled event is raised. globaleventhandlers.onsubmit is an eventhandler representing the code to be called when the submit event is raised. globaleventhandlers.onsuspend is an eventhandler representing the code to be called when the suspend event is raised. globaleventhandlers.ontimeupdate is an eventhandler representing the code to be called when the timeupdate event is raised. globaleventhandlers.onvolumechange is an eventhandler representing the code to be called when the volumechange event is raised. globaleventhandlers.ontouchcancel is an eventhandler representing the code to be called when the touchcancel event is raised. globaleventhandlers.ontouchend is an ev...
Examples of web and XML development using the DOM - Web APIs
ch changes the value in the bottom cell of the table. however, stopevent also calls an event object method, event.stoppropagation, which keeps the event from bubbling any further up into the dom. note that the table itself has an onclick event handler that ought to display a message when the table is clicked. but the stopevent method has stopped propagation, and so after the data in the table is updated, the event phase is effectively ended, and an alert box is displayed to confirm this. <!doctype html> <html lang="en"> <head> <title>event propagation</title> <style> #t-daddy { border: 1px solid red } #c1 { background-color: pink; } </style> <script> function stopevent(ev) { c2 = document.getelementbyid("c2"); c2.innerhtml = "hello"; // this ought to keep t-daddy from getting the clic...
EffectTiming.fill - Web APIs
Web › API › EffectTiming › fill
y to use a fill mode temporarily to capture the final value of an animation before canceling it. elem.addeventlistener('click', async evt => { const animation = elem.animate( { transform: `translate(${evt.clientx}px, ${evt.clienty}px)` }, { duration: 800, fill: 'forwards' } ); await animation.finished; // commitstyles will record the style up to and including `animation` and // update elem’s specified style with the result. animation.commitstyles(); animation.cancel(); }); specifications specification status comment web animationsthe definition of 'fill' in that specification. working draft editor's draft. ...
Element.attachShadow() - Web APIs
li...
Element: compositionend event - Web APIs
nst log = document.queryselector('.event-log-contents'); const clearlog = document.queryselector('.clear-log'); clearlog.addeventlistener('click', () => { log.textcontent = ''; }); function handleevent(event) { log.textcontent = log.textcontent + `${event.type}: ${event.data}\n`; } inputelement.addeventlistener('compositionstart', handleevent); inputelement.addeventlistener('compositionupdate', handleevent); inputelement.addeventlistener('compositionend', handleevent); result specifications specification status ui events working draft ...
Element: compositionstart event - Web APIs
nst log = document.queryselector('.event-log-contents'); const clearlog = document.queryselector('.clear-log'); clearlog.addeventlistener('click', () => { log.textcontent = ''; }); function handleevent(event) { log.textcontent = log.textcontent + `${event.type}: ${event.data}\n`; } inputelement.addeventlistener('compositionstart', handleevent); inputelement.addeventlistener('compositionupdate', handleevent); inputelement.addeventlistener('compositionend', handleevent); result specifications specification status ui events working draft ...
Element.computedStyleMap() - Web APIs
p)); styleslist.appendchild(cssproperty); // values const cssvalue = document.createelement('dd'); cssvalue.appendchild(document.createtextnode(val)); styleslist.appendchild(cssvalue); } in browsers that support computedstylemap(), you'll see a list of all the css properties and values. in other browsers you'll just see a link. did you realize how many default css properties a link had? update the 'a' to the 'p', and you'll notice a difference in the margin-top and margin-bottom default computed values. specifications specification status comment css typed om level 1the definition of 'computedstylemap()' in that specification. working draft initial definition. ...
Element: cut event - Web APIs
Web › API › Element › cut event
is to copy the current selection (if any) to the system clipboard and remove it from the document. a handler for this event can modify the clipboard contents by calling setdata(format, data) on the event's clipboardevent.clipboarddata property, and cancelling the default action using event.preventdefault(). note though that cancelling the default action will also prevent the document from being updated. so an event handler which wants to emulate the default action for "cut" while modifying the clipboard must also manually remove the selection from the document. the handler cannot read the clipboard data. it's possible to construct and dispatch a synthetic cut event, but this will not affect the system clipboard or the document's contents. examples live example html <div class="source" co...
Element.getElementsByTagName() - Web APIs
therefore, there is no need to call element.getelementsbytagname() with the same element and arguments repeatedly if the dom changes in between calls. when called on an html element in an html document, getelementsbytagname lower-cases the argument before searching for it. ...
Element: mousewheel event - Web APIs
the mousewheel event was never part of any standard, and while it was implemented by several browsers, it was never implemented by firefox. important: instead of this obsolete event, use the standard wheel event. ...
Element.setAttribute() - Web APIs
to get the current value of an attribute, use getattribute(); to remove an attribute, call removeattribute(). syntax element.setattribute(name, value); parameters name a domstring specifying the name of the attribute whose value is to be set. the attribute name is automatically converted to all lower-case when setattribute() is called on an html element in an html document. value a domstring containing the value to assign to the attribute. ...
Element - Web APIs
Web › API › Element
initiates a paste action through the browser's user interface. also available via the onpaste property. composition events compositionend fired when a text composition system such as an input method editor completes or cancels the current composition session. compositionstart fired when a text composition system such as an input method editor starts a new composition session. compositionupdate fired when a new character is received in the context of a text composition session controlled by a text composition system such as an input method editor. focus events blur fired when an element has lost focus. also available via the onblur property. focus fired when an element has gained focus. also available via the onfocus property focusin fired when an element is about to gain f...
Event - Web APIs
Web › API › Event
pr...
ExtendableEvent.waitUntil() - Web APIs
re, and the installing service worker is discarded. this is primarily used to ensure that a service worker is not considered installed until all of the core caches it depends on are successfully populated. the activate events in service workers use waituntil() to buffer functional events such as fetch and push until the promise passed to waituntil() settles. this gives the service worker time to update database schemas and delete outdated caches, so other events can rely on a completely upgraded state. the waituntil() method must be initially called within the event callback, but after that it can be called multiple times, until all the promises passed to it settle. note: the behaviour described in the above paragraph was fixed in firefox 43 (see bug 1180274). syntax extendableevent.waitu...
Fetch API - Web APIs
Web › API › Fetch API
ting. fetch() won't can receive cross-site cookies; you can’t can establish a cross site session using fetch. set-cookie headers from other sites are silently ignored. fetch() won’t send cookies, unless you set credentials: 'same-origin'. in august 2017, the spec changed the default credentials policy to 'same-origin'. the following browsers shipped and outdated native fetch, and were updated in these versions: firefox version 61.0b13. safari version 12. chrome version 68. if you are targetting older versions of these browsers, be sure to include credentials: 'same-origin' init option on all api requests that may be affected by cookies/user login state. note: find out more about using the fetch api features in using fetch, and study concepts in...
FileEntrySync - Web APIs
this specification is more or less abandoned as it didn't get significant traction among browser makers. basic concepts to write content to file, create a filewriter object by calling createwriter(). ...
FileSystemEntry.getParent() - Web APIs
s from the actual state of the file system. fileerror.not_found_err the specified path could not be found. fileerror.security_err security restrictions prohibit obtaining the parent directory's information. example this example renames the file specified by the variable fileentry to "newname.html". fileentry.getparent(function(parent) { fileentry.moveto(parent, "newname.html", function(updatedentry) { console.log("file " + fileentry.name + " renamed to newname.html."); }); }, function(error) { console.error("an error occurred: unable to rename " + fileentry.name + " to newname.html."); }); this is accomplished by first obtaining a filesystemdirectoryentry object representing the directory the file is currently located in. then moveto() is used to rename the file withi...
FileSystemSync - Web APIs
the specification is abandonned for the moment, failing to get significant traction. basic concepts the filesystemsync object is your gateway to the entire api and you will use it a lot. so once you have a reference, cache the object in a global variable or class property. ...
File and Directory Entries API support in Firefox - Web APIs
ctoryentrysync filesystemdirectoryreader directoryreader filesystemdirectoryreadersync directoryreadersync filesystementry entry filesystementrysync entrysync filesystemfileentry fileentry filesystemfileentrysync fileentrysync be sure to account for this in your code by allowing for both names. hopefully chrome will be updated soon to use the newer names! to ensure your code will work in both chrome and other browsers, you can include code similar to the following: var filesystemdirectoryentry = window.filesystemdirectoryentry || window.directoryentry; var filesystementry = window.filesystementry || window.entry; limitations in firefox next, let's look at limitations of the firefox implementation of the api. in b...
Gamepad - Web APIs
Web › API › Gamepad
information about the controller. gamepad.index read only an integer that is auto-incremented to be unique for each device currently connected to the system. gamepad.mapping read only a string indicating whether the browser has remapped the controls on the device to a known layout. gamepad.timestamp read only a domhighrestimestamp representing the last time the data for this gamepad was updated. experimental extensions to gamepad the following interfaces are defined in the gamepad extensions specification, and provide access to experimental features like haptic feedback and webvr controller pose information. gamepad.hand read only an enum defining what hand the controller is being held in, or is most likely to be held in. gamepad.hapticactuators read only an array containing...
GeolocationCoordinates.longitude - Web APIs
on receiving a click event, we call getcurrentposition() to request the device's current position. this is an asynchronous request, so we provide a callback which receives as in put a geolocationposition object describing the determined position. from the geolocationposition object, we obtain the user's latitude and longitude using position.coords.latitude and position.coords.longitude so we can update the displayed coordinates. the two <span> elements are updated to display the corresponding values after being converted to a value with two decimal places. html the html used to present the results looks like this: <p> your location is <span id="latitude">0.00</span>° latitude by <span id="longitude">0.00</span>° longitude. </p> <button id="get-location"> get my location </button> re...
Using the Geolocation API - Web APIs
getcurrentposition((position) => { dosomething(position.coords.latitude, position.coords.longitude); }); the above example will cause the dosomething() function to execute when the location is obtained. watching the current position if the position data changes (either by device movement or if more accurate geo information arrives), you can set up a callback function that is called with that updated position information. this is done using the watchposition() function, which has the same input parameters as getcurrentposition(). the callback function is called multiple times, allowing the browser to either update your location as you move, or provide a more accurate location as different techniques are used to geolocate you. the error callback function, which is optional just as it is for g...
Geolocation API - Web APIs
ilable functionality on the device to access this information (for example, gps). the developer can now access this location information in a couple of different ways: geolocation.getcurrentposition(): retrieves the device's current location. geolocation.watchposition(): registers a handler function that will be called automatically each time the position of the device changes, returning the updated location. in both cases, the method call takes up to three arguments: a mandatory success callback: if the location retrieval is successful, the callback executes with a geolocationposition object as its only parameter, providing access to the location data. an optional error callback: if the location retrieval is unsuccessful, the callback executes with a geolocationpositionerror object a...
GlobalEventHandlers.onanimationiteration - Web APIs
play").innerhtml = "start iteration #" + (iterationcounter+1); }; this sets up two global variables: box, which references the "box" element that we're animating, and iterationcounter, which is initially zero, which indicates how many iterations of the animation have occurred. the onanimationiteration event handler is then set up. it simply sets the box's animation-play-state to "paused", then updates the text displayed in the button to indicate that clicking the button will start playing the next iteration of theanimation. finally, we set up a handler for a click on the button that runs the animation: document.getelementbyid("play").addeventlistener("click", function(event) { box.style.animationplaystate = "running"; iterationcounter++; }, false); this sets the box element's animation...
GlobalEventHandlers.onauxclick - Web APIs
enthandler for processing auxclick events. the auxclick event is raised when a non-primary button has been pressed on an input device (e.g., a middle mouse button). it fires after the mousedown and mouseup events, in that order. note: browser vendors are implementing this property as part of a plan to improve compatibility with regards to button behaviors. specifically, event behavior is being updated so that click only fires for primary button clicks (e.g., left mouse button), while auxclick fires for non-primary button clicks. historically, click has generally fired for the click of any device input button, although with browser behavior being somewhat inconsistent. syntax target.onauxclick = functionref; value functionref is a function name or a function expression. the function rece...
GlobalEventHandlers.ondurationchange - Web APIs
the ondurationchange property of the globaleventhandlers mixin is the eventhandler for processing durationchange events. the durationchange event is fired when the duration attribute has been updated. syntax element.ondurationchange = handlerfunction; var handlerfunction = element.ondurationchange; handlerfunction is either null or a javascript function specifying the handler for the event. specification specification status comment html living standardthe definition of 'ondurationchange' in that specification. living standard ...
GlobalEventHandlers.ontransitioncancel - Web APIs
ransition-duration. note: elapsedtime does not include time prior to the transition effect beginning; that means that the value of transition-delay doesn't affect the value of elapsedtime, which is zero until the delay period ends and the animation begins. example in this example, we use the transitionrun and transitionend events to detect when the transition begins and ends, to cause a text update to occur during the transition. this could also be used to trigger animations or other effects, to allow chaining of reactions. in addition, we also use a click event to make the box dissappear (display: none;), showing how it triggers the transitioncancel event to fire. html this simply creates a <div> which we'll style with css below to make into a box that resizes and changes color and such...
GlobalEventHandlers.ontransitionend - Web APIs
e of transition-duration. elapsedtime does not include time prior to the transition effect beginning; that means that the value of transition-delay doesn't affect the value of elapsedtime, which is zero until the delay period ends and the animation begins. example in this example, we use the transitionrun and transitionend events to detect when the transition begins and ends, to cause a text update to occur during the transition. this could also be used to trigger animations or other effects, to allow chaining of reactions. html this simply creates a <div> which we'll style with css below to make into a box that resizes and changes color and such. <div class="box"></div> css the css below styles the box and applies a transition effect which makes the box's color and size change, and c...
GlobalEventHandlers - Web APIs
ent is raised. globaleventhandlers.onstalled is an eventhandler representing the code to be called when the stalled event is raised. globaleventhandlers.onsubmit is an eventhandler representing the code to be called when the submit event is raised. globaleventhandlers.onsuspend is an eventhandler representing the code to be called when the suspend event is raised. globaleventhandlers.ontimeupdate is an eventhandler representing the code to be called when the timeupdate event is raised. globaleventhandlers.onvolumechange is an eventhandler representing the code to be called when the volumechange event is raised. globaleventhandlers.ontouchcancel is an eventhandler representing the code to be called when the touchcancel event is raised. globaleventhandlers.ontouchend is an ev...
HTMLCollection - Web APIs
generic collection (array-like object similar to arguments) of elements (in document order) and offers methods and properties for selecting from the list. note: this interface is called htmlcollection for historical reasons (before the modern dom, collections implementing this interface could only have html elements as their items). an htmlcollection in the html dom is live; it is automatically updated when the underlying document is changed. properties htmlcollection.length read only returns the number of items in the collection. methods htmlcollection.item() returns the specific node at the given zero-based index into the list. returns null if the index is out of range. an alternative to accessing collection[i] (which instead returns undefined when i is out-of-bounds). this is ...
HTMLElement: change event - Web APIs
cluding <input type="text">, the change event doesn't fire until the control loses focus. try entering something into the field below, and then click somewhere else to trigger the event. html <input placeholder="enter some text" name="name"/> <p id="log"></p> javascript const input = document.queryselector('input'); const log = document.getelementbyid('log'); input.addeventlistener('change', updatevalue); function updatevalue(e) { log.textcontent = e.target.value; } result specifications specification status html living standardthe definition of 'change' in that specification. living standard ...
HTMLElement.dir - Web APIs
Web › API › HTMLElement › dir
rectionality of its parent element. browsers might allow users to change the directionality of <input> and <textarea>s in order to assist with authoring content. chrome and safari provide a directionality option in the contextual menu of input fields while internet explorer and edge use the key combinations ctrl + left shift and ctrl + right shift. firefox uses ctrl/cmd + shift + x but does not update the dir attribute value. syntax var currentwritingdirection = elementnodereference.dir; elementnodereference.dir = newwritingdirection; currentwritingdirection is a string variable representing the text writing direction of the current element. newwritingdirection is a string variable representing the text writing direction value. possible values for dir are ltr, for left-to-right, rtl,...
HTMLElement: input event - Web APIs
h as by pressing the enter key, selecting a value from a list of options, and the like. examples this example logs the value whenever you change the value of the <input> element. html <input placeholder="enter some text" name="name"/> <p id="values"></p> javascript const input = document.queryselector('input'); const log = document.getelementbyid('values'); input.addeventlistener('input', updatevalue); function updatevalue(e) { log.textcontent = e.target.value; } result specifications specification status html living standardthe definition of 'input event' in that specification. living standard document object model (dom) level 3 events specificationthe definition of 'input event' in that specification. obsolete ...
HTMLHyperlinkElementUtils.href - Web APIs
the htmlhyperlinkelementutils.href property is a stringifier that returns a usvstring containing the whole url, and allows the href to be updated. syntax string = object.href; object.href = string; examples // lets imagine an <a id="myanchor" href="https://developer.mozilla.org/htmlhyperlinkelementutils/href"> element is in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.href; // returns: 'https://developer.mozilla.org/htmlhyperlinkelementutils/href' specifications specification status comment html living standardthe definition of 'htmlhyperlinkelementutils.href' in that specification. living standard initial definition. ...
HTMLHyperlinkElementUtils - Web APIs
tmlareaelement. these utilities allow to deal with common features like urls. there are no objects of this type, but several objects such as htmlanchorelement and htmlareaelement implement it. properties note: this interface doesn't inherit any property. htmlhyperlinkelementutils.href this a stringifier property that returns a usvstring containing the whole url, and allows the href to be updated. htmlhyperlinkelementutils.protocol this is a usvstring containing the protocol scheme of the url, including the final ':'. htmlhyperlinkelementutils.host this is a usvstring containing the host, that is the hostname, and then, if the port of the url is not empty (which can happen because it was not specified or because it was specified to be the default port of the url's scheme), a ':', and...
HTMLImageElement.alt - Web APIs
d informational icons should use the corresponding text in their alt strings. that is, if an image is a corporate logo, the alt text should be the name of the company. if the image is an icon representing a status or other information, the text should be the name of that state. for example, if an image is a badge that's shown on a page to indicate that the content of the page is new and has been updated recently, the corresponding alt text might be "updated recently" or even "updated on 27 august 2019". in this example, a starburst image with the word "new!" is used to indicate that an article is about something new (and probably supposedly also exciting). the alt attribute is set to new page! to allow that text to be displayed in place of the image if the image isn't available. it is also ava...
HTMLImageElement.loading - Web APIs
sible that any lazy-loaded images located in the visual viewport may not yet be visible. preventing element shift during image lazy loads when an image whose loading has been delayed by the loading attribute being set to lazy is finally loaded, the browser will determine the final size of the <img> element based on the style and intrinsic size of the image, then reflow the document as needed to update the positions of elements based on any size change made to the element to fit the image. to prevent this reflow from occurring, you should explicitly specify the size of the image's presentation using the image element's width and height attributes. by establishing the intrinsic aspect ratio in this manner, you prevent elements from shifting around while the document loads, which can be disconce...
HTMLInputElement.setSelectionRange() - Web APIs
thod sets the start and end positions of the current text selection in an <input> or <textarea> element. optionally, in newer browser versions, you can specify the direction in which selection should be considered to have occurred. this lets you indicate, for example, that the selection was set by the user clicking and dragging from the end of the selected text toward the beginning. this method updates the htmlinputelement.selectionstart, selectionend, and selectiondirection properties in one call. note that accordingly to the whatwg forms spec selectionstart, selectionend properties and setselectionrange method apply only to inputs of types text, search, url, tel and password. chrome, starting from version 33, throws an exception while accessing those properties and method on the rest of inp...
HTMLMediaElement: durationchange event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.ondurationchange specification html5 media examples these examples add an event listener for the htmlmediaelement's durationchange event, then post a message when that event handler has reacted to the event firing. ...
HTMLMediaElement.load() - Web APIs
itself as the load process proceeds: if the element is already in the process of loading media, that load process is aborted and the abort event is sent. if the element has already been initialized with media, the emptied event is sent. if resetting the playback position to the beginning of the media actually changes the playback position (that is, it was not already at the beginning), a timeupdate event is sent. once media has been selected and loading is ready to begin, the loadstart event is delivered. from this point onward, events are sent just like any media load. example this example finds a <video> element in the document and resets it by calling load(). var mediaelem = document.queryselector("video"); mediaelem.load(); specifications specification status com...
HTMLMediaElement.play() - Web APIs
a, including calls to play(). if the user agent is configured not to allow automatic or script-initiated playback of media, calling play() will cause the returned promise to be immediately rejected with a notallowederror. web sites should be prepared to handle this situation. for example, a site should not present a user interface that assumes playback has begun automatically, but should instead update their ui based on whether the returned promise is resolved or rejected. see the example below for more information. note: the play() method may cause the user to be asked to grant permission to play the media, resulting in a possible delay before the returned promise is resolved. be sure your code doesn't expect an immediate response. for even more in-depth information about autoplay and auto...
HTMLElement.focus() - Web APIs
evel 1 specificationthe definition of 'focus' in that specification. obsolete notes if you call htmlelement.focus() from a mousedown event handler, you must call event.preventdefault() to keep the focus from leaving the htmlelement behaviour of the focus in relation to different html features like tabindex or shadow dom, which previously remained under-specified, were recently updated (as october of 2019). checkout whatwg blog for more info. ...
HTMLSelectElement - Web APIs
document.getelementbyid('s'); // return the index of the selected option console.log(select.selectedindex); // 1 // return the value of the selected option console.log(select.options[select.selectedindex].value) // second a better way to track changes to the user's selection is to watch for the change event to occur on the <select>. this will tell you when the value changes, and you can then update anything you need to. see the example provided in the documentation for the change event for details. specifications specification status comment html living standardthe definition of 'htmlselectelement' in that specification. living standard since the latest snapshot, html5, it adds the autocomplete property and the reportvalidity() method. html5the d...
HTMLSourceElement - Web APIs
een breakpoints htmlsourceelement.src is a domstring reflecting the src html attribute, containing the url for the media resource. the htmlsourceelement.src property has a meaning only when the associated <source> element is nested in a media element that is a <video> or an <audio> element. it has no meaning and is ignored when it is nested in a <picture> element. note: if the src property is updated (along with any siblings), the parent htmlmediaelement's load method should be called when done, since <source> elements are not re-scanned automatically. htmlsourceelement.srcset is a domstring reflecting the srcset html attribute, containing a list of candidate images, separated by a comma (',', u+002c comma). a candidate image is a url followed by a 'w' with the width of the images, or ...
HTMLTableElement - Web APIs
the tree, if any. htmltableelement.rowsread only returns a live htmlcollection containing all the rows of the element, that is all <tr> that are a child of the element, or a child of one of its <thead>, <tbody> and <tfoot> children. the rows members of a <thead> appear first, in tree order, and those members of a <tbody> last, also in tree order. the htmlcollection is live and is automatically updated when the htmltableelement changes. htmltableelement.tbodiesread only returns a live htmlcollection containing all the <tbody> of the element. the htmlcollection is live and is automatically updated when the htmltableelement changes. obsolete properties warning: the following properties are obsolete. you should avoid using them. htmltableelement.align is a domstring containing an ...
HTMLTableRowElement - Web APIs
ement's contents with respect to the surrounding context. the possible values are "left", "right", and "center". htmltablerowelement.bgcolor is a domstring containing the background color of the cells. it reflects the obsolete bgcolor attribute. htmltablerowelement.cells read only returns a live htmlcollection containing the cells in the row. the htmlcollection is live and is automatically updated when cells are added or removed. htmltablerowelement.ch is a domstring containing one single character. this character is the one to align all the cell of a column on. it reflects the char and default to the decimal points associated with the language, e.g. '.' for english, or ',' for french. this property was optional and was not very well supported. htmltablerowelement.choff is a domst...
HTMLTableSectionElement - Web APIs
element.align is a domstring containing an enumerated value reflecting the align attribute. it indicates the alignment of the element's contents with respect to the surrounding context. the possible values are "left", "right", and "center". htmltablesectionelement.rows read only returns a live htmlcollection containing the rows in the section. the htmlcollection is live and is automatically updated when rows are added or removed. htmltablesectionelement.ch is a domstring containing one single chararcter. this character is the one to align all the cell of a column on. it reflects the char and default to the decimal points associated with the language, e.g. '.' for english, or ',' for french. this property was optional and was not very well supported. htmltablesectionelement.choff is...
HTMLVideoElement.getVideoPlaybackQuality() - Web APIs
ckquality() creates and returns a videoplaybackquality object containing metrics including how many frames have been lost. the data returned can be used to evaluate the quality of the video stream. syntax videopq = videoelement.getvideoplaybackquality(); return value a videoplaybackquality object providing information about the video element's current playback quality. example this example updates an element to indicate the total number of video frames that have elapsed so far in the playback process. this value includes any dropped or corrupted frames, so it's not the same as "total number of frames played." var videoelem = document.getelementbyid("my_vid"); var counterelem = document.getelementbyid("counter"); var quality = videoelem.getvideoplaybackquality(); counterelem.innertext = ...
The HTML DOM API - Web APIs
workerlocation workernavigator websocket interfaces these interfaces, defined by the html specification, are used by the websockets_api. closeevent websocket server-sent events interfaces the eventsource interface represents the source which sent or is sending server-sent events. eventsource examples in this example, an <input> element's input event is monitored in order to update the state of a form's "submit" button based on whether or not a given field currently has a value. javascript const namefield = document.getelementbyid("username"); const sendbutton = document.getelementbyid("sendbutton") sendbutton.disabled = true; // [note: this is disabled since it causes this article to always load with this example focused and scrolled into view] //namefield.focus(); nam...
Recommended Drag Types - Web APIs
file type. during the drop event, the data associated with the file type is retrieved, and the filename of the file is added to the listbox. note that the instanceof operator is used here as the mozgetdataat() method will return an nsisupports that needs to be checked and converted into an nsifile. this is also a good extra check in case someone made a mistake and added a non-file for this type. updates to datatransfer.types the latest spec dictates that datatransfer.types should return a frozen array of domstrings rather than a domstringlist (this is supported in firefox 52 and above). as a result, the contains method no longer works; the includes method should be used instead to check if a specific type of data is provided, using code like the following: if ([...event.datatransfer.types].i...
Headers.get() - Web APIs
Web › API › Headers › get
specifications specification status comment fetchthe definition of 'get()' in that specification. living standard ...
Headers.getAll() - Web APIs
Web › API › Headers › getAll
seamonkey 2.49)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. the getall() method of the headers interface used to return an array of all the values of a header within a headers object with a given name; in newer versions of the fetch spec, it has been deleted, and headers.get() has been updated to fetch all header values instead of only the first one. if the requested header doesn't exist in the headers object, it returns an empty array. for security reasons, some headers can only be controller by the user agent. these headers include the forbidden header names and forbidden response header names. syntax myheaders.getall(name); parameters name the name of the http header whos...
History.replaceState() - Web APIs
syntax history.replacestate(stateobj, title, [url]) parameters stateobj the state object is a javascript object which is associated with the history entry passed to the replacestate method. the state object can be null. ...
History - Web APIs
Web › API › History
pecific url in the history list. pushstate() pushes the given data onto the session history stack with the specified title (and, if provided, url). the data is treated as opaque by the dom; you may specify any javascript object that can be serialized. note that all browsers but safari currently ignore the title parameter. for more information, see working with the history api. replacestate() updates the most recent entry on the history stack to have the specified data, title, and, if provided, url. the data is treated as opaque by the dom; you may specify any javascript object that can be serialized. note that all browsers but safari currently ignore the title parameter. for more information, see working with the history api. specifications specification status comment ...
IDBCursor.continuePrimaryKey() - Web APIs
recommendation ...
IDBCursor.delete() - Web APIs
Web › API › IDBCursor › delete
for such needs, you have to use idbindex.opencursor() instead. note: this feature is available in web workers. ...
IDBCursor - Web APIs
Web › API › IDBCursor
direction, to the item whose key matches the optional key parameter. idbcursor.continueprimarykey() sets the cursor to the given index key and primary key given as arguments. idbcursor.delete() returns an idbrequest object, and, in a separate thread, deletes the record at the cursor's position, without changing the cursor's position. this can be used to delete specific records. idbcursor.update() returns an idbrequest object, and, in a separate thread, updates the value at the current position of the cursor in the object store. this can be used to update specific records. constants these constants are no longer available — they were removed in gecko 25. you should use the string constants directly instead. (bug 891944) next : "next" : the cursor shows all records, includin...
IDBIndex - Web APIs
Web › API › IDBIndex
dex. 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. the records in an index are automatically populated whenever records in the referenced object store are inserted, updated, or deleted. each record in an index can point to only one record in its referenced object store, but several indexes can reference the same object store. when the object store changes, all indexes that refers to the object store are automatically updated. you can grab a set of keys within a range. to learn more, see idbkeyrange. note: this feature is available in web workers. properties i...
IDBObjectStore.createIndex() - Web APIs
ransactioninactiveerror occurs if the transaction this idbobjectstore belongs to is not active (e.g. has been deleted or removed.) in firefox previous to version 41, an invalidstateerror was raised in this case as well, which was misleading; this has now been fixed (see bug 1176165.) example in the following example you can see the idbopendbrequest.onupgradeneeded handler being used to update the database structure if a database with a higher version number is loaded. createindex() is used to create new indexes on the object store. for a full working example, see our to-do notifications app (view example live.) var db; // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); // two event handlers for opening the database. dbopenrequest.onerror = functi...
IDBObjectStore.deleteIndex() - Web APIs
eleted or removed.) in firefox previous to version 41, an invalidstateerror was raised in this case as well, which was misleading; this has now been fixed (see bug 1176165.) notfounderror occurs if there is no index with the given name (case-sensitive) in the database. example in the following example you can see the idbopendbrequest.onupgradeneeded handler being used to update the database structure if a database with a higher version number is loaded. idbobjectstore.createindex is used to create new indexes on the object store, after which we delete the unneeded old indexes with deleteindex(). for a full working example, see our to-do notifications app (view example live.) var db; // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4);...
IDBObjectStore.get() - Web APIs
the key or key range provided contains an invalid key. invalidstateerror the idbobjectstore has been deleted or removed. example in the following code snippet, we open a read/write transaction on our database and get one specific record from object store using get() — a sample record with the key "walk dog". once this data object is retrieved, you could then update it using normal javascript, then put it back into the database using a idbobjectstore.put operation. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of open...
IDBOpenDBRequest.onupgradeneeded - Web APIs
oaded. the event passed to the listener is an idbversionchangeevent. inside the event handler function you can include code to upgrade the database structure, as shown in the example below. note: this feature is available in web workers. syntax idbopendbrequest.onupgradeneeded = function(event) { ... }; example in the following example you can see the onupgradeneeded handler being used to update the database structure if a database with a higher version number is loaded. for a full working example, see our to-do notifications app (view example live.) var db; // request version 3 of the database. var request = window.indexeddb.open("library", 3); // this event handles the event whereby a new version of the // database needs to be created. either one has not been created // before, or a...
IDBOpenDBRequest: upgradeneeded event - Web APIs
the upgradeneeded event is fired when an attempt was made to open a database with a version number higher than its current version. bubbles no cancelable no interface event event handler onupgradeneeded examples this example opens a database and handles the upgradeneeded event by making any necessary updates to the object store. // 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 objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain ob...
IDBOpenDBRequest - Web APIs
n an open connection to a database is blocking a versionchange transaction on the same database. also available via the onblocked property. upgradeneeded fired when an attempt was made to open a database with a version number higher than its current version. also available via the onupgradeneeded property. example in the following example you can see the onupgradeneeded handler being used to update the database structure if a database with a higher version number is loaded. for a full working example, see our to-do notifications app (view example live.) var db; // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these event handlers act on the database being opened. dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading datab...
IDBVersionChangeRequest.setVersion() - Web APIs
for older webkit browsers, call this method before creating or deleting an object store. warning: the latest draft of the specification has dropped this method. some not up-to-date browsers still implement this method. the new way is to define the version in the idbdatabase.open() method and create and delete object stores in the onupgradeneeded event handler associated with the returned request. ...
IDBVersionChangeRequest - Web APIs
details. the new way to do it is to use the idbopendbrequest interface which has now the onblocked handler and the newly needed onupgradeneeded one. the idbversionchangerequest interface the indexeddb api represents a request to change the version of a database. it is used only by the setversion() method of idbdatabase. methods inherits from: idbrequest idbversionchangerequest.setversion updates the version of the database. returns immediately and runs a versionchange transaction on the connected database in a separate thread. attributes attribute type description onblocked function the event handler for the blocked event. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute...
Browser storage limits and eviction criteria - Web APIs
cache api cookies note: in firefox, web storage will soon start to use the same storage management tools too, as described in this document. note: in private browsing mode, most data storage is not supported. local storage data and cookies are still stored, but they are ephemeral — the data is deleted when you close the last private browsing window. the "last access time" of origins is updated when any of these are activated/deactivated — origin eviction will delete data for all these quota clients. in chrome/opera, the quota management api handles quota management for appcache, indexeddb, websql, and file system api. different types of data storage even in the same browser, using the same storage method, there are different classes of data storage to understand. this section dis...
getVersion - Web APIs
re installation is disabled, this method returns null. otherwise, it returns an installversion object representing the version of the component. if the component has not been registered in the client version registry or if the specified component was installed with a null version, this method returns null. installing a component with a null version indicates that the component should always be updated when the opportunity arises. ...
install - Web APIs
to the install() method. the { } constructor takes a comma-delimited set of label/value pairs. for installations, these pairs are the xpinstall confirm dialog display name and the path of the xpi, respectively. in the example below, a single installation object is created, but you can use this approach to create multiple installations to pass to a single install. as with the older startsoftwareupdate method, xpis installed with this method must have their own install.js files in which the full installation is defined. in contrast to startsoftwareupdate, install allows you to do multiple installs with the same trigger and provides a unified user experience for the multiple installs. example function xpinstallcallback(url, status) { if (status == 0) msg = "xpinstall test: passed\n"; el...
IntersectionObserverEntry.isIntersecting - Web APIs
ection; if it's false, then you know the transition is from intersecting to not-intersecting. syntax var isintersecting = intersectionobserverentry.isintersecting; value a boolean value which indicates whether the target element has transitioned into a state of intersection (true) or out of a state of intersection (false). example in this simple example, an intersection callback is used to update a counter of how many targeted elements are currently intersecting with the intersection root. function intersectioncallback(entries) { entries.foreach(function(entry) { if (entry.isintersecting) { intersectingcount += 1; } else { intersectingcount -= 1; } }); } to see a more concrete example, take a look at handling intersection changes in timing element visibility ...
Intersection Observer API - Web APIs
tainer's containing block. so if the top level of an <iframe> is reached, the intersection rectangle is clipped to the frame's viewport, then the frame's parent element is the next block recursed through toward the intersection root. when recursion upward reaches the intersection root, the resulting rectangle is mapped to the intersection root's coordinate space. the resulting rectangle is then updated by intersecting it with the root intersection rectangle. this rectangle is, finally, mapped to the coordinate space of the target's document. intersection change callbacks when the amount of a target element which is visible within the root element crosses one of the visibility thresholds, the intersectionobserver object's callback is executed. the callback receives as input an array of all ...
KeyframeEffect - Web APIs
ues for this keyframe effect. keyframeeffect.getkeyframes() returns the computed keyframes that make up this effect along with their computed keyframe offsets. animationeffect.gettiming() the effecttiming object associated with the animation containing all the animation's timing values. keyframeeffect.setkeyframes() replaces the set of keyframes that make up this effect. animationeffect.updatetiming() updates the specified timing properties. examples in the follow the white rabbit example, the keyframeeffect constructor is used to create a set of keyframes that dictate how the white rabbit should animate down the hole: var rabbitdownkeyframes = new keyframeeffect( whiterabbit, // element to animate [ { transform: 'translatey(0%)' }, // keyframe { transform: '...
LargestContentfulPaint - Web APIs
to true. note that in this example data is only sent to the server when the user leaves the tab. // catch errors since some browsers throw when using the new `type` option. // https://bugs.webkit.org/show_bug.cgi?id=209216 try { let lcp; const po = new performanceobserver((entrylist) => { const entries = entrylist.getentries(); const lastentry = entries[entries.length - 1]; // update `lcp` to the latest value, using `rendertime` if it's available, // otherwise using `loadtime`. (note: `rendertime` may not be available on // image elements loaded cross-origin without the `timing-allow-origin` header.) lcp = lastentry.rendertime || lastentry.loadtime; }); po.observe({type: 'largest-contentful-paint', buffered: true}); // send data to the server. addeventli...
LocalFileSystemSync - Web APIs
this specification is more or less abandonned, failing to get significant traction. ...
LocalMediaStream - Web APIs
the localmediastream interface was part of the media capture and streams api, representing a stream of data being generated locally (such as by getusermedia(). however, getusermedia() now returns a mediastream instead, and this interface has been removed from the specification. warning: this interface is no longer available in any mainstream browser. do not use localmediastream; you need to update any code that does use it as soon as possible or your content or application will stop working. see stopping a video stream in mediastreamtrack to learn how. all other functionality is found in mediastream. the primary reason for this interface to exist was to add a stop() method to its mediastream parent interface. however, control over playback of media has been moved to the individual medias...
Location: href - Web APIs
Web › API › Location › href
setting the value of href navigates to the provided url. if you want redirection, use location.replace(). ...
MSCandidateWindowShow - Web APIs
developers could listen to them and shift the suggestion ui accordingly. see also microsoft api extensions ime handling guide for gecko ...
MediaDevices: devicechange event - Web APIs
camera, microphone, or speaker is connected to or removed from the system. it's a generic event with no added properties. bubbles no cancelable no interface event event handler ondevicechange example you can use the devicechange event in an addeventlistener method: navigator.mediadevices.addeventlistener('devicechange', function(event) { updatedevicelist(); }); or use the ondevicechange event handler property: navigator.mediadevices.ondevicechange = function(event) { updatedevicelist(); } specifications specification status media capture and streamsthe definition of 'devicechange' in that specification. candidate recommendation ...
MediaKeySession - Web APIs
s object and close it. mediakeysession.generaterequest() returns a promise after generating a media request based on initialization data. mediakeysession.load() returns a promise that resolves to a boolean value after loading data for a specified session object. mediakeysession.remove() returns a promise after removing any session data associated with the current object. mediakeysession.update() returns a promise after loading messages and licenses to the cdm. examples // tbd specifications specification status comment encrypted media extensionsthe definition of 'mediakeysession' in that specification. recommendation initial definition. ...
MediaList.mediaText - Web APIs
ext = string; value a domstring representing the media queries of a stylesheet. each one is separated by a comma, for example screen and (min-width: 480px), print. if you wish to set new media queries on the document, the string value must have the different queries separated by commas, e.g. screen, print. note that the medialist is a live list; updating the list via mediatext will immediately update the behavior of the document. also note that is you try to set mediatext to null, it will be treated as an empty string, i.e. the value will be set to "". examples the following would log to the console a textual representation of the medialist of the first stylesheet applied to the current document. const stylesheets = document.stylesheets; let stylesheet = stylesheets[0]; console.log(styles...
MediaList - Web APIs
Web › API › MediaList
properties medialist.mediatext a stringifier that returns a domstring representing the medialist as text, and also allows you to set a new medialist. medialist.length read only returns the number of media queries in the medialist. ...
MediaSource.activeSourceBuffers - Web APIs
acks. example the following snippet is based on a simple example written by nick desaulniers (view the full demo live, or download the source for further investigation.) function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); console.log(mediasource.activesourcebuffers); // will contain the source buffer that was added above, // as it is selected for playing in the video player video.play(); //console.log(mediasource.readystate); // ended }); sourcebuffer.appendbuffer(buf); }); }; ... specifications specification ...
MediaSource.addSourceBuffer() - Web APIs
recommendation initial definition. ...
MediaSource.isTypeSupported() - Web APIs
recommendation initial definition. ...
MediaSource.readyState - Web APIs
recommendation initial definition. ...
MediaSource.sourceBuffers - Web APIs
list. example the following snippet is based on a simple example written by nick desaulniers (view the full demo live, or download the source for further investigation.) function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); console.log(mediasource.sourcebuffers); // will contain the source buffer that was added above video.play(); //console.log(mediasource.readystate); // ended }); sourcebuffer.appendbuffer(buf); }); }; ... specifications specification status comment media source extensionsthe definition of 's...
MediaSource - Web APIs
rc = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); video.play(); //console.log(mediasource.readystate); // ended }); sourcebuffer.appendbuffer(buf); }); }; function fetchab (url, cb) { console.log(url); var xhr = new xmlhttprequest; xhr.open('get', url); xhr.responsetype = 'arraybuffer'; xhr.onload = function () { cb(xhr.response); }; xhr.send(); }; spe...
active - Web APIs
comes false. syntax var isactive = mediastream.active; value a boolean value which is true if the stream is currently active; otherwise, the value is false. example in this example, a new stream whose source is the user's local camera and microphone is requested using getusermedia(). when that stream becomes available (that is, when the returned promise is fulfilled, a button on the page is updated based on whether or not the stream is currently active. var promise = navigator.mediadevices.getusermedia({ audio: true, video: true }); promise.then(function(stream) { var startbtn = document.queryselector('#startbtn'); startbtn.disabled = stream.active; };) specifications specification status comment media capture and streamsthe definition of 'active' in tha...
MediaStreamTrack.enabled - Web APIs
put. when enabled is set to false, the track only generates empty frames. empty audio frames have every sample's value set to 0. empty video frames have every pixel set to black. note: when implementing a mute/unmute feature, you should use the enabled property. usage notes if the mediastreamtrack represents the video input from a camera, disabling the track by setting enabled to false also updates device activity indicators to show that the camera is not currently recording or streaming. for example, the green "in use" light next to the camera in imac and macbook computers turns off while the track is muted in this way. example this example demonstrates a click event handler for a pause button. pausebutton.onclick = function(evt) { const newstate = !myaudiotrack.enabled; pausebutt...
MediaStreamTrack.getConstraints() - Web APIs
ecessarily describe the actual state of the media. even if any of the constraints couldn't be met, they are still included in the returned object as originally set by the site's code. to get the currently active settings for all constrainable properties, you should instead call getsettings(). example this example obtains the current constraints for a track, sets the facingmode, and applies the updated constraints. function switchcameras(track, camera) { const constraints = track.getconstraints(); constraints.facingmode = camera; track.applyconstraints(constraints); } specifications specification status comment media capture and streamsthe definition of 'getconstraints()' in that specification. candidate recommendation initial definition. ...
Recording a media element - Web APIs
will be used to hold the blobs of media data provided to our ondataavailable event handler. line 5 sets up the handler for the dataavailable event. the received event's data property is a blob that contains the media data. the event handler simply pushes the blob onto the data array. lines 6-7 starts the recording process by calling recorder.start(), and outputs a message to the log with the updated state of the recorder and the number of seconds it will be recording. lines 9-12 creates a new promise, named stopped, which is resolved when the mediarecorder's onstop event handler is called, and is rejected if its onerror event handler is called. the rejection handler receives as input the name of the error that occurred. lines 14-16 creates a new promise, named recorded, which is resolve...
Media Capture and Streams API (Media Stream) - Web APIs
ediastreamtrack mediastreamtrackevent mediatrackconstraints mediatracksettings mediatracksupportedconstraints overconstrainederror url early versions of the media capture and streams api specification included separate audiostreamtrack and videostreamtrack interfaces—each based upon mediastreamtrack—which represented streams of those types. these no longer exist, and you should update any existing code to instead use mediastreamtrack directly. events addtrack ended muted overconstrained removetrack started unmuted guides and tutorials the articles below provide additional guidance and how-to information that will help you learn to use the api, and how to perform specific tasks that you may wish to handle. capabilities, constraints, and settingsthe twi...
MerchantValidationEvent.complete() - Web APIs
return value undefined. exceptions this exception may be passed into the rejection handler for the promise: invalidstateerror the event did not come directly from the user agent, but was instead dispatched by other code. another payment request is currently being processed, the current payment request is not currently being displayed to the user, or payment information is currently being updated. example in this example, we see the client-side code needed to support merchant validation for a payment request called payrequest: payrequest.onmerchantvalidation = event => { const validationdatapromise = getvalidationdata(event.validationurl); event.complete(validationdatapromise); } function getvalidationdata(url) { /* ...retrieve the validation data from the url... */ } this c...
NamedNodeMap - Web APIs
although called namednodemap, this interface doesn't deal with node objects but with attr objects, which were originally a specialized class of node, and still are in some implementations. ...
Navigator.permissions - Web APIs
syntax permissionsobj = globalobj.navigator.permissions value a permissions object. examples navigator.permissions.query({name:'geolocation'}).then(function(result) { if (result.state === 'granted') { showmap(); } else if (result.state === 'prompt') { showbuttontoenablemap(); } // don't do anything if the permission was denied. ...
Navigator - Web APIs
Web › API › Navigator
he maximum number of simultaneous touch contact points are supported by the current device. navigatorplugins.mimetypes read only returns an mimetypearray listing the mime types supported by the browser. navigator.online read only returns a boolean indicating whether the browser is working online. navigator.permissions read only returns a permissions object that can be used to query and update permission status of apis covered by the permissions api. navigatorid.platform read only returns a string representing the platform of the browser. do not rely on this function to return a significant value. navigatorplugins.plugins read only returns a pluginarray listing the plugins installed in the browser. navigatorid.product read only always returns 'gecko', on any browser. this ...
Navigator.onLine - Web APIs
for example, the property should return false when users click links soon after they lose internet connection. browsers implement this property differently. in chrome and safari, if the browser is not able to connect to a local area network (lan) or a router, it is offline; all other conditions return true. ...
Network Information API - Web APIs
n of the networkinformation interface and a single property to the navigator interface: navigator.connection. note: this feature is available in web workers. examples detect connection changes this example watches for changes to the user's connection. var connection = navigator.connection || navigator.mozconnection || navigator.webkitconnection; var type = connection.effectivetype; function updateconnectionstatus() { console.log("connection type changed from " + type + " to " + connection.effectivetype); type = connection.effectivetype; } connection.addeventlistener('change', updateconnectionstatus); preload large resources the connection object is useful for deciding whether to preload resources that take large amounts of bandwidth or memory. this example would be called soon afte...
Node - Web APIs
Web › API › Node
a domstring representing the base url of the document containing the node. node.baseuriobject read only (not available to web content.) the nsiuri object representing the base uri for the element. node.childnodesread only returns a live nodelist containing all the children of this node. nodelist being live means that if the children of the node change, the nodelist object is automatically updated. node.firstchildread only returns a node representing the first direct child node of the node, or null if the node has no child. node.isconnectedread only a boolean indicating whether or not the node is connected (directly or indirectly) to the context object, e.g. the document object in the case of the normal dom, or the shadowroot in the case of a shadow dom. node.lastchildread only r...
NodeList - Web APIs
Web › API › NodeList
ome older browsers have not implemented nodelist.foreach() nor array.from(). this can be circumvented by using array.prototype.foreach() — see this document's example. live vs. static nodelists although they are both considered nodelists, there are 2 varieties of nodelist: live and static. live nodelists in some cases, the nodelist is live, which means that changes in the dom automatically update the collection. for example, node.childnodes is live: const parent = document.getelementbyid('parent'); let child_nodes = parent.childnodes; console.log(child_nodes.length); // let's assume "2" parent.appendchild(document.createelement('div')); console.log(child_nodes.length); // outputs "3" static nodelists in other cases, the nodelist is static, where any changes in the dom does not affect...
Notification.requestPermission() - Web APIs
is feature is not available in sharedworker note: safari still uses the callback syntax to get the permission. read using the notifications api for a good example of how to feature detect this and run code as appropriate. the requestpermission() method of the notification interface requests permission from the user for the current origin to display notifications. syntax the latest spec has updated this method to a promise-based syntax that works like this: notification.requestpermission().then(function(permission) { ... }); previously, the syntax was based on a simple callback; this version is now deprecated: notification.requestpermission(callback); parameters callback optional deprecated since gecko 46 an optional callback function that is called with the permission value. depre...
Page Visibility API - Web APIs
operties (such as display: none;) doesn't trigger visibility events or change the state of the document contained within the frame. use cases let's consider a few use cases for the page visibility api. a site has an image carousel that shouldn't advance to the next slide unless the user is viewing the page an application showing a dashboard of information doesn't want to poll the server for updates when the page isn't visible a page wants to detect when it is being prerendered so it can keep accurate count of page views a site wants to switch off sounds when a device is in standby mode (user pushes power button to turn screen off) developers have historically used imperfect proxies to detect this. for example, watching for blur and focus events on the window helps you know when your pa...
PannerNode.coneInnerAngle - Web APIs
d outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orientationx.setvalueattime(x1, context.currenttime); panner.orientationy.setvalueattime(y1, context.currenttime); panner.orientationz.setvalueattime(z1, context.currenttime); // calcula...
PannerNode.coneOuterAngle - Web APIs
d outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orientationx.setvalueattime(x1, context.currenttime); panner.orientationy.setvalueattime(y1, context.currenttime); panner.orientationz.setvalueattime(z1, context.currenttime); // calcula...
PannerNode.coneOuterGain - Web APIs
d outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orientationx.setvalueattime(x1, context.currenttime); panner.orientationy.setvalueattime(y1, context.currenttime); panner.orientationz.setvalueattime(z1, context.currenttime); // calcula...
PannerNode.distanceModel - Web APIs
ner = audioctx.createpanner(); panner.distancemodel = 'inverse'; value a enum — see distancemodeltype. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values fo...
PannerNode.maxDistance - Web APIs
lowed. exceptions rangeerror the property has been given a value that is outside the accepted range. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values fo...
PannerNode.orientationX - Web APIs
d outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orientationx.setvalueattime(x1, context.currenttime); panner.orientationy.setvalueattime(y1, context.currenttime); panner.orientationz.setvalueattime(z1, context.currenttime); // calcula...
PannerNode.orientationY - Web APIs
d outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orientationx.setvalueattime(x1, context.currenttime); panner.orientationy.setvalueattime(y1, context.currenttime); panner.orientationz.setvalueattime(z1, context.currenttime); // calcula...
PannerNode.orientationZ - Web APIs
d outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orientationx.setvalueattime(x1, context.currenttime); panner.orientationy.setvalueattime(y1, context.currenttime); panner.orientationz.setvalueattime(z1, context.currenttime); // calcula...
PannerNode.panningModel - Web APIs
r panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; value a enum — see panningmodeltype. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values fo...
PannerNode.setOrientation() - Web APIs
= new audiocontext(); var panner = audioctx.createpanner(); panner.setorientation(1,0,0); returns void. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values fo...
PannerNode.setPosition() - Web APIs
ctx = new audiocontext(); var panner = audioctx.createpanner(); panner.setposition(0,0,0); returns void. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values fo...
PannerNode.setVelocity() - Web APIs
tx = new audiocontext(); var panner = audioctx.createpanner(); panner.setvelocity(0,0,17); returns void. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values fo...
PannerNode - Web APIs
feature was not clearly specified and had a number of issues, so it was removed from the specification. examples in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values fo...
PaymentCurrencyAmount.currencySystem - Web APIs
nd should no longer be used; the currency is now always specified using iso 4127. syntax currencysystem = paymentcurrencyamount.currencysystem; value a domstring which specifies the currency standard used to specify the currency in which the payment value is represented. the default, urn:iso:std:iso:4217, indicates the iso 4217 standard. this obsolete property was removed in the may 3, 2018 update of the payment request api specification. specifications specification status comment payment request apithe definition of 'paymentcurrencyamount' in that specification. candidate recommendation no longer part of the specification payment request api the definition of 'paymentcurrencyamount.currencysystem' in that specification. candidate recommenda...
PaymentMethodChangeEvent.methodDetails - Web APIs
.methoddetails; const newstuff = {}; if (ev.methodname === "https://apple.com/apple-pay") { switch (cardtype) { case "visa": // do apple pay specific handling for visa card... // methoddetails contains the card information const result = calculatediscount(ev.methoddetails); object.assign(newstuff, result); break; } } // finally... ev.updatewith(newstuff); }; const response = await request.show(); note that the methoddetails property is being used by the calculatediscount() function to compute any payment discount, then updatewith() is called to update the event with the computed update. specifications specification status comment payment request apithe definition of 'paymentmethodchangeevent.methoddetails'...
PaymentMethodChangeEvent.methodName - Web APIs
.methoddetails; const newstuff = {}; if (ev.methodname === "https://apple.com/apple-pay") { switch (cardtype) { case "visa": // do apple pay specific handling for visa card... // methoddetails contains the card information const result = calculatediscount(ev.methoddetails); object.assign(newstuff, result); break; } } // finally... ev.updatewith(newstuff); }; const response = await request.show(); specifications specification status comment payment request apithe definition of 'paymentmethodchangeevent.methodname' in that specification. candidate recommendation initial definition. ...
PaymentRequest.onpaymentmethodchange - Web APIs
etails; 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... ev.updatewith(newstuff); }; const response = await request.show(); specifications specification status comment payment request apithe definition of 'onpaymentmethodchange' in that specification. candidate recommendation initial definition. ...
PaymentResponse.retry() - Web APIs
all([response.retry(errors), ...promisestofixthings]); await recursivevalidate(request, response); } function fixfield(requestorresponse, event, validator) { return new promise(resolve => { // browser keeps calling this until promise resolves. requestorresponse.addeventlistener(event, async function listener(ev) { const promisetovalidate = validator(requestorresponse); ev.updatewith(promisetovalidate); const errors = await promisetovalidate; if (!errors) { // yay! fixed! event.removeeventlistener(event, listener); resolve(); } }); }); } dopaymentrequest(); specifications specification status comment payment request apithe definition of 'retry()' in that specification. candidate recommendation initi...
Using the Payment Request API - Web APIs
}) } }) paymentrequest.abort() can be used to abort the payment request if required. detecting availability of the payment request api you can effectively detect support for the payment request api by checking if the user's browser supports paymentrequest, i.e. if (window.paymentrequest). in the following snippet, a merchant page performs this check, and if it returns true updates the checkout button to use paymentrequest instead of legacy web forms. const checkoutbutton = document.getelementbyid('checkout-button'); if (window.paymentrequest) { let request = new paymentrequest(buildsupportedpaymentmethodnames(), buildshoppingcartdetails()); checkoutbutton.addeventlistener('click', function() { request.show().then(function(paymentresponse) { // handle ...
PerformanceEventTiming - Web APIs
the performanceeventtiming interface of the event timing api provides timing information for the event types listed below. auxclick beforeinput click compositionend compositionstart compositionupdate contextmenu dblclick dragend dragenter dragleave dragover dragstart drop input keydown keypress keyup mousedown mouseenter mouseleave mouseout mouseover mouseup pointerover pointerenter pointerdown pointerup pointercancel pointerout pointerleave gotpointercapture lostpointercapture touchstart touchend touchcancel properties performanceeventtiming.processingstart returns the time at which event dispatch started. performanceeventtiming.processingend returns the time at which the event dispatch ended. performanceeventtiming.cancelable returns th...
Pinch zoom gestures - Web APIs
increased (zoom in), // the target element's background is changed to "pink" and if the // distance is decreasing (zoom out), the color is changed to "lightblue". // // this function sets the target element's border to "dashed" to visually // indicate the pointer's target received a move event. ...
Pointer events - Web APIs
hould be large enough to accommodate the largest contact surface area (typically a finger touch). if the target area is too small, touching it could result in firing other events for adjacent elements. specifications specification status comment pointer events – level 3 editor's draft added new apis for getcoalescedevent and getpredictedevents, new pointerrawupdate event, additional touch-action property values pan-left, pan-right, pan-up, pan-down. pointer events – level 2 recommendation adds haspointercapture method and clarifies more edge cases and dynamic scenarios. pointer events obsolete initial definition. ...
PushManager.unregister() - Web APIs
syntax var request = navigator.push.unregister(pushendpoint); properties pushendpoint a pushendpoint to be unregistered. return a domrequest object to handle the success or failure of the method call. if the method call is successful, the request's result will be a pushregistration object representing the endpoint that has been unregistered. ...
PushManager - Web APIs
hich will be one of granted, denied, or default. replaced by pushmanager.permissionstate(). pushmanager.register() subscribes to a push subscription. replaced by pushmanager.subscribe(). pushmanager.registrations() retrieves existing push subscriptions. replaced by pushmanager.getsubscription(). pushmanager.unregister() unregisters and deletes a specified subscription endpoint. in the updated api, a subscription is unregistered by calling the pushsubscription.unsubscribe() method. example this.onpush = function(event) { console.log(event.data); // from here we can write the data to indexeddb, send it to any open // windows, display a notification, etc. } navigator.serviceworker.register('serviceworker.js').then( function(serviceworkerregistration) { serviceworkerregis...
Web Push API Notifications best practices - Web APIs
there breaking news that is timely? this is where it gets a little tricky. sometimes news sites request push notifications so they can essentially say "look at me! look at me!" it all comes down to what the user wants, and you can use behavior to determine intent. for example, if the user views more than one article, or lingers on your page for several minutes, they may be interested in receiving updates. in addition to the question of whether a push notification is required at all, there are many different types of push notifications, ranging from casual-and-disappearing to persistent-and-requiring-interaction. we caution you to use the interaction-requiring ones very sparingly, since they can be the most annoying. your notifications should be assistive, not disruptive. building trust some...
Push API - Web APIs
Web › API › Push API
push concepts and usage when implementing pushmanager subscriptions, it is vitally important that you protect against csrf/xsrf issues in your app. ...
RTCDTMFSender: tonechange event - Web APIs
g (by calling rtcdtmfsender.insertdtmf()) begin and end. bubbles no cancelable no interface rtcdtmftonechangeevent event handler property ontonechange to determine what tone started playing, or if a tone stopped playing, check the value of the event's tone property. examples this example establishes a handler for the tonechange event which updates an element to display the currently playing tone in its content, or, if all tones have played, the string "<none>". this can be done using addeventlistener(): dtmfsender.addeventlistener("tonechange", ev => { let tone = ev.tone; if (tone === "") { tone = "&lt;none&gt;"; } document.getelementbyid("playingtone").innertext = tone; }, false); you can also just set the ontonechange e...
RTCDTMFToneChangeEvent.tone - Web APIs
the read-only property rtcdtmftonechangeevent.tone returns the dtmf character which has just begun to play, or an empty string (""). if all queued tones have finished playing (that is, rtcdtmfsender.tonebuffer is empty). syntax var tone = dtmftonechangeevent.tone; example this example establishes a handler for the tonechange event which updates an element to display the currently playing tone in its content, or, if all tones have played, the string "<none>". dtmfsender.ontonechange = function( ev ) { let tone = ev.tone; if (tone === "") { tone = "&lt;none&gt;" } document.getelementbyid("playingtone").innertext = tone; }; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdtmftonec...
RTCDataChannel: close event - Web APIs
has closed. before any further data can be transferred using rtcdatachannel, a new data channel instance must be created. bubbles no cancelable no interface event event handler property rtcdatachannel.onclose examples this example sets up a handler for the close event for the rtcdatachannel named dc; its responsibility in this example is to update user interface elements to reflect that there is no longer an ongoing call, and to allow a new call to be started. dc.addeventlistener("close", ev => { messageinputbox.disabled = true; sendbutton.disabled = true; connectbutton.disabled = false; disconnectbutton.disabled = true; }, false); all this code does in response to receiving the close event is to disable an input box and its "se...
RTCDataChannel.id - Web APIs
Web › API › RTCDataChannel › id
by the user agent (if rtcdatachannel.negotiated is false) or by the site or app script (if negotiated is true). each rtcpeerconnection can therefore have up to a theoretical maximum of 65,534 data channels on it, although the actual maximum may vary from browser to browser. in early versions of the webrtc specification, this property's name was stream. code that uses that property needs to be updated. syntax var id = adatachannel.id; value an unsigned short value (that is, an integer between 0 and 65,535) which uniquely identifies the data channel. while the label property doesn't have to be unique, this id number is guaranteed to be unique among all data channels. additionally, known implementations of webrtc use the same id on both peers. a unique id makes it easier for your code to...
RTCDataChannel.onopen - Web APIs
l's messages flow—is established or re-established. syntax rtcdatachannel.onopen = function; value a function which the browser will call to handle the open event. the function receives as its only input parameter the event itself, of type event. example this example adds a new data channel to an existing rtcpeerconnection, mypeerconnection. it then establishes an open event handler which updates some user interface elements to prepare them for being used to send messages over the data channel. let dc = mypeerconnection.createdatachannel("message channel"); dc.onopen = function(event) { let messagebox = document.getelementbyid("messagebox"); let sendbutton = document.getelementbyid("sendbutton"); messagebox.disabled = false; messagebox.focus(); sendbutton.disabled = false; }...
RTCDataChannel.reliable - Web APIs
the read-only rtcdatachannel property reliable indicates whether or not the data channel is reliable. this property is obsolete. use rtcdatachannel.ordered instead in any new code, and update existing code as soon as possible. syntax var reliable = adatachannel.reliable; value true if the rtcdatachannel's connection is reliable; false if it isn't. example // tbd specifications no longer part of any specification. ...
RTCDataChannel.stream - Web APIs
erty stream returns an id number (between 0 and 65,535) which uniquely identifies the rtcdatachannel. this id is set at the time the data channel is created, either by the user agent (if rtcdatachannel.negotiated is false) or by the site or app script (if negotiated is true). this property has been replaced with the rtcdatachannel.id property. if you have code that uses stream, you will need to update, since browsers have begun to remove support for stream. syntax var stream = adatachannel.stream; value an unsigned short value (that is, an integer between 0 and 65,535) which uniquely identifies the data channel. example var datachannel = pc.createdatachannel("samplechannel"); console.log("data channel stream id: " + datachannel.stream); ...
RTCDtlsTransport - Web APIs
peer supports bundling or not. for this reason, you'll sometimes see separate transports created at first, one for each track, then see them get bundled up once it's known that bundling is possible. if your code accesses rtcrtpsenders and/or rtcrtpreceivers directly, you may encounter situations where they're initially separate, then half or more of them get closed and the senders and receivers updated to refer to the appropriate remaining rtcdtlstransport objects. data channels rtcdatachannels use sctp to communicate. all of a peer connection's data channels share a single rtcsctptransport, found in the connection's sctp property. you can, in turn, identify the rtcdtlstransport used to securely encapsulate the data channels' sctp communications by looking at the rtcsctptransport object's t...
RTCIceCandidatePair - Web APIs
rt.getselectedcandidatepair() to identify the currently-selected candidate pair identified by the ice agent. properties local an rtcicecandidate describing the configuration of the local end of the connection. remote the rtcicecandidate describing the configuration of the remote end of the connection. example in this example, an event handler for selectedcandidatepairchange is set up to update an on-screen display showing the protocol used by the currently selected candidate pair. var icetransport = pc.getsenders()[0].transport.icetransport; var localproto = document.getelementbyid("local-protocol"); var remoteproto = document.getelementbyid("remote-protocol"); icetransport.onselectedcandidatepairchange = function(event) { var pair = icetransport.getselectedcandidatepair(); local...
RTCIceCandidatePairStats - Web APIs
nd trip time (rtt) by dividing this value by responsesreceived. transportid optional a domstring that uniquely identifies the rtcicetransport that was inspected to obtain the transport-related statistics (as found in rtctransportstats) used in generating this object. obsolete properties the following properties have been removed from the specification and should no longer be used. you should update any existing code to avoid using them as soon as is practical. check the compatibility table for details on which browsers support them and in which versions. priority optional an integer value indicating the candidate pair's priority. readable optional a boolean value indicating whether or not data can be sent over the connection described by the candidate pair. writable optional a...
RTCIceServer.url - Web APIs
Web › API › RTCIceServer › url
tion in june 2013 but is still broadly used in older examples and books, so we include documentation here to help adapt old code to new browsers. this property has been removed from the specification; while it's still supported by many browsers, it should no longer be used. you should instead use the newer urls property, which allows you to optionally specify multiple urls for the server. try to update any existing code to use that property instead. syntax var iceserver = { ... url = iceserverurl, ... }; var serverurl = iceserver.url; iceserver.url = iceserverurl; the value of this property is a domstring containing the full url of a server to use during ice negotiation. example this example creates a new rtcpeerconnec...
RTCIceServer - Web APIs
ple addresses for each server in the list, as shown in the example below. obsolete properties the following properties have been removed from the specification and should not be used. url this obsolete property is a string specifies a single ice server's url. do not use this property; use urls instead. because many older books and examples still use this, we include it to help developers update their code or make sense of older examples. example the configuration below establishes two ice servers. the first one, stun:stun.services.mozilla.com, requires authentication, so the username and password are provided. the second server has two urls: stun:stun.example.com and stun:stun-1.example.com. var configuration = { iceservers: [{ urls: "stun:stun.services.moz...
RTCIceTransport.getSelectedCandidatePair() - Web APIs
discovered that is better than the currently-selected pair, the new pair is selected, replacing the previous pairing, and the selectedcandidatepairchange event is fired again. note: it's possible for one of the configurations in the selected candidate pair to remain unchanged when a new pairing is chosen. example in this example, an event handler for selectedcandidatepairchange is set up to update an on-screen display showing the protocol used by the currently selected candidate pair. var icetransport = pc.getsenders()[0].transport.icetransport; var localproto = document.getelementbyid("local-protocol"); var remoteproto = document.getelementbyid("remote-protocol"); icetransport.onselectedcandidatepairchange = function(event) { var pair = icetransport.getselectedcandidatepair(); local...
RTCIceTransport.onselectedcandidatepairchange - Web APIs
can determine the current state by calling the transport's getselectedcandidatepair() method, which returns a rtcicecandidatepair whose rtcicecandidatepair.local and rtcicecandidatepair.global properties specify rtcicecandidate objects describing the local and remote candidates that are currently being used. example in this example, an event handler for selectedcandidatepairchange is set up to update an on-screen display showing the protocol used by the currently selected candidate pair. var icetransport = pc.getsenders()[0].transport.icetransport; var localproto = document.getelementbyid("local-protocol"); var remoteproto = document.getelementbyid("remote-protocol"); icetransport.onselectedcandidatepairchange = function(event) { var pair = icetransport.getselectedcandidatepair(); local...
RTCIceTransport: selectedcandidatepairchange event - Web APIs
nd of the connection. together, the candidates can be used to establish a connection to be used by the rtcicetransport, and, by extension, by an rtcpeerconnection. bubbles no cancelable no interface event event handler property onselectedcandidatepairchange examples this example creates an event handler for selectedcandidatepairchange that updates a display providing the user information about the progress of the ice negotiation for an rtcpeerconnection called pc. let icetransport = pc.getsenders[0].transport.icetransport; let localprotoelem = document.getelementbyid("local-protocol"); let remoteprotoelem = document.getelementbyid("remote-protocol"); icetransport.addeventlistener("selectedcandidatepairchange", ev => { let pair = icetr...
RTCPeerConnection.addIceCandidate() - Web APIs
ce agent. if no candidate object is specified, or its value is null, an end-of-candidates signal is sent to the remote peer using the end-of-candidates a-line, formatted simply like this: a=end-of-candidates deprecated parameters in older code and documentation, you may see a callback-based version of this function. this has been deprecated and its use is strongly discouraged. you should update any existing code to use the promise-based version of addicecandidate() instead. the parameters for this form of addicecandidate() are described below, to aid in updating existing code. successcallback a function to be called when the ice candidate has been successfully added. this function receives no input parameters and doesn't return a value. failurecallback a function to be called ...
RTCPeerConnection.addStream() - Web APIs
indicating the stream to add to the webrtc peer connection. return value none. example this simple example adds the audio and video stream coming from the user's camera to the connection. navigator.mediadevices.getusermedia({video:true, audio:true}, function(stream) { var pc = new rtcpeerconnection(); pc.addstream(stream); }); migrating to addtrack() compatibility allowing, you should update your code to instead use the addtrack() method: navigator.getusermedia({video:true, audio:true}, function(stream) { var pc = new rtcpeerconnection(); stream.gettracks().foreach(function(track) { pc.addtrack(track, stream); }); }); the newer addtrack() api avoids confusion over whether later changes to the track-makeup of a stream affects a peer connection (they do not). the exception...
RTCPeerConnection.addTrack() - Web APIs
r can't be reused. if all of those criteria are met, the sender gets reused, which results in these changes occurring to the existing rtcrtpsender and its rtcrtptransceiver: the rtcrtpsender's track is set to the specified track. the sender's set of associated streams is set to the list of streams passed into this method, stream.... the associated rtcrtptransceiver has its currentdirection updated to include sending; if its current value is "recvonly", it becomes "sendrecv", and if its current value is "inactive", it becomes "sendonly". new senders if no existing sender exists that can be reused, a new one is created. this also results in the creation of the associated objects that must exist. the process of creating a new sender results in these changes: the new rtcrtpsender is cre...
RTCPeerConnection: connectionstatechange event - Web APIs
nectionstate enumerated type. bubbles no cancelable no interface event event handler onconnectionstatechange examples for an rtcpeerconnection, pc, this example sets up a handler for connectionstatechange messages to handle changes to the connectivity of the webrtc session. it simply calls an app-defined function called setonlinestatus() to update a status display. pc.onconnectionstatechange = ev => { switch(pc.connectionstate) { case "new": case "checking": setonlinestatus("connecting..."); break; case "connected": setonlinestatus("online"); break; case "disconnected": setonlinestatus("disconnecting..."); break; case "closed": setonlinestatus("offline"); break; cas...
RTCPeerConnection.createAnswer() - Web APIs
nnection.createanswer(successcallback, failurecallback[, options]); parameters options optional an object which contains options which customize the answer; this is based on the rtcansweroptions dictionary. deprecated parameters in older code and documentation, you may see a callback-based version of this function. this has been deprecated and its use is strongly discouraged. you should update any existing code to use the promise-based version of createanswer() instead. the parameters for this form of createanswer() are described below, to aid in updating existing code. successcallback an rtcsessiondescriptioncallback which will be passed a single rtcsessiondescription object describing the newly-created answer. failurecallback an rtcpeerconnectionerrorcallback which will be...
RTCPeerConnection.createDataChannel() - Web APIs
if the new data channel is the first one added to the connection, renegotiation is started by delivering a negotiationneeded event. ...
RTCPeerConnection.getStats() - Web APIs
iously, getstats() used success and failure callbacks to report the results to you, instead of using a promise. this version of getstats() is obsolete; in addition, the data it returns is entirely different from the current specification, and the form of that data was never documented. this form of getstats() has been or will soon be removed from most browsers; you should not use it, and should update existing code to use the new promise-based version. check the browser compatibility table to verify the state of this method. promise = rtcpeerconnection.getstats(selector, successcallback, failurecallback) parameters selector optional a mediastreamtrack for which to gather statistics. if this is null (the default value), statistics will be gathered for the entire rtcpeerconnection. succ...
RTCPeerConnection.getStreamById() - Web APIs
the rtcpeerconnection.getstreambyid() method returns the mediastream with the given id that is associated with local or remote end of the connection. if no stream matches, it returns null. this property has been replaced with the rtcpeerconnection.getlocalstreams and rtcpeerconnection.getremotestreams properties. if you have code that uses stream, you will need to update, since browsers have begun to remove support for stream. syntax var mediastream = pc.getstream(id); parameters id is a domstring corresponding to the stream to return. example var stream = pc.getstreambyid(mytrackid); if (stream) { console.log("found stream: " + stream.id); } polyfill running the following code before any other code will create rtcpeerconnection.prototype.getstreambyid() if it's not nativ...
RTCPeerConnection: iceconnectionstatechange event - Web APIs
date() with a candidate whose candidate property is an empty string (""), or by setting the rtcpeerconnection property cantrickleicecandidates to false. examples an event handler for this event can be added using the rtcpeerconnection.oniceconnectionstatechange property or by using addeventlistener() on the rtcpeerconnection. in this example, a handler for iceconnectionstatechange is set up to update a call state indicator by using the value of iceconnectionstate to create a string which corresponds to the name of a css class that we can assign to the status indicator to cause it to reflect the current state of the connection. pc.addeventlistener("iceconnectionstatechange", ev => { let stateelem = document.queryselector("#call-state"); stateelem.classname = `${pc.iceconnectionstate}-stat...
RTCPeerConnection: icecandidate event - Web APIs
if that value is now complete, you know that ice gathering has just ended. this is a more reliable approach than looking at the individual ice messages for one indicating that the ice session is finished. examples this example creates a simple handler for the icecandidate event that uses a function called sendmessage() to create and send a reply to the remote peer through the signaling serve...
RTCPeerConnection.onicegatheringstatechange - Web APIs
want to closely monitor the state of ice gathering. syntax rtcpeerconnection.onicegatheringstatechange = eventhandler; value a function you provide which is passed a single parameter: an event object containing the icegatheringstatechange event. you can determine the new state of ice gathering by looking at the value of the rtcpeerconnection.icegatheringstate property. example this example updates status information presented to the user to let them know what's happening by examining the current value of the icegatheringstate property each time it changes and changing the contents of a status display based on the new information. the status is simply presented as text in a <div> element: <div id="icestatus"></div> the actual event handler looks like this: pc.onicegatheringstatechange...
RTCPeerConnection.setLocalDescription() - Web APIs
can be changed without losing the connection if the change does not succeed. see pending and current descriptions in webrtc connectivity for more details on this process. deprecated parameters in older code and documentation, you may see a callback-based version of this function used. this has been deprecated and its use is strongly discouraged, as it will be removed in the future. you should update any existing code to use the promise-based version of setlocaldescription() instead. the parameters for the older form of setlocaldescription() are described below, to aid in updating existing code. successcallback a javascript function which accepts no input parameters to be be called once the description has been successfully set. at that time, the offer can be sent to a remote peer via t...
RTCPeerConnection.setRemoteDescription() - Web APIs
process differently depending on whether the local peer is the caller or callee. note: earlier implementations of webrtc would throw an exception if an offer was set outside a stable or have-remote-offer state. deprecated syntax in older code and documentation, you may see a callback-based version of this function used. this has been deprecated and its use is strongly discouraged. you should update any existing code to use the promise-based version of setremotedescription() instead. the parameters for the older form of setremotedescription() are described below, to aid in updating existing code. pc.setremotedescription(sessiondescription, successcallback, errorcallback); parameters successcallback a javascript function which accepts no input parameters to be be called once the descr...
RTCRemoteOutboundRtpStreamStats.localId - Web APIs
tracting startrecord's framesdecoded from endrecord.framesdecoded. finally, the frame rate over the elapsed time span is calculated by dividing framesdecoded by elapsedtime. the remainder of the networkteststop() function constructs the html used to display the output of the collected and computed results to the user, then append it to the element statsbox, which we're using to show the status updates to the user. the output log, given the styles used by the example, looks like this: in the screenshot, we see a heading followed by the scrollable <div> we refer to as statsbox. the box contains a number of log entries, the last handful of which are visible. each one represents approximately one second of time (since that's much time we're waiting between calling networkteststart() and netwo...
RTCRtpReceiver.getStats() - Web APIs
omise which is fulfilled once the statistics are available. the promise's fulfillment handler receives as a parameter a rtcstatsreport object containing the collected statistics. the returned statistics include those from all streams which are coming in through the rtcrtpreceiver, as well as any of their dependencies. example this simple example obtains the statistics for an rtcrtpreceiver and updates an element's innertext to display the number of packets lost. receiver.getstats().then(function(stats) { document.getelementbyid("lostpackets").innertext = stats.packetslost; }); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtpreceiver.getstats()' in that specification. candida...
RTCRtpSender.getStats() - Web APIs
tistics are available. the promise's fulfillment handler receives as a parameter a rtcstatsreport object containing the collected statistics. the returned rtcstatsreport accumulates the statistics for all of the streams being sent using the rtcrtpsender, as well as the statistics for any dependencies those streams have. example this simple example obtains the statistics for an rtcrtpsender and updates an element's innertext to display the current round trip time for requests on the sender. sender.getstats().then(function(stats) { document.getelementbyid("currentrtt").innertext = stats.roundtriptime; }); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtpsender.getstats()' in that ...
RTCRtpStreamStats - Web APIs
e the dictionary has a base set of properties that are present in each of these cases, there are also additional properties added depending on which interface the method is called on. rtcrtpstreamstats is the base class for all rtp-related statistics reports. it's based on rtcstats and adds the following additional fields. note: this interface was called rtcrtpstreamstats until a specification update in the spring of 2017. check the browser compatibility table to know if and when the name change was implemented in specific browsers. properties the rtcrtpstreamstats dictionary is based on rtcstats, and inherits its properties. in addition, some or all of the following properties are available. standard fields included for all media types codecid a domstring which uniquely identifies th...
RTCRtpTransceiver.stopped - Web APIs
ransceiver's sender will no longer send data, and its receiver will no longer receive data. if either or both are still at work, the result is false. usage notes this property is deprecated and will be removed in the future. instead, look at the value of currentdirection. its value is stopped if the transceiver has stopped. note: currently only firefox implements stopped, and has not yet been updated to implement this change. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtptransceiver.stopped' in that specification. candidate recommendation ...
Request() - Web APIs
Web › API › Request › Request
the request() constructor creates a new request object. syntax var myrequest = new request(input[, init]); parameters input defines the resource that you wish to fetch. this can either be: a usvstring containing the direct url of the resource you want to fetch. a request object, effectively creating a copy. note the following behavioural updates to retain security while making the constructor less likely to throw exceptions: if this object exists on another origin to the constructor call, the request.referrer is stripped out. if this object has a request.mode of navigate, the mode value is converted to same-origin. init optional an options object containing any custom settings that you want to apply to the request. the possible options are: method: the ...
ResizeObserverEntry.target - Web APIs
as a percentage of the viewport size. when the viewport size is changed, the box's rounded corners change in proportion to the size of the box. we could just implement this using border-radius with a percentage, but that quickly leads to ugly-looking elliptical corners; this solution gives you nice square corners that scale with the box size. to grab a reference to the observed element so we can update its border-radius value after each change, we make use of the target property of each entry — entry.target.style.borderradius. const resizeobserver = new resizeobserver(entries => { for (let entry of entries) { if(entry.contentboxsize) { entry.target.style.borderradius = math.min(100, (entry.contentboxsize.inlinesize/10) + (ent...
SVGGraphicsElement: cut event - Web APIs
s to copy the current selection (if any) to the system clipboard and remove it from the document. a handler for this event can modify the clipboard contents by calling setdata(format, data) on the event's clipboardevent.clipboarddata property, and cancelling the default action using event.preventdefault(). note though that cancelling the default action will also prevent the document from being updated. so an event handler which wants to emulate the default action for "cut" while modifying the clipboard must also manually remove the selection from the document. the handler cannot read the clipboard data. it's possible to construct and dispatch a synthetic cut event, but this will not affect the system clipboard or the document's contents. specifications specification status ...
ServiceWorkerContainer.register() - Web APIs
if successful, a service worker registration ties the provided script url to a scope, which is subsequently used for navigation matching. you can call this method unconditionally from the controlled page. i.e., you don't need to first check whether there's an active registration. there is frequent confusion surrounding the meaning and use of scope. since a service worker can't have a scope broader than its own location, only use the scope option when you need a scope that is narrower than the default. ...
ServiceWorkerGlobalScope.skipWaiting() - Web APIs
syntax serviceworkerglobalscope.skipwaiting().then(function() { //do something }); returns a promise that immediately resolves with undefined. ...
SourceBuffer.abort() - Web APIs
ynchronous, but this step seems to suggest a synchronous (blocking) operation, which doesn't make sense. saying that, current implementations can be useful in certain situations, when you want to stop the current append (or whatever) operation occuring on a sourcebuffer, and then immediately start performing operations on it again. for example, consider this code: sourcebuffer.addeventlistener('updateend', function (_) { ... }); sourcebuffer.appendbuffer(buf); let's say that after the call to appendbuffer but before the updateend event fires (i.e. a buffer is being appended but the operation has not yet completed) a user "scrubs" the video seeking to a new point in time. in this case you would want to manually call abort() on the source buffer to stop the decoding of the current buffer, t...
SourceBuffer.appendWindowEnd - Web APIs
a double, indicating the end time of the append window, in seconds. exceptions the following exceptions may be thrown when setting a new value for this property. exception explanation invalidaccesserror an attempt was made to set the value to less than or equal to sourcebuffer.appendwindowstart, or nan. invalidstateerror this sourcebuffer object is being updated (i.e. its sourcebuffer.updating property is currently true), or this sourcebuffer has been removed from the mediasource. example tbd specifications specification status comment media source extensionsthe definition of 'appendwindowend' in that specification. recommendation initial definition. ...
SourceBuffer.appendWindowStart - Web APIs
g the start time of the append window, in seconds. exceptions the following exceptions may be thrown when setting a new value for this property. exception explanation invalidaccesserror an attempt was made to set the value to less than 0, or a value greater than or equal to sourcebuffer.appendwindowend. invalidstateerror this sourcebuffer object is being updated (i.e. its sourcebuffer.updating property is currently true), or this sourcebuffer has been removed from the mediasource. example tbd specifications specification status comment media source extensionsthe definition of 'appendwindowstart' in that specification. recommendation initial definition. ...
SourceBuffer.mode - Web APIs
Web › API › SourceBuffer › mode
ar mymode = sourcebuffer.mode; sourcebuffer.mode = 'sequence'; value a domstring. exceptions the following exceptions may be thrown when setting a new value for this property. exception explanation invalidaccesserror an attempt was made to set the value to segments when the initial value is sequence. invalidstateerror the sourcebuffer object is being updated (i.e. its sourcebuffer.updating property is currently true), the last media segment appended to this sourcebuffer is incomplete, or this sourcebuffer has been removed from the mediasource. example this snippet sets the sourcebuffer mode to 'sequence' if it is currently set to 'segments', thus setting the play order to the sequence in which media segments are appended. var curmode = sour...
SourceBuffer.timestampOffset - Web APIs
syntax var myoffset = sourcebuffer.timestampoffset; sourcebuffer.timestampoffset = 2.5; value a double, with the offset amount expressed in seconds. exceptions the following exceptions may be thrown when setting a new value for this property. exception explanation invalidstateerror one or more of the sourcebuffer objects in mediasource.sourcebuffers are being updated (i.e. their sourcebuffer.updating property is currently true), a media segment inside the sourcebuffer is currently being parsed, or this sourcebuffer has been removed from the mediasource. example tbd specifications specification status comment media source extensionsthe definition of 'timestampoffset' in that specification. recommendation initial definit...
SourceBuffer.trackDefaults - Web APIs
rcebuffer. syntax var mytrackdefaults = sourcebuffer.trackdefaults; sourcebuffer.trackdefaults = mytrackdefaultlist; value a trackdefaultlist object. exceptions the following exceptions may be thrown when setting a new value for this property. exception explanation invalidstateerror one or more of the sourcebuffer objects in mediasource.sourcebuffers are being updated (i.e. their sourcebuffer.updating property is currently true), or this sourcebuffer has been removed from the mediasource. example tbd ...
SourceBuffer.updating - Web APIs
whether an sourcebuffer.appendbuffer(), sourcebuffer.appendstream(), or sourcebuffer.remove() operation is currently in progress. syntax var isupdating = sourcebuffer.updating; value a boolean. ...
SpeechRecognitionResult.isFinal - Web APIs
syntax var myisfinal = speechrecognitionresultinstance.isfinal; returns a boolean. ...
SpeechRecognitionResult - Web APIs
sult interface of the web speech api represents a single recognition match, which may contain multiple speechrecognitionalternative objects. properties speechrecognitionresult.isfinal read only a boolean that states whether this result is final (true) or not (false) — if so, then this is the final time this result will be returned; if not, then this result is an interim result, and may be updated later on. speechrecognitionresult.length read only returns the length of the "array" — the number of speechrecognitionalternative objects contained in the result (also referred to as "n-best alternatives".) methods speechrecognitionresult.item a standard getter that allows speechrecognitionalternative objects within the result to be accessed via array syntax. examples this code is ...
StaticRange - Web APIs
it offers the same set of properties and methods as abstractrange. abstractrange and staticrange are not available from web workers. ...
StereoPannerNode.pan - Web APIs
example in our stereopannernode example (see source code) html we have a simple <audio> element along with a slider <input> to increase and decrease pan value. in the javascript we create a mediaelementaudiosourcenode and a stereopannernode, and connect the two together using the connect() method. we then use an oninput event handler to change the value of the stereopannernode.pan parameter and update the pan value display when the slider is moved. moving the slider left and right while the music is playing pans the music across to the left and right speakers of the output, respectively. var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var myaudio = document.queryselector('audio'); var pancontrol = document.queryselector('.panning-control'); var panvalue = document.q...
StereoPannerNode - Web APIs
example in our stereopannernode example (see source code) html we have a simple <audio> element along with a slider <input> to increase and decrease pan value. in the javascript we create a mediaelementaudiosourcenode and a stereopannernode, and connect the two together using the connect() method. we then use an oninput event handler to change the value of the stereopannernode.pan parameter and update the pan value display when the slider is moved. moving the slider left and right while the music is playing pans the music across to the left and right speakers of the output, respectively. var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var myaudio = document.queryselector('audio'); var pancontrol = document.queryselector('.panning-control'); var panvalue = document.q...
TextTrackList.onchange - Web APIs
vent handler which is called when the change event occurs, indicating that a change has occurred on a texttrack in the videotracklist. note: you can also add a handler for the change event using addeventlistener(). syntax texttracklist.onchange = eventhandler; example this snippet establishes a handler for the change event that looks at each of the tracks in the list, calling a function to update the state of a user interface control that indicates the current state of the track. var tracklist = document.queryselector("video, audio").texttracks; tracklist.onchange = function(event) { .... /* do something */ }; specifications specification status comment html living standardthe definition of 'texttracklist: onchange' in that specification. living stan...
TextTrackList - Web APIs
o element's text track list to get a media element's texttracklist, use its texttracks property. var texttracks = document.queryselector("video").texttracks; monitoring track count changes in this example, we have an app that displays information about the number of channels available. to keep it up to date, handlers for the addtrack and removetrack events are set up. texttracks.onaddtrack = updatetrackcount; texttracks.onremovetrack = updatetrackcount; function updatetrackcount(event) { trackcount = texttracks.length; drawtrackcountindicator(trackcount); } specifications specification status comment html living standardthe definition of 'textracklist' in that specification. living standard ...
UIEvent.pageX - Web APIs
Web › API › UIEvent › pageX
ative to the whole document. this property was never part of any standard, and was only implemented across a subset of browsers, and only for a limited number of versions. a standardized version of pagex was added to the mouseevent interface, however, and is well-supported. you should not expect to find pagex on any non-mouse events. do not look for pagex on any non-mouse events in new code and update existing code as soon as possible. syntax var pos = event.pagex value an integer value, in pixels, indicating the x coordinate at which the mouse pointer was located when the event occurred. this value is relative to the left edge of the entire document, regardless of the current horizontal scrolling offset of the document. examples for an example, see the documentation for the standard mo...
URL.createObjectURL() - Web APIs
you should do so. using object urls for media streams in older versions of the media source specification, attaching a stream to a <video> element required creating an object url for the mediastream. this is no longer necessary, and browsers are removing support for doing this. important: if you still have code that relies on createobjecturl() to attach streams to media elements, you need to update your code to simply set srcobject to the mediastream directly. specifications specification status comment file apithe definition of 'createobjecturl()' in that specification. working draft initial definition. media source extensionsthe definition of 'url' in that specification. recommendation mediasource extension. older versions of this ...
URL API - Web APIs
Web › API › URL API
/api/url_api, respectively. changing the url most of the properties of url are settable; you can write new values to them to alter the url represented by the object. for example, to create a url and set its username: let myusername = "someguy"; let addr = new url("https://mysite.com/login"); addr.username = myusername; setting the value of username not only sets that property's value, but it updates the overall url. after executing the code snippet above, the value returned by addr.href is https://someguy@mysite.com/login. this is true for any of the writable properties. queries the search property on a url contains the query string portion of the url. for example, if the url is https://mysite.com/login?user=someguy&page=news, then the value of the search property is ?user=someguy&page=ne...
VideoPlaybackQuality.creationTime - Web APIs
sample of the video quality was obtained. for details on how the time is determined, see performance.now(). example this example calls getvideoplaybackquality() to obtain a videoplaybackquality object, then determines what percentage of frames have been lost by either corruption or being dropped. if that exceeds 10% (0.1), a function called lostframesthresholdexceeded() is called to, perhaps, update a quality indicator to show an increase in frame loss. var videoelem = document.getelementbyid("my_vid"); var quality = videoelem.getvideoplaybackquality(); if ((quality.corruptedvideoframes + quality.droppedvideoframes)/quality.totalvideoframes > 0.1) { lostframesthresholdexceeded(); } specifications specification status comment media playback qualitythe definition...
VideoPlaybackQuality.totalVideoFrames - Web APIs
t would have presented had no problems occurred. this value is reset when the media is reloaded or replaced. example this example calls getvideoplaybackquality() to obtain a videoplaybackquality object, then determines what percentage of frames have been lost by either corruption or being dropped. if that exceeds 10% (0.1), a function called lostframesthresholdexceeded() is called to, perhaps, update a quality indicator to show an increase in frame loss. var videoelem = document.getelementbyid("my_vid"); var quality = videoelem.getvideoplaybackquality(); if ((quality.corruptedvideoframes + quality.droppedvideoframes)/quality.totalvideoframes > 0.1) { lostframesthresholdexceeded(); } a similar algorithm might be used to attempt to switch to a lower-resolution video that requires less band...
VideoTrackList - Web APIs
ent's video track list to get a media element's videotracklist, use its videotracks property. var videotracks = document.queryselector("video").videotracks; monitoring track count changes in this example, we have an app that displays information about the number of channels available. to keep it up to date, handlers for the addtrack and removetrack events are set up. videotracks.onaddtrack = updatetrackcount; videotracks.onremovetrack = updatetrackcount; function updatetrackcount(event) { trackcount = videotracks.length; drawtrackcountindicator(trackcount); } specifications specification status comment html living standardthe definition of 'videotracklist' in that specification. living standard ...
WebGL2RenderingContext.texImage3D() - Web APIs
opengl es 3.0the definition of 'glteximage3d' in that specification. standard man page of the (similar) opengl es 3.0 api. ...
WebGL2RenderingContext.vertexAttribDivisor() - Web APIs
instances of primitives with gl.drawarraysinstanced() and gl.drawelementsinstanced(). note: when using webgl 1, the angle_instanced_arrays extension can provide this method, too. syntax void gl.vertexattribdivisor(index, divisor); parameters index a gluint specifying the index of the generic vertex attributes. divisor a gluint specifying the number of instances that will pass between updates of the generic attribute. return value none. examples gl.vertexattribdivisor(0, 2); specifications specification status comment webgl 2.0the definition of 'vertexattribdivisor' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glvertexattribdivisor' in that specification. standard man page of t...
WebGL2RenderingContext - Web APIs
webgl tutorial has more information, examples, and resources on how to get started with webgl. constants see the webgl constants page. state information webgl2renderingcontext.getindexedparameter() returns the indexed value for the given target. 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.copybuffersubdata() copies part of the data of a buffer to another buffer. webgl2renderingcontext.getbuffersubdata() reads data from a buffer and writes them to an arraybuffer or sharedarraybuffer. framebuffers webgl2renderingcontext.blitframebuffer() transfers a block of pixels from the read framebuffer to the draw frame...
WebGLRenderingContext.bindBuffer() - Web APIs
specification status comment webgl 1.0the definition of 'bindbuffer' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glbindbuffer' in that specification. standard man page of the (similar) opengl es 2 api. webgl 2.0the definition of 'bindbuffer' in that specification. editor's draft updated definition for webgl 2. adds new target buffers: gl.copy_read_buffer, gl.copy_write_buffer, gl.transform_feedback_buffer, gl.uniform_buffer, gl.pixel_pack_buffer, gl.pixel_unpack_buffer opengl es 3.0the definition of 'glbindbuffer' in that specification. standard man page of the (similar) opengl es 3 api. ...
WebGLRenderingContext.bindFramebuffer() - Web APIs
ns specification status comment webgl 1.0the definition of 'bindframebuffer' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glbindframebuffer' in that specification. standard man page of the opengl api. webgl 2.0the definition of 'bindframebuffer' in that specification. editor's draft updated definition for webgl 2. adds: gl.draw_framebuffer and gl.read_framebuffer opengl es 3.0the definition of 'glbindframebuffer' in that specification. standard man page of the (similar) opengl es 3 api. ...
WebGLRenderingContext.bindTexture() - Web APIs
specification status comment webgl 1.0the definition of 'bindtexture' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glbindtexture' in that specification. standard man page of the (similar) opengl es 2.0 api. webgl 2.0the definition of 'bindtexture' in that specification. editor's draft updated definition for webgl 2. adds: gl.texture_3d and gl.texture_2d_array opengl es 3.0the definition of 'glbindtexture' in that specification. standard man page of the (similar) opengl es 3.0 api. ...
WebGLRenderingContext.bufferSubData() - Web APIs
syntax // webgl1: void gl.buffersubdata(target, offset, arraybuffer srcdata); void gl.buffersubdata(target, offset, arraybufferview srcdata); // webgl2: void gl.buffersubdata(target, dstbyteoffset, arraybufferview srcdata, srcoffset, length); parameters target a glenum specifying the binding point (target). possible values: gl.array_buffer: buffer containing vertex attributes, such as vertex coordinates, texture coordinate data, or vertex color data. gl.element_array_buffer: buffer used for element indices. ...
WebGLRenderingContext.checkFramebufferStatus() - Web APIs
ation status comment webgl 1.0the definition of 'checkframebufferstatus' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glcheckframebufferstatus' in that specification. standard man page of the opengl api. webgl 2.0the definition of 'checkframebufferstatus' in that specification. editor's draft updated definition for webgl 2. opengl es 3.0the definition of 'glcheckframebufferstatus' in that specification. standard man page of the (similar) opengl es 3 api. ...
WebGLRenderingContext.getBufferParameter() - Web APIs
status comment webgl 1.0the definition of 'getbufferparameter' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glgetbufferparameteriv' in that specification. standard man page of the (similar) opengl es 2 api. webgl 2.0the definition of 'getbufferparameter' in that specification. editor's draft updated definition for webgl. opengl es 3.0the definition of 'glgetbufferparameter' in that specification. standard man page of the (similar) opengl es 3 api. adds new target buffers: gl.copy_read_buffer, gl.copy_write_buffer, gl.transform_feedback_buffer, gl.uniform_buffer, gl.pixel_pack_buffer, gl.pixel_unpack_buffer adds new usage hints: gl...
WebGLRenderingContext.getFramebufferAttachmentParameter() - Web APIs
the definition of 'getframebufferattachmentparameter' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glgetframebufferattachmentparameteriv' in that specification. standard man page of the (similar) opengl api. webgl 2.0the definition of 'getframebufferattachmentparameter' in that specification. editor's draft updated definition for webgl 2. opengl es 3.0the definition of 'glgetframebufferattachmentparameteriv' in that specification. standard man page of the (similar) opengl es 3 api. ...
WebGLRenderingContext.getRenderbufferParameter() - Web APIs
comment webgl 1.0the definition of 'getrenderbufferparameter' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glgetrenderbufferparameteriv' in that specification. standard man page of the (similar) opengl api. webgl 2.0the definition of 'getrenderbufferparameter' in that specification. editor's draft updated definition for webgl 2. opengl es 3.0the definition of 'glgetrenderbufferparameteriv' in that specification. standard man page of the (similar) opengl es 3 api. adds a new pname value: gl.renderbuffer_samples ...
WebGLRenderingContext.getTexParameter() - Web APIs
ification status comment webgl 1.0the definition of 'gettexparameter' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glgettexparameter' in that specification. standard man page of the (similar) opengl es 2.0 api. webgl 2.0the definition of 'gettexparameter' in that specification. editor's draft updated definition for webgl. opengl es 3.0the definition of 'glgettexparameter' in that specification. standard man page of the (similar) opengl es 3.0 api. ...
WebGLRenderingContext.getUniform() - Web APIs
ns specification status comment webgl 1.0the definition of 'getuniform' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glgetuniform' in that specification. standard man page of the (similar) opengl es 2 api. webgl 2.0the definition of 'getuniform' in that specification. editor's draft updated definition for webgl. opengl es 3.0the definition of 'glgetuniform' in that specification. standard man page of the (similar) opengl es 3 api. ...
WebGLRenderingContext.getVertexAttrib() - Web APIs
specification status comment webgl 1.0the definition of 'getvertexattrib' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glgetvertexattrib' in that specification. standard man page of the opengl es 2 api. webgl 2.0the definition of 'getvertexattrib' in that specification. editor's draft updated definition for webgl 2. opengl es 3.0the definition of 'glgetvertexattrib' in that specification. standard man page of the opengl es 3 api. ...
WebGLRenderingContext.isContextLost() - Web APIs
ttery power), and the user or system decides to switch gpus. in this case, all contexts are lost, then restored after switching gpus. another page running in the user's browser performs an operation using the gpu that takes too long, causing hte browser to decide to reset the gpu in order to break the stall. this would cause every webgl context to be lost throughout the entire browser. the user updates their graphics driver on an operating system that allows graphics drivers to be updated without restarting the system. examples for example, when checking for program linking success, you could also check if the context is not lost: gl.linkprogram(program); if (!gl.getprogramparameter(program, gl.link_status) && !gl.iscontextlost()) { var info = gl.getprograminfolog(program); console.lo...
WebGLRenderingContext.pixelStorei() - Web APIs
webgl 1.0the definition of 'pixel storage parameters' in that specification. recommendation additional pixel storage parameters that aren't specified in opengl. opengl es 2.0the definition of 'glpixelstorei' in that specification. standard man page of the opengl es 2.0 api. webgl 2.0the definition of 'pixelstorei' in that specification. editor's draft updated definition for webgl 2. opengl es 3.0the definition of 'glpixelstorei' in that specification. standard man page of the opengl es 3.0 api. ...
WebGLRenderingContext.renderbufferStorage() - Web APIs
tion status comment webgl 1.0the definition of 'renderbufferstorage' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glrenderbufferstorage' in that specification. standard man page of the opengl es 2 api. webgl 2.0the definition of 'getrenderbufferparameter' in that specification. editor's draft updated definition for webgl 2. opengl es 3.0the definition of 'glrenderbufferstorage' in that specification. standard man page of the (similar) opengl es 3 api. adds many new internal formats. ...
WebGLRenderingContext.stencilFuncSeparate() - Web APIs
ncseparate() method of the webgl api sets the front and/or back function and reference value for stencil testing. stencilling enables and disables drawing on a per-pixel basis. it is typically used in multipass rendering to achieve special effects. syntax void gl.stencilfuncseparate(face, func, ref, mask); parameters face a glenum specifying whether the front and/or back stencil state is updated. the possible values are: gl.front gl.back gl.front_and_back func a glenum specifying the test function. the default function is gl.always. the possible values are: gl.never: never pass. gl.less: pass if (ref & mask) < (stencil & mask). gl.equal: pass if (ref & mask) = (stencil & mask). gl.lequal: pass if (ref & mask) <= (stencil & mask). gl.gr...
WebGLRenderingContext.stencilMaskSeparate() - Web APIs
ethod of the webgl api controls enabling and disabling of front and/or back writing of individual bits in the stencil planes. the webglrenderingcontext.stencilmask() method can set both, the front and back stencil writemasks to one value at the same time. syntax void gl.stencilmaskseparate(face, mask); parameters face a glenum specifying whether the front and/or back stencil writemask is updated. the possible values are: gl.front gl.back gl.front_and_back mask a gluint specifying a bit mask to enable or disable writing of individual bits in the stencil planes. by default, the mask is all 1. return value none. examples gl.stencilmaskseparate(gl.front, 110101); to get the current stencil masks, query the stencil_writemask, stencil_back_writemask, or stencil_bits const...
WebGLRenderingContext.stencilOpSeparate() - Web APIs
the webglrenderingcontext.stencilopseparate() method of the webgl api sets the front and/or back-facing stencil test actions. syntax void gl.stencilopseparate(face, fail, zfail, zpass); parameters the fail, zfail and zpass parameters accept all constants listed below. face a glenum specifying whether the front and/or back stencil state is updated. the possible values are: gl.front gl.back gl.front_and_back fail a glenum specifying the function to use when the stencil test fails. the default value is gl.keep. zfail a glenum specifying the function to use when the stencil test passes, but the depth test fails. the default value is gl.keep. zpass a glenum specifying the function to use when both the stencil test and the depth test pass, or when the stencil test passes an...
WebGLRenderingContext.texImage2D() - Web APIs
specification status comment webgl 1.0the definition of 'teximage2d' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glteximage2d' in that specification. standard man page of the (similar) opengl es 2.0 api. webgl 2.0the definition of 'teximage2d' in that specification. editor's draft updated definition for webgl. opengl es 3.0the definition of 'glteximage2d' in that specification. standard man page of the (similar) opengl es 3.0 api. ...
WebGLRenderingContext.texParameter[fi]() - Web APIs
cification status comment webgl 1.0the definition of 'texparameter[fi]' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'gltexparameter' in that specification. standard man page of the (similar) opengl es 2.0 api. webgl 2.0the definition of 'texparameter[fi]' in that specification. editor's draft updated definition for webgl. opengl es 3.0the definition of 'gltexparameter' in that specification. standard man page of the (similar) opengl es 3.0 api. ...
WebGLRenderingContext.texSubImage2D() - Web APIs
specification status comment webgl 1.0the definition of 'texsubimage2d' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'gltexsubimage2d' in that specification. standard man page of the (similar) opengl es 2.0 api. webgl 2.0the definition of 'texsubimage2d' in that specification. editor's draft updated definition for webgl. opengl es 3.0the definition of 'gltexsubimage2d' in that specification. standard man page of the (similar) opengl es 3.0 api. ...
Color masking - Web APIs
the range of displayed colors to specific shades. masking random colors this example modifies the random color animation by applying color masking with colormask(). you can think of the color masking operation as if looking at the colored canvas through some tinted glass or color filter. so, by masking off the blue and green channels, you are only allowing the red component of pixels to be updated, and therefore it is as if you were looking through a red tinted glass. color masking allows us to demonstrate some basics of color theory. by masking off some channel(s), we are in fact biasing the displayed colors towards the complementary color. so, clearly masking both blue and red, would give us shades of green. masking only the blue channel would give us shades of yellow (including shades...
Scissor animation - Web APIs
« previousnext » a simple webgl example in which we have some animation fun using scissoring and clearing operations. animation with scissoring in this example, we are animating squares using scissor() and clear(). we again establish an animation loop using timers. note that this time it is the position of the square (the scissoring area) that is updated every frame (we set frame rate to roughly one every 17ms, or roughly 60fps – frames per second). in contrast, the color of the square (set with clearcolor) is only updated when a new square is created. this is a nice demonstration of webgl as a state machine. for each square, we set its color once, and then update only its position every frame. the clear color state of webgl remains at the set value, until we change it agai...
Creating 3D objects using WebGL - Web APIs
// tell webgl how to pull out the positions from the position // buffer into the vertexposition attribute { const numcomponents = 3; ... gl.vertexattribpointer( programinfo.attriblocations.vertexposition, numcomponents, type, normalize, stride, offset); gl.enablevertexattribarray( programinf...
Using shaders to apply color in WebGL - Web APIs
loat32array(colors), gl.static_draw); return { position: positionbuffer, color: colorbuffer, }; } this code starts by creating a javascript array containing four 4-value vectors, one for each vertex color. then a new webgl buffer is allocated to store these colors, and the array is converted into floats and stored into the buffer. ...
WebGL best practices - Web APIs
ompute this constant on a few target systems to get a reliable estimate. now adjust all internal caching in the application (webglbuffers, webgltextures, etc.) to obey a maximum size, computed by this constant multiplied by the number of pixels covered by the current browser window. this requires estimating the number of bytes consumed by each texture, for example. the cap also must typically be updated as the browser window resizes, and older resources above the limit must be purged. keeping the application's vram usage under this cap will help to avoid out-of-memory errors and associated instability. consider rendering to a smaller backbuffer size a common (and easy) way to trade off quality for speed is rendering into a smaller backbuffer, and upscaling the result. consider reducing canva...
WebGL: 2D and 3D graphics for the web - Web APIs
Web › API › WebGL API
it is based on opengl es 3.0 and new features include: 3d textures, sampler objects, uniform buffer objects, sync objects, query objects, transform feedback objects, promoted extensions that are now core to webgl 2: vertex array objects, instancing, multiple render targets, fragment depth. see also the blog post "...
WebRTC connectivity - Web APIs
called the controlled agent. you can identify which one your end of the connection is by examining the value of rtcicecandidate.transport.role, although in general it doesn't matter which is which. the controlling agent not only takes responsibility for making the final decision as to which candidate pair to use, but also for signaling that selection to the controlled agent by using stun and an updated offer, if necessary. the controlled agent just waits to be told which candidate pair to use. it's important to keep in mind that a single ice session may result in the controlling agent choosing more than one candidate pair. each time it does so and shares that information with the controlled agent, the two peers reconfigure their connection to use the new configuration described by the new can...
Introduction to the Real-time Transport Protocol (RTP) - Web APIs
its multiplexing and checksum features. rtp supports multicast; while this isn't yet important for webrtc, it's likely to matter in the future, when webrtc is (hopefully) enhanced to support multi-user conversations. rtp isn't limited to use in audiovisual communication. it can be used for any form of continuous or active data transfer, including data streaming, active badges or status display updates, or control and measurement information transport. things rtp doesn't do rtp itself doesn't provide every possible feature, which is why other protocols are also used by webrtc. some of the more noteworthy things rtp doesn't include: editor's note: we should add information about where these deficiencies are compensated for, if they are at all. rtp does not guarantee quality-of-service (q...
Lifetime of a WebRTC session - Web APIs
d one is closed. note: different browsers support ice restart under different sets of conditions. not all browsers will perform ice restart due to network congestion, for example. if you need to change the configuration of the connection in some way (such as changing to a different set of ice servers), you can do so before restarting ice by calling rtcpeerconnection.setconfiguration() with an updated rtcconfiguration dictionary before restarting ice. to explicitly trigger ice restart, simply start the renegotiation process by calling rtcpeerconnection.createoffer(), specifying the icerestart option with a value of true. then handle the connection process from then on just like you normally would. this generates new values for the ice username fragment (ufrag) and password, which will be use...
Using WebRTC data channels - Web APIs
of being implemented; see bug 1381145 to track it becoming available for general use. the chrome team is tracking their implementation of ndata support in chrome bug 5696. much of the information in this section is based in part on the blog post demystifyijng webrtc's data channel message size limitations, written by lennart grahl. he goes into a bit more detail there, but as browsers have been updated since then some of it may be out-of-date. in addition, as time goes by, it will become more so, especially once eor and ndata support are fully integrated in the major browsers. security all data transferred using webrtc is encrypted. in the case of rtcdatachannel, the encryption used is datagram transport layer security (dtls), which is based on transport layer security (tls). since tls is u...
WebSocket: close event - Web APIs
given that you have a variable called examplesocket that refers to an opened websocket, this handler would handle the situation where the socket has been closed. ...
Writing WebSocket client applications - Web APIs
begin listening for incoming data, you can do something like this: examplesocket.onmessage = function (event) { console.log(event.data); } receiving and interpreting json objects let's consider the chat client application first alluded to in using json to transmit objects. ...
Fundamentals of WebXR - Web APIs
nd isn't webxr is an api for web content and apps to use to interface with mixed reality hardware such as vr headsets and glasses with integrated augmented reality features. this includes both managing the process of rendering the views needed to simulate the 3d experience and the ability to sense the movement of the headset or other motion sensing apparatus to provide the needed data to let you update the imagery shown to the user based on that movement. webxr additionally provides support for accepting inputs from control devices such as handheld vr controllers or specialized mixed reality gamepads. webxr is not a rendering technology, and provides no features for actually managing 3d data or rendering it to the display. this is an important fact to keep in mind; while webxr manages the tim...
Lighting a WebXR setting - Web APIs
the shape and orientation of the objects in the scene, along with information about the materials they're made of, then returns data you can use to create virtual light source objects that approximately match the real world's lighting. the specifics of how lighting estimation works, especially in the context of the proposed api, is out of scope for the moment. once the api has stabilized, we'll update this documentation with the details. security and privacy concerns there are a number of potential security issues involved with collecting all of this data in order to generate and apply lighting to your virtual objects using real-world data. of course, many ar applications make it pretty clear where the user is located. if the user is running an app called touring the louvre, there's a very ...
WebXR performance guide - Web APIs
means the memory management becomes a problem eventually if you keep allocating and de-allocating memory objects. consider the following function drawscene(gl, view, programinfo, buffers, texture, deltatime) { ... for (object in scene) { let vertexlist = ... let normalmatrix = mat4.create(); let modelviewmatrix = mat4.create(); let objectmatrix = mat4. // apply rotation updates to the object if needed mat4.rotate( } } this renders a scene. but it's inefficient, because it allocates as local variables a number of things, including at least two matrices, an array of vertices, and more. that means that for every frame, the javascript runtime has to allocate memory for those and set them up—possibly triggering garbage collection—and then when each interaction o...
Rendering and the WebXR frame animation callback - Web APIs
ersecond each contian that axis's component of the object's velocity. in other words, [xdistancemoved, ydistancemoved, zdistancemoved] is a vector representing the velocity of the object. additional tasks related to animating the scene there are, of course, other things that probably need to happen each pass through the renderer. two of the most common are handling of user inputs and performing updates to the positions of objects (or the viewer) based on known factors, such as those user control states or known animation paths of the objects in the scene. handling user control inputs there are three methods by which users might provide input while using a webxr application. first, webxr supports directly handling inputs from the controllers which are integrated with the xr hardware itself. t...
Spaces and reference spaces: Spatial tracking in WebXR - Web APIs
not only does your app need to determine what to show the user during these periods, but it needs to cleanly recover when tracking resumes. once the xr hardware begins providing tracking information, it will continue to do so until the xr session is clsoed. this data is obtained during each frame by calling the xrfram...
Web Animations API Concepts - Web APIs
vel 2 spec of the web animations api. assembling the animation from disparate pieces we can assemble all these pieces together to create a working animation with the animation() constructor or we can use the element.animate() shortcut function. (read more about how to use element.animate() in using the web animations api.) uses the api allows for the creation of dynamic animations that can be updated on the fly as well as more straightforward, declarative animations like those css creates. it can be used in automated tests to ensure that your ui animations are running correctly. it opens up the browser’s rendering engine for building animation development tools like timelines. it is also a performant base on which to build a custom or commercial animation library. (see animating like you j...
Migrating from webkitAudioContext - Web APIs
the web audio api went through many iterations before reaching its current state. it was first implemented in webkit, and some of its older parts were not immediately removed as they were replaced in the specification, leading to many sites using non-compatible code. in this article, we cover the differences in web audio api since it was first implemented in webkit and how to update your code to use the modern web audio api. the web audio standard was first implemented in webkit, and the implementation was built in parallel with the work on the specification of the api. as the specification evolved and changes were made to the spec, some of the old implementation pieces were not removed from the webkit (and blink) implementations due to backwards compatibility reasons. new engines impl...
Example and tutorial: Simple synth keyboard - Web APIs
h); customwaveform = audiocontext.createperiodicwave(cosineterms, sineterms); for (i=0; i<9; i++) { osclist[i] = []; } } setup(); the table which maps note names and octaves to their frequenies is created by calling createnotetable(). an event handler is established (by calling our old friend addeventlistener() to handle change events on the master gain control. this will simply update the master gain node's volume to the new value of the control. next, we iterate over each octave in the note frequencies table. for each octave, we use object.entries() to get a list of the notes in that octave. create a <div> to contain that octave's notes (so we can have a small bit of space drawn between octaves), and set its class name to "octave" for each key in the octave, we check to se...
Visualizations with Web Audio API - Web APIs
we have one available in voice-change-o-matic; let's look at how it's done. first, we again set up our analyser and data array, then clear the current canvas display with clearrect(). the only difference from before is that we have set t...
Web Audio API - Web APIs
ong the standard waveforms as well as one custom waveform, and you can control the master gain using a volume slider beneath the keyboard. this example makes use of the following web api interfaces: audiocontext, oscillatornode, periodicwave, and gainnode.migrating from webkitaudiocontextin this article, we cover the differences in web audio api since it was first implemented in webkit and how to update your code to use the modern web audio api. tools for analyzing web audio usagewhile working on your web audio api code, you may find that you need tools to analyze the graph of nodes you create or to otherwise debug your work. this article discusses tools available to help you do that.using iir filtersthat's it for our iirfilter demo. this should have shown you how to use the basics, and help...
Web Storage API - Web APIs
ored.) storageevent the storage event is fired on a document's window object when a storage area changes. examples to illustrate some typical web storage usage, we have created a simple example, imaginatively called web storage demo. the landing page provides controls that can be used to customize the colour, font and decorative image. when you choose different options, the page is instantly updated; in addition your choices are stored in localstorage, so that when you leave the page then load it again later on your choices are remembered. in addition, we have provided an event output page — if you load this page in another tab, then make changes to your choices in the landing page, you'll see the updated storage information outputted as the storageevent is fired. specifications ...
Using Web Workers - Web APIs
shared web workers, there are other types of worker available: serviceworkers essentially act as proxy servers that sit between web applications, and the browser and network (when available). they are intended to (amongst other things) enable the creation of effective offline experiences, intercepting network requests and taking appropriate action based on whether the network is available and updated assets reside on the server. they will also allow access to push notifications and background sync apis. chrome workers are a firefox-only type of worker that you can use if you are developing add-ons and want to use workers in extensions and have access to js-ctypes in your worker. see chromeworker for more details. audio worklet provide the ability for direct scripted audio processing to be ...
Web Workers API - Web APIs
ust communicate via an active port. see sharedworker for more details. serviceworkers essentially act as proxy servers that sit between web applications, the browser, and the network (when available). they are intended, among other things, to enable the creation of effective offline experiences, intercept network requests and take appropriate action based on whether the network is available, and update assets residing on the server. they will also allow access to push notifications and background sync apis. chrome workers are a firefox-only type of worker that you can use if you are developing add-ons and want to use workers in extensions and have access to js-ctypes in your worker. see chromeworker for more details. audio workers provide the ability for direct scripted audio processing to b...
window.cancelAnimationFrame() - Web APIs
ionframe; var cancelanimationframe = window.cancelanimationframe || window.mozcancelanimationframe; var start = window.mozanimationstarttime; // only supported in ff. other browsers can use something like date.now(). var myreq; function step(timestamp) { var progress = timestamp - start; d.style.left = math.min(progress / 10, 200) + 'px'; if (progress < 2000) { // it's important to update the requestid each time you're calling requestanimationframe myreq = requestanimationframe(step); } } myreq = requestanimationframe(step); // the cancelation uses the last requestid cancelanimationframe(myreq); specifications specification status comment html living standardthe definition of 'cancelanimationframe()' in that specification. living standard ...
Window.controllers - Web APIs
urns the xul controllers of the chrome window. syntax controllers = window.controllers controllers is an object of type xulcontrollers (nsicontrollers). specification xul-specific. not part of specification. by default, a window's controller contains the code that supports the global window commands. chrome code can add controllers (to be used in conjunction with the godocommand and goupdatecommand functions in globaloverlay.js). however, the added controllers must be explicitly removed when the window is unloaded, as this is not done automatically. each missing removal can cause bug 415775: assertion: xpconnect is being called on a scope without a 'components' property! ...
Window.getComputedStyle() - Web APIs
y values are accessed through apis provided by the object, or by indexing with css property names. syntax var style = window.getcomputedstyle(element [, pseudoelt]); element the element for which to get the computed style. pseudoeltoptional a string specifying the pseudo-element to match. omitted (or null) for real elements. the returned style is a live cssstyledeclaration object, which updates automatically when the element's styles are changed. throws typeerror if the passed object is not an element or the pseudoelt is not a valid pseudo-element selector or is ::part() or ::slotted(). note: valid pseudo-element selector refers to syntactic validity, e.g. ::unsupported is considered valid, even though the pseudo-element itself is not supported. examples in this exampl...
Window: popstate event - Web APIs
to store with the current-entry before navigating away from it, it then does so. the entry is now said to have "persisted user state." this information the browser might add to the history session entry may include, for instance, the document's scroll position, the values of form inputs, and other such data. if new-entry has a different document object than current-entry, the browsing context is updated so that its document property refers to the document referred to by new-entry, and the context's name is updated to match the context name of the now-current document. each form control within new-entry's document that has autocomplete configured with its autofill field name set to off is reset. see the html autocomplete attribute for more about the autocomplete field names and how autocomplete...
Window.setImmediate() - Web APIs
this method is not expected to become standard, and is only implemented by recent builds of internet explorer and node.js 0.10+. it meets resistance both from gecko (firefox) and webkit (google/apple). syntax var immediateid = setimmediate(func, [param1, param2, ...]); var immediateid = setimmediate(func); where immediateid is the id of the immediate which can be used later with window.clearimmediate. ...
Window - Web APIs
Web › API › Window
specified number of pages. window.scrollto() scrolls to a particular set of coordinates in the document. window.setimmediate() executes a function after the browser has finished other heavy tasks window.setresizable() toggles a user's ability to resize a window. window.sizetocontent() sizes the window according to its content. window.stop() this method stops window loading. window.updatecommands() updates the state of commands of the current chrome window (ui). methods implemented from elsewhere eventtarget.addeventlistener() register an event handler to a specific event type on the window. eventtarget.dispatchevent() used to trigger an event. windoworworkerglobalscope.atob() decodes a string of data which has been encoded using base-64 encoding. windoworworkergloba...
WindowEventHandlers.onbeforeunload - Web APIs
on the event will guarantee the browser unload happens delete e['returnvalue']; }); notes when your page uses javascript to render content, the javascript may stop when leaving and then navigating back to the page. you can bind to window.onbeforeunload to prevent the browser from fully caching the page. if you do so, javascript in the page will be triggered on the subsequent return visit and update the content as desired. specifications the event was originally introduced by microsoft in internet explorer 4 and standardized in the html5 specification. specification status comment html living standardthe definition of 'onbeforeunload' in that specification. living standard html 5.1the definition of 'globaleventhandlers' in that specification. ...
WindowEventHandlers.onlanguagechange - Web APIs
the list is accessible via navigatorlanguage.languages. ...
WorkerNavigator.permissions - Web APIs
syntax permissionsobj = self.permissions value a permissions object. examples self.navigator.permissions.query({name:'notifications'}).then(function(result) { if (result.state === 'granted') { shownotification(); } else if (result.state === 'prompt') { requestnotificationpermission() } }); specification specification status comment permissions working draft initial definition. ...
WorkerNavigator - Web APIs
ernavigator.connectionread only provides a networkinformation object containing information about the network connection of a device. workernavigator.locks read only returns a lockmanager object which provides methods for requesting a new lock object and querying for an existing lock object. workernavigator.permissions read only returns a permissions object that can be used to query and update permission status of apis covered by the permissions api. navigator.storageread only returns a storagemanager interface for managing persistance permissions and estimating available storage. inherited properties navigatorid.appcodename read only always returns 'mozilla', in any browser. this property is kept only for compatibility purposes. navigatorid.appname read only returns t...
XMLHttpRequest - Web APIs
xmlhttprequest is used heavily in ajax programming. ...
XRHandedness - Web APIs
input controller is being held in, worn on, or is attached to the user's left hand. right the input controller is being held in, worn on, or is attached to the user's right hand. examples one important usage scentario for handedness is to determine which hand a controller is in so you can draw a representation of that hand (or the device that hand is controlling) in virtual space. ...
XRInputSource.handedness - Web APIs
of handedness is none. this may indicate, for example, an input source which isn't hand-held, such as controls built into a headset or an input device attached to the head or body. examples one important usage scentario for handedness is to determine which hand a controller is in so you can draw a representation of that hand (or the device that hand is controlling) in virtual space. ...
XRInputSource.targetRayMode - Web APIs
n tap, or mouse click. for tracked pointers, a function myrendertargetrayasbeam() is called to render a beam from the input controller's virtual position outward in the direction it's pointing. the code should continue to perform tasks such as drawing controllers or any objects representative of the user's hands' positions in the virtual space, as well as any other input-related tasks. function updateinputsources(session, frame, refspace) { for (let source of session.getinputsources()) { let targetraypose = frame.getpose(inputsource.targetrayspace, refspace); if (targetraypose) { if (source.targetraymode == "tracked-pointer") { myrendertargetrayasbeam(targetraypose); } } /* ... */ } } see the article inputs and input sources for more details and a mo...
XRInputSource.targetRaySpace - Web APIs
n tap, or mouse click. for tracked pointers, a function myrendertargetrayasbeam() is called to render a beam from the input controller's virtual position outward in the direction it's pointing. the code should continue to perform tasks such as drawing controllers or any objects representative of the user's hands' positions in the virtual space, as well as any other input-related tasks. function updateinputsources(session, frame, refspace) { for (let source of session.getinputsources()) { let targetraypose = frame.getpose(inputsource.targetrayspace, refspace); if (targetraypose) { if (source.targetraymode == "tracked-pointer") { myrendertargetrayasbeam(targetraypose); } } /* ... */ } } see the article inputs and input sources for more details and a mo...
XRInputSourcesChangeEvent() - Web APIs
you won't typically call this constructor yourself, as these events are created and sent to you by the webxr system. syntax newinputsourceschangeevent = new xrinputsourceschangeevent(type, eventinitdict); parameters type a domstring indicating the type of event which has occurred. this string must always be inputsourceschange. eventinitdict an object conforming to the xrinputsourceschangeeventinit dictionary, prodividing the initial values for the event. ...
XRPose - Web APIs
Web › API › XRPose
a viewer (or camera) is represented by the xrviewerpose subclass of xrpose. this is obtained using xrframe.getviewerpose() instead of getpose(), specifying a reference space which has been adjusted to position and orient the node to provide the desired viewing position and angle: viewerpose = xrframe.getviewerpose(adjreferencespace); here, adjreferencespace is a reference space which has been updated using the base frame of reference for the frame and any adjustments needed to position the viewer based on movement or rotation which is being supplied from a source other than the xr device, such as keyboard or mouse inputs. see the article movement, orientation, and motion for further details and an example with thorough explanations of what's going on. properties xrpose.transform read on...
XRReferenceSpace.getOffsetReferenceSpace() - Web APIs
u up to be ignored by calling preventdefault() on those events. this prevents the right-clicks from causing the context menu from appearing in the browser. canvas.oncontextmenu = (event) => { event.preventdefault(); }; canvas.addeventlistener("mousemove", (event) => { if (event.buttons & 2) { rotateviewby(event.movementx, event.movementy); } }); next, the rotateviewby() function, which updates the mouse look direction's yaw and pitch based on the mouse delta values from the mousemove event. the pitch is restricted so that you can't look beyond straight up and straight down. each time this is called, the new offsets are used to update the current values of mousepitch and mouseyaw. let mouseyaw = 0.0; let mousepitch = 0.0; const inverseorientation = quat.create(); const mouse_speed = 0...
XRReferenceSpaceEvent.transform - Web APIs
post-event coordiante system. syntax let refspace = xrreferencespaceevent.transform; value an xrrigidtransform object providing a transform that can be used to convert coordinates from the pre-event coordinate system to the post-event coordinate system. usage notes upon receiving a reset event, you can apply the transform to cached position or orientation information to shift them into the updated coordinate system. alternatively, you can just discard any cached positional information and recompute from scratch. the approach you take will depend on your needs. for details on what causes a reset event and how to respond, see the reset event's documentation. examples this example handles the reset event by walking through all the objects in a scene, updating each object's position by mul...
XRReferenceSpaceEvent - Web APIs
n after the event, defined relative to the coordinate system before the event. methods while xrreferencespaceevent does not define any methods, it inherits the methods of its parent interface, event. event types reset the reset event is sent to a reference space when its native origin is changed due to a discontinuity, recalibration, or device reset. this is an opportunity for your app to update any stored transforms, position/orientation information, or the like—or to dump any cached values based on the reference's space's origin so you can recompute them as needed. specifications specification status comment webxr device apithe definition of 'xrreferencespaceevent' in that specification. working draft initial definition. ...
XRRenderState - Web APIs
ed by an xrsession gets composited. these properties include the range of distances from the viewer within which content should be rendered, the vertical field of view (for inline presentations), and a reference to the xrwebgllayer being used as the target for rendering the scene prior to it being presented on the xr device's display or displays. when you apply changes using the xrsession method updaterenderstate(), the specified changes take effect after the current animation frame has completed, but before the next one begins. properties the followiing properties are available on xrrenderstate objects. baselayer read only the xrwebgllayer from which the browser's compositing system obtains the image for the xr session. depthfar read only the distance, in meters, of the far clip ...
XRRigidTransform.position - Web APIs
form matrix. the units are meters. note: the w component of the point is always 1.0. ...
XRSession.cancelAnimationFrame() - Web APIs
callback schedules the next one, removing the callback terminates updating of the webxr scene. ...
XRSession.end() - Web APIs
Web › API › XRSession › end
the end() method shuts down the xrsession on which it's called, returning a promise which resolves once the session has fully shut down. syntax xrsession.end(); parameters none. return value a promise that resolves without a value after any platform-specific steps related to shutting down the session have completed. you can use the promise to do things like update ui elements to reflect the shut down connection, trigger application shut down, or whatever else you might need to do. example specifications specification status comment webxr device apithe definition of 'xrsession.end' in that specification. working draft initial definition. ...
XRSession.inputSources - Web APIs
. note: traditional gamepad controllers are supported using the gamepad api. syntax inputsources = xrsession.inputsources; value an xrinputsourcearray object listing all of the currently-connected input controllers which are linked specifically to the xr device currently in use. the returned object is live; as devices are connected to and removed from the user's system, the list's contents update to reflect the changes. usage notes you can add a handler for the xrsession event inputsourceschange to be advised when the contents of the session's connected devices list changes. you can then either get the value of inputsources to examine the list, or you can refer to a reference to the list that you've previously saved. specifications specification status comment ...
XRSession.oninputsourceschange - Web APIs
the oninputsourcechange attribute of the xrsession object is the event handler for the inputsourcechange event, which is dispatched when session's list of active xr input sources has changed. the list itself is accessible via xrsession.inputsources. note: the xrinputsource objects in xrsession.inputsources array are "live", so values within them are updated in-place. therefore if you wish to compare input states between frames, you should make a copy of the content of the state in question. syntax xrsession.oninputsourceschange = function(event) { ... } example xrsession.oninputsourceschange = function(event) { console.log("the list of active xr input sources has changed.") } specifications specification status comment webxr device apithe defi...
XRSession.renderState - Web APIs
e returns a xrrenderstate object describing how the user's environment which should be rendered. the information provided covers the minimum and maximum distance at which to render objects, the vertical field of view to use when rendering the in the inline session mode, and the xrwebgllayer to render into for inline composition. while this property is read only, you can call the xrsession method updaterenderstate() to make changes. syntax var xrrenderstate = xrsession.renderstate; value an xrrenderstate object describing how to render the scene. specifications specification status comment webxr device apithe definition of 'xrsession.renderstate' in that specification. working draft initial definition. ...
XRSession - Web APIs
Web › API › XRSession
ack using cancelanimationframe(). this method is comparable to the window.requestanimationframe() method. requestreferencespace() requests that a new xrreferencespace of the specified type be created. returns a promise which resolves with the xrreferencespace or xrboundedreferencespace which was requested, or throws a notsupportederror if the requested space type isn't supported by the device. updaterenderstate() updates the properties of the session's render state to match the values specified in the specified xrrenderstateinit dictionary. any properties not included in the given dictionary are left unchanged from their current values. events the following events are delivered to xrsession objects. event description end sent to the xrsession object after the ...
XRSessionInit - Web APIs
stsession() method. properties the following parameters are all optional. if none are included, the device will use a default feature configuration for all options. optionalfeatures optional an array of values identifying features which the returned xrsession may optionally support. at this time, all features are identified using strings from the xrreferencespacetype enumeration, but future updates to the webxr standard may add more features. requiredfeatures optional an array of values which the returned xrsession must support. these values currently must come from the enumerated type xrreferencespacetype. more features may be added in future updates to the webxr standard. default features immersive sessions all immersive (both immersive-vr and immersive-ar) sessions support both t...
XRTargetRayMode - Web APIs
n tap, or mouse click. for tracked pointers, a function myrendertargetrayasbeam() is called to render a beam from the input controller's virtual position outward in the direction it's pointing. the code should continue to perform tasks such as drawing controllers or any objects representative of the user's hands' positions in the virtual space, as well as any other input-related tasks. function updateinputsources(session, frame, refspace) { for (let source of session.getinputsources()) { let targetraypose = frame.getpose(inputsource.targetrayspace, refspace); if (targetraypose) { if (source.targetraymode == "tracked-pointer") { myrendertargetrayasbeam(targetraypose); } } /* ... */ } } see the article inputs and input sources for more details and a mo...
XRWebGLLayer - Web APIs
ides a linkage between the webxr device (or simulated xr device, in the case of an inline session) and a webgl context used to render the scene for display on the device. in particular, it provides access to the webgl framebuffer and viewport to ease access to the context. although xrwebgllayer is currently the only type of framebuffer layer supported by webgl, it's entirely possible that future updates to the webxr specification may allow for other layer types and corresponding image sources. constructor new xrwebgllayer() creates and returns a new xrwebgllayer object for use by the specified xrsession, using a particular webglrenderingcontext or webgl2renderingcontext as the destination context. properties antialias read only a boolean value indicating whether or not the webgl con...
XRWebGLLayerInit.alpha - Web APIs
lue }; let gllayer = new xrwebgllayer(xrsession, gl, layerinit); let gllayer = new xrwebgllayer(xrsession, gl, { alpha: boolvalue }); value a boolean which can be set to true to request that the new webgl layer for rendering the webxr scene is to have an alpha channel. example in this example, a new xrwebgllayer is created for a webxr session, xrsession, without an alpha channel. xrsession.updaterenderstate({ baselayer: new xrwebgllayer(xrsession, gl, { alpha: false }); }); specifications specification status comment webxr device apithe definition of 'xrwebgllayerinit.alpha' in that specification. working draft initial definition. ...
XRWebGLLayerInit.antialias - Web APIs
for rendering, the value of a user preference from a configuration interface is obtained using a function called getpreferencevalue() to determine whether the user has enabled or disabled anti-aliasing support; this is passed into the constructor. let options = { antialias: getpreferencevalue("antialiasing") }; let gllayer = new xrwebgllayer(xrsession, gl, options); if (gllayer) { xrsession.updaterenderstate({ baselayer: gllayer }); } offering the user features such as the ability to enable or disable things like anti-aliasing can provide them with optiions to try when your app isn't performing as well as they'd like. disabling anti-aliasing may improve performance to some extent. specifications specification status comment webxr device apithe definition of 'xrw...
XRWebGLLayerInit.depth - Web APIs
by a given webgl rendering layer during your xr session by checking the value returned by xrwebgllayer.ignoredepthvalues. if this is true, then the depth buffer is either not present or is being ignored. if (gllayer.ignoredepthvalues) { /* not using the depth buffer */ } example in this example, a new xrwebgllayer is created for a webxr session, xrsession, without a depth buffer. xrsession.updaterenderstate({ baselayer: new xrwebgllayer(xrsession, gl, { depth: false }); }); specifications specification status comment webxr device apithe definition of 'xrwebgllayerinit.depth' in that specification. working draft initial definition. ...
XRWebGLLayerInit.framebufferScaleFactor - Web APIs
calefactor }); value a floating-point value indicating a multiplier to apply to the default frame buffer resolution in order to determine the resolution of the frame buffer for the xrwebgllayer. example in this example, a new xrwebgllayer is created for a webxr session, xrsession, with a frame buffer whose resolution is half that of the default display resolution of the xr device. xrsession.updaterenderstate({ baselayer: new xrwebgllayer(xrsession, gl, { framebufferscalefactor: 0.5 }); }); specifications specification status comment webxr device apithe definition of 'xrwebgllayerinit.framebufferscalefactor' in that specification. working draft initial definition. ...
XRWebGLLayerInit.ignoreDepthValues - Web APIs
ignoring depth values causes the compositor to rely solely upon the relative position of objects to establish depth, and may result in less effective and less comfortable 3d effects. the default is false (depth values are used by default). example in this example, a new xrwebgllayer is created for a webxr session, xrsession. it's configured to ignore depth values or an alpha channel. xrsession.updaterenderstate({ baselayer: new xrwebgllayer(xrsession, gl, { alpha: false, ignoredepthvalues: true }); }); specifications specification status comment webxr device apithe definition of 'xrwebgllayerinit.ignoredepthvalues' in that specification. working draft initial definition. ...
XRWebGLLayerInit.stencil - Web APIs
}; let gllayer = new xrwebgllayer(xrsession, gl, layerinit); let gllayer = new xrwebgllayer(xrsession, gl, { stencil: false }); value a boolean which can be set to false to specify that the new webgl layer should not include a stencil buffer. the default value is true. example in this example, a new xrwebgllayer is created for a webxr session, xrsession, without a stencil buffer. xrsession.updaterenderstate({ baselayer: new xrwebgllayer(xrsession, gl, { stencil: false }); }); specifications specification status comment webxr device apithe definition of 'xrwebgllayerinit.stencil' in that specification. working draft initial definition. ...
XRWebGLLayerInit - Web APIs
working draft initial definition. ...
ARIA guides - Accessibility
ria) defines ways to make the web more accessible to people with disabilities. a few guidelines to follow that ensure better accessibility, like using drag and drop for placement of the widgets. error handling in forms labeling widgets labeling composite widgets and regions managing focus in composite widgets (aria-activedescendant vs roving tabindex) using landmark roles handling dynamic updates & live regions virtual vs. non virtual mode in at products using drag & drop notifying users of non-aria screen readers fixing structure with presentation role hiding layout tables managing modal and non modal dialogs using aria with html5 how to test aria aria on mobile devices ...
Using the aria-invalid attribute - Accessibility
w shows a very simple validation function, which only checks for the presence of a particular character (in the real world, validation will likely be more sophisticated): function checkvalidity(aid, asearchterm, amsg){ var elem = document.getelementbyid(aid); var invalid = (elem.value.indexof(asearchterm) < 0); if (invalid) { elem.setattribute("aria-invalid", "true"); updatealert(amsg); } else { elem.setattribute("aria-invalid", "false"); updatealert(); } } the snippet below shows the alert functions, which add (or remove) the error message: function updatealert(msg) { var oldalert = document.getelementbyid("alert"); if (oldalert) { document.body.removechild(oldalert); } if (msg) { var newalert = document.cre...
Using the aria-relevant attribute - Accessibility
the aria-relevant attribute is an optional value used to describe what types of changes have occurred to an aria-live region, and which are relevant and should be announced. any change that is not relevant acts in the same manner it would if the aria-live attribute were set to off. aria-relevant is commonly used when a web page contains content that may be updated while viewing the page. values a space-delimited list of one or more of the following values: additions element nodes added to the accessibility tree within the live region; should be considered relevant. removals are deletion of nodes in the accessiblity tree; should be considered relevant. text are changes to the textual content of existing nodes; should be considered relevant. all is equivalent to additions removals...
Using the aria-valuetext attribute - Accessibility
may differ on how assistive technology should handle this technique. the information provided above is one of those opinions and therefore not normative. examples example 1: the snippet below shows a simple slider for selecting a day of the week. the value of the slider is numeric, and the aria-valuetext attribute is used to provide the name of the day. the application would programmatically update aria-valuetext depending on aria-valuenow. <div role="slider" aria-valuenow="1" aria-valuemin="1" aria-valuemax="7" aria-valuetext="sunday"> working examples: notes used with aria roles progressbar scrollbar slider spinbutton related aria techniques aria-valuenow compatibility tbd: add support information for common ua and at product combinations additional resources wa...
Using the status role - Accessibility
into the html source code. ...
ARIA annotations - Accessibility
on (see role="insertion" and role="deletion" above). role="comment" — semantically denotes a comment/reaction to some content on the page, or to a previous comment. to provide a semantic association between the document content being annotated and the annotation, an aria-details attribute can be set on the annotated content that contains the id of the annotated element. aria-details has been updated so that it can support multiple ids — this makes sense, for example you can easily envisage having multiple comments relating to the same bit of text. aria annotation roles and objects are currently exposed in: firefox from version 75 onwards, on windows and linux (on macos, we are first waiting for apple to define what safari will expose as apple-dialect attributes to voiceover, and will ...
How to file ARIA-related bugs - Accessibility
the state of aria technology has always depended on the community. if you notice an implementation issue, please take a little time and let the developers know. here's where to file bugs: when finding a bug, please also update the relevant compatibility tables in the examples page. tbd: add proper accessibility markup to table genre software where to file notes screen readers freedom scientific jaws jaws technical support form gw micro window eyes window-eyes comments, questions, and feedback (email) non visual desktop access (nvda) file nvda bugs discuss nvda issues browsers apple safari file webkit.org bugs google chrome file chromium bugs microsoft i...
ARIA: textbox role - Accessibility
om focus or is a logical descendant as indicated by the aria-owns attribute, it indicates when that element has focus, when it is part of a composite widget such as a combobox. for example, in a combobox, focus may remain on the textbox while the value of aria-activedescendant on the textbox element refers to a descendant of a popup listbox that is controlled by the textbox.this attribute must be updated programmatically as the focus changes. aria-autocomplete attribute indicates whether and how the user's input into the field could trigger display of a prediction of the intended value. it supports the following values: inline: predicted text is inserted after the caret. list: predicted text is presented as a collection of values. both: predicted text is presented as a collection of va...
WAI-ARIA Roles - Accessibility
this page lists reference pages covering all the wai-aria roles discussed on mdn. for a full list of roles, see using aria: roles, states, and properties aria: alert rolethe alert role can be used to tell the user an element has been dynamically updated. screen readers will instantly start reading out the updated content when the role is added. if the user is expected to close the alert, then the alertdialog role should be used instead.aria: application rolethe application role indicates to assistive technologies that an element and all of its children should be treated similar to a desktop application, and no traditional html interpretation techniques should be used. this role should only be used to define very dynamic and desktop-like web applications.aria: article rolethe article rol...
Cognitive accessibility - Accessibility
real-time events. people with attention deficit disorders should be able to focus on content without distractions. the user should be able to postpone or suppress interruptions, except situations involving altering a person to an emergency. this provides access to people with cognitive disabilities by enabling them to focus on the main purpose of the content. enable the user to postpone content updates by providing a way to request content updates rather than updating automatically. also, enable a way to make nonessential alerts optional. ensure that people can continue an activity without loss of data after re-authenticating an expired session, for example, saving the state of a questionnaire. make sure to save data in such a way that it can be modified after a user re-authenticates. before ...
Operable - Accessibility
hown alongside other content, controls should be provided to pause, stop, or hide it. this does not apply to moving/blinking content that is essential to the experience. examples include scrolling text and videos. for auto-updating information that starts automatically and is shown alongside other content, controls should be provided to pause, stop, or hide it, or to control the frequency of updates. this does not apply to auto-updating content that is essential to the experience. examples include carousels or rotating annoucements. 2.2.3 no time limits (aaa) this builds on criteria 2.2.1, stating that content that wants to pass aaa conformance should have no time limits. 2.2.4 surpress interruptions (aaa) any interruptions such as alerts or interstitial ...
Understandable - Accessibility
eenreader users, you can use aria live regions to alert the user to a change on the page. note: server-side validation should *always* be used alongside client-side validation. client-side validation is too easy to turn off or otherwise get around, so it can't be relied on alone. see form data validation for comprehensive validation information, and wai-aria: dynamic content updates for information on live regions. 3.3.2 labels or instructions (a) clear instructions should be provided when data input is required. when a simple instruction or prompt is required, you can use <label> elements for single inputs like name or age, a combination or <label>s and <fieldset>s/<legend>s for multiple inputs that go together (like the elements of a date of birth or post...
Accessibility
ial to allow for accessible web experiences ... or they can significantly harm accessibility if misused. this article outlines some css and javascript best practices that should be considered to ensure even complex content is as accessible as possible. wai-aria basics following on from the previous article, sometimes making complex ui controls that involve unsemantic html and dynamic javascript-updated content can be difficult. wai-aria is a technology that can help with such problems by adding in further semantics that browsers and assistive technologies can recognize and use to let users know what is going on. here we'll show how to use it at a basic level to improve accessibility. accessible multimedia another category of content that can create accessibility problems is multimedia — vi...
Coordinate systems - CSS: Cascading Style Sheets
aining the coordinates. the implementation is then quite simple. the variables idx and idy are set to strings with the names of the properties corresponding to the coordinates in the given coordinate system. for example, if the value of type is "page", then idx is "pagex" and idy is "pagey". handling the mouse events setcoords() is called by the event handler for the various mouse events, named update(); this is shown below. function update(e) { setcoords(e, "offset"); setcoords(e, "client"); setcoords(e, "page"); setcoords(e, "screen"); } inner.addeventlistener("mouseenter", update, false); inner.addeventlistener("mousemove", update, false); inner.addeventlistener("mouseleave", update, false); the event handler is in the update() method. it simply calls setcoords() once for each co...
Detecting CSS animation support - CSS: Cascading Style Sheets
ument.createelement( 'style' ); s.innerhtml = keyframes; document.getelementsbytagname( 'head' )[ 0 ].appendchild( s ); } } this code looks at the value of animation; if it's false, we know we need to use our javascript fallback code to perform our animation. otherwise, we can use javascript to create the desired css animation effects. setting the animation property is easy; simply update its value in the style collection. however, adding keyframes is trickier, since they're not defined using traditional css syntax (which makes them more flexible, but harder to define from script). to define our keyframes using javascript, we need to write them out as a css string. all we do is set up a keyframes variable, prefixing each attribute as it's constructed. this variable, once construc...
Using CSS animations - CSS: Cascading Style Sheets
cript. the animations run well, even under moderate system load. simple animations can often perform poorly in javascript (unless they’re well made). the rendering engine can use frame-skipping and other techniques to keep the performance as smooth as possible. letting the browser control the animation sequence lets the browser optimize performance and efficiency by, for example, reducing the update frequency of animations running in tabs that aren't currently visible. configuring the animation to create a css animation sequence, you style the element you want to animate with the animation property or its sub-properties. this lets you configure the timing, duration, and other details of how the animation sequence should progress. this does not configure the actual appearance of the animat...
Box alignment in grid layout - CSS: Cascading Style Sheets
row-gap column-gap gap grid-row-gap grid-column-gap grid-gap the grid specification originally contained the definition for the properties grid-row-gap, grid-column-gap and grid-gap. these have since been moved into the box alignment specification and renamed to row-gap, column-gap, and gap. this allows them to be used for other layout methods where a gap between items makes sense. the updated properties have not yet been implemented in all browsers. therefore, to use the gap properties in grid layout, you should use the grid-row-gap, grid-column-gap and grid-gap versions to ensure full compatibility. you could double up the properties and use both as you would for vendor prefixes. reference css properties justify-content align-content place-content justify-items align-items...
Variable fonts guide - CSS: Cascading Style Sheets
ont-family; } @supports (font-variation-settings: 'wdth' 115) { h1 { font-family: some-variable-font-family; } } sample pages the following example pages show two different ways to structure your css. the first uses the standard attributes wherever possible. the second example uses css custom properties to set values for a font-variation-settings string, and shows how you can more easily update single variable values by overriding a single variable rather than rewriting the whole string. note the hover effect on the h2, which only alters the grade axis custom property value. resources w3c css fonts module 4 specification (editor’s draft) w3c github issue queue microsoft open type variations introduction microsoft opentype design-variation axis tag registry wakamai fondue (a ...
Box alignment in CSS Grid Layout - CSS: Cascading Style Sheets
; } .item3 { grid-area: c; } .item4 { grid-area: d; } <div class="wrapper"> <div class="item1">item 1</div> <div class="item2">item 2</div> <div class="item3">item 3</div> <div class="item4">item 4</div> </div> we can also use values for this property that you may be familiar with from flexbox; the space distribution values of space-between, space-around and space-evenly. ...
CSS Grid Layout and Accessibility - CSS: Cascading Style Sheets
g about using css grid layout is that you should be able to move an item in the source to match the logical order, without needing to make big changes to your layout. this is a huge improvement over a float-based layout for example, where document source matters a lot in order to get layouts at different breakpoints. however the onus is on us as developers to remember to go back to our source and update it to maintain logical order. grid and the danger of markup flattening another issue to be aware of in css grid layout and to a lesser extent in css flexbox, is the temptation to flatten markup. as we have discovered, for an item to become a grid item it needs to be a direct child of the grid container. therefore, where you have a <ul> element inside a grid container, that ul becomes a grid it...
Consistent list indentation - CSS: Cascading Style Sheets
lt styles, and that's where the problems creep in. by making sure you style both the left padding and left margin of lists, you can find much greater cross-browser consistency in your list indentation. recommendations when altering the indentation of lists, make sure to set both the padding and margin. original document information author(s): eric a. meyer, netscape communications last updated date: published 30 aug 2002 copyright information: copyright © 2001-2003 netscape. all rights reserved. note: this reprinted article was originally part of the devedge site. ...
Understanding CSS z-index - CSS: Cascading Style Sheets
...
Browser compatibility and Scroll Snap - CSS: Cascading Style Sheets
emoved. in this article, we consider questions that might arise related to compatibility across browsers and versions of browsers when adding support for scroll-snap to your web site or app. what should i do if i used the old firefox implementation? if you have only used the old firefox implementation of the specification, with the properties that are detailed in scroll snap points, you should update your code to use the new specification. this will ensure your scroll snapping works in all browsers which implement the specification, including firefox. if you do not do this your scroll snapping will no longer work in firefox 68 and up. the main things to note are as follows: the scroll-snap-type-x and scroll-snap-type-y properties have been dropped the scroll-snap-type property has become...
CSS Text - CSS: Cascading Style Sheets
Web › CSS › CSS Text
d text transformation. reference properties hanging-punctuation hyphens letter-spacing line-break overflow-wrap tab-size text-align text-align-last text-indent text-justify text-size-adjust text-transform white-space word-break word-spacing specifications specification status comment css logical properties and values level 1 editor's draft updates some properties to be independent of the directionality of the text. css text module level 3 working draft css level 2 (revision 1) recommendation css level 1 recommendation initial definition ...
Contribute a recipe - CSS: Cascading Style Sheets
this backup is maintained by andrew sachen of realityripple software. it may see periodical improvements or updates, and may eventually even be cleaned up (and de-archived) for better uxp focus, but for now, it's a historical snapshot for reference, not a living website. ...
Using media queries - CSS: Cascading Style Sheets
e page added in media queries level 5. prefers-reduced-transparency the user prefers reduced transparency added in media queries level 5. resolution pixel density of the output device scan scanning process of the output device scripting detects whether scripting (i.e. javascript) is available added in media queries level 5. update how frequently the output device can modify the appearance of content added in media queries level 4. width width of the viewport including width of scrollbar logical operators the logical operators not, and, and only can be used to compose a complex media query. you can also combine multiple media queries into a single rule by separating them with commas. and the ...
Visual formatting model - CSS: Cascading Style Sheets
css visual formatting model that creates boxes from the document's elements. generated boxes are of different types, which affect their visual formatting. the type of the box generated depends on the value of the css display property. initially defined in css2, the display property is extended in the css display module level 3. in addition, some of the terminologies around the display have been updated and clarified in the years since css2. css takes your source document and renders it onto a canvas. to do this, it generates an intermediary structure, the box tree, which represents the formatting structure of the rendered document. each box in the box tree represents its corresponding element (or pseudo-element) in space and/or time on the canvas, while each text run in the box tree likewise ...
align-items - CSS: Cascading Style Sheets
css flexible box layout modulethe definition of 'align-items' in that specification. candidate recommendation initial definition ...
align-self - CSS: Cascading Style Sheets
css flexible box layout modulethe definition of 'align-self' in that specification. candidate recommendation initial definition. ...
element() - CSS: Cascading Style Sheets
Web › CSS › element
a particularly useful scenario for using this would be to render an image in an html <canvas> element, then use that as a background. on gecko browsers, you can use the non-standard document.mozsetimageelement() method to change the element being used as the background for a given css background element. ...
font-kerning - CSS: Cascading Style Sheets
xtarea id="input">av t. ij</textarea> css div { font-size: 2rem; font-family: serif; } #nokern { font-kerning: none; } #kern { font-kerning: normal; } javascript let input = document.getelementbyid('input'); let kern = document.getelementbyid('kern'); let nokern = document.getelementbyid('nokern'); input.addeventlistener('keyup', function() { kern.textcontent = input.value; /* update content */ nokern.textcontent = input.value; }); kern.textcontent = input.value; /* initialize content */ nokern.textcontent = input.value; specifications specification status comment css fonts module level 3the definition of 'font-kerning' in that specification. candidate recommendation initial definition. ...
font-size - CSS: Cascading Style Sheets
Web › CSS › font-size
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
font-weight - CSS: Cascading Style Sheets
vw; overflow: hidden; } body { display: flex; flex-direction: column; } header { margin-bottom: 1.5rem; } .container { flex-grow: 1; } .container > p { margin-top: 0; margin-bottom: 0; } javascript let weightlabel = document.queryselector('label[for="weight"]'); let weightinput = document.queryselector('#weight'); let sampletext = document.queryselector('.sample'); function update() { weightlabel.textcontent = `font-weight: ${weightinput.value};`; sampletext.style.fontweight = weightinput.value; } weightinput.addeventlistener('input', update); update(); accessibility concerns people experiencing low vision conditions may have difficulty reading text set with a font-weight value of 100 (thin/hairline) or 200 (extra light), especially if the font has a low contrast...
mask-border - CSS: Cascading Style Sheets
-webkit-mask-box-image-repeat: round; -webkit-mask-box-image-outset: 1px; */ /* prefixed shorthand property currently supported in chromium */ -webkit-mask-box-image: url("https://udn.realityripple.com/samples/2d/fd08a3134c.png") /* source */ 30 fill / /* slice */ 20px / /* width */ 1px /* outset */ round; /* repeat */ /* updated standard shorthand property, not supported anywhere yet */ mask-border: url("https://udn.realityripple.com/samples/2d/fd08a3134c.png") /* source */ 30 fill / /* slice */ 20px / /* width */ 1px /* outset */ round; /* repeat */ } result specifications specification status comment css masking module lev...
<ratio> - CSS: Cascading Style Sheets
Web › CSS › ratio
two unitless values. syntax in media queries level 3, the <ratio> data type consisted of a strictly positive <integer> followed by a forward slash ('/', unicode u+002f solidus) and a second strictly positive <integer>. spaces before and after the slash are optional. the first number represents the width, while the second represents the height. in media queries level 4, the <ratio> date type is updated to consist of a strictly positive <number> followed by a forward slash ('/', unicode u+002f solidus) and a second strictly positive <number>. in addition a single <number> as a value is allowable. examples use in a media query @media screen and (min-aspect-ratio: 16/9) { ... } common aspect ratios ratio usage 4/3 traditional tv format in the 20th century.
text-decoration-thickness - CSS: Cascading Style Sheets
...
Ajax - Developer guides
Web › Guide › AJAX
script and xml, while not a technology in itself, is a term coined in 2005 by jesse james garrett, that describes a "new" approach to using a number of existing technologies together, including html or xhtml, css, javascript, dom, xml, xslt, and most importantly the xmlhttprequest object. when these technologies are combined in the ajax model, web applications are able to make quick, incremental updates to the user interface without reloading the entire browser page. this makes the application faster and more responsive to user actions. although x in ajax stands for xml, json is used more than xml nowadays because of its many advantages such as being lighter and a part of javascript. both json and xml are used for packaging information in the ajax model. documentation getting started t...
Writing Web Audio API code that works in every browser - Developer guides
ew style. for example, the way to create instances of gainnode used to be var gain = audiocontext.creategainnode(); but nowadays it is just var gain = audiocontext.creategain(); since the old method names are not present in firefox, existing code may crash with something like creategainnode is not a function, and you now know why. there's a section in the spec that lists the old names and their updated equivalences; be sure to check it out and change your code accordingly. you can also check this article on porting which covers more cases and has many code samples. things that are not ready yet second, ensure that your project doesn't use node types that are not implemented yet in firefox: mediastreamaudiosourcenode, mediaelementaudiosourcenode and oscillatornode. if it's using, for example, o...
Media buffering, seeking, and time ranges - Developer guides
for (var i = 0; i < myaudio.buffered.length; i++) { if (myaudio.buffered.start(myaudio.buffered.length - 1 - i) < myaudio.currenttime) { document.getelementbyid("buffered-amount").style.width = (myaudio.buffered.end(myaudio.buffered.length - 1 - i) / duration) * 100 + "%"; break; } } } }); myaudio.addeventlistener('timeupdate', function() { var duration = myaudio.duration; if (duration > 0) { document.getelementbyid('progress-amount').style.width = ((myaudio.currenttime / duration)*100) + "%"; } }); } the progress event is fired as data is downloaded, this is a good event to react to if we want to display download or buffering progress. the timeupdate event is fired 4 times a second as the media...
Media events - Developer guides
sent when a seek operation completes. seeking sent when a seek operation begins. stalled sent when the user agent is trying to fetch media data, but data is unexpectedly not forthcoming. suspend sent when loading of the media is suspended; this may happen either because the download has completed or because it has been paused for any other reason. timeupdate the time indicated by the element's currenttime attribute has changed. volumechange sent when the audio volume changes (both when the volume is set and when the muted attribute is changed). waiting sent when the requested operation (such as playback) is delayed pending the completion of another operation (such as a seek). you can easily watch for these events, us...
Introduction to Web development - Developer guides
ing with css — a brief guide to styling web pages for beginners. common css questions — common questions and answers for beginners intermediate css concepts — grouping, pseudo-classes and more. javascript beginning getting started with javascript — what is javascript and how can it help you? javascript reference guide — a comprehensive, regularly updated guide to javascript for all levels of learning from beginner to advanced. crockford on javascript — an in-depth video series on the javascript language. eloquent javascript — a comprehensive guide to intermediate and advanced javascript methodologies intermediate a re-introduction to javascript — a recap on the javascript programming language aimed at interm...
SVG-in-OpenType - Developer guides
...
Writing forward-compatible websites - Developer guides
ification evolves the browser's prefixed implementation can likewise change to track the specification. and once the feature is standardized, the prefixed version is likely to be removed. prefixed, non-standard features are provided by browser developers for you to experiment with and offer feedback on, and aren't meant to be deployed. if you choose to use them, be prepared to need to frequently update your site to keep up with changes. when using cutting-edge features (even standard ones) that are not universally implemented, make sure to test fallback paths make sure to test what happens in a browser that doesn't implement the feature you're using, especially if you don't use such a browser day-to-day while working on the site. don't use vendor-prefixed features except to target old buggy ...
Developer guides
lain what you need to do. events developer guide events refer to two things: a design pattern used for the asynchronous handling of various incidents which occur in the lifetime of a web page; and the naming, characterization, and use of a large number of incidents of different types. ajax ajax is a term that defines a group of technologies allowing web applications to make quick, incremental updates to the user interface without reloading the entire browser page. this makes the application faster and more responsive to user actions. graphics on the web modern web sites and applications often need to present graphics of varying sophistication. guide to web apis a list of all web apis and what they do. javascript javascript is the powerful scripting language used to create applications ...
disabled - HTML: Hypertext Markup Language
the :disabled pseudo class will match. if the attribute is not included, the :enabled pseudo class will match. if the element doesn't support the disabled attribute, the attribute will have no effect, including not leading to being matched by the :disabled and :enabled pseudo classes. constraint validation if the element is disabled, then the element's value can not receive focus and cannot be updated by the user, and does not participate in constraint validation. examples when form controls are disabled, many browsers will display them in a lighter, greyed-out color by default. here are examples of a disabled checkbox, radio button, <option> and <optgroup>, as well as some form controls that are disabled via the disabled attribute set on the ancestor <fieldset> element. the <option>s are ...
HTML attribute: readonly - HTML: Hypertext Markup Language
any effect on inputs with the readonly attribute also specified. the only way to modify dynamically the value of the readonly attribute is through a script. note: the required attribute is not permitted on inputs with the readonly attribute specified. usability browsers display the readonly attribute... constraint validation if the element is readonly, then the element's value can not be updated by the user, and does not participate in constraint validation. example html <div class="group"> <input type="textbox" value="some value" readonly="readonly"/> <label>textbox</label> </div> <div class="group"> <input type="date" value="2020-01-01" readonly="readonly"/> <label>date</label> </div> <div class="group"> <input type="email" value="some value" readonly="readonly"/> <labe...
<address>: The Contact Address element - HTML: Hypertext Markup Language
Web › HTML › Element › address
htmlelement prior to gecko 2.0 (firefox 4), gecko implemented this element using the htmlspanelement interface attributes this element only includes the global attributes. usage notes it used to be the case that an <address> element was only supposed to be used to represent the contact information of the document's author. in the latest spec versions however, its definition has been updated so it can now be used to mark up arbitrary addresses. this element should not contain more information than the contact information, like a publication date (which belongs in a <time> element). typically an <address> element can be placed inside the <footer> element of the current section, if any. examples this example demonstrates the use of <address> to demarcate the contact information f...
<img>: The Image Embed element - HTML: Hypertext Markup Language
Web › HTML › Element › img
e cursor stops moving over the image. while this can provide additional information to the user, you should not assume that the user will ever see it: the user may only have keyboard or touchscreen. if you have information that's particularly important or valuable for the user, present it inline using one of the methods mentioned above instead of using title. using the html title attribute – updated | the paciello group technical summary content categories flow content, phrasing content, embedded content, palpable content. if the element has a usemap attribute, it also is a part of the interactive content category. permitted content none, it is an empty element. tag omission must have a start tag and must not have an end tag. permitted parents...
<input type="date"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › date
specifications specification status comments html living standardthe d...
<input type="number"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › number
ill manually enter a number that's not a multiple of 10, but it will be considered invalid. specifying minimum and maximum values you can use the min and max attributes to specify a minimum and maximum value that the field can have. for example, let's give our example a minimum of 0, and a maximum of 100: <input type="number" placeholder="multiple of 10" step="10" min="0" max="100"> in this updated version, you should find that the up and down step buttons will not allow you to go below 0 or above 100. you can still manually enter a number outside these bounds, but it will be considered invalid. allowing decimal values one issue with number inputs is that their step size is 1 by default. if you try to enter a number with a decimal (such as "1.0"), it will be considered invalid. if you wa...
<input type="range"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › range
result screenshotlive sample unfortunately, no major browsers currently support vertical range controls directly. transform: rotate(-90deg) you can, however, create a vertical range control by drawing a horizontal range control on its side. the easiest way is to use css: by applying a transform to rotate the element, you can make it vertical. let's take a look. html the html needs to be updated to wrap the <input> in a <div> to let us correct the layout after the transform is performed (since transforms don't automatically affect the layout of the page): <div class="slider-wrapper"> <input type="range" min="0" max="11" value="7" step="1"> </div> css now we need some css. first is the css for the wrapper itself; this specifies the display mode and size we want so that the page lays...
<input type="search"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › search
tion and text substitutions. incremental the boolean attribute incremental is a webkit and blink extension (so supported by safari, opera, chrome, etc.) which, if present, tells the user agent to process the input as a live search. as the user edits the value of the field, the user agent sends search events to the htmlinputelement object representing the search box. this allows your code to update the search results in real time as the user edits the search. if incremental is not specified, the search event is only sent when the user explicitly initiates a search (such as by pressing the enter or return key while editing the field). the search event is rate-limited so that it is not sent more more frequently than an implementation-defined interval. mozactionhint a mozilla extension,...
<input type="tel"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › tel
var selectelem = document.queryselector("select"); var inputelems = document.queryselectorall("input"); selectelem.onchange = function() { for(var i = 0; i < inputelems.length; i++) { inputelems[i].value = ""; } if(selectelem.value === "us") { inputelems[...
<input type="week"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › week
nputs, the value of step is given in weeks, with a scaling factor of 604,800,000 (since the underlying numeric value is in milliseconds). the default value of step is 1, indicating 1week. the default stepping base is -259,200,000, which is the beginning of the first week of 1970 ("1970-w01"). at this time, it's unclear what a value of "any" means for step when used with week inputs. this will be updated as soon as that information is determined. using week inputs week inputs sound convenient at first glance, since they provide an easy ui for choosing weeks, and they normalize the data format sent to the server, regardless of the user's browser or locale. however, there are issues with <input type="week"> because browser support is not guaranteed across all browsers. we'll look at basic and m...
<kbd>: The Keyboard Input element - HTML: Hypertext Markup Language
Web › HTML › Element › kbd
though, you may find it useful to do this kind of nesting. result the output looks like this without a style sheet applied: with custom styles we can make more sense of this by adding some css: css we add a new style for <kbd> elements, key, which we can apply when rendering keyboard keys: kbd.key { border-radius: 3px; padding: 1px 2px 0; border: 1px solid black; } html then we update the html to use this class on the keys in the output to be presented: <p>you can also create a new document by pressing <kbd><kbd class="key">ctrl</kbd>+<kbd class="key">n</kbd></kbd>.</p> result the result is just what we want! echoed input nesting a <kbd> element inside a <samp> element represents input that has been echoed back to the user by the system. <p>if a syntax error occurs, th...
<tbody>: The Table Body element - HTML: Hypertext Markup Language
Web › HTML › Element › tbody
dies you can create multiple sections within a table by using multiple <tbody> elements. each may potentially have its own header row or rows; however, there can be only one <thead> per table! because of that, you need to use a <tr> filled with <th> elements to create headers within each <tbody>. let's see how that's done. let's take the previous example, add some more students to the list, and update the table so that instead of listing each student's major on every row, the students are grouped by major, with heading rows for each major. result first, the resulting table, so you know what we're building: html the revised html looks like this: <table> <thead> <tr> <th>student id</th> <th>name</th> </tr> </thead> <tbody> <tr> <th colspan="2">computer ...
<title>: The Document Title element - HTML: Hypertext Markup Language
Web › HTML › Element › title
that describes the page's purpose. a common navigation technique for users of assistive technology is to read the page title and infer the content the page contains. this is because navigating into a page to determine its content can be a time consuming and potentially confusing process. example <title>menu - blue house chinese food - foodyum: online takeout today!</title> to help the user, update the page title value to reflect significant page state changes (such as form validation problems). example <title>2 errors - your order - blue house chinese food - foodyum: online takeout today!</title> mdn understanding wcag, guideline 2.4 explanations understanding success criterion 2.4.2 | w3c understanding wcag 2.0 specifications specification status comment ...
dir - HTML: Hypertext Markup Language
ventually stored in a database. browsers might allow users to change the directionality of <input> and <textarea>s in order to assist with authoring content. chrome and safari provide a directionality option in the contextual menu of input fields while internet explorer and edge use the key combinations ctrl + left shift and ctrl + right shift. firefox uses ctrl/cmd + shift + x but does not update the dir attribute value. specifications specification status comment html living standardthe definition of 'dir' in that specification. living standard no change from latest snapshot, html 5.1 html 5.1the definition of 'dir' in that specification. recommendation snapshot of html living standard, no change from html5 html5the definition of '...
title - HTML: Hypertext Markup Language
s is due to inconsistent browser support, compounded by the additional assistive technology parsing of the browser-rendered page. if a tooltip effect is desired, it is better to use a more accessible technique that can be accessed with the above browsing methods. 3.2.5.1. the title attribute | w3c html 5.2: 3. semantics, structure, and apis of html documents using the html title attribute – updated | the paciello group tooltips & toggletips - inclusive components the trials and tribulations of the title attribute - 24 accessibility specifications specification status comment html living standardthe definition of 'title' in that specification. living standard no change from latest snapshot, html 5.1 html 5.1the definition of 'title' in that sp...
Global attributes - HTML: Hypertext Markup Language
list of global attributes accesskey provides a hint for generating a keyboard shortcut for the current element. this attribute consists of a space-separated list of characters. the browser should use the first one that exists on the computer keyboard layout. autocapitalize controls whether and how text input is automatically capitalized as it is enter...
Microformats - HTML: Hypertext Markup Language
fundamental to domain-specific information, such as people, organizations, events, and locations. microformats use supporting vocabularies to describe objects and name-value pairs to assign values to their properties. the properties are carried in class attributes that can be added to any html element, while the data values re-use html element content and semantic attributes. microformats2 is an update to microformats that provides a simpler way of annotating html structured syntax & vocabularies than previous approaches of using rdfa and microdata which require learning new attributes. microformats are supported by all major search engines. search engines benefit greatly from direct access to this structured data because it allows them to understand the information on web pages and provide mo...
Evolution of HTTP - HTTP
x. their use on web realms stayed confidential. in 2000, a new pattern for using http was designed: representational state transfer (or rest). the actions induced by the api were no more conveyed by new http methods, but only by accessing specific uris with basic http/1.1 methods. this allowed any web application to provide an api to allow retrieval and modification of its data without having to update the browsers or the servers: all what is needed was embedded in the files served by the web sites through standard http/1.1. the drawback of the rest model resides in the fact that each website defines its own non-standard restful api and has total control on it; unlike the *dav extensions were clients and servers are interoperable. restful apis became very common in the 2010s. since 2005, the s...
Basics of HTTP - HTTP
articles overview of http describes what http is and its role in web architecture, including its position in the protocol stack. ...
Reason: CORS request external redirect not allowed - HTTP
...
Reason: missing token ‘xyz’ in CORS header ‘Access-Control-Allow-Headers’ from CORS preflight channel - HTTP
...
Feature Policy - HTTP
feature policy allows web developers to selectively enable, disable, and modify the behavior of certain features and apis in the browser. it is similar to content security policy but controls features instead of security behavior. the feature-policy header has now been renamed to permissions-policy in the spec, and this article will eventually be updated to reflect that change. in a nutshell feature policy provides a mechanism to explicitly declare what functionality is used (or not used), throughout your website. this allows you to lock in best practices, even as the codebase evolves over time — as well as to more safely compose third-party content — by limiting which features are available. with feature policy, you opt-in to a set of "policies" for the browser to enforce on specific...
Cache-Control - HTTP
lidation on the origin server. proxy-revalidate like must-revalidate, but only for shared caches (e.g., proxies). ignored by private caches. immutable indicates that the response body will not change over time. the resource, if unexpired, is unchanged on the server and therefore the client should not send a conditional revalidation for it (e.g. if-none-match or if-modified-since) to check for updates, even when the user explicitly refreshes the page. clients that aren't aware of this extension must ignore them as per the http specification. in firefox, immutable is only honored on https:// transactions. for more information, see also this blog post. other no-transform an intermediate cache or proxy cannot edit the response body, content-encoding, content-range, or content-type. it ther...
Digest - HTTP
Web › HTTP › Headers › Digest
...
ETag - HTTP
Web › HTTP › Headers › ETag
if the resource at a given url changes, a new etag value must be generated. a comparison of them can determine whether two representations of a resource are the same. ...
Feature-Policy - HTTP
cy header provides a mechanism to allow and deny the use of browser features in its own frame, and in content within any <iframe> elements in the document. this header is still in an experimental state, and is subject to change at any time. be wary of this when implementing it on your website. the header has now been renamed to permissions-policy in the spec, and this article will eventually be updated to reflect that change. for more information, see the main feature policy article. header type response header forbidden header name yes syntax feature-policy: <directive> <allowlist> <directive> the feature policy directive to apply the allowlist to. see directives below for a list of the permitted directive names. <allowlist> an allowlist is a list of o...
If-Match - HTTP
Web › HTTP › Headers › If-Match
nder this comparison algorithm. there are two common use cases: for get and head methods, used in combination with a range header, it can guarantee that the new ranges requested comes from the same resource than the previous one. if it doesn't match, then a 416 (range not satisfiable) response is returned. for other methods, and in particular for put, if-match can be used to prevent the lost update problem. it can check if the modification of a resource that the user wants to upload will not override another change that has been done since the original resource was fetched. if the request cannot be fulfilled, the 412 (precondition failed) response is returned. header type request header forbidden header name no syntax if-match: <etag_value> if-match: <etag_...
If-Modified-Since - HTTP
has not been modified since, the response will be a 304 without any body; the last-modified response header of a previous request will contain the date of last modification. unlike if-unmodified-since, if-modified-since can only be used with a get or head. when used in combination with if-none-match, it is ignored, unless the server doesn't support if-none-match. the most common use case is to update a cached entity that has no associated etag. header type request header forbidden header name no syntax if-modified-since: <day-name>, <day> <month> <year> <hour>:<minute>:<second> gmt directives <day-name> one of "mon", "tue", "wed", "thu", "fri", "sat", or "sun" (case-sensitive). <day> 2 digit day number, e.g. "04" or "23". <month> one of "jan", "feb",...
If-None-Match - HTTP
files are considered identical if the content is equivalent — they don't have to be identical byte for byte. for example, two pages that differ by the date of generation in the footer would still be considered as identical. when used in combination with if-modified-since, if-none-match has precedence (if the server supports it). there are two common use cases: for get and head methods, to update a cached entity that has an associated etag. for other methods, and in particular for put, if-none-match used with the * value can be used to save a file not known to exist, guaranteeing that another upload didn't happen before, losing the data of the previous put; this problem is a variation of the lost update problem. header type request header forbidden header name n...
Index - HTTP
Web › HTTP › Headers › Index
originated. 58 etag http, reference, response, header the etag http response header is an identifier for a specific version of a resource. it allows caches to be more efficient, and saves bandwidth, as a web server does not need to send a full response if the content has not changed. on the other side, if the content has changed, etags are useful to help prevent simultaneous updates of a resource from overwriting each other ("mid-air collisions"). 59 early-data client hints, http, header, request the early-data header is set by an intermediate to indicates that the request has been conveyed in tls early data, and additionally indicates that an intermediary understands the 425 (too early) status code. the early-data header is not set by the originator o...
Save-Data - HTTP
d data usage. this could be for reasons such as high transfer costs, slow connection speeds, etc. a value of on indicates explicit user opt-in into a reduced data usage mode on the client, and when communicated to origins allows them to deliver alternative content to reduce the data downloaded such as smaller image and video resources, different markup and styling, disabled polling and automatic updates, and so on. note: disabling http/2 server push (rfc 7540, section 8.2: server push) might be desirable too for reducing data downloads. syntax save-data: <sd-token> directives <sd-token> a numerical value indicating whether the client wants to opt in to reduced data usage mode. on indicates yes, while off (the default) indicates no. examples the vary header ensures that the content ...
Strict-Transport-Security - HTTP
he browser records this information, so that future attempts to load the site using http will automatically use https instead. when the expiration time specified by the strict-transport-security header elapses, the next attempt to load the site via http will proceed as normal instead of automatically using https. whenever the strict-transport-security header is delivered to the browser, it will update the expiration time for that site, so sites can refresh this information and prevent the timeout from expiring. should it be necessary to disable strict transport security, setting the max-age to 0 (over a https connection) will immediately expire the strict-transport-security header, allowing access via http. preloading strict transport security google maintains an hsts preload service. by fol...
Firefox user agent string reference - HTTP
ries starting by mozilla-b2g are the release repositories for firefox os, and have both firefox os and gecko versions in their names. firefox os has a four-digit version number: x.x.x.y. the first two digits are owned by the mozilla product team and denote versions with new features (eg: v1.1, 1.2, etc). the third digit is incremented with regular version tags (about every 6 weeks) for security updates, and the fourth is owned by the oem. firefox web runtime the web runtime uses the same user agent string as desktop firefox. other gecko-based browsers these are some sample ua strings from other gecko-based browsers on various platforms. note that many of these have not yet been released on gecko 2.0! browser gecko user agent string firefox for maemo (nokia n900) ...
Want-Digest - HTTP
...
HTTP headers - HTTP
Web › HTTP › Headers
the resource. conditional requests using if-match and if-none-match use this value to change the behavior of the request. 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. this is used to update caches (for safe requests), or to prevent to upload a new resource when one already exists. if-modified-since makes the request conditional, and expects the entity to be transmitted only if it has been modified after the given date. this is used to transmit data only when the cache is out of date. if-unmodified-since makes the request conditional, and expects the entity to be transmitted only...
Link prefetching FAQ - HTTP
ill prefetch www.amazon.com, causing amazon cookies to be sent back and forth. you can block 3rd party cookies in firefox, see disabling third party cookies.) what about...? if you have any questions or comments about link prefetching, please feel free to send them my way :-) see also... prefetching hints original document information author(s): darin fisher (darin at meer dot net) last updated date: updated: march 3, 2003 ...
HTTP Messages - HTTP
Web › HTTP › Messages
g it (like if-none). entity headers, like content-length which apply to the body of the request. obviously, there is no such header transmitted if there is no body in the request. body the final part of the request is its body. not all requests have one: requests fetching resources, like get, head, delete, or options, usually don't need one. some requests send data to the server in order to update it: as often the case with post requests (containing html form data). bodies can be broadly divided into two categories: single-resource bodies, consisting of one single file, defined by the two headers: content-type and content-length. multiple-resource bodies, consisting of a multipart body, each containing a different bit of information. this is typically associated with html forms. htt...
PATCH - HTTP
Web › HTTP › Methods › PATCH
a patch request is considered a set of instructions on how to modify a resource. contrast this with put; which is a complete representation of a resource. a patch is not necessarily idempotent, although it can be. contrast this with put; which is always idempotent. the word "idempotent" means that any number of repeated, identical requests will leave the resource in the same state. ...
204 No Content - HTTP
Web › HTTP › Status › 204
doesn't need to go away from its current page. a 204 response is cacheable by default. an etag header is included in such a response. the common use case is to return 204 as a result of a put request, updating a resource, without changing the current content of the page displayed to the user. if the resource is created, 201 created is returned instead. if the page should be changed to the newly updated page, the 200 should be used instead. status 204 no content specifications specification title rfc 7231, section 6.3.5: 204 no content hypertext transfer protocol (http/1.1): semantics and content ...
301 Moved Permanently - HTTP
Web › HTTP › Status › 301
the hypertext transfer protocol (http) 301 moved permanently redirect status response code indicates that the resource requested has been definitively moved to the url given by the location headers. a browser redirects to this page and search engines update their links to the resource (in 'seo-speak', it is said that the 'link-juice' is sent to the new url). even if the specification requires the method (and the body) not to be altered when the redirection is performed, not all user-agents align with it - you can still find this type of bugged software out there. it is therefore recommended to use the 301 code only as a response for get or head methods and to use the 308 permanent redirect for post methods instead, as the method change is explicitly prohibited with this status. status 301 mo...
302 Found - HTTP
Web › HTTP › Status › 302
the hypertext transfer protocol (http) 302 found redirect status response code indicates that the resource requested has been temporarily moved to the url given by the location header. a browser redirects to this page but search engines don't update their links to the resource (in 'seo-speak', it is said that the 'link-juice' is not sent to the new url). even if the specification requires the method (and the body) not to be altered when the redirection is performed, not all user-agents conform here - you can still find this type of bugged software out there. it is therefore recommended to set the 302 code only as a response for get or head methods and to use 307 temporary redirect instead, as the method change is explicitly prohibited in that case. in the cases where you want the method used ...
308 Permanent Redirect - HTTP
Web › HTTP › Status › 308
the request method and the body will not be altered, whereas 301 may incorrectly sometimes be changed to a get method. ...
HTTP
Web › HTTP
nt-server model, with a client opening a connection to make a request, then waiting until it receives a response. http is a stateless protocol, meaning that the server does not keep any data (state) between two requests. though often based on a tcp/ip layer, it can be used on any reliable transport layer, that is, a protocol that doesn't lose messages silently like udp does. rudp — the reliable update of udp — is a suitable alternative. tutorials learn how to use http with guides and tutorials. overview of http the basic features of the client-server protocol: what it can do and its intended uses. http cache caching is very important for fast web sites. this article describes different methods of caching and how to use http headers to control them. http cookies how cookies work i...
CSS Houdini
object model (cssom), enabling developers to write code the browser can parse as css, thereby creating new css features without waiting for them to be implemented natively in browsers. advantages of houdini houdini enables faster parse times than using javascript .style for style changes. browsers parse the cssom — including layout, paint, and composite processes — before applying any style updates found in scripts. in addition, layout, paint, and composite processes are repeated for javascript style updates. houdini code doesn't wait for that first rendering cycle to be complete. rather, it is included in that first cycle — creating renderable, understandable styles. houdini provides an object-based api for working with css values in javascript. houdini's css typed om is a css object m...
A re-introduction to JavaScript (JS tutorial) - JavaScript
this has been a source of confusion ever since. several months later, microsoft released jscript with internet explorer 3. it was a mostly-compatible javascript work-alike. several months after that, netscape submitted javascript to ecma international, a european standards organization, which resulted in the first edition of the ecmascript standard that year. the standard received a significant update as ecmascript edition 3 in 1999, and it has stayed pretty much stable ever since. the fourth edition was abandoned, due to political differences concerning language complexity. many parts of the fourth edition formed the basis for ecmascript edition 5, published in december of 2009, and for the 6th major edition of the standard, published in june of 2015. because it is more familiar, we will re...
About JavaScript - JavaScript
ource code recovery (javascript programs can decompile function bodies back into their source text). for a more in depth discussion of javascript programming follow the javascript resources links below. what javascript implementations are available? the mozilla project provides two javascript implementations. the first ever javascript was created by brendan eich at netscape, and has since been updated to conform to ecma-262 edition 5 and later versions. this engine, code named spidermonkey, is implemented in c/c++. the rhino engine, created primarily by norris boyd (also at netscape) is a javascript implementation written in java. like spidermonkey, rhino is ecma-262 edition 5 compliant. several major runtime optimizations such as tracemonkey (firefox 3.5), jägermonkey (firefox 4) and ionmo...
Details of the object model - JavaScript
structor: function employee(name, dept) { this.name = name || ''; this.dept = dept || 'general'; if (name) this.id = idcounter++; } when you create an instance of employee to use as a prototype, you do not supply arguments to the constructor. using this definition of the constructor, when you do not supply arguments, the constructor does not assign a value to the id and does not update the counter. therefore, for an employee to get an assigned id, you must specify a name for the employee. in this example, mac.id would be 1. alternatively, you can create a copy of employee's prototype object to assign to workerbee: workerbee.prototype = object.create(employee.prototype); // instead of workerbee.prototype = new employee no multiple inheritance some object-oriented languages ...
Expressions and operators - JavaScript
, var status = (age >= 18) ? 'adult' : 'minor'; this statement assigns the value "adult" to the variable status if age is eighteen or more. otherwise, it assigns the value "minor" to status. comma operator the comma operator (,) simply evaluates both of its operands and returns the value of the last operand. this operator is primarily used inside a for loop, to allow multiple variables to be updated each time through the loop. it is regarded bad style to use it elsewhere, when it is not necessary. often two separate statements can and should be used instead. for example, if a is a 2-dimensional array with 10 elements on a side, the following code uses the comma operator to update two variables at once. the code prints the values of the diagonal elements in the array: var x = [0,1,2,3,4,5,...
Loops and iteration - JavaScript
onditionexpression expression is evaluated. if the value of conditionexpression is true, the loop statements execute. if the value of condition is false, the for loop terminates. (if the condition expression is omitted entirely, the condition is assumed to be true.) the statement executes. to execute multiple statements, use a block statement ({ ... }) to group those statements. if present, the update expression incrementexpression is executed. control returns to step 2. example in the example below, the function contains a for statement that counts the number of selected options in a scrolling list (a <select> element that allows multiple selections). the for statement declares the variable i and initializes it to 0. it checks that i is less than the number of options in the <select> elem...
SyntaxError: "x" is a reserved identifier - JavaScript
rally reserved. var enum = { red: 0, green: 1, blue: 2 }; // syntaxerror: enum is a reserved identifier in strict mode code, more identifiers are reserved. "use strict"; var package = ["potatoes", "rice", "fries"]; // syntaxerror: package is a reserved identifier you'll need to rename these variables. var colorenum = { red: 0, green: 1, blue: 2 }; var list = ["potatoes", "rice", "fries"]; update older browsers if you are using an older browser that does not yet implement let or class, for example, you should update to a more recent browser version that does support these new language features. "use strict"; class docarchiver {} // syntaxerror: class is a reserved identifier // (throws in older browsers only, e.g. firefox 44 and older) ...
setter - JavaScript
ne arguments for more information); it must not appear in an object literal with another set or with a data entry for the same property. ( { set x(v) { }, set x(v) { } } and { x: ..., set x(v) { } } are forbidden ) examples defining a setter on new objects in object initializers the following example define a pseudo-property current of object language. when current is assigned a value, it updates log with that value: const language = { set current(name) { this.log.push(name); }, log: [] } language.current = 'en'; console.log(language.log); // ['en'] language.current = 'fa'; console.log(language.log); // ['en', 'fa'] note that current is not defined, and any attempts to access it will result in undefined. removing a setter with the delete operator if you want to remove th...
Array.prototype.forEach() - JavaScript
ach(). the following code logs a line for each element in an array: function logarrayelements(element, index, array) { console.log('a[' + index + '] = ' + element) } // notice that index 2 is skipped, since there is no item at // that position in the array... ...
Date.UTC() - JavaScript
rs between 0 and 99 are converted to a year in the 20th century (1900 + year). for example, 95 is converted to the year 1995. the utc() method differs from the date constructor in two ways: date.utc() uses universal time instead of the local time. date.utc() returns a time value as a number instead of creating a date object. if a parameter is outside of the expected range, the utc() method updates the other parameters to accommodate the value. for example, if 15 is used for month, the year will be incremented by 1 (year + 1) and 3 will be used for the month. utc() is a static method of date, so it's called as date.utc() rather than as a method of a date instance. examples using date.utc() the following statement creates a date object with the arguments treated as utc instead of local:...
Date.now() - JavaScript
the static date.now() method returns the number of milliseconds elapsed since january 1, 1970 00:00:00 utc. syntax var timeinms = date.now(); return value a number representing the milliseconds elapsed since the unix epoch. polyfill this method was standardized in ecma-262 5th edition. engines which have not been updated to support this method can work around the absence of this method using the following shim: if (!date.now) { date.now = function now() { return new date().gettime(); }; } examples reduced time precision to offer protection against timing attacks and fingerprinting, the precision of date.now() might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 20µs in firefox 59; ...
Date.prototype.setDate() - JavaScript
mdn/interactive-examples and send us a pull request. syntax dateobj.setdate(dayvalue) parameters dayvalue an integer representing the day of the month. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the given date (the date object is also changed in place). description if the dayvalue is outside of the range of date values for the month, setdate() will update the date object accordingly. for example, if 0 is provided for dayvalue, the date will be set to the last day of the previous month. if a negative number is provided for dayvalue, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. examples using setdate() var thebigday = ne...
Date.prototype.setFullYear() - JavaScript
he numeric value of the year, for example, 1995. monthvalue optional. an integer between 0 and 11 representing the months january through december. datevalue optional. an integer between 1 and 31 representing the day of the month. if you specify the datevalue parameter, you must also specify the monthvalue. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. description if you do not specify the monthvalue and datevalue parameters, the values returned from the getmonth() and getdate() methods are used. if a parameter you specify is outside of the expected range, setfullyear() attempts to update the other parameters and the date information in the date object accordingly. for example, if you specify 15 for monthvalue, the year is incremented...
Date.prototype.setMilliseconds() - JavaScript
ithub repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.setmilliseconds(millisecondsvalue) parameters millisecondsvalue a number between 0 and 999, representing the milliseconds. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. description if you specify a number outside the expected range, the date information in the date object is updated accordingly. for example, if you specify 1005, the number of seconds is incremented by 1, and 5 is used for the milliseconds. examples using setmilliseconds() var thebigday = new date(); thebigday.setmilliseconds(100); specifications specification ecm...
Date.prototype.setMinutes() - JavaScript
an integer between 0 and 59, representing the seconds. if you specify the secondsvalue parameter, you must also specify the minutesvalue. msvalue optional. a number between 0 and 999, representing the milliseconds. if you specify the msvalue parameter, you must also specify the minutesvalue and secondsvalue. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. description if you do not specify the secondsvalue and msvalue parameters, the values returned from getseconds() and getmilliseconds() methods are used. if a parameter you specify is outside of the expected range, setminutes() attempts to update the date information in the date object accordingly. for example, if you use 100 for secondsvalue, the minutes will be incremented by 1 (minute...
Date.prototype.setMonth() - JavaScript
ero-based integer representing the month of the year offset from the start of the year. so, 0 represents january, 11 represents december, -1 represents december of the previous year, and 12 represents january of the following year. dayvalue optional. an integer from 1 to 31, representing the day of the month. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. description if you do not specify the dayvalue parameter, the value returned from the getdate() method is used. if a parameter you specify is outside of the expected range, setmonth() attempts to update the date information in the date object accordingly. for example, if you use 15 for monthvalue, the year will be incremented by 1, and 3 will be used for month. the current day of month...
Date.prototype.setSeconds() - JavaScript
and send us a pull request. syntax dateobj.setseconds(secondsvalue[, msvalue]) versions prior to javascript 1.3 dateobj.setseconds(secondsvalue) parameters secondsvalue an integer between 0 and 59, representing the seconds. msvalue optional. a number between 0 and 999, representing the milliseconds. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. description if you do not specify the msvalue parameter, the value returned from the getmilliseconds() method is used. if a parameter you specify is outside of the expected range, setseconds() attempts to update the date information in the date object accordingly. for example, if you use 100 for secondsvalue, the minutes stored in the date object will be incremented by 1, and 40 will be...
Date.prototype.setTime() - JavaScript
b repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.settime(timevalue) parameters timevalue an integer representing the number of milliseconds since 1 january 1970, 00:00:00 utc. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date (effectively, the value of the argument). description use the settime() method to help assign a date and time to another date object. examples using settime() var thebigday = new date('july 1, 1999'); var sameasbigday = new date(); sameasbigday.settime(thebigday.gettime()); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.settime'...
Date.prototype.setUTCDate() - JavaScript
ample is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.setutcdate(dayvalue) parameters dayvalue an integer from 1 to 31, representing the day of the month. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. description if a parameter you specify is outside of the expected range, setutcdate() attempts to update the date information in the date object accordingly. 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. examples using setutcdate() var thebigday = new date(); thebigday.
Date.prototype.setUTCFullYear() - JavaScript
the numeric value of the year, for example, 1995. monthvalue optional. an integer between 0 and 11 representing the months january through december. dayvalue optional. an integer between 1 and 31 representing the day of the month. if you specify the dayvalue parameter, you must also specify the monthvalue. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. description if you do not specify the monthvalue and dayvalue parameters, the values returned from the getutcmonth() and getutcdate() methods are used. if a parameter you specify is outside of the expected range, setutcfullyear() attempts to update the other parameters and the date information in the date object accordingly. for example, if you specify 15 for monthvalue, the year is inc...
Date.prototype.setUTCMilliseconds() - JavaScript
ub repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.setutcmilliseconds(millisecondsvalue) parameters millisecondsvalue a number between 0 and 999, representing the milliseconds. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. description if a parameter you specify is outside of the expected range, setutcmilliseconds() attempts to update the date information in the date object accordingly. 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. examples using setutcmilliseconds() var thebigday = new date(); th...
Date.prototype.setUTCMinutes() - JavaScript
an integer between 0 and 59, representing the seconds. if you specify the secondsvalue parameter, you must also specify the minutesvalue. msvalue optional. a number between 0 and 999, representing the milliseconds. if you specify the msvalue parameter, you must also specify the minutesvalue and secondsvalue. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. description if you do not specify the secondsvalue and msvalue parameters, the values returned from getutcseconds() and getutcmilliseconds() methods are used. if a parameter you specify is outside of the expected range, setutcminutes() attempts to update the date information in the date object accordingly. for example, if you use 100 for secondsvalue, the minutes will be incremented by ...
Date.prototype.setUTCMonth() - JavaScript
https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.setutcmonth(monthvalue[, dayvalue]) parameters monthvalue an integer between 0 and 11, representing the months january through december. dayvalue optional. an integer from 1 to 31, representing the day of the month. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. description if you do not specify the dayvalue parameter, the value returned from the getutcdate() method is used. if a parameter you specify is outside of the expected range, setutcmonth() attempts to update the date information in the date object accordingly. for example, if you use 15 for monthvalue, the year will be incremented by 1, and 3 will be used for month. examples using se...
Date.prototype.setUTCSeconds() - JavaScript
project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.setutcseconds(secondsvalue[, msvalue]) parameters secondsvalue an integer between 0 and 59, representing the seconds. msvalue optional. a number between 0 and 999, representing the milliseconds. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. description if you do not specify the msvalue parameter, the value returned from the getutcmilliseconds() method is used. if a parameter you specify is outside of the expected range, setutcseconds() attempts to update the date information in the date object accordingly. for example, if you use 100 for secondsvalue, the minutes stored in the date object will be incremented by 1, and 40 w...
Date.prototype.setYear() - JavaScript
the setyear() method sets the year for a specified date according to local time. because setyear() does not set full years ("year 2000 problem"), it is no longer used and has been replaced by the setfullyear() method. syntax dateobj.setyear(yearvalue) parameters yearvalue an integer. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. description if yearvalue is a number between 0 and 99 (inclusive), then the year for dateobj is set to 1900 + yearvalue. otherwise, the year for dateobj is set to yearvalue. examples using setyear() the first two lines set the year to 1996. the third sets the year to 2000. var thebigday = new date(); thebigday.setyear(96); thebigday.setyear(1996); thebigday.setyear(2000); specifications s...
Date.prototype.toISOString() - JavaScript
a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.toisostring() return value a string representing the given date in the iso 8601 format according to universal time. polyfill this method was standardized in ecma-262 5th edition. ...
Date.prototype.toUTCString() - JavaScript
es if required hh hour, as two digits with leading zero if required mm minute, as two digits with leading zero if required ss seconds, as two digits with leading zero if required prior to ecmascript 2018, the format of the return value varied according to the platform. the most common return value was an rfc-1123 formatted date stamp, which is a slightly updated version of rfc-822 date stamps. examples using toutcstring() let today = new date('wed, 14 jun 2017 00:00:00 pdt'); let utcstring = today.toutcstring(); // wed, 14 jun 2017 07:00:00 gmt specifications specification ecmascript (ecma-262)the definition of 'date.prototype.toutcstring' in that specification. ...
Intl - JavaScript
-cn": chinese (language) written in simplified characters (script) as used in china (region) "en-emodeng": english (language) in the "early modern english" dialect (variant) the subtags identifying languages, scripts, regions (including countries), and (rarely used) variants in unicode bcp 47 locale identifiers are registered in the iana language subtag registry. this registry is periodically updated over time, and implementations may not always be up to date, so be careful not to rely too much on tags being universally supported. bcp 47 also allows for extensions, each consisting of a single digit or letter (other than "x") and one or more two- to eight-letter or digit tags, all separated by hyphens. javascript internationalization functions use the "u" (unicode) extension, which can be us...
Reflect - JavaScript
as own or inherited. works like the in operator as a function. reflect.isextensible(target) same as object.isextensible(). returns a boolean that is true if the target is extensible. reflect.ownkeys(target) returns an array of the target object's own (not inherited) property keys. reflect.preventextensions(target) similar to object.preventextensions(). returns a boolean that is true if the update was successful. reflect.set(target, propertykey, value[, receiver]) a function that assigns values to properties. returns a boolean that is true if the update was successful. reflect.setprototypeof(target, prototype) a function that sets the prototype of an object. returns a boolean that is true if the update was successful. examples detecting whether an object contains certain properties ...
RegExp.prototype.exec() - JavaScript
ub repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax regexobj.exec(str) parameters str the string against which to match the regular expression. return value if the match succeeds, the exec() method returns an array (with extra properties index and input; see below) and updates the lastindex property of the regular expression object. the returned array has the matched text as the first item, and then one item for each parenthetical capture group of the matched text. if the match fails, the exec() method returns null, and sets lastindex to 0. description consider the following example: // match "quick brown" followed by "jumps", ignoring characters in between // rem...
SharedArrayBuffer - JavaScript
ing agent (just as for arraybuffer). however, the shared data block referenced by the two sharedarraybuffer objects is the same data block, and a side effect to the block in one agent will eventually become visible in the other agent. var sab = new sharedarraybuffer(1024); worker.postmessage(sab); updating and synchronizing shared memory with atomic operations shared memory can be created and updated simultaneously in workers or the main thread. depending on the system (the cpu, the os, the browser) it can take a while until the change is propagated to all contexts. to synchronize, atomic operations are needed. apis which use sharedarraybuffer objects webglrenderingcontext.bufferdata() webglrenderingcontext.buffersubdata() webgl2renderingcontext.getbuffersubdata() security requiremen...
WeakMap.prototype.set() - JavaScript
.set(key, value); parameters key required. must be object. the key of the element to add to the weakmap object. value required. any value. the value of the element to add to the weakmap object. return value the weakmap object. examples using the set method var wm = new weakmap(); var obj = {}; // add new elements to the weakmap wm.set(obj, 'foo').set(window, 'bar'); // chainable // update an element in the weakmap wm.set(obj, 'baz'); specifications specification ecmascript (ecma-262)the definition of 'weakmap.prototype.set' in that specification. ...
Logical OR assignment (||=) - JavaScript
hich would always perform an assignment: x = x || y; note that this behavior is different to mathematical and bitwise assignment operators. examples setting default content if the "lyrics" element is empty, set the innerhtml to a default value: document.getelementbyid('lyrics').innerhtml ||= '<i>no lyrics.</i>' here the short-circuit is especially beneficial, since the element will not be updated unnecessarily and won't cause unwanted side-effects such as additional parsing or rendering work, or loss of focus, etc. note: pay attention to the value returned by the api you're checking against. if an empty string is returned (a falsy value), ||= must be used, otherwise you want to use the ??= operator (for null or undefined return values). specifications specification ...
continue - JavaScript
es project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax continue [label]; label identifier associated with the label of the statement. description in contrast to the break statement, continue does not terminate the execution of the loop entirely: instead, in a while loop, it jumps back to the condition. in a for loop, it jumps to the update expression. the continue statement can include an optional label that allows the program to jump to the next iteration of a labeled loop statement instead of the current loop. in this case, the continue statement needs to be nested within this labeled statement. examples using continue with while the following example shows a while loop that has a continue statement that executes when the va...
export - JavaScript
the export statement is used when creating javascript modules to export live bindings to functions, objects, or primitive values from the module so they can be used by other programs with the import statement. bindings that are exported can still be modified locally; when imported, although they can only be read by the importing module the value updates whenever it is updated by the exporting module. exported modules are in strict mode whether you declare them as such or not. the export statement cannot be used in embedded scripts. syntax there are two types of exports: named exports (zero or more exports per module) default exports (one per module) // exporting individual features export let name1, name2, …, namen; // also var, const export let name1 = …, name2 = …, …, namen; ...
for - JavaScript
pression evaluates to true, statement is executed. this conditional test is optional. if omitted, the condition always evaluates to true. if the expression evaluates to false, execution skips to the first expression following the for construct. final-expression an expression to be evaluated at the end of each loop iteration. this occurs before the next evaluation of condition. generally used to update or increment the counter variable. statement a statement that is executed as long as the condition evaluates to true. to execute multiple statements within the loop, use a block statement ({ ... }) to group those statements. to execute no statement within the loop, use an empty statement (;). examples using for the following for statement starts by declaring the variable i and initializing ...
import - JavaScript
the static import statement is used to import read only live bindings which are exported by another module. imported modules are in strict mode whether you declare them as such or not. the import statement cannot be used in embedded scripts unless such script has a type="module". bindings imported are called live bindings because they are updated by the module that exported the binding. there is also a function-like dynamic import(), which does not require scripts of type="module". backward compatibility can be ensured using attribute nomodule on the <script> tag. syntax import defaultexport from "module-name"; import * as name from "module-name"; import { export1 } from "module-name"; import { export1 as alias1 } from "module-name"; import { export1 , export2 } from "module-name"; import {...
<mtable> - MathML
Web › MathML › Element › mtable
align="center 3"). this allows you to align the specified row of the table rather than the whole table. a negative integer value counts rows from the bottom of the table. starting with gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) the interpretation of negative values has been corrected (bug 601436). in gecko 17.0 (firefox 17.0 / thunderbird 17.0 / seamonkey 2.14) the parsing has been updated to treat whitespace correctly. alignmentscope unimplemented class, id, style provided for use with stylesheets. columnalign specifies the horizontal alignment of the cells. multiple values separated by space are allowed and apply to the corresponding columns (e.g. columnalign="left right center"). possible values are: left, center (default) and right. columnlines specifies column borders...
Handling media support issues in web content - Web media technologies
s progressive jpeg or interlaced png. once your image has been converted to progressive form, you can simply use it as usual. <img src="/images/stafff-photo-huge-progressive.jpg" alt="staff photo, taken in january of 1972"> when using a progressive image, the data is stored in such a way that the browser is able to render a low-quality representation of the image as soon as possible, then update the image as it loads—or after it's finished loading—to present it in full quality. note: progressive (or interlaced) images are inherently slightly larger than the non-progressive versions of the same images. whether the interlacing will benefit your users is up to you to determine. specifying multiple sources checking compatibility in javascript htmlmediaelement.canplaytype and medias...
Web video codec guide - Web media technologies
ealistic the motion will appear. eventually the point of diminishing returns is reached. see frame rate below for details. assuming the frame rate is not reduced during encoding, higher frame rates cause larger compressed video sizes. motion compression of video typically works by comparing frames, finding where they differ, and constructing records containing enough information to update the previous frame to approximate the appearance of the following frame. the more successive frames differ from one another, the larger these differences are, and the less effective the compression is at avoiding the introduction of artifacts into the compressed video. the complexity introduced by motion results in larger intermediate frames due to the higher number of differences between fram...
Codecs used by WebRTC - Web media technologies
lled prefercodec() for both the sender's and receiver's codec lists; this method rearranges the codec list the way we want (see below). finally, we call the rtcrtptransceiver's setcodecpreferences() method to specify that the given send and receive codecs are allowed, in the newly rearranged order. that's done for each transceiver on the rtcpeerconnection; once all of the transceivers have been updated, we call the onnegotiationneeded event handler, which will create a new offer, update the local description, send the offer along to the remote peer, and so on, thereby triggering the renegotiation of the connection. the prefercodec() function called by the code above looks like this to move a specified codec to the top of the list (to be prioritized during negotiation): function prefercodec(c...
Using audio and video in HTML - Web media technologies
the html <audio> and <video> elements let you embed audio and video content into a web page. more than that, their underlying interfaces are the key to manipulating and playing back media in general, even offscreen. in this guide, we'll review the media elements and how to use them in html content. note: this guide is a planned update to integrate content from various scattered places on mdn into one cohesive document or document set. the work is not yet scheduled but hopefully will come soon. for now, some of the key information you may be looking for can be found in our learning area article on the topic. we don't have a particularly good guide to using these objects offscreen at this time, although audio and video manipulation may be a good start. ...
OpenSearch description format
itle" href="http://example.com/mysitetitle.xml"> this way, your site can offer plugins to search by author, or by title. in firefox, an icon change in the search box indicates there's a provided search plugin. (see image, the green plus sign.) thus if a search box is not shown in the user's ui, they will receive no indication. in general, behavior varies among browsers. supporting automatic updates for opensearch plugins opensearch plugins can automatically update. to support this, include an extra url element with type="application/opensearchdescription+xml" and rel="self". the template attribute should be the url of the opensearch document to automatically update to. for example: <url type="application/opensearchdescription+xml" rel="self" template="https://example.com/mysea...
Performance fundamentals - Web Performance
"quality of service" metric. computer displays are designed to "fool" user's eyes, by delivering photons to them that mimic reality. for example, paper covered with printed text reflects photons to the user's eyes in some pattern. by manipulating pixels, a reader app emits photons in a similar pattern to "fool" the user's eyes. as your brain infers, motion is not jerky and discrete, but rather "updates" smoothly and continuously. (strobe lights are fun because they turn that upside down, starving your brain of inputs to create the illusion of discrete reality). on a computer display, a higher framerate simply makes for a more faithful imitation of reality. note: humans usually cannot perceive differences in framerate above 60hz. that's why most modern electronic displays are designed to refr...
Populating the page: how browsers work - Web Performance
er engines take the abstract syntax tree and pass it into an interpreter, outputting bytecode which is executed on the main thread. this is known as javascript compilation. building the accessibility tree the browser also builds an accessibility tree that assistive devices use to parse and interpret content. the accessibility object model (aom) is like a semantic version of the dom. the browser updates the accessibility tree when the dom is updated. the accessibility tree is not modifiable by assistive technologies themselves. until the aom is built, the content is not accessible to screen readers. render rendering steps include style, layout, paint and, in some cases, compositing. the cssom and dom trees created in the parsing step are combined into a render tree which is then used to comp...
Add to Home screen - Progressive web apps (PWAs)
the a2hs criteria. when this happens, supporting browsers will fire a beforeinstallprompt event. we can then use a handler like the one below to handle the installation: window.addeventlistener('beforeinstallprompt', (e) => { // prevent chrome 67 and earlier from automatically showing the prompt e.preventdefault(); // stash the event so it can be triggered later. ...
Making PWAs work offline with Service workers - Progressive web apps (PWAs)
functions as a proxy server between the app and the network. this allows us to respond to every single request with any response we want: prepared by the service worker, taken from cache, modified if needed. that's it! our app is caching its resources on install and serving them with fetch from the cache, so it works even if the user is offline. it also caches new content whenever it is added. updates there is still one point to cover: how do you upgrade a service worker when a new version of the app containing new assets is available? the version number in the cache name is key to this: var cachename = 'js13kpwa-v1'; when this updates to v2, we can then add all of our files (including our new files) to a new cache: contenttocache.push('/pwa-examples/js13kpwa/icons/icon-32.png'); // ... ...
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
two separate apis, but they work well together when you want to provide engaging functionality in your app. push is used to deliver new content from the server to the app without any client-side intervention, and its operation is handled by the app's service worker. notifications can be used by the service worker to show new information to the user, or at least alert them when something has been updated. they work outside of the browser window, just like service workers, so updates can be pushed and notifications can be shown when the app's page is out of focus or even closed. notifications let's start with notifications — they can work without push, but are very useful when combined with them. let’s look at them in isolation to begin with. request permission to show a notification, we...
SVG Event Attributes - SVG: Scalable Vector Graphics
Web › SVG › Attribute › Events
ed, onended, onerror, onfocus, oninput, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onmousedown, onmouseenter, onmouseleave, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onpause, onplay, onplaying, onprogress, onratechange, onreset, onresize, onscroll, onseeked, onseeking, onselect, onshow, onstalled, onsubmit, onsuspend, ontimeupdate, ontoggle, onvolumechange, onwaiting graphical event attributes onactivate, onfocusin, onfocusout ...
begin - SVG: Scalable Vector Graphics
Web › SVG › Attribute › begin
wed by a dot and one of the supported events for that element. all valid events (not necessarily supported by all elements) are defined by the dom and html specifications. those are: focus, blur, focusin, focusout, activate, auxclick, click, dblclick, mousedown, mouseenter, mouseleave, mousemove, mouseout, mouseover, mouseup, wheel, beforeinput, input, keydown, keyup, compositionstart, compositionupdate, compositionend, load, unload, abort, error, select, resize, scroll, beginevent, endevent, and repeatevent. an optional offset value as defined in <offset-value> can be appended. <repeat-value> this value defines a qualified repeat event. the element animation start time is defined relative to the time that the repeat event is raised with the specified iteration value. a valid repeat value con...
end - SVG: Scalable Vector Graphics
Web › SVG › Attribute › end
ed by a dot and one of the supported events for that element. all valid events (not necessarily supported by all elements) are defined by the dom and html specifications. those are: focus, blur, focusin, focusout, activate, auxclick, click, dblclick, mousedown, mouseenter, mouseleave, mousemove, mouseout, mouseover, mouseup, wheel, beforeinput, input, keydown, keyup, compositionstart, compositionupdate, compositionend, load, unload, abort, error, select, resize, scroll, beginevent, endevent, and repeatevent . an optional offset value as defined in <offset-value> can be appended. <repeat-value> this value defines a qualified repeat event. the element animation end time is defined relative to the time that the repeat event is raised with the specified iteration value. a valid repeat value cons...
textLength - SVG: Scalable Vector Graphics
ts() to set the value of textlength to the slider's new value, using the svglength interface's svg_lengthtype_px unit type to indicate that the value represents pixels. note that we have to dive into textlength to get its baseval property; textlength is stored as an svglength object, so we can't treat it like a plain number. after updating the text width, the contents of the widthdisplay box are updated with the new value as well, and we're finished. result here's what the example looks like. try dragging the slider around to get a feel for what it does. specifications specification status comment scalable vector graphics (svg) 2the definition of 'textlength' in that specification. candidate recommendation allowed percentages and numbers as values. ...
SVG Attribute reference - SVG: Scalable Vector Graphics
Web › SVG › Attribute
ed, onended, onerror, onfocus, oninput, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onmousedown, onmouseenter, onmouseleave, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onpause, onplay, onplaying, onprogress, onratechange, onreset, onresize, onscroll, onseeked, onseeking, onselect, onshow, onstalled, onsubmit, onsuspend, ontimeupdate, ontoggle, onvolumechange, onwaiting graphical event attributes onactivate, onfocusin, onfocusout ...
Certificate Transparency - Web security
ed_certificate_timestamp sent during the handshake ocsp stapling (that is, the status_request tls extension) and providing a signedcertificatetimestamplist with one or more scts with the x.509 certificate extension, the included scts are decided by the issuing ca. there should be no need for web servers to be modified if this mechanism is used. with the latter methods, servers will need to be updated to send the required data. the advantage is that the server operator can customise the ct log sources providing the scts sent via the tls extension/stapled ocsp response. browser requirements google chrome requires ct log inclusion for all certificates issues with a notbefore date of after 30 april 2018. users will be prevented from visiting sites using non-compliant tls certificates. chrome h...
Subdomain takeovers - Web security
e likelihood for a vulnerable misconfiguration. define standard processes for provisioning and deprovisioning hosts. do all steps as closely together as possible. start provisioning by claiming the virtual host; create dns records last. start deprovisioning by removing dns records first. create an inventory of all of your organization’s domains and their hosting providers, and update it as things change, to ensure that nothing is left dangling. put pressure on hosting vendors to close gaps; ask how they verify that someone claiming a virtual host actually has a legitimate claim to the domain name. work within your organization to make this part of the vendor qualification process. my subdomain has been taken over. what should i do? if you discover that a subdomain of your...
Transport Layer Security - Web security
ly and robustly. applications that use tls can choose their security parameters, which can have a substantial impact on the security and reliability of data. this article provides an overview of tls and the kinds of decisions you need to make when securing your content. history when https was introduced, it was based on secure sockets layer (ssl) 2.0, a technology introduced by netscape. it was updated to ssl 3.0 not long after, and as its usage expanded, it became clear that a common, standard encryption technology needed to be specified to ensure interoperability among all web browsers and servers. the internet engineering task force (ietf) specified tls 1.0 in rfc 2246 in january, 1999. the current version of tls is 1.3 (rfc 8446). despite the fact that the web now uses tls for encryption...
Tutorials
ermediate and advanced javascript methodologies. speaking javascript for programmers who want to learn javascript quickly and properly, and for javascript programmers who want to deepen their skills and/or look up specific topics. essential javascript design patterns an introduction to essential javascript design patterns. advanced level javascript guide a comprehensive, regularly updated guide to javascript for all levels of learning from beginner to advanced. you don't know js a series of books diving deep into the core mechanisms of the javascript language. javascript garden documentation of the most quirky parts of javascript. exploring es6 reliable and in-depth information on ecmascript 2015. javascript patterns a javascript pattern and antipattern collection ...
HTML Imports - Web Components
until there is a consensus on the standard or alternative mechanisms are worked out, you can use a polyfill such as google's webcomponents.js. ...
Using templates and slots - Web Components
the <slot> element. this has more limited support than <template>, available since chrome 53, opera 40, safari 10, firefox 59, and edge 79. slots are identified by their name attribute, and allow you to define placeholders in your template that can be filled with any markup fragment you want when the element is used in the markup. so, if we want to add a slot into our trivial example, we could update our template's paragraph element like this: <p><slot name="my-text">my default text</slot></p> if the slot's content isn't defined when the element is included in the markup, or if the browser doesn't support slots, <my-paragraph> just contains the fallback content "my default text". to define the slot's content, we include an html structure inside the <my-paragraph> element with a slot attri...
Introduction to using XPath in JavaScript - XPath
hes the expression. first_ordered_node_type 9 a result node-set containing the first node in the document that matches the expression. see also xpath xml path language from what is xslt? by g. ken holman original document information based upon original document mozilla xpath tutorial original source author: james graham. other contributors: james thompson. last updated date: 2006-3-25. ...
The Netscape XSLT/XPath Reference - XSLT: Extensible Stylesheet Language Transformations
the following is an alphabetized and annotated list of the elements, axes, and functions from the w3c's 1.0 recommendation for xslt, as well as from the appropriate sections of the xpath recommendation. development of the xslt processor is ongoing, and this document will be updated as functionality is expanded. elements xsl:apply-imports (supported) xsl:apply-templates (supported) xsl:attribute (supported) xsl:attribute-set (supported) xsl:call-template (supported) xsl:choose (supported) xsl:comment (supported) xsl:copy (supported) xsl:copy-of (supported) xsl:decimal-format (supported) xsl:element (supported) xsl:fallback (not supported) xsl:for-each (supported) xsl:if (supported) xsl:import (mostly supported) xsl:include (supported) xsl:key (supported) xsl:m...
Using the Mozilla JavaScript interface to XSL Transformations - XSLT: Extensible Stylesheet Language Transformations
rocessor = new xsltprocessor(); do this: var processor = components.classes["@mozilla.org/document-transformer;1?type=xslt"] .createinstance(components.interfaces.nsixsltprocessor); see also the xslt javascript interface in gecko document.load() regarding the loading of xml documents (as used above) original document information author(s): mike hearn last updated date: december 21, 2005 copyright information: copyright (c) mike hearn ...