Search completed in 1.08 seconds.
Sensor.onreading - Web APIs
candidate recommendation initial definition. ...
... candidate recommendation initial definition. ...
... candidate recommendation initial definition. ...
...ler is called when a reading is taken on one of the child interfaces of the sensor interface. syntax sensorinstance.
onreading = function sensorinstance.addeventlistener('reading', function() { ... }) because sensor is a base class,
onreading may only be used on one of its derived classes. specifications specification status comment generic sensor apithe definition of '
onreading' in that specification. candidate recommendation initial definition. ...
XMLHttpRequest.onreadystatechange - Web APIs
an eventhandler that is called whenever the readystate attribute changes. the callback is called from the user interface thread. the xmlhttprequest.
onreadystatechange property contains the event handler to be called when the readystatechange event is fired, that is every time the readystate property of the xmlhttprequest changes. warning: this should not be used with synchronous requests and must not be used from native code. syntax xmlhttprequest.
onreadystatechange = callback; values callback is the function to be executed when the readystate changes. ...
...ttprequest changes. warning: this should not be used with synchronous requests and must not be used from native code. syntax xmlhttprequest.
onreadystatechange = callback; values callback is the function to be executed when the readystate changes. ...
NDEFReader.onreading - Web APIs
the
onreading property of ndefreader interface of the web nfc api is called whenever a new reading is available from compatible nfc devices, e.g. nfc tags supporting ndef, when these devices are within the reader's magnetic induction field. specifications specification status comment web nfc, ndefreader.
onreadig draft initial definition. ...
dev/panel - Archive of obsolete content
. you can use the class utility function: const { panel } = require("dev/panel"); const { class } = require("sdk/core/heritage"); const mypanel = class({ extends: panel, label: "my panel", tooltip: "my new devtool", icon: "./my-devtool.png", url: "./my-devtool.html", setup: function(options) { // my setup goes here }, dispose: function() { // my teardown goes here },
onready: function() { // i can send messages to // the panel document here } }); alternatively, you can use the extend function: const { extend } = require("sdk/core/heritage"); function mypanel() {}; mypanel.prototype = extend(panel.prototype, { label: "my panel", tooltip: "...", .... }); in the constructor definition there are a number of mandatory and optional parameters for you...
...nction that will be called when the panel is created. it's passed an options object containing a single property debuggee. debuggee is a messageport object that you can use to exchange messages with the debugger server. optional dispose function a function that will be called when the panel is about to be destroyed. you can use it to do any cleanup. optional
onready function an event handler that will be called when the document in the panel becomes interactive. it's equivalent to document.readystate === "interactive". at this point you can send the panel document messages. optional onload function an event handler that will be called after the document in the panel is fully loaded. it's equivalent to document.readystate === "complet...
...core/heritage"); // define the panel constructor const mypanel = class({ extends: panel, label: "my panel", tooltip: "my new devtool's panel", icon: "./my-icon.png", url: "./my-panel.html", // when the panel is created, // take a reference to the debuggee setup: function(options) { this.debuggee = options.debuggee; }, dispose: function() { this.debuggee = null; },
onready: function() { // in this function you can communicate // with the panel document } }); // export the constructor exports.mypanel = mypanel; // create a new tool, initialized // with the new constructor const mytool = new tool({ panels: { mypanel: mypanel } }); panel document environment the panel document loaded from the url property can of course include css and javascript just ...
...And 4 more matches
Getting Started - Developer guides
icrosoft.xmlhttp"); } note: for illustration purposes, the above is a somewhat simplified version of the code to be used for creating an xmlhttp instance. for a more realistic example, see step 3 of this article. after making a request, you will receive a response back. at this stage, you need to tell the xmlhttp request object which javascript function will handle the response, by setting the
onreadystatechange property of the object and naming it after the function to call when the request changes state, like this: httprequest.
onreadystatechange = nameofthefunction; note that there are no parentheses or parameters after the function name, because you're assigning a reference to the function, rather than actually calling it. alternatively, instead of giving a function name, you can use the...
...unction; note that there are no parentheses or parameters after the function name, because you're assigning a reference to the function, rather than actually calling it. alternatively, instead of giving a function name, you can use the javascript technique of defining functions on the fly (called "anonymous functions") to define the actions that will process the response, like this: httprequest.
onreadystatechange = function(){ // process the server response here. }; next, after declaring what happens when you receive the response, you need to actually make the request, by calling the open() and send() methods of the http request object, like this: httprequest.open('get', 'http://www.example.org/some.file', true); httprequest.send(); the first parameter of the call to open() is the h...
...u want to post data, you may have to set the mime type of the request. for example, use the following before calling send() for form data sent as a query string: httprequest.setrequestheader('content-type', 'application/x-www-form-urlencoded'); step 2 – handling the server response when you sent the request, you provided the name of a javascript function to handle the response: httprequest.
onreadystatechange = nameofthefunction; what should this function do? first, the function needs to check the request's state. if the state has the value of xmlhttprequest.done (corresponding to 4), that means that the full server response was received and it's ok for you to continue processing it. if (httprequest.readystate === xmlhttprequest.done) { // everything is good, the response was receiv...
...And 4 more matches
Document - Web APIs
e current document. document.formsread only returns a list of the <form> elements within the current document. document.headread only returns the <head> element of the current document. document.hiddenread only returns a boolean value indicating if the page is considered hidden or not. document.imagesread only returns a list of the images in the current document. document.implementati
onread only returns the dom implementation associated with the current document. document.laststylesheetsetread only returns the name of the style sheet set that was last enabled. has the value null until the style sheet is changed by setting the value of selectedstylesheetset. document.linksread only returns a list of all the hyperlinks in the document. document.mozsyntheticdocument returns...
...ie. document.defaultviewread only returns a reference to the window object. document.designmode gets/sets the ability to edit the whole document. document.dirread only gets/sets directionality (rtl/ltr) of the document. document.domain gets/sets the domain of the current document. document.lastmodifiedread only returns the date on which the document was last modified. document.locati
onread only returns the uri of the current document. document.readystateread only returns loading status of the document. document.referrerread only returns the uri of the page that linked to this page. document.title sets or gets the title of the current document. document.urlread only returns the document location as a string. properties included from documentorshadowroot the document ...
...cut represents the event handling code for the cut event. document.onfullscreenchange is an eventhandler representing the code to be called when the fullscreenchange event is raised. document.onfullscreenerror is an eventhandler representing the code to be called when the fullscreenerror event is raised. document.onpaste represents the event handling code for the paste event. document.
onreadystatechange represents the event handling code for the readystatechange event. document.onselectionchange is an eventhandler representing the code to be called when the selectionchange event is raised. document.onvisibilitychange is an eventhandler representing the code to be called when the visibilitychange event is raised. the document interface is extended with the globaleventhandlers...
...ble via the onkeypress property. keyup fired when a key is released. also available via the onkeyup property. load & unload events domcontentloaded fired when the document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading. readystatechange fired when the readystate attribute of a document has changed. also available via the
onreadystatechange property. pointer events gotpointercapture fired when when an element captures a pointer using setpointercapture(). also available via the ongotpointercapture property. lostpointercapture fired when a captured pointer is released. also available via the onlostpointercapture property. pointercancel fired when a pointer event is canceled. also available via the onpointercan...
nsIDBChangeListener
at does nothing): var mylistener = { onhdrflagschanged: function(ahdrchanged, aoldflags, anewflags, ainstigator) {}, onhdrdeleted: function(ahdrchanged, aparentkey, aflags, ainstigator) {}, onhdradded: function(ahdrchanged, aparentkey, aflags, ainstigator) {}, onparentchanged: function(akeychanged, oldparent, newparent, ainstigator) {}, onannouncergoingaway: function(ainstigator) {},
onreadchanged: function(ainstigator) {}, onjunkscorechanged: function(ainstigator) {}, onhdrpropertychanged: function(ahdrtochange, aprechange, astatus, ainstigator) {}, onevent: function(adb, aevent) {}, queryinterface: function(aiid) { if (!aiid.equals(components.interfaces.nsidbchangelistener) && !aiid.equals(components.interfaces.nsisupports)) throw components.results.ns_e...
... aflags, in nsidbchangelistener ainstigator); void onhdradded(in nsimsgdbhdr ahdrchanged, in nsmsgkey aparentkey, in long aflags, in nsidbchangelistener ainstigator); void onparentchanged(in nsmsgkey akeychanged, in nsmsgkey oldparent, in nsmsgkey newparent, in nsidbchangelistener ainstigator); void onannouncergoingaway(in nsidbchangeannouncer instigator); void
onreadchanged(in nsidbchangelistener ainstigator); void onjunkscorechanged(in nsidbchangelistener ainstigator); void onhdrpropertychanged(in nsimsgdbhdr ahdrtochange, in unsigned long aoldflags, in prbool aprechange, inout pruint32 astatus, in nsidbchangelistener ainstigator); void onevent(in nsimsgdatabase adb, in string aevent); methods onhdrflagschanged() called wh...
... nsmsgkey is given in mailnewstypes2.idl. ainstigator the caller who changed the parent. this can be used to filter out events that you yourself started. ainstigator may also be null. onannouncergoingaway() called when an announcer is being deleted. void onannouncergoingaway(in nsidbchangeannouncer ainstigator); parameters ainstigator the nsidbchangeannouncer that is being removed.
onreadchanged() called when the read state of news messages changes. only used by nsinewsdatabase databases. others use the onhdrflagschanged() method. void
onreadchanged(in nsidbchangelistener ainstigator); parameters ainstigator the caller who changed the read state. this can be used to filter out events that you yourself started. ainstigator may also be null. onjunkscorechanged() called w...
Index - Web APIs
tivate the onactivate eventhandler is called when one of the sensor interface's child interfaces becomes active. 3924 sensor.onerror api, error, eventhandler, generic sensor api, property, reference, sensor, sensor apis, sensors, onerror the onerror eventhandler is called when an error occurs on one of the child interfaces of the sensor interface. 3925 sensor.
onreading api, eventhandler, generic sensor api, property, reference, sensor, sensor apis, sensors,
onreading, reading the
onreading eventhandler is called when a reading is taken on one of the child interfaces of the sensor interface. 3926 sensor.start() api, generic sensor api, method, reference, sensor, sensor apis, sensors, start() the start method activates one of the...
...ttprequest, mozsystem, origin mozsystem is a boolean. if true, the same origin policy is not enforced on the request. 5183 xmlhttprequest.multipart api, gecko, mozilla, non-standard, obsolete, property, reference, xmlhttprequest, multipart this boolean indicates if the response is expected to be a stream of possibly multiple xml documents. ...
...ttprequest, multipart this boolean indicates if the response is expected to be a stream of possibly multiple xml documents. 5184 xmlhttprequest.
onreadystatechange api, event, handler, property, reference, xhr, xmlhttprequest an eventhandler that is called whenever the readystate attribute changes. the callback is called from the user interface thread. the xmlhttprequest.
onreadystatechange property contains the event handler to be called when the readystatechange event is fired, that is every time the readystate property of the xmlhttprequest changes. 5185 xmlhttprequest.open() api, http, method, needsexample, reference, xhr, xmlhttprequest, open the xmlhttprequest method open() initializes a newly-created request, or re-initializes an existing one.
XMLHttpRequest - Web APIs
rom a server, consider using server-sent events through the eventsource interface. for full-duplex communication, websockets may be a better choice. constructor xmlhttprequest() the constructor initializes an xmlhttprequest. it must be called before any other method calls. properties this interface also inherits properties of xmlhttprequesteventtarget and of eventtarget. xmlhttprequest.
onreadystatechange an eventhandler that is called whenever the readystate attribute changes. xmlhttprequest.readystate read only returns an unsigned short, the state of the request. xmlhttprequest.response read only returns an arraybuffer, blob, document, javascript object, or a domstring, depending on the value of xmlhttprequest.responsetype, that contains the response entity body. xmlhttpreque...
...lhttprequestupload, representing the upload process. xmlhttprequest.withcredentials is a boolean that indicates whether or not cross-site access-control requests should be made using credentials such as cookies or authorization headers. non-standard properties xmlhttprequest.channelread only is a nsichannel. the channel used by the object when performing the request. xmlhttprequest.mozan
onread only is a boolean. if true, the request will be sent without cookie and authentication headers. xmlhttprequest.mozsystemread only is a boolean. if true, the same origin policy will not be enforced on the request. xmlhttprequest.mozbackgroundrequest is a boolean. it indicates whether or not the object represents a background service request. xmlhttprequest.mozresponsearraybuffer obsolete s...
...background service request. xmlhttprequest.mozresponsearraybuffer obsolete since gecko 6 read only arraybuffer. the response to the request, as a javascript typed array. xmlhttprequest.multipartobsolete since gecko 22 this gecko-only feature, a boolean, was removed in firefox/gecko 22. please use server-sent events, web sockets, or responsetext from progress events instead. event handlers
onreadystatechange as a property of the xmlhttprequest instance is supported in all browsers. since then, a number of additional event handlers have been implemented in various browsers (onload, onerror, onprogress, etc.). see using xmlhttprequest. more recent browsers, including firefox, also support listening to the xmlhttprequest events via standard addeventlistener() apis in addition to setting on...
Cross-Origin Resource Sharing (CORS) - HTTP
ts no other browsers implement these extra restrictions, because they’re not part of the spec. for example, suppose web content at https://foo.example wishes to invoke content on domain https://bar.other. ...
...e actual request is safe to send. cross-site requests are preflighted like this since they may have implications to user data. the following is an example of a request that will be preflighted: const xhr = new xmlhttprequest(); xhr.open('post', 'https://bar.other/resources/post-here/'); xhr.setrequestheader('x-pingother', 'pingpong'); xhr.setrequestheader('content-type', 'application/xml'); xhr.
onreadystatechange = handler; xhr.send('<person><name>arun</name></person>'); the example above creates an xml body to send with the post request. also, a non-standard http x-pingother request header is set. such headers are not part of http/1.1, but are generally useful to web applications. since the request uses a content-type of application/xml, and since a custom header is set, this request is pre...
...oo.example makes a simple get request to a resource on http://bar.other which sets cookies. content on foo.example might contain javascript like this: const invocation = new xmlhttprequest(); const url = 'http://bar.other/resources/credentialed-content/'; function callotherdomain() { if (invocation) { invocation.open('get', url, true); invocation.withcredentials = true; invocation.
onreadystatechange = handler; invocation.send(); } } line 7 shows the flag on xmlhttprequest that has to be set in order to make the invocation with cookies, namely the withcredentials boolean value. by default, the invocation is made without cookies. since this is a simple get request, it is not preflighted, but the browser will reject any response that does not have the access-control-allow-cre...
Interacting with page scripts - Archive of obsolete content
the object in the target context, and returns a reference to the clone. you can then assign that to a property of the target window, and the page script can access it. here's an example. ...
...hods will not be available to the page script. to expose a function defined in a content script to a page script so the page script can call it, use exportfunction(). here's an example. the "main.js" opens the local file "page.html" and attaches a content script to it: // main.js var tabs = require("sdk/tabs"); var self = require("sdk/self"); tabs.open({ url: self.data.url("page.html"),
onready: attachscript }); function attachscript(tab) { tab.attach({ contentscriptfile: self.data.url("content-script.js") }); } the content script defines a function greetme() and exports it to the page script context. note that the function's closure will be exported, too: // content-script.js var salutation = "hello, "; function greetme(user) { return salutation + user; } exportfunction...
tabs - Archive of obsolete content
ty. ispinned boolean if present and true, then the new tab will be pinned as an app tab. onopen function a callback function that will be registered for the 'open' event. this is an optional property. onclose function a callback function that will be registered for the 'close' event. this is an optional property.
onready function a callback function that will be registered for the 'ready' event. this is an optional property. onload function a callback function that will be registered for the 'load' event. this is an optional property. onpageshow function a callback function that will be registered for the 'pageshow' event. this is an optional property. ...
... the contentscriptfile option. optional. contentscriptoptions object you can use this option to define read-only values for your content scripts. the option consists of an object literal listing name:value pairs for the values you want to provide to the content script. ...
frame/hidden-frame - Archive of obsolete content
remove. hiddenframe constructs a new hidden frame. add registers a hidden frame, preparing it to load content. remove unregisters a frame, unloading any content that was loaded in it. the following code creates a hidden frame, loads a web page into it, and then logs its title: var hiddenframes = require("sdk/frame/hidden-frame"); let hiddenframe = hiddenframes.add(hiddenframes.hiddenframe({
onready: function() { this.element.contentwindow.location = "http://www.mozilla.org/"; let self = this; this.element.addeventlistener("domcontentloaded", function() { console.log(self.element.contentdocument.title); }, true, true); } })); see the panel module for a real-world example of usage of this module. globals constructors hiddenframe(options) creates a hidden frame. ...
...let self = this; this.element.addeventlistener("domcontentloaded", function() { console.log(self.element.contentdocument.title); }, true, true); } })); see the panel module for a real-world example of usage of this module. globals constructors hiddenframe(options) creates a hidden frame. parameters options : object required options: name type
onready function,array functions to call when the frame is ready to load content. you must specify an
onready callback and refrain from using the hidden frame until the callback gets called, because hidden frames are not always ready to load content the moment they are added. functions add(hiddenframe) register a hidden frame, preparing it to load content. parameters hiddenfram...
Open a Web Page - Archive of obsolete content
to follow this tutorial you'll need to have learned the basics of jpm. to open a new web page, you can use the tabs module: var tabs = require("sdk/tabs"); tabs.open("http://www.example.com"); this function is asynchronous, so you don't immediately get back a tab object which you can examine. to do this, pass a callback function into open(). the callback is assigned to the
onready property, and will be passed the tab as an argument: var tabs = require("sdk/tabs"); tabs.open({ url: "http://www.example.com",
onready: function
onready(tab) { console.log(tab.title); } }); even then, you don't get direct access to any content hosted in the tab. to access tab content you need to attach a script to the tab using tab.attach(). this add-on loads a page, then attaches a script to the pa...
... to learn more about running scripts in tabs, see the tutorial on using tab.attach(). ...
Tabs - Archive of obsolete content
his class is jetpack.tabs. blah(lengthstringfocusedstringtostringstringpopstringpushstringreversestringshiftstringsortstringsplicestringunshiftstring)this is some default text lengththe number of open tabsstring focusedthe current tab in your browserstring tostringstuffstring popstuffstring pushstuffstring reversestuffstring shiftstuffstring sortstuffstring splicestuffstring unshiftstuffstring
onready()when the inherited document is fully loaded. onfocus()changing the focus of a tab. methods open(urlstring)opens a new tab in your browser with a defined url. urlurl to be openedstring jetpack.tabs.open("http://www.example.com/"); blah(lengthstringfocusedstringtostringstringpopstringpushstringreversestringshiftstringsortstringsplicestringunshiftstring)this is some default text lengththe numb...
...onfocus()changing the focus of a tab. ...
slideBar - Archive of obsolete content
ck 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 webpage. it currently under development and lives in the future. jetpack.future.import("slidebar"); methods append(iconurihtmlhtml/xmlurluriwidthintpersistboolautoreloadboolonclickfunctiononselectfunction
onreadyfunction)this is a list of options to specify modifications to your slidebar instance. iconhref oficon to show in the slidebaruri htmlhtml content for the featurehtml/xml urlurl to load content for the featureuri widthwidth of the content area and the selected slide sizeint persistdefault slide behavior when being selectedbool autoreloadautomatically reload content on selectbool onclickcallback ...
... iconhref oficon to show in the slidebaruri htmlhtml content for the featurehtml/xml urlurl to load content for the featureuri widthwidth of the content area and the selected slide sizeint persistdefault slide behavior when being selectedbool autoreloadautomatically reload content on selectbool onclickcallback when the icon is clickedfunction onselectcallback when the feature is selectedfunction
onreadycallback when featured is loadedfunction an example: jetpack.slidebar.append({ url: "http://mozilla.com", width: 150, onclick: function(slide){ slide.icon.src = "chrome://branding/content/icon48.png"; }}); ...
jspage - Archive of obsolete content
s:false,evalresponse:false,nocache:false},initialize:function(a){this.xhr=new browser.request(); this.setoptions(a);this.options.issuccess=this.options.issuccess||this.issuccess;this.headers=new hash(this.options.headers);},onstatechange:function(){if(this.xhr.readystate!=4||!this.running){return; }this.running=false;this.status=0;$try(function(){this.status=this.xhr.status;}.bind(this));this.xhr.
onreadystatechange=$empty;if(this.options.issuccess.call(this,this.status)){this.response={text:this.xhr.responsetext,xml:this.xhr.responsexml}; this.success(this.response.text,this.response.xml);}else{this.response={text:null,xml:null};this.failure();}},issuccess:function(){return((this.status>=200)&&(this.status<300)); },processscripts:function(a){if(this.options.evalresponse||(/(ecma|java)script/).te...
...tions.encoding)?"; charset="+this.options.encoding:""; this.headers.set("content-type","application/x-www-form-urlencoded"+c);}if(this.options.nocache){var f="nocache="+new date().gettime();g=(g)?f+"&"+g:f; }var e=b.lastindexof("/");if(e>-1&&(e=b.indexof("#"))>-1){b=b.substr(0,e);}if(g&&a=="get"){b=b+(b.contains("?")?"&":"?")+g;g=null;}this.xhr.open(a.touppercase(),b,this.options.async); this.xhr.
onreadystatechange=this.onstatechange.bind(this);this.headers.each(function(m,l){try{this.xhr.setrequestheader(l,m);}catch(n){this.fireevent("exception",[l,m]); }},this);this.fireevent("request");this.xhr.send(g);if(!this.options.async){this.onstatechange();}return this;},cancel:function(){if(!this.running){return this; }this.running=false;this.xhr.abort();this.xhr.
onreadystatechange=$empty;this.xhr=new...
statusBar - Archive of obsolete content
diframe append the append methods adds a new item to the statusbar. many of the options are optional. ...
...l width (string/length) the width of the panel-item html (string) the html code which will be used inside the item onload (event) this event fires when the item was appended. its acutally not implemented in the current version. ...
Document.readyState - Web APIs
span = document.createelement("span"); span.textcontent = "a <span> element."; document.body.appendchild(span); break; case "complete": // the page is fully loaded. ...
...he first css rule is: " + document.stylesheets[0].cssrules[0].csstext); break; } readystatechange as an alternative to domcontentloaded event // alternative to domcontentloaded event document.
onreadystatechange = function () { if (document.readystate === 'interactive') { initapplication(); } } readystatechange as an alternative to load event // alternative to load event document.
onreadystatechange = function () { if (document.readystate === 'complete') { initapplication(); } } readystatechange as event listener to insert or modify the dom before domcontentloaded document.addeventlistener('readystatechange', event => { if (event.target.readystate === 'interactive') { initloader(); } else if (event.target.readystate === 'complete') { initapp(); } }); ...
EventTarget.addEventListener() - Web APIs
element; e.currenttarget=self; if (typeof listener.handleevent != 'undefined') { listener.handleevent(e); } else { listener.call(self,e); } }; if (type=="domcontentloaded") { var wrapper2=function(e) { if (document.readystate=="complete") { wrapper(e); } }; document.attachevent("
onreadystatechange",wrapper2); eventlisteners.push({object:this,type:type,listener:listener,wrapper:wrapper2}); if (document.readystate=="complete") { var e=new event(); e.srcelement=window; wrapper2(e); } } else { this.attachevent("on"+type,wrapper); eventlisteners.push({object:this,type:type,listener:listener,wrapper:wrapper}...
... } }; var removeeventlistener=function(type,listener /*, usecapture (will be ignored) */) { var counter=0; while (counter<eventlisteners.length) { var eventlistener=eventlisteners[counter]; if (eventlistener.object==this && eventlistener.type==type && eventlistener.listener==listener) { if (type=="domcontentloaded") { this.detachevent("
onreadystatechange",eventlistener.wrapper); } else { this.detachevent("on"+type,eventlistener.wrapper); } eventlisteners.splice(counter, 1); break; } ++counter; } }; element.prototype.addeventlistener=addeventlistener; element.prototype.removeeventlistener=removeeventlistener; if (htmldocument) { htmldocument...
XMLHttpRequest.getAllResponseHeaders() - Web APIs
02\r\n x-xss-protection: 1; mode=block\r\n each line is terminated by both carriage return and line feed characters (\r\n). these are essentially delimiters separating each of the headers. note: in modern browsers, the header names are returned in all lower case, as per the latest spec. ...
... the headers in the request's readystatechange event handler, xmlhttprequest.
onreadystatechange. the code shows how to obtain the raw header string, as well as how to convert it into an array of individual headers and then how to take that array and create a mapping of header names to their values. ...
self - Archive of obsolete content
data files and id. self properties options content-scripting apis such as tab.attach(), page-mod, and page-worker let you pass read-only data to the content script as a json object via the contentscriptoptions option. if you do this, the data is available to the content script in the options property of self: // main.js const tabs = require("sdk/tabs"); tabs.open({ url: "./page.html",
onready: function(tab) { tab.attach({ contentscriptfile: "./content-script.js", contentscriptoptions: { a: "blah" } }); } }); // content-script.js alert(self.options.a); port you can use port to receive messages from, and send messages to, the main add-on code. see the documentation for port. methods the self object has four methods, which enable the content scr...
Working with Events - Archive of obsolete content
re does not yet work for the tabs or windows modules. adding listeners in constructors event emitters may be modules, as is the case for the ready event above, or they may be objects returned by constructors. in the latter case the options object passed to the constructor typically defines properties whose names are the names of supported event types prefixed with "on": for example, "onopen", "
onready" and so on. then in the constructor you can assign a listener function to this property as an alternative to calling the object's on() method. for example: the actionbutton object emits an event when the button is clicked. the following add-on creates a button and assigns a listener to the onclick property of the options object supplied to the button's constructor. the listener loads https://d...
event/target - Archive of obsolete content
s an event `target` unless // intentionally overridden via `.bind()`. console.log(message); }); sometimes event listener may care only about very first event of specific type. eventtarget interface defines convenience method for adding one shot event listeners via method once. such listeners are called only once next time event of the specified type is emitted: target.once('ready', function
onready() { // do the thing once ready! }); removing listeners eventtarget interface defines api for unregistering event listeners, via removelistener method: target.removelistener('message', onmessage); emitting events eventtarget interface intentionally does not define an api for emitting events. in majority of cases party emitting events is different from party registering listeners. in order ...
ui/frame - Archive of obsolete content
is derived from the frame's url, meaning that if you don't supply a name, you may not create two frames with the same url. onattach function assign a listener to the frame's attach event. ondetach function assign a listener to the frame's detach event. onload function assign a listener to the frame's load event.
onready function assign a listener to the frame's ready event. onmessage function assign a listener to the frame's message event. frame methods postmessage(message, targetorigin) send a message to scripts loaded into the frame. this will send the message to message is all viewport documents (one per browser window) of the frame: var { frame } = require("...
ui/sidebar - Archive of obsolete content
() { console.log("sidebar script got the message"); addon.port.emit("pong"); }); the "main.js" file creates a sidebar object and adds a listener to its attach event. on attach, "main.js" sends the ping message, and starts listening for the pong: var sidebar = require("sdk/ui/sidebar").sidebar({ id: 'my-sidebar', title: 'my sidebar', url: require("sdk/self").data.url("sidebar.html"),
onready: function (worker) { worker.port.emit("ping"); worker.port.on("pong", function() { console.log("add-on script got the reply"); }); } }); try running the add-on, and showing the sidebar using the "view->sidebar->my sidebar" menu item. you should see console output like: console.log: add-on: sidebar script got the message console.log: add-on: add-on script got the reply g...
Communication between HTML and your extension - Archive of obsolete content
ssaging on existing components. next i started investigating events, there 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 ...
Basics - Archive of obsolete content
his class is jetpack.tabs. blah(lengthstringfocusedstringtostringstringpopstringpushstringreversestringshiftstringsortstringsplicestringunshiftstring)this is some default text lengththe number of open tabsstring focusedthe current tab in your browserstring tostringstuffstring popstuffstring pushstuffstring reversestuffstring shiftstuffstring sortstuffstring splicestuffstring unshiftstuffstring
onready()when the inherited document is fully loaded. onfocus()changing the focus of a tab. methods open(urlstring)opens a new tab in your browser with a defined url. urlurl to be openedstring jetpack.tabs.open("http://www.example.com/"); ...
Jetpack Snippets - Archive of obsolete content
.appendchild(firebug); (function(){if(window.firebug.version){firebug.init();}else{settimeout(arguments.callee);}})();void(firebug); ]]></script> </body></html>, width: 800, //wide enough to use firebug onselect: function(slide) { slide.slide(800, true); }}); calling into a slidebar from the global jetpack scope jetpack.slidebar.append({
onready: function (slide) { // call out to a global function, passing the slidebar object exinitslidebar(slide); }, ...});function exinitslidebar(aslidebar) { // this variable will now be global slider = aslidebar;} // then, accessing the slidebar htmlvar tl = slider.contentdocument.getelementbyid("thumblist"); // or calling slidebar api methods or accessing propertiesslider.notify(); ...
Using SOAP in XULRunner 1.9 - Archive of obsolete content
req.setrequestheader("method", "post"); < req.setrequestheader("content-length", soapclient.contentlength); < req.setrequestheader("soapserver", soapclient.soapserver); < req.setrequestheader("soapaction", soapreq.action); < } < }); --- > var xhr = new xmlhttprequest(); > xhr.mozbackgroundrequest = true; > xhr.open('post', soapclient.proxy, true); > xhr.
onreadystatechange = function() { > if (4 != xhr.readystate) { return; } > getresponse(xhr); > }; > var headers = { > 'method': 'post', > 'content-type': soapclient.contenttype + '; charset="' + > soapclient.charset + '"', > 'content-length': soapclient.contentlength, > 'soapserver': soapclient.soapserver, > 'soapaction': soapreq.action > }; > for (var h in h...
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
ype="text/css" rel="stylesheet"/> <script src="/jaxer_examples/js/ext-2.1/adapter/ext/ext-base.js"/> <script src="/jaxer_examples/js/ext-2.1/ext-all.js"/> <link href="/jaxer_examples/css/main.css" type="text/css" rel="stylesheet"/> <script runat="both" src="/jaxer_examples/js/validatecomments.js"/> <script> var txt_name; var txt_email; var txt_message; var btn_comments; var form_comments; ext.
onready( function() { // create the name text field txt_name = new ext.form.textfield({ name: "name", fieldlabel: "name", width: 200 }); // create the e-mail text field txt_email = new ext.form.textfield({ name: "email", fieldlabel: "e-mail", width: 200 }); // create the message text field txt_message = new ext.form.textarea({ name: "message", fieldlabel: "message", width: 20...
Necko walkthrough
ocketwritable tries to write the request data from the current transaction (mtransaction) tells the transaction to now wait (`resumerecv) nshttpconnection::resumerecv nshttptransaction::readsegments readrequestsegment is passed to mrequeststream->readsegments - this function pointer is called and used to read the request bytes, which in turn calls ... nshttpconnection::
onreadsegment passes bytes read from request to msocketout->write back to the context of onsocketwritable: nsiasyncinputstream::asyncwait (i.e. msocketin) sets the callback and waits. the http request is now written to the socket, which has a callback to the nshttpconnection... note: from what i can tell, there are some cases where the transaction is queued up to be written to ...
mozIStorageConnection
this will be false if the connection failed to open, or it has been closed. read only. databasefile nsifile the current database nsifile. null if the database connection refers to an in-memory database. read only. lasterror long the last sqlite error code that occurred. read only. note: this is n...
mozIStorageService
tabase() opens a database connection to the specified file. the specified file is created if it does not already exist. if this method throws ns_error_file_corrupted, it's recommended that you call mozistorageservice.backupdatabasefile() to back up the database so that user data is not lost (although we have no way of recovering this data yet). consumers should check mozistorageconnection.connecti
onready to ensure that they can use the database. if this value is false, it is strongly recommended that the database be backed up with mozistorageconnection.backupdb() so user data is not lost. and then the database can be opened again with the mozistorageservice.opendatabase() method. warning: if you have more than one connection to a file, you must use the exact same name for the file each time...
nsIXMLHttpRequest
uest implements the interface nsidomeventtarget and that's how you're supported to add event listeners. try something like this: nscomptr<nsidomeventtarget> target(do_queryinterface(myxmlhttpreq)); target->addeventlistener(ns_literal_string("load"), mylistener, pr_false) where mylistener is your event listener object that implements the interface nsidomeventlistener. the 'onload', 'onerror', and '
onreadystatechange' attributes moved to nsijsxmlhttprequest, but if you're coding in c++ you should avoid using those. though actually, if you use addeventlistener from c++ weird things will happen too, since the result will depend on what js happens to be on the stack when you do it.... conclusion: do not use event listeners on xmlhttprequest from c++, unless you're aware of all the security implicat...
AbsoluteOrientationSensor - Web APIs
set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. syntax var absoluteorientationsensor = new absoluteorientationsensor([options]) parameters options optional options are as follows: frequency: the desired number of times per second a sample should be taken, meaning the number of times per second that sensor.
onreading will be called. a whole number or decimal may be used, the latter for frequencies less than a second. the actual reading frequency depends device hardware and consequently may be less than requested. referenceframe: either 'device' or 'screen'. the default is 'device'. specifications specification status comment generic sensor api candidate recommendation ...
Accelerometer.x - Web APIs
cceleration of the device along the its x axis. if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. syntax var xacceleration = accelerometer.x value a number. example acceleration is typically read in the sensor.
onreading event callback. in the example below this occurs sixty times a second. let accelerometer = new accelerometer({frequency: 60}); accelerometer.addeventlistener('reading', e => { console.log("acceleration along the x-axis " + accelerometer.x); console.log("acceleration along the y-axis " + accelerometer.y); console.log("acceleration along the z-axis " + accelerometer.z); }); accelerometer...
Accelerometer.y - Web APIs
cceleration of the device along the its y axis. if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. syntax var yacceleration = accelerometer.y value a number. example acceleration is typically read in the sensor.
onreading event callback. in the example below this occurs sixty times a second. let accelerometer = new accelerometer({frequency: 60}); accelerometer.addeventlistener('reading', e => { console.log("acceleration along the x-axis " + accelerometer.x); console.log("acceleration along the y-axis " + accelerometer.y); console.log("acceleration along the z-axis " + accelerometer.z); }); accelerometer...
Accelerometer.z - Web APIs
cceleration of the device along the its z axis. if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. syntax var zacceleration = accelerometer.z value a number. example acceleration is typically read in the sensor.
onreading event callback. in the example below this occurs sixty times a second. let accelerometer = new accelerometer({frequency: 60}); accelerometer.addeventlistener('reading', e => { console.log("acceleration along the x-axis " + accelerometer.x); console.log("acceleration along the y-axis " + accelerometer.y); console.log("acceleration along the z-axis " + accelerometer.z); }); accelerometer...
Accelerometer - Web APIs
accelerometer.x read only returns a double containing the acceleration of the device along the device's x axis. accelerometer.y read only returns a double containing the acceleration of the device along the device's y axis. accelerometer.z read only returns a double containing the acceleration of the device along the device's z axis. example acceleration is typically read in the sensor.
onreading event callback. in the example below this occurs sixty times a second. let acl = new accelerometer({frequency: 60}); acl.addeventlistener('reading', () => { console.log("acceleration along the x-axis " + acl.x); console.log("acceleration along the y-axis " + acl.y); console.log("acceleration along the z-axis " + acl.z); }); acl.start(); specifications specification statu...
AmbientLightSensor.AmbientLightSensor() - Web APIs
set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. syntax var ambientlightsensor = new ambientlightsensor(options) parameters options optional currently only one option is supported: frequency: the desired number of times per second a sample should be taken, meaning the number of times per second that sensor.
onreading will be called. a whole number or decimal may be used, the latter for frequencies less than a second. the actual reading frequency depends device hardware and consequently may be less than requested. specifications specification status comment generic sensor api candidate recommendation defines sensors in general. ambient light sensorthe definition...
AmbientLightSensor.illuminance - Web APIs
is because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation insfructions. syntax var level = ambientlightsensor.illuminance value a number indicating the current light level in lux. example if ( 'ambientlightsensor' in window ) { const sensor = new ambientlightsensor(); sensor.
onreading = () => { console.log('current light level:', sensor.illuminance); }; sensor.onerror = (event) => { console.log(event.error.name, event.error.message); }; sensor.start(); } specifications specification status comment generic sensor api candidate recommendation defines sensors in general. ambient light sensorthe definition of 'illuminance...
AmbientLightSensor - Web APIs
user. see feature-policy for implementation instructions. constructor ambientlightsensor.ambientlightsensor() creates a new ambientlightsensor object. properties ambientlightsensor.illuminance returns the current light level in lux of the ambient light level around the hosting device. example if ( 'ambientlightsensor' in window ) { const sensor = new ambientlightsensor(); sensor.
onreading = () => { console.log('current light level:', sensor.illuminance); }; sensor.onerror = (event) => { console.log(event.error.name, event.error.message); }; sensor.start(); } specifications specification status comment generic sensor api candidate recommendation defines sensors in general. ambient light sensorthe definition of 'ambientligh...
DeviceMotionEvent - Web APIs
the devicemotionevent provides web developers with information about the speed of changes for the device's position and orientation. warning: currently, firefox and chrome do not handle the coordinates the same way. take care about this while using them. constructor devicemotionevent.devicemotionevent() creates a new devicemotionevent. properties devicemotionevent.accelerati
onread only an object giving the acceleration of the device on the three axis x, y and z. acceleration is expressed in m/s2. devicemotionevent.accelerationincludinggravityread only an object giving the acceleration of the device on the three axis x, y and z with the effect of gravity. acceleration is expressed in m/s2. devicemotionevent.rotationrateread only an object giving the rate of change of the...
Gyroscope.Gyroscope() - Web APIs
inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. syntax var gyroscope = new gyroscope([options]) parameters options optional options are as follows: frequency: the desired number of times per second a sample should be taken, meaning the number of times per second that sensor.
onreading will be called. a whole number or decimal may be used, the latter for frequencies less than a second. the actual reading frequency depends device hardware and consequently may be less than requested. referenceframe: either 'device' or 'screen'. the default is 'device'. specifications specification status comment generic sensor api candidate recommendation ...
Gyroscope.x - Web APIs
ining the angular velocity of the device along the its x axis. if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. syntax var x = gyroscope.x value a number. example the gyroscope is typically read in the sensor.
onreading event callback. in the example below this occurs sixty times a second. let gyroscope = new gyroscope({frequency: 60}); gyroscope.addeventlistener('reading', e => { console.log("angular velocity along the x-axis " + gyroscope.x); console.log("angular velocity along the y-axis " + gyroscope.y); console.log("angular velocity along the z-axis " + gyroscope.z); }); gyroscope.start(); speci...
Gyroscope.y - Web APIs
ining the angular velocity of the device along the its y axis. if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. syntax var y = gyroscope.y value a number. example the gyroscope is typically read in the sensor.
onreading event callback. in the example below this occurs sixty times a second. let gyroscope = new gyroscope({frequency: 60}); gyroscope.addeventlistener('reading', e => { console.log("angular velocety along the x-axis " + gyroscope.x); console.log("angular velocety along the y-axis " + gyroscope.y); console.log("angular velocety along the z-axis " + gyroscope.z); }); gyroscope.start(); speci...
Gyroscope.z - Web APIs
ining the angular velocity of the device along the its z axis. if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. syntax var z = gyroscope.z value a number. example the gyroscope is typically read in the sensor.
onreading event callback. in the example below this occurs sixty times a second. let gyroscope = new gyroscope({frequency: 60}); gyroscope.addeventlistener('reading', e => { console.log("angular velocety along the x-axis " + gyroscope.x); console.log("angular velocety along the y-axis " + gyroscope.y); console.log("angular velocety along the z-axis " + gyroscope.z); }); gyroscope.start(); speci...
Gyroscope - Web APIs
scope.x read only returns a double, containing the angular velocity of the device along the device's x axis. gyroscope.y read only returns a double, containing the angular velocity of the device along the device's y axis. gyroscope.z read only returns a double, containing the angular velocity of the device along the device's z axis. example the gyroscope is typically read in the sensor.
onreading event callback. in the example below this occurs sixty times a second. let gyroscope = new gyroscope({frequency: 60}); gyroscope.addeventlistener('reading', e => { console.log("angular velocity along the x-axis " + gyroscope.x); console.log("angular velocity along the y-axis " + gyroscope.y); console.log("angular velocity along the z-axis " + gyroscope.z); }); gyroscope.start(); speci...
HTMLProgressElement - Web APIs
-anchor="middle" alignment-baseline="middle">htmlprogresselement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlprogresselement.max is a double value reflecting the content attribute of the same name, limited to numbers greater than zero. its default value is 1.0. htmlprogresselement.positi
onread only returns a double value returning the result of dividing the current value (value) by the maximum value (max); if the progress bar is an indeterminate progress bar, it returns -1. htmlprogresselement.value is a double value that reflects the current value; if the progress bar is an indeterminate progress bar, it returns 0. htmlprogresselement.labelsread only returns nodelist containing...
LinearAccelerationSensor.LinearAccelerationSensor() - Web APIs
s set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. syntax var linearaccelerationsensor = new linearaccelerationsensor([options]) parameters options optional options are as follows: frequency: the desired number of times per second a sample should be taken, meaning the number of times per second that sensor.
onreading will be called. a whole number or decimal may be used, the latter for frequencies less than a second. the actual reading frequency depends on device hardware and consequently may be less than requested. referenceframe: either 'device' or 'screen'. the default is 'device'. specifications specification status comment generic sensor api candidate recommendation...
LinearAccelerationSensor.x - Web APIs
device's x axis. if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. syntax var xlinearaccelerationsensor = linearaccelerationsensor.x value a number. example linear acceleration is typically read in the sensor.
onreading event callback. in the example below this occurs sixty times a second. let lasensor = new linearaccelerationsensor({frequency: 60}); lasensor.addeventlistener('reading', e => { console.log("linear acceleration along the x-axis " + lasensor.x); console.log("linear acceleration along the y-axis " + lasensor.y); console.log("linear acceleration along the z-axis " + lasensor.z); }); lasens...
LinearAccelerationSensor.y - Web APIs
of the device along the device's y axis. if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. syntax var yacceleration = accelerometer.y value a number. example linear acceleration is typically read in the sensor.
onreading event callback. in the example below this occurs sixty times a second. let lasensor = new linearaccelerationsensor({frequency: 60}); lasensor.addeventlistener('reading', e => { console.log("linear acceleration along the x-axis " + lasensor.x); console.log("linear acceleration along the y-axis " + lasensor.y); console.log("linear acceleration along the z-axis " + lasensor.z); }); lasens...
LinearAccelerationSensor.z - Web APIs
of the device along the device's z axis. if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. syntax var zacceleration = accelerometer.z value a number. example linear acceleration is typically read in the sensor.
onreading event callback. in the example below this occurs sixty times a second. let lasensor = new linearaccelerationsensor({frequency: 60}); lasensor.addeventlistener('reading', e => { console.log("linear acceleration along the x-axis " + lasensor.x); console.log("linear acceleration along the y-axis " + lasensor.y); console.log("linear acceleration along the z-axis " + lasensor.z); }); lasens...
LinearAccelerationSensor - Web APIs
ining the linear acceleration of the device along the device's x axis. linearaccelerationsensor.y read only returns a double containing the linear acceleration of the device along the device's y axis. linearaccelerationsensor.z read only returns a double containing the linear acceleration of the device along the device's z axis. example linear acceleration is typically read in the sensor.
onreading event callback. in the example below this occurs sixty times a second. let lasensor = new linearaccelerationsensor({frequency: 60}); lasensor.addeventlistener('reading', e => { console.log("linear acceleration along the x-axis " + lasensor.x); console.log("linear acceleration along the y-axis " + lasensor.y); console.log("linear acceleration along the z-axis " + lasensor.z); }); lasens...
Magnetometer.Magnetometer() - Web APIs
sistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. syntax var magnetometer = new magnetometer([options]) parameters options optional options are as follows: frequency: the desired number of times per second a sample should be taken, meaning the number of times per second that sensor.
onreading will be called. a whole number or decimal may be used, the latter for frequencies less than a second. the actual reading frequency depends on device hardware and consequently may be less than requested. referenceframe: either 'device' or 'screen'. the default is 'device'. specifications specification status comment generic sensor api candidate recommendation...
Magnetometer.x - Web APIs
the magnetic field around the device's x axis. if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. syntax var magnetometerx = magnetometer.x value a number. example the magnetometer is typically read in the sensor.
onreading event callback. in the example below this occurs sixty times a second. let magsensor = new magnetometer({frequency: 60}); magsensor.addeventlistener('reading', e => { console.log("magnetic field along the x-axis " + magsensor.x); console.log("magnetic field along the y-axis " + magsensor.y); console.log("magnetic field along the z-axis " + magsensor.z); }); magsensor.start(); specific...
Magnetometer.y - Web APIs
the magnetic field around the device's y axis. if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. syntax var magnetometery = magnetometer.x value a number. example the magnetometer is typically read in the sensor.
onreading event callback. in the example below this occurs sixty times a second. let magsensor = new magnetometer({frequency: 60}); magsensor.addeventlistener('reading', e => { console.log("magnetic field along the x-axis " + magsensor.x); console.log("magnetic field along the y-axis " + magsensor.y); console.log("magnetic field along the z-axis " + magsensor.z); }); magsensor.start(); specific...
Magnetometer.z - Web APIs
e magnetic field around the device's z axis. if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. syntax var magnetometerz = magnetometer.z value a number. example the magnetometer is typically read in the sensor.
onreading event callback. in the example below this occurs sixty times a second. let magsensor = new magnetometer({frequency: 60}); magsensor.addeventlistener('reading', e => { console.log("magnetic field along the x-axis " + magsensor.x); console.log("magnetic field along the y-axis " + magsensor.y); console.log("magnetic field along the z-axis " + magsensor.z); }); magsensor.start(); specific...
Magnetometer - Web APIs
tometer object. properties magnetometer.x read only returns a double containing the magnetic field around the device's x axis. magnetometer.y read only returns a double containing the magnetic field around the device's y axis. magnetometer.z read only returns a double containing the magnetic field around the device's z axis. example the magnetometer is typically read in the sensor.
onreading event callback. in the example below this occurs sixty times a second. let magsensor = new magnetometer({frequency: 60}); magsensor.addeventlistener('reading', e => { console.log("magnetic field along the x-axis " + magsensor.x); console.log("magnetic field along the y-axis " + magsensor.y); console.log("magnetic field along the z-axis " + magsensor.z); }); magsensor.start(); specific...
NDEFReader - Web APIs
. nfc tags supporting ndef, when these devices are within the reader's magnetic induction field. constructor ndefreader.ndefreader() returns an ndefreader with configuration specified in the parameters or default ones if no parameters are specified. properties in addition to the properties listed below, ndefreader inherits properties from its parent interface, eventtarget. ndefreader.
onreading an event handler for reading event, that notifies about availability of a new reading. ndefreader.onerror an event handler for error event which is called to notify that an error occured during reading. methods the ndefreader interface inherits the methods of eventtarget, its parent interface. ndefreader.scan() called to activate the reader (after ensuring hardware and ua compa...
PerformanceResourceTiming - Web APIs
properties for resource performance entry types by qualifying and constraining them as follows: performanceentry.entrytyperead only returns "resource". performanceentry.nameread only returns the resources url. performanceentry.starttimeread only returns the timestamp for the time a resource fetch started. this value is equivalent to performanceentry.fetchstart. performanceentry.durati
onread only returns a timestamp that is the difference between the responseend and the starttime properties. the interface also supports the following properties which are listed in the order in which they are recorded for the fetching of a single resource. an alphabetical listing is shown in the navigation, at left. performanceresourcetiming.initiatortyperead only a string representing the typ...
PerformanceServerTiming - Web APIs
erface surfaces server metrics that are sent with the response in the server-timing http header. this interface is restricted to the same origin, but you can use the timing-allow-origin header to specify the domains that are allowed to access the server metrics. note that this interface is only available in secure contexts (https) in some browsers. properties performanceservertiming.descripti
onread only a domstring value of the server-specified metric description, or an empty string. performanceservertiming.durati
onread only a double that contains the server-specified metric duration, or value 0.0. performanceservertiming.nameread only a domstring value of the server-specified metric name. methods performanceservertiming.tojson() returns a domstring that is the json representa...
RelativeOrientationSensor.RelativeOrientationSensor() - Web APIs
set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. syntax var relativeorientationsensor = new relativeorientationsensor([options]) parameters options optional options are as follows: frequency: the desired number of times per second a sample should be taken, meaning the number of times per second that sensor.
onreading will be called. a whole number or decimal may be used, the latter for frequencies less than a second. the actual reading frequency depends device hardware and consequently may be less than requested. referenceframe: either 'device' or 'screen'. the default is 'device'. specifications specification status comment orientation sensorthe definition of 'relativeorie...
SecurityPolicyViolationEvent - Web APIs
ent() creates a new securitypolicyviolationevent object instance. properties securitypolicyviolationevent.blockeduriread only a usvstring representing the uri of the resource that was blocked because it violates a policy. securitypolicyviolationevent.columnnumberread only the column number in the document or worker at which the violation occurred. securitypolicyviolationevent.dispositi
onread only indicates how the violated policy is configured to be treated by the user agent. this will be "enforce" or "report". securitypolicyviolationevent.documenturiread only a usvstring representing the uri of the document or worker in which the violation was found. securitypolicyviolationevent.effectivedirectiveread only a domstring representing the directive whose enforcement uncovered th...
Sensor - Web APIs
ies sensor.activated read only returns a boolean indicating whether the sensor is active. sensor.hasreading read only returns a boolean indicating whether the sensor has a reading. sensor.timestamp read only returns the time stamp of the latest sensor reading. event handlers sensor.onerror called when an error occurs on one of the child interfaces of the sensor interface. sensor.
onreading called when a reading is taken on one of the child interfaces of the sensor interface. sensor.onactivate called when one of the sensor interface's becomes active. methods sensor.start() activates one of the sensors based on sensor. sensor.stop() deactivates one of the sensors based on sensor. specifications specification status comment generic sensor apith...
Sensor APIs - Web APIs
reading frequency is decided by you, accomplished with an option passed to a sensor's constructor. the option is a number that specifies the number of readings per second. a whole number or decimal may be used, the latter for frequencies less than a second. the actual reading frequency depends device hardware and consequently may be less than re...
WorkerNavigator - Web APIs
wed to be accessed from a worker. such an object is initialized for each worker and is available via the workerglobalscope.navigator property obtained by calling window.self.navigator. properties the workernavigator interface implements properties from the navigatorid, navigatorlanguage, navigatoronline, navigatordatastore, and navigatorconcurrenthardware interfaces. workernavigator.connecti
onread 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 o...
XMLHttpRequest.getResponseHeader() - Web APIs
eadystatechange handler is established to look for the readystate to indicate that the headers have been received; when that is the case, the value of the content-type header is fetched. if the content-type isn't the desired value, the xmlhttprequest is canceled by calling abort(). var client = new xmlhttprequest(); client.open("get", "unicorns-are-teh-awesome.txt", true); client.send(); client.
onreadystatechange = function() { if(this.readystate == this.headers_received) { var contenttype = client.getresponseheader("content-type"); if (contenttype != my_expected_type) { client.abort(); } } } specifications specification status comment xmlhttprequestthe definition of 'getresponseheader()' in that specification. living standard whatwg li...
XMLHttpRequest.response - Web APIs
reating a listener for readystatechange events such that that when readystate changes to done (4), the response is obtained and passed into the callback function provided to load(). the content is handled as raw text data (since nothing here is overriding the default responsetype). ...