Search completed in 0.95 seconds.
Gyroscope.Gyroscope() - Web APIs
the gyro
scope constructor creates a new gyro
scope object which provides on each reading the angular velocity of the device along all three axes.
... syntax var gyro
scope = new gyro
scope([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.
... gyro
scopethe definition of 'gyro
scope' in that specification.
Rhino scopes and contexts
before using rhino in a concurrent environment, it is important to understand the distinction between contexts and
scopes.
...
scopes a
scope is a set of javascript objects.
... execution of scripts requires a
scope for top-level script variable storage as well as a place to find standard objects like function and object.
...And 46 more matches
WorkerGlobalScope - Web APIs
the workerglobal
scope interface of the web workers api is an interface representing the
scope of any worker.
... workers have no browsing context; this
scope contains the information usually conveyed by window objects — in this case event handlers, the console or the associated workernavigator object.
... each workerglobal
scope has its own event loop.
...And 40 more matches
ServiceWorkerGlobalScope - Web APIs
the serviceworkerglobal
scope interface of the serviceworker api represents the global execution context of a service worker.
...an active service worker is automatically restarted to respond to events, such as serviceworkerglobal
scope.onfetch or serviceworkerglobal
scope.onmessage.
... this interface inherits from the workerglobal
scope interface, and its parent eventtarget, and therefore implements properties from windowtimers, windowbase64, and windoweventhandlers.
...And 18 more matches
DedicatedWorkerGlobalScope - Web APIs
the dedicatedworkerglobal
scope object (the worker global
scope) is accessible through the self keyword.
... some additional global functions, namespaces objects, and constructors, not typically associated with the worker global
scope, but available on it, are listed in the javascript reference.
... properties this interface inherits properties from the workerglobal
scope interface, and its parent eventtarget, and therefore implements properties from windowtimers, windowbase64, and windoweventhandlers.
...And 17 more matches
SharedWorkerGlobalScope - Web APIs
the sharedworkerglobal
scope object (the sharedworker global
scope) is accessible through the self keyword.
... some additional global functions, namespaces objects, and constructors, not typically associated with the worker global
scope, but available on it, are listed in the javascript reference.
... properties this interface inherits properties from the workerglobal
scope interface, and its parent eventtarget, and therefore implements properties from windowtimers, windowbase64, and windoweventhandlers.
...And 17 more matches
WindowOrWorkerGlobalScope - Web APIs
the windoworworkerglobal
scope mixin describes several features common to the window and workerglobal
scope interfaces.
... note: windoworworkerglobal
scope is a mixin and not an interface; you can't actually create an object of type windoworworkerglobal
scope.
... properties these properties are defined on the windoworworkerglobal
scope mixin, and implemented by window and workerglobal
scope.
...And 16 more matches
JS_GetScopeChain
retrieves the
scope chain for the javascript code currently running in a given context.
... js_get
scopechain has been removed in spidermonkey 1.8.7 with no identical replacement.
... when you only used this function to retrieve the
scope chain's global, then you can use the function js_getglobalfor
scopechain.
...And 14 more matches
itemscope - HTML: Hypertext Markup Language
item
scope is a boolean global attribute that defines the
scope of associated metadata.
... specifying the item
scope attribute for an element creates a new item, which results in a number of name-value pairs that are associated with the element.
... every html element may have an item
scope attribute specified.
...And 13 more matches
:scope - CSS: Cascading Style Sheets
the :
scope css pseudo-class represents elements that are a reference point for selectors to match against.
... /* selects a
scoped element */ :
scope { background-color: lime; } currently, when used in a stylesheet, :
scope is the same as :root, since there is not at this time a way to explicitly establish a
scoped element.
... when used from a dom api such as queryselector(), queryselectorall(), matches(), or element.closest(), :
scope matches the element on which the method was called.
...And 10 more matches
JS_EnterLocalRootScope
enter a local root
scope.
... syntax jsbool js_enterlocalroot
scope(jscontext *cx); name type description cx jscontext * pointer to the context.
... description
scoped local root management allows native functions, getter/setters, etc.
...And 9 more matches
Gyroscope - Web APIs
the gyro
scope interface of the sensor apis provides on each reading the angular velocity of the device along all three axes.
... to use this sensor, the user must grant permission to the 'gyro
scope' device sensor through the permissions api.
... constructor gyro
scope.gyro
scope() creates a new gyro
scope object.
...And 6 more matches
WindowOrWorkerGlobalScope.setInterval() - Web APIs
this method is defined by the windoworworkerglobal
scope mixin.
... syntax var intervalid =
scope.setinterval(func, [delay, arg1, arg2, ...]); var intervalid =
scope.setinterval(function[, delay]); var intervalid =
scope.setinterval(code, [delay]); parameters func a function to be executed every delay milliseconds.
... return value the returned intervalid is a numeric, non-zero value which identifies the timer created by the call to setinterval(); this value can be passed to windoworworkerglobal
scope.clearinterval() to cancel the timeout.
...And 5 more matches
JS_LeaveLocalRootScope
leave a local root
scope.
... syntax void js_leavelocalroot
scope(jscontext *cx); name type description cx jscontext * pointer to the context.
... this must be the same context passed to js_enterlocalroot
scope().
...And 4 more matches
JS_LeaveLocalRootScopeWithResult
leave a local root
scope, transferring the result value to the next enclosing root
scope.
... syntax void js_leavelocalroot
scopewithresult(jscontext *cx, jsval rval); name type description cx jscontext * pointer to the context.
... this must be the same context that was passed to js_enterlocalroot
scope.
...And 3 more matches
WorkerGlobalScope.self - Web APIs
the self read-only property of the workerglobal
scope interface returns a reference to the workerglobal
scope itself.
... most of the time it is a specific
scope like dedicatedworkerglobal
scope, sharedworkerglobal
scope, or serviceworkerglobal
scope.
... syntax var selfref = self; value a global
scope object (differs depending on the type of worker you are dealing with, as indicated above).
...And 3 more matches
Gyroscope.x - Web APIs
the x read-only property of the gyro
scope interface returns a double precision integer containing the angular velocity of the device along the its x axis.
... syntax var x = gyro
scope.x value a number.
... example the gyro
scope is typically read in the sensor.onreading event callback.
...And 2 more matches
Gyroscope.y - Web APIs
the y read-only property of the gyro
scope interface returns a double precision integer containing the angular velocity of the device along the its y axis.
... syntax var y = gyro
scope.y value a number.
... example the gyro
scope is typically read in the sensor.onreading event callback.
...And 2 more matches
Gyroscope.z - Web APIs
the z read-only property of the gyro
scope interface returns a double precision integer containing the angular velocity of the device along the its z axis.
... syntax var z = gyro
scope.z value a number.
... example the gyro
scope is typically read in the sensor.onreading event callback.
...And 2 more matches
Scope - MDN Web Docs Glossary: Definitions of Web-related terms
if a variable or other expression is not "in the current
scope," then it is unavailable for use.
...
scopes can also be layered in a hierarchy, so that child
scopes have access to parent
scopes, but not vice versa.
... a function serves as a closure in javascript, and thus creates a
scope, so that (for example) a variable defined exclusively within the function cannot be accessed from outside the function or within other functions.
... console.log(x); } console.log(x); // causes error however, the following code is valid due to the variable being declared outside the function, making it global: var x = "declared outside function"; examplefunction(); function examplefunction() { console.log("inside function"); console.log(x); } console.log("outside function"); console.log(x); learn more general knowledge
scope (computer science) on wikipedia ...
PRThreadScope
the
scope of an nspr thread, specified as a parameter to pr_createthread or returned by pr_getthread
scope.
... syntax #include <prthread.h> typedef enum prthread
scope { pr_local_thread, pr_global_thread pr_global_bound_thread } prthread
scope; enumerators pr_local_thread a local thread, scheduled locally by nspr within the process.
... pr_global_bound_thread a global bound (kernel) thread, scheduled by the host os description an enumerator of type prthread
scope specifies how a thread is scheduled: either locally by nspr within the process (a local thread) or globally by the host (a global thread).
...to find the
scope of the thread, call pr_getthread
scope.
nsIWorkerScope
dom/interfaces/threads/nsidomworkers.idlscriptable this interface represents the global
scope in which a worker's script runs.
... 1.0 66 introduced gecko 1.9.1 inherits from: nsiworkerglobal
scope last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview void postmessage(in domstring amessage, [optional] in nsiworkermessageport amessageport); void close(); attributes attribute type description onclose nsidomeventlistener a listener object to be called when the worker stops running.
...postmessage() posts a message to the
scope's parent worker object.
... see also using web workers nsiworkermessageevent nsiworkermessageport nsiworkerglobal
scope nsiabstractworker nsiworker ...
DedicatedWorkerGlobalScope.onmessage - Web APIs
the onmessage property of the dedicatedworkerglobal
scope interface represents an eventhandler to be called when the message event occurs and bubbles through the worker — i.e.
... var myworker = new worker("worker.js"); first.onchange = function() { myworker.postmessage([first.value,second.value]); console.log('message posted to worker'); } myworker.onmessage = function(e) { result.textcontent = e.data; console.log('message received from worker'); } in the worker.js script, a dedicatedworkerglobal
scope.onmessage handler is used to handle messages from the main script: onmessage = function(e) { console.log('message received from main script'); var workerresult = 'result: ' + (e.data[0] * e.data[1]); console.log('posting message back to main script'); postmessage(workerresult); } notice how in the main script, onmessage has to be called on myworker, whereas inside the worker script you ...
...just need onmessage because the worker is effectively the global
scope (the dedicatedworkerglobal
scope, in this case).
... specifications specification status comment html living standardthe definition of 'dedicatedworkerglobal
scope.onmessage' in that specification.
DedicatedWorkerGlobalScope.postMessage() - Web APIs
the postmessage() method of the dedicatedworkerglobal
scope interface sends a message to the main thread that spawned it.
... the main
scope that spawned the worker can send back information to the thread that spawned it using the worker.postmessage method.
... onmessage = function(e) { console.log('message received from main script'); var workerresult = 'result: ' + (e.data[0] * e.data[1]); console.log('posting message back to main script'); postmessage(workerresult); } in the main script, onmessage would have to be called on a worker object, whereas inside the worker script you just need onmessage because the worker is effectively the global
scope (dedicatedworkerglobal
scope).
... specifications specification status comment html living standardthe definition of 'dedicatedworkerglobal
scope.postmessage()' in that specification.
ServiceWorkerGlobalScope.onnotificationclick - Web APIs
the serviceworkerglobal
scope.onnotificationclick property is an event handler called whenever the notificationclick event is dispatched on the serviceworkerglobal
scope object, that is when a user clicks on a displayed notification spawned by serviceworkerregistration.shownotification().
... note: trying to create a notification inside the serviceworkerglobal
scope using the notification() constructor will throw an error.
... syntax serviceworkerglobal
scope.onnotificationclick = function(notificationevent) { ...
...this property is specified on the notifications_api even though it's part of serviceworkerglobal
scope.
WindowOrWorkerGlobalScope.atob() - Web APIs
the windoworworkerglobal
scope.atob() function decodes a string of data which has been encoded using base64 encoding.
... syntax var decodeddata =
scope.atob(encodeddata); parameters encodeddata a binary string contains an base64 encoded data.
... specifications specification status comment html living standardthe definition of 'windoworworkerglobal
scope.atob()' in that specification.
... living standard method moved to the windoworworkerglobal
scope mixin in the latest spec.
WindowOrWorkerGlobalScope.btoa() - Web APIs
the windoworworkerglobal
scope.btoa() method creates a base64-encoded ascii string from a binary string (i.e., a string object in which each character in the string is treated as a byte of binary data).
... syntax var encodeddata =
scope.btoa(stringtoencode); parameters stringtoencode the binary string to encode.
... specifications specification status comment html living standardthe definition of 'windoworworkerglobal
scope.btoa()' in that specification.
... living standard method moved to the windoworworkerglobal
scope mixin in the latest spec.
WindowOrWorkerGlobalScope.clearInterval() - Web APIs
the clearinterval() method of the windoworworkerglobal
scope mixin cancels a timed, repeating action which was previously established by a call to setinterval().
... syntax
scope.clearinterval(intervalid) parameters intervalid the identifier of the repeated action you want to cancel.
... specifications specification status comment html living standardthe definition of 'windoworworkerglobal
scope.clearinterval()' in that specification.
... living standard method moved to the windoworworkerglobal
scope mixin in the latest spec.
WindowOrWorkerGlobalScope.clearTimeout() - Web APIs
the cleartimeout() method of the windoworworkerglobal
scope mixin cancels a timeout previously established by calling settimeout().
... syntax
scope.cleartimeout(timeoutid) parameters timeoutid the identifier of the timeout you want to cancel.
... specifications specification status comment html living standardthe definition of 'windoworworkerglobal
scope.cleartimeout()' in that specification.
... living standard method moved to the windoworworkerglobal
scope mixin in the latest spec.
WindowOrWorkerGlobalScope.setTimeout() - Web APIs
the settimeout() method of the windoworworkerglobal
scope mixin (and successor to window.settimeout()) sets a timer which executes a function or specified piece of code once the timer expires.
... syntax var timeoutid =
scope.settimeout(function[, delay, arg1, arg2, ...]); var timeoutid =
scope.settimeout(function[, delay]); var timeoutid =
scope.settimeout(code[, delay]); parameters function a function to be executed after the timer expires.
... specifications specification status comment html living standardthe definition of 'windoworworkerglobal
scope.settimeout()' in that specification.
... living standard method moved to the windoworworkerglobal
scope mixin in the latest spec.
WorkerGlobalScope.console - Web APIs
the console read-only property of the workerglobal
scope interface returns a console object providing access to the browser console for the worker.
...so for example you could call console.log('test'); inside a worker (which would basically be the equivalent of self.console.log('test');, as these are being called on the worker
scope, which can be referenced with workerglobal
scope.self), to return a test message out to the browser console.
... if you are calling console.log() from a dedicatedworkerglobal
scope or other worker
scope that acts on a single loaded window, that tab's web console will receive the logs.
... however, if you are calling console.log() from a sharedworkerglobal
scope, the global browser console will receive the logs.
scope - Web app manifests
type string mandatory no the
scope member is a string that defines the navigation
scope of this web application's application context.
...if the user navigates outside the
scope, it reverts to a normal web page inside a browser tab or window.
... if the
scope is a relative url, the base url will be the url of the manifest.
... examples if the
scope is relative, the manifest url is used as a base url: "
scope": "/app/" the following
scope limits navigation to the current site: "
scope": "https://example.com/" finally, the following example limits navigation to a subdirectory of the current site: "
scope": "https://example.com/subdirectory/" specification specification status comment feedback web app manifestthe definition of '
scope' in that specification.
Global scope - MDN Web Docs Glossary: Definitions of Web-related terms
in a programming environment, the global
scope is the
scope that contains, and is visible in, all other
scopes.
... in client-side javascript, the global
scope is generally the web page inside which all the code is being executed.
... learn more learn about it introduction to variable
scope in javascript
scope on wikipedia ...
JS_GetGlobalForScopeChain
syntax jsobject * js_getglobalfor
scopechain(jscontext *cx); name type description cx jscontext * the context for which to return the global object.
... description js_getglobalfor
scopechain() returns the global object for whatever function is currently running on the context.
... in other words, it returns the global object on the current
scope chain.
Using the Debugger map scopes feature - Firefox Developer Tools
it’s also possible to inspect variables from the generated
scopes (e.g., a bundle file with all concatenated module files).
... when you click the increment button on the page and hit the breakpoint, an additional section is added to the right-hand panel below the call stack to display variables mapped from the original
scope, like this: as useful as this is, it would be even nicer if you could view the original code (before it was packages into the "bundle.js" file.
...and, since map has been checked in the
scopes panel, you also see variable symbols from the original code.
AudioWorkletGlobalScope.registerProcessor - Web APIs
the registerprocessor method of the audioworkletglobal
scope interface registers a class constructor derived from audioworkletprocessor interface under a specified name.
... syntax audioworkletglobal
scope.registerprocessor(name, processorctor); parameters name a string representing the name under which the processor will be registered.
... note: a key-value pair { name: constructor } is saved internally in the audioworkletglobal
scope once the processor is registered.
AudioWorkletGlobalScope - Web APIs
the audioworkletglobal
scope interface of the web audio api represents a global execution context for user-supplied code, which defines custom audioworkletprocessor-derived classes.
... each baseaudiocontext has a single audioworklet available under the audioworklet property, which runs its code in a single audioworkletglobal
scope.
...we should see the output of console.log calls in the console: const audiocontext = new audiocontext() await audiocontext.audioworklet.addmodule('test-processor.js') const testnode = new audioworkletnode(audiocontext, 'test-processor') testnode.connect(audiocontext.destination) specifications specification status comment web audio apithe definition of 'audioworkletglobal
scope' in that specification.
DedicatedWorkerGlobalScope.name - Web APIs
the name read-only property of the dedicatedworkerglobal
scope interface returns the name that the worker was (optionally) given when it was created.
... this is the name that the worker() constructor can pass to get a reference to the dedicatedworkerglobal
scope.
... example if a worker is created using a constructor with a name option: var myworker = new worker("worker.js", { name : "myworker" }); the dedicatedworkerglobal
scope will now have a name of "myworker", returnable by running self.name from inside the worker.
HTMLStyleElement.scoped - Web APIs
the htmlstyleelement.
scoped property is a boolean value indicating if the element applies to the whole document (false) or only to the parent's sub-tree (true).
... by default it contains the value of the
scoped content attribute.
... syntax value = style.
scoped; style.
scoped = true; ...
ServiceWorkerGlobalScope: activate event - Web APIs
the activate event of the serviceworkerglobal
scope interface is fired when a serviceworkerregistration acquires a new serviceworkerregistration.active worker.
... bubbles no cancelable no interface extendableevent event handler property serviceworkerglobal
scope.onactivate examples the following snippet shows how you could use an activate event handler to upgrade a cache.
... global
scope.addeventlistener('activate', function(event) { var cachewhitelist = ['v2']; event.waituntil( caches.foreach(function(cache, cachename) { if (cachewhitelist.indexof(cachename) == -1) { return caches.delete(cachename); } }) ); }); you can also set up the event handler using the serviceworkerglobal
scope.onactivate property: global
scope.onactivate = function(event) { ...
ServiceWorkerGlobalScope: install event - Web APIs
the install event of the serviceworkerglobal
scope interface is fired when a serviceworkerregistration acquires a new serviceworkerregistration.installing worker.
... bubbles no cancelable no interface extendableevent event handler property serviceworkerglobal
scope.oninstall examples the following snippet shows how an install event handler can be used to populate a cache with a number of responses, which the service worker can then use to serve assets offline: this.addeventlistener('install', function(event) { event.waituntil( caches.open('v1').then(function(cache) { return cache.add( '/sw-test/', '/sw-test/index.html', '/sw-test/style.css', '/sw-test/app.js', '/sw-test/image-list.js', '/sw-test/star-wars-logo.jpg', '/sw-test/gallery/', '/sw-test/gallery/bountyhunters.jpg', '/sw-test/gallery/mylittlevader.jpg', ...
... '/sw-test/gallery/snowtroopers.jpg' ); }) ); }); you can also set up the event handler using the serviceworkerglobal
scope.oninstall property: global
scope.oninstall = function(event) { ...
ServiceWorkerGlobalScope.onpush - Web APIs
the serviceworkerglobal
scope.onpush event of the serviceworkerglobal
scope interface is fired whenever a push message is received by a service worker via a push server.
... syntax serviceworkerglobal
scope.onpush = function(pushevent) { ...
...this event is specified in the push api, but accessed through serviceworkerglobal
scope.
ServiceWorkerGlobalScope.onpushsubscriptionchange - Web APIs
the serviceworkerglobal
scope.onpushsubscriptionchange event of the serviceworkerglobal
scope interface is fired to indicate a change in push subscription that was triggered outside the application's control, e.g.
... syntax serviceworkerglobal
scope.onpushsubscriptionchange = function() { ...
... working draft initial definition (note: this event is specified in the push api, but accessed through serviceworkerglobal
scope.) ...
SharedWorkerGlobalScope.name - Web APIs
the name read-only property of the sharedworkerglobal
scope interface returns the name that the sharedworker was (optionally) given when it was created.
... this is the name that the sharedworker() constructor can pass to get a reference to the sharedworkerglobal
scope.
... example if a shared worker is created using a constructor with a name option: var myworker = new sharedworker("worker.js", { name : "mysharedworker" }); the sharedworkerglobal
scope will now have a name of "mysharedworker", returnable by running self.name from inside the shared worker.
WindowOrWorkerGlobalScope.fetch() - Web APIs
the fetch() method of the windoworworkerglobal
scope mixin starts the process of fetching a resource from the network, returning a promise which is fulfilled once the response is available.
... windoworworkerglobal
scope is implemented by both window and workerglobal
scope, which means that the fetch() method is available in pretty much any context in which you might want to fetch resources.
... living standard defined in a windoworworkerglobal
scope partial in the newest spec.
WindowOrWorkerGlobalScope.origin - Web APIs
the origin read-only property of the windoworworkerglobal
scope interface returns the origin of the global
scope, serialized as a string.
... examples executed from inside a worker script, the following snippet will log the worker's global
scope's origin to the console each time it receives a message onmessage = function() { console.log(self.origin); }; if the origin is not a scheme/host/port tuple (say you are trying to run it locally, i.e.
... specifications specification status comment html living standardthe definition of 'windoworworkerglobal
scope.origin' in that specification.
WorkerGlobalScope.location - Web APIs
the location read-only property of the workerglobal
scope interface returns the workerlocation associated with the worker.
... it is a specific location object, mostly a subset of the location for browsing
scopes, but adapted to workers.
... example if you called the following in a document served at localhost:8000 console.log(location); inside a worker (which would basically be the equivalent of self.console.log(self.location);, as these are being called on the worker
scope, which can be referenced with workerglobal
scope.self), you will get a workerlocation object written to the console — something like the following: workerlocation {hash: "", search: "", pathname: "/worker.js", port: "8000", hostname: "localhost"…} hash: "" host: "localhost:8000" hostname: "localhost" href: "http://localhost:8000/worker.js" origin: "http://localhost:8000" pathname: "/worker.js" port: "8000" protocol: "http:" search: "" __proto__: workerlocatio...
WorkerGlobalScope.navigator - Web APIs
the navigator read-only property of the workerglobal
scope interface returns the workernavigator associated with the worker.
... it is a specific navigator object, mostly a subset of the navigator for browsing
scopes, but adapted to workers.
... example if you call the following console.log(navigator); inside a worker (which would basically be the equivalent of self.console.log(self.navigator);, as these are being called on the worker
scope, which can be referenced with workerglobal
scope.self), you will get a workernavigator object written to the console — something like the following: object {online: true, useragent: "mozilla/5.0 (macintosh; intel mac os x 10_10_1) ap…ml, like gecko) chrome/40.0.2214.93 safari/537.36", product: "gecko", platform: "macintel", appversion: "5.0 (macintosh; intel mac os x 10_10_1) applewebki…ml, like gecko) chrome/40.0.2214.93 safari/537.36"…} appcodename: "mozilla" appname: "netscape" appversion: "5.0 ...
WorkerGlobalScope.performance - Web APIs
the performance read-only property of the workerglobal
scope interface returns a performance object to be used on the worker.
... example if you called console.log(performance); inside a worker (which would basically be the equivalent of self.console.log(self.performance);, as these are being called on the worker
scope, which can be referenced with workerglobal
scope.self), you will get a workerperformance object written to the console — something like the following: workerperformance {now: function} __proto__: workerperformance constructor: function workerperformance() { [native code] } now: function now() { [native code] } __proto__: object you could use this performance object to return performance data, as you migh...
... recommendation defines workerglobal
scope.performance.
JS_ClearScope
syntax void js_clear
scope(jscontext *cx, jsobject *obj); name type description cx jscontext * the context in which to clear the object.
... description js_clear
scope removes all of obj's own properties, except the special __proto__ and __parent__ properties, in a single operation.
nsIWorkerGlobalScope
onerror nsidomeventlistener self nsiworkerglobal
scope returns the global
scope object itself.
... see also using web workers nsiworkermessageport nsiworkermessageevent nsiworker
scope nsiabstractworker nsiworker ...
nsMsgSearchScope
defined in comm-central/ mailnews/ base/ search/ public/ nsmsgsearchcore.idl [scriptable, uuid(6e893e59-af98-4f62-a326-0f00f32147cd)] interface nsmsgsearch
scope { const nsmsgsearch
scopevalue offlinemail = 0; const nsmsgsearch
scopevalue offlinemailfilter = 1; const nsmsgsearch
scopevalue onlinemail = 2; const nsmsgsearch
scopevalue onlinemailfilter = 3; /// offline news, base table, no body or junk const nsmsgsearch
scopevalue localnews = 4; const nsmsgsearch
scopevalue news = 5; const nsmsgsearch
scopevalue newsex = 6; const nsmsgsearch
scopevalue ldap = 7; const nsmsgsearch
scopevalue localab = 8; const nsmsgsearch
scopevalue allsearchablegroups = 9; const nsmsgsearch
scopevalue newsfilter = 10; const nsmsgsearch
scopevalue localaband = 11; const nsmsgsearch
scopeval...
...ue ldapand = 12; // imap and news, searched using local headers const nsmsgsearch
scopevalue onlinemanual = 13; /// local news + junk const nsmsgsearch
scopevalue localnewsjunk = 14; /// local news + body const nsmsgsearch
scopevalue localnewsbody = 15; /// local news + junk + body const nsmsgsearch
scopevalue localnewsjunkbody = 16; }; ...
DedicatedWorkerGlobalScope.close() - Web APIs
the close() method of the dedicatedworkerglobal
scope interface discards any tasks queued in the dedicatedworkerglobal
scope's event loop, effectively closing this particular
scope.
... syntax self.close(); example if you want to close your worker instance from inside the worker itself, you can call the following: close(); close() and self.close() are effectively equivalent — both represent close() being called from inside the worker's inner
scope.
ServiceWorkerGlobalScope.caches - Web APIs
the caches read-only property of the serviceworkerglobal
scope interface returns the cachestorage object associated with the service worker.
... specifications specification status comment service workersthe definition of 'serviceworkerglobal
scope.caches' in that specification.
ServiceWorkerGlobalScope: contentdelete event - Web APIs
the contentdelete event of the serviceworkerglobal
scope interface is fired when an item is removed from the indexed content via the user agent.
... self.addeventlistener('contentdelete', event => { event.waituntil( caches.open('cache-name').then(cache => { return promise.all([ cache.delete(`/icon/${event.id}`), cache.delete(`/content/${event.id}`) ]) }) ); }); you can also set up the event handler using the serviceworkerglobal
scope.ondelete property: self.oncontentdelete = (event) => { ...
ServiceWorkerGlobalScope.onactivate - Web APIs
the onactivate property of the serviceworkerglobal
scope interface is an event handler fired whenever an activate event occurs (when the service worker activates).
... syntax serviceworkerglobal
scope.onactivate = function(event) { ...
ServiceWorkerGlobalScope.oncontentdelete - Web APIs
the oncontentdelete property of the serviceworkerglobal
scope interface is an event handler fired when an item is removed from the indexed content via the user agent.
... syntax serviceworkerglobal
scope.oncontentdelete = function(event) { ...
ServiceWorkerGlobalScope.onfetch - Web APIs
the onfetch property of the serviceworkerglobal
scope interface is an event handler fired whenever a fetch event occurs (usually when the windoworworkerglobal
scope.fetch() method is called.) syntax serviceworkerglobal
scope.onfetch = function(fetchevent) { ...
... }; example this code snippet is from the service worker prefetch sample (see prefetch example live.) the serviceworkerglobal
scope.onfetch event handler listens for the fetch event.
ServiceWorkerGlobalScope.oninstall - Web APIs
the oninstall property of the serviceworkerglobal
scope interface is an event handler fired whenever an install event occurs (when the service worker installs).
... syntax serviceworkerglobal
scope.oninstall = function(event) { ...
ServiceWorkerGlobalScope.onmessage - Web APIs
the onmessage property of the serviceworkerglobal
scope interface is an event handler fired whenever a message event occurs — when incoming messages are received.
...(they used to be represented by serviceworkermessageevent objects, which have now been deprecated.) syntax serviceworkerglobal
scope.onmessage = function(extendablemessageevent) { ...
ServiceWorkerGlobalScope.onsync - Web APIs
the serviceworkerglobal
scope.onsync event of the serviceworkerglobal
scope interface is fired whenever a syncevent event occurs.
... syntax serviceworkerglobal
scope.onsync = function(syncevent) { ...
ServiceWorkerGlobalScope.registration - Web APIs
the registration read-only property of the serviceworkerglobal
scope interface returns a reference to the serviceworkerregistration object, which represents the service worker's registration.
... specifications specification status comment service workersthe definition of 'serviceworkerglobal
scope.registration' in that specification.
ServiceWorkerGlobalScope.skipWaiting() - Web APIs
the serviceworkerglobal
scope.skipwaiting() method of the serviceworkerglobal
scope forces the waiting service worker to become the active service worker.
... syntax serviceworkerglobal
scope.skipwaiting().then(function() { //do something }); returns a promise that immediately resolves with undefined.
ServiceWorkerRegistration.scope - Web APIs
the
scope read-only property of the serviceworkerregistration interface returns a unique identifier for a service worker registration.
... syntax var sw
scope = serviceworkerregistration.
scope; specifications specification status comment service workersthe definition of 'serviceworkerregistration.
scope' in that specification.
SharedWorkerGlobalScope.close() - Web APIs
the close() method of the sharedworkerglobal
scope interface discards any tasks queued in the sharedworkerglobal
scope's event loop, effectively closing this particular
scope.
... syntax self.close(); example if you want to close your worker instance from inside the worker itself, you can call the following: close(); close() and self.close() are effectively equivalent — both represent close() being called from inside the worker's inner
scope.
SharedWorkerGlobalScope: connect event - Web APIs
the connect event is fired in shared workers at their sharedworkerglobal
scope when a new client connects.
... bubbles no cancelable no interface messageevent event handler property sharedworkerglobal
scope.onconnect examples this example shows a shared worker file — when a connection to the worker occurs from a main thread via a messageport, the onconnect event handler fires.
WindowOrWorkerGlobalScope.caches - Web APIs
the caches read-only property of the windoworworkerglobal
scope interface returns the cachestorage object associated with the current context.
... working draft defined in a windoworworkerglobal
scope partial in the newest spec.
WindowOrWorkerGlobalScope.indexedDB - Web APIs
the indexeddb read-only property of the windoworworkerglobal
scope mixin provides a mechanism for applications to asynchronously access the capabilities of indexed databases.
... recommendation defined in a windoworworkerglobal
scope partial in the newest spec.
WindowOrWorkerGlobalScope.isSecureContext - Web APIs
the issecurecontext read-only property of the windoworworkerglobal
scope interface returns a boolean indicating whether the current context is secure (true) or not (false).
... specifications specification status comment secure contextsthe definition of 'windoworworkerglobal
scope.issecurecontext' in that specification.
WindowOrWorkerGlobalScope.queueMicrotask() - Web APIs
queuemicrotask() is exposed on the windoworworkerglobal
scope mixin.
... syntax
scope.queuemicrotask(function); parameters function a function to be executed when the browser engine determines it is safe to call your code.
WorkerGlobalScope.close() - Web APIs
the close() method of the workerglobal
scope interface discards any tasks queued in the workerglobal
scope's event loop, effectively closing this particular
scope.
... syntax self.close(); example if you wanted to close your worker instance from inside the worker itself, you could call the following: close(); close() and self.close() are effectively equivalent — both represent close() being called from inside the worker's inner
scope.
WorkerGlobalScope.importScripts() - Web APIs
the importscripts() method of the workerglobal
scope interface synchronously imports one or more scripts into the worker's
scope.
... example if you had some functionality written in a separate script called foo.js that you wanted to use inside worker.js, you could import it using the following line: importscripts('foo.js'); importscripts() and self.importscripts() are effectively equivalent — both represent importscripts() being called from inside the worker's inner
scope.
WorkerGlobalScope.onerror - Web APIs
the onerror property of the workerglobal
scope interface represents an eventhandler to be called when the error event occurs and bubbles through the worker.
...}; example the following code snippet shows an onerror handler set inside a worker: self.onerror = function() { console.log('there is an error inside your worker!'); } specifications specification status comment html living standardthe definition of 'workerglobal
scope.onerror' in that specification.
WorkerGlobalScope.onlanguagechange - Web APIs
the onlanguagechange property of the workerglobal
scope interface represents an eventhandler to be called when the languagechange event occurs and bubbles through the worker.
...}; example the following code snippet shows an onlanguagechange handler set inside a worker: self.onlanguagechange = function() { console.log('your preferred language settings have been changed'); } specifications specification status comment html living standardthe definition of 'workerglobal
scope.onlanguagechange' in that specification.
WorkerGlobalScope.onoffline - Web APIs
the onoffline property of the workerglobal
scope interface represents an eventhandler to be called when the offline event occurs and bubbles through the worker.
...}; example the following code snippet shows an onoffline handler set inside a worker: self.onoffline = function() { console.log('your worker is now offline'); } specifications specification status comment html living standardthe definition of 'workerglobal
scope.onoffline' in that specification.
WorkerGlobalScope.ononline - Web APIs
the ononline property of the workerglobal
scope interface represents an eventhandler to be called when the online event occurs and bubbles through the worker.
...}; example the following code snippet shows an ononline handler set inside a worker: self.ononline = function() { console.log('your worker is now online'); } specifications specification status comment html living standardthe definition of 'workerglobal
scope.ononline' in that specification.
Feature-Policy: gyroscope - HTTP
the http feature-policy header gyro
scope directive controls whether the current document is allowed to gather information about the orientation of the device through the gyro
scope interface.
... syntax feature-policy: gyro
scope <allowlist>; <allowlist> an allowlist is a list of origins that takes one or more of the following values, separated by spaces: *: the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin.
PR_GetThreadScope
syntax #include <prthread.h> prthread
scope pr_getthread
scope(void); returns a value of type prthread
scope indicating whether the thread is local or global.
nsIMsgSearchScopeTerm
defined in comm-central/ mailnews/ base/ search/ public/ nsimsgsearch
scopeterm.idl [scriptable, uuid(934672c3-9b8f-488a-935d-87b4023fa0be)] interface nsimsgsearch
scopeterm : nsisupports { nsiinputstream getinputstream(in nsimsgdbhdr ahdr); void closeinputstream(); readonly attribute nsimsgfolder folder; readonly attribute nsimsgsearchsession searchsession; }; ...
DedicatedWorkerGlobalScope.onmessageerror - Web APIs
the onmessageerror event handler of the dedicatedworkerglobal
scope interface is an eventlistener, called whenever an messageevent of type messageerror is fired on the worker—that is, when it receives a message that cannot be deserialized.
SharedWorkerGlobalScope.onconnect - Web APIs
the onconnect property of the sharedworkerglobal
scope interface is an event handler representing the code to be called when the connect event is raised — that is, when a messageport connection is opened between the associated sharedworker and the main thread.
WorkerGlobalScope.onclose - Web APIs
summary the onclose property of the workerglobal
scope interface represents an eventhandler to be called when the close event occurs and bubbles through the worker.
Index - Web APIs
user-supplied code is run in the audioworkletglobal
scope global execution context in a separate web audio rendering thread along with other nodes, allowing for zero-latency audio processing.
... 203 audioworkletglobal
scope api, audioworkletglobal
scope, experimental, interface, reference, web audio api the audioworkletglobal
scope interface of the web audio api represents a global execution context for user-supplied code, which defines custom audioworkletprocessor-derived classes.
... each baseaudiocontext has a single audioworklet available under the audioworklet property, which runs its code in a single audioworkletglobal
scope.
...And 112 more matches
Bytecode Descriptions
in a global
scope: typeof x compiles to getgname "x"; typeof.
...this must be used only in
scopes where this refers to the global this.
...this must be used only in scripts where new.target is allowed: non-arrow function scripts and other scripts that have a non-arrow function script on the
scope chain.
...And 29 more matches
Anonymous Content - Archive of obsolete content
anonymous content introduces the concept of
scope to nodes within a document.
... explicit content is said to be at the document-level
scope.
... anonymous content nodes are in their own binding-level
scopes.
...And 22 more matches
Functions - JavaScript
to use a function, you must define it somewhere in the
scope from which you wish to call it.
... functions must be in
scope when they are called, but the function declaration can be hoisted (appear below the call in the code), as in this example: console.log(square(5)); /* ...
... */ function square(n) { return n * n } the
scope of a function is the function in which it is declared (or the entire program, if it is declared at the top level).
...And 21 more matches
nsIXPConnect
ntextptr ajscontext, in jsobjectptr ajsobj); void getsecuritymanagerforjscontext(in jscontextptr ajscontext, out nsixpcsecuritymanager amanager, out pruint16 flags); nsixpconnectwrappednative getwrappednativeofjsobject(in jscontextptr ajscontext, in jsobjectptr ajsobj); nsixpconnectwrappednative getwrappednativeofnativeobject(in jscontextptr ajscontext, in jsobjectptr a
scope, in nsisupports acomobj, in nsiidref aiid); nsixpconnectjsobjectholder getwrappednativeprototype(in jscontextptr ajscontext, in jsobjectptr a
scope, in nsiclassinfo aclassinfo); jsval getwrapperforobject(in jscontextptr ajscontext, in jsobjectptr aobject, in jsobjectptr a
scope, in nsiprincipal aprincipal, in unsigned long afilenameflags); native code only!
... initclasseswithnewwrappedglobal(in jscontextptr ajscontext, in nsisupports acomobj, in nsiidref aiid, in nsiprincipal aprincipal, in nsisupports aextraptr, in pruint32 aflags); nsivariant jstovariant(in jscontextptr ctx, in jsval value); nsivariant jsvaltovariant(in jscontextptr cx, in jsvalptr ajsval); void movewrappers(in jscontextptr ajscontext, in jsobjectptr aold
scope, in jsobjectptr anew
scope); [noscript,notxpcom] void notejscontext(in jscontextptr ajscontext, in nscctraversalcallbackref acb); void releasejscontext(in jscontextptr ajscontext, in prbool nogc); void removejsholder(in voidptr aholder); native code only!
... void reparent
scopeawarewrappers(in jscontextptr ajscontext, in jsobjectptr aold
scope, in jsobjectptr anew
scope); obsolete since gecko 1.9.1 nsixpconnectjsobjectholder reparentwrappednativeiffound(in jscontextptr ajscontext, in jsobjectptr a
scope, in jsobjectptr anewparent, in nsisupports acomobj); void restorewrappednativeprototype(in jscontextptr ajscontext, in jsobjectptr a
scope, in nsiclassinfo aclassinfo, in nsixpconnectjsobjectholder aprototype); void setdebugmodewhenpossible(in prbool mode); native code only!
...And 18 more matches
Functions — reusable blocks of code - Learn web development
in this article we'll explore fundamental concepts behind functions such as basic syntax, how to invoke and define them,
scope, and parameters.
... function
scope and conflicts let's talk a bit about
scope — a very important concept when dealing with functions.
... when you create a function, the variables and other things defined inside the function are inside their own separate
scope, meaning that they are locked away in their own separate compartments, unreachable from code outside the functions.
...And 15 more matches
Index
if
scopechain is supplied, it uses
scopechain as its enclosing
scope.
... if
scopechain is omitted, it creates a new function object in cx's global.
...in other words, it returns the global object on the current
scope chain.
...And 14 more matches
A re-introduction to JavaScript (JS tutorial) - JavaScript
let a; let name = 'simon'; the following is an example of
scope with a variable declared with let: // myletvariable is *not* visible out here for (let myletvariable = 0; myletvariable < 5; myletvariable++) { // myletvariable is only visible in here } // myletvariable is *not* visible out here const allows you to declare variables whose values are never intended to change.
... var a; var name = 'simon'; an example of
scope with a variable declared with var: // myvarvariable *is* visible out here for (var myvarvariable = 0; myvarvariable < 5; myvarvariable++) { // myvarvariable is visible to the whole function } // myvarvariable *is* visible out here if you declare a variable without assigning any value to it, its type is undefined.
... an important difference between javascript and other languages like java is that in javascript, blocks do not have
scope; only functions have a
scope.
...And 13 more matches
Mork
meta-dictionaries are in practice only used to change the
scope of alias definitions (the '(a=c)' that you can see in files).
... meta-tables are used to establish some facts about the table as well as the default row
scope.
... meta-rows do not appear to be used at all, although the parser seems to consider setting the charset, row
scope, and atom
scope.
...And 12 more matches
Window - Web APIs
properties this interface inherits properties from the eventtarget interface and implements properties from the windoworworkerglobal
scope and windoweventhandlers mixins.
... properties implemented from elsewhere windoworworkerglobal
scope.caches read only returns the cachestorage object associated with the current context.
... windoworworkerglobal
scope.indexeddb read only provides a mechanism for applications to asynchronously access capabilities of indexed databases; returns an idbfactory object.
...And 12 more matches
itemprop - HTML: Hypertext Markup Language
html <div item
scope itemtype="http://schema.org/movie"> <h1 itemprop="name">avatar</h1> <span>director: <span itemprop="director">james cameron</span> (born august 16, 1954)</span> <span itemprop="genre">science fiction</span> <a href="../movies/avatar-theatrical-trailer.html" itemprop="trailer">trailer</a> </div> structured data item itemprop name itemprop value ...
... three properties with values that are strings <div item
scope> <p>my name is <span itemprop="name">neil</span>.</p> <p>my band is called <span itemprop="band">four parts water</span>.</p> <p>i am <span itemprop="nationality">british</span>.</p> </div> one property, "image", whose value is a url <div item
scope> <img itemprop="image" src="google-logo.png" alt="google"> </div> when a string value can't be easily read and understood by a pers...
... <h1 item
scope> <data itemprop="product-id" value="9678aou879">the instigator 2000</data> </h1> for numeric data, the meter element and its value attribute can be used.
...And 12 more matches
Property cache
throughout this article, phrases such as "own property" should be taken to refer to the low-level representation of properties in
scopes and shape chains.
...(informally: if another property shadows x'.p, the shape of x' will change.) o---->o---->o---->o ^x ^x' ^object.prototype, perhaps (----> indicates the proto relation)
scope chain shadowing guarantee — if at time t0 the object x has shape s and a name lookup for p starting at
scope chain head x finds p on an object x' of shape s', where x !== x'; and the lookup called no resolve hooks or non-native lookup ops; and each object examined along the parent chain, except possibly the one along whose prototype chain x' was found, had no prototype or was a block object; an...
... lookups for jof_name instructions are quite different from ordinary property lookups: name lookups follow the
scope chain and the prototype chain, whereas the others only follow the prototype chain.
...And 10 more matches
Index
32 components.utils.cloneinto this function provides a safe way to take an object defined in a privileged
scope and create a structured clone of it in a less-privileged
scope.
... it returns a reference to the clone: 33 components.utils.createobjectin add-ons, developing mozilla, extensions, javascript, reference, référence(2), xpcom:language bindings, xpconnect components.utils.createobjectin creates a new javascript object in the
scope of the specified object's compartment.
... 36 components.utils.exportfunction api, add-ons, components, extensions, language bindings, method, mozilla, non-standard, reference, webextensions, xpcom this function provides a safe way to expose a function from a privileged
scope to a less-privileged
scope.
...And 10 more matches
nsIPushService
implemented by @mozilla.org/push/service;1 as a service: const pushservice = components.classes["@mozilla.org/push/service;1"] .getservice(components.interfaces.nsipushservice); method overview void subscribe(in domstring
scope, in nsiprincipal principal, in nsipushsubscriptioncallback callback); void getsubscription(in domstring
scope, in nsiprincipal principal, in nsipushsubscriptioncallback callback); void unsubscribe(in domstring
scope, in nsiprincipal principal, in nsiunsubscriberesultcallback callback); methods subscribe() creates a push subscription.
... void subscribe( in domstring
scope, in nsiprincipal principal, in nsipushsubscriptioncallback callback ); parameters
scope the serviceworkerregistration.
scope for a service worker subscription, or a unique url (for example, chrome://my-module/push) for a system subscription.
... void getsubscription( in domstring
scope, in nsiprincipal principal, in nsipushsubscriptioncallback callback ); parameters
scope the unique
scope url, as passed to nsipushservice.subscribe().
...And 10 more matches
Service Worker API - Web APIs
after that, it is updated when: a navigation to an in-
scope page occurs.
...activation can happen sooner using serviceworkerglobal
scope.skipwaiting() and existing pages can be claimed by the active worker using clients.claim().
... receiving centralized updates to expensive-to-calculate data such as geolocation or gyro
scope, so multiple pages can make use of one set of data.
...And 10 more matches
let - JavaScript
the let statement declares a block-
scoped local variable, optionally initializing it to a value.
... description let allows you to declare variables that are limited to the
scope of a block statement, or expression on which it is used, unlike the var keyword, which defines a variable globally, or locally to an entire function regardless of block
scope.
... just like const the let does not create properties of the window object when declared globally (in the top-most
scope).
...And 10 more matches
Using JavaScript code modules
javascript code modules are a concept introduced in gecko 1.9 and can be used for sharing code between different privileged
scopes.
...the module is loaded into a specific javascript
scope, such as xul script or javascript xpcom script, using components.utils.import() or components.utils["import"]().
...any javascript item named in exported_symbols will be exported from the module and injected into the importing
scope.
...And 9 more matches
Split object
the function object carries a reference to the window, via the
scope chain.
... security privileges are granted to js code on the basis of the
scope chain of the executing code.
... spidermonkey walks up the
scope chain to the nearest object that has jsprincipals attached.
...And 9 more matches
Components.utils.exportFunction
this function provides a safe way to expose a function from a privileged
scope to a less-privileged
scope.
... the exported function does not have to be added to the less privileged code's global window object: it can be exported to any object in the target
scope.
... syntax components.utils.exportfunction(func, target
scope[, options]); parameters func : function the function to export.
...And 9 more matches
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.
... 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.
...And 9 more matches
var - JavaScript
the var statement declares a function-
scoped or globally-
scoped variable, optionally initializing it to a value.
... the
scope of a variable declared with var is its current execution context and closures thereof, which is either the enclosing function and functions declared within it, or, for variables declared outside any function, global.
... 'use strict'; function foo() { var x = 1; function bar() { var y = 2; console.log(x); // 1 (function `bar` closes over `x`) console.log(y); // 2 (`y` is in
scope) } bar(); console.log(x); // 1 (`x` is in
scope) console.log(y); // referenceerror in strict mode, `y` is
scoped to `bar` } foo(); variables declared using var are created before any code is executed in a process known as hoisting.
...And 9 more matches
Appendix D: Loading Scripts - Archive of obsolete content
debuggable: development tools support debugging javascript loaded by script tags disadvantages scoping: scripts loaded via script tags share the global
scope with all other scripts loaded into the same window.
... these tags provide no means to load scripts into a private or otherwise specific
scope.
...additionally, as sandbox objects can be created with an arbitrary prototype object, the evaluated code can be given access to the global properties of any existing
scope.
...And 8 more matches
filter - CSS: Cascading Style Sheets
filter: blur(5px) <table class="standard-table"> <thead> <tr> <th style="text-align: left;"
scope="col">original image</th> <th style="text-align: left;"
scope="col">live example</th> <th style="text-align: left;"
scope="col">svg equivalent</th> <th style="text-align: left;"
scope="col">static example</th> </tr> </thead> <tbody> <tr> <td><img alt="test_form.jpg" id="img1" class="internal default" src="/files/3710/test_form_2.jpg" style="width: 100%;" /></td...
...sition: absolute; top: -99999px" xmlns="http://www.w3.org/2000/svg"> <filter id="brightness"> <fecomponenttransfer> <fefuncr type="linear" slope="[amount]"/> <fefuncg type="linear" slope="[amount]"/> <fefuncb type="linear" slope="[amount]"/> </fecomponenttransfer> </filter> </svg> <table class="standard-table"> <thead> <tr> <th style="text-align: left;"
scope="col">original image</th> <th style="text-align: left;"
scope="col">live example</th> <th style="text-align: left;"
scope="col">svg equivalent</th> <th style="text-align: left;"
scope="col">static example</th> </tr> </thead> <tbody> <tr> <td><img alt="test_form.jpg" id="img1" class="internal default" src="/files/3708/test_form.jpg" style="width: 100%;" /></td> ...
...enttransfer> <fefuncr type="linear" slope="[amount]" intercept="-(0.5 * [amount]) + 0.5"/> <fefuncg type="linear" slope="[amount]" intercept="-(0.5 * [amount]) + 0.5"/> <fefuncb type="linear" slope="[amount]" intercept="-(0.5 * [amount]) + 0.5"/> </fecomponenttransfer> </filter> </svg> <table class="standard-table"> <thead> <tr> <th style="text-align: left;"
scope="col">original image</th> <th style="text-align: left;"
scope="col">live example</th> <th style="text-align: left;"
scope="col">svg equivalent</th> <th style="text-align: left;"
scope="col">static example</th> </tr> </thead> <tbody> <tr> <td><img alt="test_form_3.jpeg" id="img1" class="internal default" src="/files/3712/test_form_3.jpeg" style="width: 100%;" />...
...And 8 more matches
Grammar and types - JavaScript
let declares a block-
scoped, local variable, optionally initializing it to a value.
... const declares a block-
scoped, read-only named constant.
...this syntax can be used to declare a block-
scope local variable.
...And 8 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
80 closure codingscripting, glossary the binding which defines the
scope of execution.
... 172 global object codingscripting, glossary, needscontent a global object is an object that always exists in the global
scope.
... 173 global
scope codingscripting, glossary, needscontent in a programming environment, the global
scope is the
scope that contains, and is visible in, all other
scopes.
...And 7 more matches
Handling common JavaScript problems - Learn web development
are defined in the correct
scope, and you are not running into conflicts between items declared in different places (see function
scope and conflicts).
... confusion about this, in terms of what
scope it applies to, and therefore if its value is what you intended.
...for a light introduction; you should also study examples like this one, which shows a typical pattern of saving a this
scope to a separate variable, then using that variable in nested functions so you can be sure you are applying functionality to the correct this
scope.
...And 7 more matches
Rhino serialization
writing an object to a file can be done in a few lines of java code: fileoutputstream fos = new fileoutputstream(filename); scriptableoutputstream out = new scriptableoutputstream(fos,
scope); out.writeobject(obj); out.close(); here filename is the file to write to, obj is the object or function to write, and
scope is the top-level
scope containing obj.
... reading the serialized object back into memory is similarly simple: fileinputstream fis = new fileinputstream(filename); objectinputstream in = new scriptableinputstream(fis,
scope); object deserialized = in.readobject(); in.close(); again, we need the
scope to create our serialization stream class.
...javascript objects contain references to prototypes and to parent
scopes.
...And 7 more matches
How to embed the JavaScript engine
s, js_propertystub, js_deletepropertystub, js_propertystub, js_strictpropertystub, js_enumeratestub, js_resolvestub, js_convertstub, }; int main(int argc, const char *argv[]) { jsruntime *rt = js_newruntime(8l * 1024 * 1024, js_use_helper_threads); if (!rt) return 1; jscontext *cx = js_newcontext(rt, 8192); if (!cx) return 1; { //
scope for our various stack objects (jsautorequest, rootedobject), so they all go // out of
scope before we js_destroycontext.
... jsautorequest ar(cx); // in practice, you would want to exit this any // time you're spinning the event loop js::rootedobject global(cx, js_newglobalobject(cx, &global_class, nullptr)); if (!global) return 1; js::rootedvalue rval(cx); { //
scope for jsautocompartment jsautocompartment ac(cx, global); js_initstandardclasses(cx, global); const char *script = "'hello'+'world, it is '+new date()"; const char *filename = "noname"; int lineno = 1; bool ok = js_evaluatescript(cx, global, script, strlen(script), filename, lineno, rval.address()); if (!ok) return 1; } jsstring *str = rval.tostring(); printf("%s\n", js_encodestring(cx, str)); }...
..., js_enumeratestub, js_resolvestub, js_convertstub, nullptr, nullptr, nullptr, nullptr, js_globalobjecttracehook }; int main(int argc, const char *argv[]) { js_init(); jsruntime *rt = js_newruntime(8l * 1024 * 1024, js_use_helper_threads); if (!rt) return 1; jscontext *cx = js_newcontext(rt, 8192); if (!cx) return 1; { //
scope for our various stack objects (jsautorequest, rootedobject), so they all go // out of
scope before we js_destroycontext.
...And 7 more matches
Invariants
but note that a stack frame is not necessarily newer than the next stack frame down, thanks to generators!) an object's
scope chain (found by chasing jsobject::fslots[jsslot_parent]) never forms a cycle.
...js_setparent can violate this, if the application is really that dumb, but generally every object is newer than its __parent__.) the tracejit must not trace into a function whose
scope chain ends in a different global object.
...even if the function is native, there is serious trouble: js_newobject with null parent argument calculates the parent from cx->fp->
scopechain, which can be stale if we're on trace.) the chain of properties starting at any jsshape and chasing jsshape::parent never forms a cycle and does not contain any duplicate js
scopeproperty::slot values other than -1.
...And 7 more matches
Using IndexedDB - Web APIs
the method accepts two parameters: the storenames (the
scope, defined as an array of object stores that you want to access) and the mode (readonly or readwrite) for the transaction.
... you can speed up data access by using the right
scope and mode in the transaction.
... here are a couple of tips: when defining the
scope, specify only the object stores you need.
...And 7 more matches
Closures - JavaScript
in other words, a closure gives you access to an outer function’s
scope from an inner function.
...nested functions have access to variables declared in their outer
scope.
...this environment consists of any local variables that were in-
scope at the time the closure was created.
...And 7 more matches
HTML table advanced features and accessibility - Learn web development
the
scope attribute a new topic for this article is the
scope attribute, which can be added to the <th> element to tell screenreaders exactly what cells the header is a header for — is it a header for the row it is in, or the column, for example?
... looking back to our spending record example from earlier on, you could unambiguously define the column headers as column headers like this: <thead> <tr> <th
scope="col">purchase</th> <th
scope="col">location</th> <th
scope="col">date</th> <th
scope="col">evaluation</th> <th
scope="col">cost (€)</th> </tr> </thead> and each row could have a header defined like this (if we added row headers as well as column headers): <tr> <th
scope="row">haircut</th> <td>hairdresser</td> <td>12/09</td> <td>great idea</td> <td>30</td> </tr> screenreaders will recognize markup structured like this, and allow their users to read out the entire column or row at once, for example.
...
scope has two more possible values — colgroup and rowgroup.
...And 6 more matches
Tutorial: Embedding Rhino
initializing standard objects the code scriptable
scope = cx.initstandardobjects(); initializes the standard objects (object, function, etc.) this must be done before scripts can be executed.
... the null parameter tells initstandardobjects to create and return a
scope object that we use in later calls.
... string s = ""; for (int i=0; i < args.length; i++) { s += args[i]; } evaluating a script the code object result = cx.evaluatestring(
scope, s, "<cmd>", 1, null); uses the context cx to evaluate a string.
...And 6 more matches
Functions
when the function object is created, its parent is set to the first object on the
scope chain.
... when a name is evaluated that doesn't refer to a local variable, the interpreter consults the
scope chain to find the variable.
...this is slow, not only because walking the
scope chain is a drag, but also because we'd rather avoid actually creating the
scope chain at all, if possible.
...And 6 more matches
Components.utils.import
components.utils.import was introduced in firefox 3 and is used for sharing code between different
scopes easily.
... syntax components.utils.import(url [,
scope]); // or, if you use a tool such as jslint which reports compiler errors for the above, components.utils["import"](url [,
scope]); parameters url a string of the url of the script to be loaded.
...
scope an optional object to import onto; if omitted, the global object is used.
...And 6 more matches
nsIMsgSearchSession
to create an instance, use: var searchsession = components.classes["@mozilla.org/messenger/searchsession;1"] .createinstance(components.interfaces.nsimsgsearchsession); to use the instance append search terms, set the
scope, and then call search().
... searchsession.add
scopeterm(components.interfaces.nsmsgsearch
scope.offlinemail, afolder); var searchterm = searchsession.createterm(); var value = searchterm.value; value.str = avalue; searchterm.value = value; searchterm.op = searchsession.booleanor; searchterm.booleanand = false; searchsession.appendterm(searchterm); searchsession.search(null); inherits from: nsisupports method overview void addsearchterm(in nsmsgsearchattribvalue attrib, in nsmsgsearchopvalue op, in nsimsgsearchvalue value, in boolean booleanand, in string arbitraryheader); nsimsgsearchterm createterm(); void appendterm(in nsimsgsearchterm term); void registerlistener(in nsimsgsearchnotify listener); void unregisterlistener(in nsimsgsearchnotify listener); void getn...
...thsearchterm(in long whichterm, in nsmsgsearchattribvalue attrib, in nsmsgsearchopvalue op, in nsimsgsearchvalue value); long countsearch
scopes(); void getnthsearch
scope(in long which,out nsmsgsearch
scopevalue
scopeid, out nsimsgfolder folder); void add
scopeterm(in nsmsgsearch
scopevalue
scope, in nsimsgfolder folder); void adddirectory
scopeterm(in nsmsgsearch
scopevalue
scope); void clear
scopes(); [noscript] boolean
scopeusescustomheaders(in nsmsgsearch
scopevalue
scope, in voidptr selection, in boolean forfilters); boolean isstringattribute(in nsmsgsearchattribvalue attrib); void addall
scopes(in nsmsgsearch
scopevalue attrib); void search(in nsimsgwindow awindow); void interruptsearch(); void pause...
...And 6 more matches
Debugger - Firefox Developer Tools
onnewscript(script,global) new code, represented by the debugger.script instancescript, has been loaded in the
scope of the debuggees.
... onnewpromise(promise) a new promise object, referenced by the debugger.object instance promise, has been allocated in the
scope of the debuggees.
... onpromisesettled(promise) a promise object, referenced by the debugger.object instance promise that was allocated within a debuggee
scope, has settled (either fulfilled or rejected).
...And 6 more matches
Using Service Workers - Web APIs
if successful, the service worker is executed in a serviceworkerglobal
scope; this is basically a special kind of worker context, running off the main script execution thread, with no dom access.
... if ('serviceworker' in navigator) { navigator.serviceworker.register('./sw-test/sw.js', {
scope: './sw-test/'}) .then((reg) => { // registration worked console.log('registration succeeded.
...
scope is ' + reg.
scope); }).catch((error) => { // registration failed console.log('registration failed with ' + error); }); } the outer block performs a feature detection test to make sure service workers are supported before trying to register one.
...And 6 more matches
itemtype - HTML: Hypertext Markup Language
item
scope is used to set the
scope of where in the data structure the vocabulary set by itemtype will be active.
... the itemtype attribute can only be specified on elements which have an item
scope attribute specified.
... the itemid attribute can only be specified on elements which have both an item
scope attribute and an itemtype attribute specified.
...And 6 more matches
Functions - JavaScript
function expressions are not hoisted onto the beginning of the
scope, therefore they cannot be used before they appear in the code.
... on the other hand, the variable the function is assigned to is limited only by its
scope, which is guaranteed to include the
scope in which the function is declared.
...thus, unlike those defined by function expressions, functions defined by function declarations can be accessed by their name in the
scope they were defined in: a function defined by 'new function' does not have a function name.
...And 6 more matches
Interacting with page scripts - Archive of obsolete content
but sometimes, you will want to share objects between the two
scopes.
...instead, you need to use the global cloneinto() function to clone the object into the page script's
scope.
...this means that you can't expose a function to a page script using cloneinto(), and if you clone an object into the page script
scope, its methods will not be available to the page script.
...And 5 more matches
HTTP Cache
– after it returns, all entries are no longer accessible through the cache apis; the method is fast to execute and non-blocking in any way; the actual erase happens in background purgefrommemory – removes (schedules to remove) any intermediate cache data held in memory for faster access (more about the intermediate cache below) nsiloadcontextinfo distinguishes the
scope of the storage demanded to open.
... represents a distinct storage area (or
scope) to put and get cache entries mapped by urls into and from it.
... adding a new storage should there be a need to add a new distinct storage for which the current scoping model would not be sufficient - use one of the two following ways: [preffered] add a new <your>storage method on nsicachestorageservice and if needed give it any arguments to specify the storage
scope even more.
...And 5 more matches
JS_ExecuteScript
syntax bool js_executescript(jscontext *cx, js::handlescript script, js::mutablehandlevalue rval); // added in spidermonkey 45 bool js_executescript(jscontext *cx, js::handlescript script); // added in spidermonkey 45 bool js_executescript(jscontext *cx, js::autoobjectvector &
scopechain, js::handlescript script, js::mutablehandlevalue rval); // added in spidermonkey 36 bool js_executescript(jscontext *cx, js::autoobjectvector &
scopechain, js::handlescript script); // added in spidermonkey 36 bool js_executescript(jscontext *cx, js::handleobject obj, js::handlescript script, js::mutablehandlevalue rval); // obsolete since jsapi 39 bool js_executescript(jscontext *cx, js::handleobject obj, js:...
... obj js::handleobject the
scope in which to execute the script.
...instead: the
scope chain is initialized to contain obj, followed by its parent, then its parent's parent, etc.
...And 5 more matches
HTMLTableCellElement - Web APIs
htmltablecellelement.
scope a domstring indicating the
scope of a <th> cell.
... header cells can be configured, using the
scope property, the apply to a specified row or column, or to the not-yet-
scoped cells within the current row group (that is, the same ancestor <thead>, <tbody>, or <tfoot> element).
... if no value is specified for
scope, the header is not associated directly with cells in this way.
...And 5 more matches
delete operator - JavaScript
any property declared with var cannot be deleted from the global
scope or from a function's
scope.
... as such, delete cannot delete any functions in the global
scope (whether this is part from a function definition or a function expression).
... functions which are part of an object (apart from the global
scope) can be deleted with delete.
...And 5 more matches
Modules - Archive of obsolete content
to improve encapsulation, each module should be defined in the
scope of its own global object.
...xulrunner adds a built-in object, known as components, to the global
scope.
...a complete explanation of how to use components is out of
scope for this document.
...And 4 more matches
AddonManager
installation
scopes constant value description
scope_all 15 a combination of all the installation
scopes.
...
scope_application 4 this add-on is a part of the current application (installed and owned by firefox).
...
scope_profile 1 this add-on is installed in the current profile directory.
...And 4 more matches
Basic concepts - Web APIs
a database connection can have several active transactions associated with it at a time, so long as the writing transactions do not have overlapping
scopes.
... the
scope of transactions, which is defined at creation, determines which object stores the transaction can interact with and remains constant for the lifetime of the transaction.
... so, for example, if a database connection already has a writing transaction with a
scope that just covers the flyingmonkey object store, you can start a second transaction with a
scope of the unicorncentaur and unicornpegasus object stores.
...And 4 more matches
Microdata - HTML: Hypertext Markup Language
to create an item, the item
scope attribute is used.
... itemref – properties that are not descendants of an element with the item
scope attribute can be associated with the item using an itemref.
... item
scope – item
scope (usually) works along with itemtype to specify that the html contained in a block is about a particular item.
...And 4 more matches
block - JavaScript
examples block scoping rules with var or function declaration in non-strict mode variables declared with var or created by function declarations in non-strict mode do not have block
scope.
... variables introduced within a block are
scoped to the containing function or script, and the effects of setting them persist beyond the block itself.
... in other words, block statements do not introduce a
scope.
...And 4 more matches
with - JavaScript
the with statement extends the
scope chain for a statement.
... syntax with (expression) statement expression adds the given expression to the
scope chain used when evaluating the statement.
... description javascript looks up an unqualified name by searching a
scope chain associated with the execution context of the script or function containing that unqualified name.
...And 4 more matches
Browser chrome tests
it currently allows you to run javascript code in the same
scope as the main firefox browser window and report results using the same functions as the mochitest test framework.
... writing browser chrome tests browser chrome tests are snippets of javascript code that run in the browser window's global
scope.
...since the test files are executed in the same
scope as the browser window, conflicting variable names could cause trouble while running the tests.
...And 3 more matches
JSAPI reference
on_ecma_3 jsversion_1_6 jsversion_1_7 jsversion_1_8 jsversion_ecma_5 jsversion_default jsversion_unknown jsversion_latest js_getimplementationversion js_getversion js_setversionforcompartment added in spidermonkey 31 js_stringtoversion js_versiontostring js_setversion obsolete since jsapi 25 js::currentglobalornull added in spidermonkey 31 js_getglobalfor
scopechain obsolete since jsapi 25 js_getglobalobject obsolete since jsapi 24 js_setglobalobject obsolete since jsapi 25 js_initclass js_initstandardclasses js_resolvestandardclass js_enumeratestandardclasses js_enumerateresolvedstandardclasses obsolete since jsapi 24 js_isrunning js_saveframechain js_restoreframechain js_isassigning obsolete since javascript 1.8.5 js_isconstruc...
...ting obsolete since jsapi 26 js_isconstructing_possiblywithgiventhisobject obsolete since jsapi 17 js_get
scopechain obsolete since javascript 1.8.7 compartments: class jsautocompartment added in spidermonkey 24 js_newglobalobject added in spidermonkey 17 js_entercompartment added in spidermonkey 24 js_leavecompartment added in spidermonkey 24 js_getcompartmentprivate added in spidermonkey 1.8.5 js_setcompartmentprivate added in spidermonkey 1.8.5 js_getglobalforcompartmentornull added in spidermonkey 17 js_iteratecompartments added in spidermonkey 17 js_setdestroycompartmentcallback added in spidermonkey 17 js_setcompartmentnamecallback added in spidermonkey 17 js_newcompartmentandglobalobject added in spidermonkey 1.8.1 obsolete since jsapi 16 js_entercrosscompartmentcal...
...lete since jsapi 31 js_addroot obsolete since javascript 1.8.5 js_addnamedroot obsolete since javascript 1.8.5 js_addnamedrootrt obsolete since javascript 1.8.5 js_removeroot obsolete since javascript 1.8.5 js_removerootrt obsolete since javascript 1.8.5 js_mapgcroots obsolete since jsapi 19 jsgcmaprootfun obsolete since jsapi 19 js_dumpnamedroots obsolete since jsapi 19 local root
scopes were another way of protecting objects from the garbage collector.
...And 3 more matches
SpiderMonkey 1.8.5
the approach eliminates the need for the js_enterlocalroot
scope api, and in many cases the need to explicitly root gc things or use the "root as you go" approach popular with earlier spidermonkey releases.
...executeregexp js_executeregexpnostatics js_executescriptversion js_forget_string_flatness js_fileescapedstring js_finishjsonparse (removed in future releases, replaced with js_parsejson) js_flatstringequalsascii js_flattenstring js_flushcaches js_freezeobject js_getcompartmentprivate js_getemptystring js_getflatstringchars js_getgcparameter js_getgcparameterforthread js_getglobalfor
scopechain js_getinternedstringchars js_getinternedstringcharsandlength js_getownpropertydescriptor js_getpropertyattrsgetterandsetterbyid js_getpropertybyid js_getpropertybyiddefault js_getpropertydefault js_getpropertydescriptorbyid js_getruntimesecuritycallbacks js_getsecuritycallbacks js_getstringcharsandlength js_getstringcharsz js_getstringcharszandlength js_getstringencodinglength ...
... jsautorequest jsautosuspendrequest jsautocheckrequest jsautoentercompartment js::anchor<> js::call obsolete apis js_clearnewbornroots js_enterlocalroot
scope js_leavelocalroot
scope js_leavelocalroot
scopewithresult js_forgetlocalroot js_newgrowablestring deleted apis js_addnamedroot – use js_add*root js_addnamedrootrt – use js_add*root js_addroot – use js_add*root js_clearnewbornroots – no longer needed js_clearoperationcallback js_clearregexproots js_decompilescript js_destroyscript js_enterlocalroot
scope js_executescriptpart ...
...And 3 more matches
Components.utils.cloneInto
this function provides a safe way to take an object defined in a privileged
scope and create a structured clone of it in a less-privileged
scope.
... it returns a reference to the clone: var clonedobject = cloneinto(myobject, targetwindow); you can then assign the clone to an object in the target
scope as an expando property, and scripts running in that
scope can access it: targetwindow.foo = clonedobject; in this way privileged code, such as an add-on, can share an object with less-privileged code like a normal web page script.
... syntax components.utils.cloneinto(obj, target
scope[, options]); parameters obj : object the object to clone.
...And 3 more matches
Components.utils
createobjectin() creates a new object, created in the
scope of the specified object's compartment.
... exportfunction() export a javascript function from a more-privileged to a less-privileged
scope, allowing it to be called in the less-privileged
scope.
... getcomponentsfor
scope() this seemingly-paradoxical api allows privileged code to explicitly give unprivileged code a reference to its own components object (whereas it's normally hidden away on a
scope chain visible only to xbl methods).
...And 3 more matches
Language bindings
its interface is defined at js/xpconnect/idl/xpccomponents.idl.components.utils.cloneintothis function provides a safe way to take an object defined in a privileged
scope and create a structured clone of it in a less-privileged
scope.
... it returns a reference to the clone:components.utils.createobjectincomponents.utils.createobjectin creates a new javascript object in the
scope of the specified object's compartment.components.utils.evalinsandboxthe evalinsandbox() function enables you to evaluate javascript code inside a sandbox you've previously created using the components.utils.sandbox constructor.components.utils.evalinwindowthis function enables code running in a more-privileged javascript context to evaluate a string in a less-privileged javascript context.
... this is useful for privileged code, such as add-on code, to access variables and apis defined in web content.components.utils.exportfunctionthis function provides a safe way to expose a function from a privileged
scope to a less-privileged
scope.components.utils.forcegccomponents.utils.forcegc lets scripts force a garbage collection cycle.
...And 3 more matches
nsIFrameScriptLoader
methods void loadframescript(in astring aurl, in boolean aallowdelayedload, [optional] in boolean aruninglobal
scope) void removedelayedframescript(in astring aurl); jsval getdelayedframescripts(); loadframescript() load a script in the remote frame.
... aruninglobal
scope boolean optional, defaults to false.
... by default, frame scripts each have their own
scope, so they can declare global variables without causing conflicts with any other frame scripts.
...And 3 more matches
Working with windows in chrome code
using javascript code modules javascript code modules is a simple method for creating shared global singleton objects that can be imported into any other javascript
scope.
... the importing
scope will have access to the objects and data in the code module.
... since the code module is cached, all
scopes get the same instance of the code module and can share the data in the module.
...And 3 more matches
Debugger.Object - Firefox Developer Tools
this accessor returns whatever name appeared after the function keyword in the source code, regardless of whether the function is the result of instantiating a function declaration (which binds the function to its name in the enclosing
scope) or evaluating a function expression (which binds the function to its name only within the function’s body).
... global a debugger.object instance referring to the global object in whose
scope the referent was allocated.
...(this function behaves like the standard object.getownpropertydescriptor function, except that the object being inspected is implicit; the property descriptor returned is allocated as if by code
scoped to the debugger’s global object (and is thus in the debugger’s compartment); and its value, get, and set properties, if present, are debuggee values.) getownpropertynames() return an array of strings naming all the referent’s own properties, as if object.getownpropertynames(referent) had been called in the debuggee, and the result copied in the
scope of the debugger’s global object.
...And 3 more matches
EventTarget.addEventListener() - Web APIs
getting data into an event listener using the outer
scope property when an outer
scope contains a variable declaration (with const, let), all the inner functions declared in that
scope have access to that variable (look here for information on outer/inner functions, and here for information on variable
scope).
... therefore, one of the simplest ways to access data from outside of an event listener is to make it accessible to the
scope in which the event listener is declared.
... const mybutton = document.getelementbyid('my-button-id'); const somestring = 'data'; mybutton.addeventlistener('click', function() { console.log(somestring); // expected value: 'data' somestring = 'data again'; }); console.log(somestring); // expected value: 'data' (will never output 'data again') note: although inner
scopes have access to const, let variables from outer
scopes, you cannot expect any changes to these variables to be accessible after the event listener definition, within the same outer
scope.
...And 3 more matches
Functions and classes available to Web Workers - Web APIs
workers run in another global context, dedicatedworkerglobal
scope, different from the current window.
... by default, methods and properties of window are not available to them, but dedicatedworkerglobal
scope, like window, implements windowtimers and windowbase64.
... comparison of the properties and methods of the different type of workers function dedicated workers shared workers service workers chrome workers outside workers atob() yes, on workerglobal
scope yes, on workerglobal
scope yes, on workerglobal
scope yes, on workerglobal
scope yes, on window btoa() yes, on workerglobal
scope yes, on workerglobal
scope yes, on workerglobal
scope yes, on workerglobal
scope yes, on window clearinterval() yes, on workerglobal
scope yes, on workerglobal
scope yes, on workerglobal
scope yes, on workerglobal
scope yes, on window cleartimeout() yes, on workerglobal
scope yes, on workerglobal
scope yes, on workerglobal
scope yes, on workerglobal
scope yes, on win...
...And 3 more matches
ARIA: grid role - Accessibility
<table role="grid" aria-labelledby="id-select-your-seat"> <caption id="id-select-your-seat">select your seat</caption> <tbody role="presentation"> <tr role="presentation"> <td></td> <th>row a</th> <th>row b</th> </tr> <tr> <th
scope="row">aisle 1</th> <td tabindex="0"> <button id="1a" tabindex="-1">1a</button> </td> <td tabindex="-1"> <button id="1b" tabindex="-1">1b</button> </td> <!-- more columns --> </tr> <tr> <th
scope="row">aisle 2</th> <td tabindex="-1"> <button id="2a" tabindex="-1">2a</button> </td> <td tabindex="-1"> <butt...
...r" aria-label="monday">m</th> <th role="columnheader" aria-label="tuesday">t</th> <th role="columnheader" aria-label="wednesday">w</th> <th role="columnheader" aria-label="thursday">t</th> <th role="columnheader" aria-label="friday">f</th> <th role="columnheader" aria-label="saturday">s</th> </tr> </thead> <tbody role="rowgroup"> <tr role="row"> <th
scope="row" role="rowheader">week 35</th> <td>26</td> <td>27</td> <td>28</td> <td>29</td> <td>30</td> <td>31</td> <td role="gridcell" tabindex="-1">1</td> </tr> <tr role="row"> <th
scope="row" role="rowheader">week 36</th> <td role="gridcell" tabindex="-1"> 2 </td> <td role="gridcell" tabindex="-1"> 3 </t...
...d> <td role="gridcell" tabindex="-1"> 4 </td> <td role="gridcell" tabindex="-1"> 5 </td> <td role="gridcell" tabindex="-1"> 6 </td> <td role="gridcell" tabindex="-1"> 7 </td> <td role="gridcell" tabindex="-1"> 8 </td> </tr> <tr role="row"> <th
scope="row" role="rowheader">week 37</th> <td role="gridcell" tabindex="-1"> 9 </td> <td role="gridcell" tabindex="-1"> 10 </td> <td role="gridcell" tabindex="-1"> 11 </td> <td role="gridcell" tabindex="-1"> 12 </td> <td role="gridcell" tabindex="-1"> 13 </td> <td role="gridcell" tabindex="-1"> 14 </td> <td role="gridce...
...And 3 more matches
HTML attribute reference - HTML: Hypertext Markup Language
scope <th> defines the cells that the header test (defined in the th element) relates to.
...
scoped <style> selected <option> defines a value which will be selected on page load.
...the following examples are valid ways to mark up a boolean attribute: <div item
scope> this is valid html but invalid xml.
...And 3 more matches
<table>: The Table element - HTML: Hypertext Markup Language
mdn adding a caption to your table with <caption> caption & summary • tables • w3c wai web accessibility tutorials scoping rows and columns the
scope attribute on header elements is redundant in simple contexts, because
scope is inferred.
... however, some assistive technologies may fail to draw correct inferences, so specifying header
scope may improve user experiences.
... in complex tables,
scope can be specified so as to provide necessary information about the cells related to a header.
...And 3 more matches
<tr>: The Table Row element - HTML: Hypertext Markup Language
<table> <thead> <tr> <th rowspan="2">name</th> <th rowspan="2">id</th> <th colspan="2">membership dates</th> <th rowspan="2">balance</th> </tr> <tr> <th>joined</th> <th>canceled</th> </tr> </thead> <tbody> <tr> <th
scope="row">margaret nguyen</td> <td>427311</td> <td><time datetime="2010-06-03">june 3, 2010</time></td> <td>n/a</td> <td>0.00</td> </tr> <tr> <th
scope="row">edvard galinski</td> <td>533175</td> <td><time datetime="2011-01013">january 13, 2011</time></td> <td><time datetime="2017-04008">april 8, 2017</time></td> <td>37.00</td> </tr> ...
... <tr> <th
scope="row">hoshi nakamura</td> <td>601942</td> <td><time datetime="2012-07-23">july 23, 2012</time></td> <td>n/a</td> <td>15.00</td> </tr> </tbody> </table> the differences that matter here—for the purposes of discussing row and column spans—are in the first few lines of the code above.
... <table> <thead> <tr> <th rowspan="2">name</th> <th rowspan="2">id</th> <th colspan="2">membership dates</th> <th rowspan="2">balance</th> </tr> <tr> <th>joined</th> <th>canceled</th> </tr> </thead> <tbody> <tr> <th
scope="row">margaret nguyen</td> <td>427311</td> <td><time datetime="2010-06-03">june 3, 2010</time></td> <td>n/a</td> <td>0.00</td> </tr> <tr> <th
scope="row">edvard galinski</td> <td>533175</td> <td><time datetime="2011-01013">january 13, 2011</time></td> <td><time datetime="2017-04008">april 8, 2017</time></td> <td>37.00</td> </tr> ...
...And 3 more matches
How to build custom form controls - Learn web development
note: we'll focus on building the control, not on how to make the code generic and reusable; that would involve some non-trival javascript code and dom manipulation in an unknown context, and that is out of the
scope of this article.
...ion (select) { // as well as all its `option` elements var optionlist = select.queryselectorall('.option'); // each time a user hovers their mouse over an option, we highlight the given option optionlist.foreach(function (option) { option.addeventlistener('mouseover', function () { // note: the `select` and `option` variable are closures // available in the
scope of our function call.
... highlightoption(select, option); }); }); // each times the user clicks on or taps a custom select element select.addeventlistener('click', function (event) { // note: the `select` variable is a closure // available in the
scope of our function call.
...And 2 more matches
Script security
objects in a privileged
scope are allowed complete access to objects in a less privileged
scope, but by default they see a restricted view of such objects, designed to prevent them from being tricked by the untrusted code.
... an example of this
scope is chrome-privileged javascript accessing web content.
... objects in a less privileged
scope don't get any access to objects in a more privileged
scope, unless the more privileged
scope explicitly clones those objects.
...And 2 more matches
JSAPI User Guide
if a function creates new objects, strings, or numbers, it can use js_enterlocalroot
scope and js_leavelocalroot
scope to keep those values alive for the duration of the function.
...*/ my_addproperty, my_delproperty, my_getproperty, my_setproperty, my_enumerate, my_resolve, my_convert, my_finalize }; jsobject *obj; /* * define an object named in the global
scope that can be enumerated by * for/in loops.
...they are defined in the constructor object's
scope, so that myclass.mystaticprop works along with new myclass().
...And 2 more matches
JS_ForgetLocalRoot
remove a value from the innermost current local root
scope.
... description this function is used to interact with
scoped local root management.
... see js_enterlocalroot
scope for more on this topic.
...And 2 more matches
JS_SetOptions
mxr id search for jsoption_werror jsoption_varobjfix make js_evaluatescript() use the last object on its obj param's
scope chain (that is, the global object) as the ecma "variables object".
... without it, the two scripts "x = 1" and "var x = 1", where no variable x is in
scope, do two different things.
... mxr id search for jsoption_private_is_nsisupports jsoption_compile_n_go caller of js_compilescript et al promises to execute the compiled script once only, in the same
scope object used for compilation.
...And 2 more matches
SpiderMonkey 1.8.7
the approach eliminates the need for the js_enterlocalroot
scope api, and in many cases the need to explicitly root gc things or use the "root as you go" approach popular with earlier spidermonkey releases.
...executeregexp js_executeregexpnostatics js_executescriptversion js_forget_string_flatness js_fileescapedstring js_finishjsonparse (removed in future releases, replaced with js_parsejson) js_flatstringequalsascii js_flattenstring js_flushcaches js_freezeobject js_getcompartmentprivate js_getemptystring js_getflatstringchars js_getgcparameter js_getgcparameterforthread js_getglobalfor
scopechain js_getinternedstringchars js_getinternedstringcharsandlength js_getownpropertydescriptor js_getpropertyattrsgetterandsetterbyid js_getpropertybyid js_getpropertybyiddefault js_getpropertydefault js_getpropertydescriptorbyid js_getruntimesecuritycallbacks js_getsecuritycallbacks js_getstringcharsandlength js_getstringcharsz js_getstringcharszandlength js_getstringencodinglength ...
... jsautorequest jsautosuspendrequest jsautocheckrequest jsautoentercompartment js::anchor<> js::call obsolete apis js_clearnewbornroots js_enterlocalroot
scope js_leavelocalroot
scope js_leavelocalroot
scopewithresult js_forgetlocalroot js_newgrowablestring deleted apis js_get
scopechain use js_getglobalfor
scopechain api changes operation callback js_setoperationcallback was introduced in js 1.8.0, replacing the branch callback, in anticipation of the addition of the tracing jit (tracemonkey).
...And 2 more matches
Components.utils.importGlobalProperties
imports various objects into a system
scope.
... system
scopes such as jsms and frame scripts don't have certain objects, such as indexeddb and xmlhttprequest, that are available to dom window globals.
... using this api you can import these objects into such a system
scope.
...And 2 more matches
mozIJSSubScriptLoader
targetobj the object to use as the
scope object for the script being executed.
... note that let and const declarations in the script will be placed on a syntactic
scope that is not an object at all, and will not be available to the caller of loadsubscript.
...this object will be searched for variables that cannot be resolved in the subscript
scope.
...And 2 more matches
nsIMsgSearchCustomTerm
* * @param
scope search
scope (nsmsgsearch
scope) * @param op search operator (nsmsgsearchop).
... * * @return true if enabled */ boolean getenabled(in nsmsgsearch
scopevalue
scope, in nsmsgsearchopvalue op); getavailable /** * is this custom term available?
... * * @param
scope search
scope (nsmsgsearch
scope) * @param op search operator (nsmsgsearchop).
...And 2 more matches
Microdata DOM API - Web APIs
each item is represented in the dom by the element on which the relevant item
scope attribute is found.
... these elements have their element.item
scope idl attribute set to true.
... the type(s) of items can be obtained using the element.itemtype idl attribute on the element with the item
scope attribute.
...And 2 more matches
Sensor APIs - Web APIs
for example, the gyro
scope interface corresponds exactly to a physical device interface.
... if (typeof gyro
scope === "function") { // run in circles...
... sensor permissions sensor permission/feature policy name absoluteorientationsensor 'accelerometer', 'gyro
scope', and 'magnetometer' accelerometer 'accelerometer' ambientlightsensor 'ambient-light-sensor' gyro
scope 'gyro
scope' linearaccelerationsensor 'accelerometer' magnetometer 'magnetometer' relativeorientationsensor 'accelerometer', and 'gyro
scope' readings sensor readings are received through the sensor.onreading callback ...
...And 2 more matches
onnotificationclose - Web APIs
the serviceworkerglobal
scope.onnotificationclose property is an event handler called whenever the notificationclose event is dispatched on the serviceworkerglobal
scope object, that is when a user closes a displayed notification spawned by serviceworkerregistration.shownotification().
... note: trying to create a notification inside the serviceworkerglobal
scope using the notification() constructor will throw an error.
... syntax serviceworkerglobal
scope.onnotificationclose = function(notificationevent) { ...
...And 2 more matches
Web Authentication API - Web APIs
the protocol and format of this request is outside of the
scope of the web authentication api.
...the protocol for communicating with the server is not specified and is outside of the
scope of the web authentication api.
...the protocol and format of this request is outside of the
scope of the web authentication api.
...And 2 more matches
Web Workers API - Web APIs
this context is represented by either a dedicatedworkerglobal
scope object (in the case of dedicated workers - workers that are utilized by a single script), or a sharedworkerglobal
scope (in the case of shared workers - workers that are shared between multiple scripts).
... workerglobal
scope represents the generic
scope of any worker (doing the same job as window does for normal web content).
... different types of worker have
scope objects that inherit from this interface and add more specific features.
...And 2 more matches
Web APIs
nt animationplaybackevent animationtimeline arraybufferview attr audiobuffer audiobuffersourcenode audioconfiguration audiocontext audiocontextlatencycategory audiocontextoptions audiodestinationnode audiolistener audionode audionodeoptions audioparam audioparamdescriptor audioparammap audioprocessingevent audioscheduledsourcenode audiotrack audiotracklist audioworklet audioworkletglobal
scope audioworkletnode audioworkletnodeoptions audioworkletprocessor authenticatorassertionresponse authenticatorattestationresponse authenticatorresponse b baseaudiocontext basiccardrequest basiccardresponse batterymanager beforeinstallpromptevent beforeunloadevent biquadfilternode blob blobbuilder blobevent bluetooth bluetoothadvertisingdata bluetoothcharacteristicproperties blueto...
...vent d domconfiguration domerror domexception domhighrestimestamp domimplementation domimplementationlist domlocator dommatrix dommatrixreadonly domobject domparser dompoint dompointinit dompointreadonly domquad domrect domrectreadonly domstring domstringlist domstringmap domtimestamp domtokenlist domuserdata datatransfer datatransferitem datatransferitemlist dedicatedworkerglobal
scope delaynode deprecationreportbody devicelightevent devicemotionevent devicemotioneventacceleration devicemotioneventrotationrate deviceorientationevent deviceproximityevent directoryentrysync directoryreadersync displaymediastreamconstraints document documentfragment documentorshadowroot documenttimeline documenttouch documenttype doublerange dragevent dynamicscompressornode e ext_bl...
...lesystementrysync filesystemfileentry filesystemflags filesystemsync focusevent fontface fontfaceset fontfacesetloadevent formdata formdataentryvalue formdataevent fullscreenoptions g gainnode gamepad gamepadbutton gamepadevent gamepadhapticactuator geolocation geolocationcoordinates geolocationposition geolocationpositionerror geometryutils gestureevent globaleventhandlers gyro
scope h htmlanchorelement htmlareaelement htmlaudioelement htmlbrelement htmlbaseelement htmlbasefontelement htmlbodyelement htmlbuttonelement htmlcanvaselement htmlcollection htmlcontentelement htmldlistelement htmldataelement htmldatalistelement htmldetailselement htmldialogelement htmldivelement htmldocument htmlelement htmlembedelement htmlfieldsetelement htmlfontelement htmlformcontrolsco...
...And 2 more matches
Global attributes - HTML: Hypertext Markup Language
itemref properties that are not descendants of an element with the item
scope attribute can be associated with the item using an itemref.
... item
scope item
scope (usually) works along with itemtype to specify that the html contained in a block is about a particular item.
... item
scope creates the item and defines the
scope of the itemtype associated with it.
...And 2 more matches
Control flow and error handling - JavaScript
important: javascript before ecmascript2015 (6th edition) does not have block
scope!
... in older javascript, variables introduced within a block are
scoped to the containing function or script, and the effects of setting them persist beyond the block itself.
... in other words, block statements do not define a
scope.
...And 2 more matches
TypeError: invalid assignment to const "x" - JavaScript
examples invalid redeclaration assigning a value to the same constant name in the same block-
scope will throw.
...this constant name is already taken in this
scope.
...maybe you meant to declare a block-
scoped variable with let or global variable with var.
...And 2 more matches
ReferenceError: "x" is not defined - JavaScript
this variable needs to be declared, or you need to make sure it is available in your current script or
scope.
... var foo = 'bar'; foo.substring(1); // "ar" wrong
scope a variable needs to be available in the current context of execution.
... variables defined inside a function cannot be accessed from anywhere outside the function, because the variable is defined only in the
scope of the function function numbers() { var num1 = 2, num2 = 3; return num1 + num2; } console.log(num1); // referenceerror num1 is not defined.
...And 2 more matches
eval() - JavaScript
var expression = new string('2 + 2'); eval(expression.tostring()); // returns 4 if you use the eval function indirectly, by invoking it via a reference other than eval, as of ecmascript 5 it works in the global
scope rather than the local
scope.
... this means, for instance, that function declarations create global functions, and that the code being evaluated doesn't have access to local variables within the
scope where it's being called.
... function test() { var x = 2, y = 4; console.log(eval('x + y')); // direct call, uses local
scope, result is 6 var geval = eval; // equivalent to calling eval in the global
scope console.log(geval('x + y')); // indirect call, uses global
scope, throws referenceerror because `x` is undefined (0, eval)('x + y'); // another example of indirect call } never use eval()!
...And 2 more matches
loader/sandbox - Archive of obsolete content
usage create a sandbox to create a sandbox: const { sandbox, evaluate, load } = require("sdk/loader/sandbox"); let
scope = sandbox('http://example.com'); the argument passed to the sandbox defines its privileges.
... evaluate code module provides evaluate function that lets you execute code in the given sandbox: evaluate(
scope, 'var a = 5;'); evaluate(
scope, 'a + 2;'); //=> 7 more details about evaluated script may be passed via optional arguments that may improve exception reporting: // evaluate code as if it was loaded from 'http://foo.com/bar.js' and // start from 2nd line.
... evaluate(
scope, 'a ++', 'http://foo.com/bar.js', 2); version of javascript can be also specified via an optional argument: evaluate(
scope, 'let b = 2;', 'bar.js', 1, '1.5'); // throws cause `let` is not defined in js 1.5.
... load(
scope, 'resource://path/to/my/script.js'); load(
scope, 'file:///path/to/script.js'); load(
scope, 'data:,var a = 5;'); globals functions sandbox(source) make a new sandbox that inherits principals from source.
Jetpack Processes - Archive of obsolete content
privileged apis when script is evaluated in a jetpack process via a call to nsijetpack.evalscript(), the script's global
scope is endowed with the following privileged apis: sendmessage(amessagename [, v1 [, v2 [, ...]]]) similar to nsijetpack.sendmessage(), this function asynchronously sends a message to the chrome process.
...createsandbox() this creates a new javascript sandbox and returns its global
scope.
... this global
scope does not contain privileged apis, or any non-standard javascript objects for that matter, though new globals can be endowed by simply attaching them to the global
scope as properties.
... evalinsandbox(asandbox, ascript) evaluates the given script contents in the given sandbox's global
scope.
Appendix: What you should know about open-source software licenses - Archive of obsolete content
a license on a copyrighted work is a use permit that says “it’s ok to use this work within this
scope, as long as you follow these conditions.” those conditions could be something like “if you pay me money” or “you can print up to 10,000 copies.” software licenses software is subject to copyright law.
... software range of uses restricted to author unrestricted software license >> usable within permitted
scope restricted use within permitted
scope fixme: wow, the table is weird!
...
scope of modifications in the open-source world, “copyleft” is when you require that any modifications to your source code must also be released under the same terms.
...see the previously mentioned “
scope of modification.” using the same license as the existing work is a straightforward option.
Index - Archive of obsolete content
it currently allows you to run javascript code in the same
scope as the immersive browser and report results using the same functions as the mochitest test framework.
... 2029 debug.setnonusercodeexceptions debug, example, javascript, property, setnonusercodeexceptions if this property is set to true within a given
scope, the debugger can then choose whether to take some specified action on exceptions thrown inside that
scope: for instance, if the developer wishes to break on user-unhandled exceptions.
... 3416 bypassing security restrictions and signing code security, web development early versions of firefox allowed web sites to segregate principals using signed scripts, and request extra permissions for
scopes within signed scripts using a function called enableprivelege.
... 3635 npn_evaluate npapi, plugins evaluates a script in the
scope of the specified npobject.
Choosing the right approach - Learn web development
ng internetsettimeoutchrome full support 30edge full support 12firefox full support 1 full support 1 full support 52notes notes setinterval now defined on windoworworkerglobal
scope mixin.ie full support 4opera full support 4safari full support 1webview android full support 4.4chrome android full support 30firefox android full support ...
... 4 full support 4 full support 52notes notes setinterval now defined on windoworworkerglobal
scope mixin.opera android full support 10.1safari ios full support 1samsung internet android full support 3.0supports parameters for callbackchrome full support yesedge full support 12firefox full support yesie full support 10opera full support ...
...g internetsetintervalchrome full support 30edge full support 12firefox full support 1 full support 1 full support 52notes notes setinterval now defined on windoworworkerglobal
scope mixin.ie full support 4opera full support 4safari full support 1webview android full support 4.4chrome android full support 30firefox android full support ...
... 4 full support 4 full support 52notes notes setinterval now defined on windoworworkerglobal
scope mixin.opera android full support 10.1safari ios full support 1samsung internet android full support 3.0supports parameters for callbackchrome full support yesedge full support 12firefox full support yesie full support 10opera full support ...
Styling Vue components with CSS - Learn web development
component-
scoped styles in single file components.
... 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.
...this is where the
scoped attribute can be useful — this attaches a unique html data attribute selector to all of your styles, preventing them from colliding globally.
... to use the
scoped modifier, create a <style> element inside todoitem.vue, at the bottom of the file, and give it a
scoped attribute: <style
scoped> </style> next, copy the following css into the newly created <style> element: .custom-checkbox > .checkbox-label { font-family: arial, sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-weight: 400; font-size: 16px; font-size: 1rem; line-height: 1.25; color: #0b0c0c; display: block; margin-bottom: 5px; } .custom-checkbox > .checkbox { font-family: arial, sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-weight: 400; font-size: 16px; font-size: 1rem; line-height: 1.25; box-sizing: border-box; width: 100%; height: 40px; height:...
Command line crash course - Learn web development
if you enter it in a new browser tab, you’ll (eventually) get redirected to /docs/web/api/windoworworkerglobal
scope/fetch.
...act there are three redirects happening before we reach the final page: curl /docs/web/api/fetch -l -i | grep location your output should look something like this (curl will first output some download counters and suchlike): location: /docs/web/api/fetch location: /docs/web/api/globalfetch/globalfetch.fetch() location: /docs/web/api/globalfetch/fetch location: /docs/web/api/windoworworkerglobal
scope/fetch although contrived, we could take this result a little further and transform the location: line contents, adding the base origin to the start of each one so that we get complete urls printed out.
... try running this: curl /docs/web/api/fetch -l -i | grep location | awk '{ print "https://developer.mozilla.org" $2 }' your final output should look something like this: /docs/web/api/fetch /docs/web/api/globalfetch/globalfetch.fetch() /docs/web/api/globalfetch/fetch /docs/web/api/windoworworkerglobal
scope/fetch by combining these commands we've customised the output to show the full urls that the mozilla server is redirecting through when we request the /docs/web/api/fetch url.
... with prettier there's a number of ways automation can be achieved and though they're beyond the
scope of this article, there's some excellent resources online to help (some of which have been linked to).
Storage access policy: Block cookies from trackers
these scripts can continue to use storage
scoped to the top-level origin.
... storage access grants in order to improve web compatibility and permit third-party integrations that require storage access, firefox will grant storage access
scoped to the first party for a particular third-party origin as described in this section.
...
scope of storage access when storage access is granted, it is
scoped to the origin of the opener document or subdomains of that origin.
...this means that providers using cookies which are
scoped to their third-party domain, or local storage and other site data stored under their origin, will no longer have access to those identifiers across other websites.
XPCOMUtils.jsm
to use this, you first need to import the code module into your javascript
scope: components.utils.import("resource://gre/modules/xpcomutils.jsm"); using xpcomutils exposing a javascript class as a component using these utility methods requires four key steps: import xpcomutils.jsm, as explained previously.
...definelazygetter(aobject, aname, alambda); function definelazymodulegetter(aobject, aname, aresource, [optional] asymbol); function definelazyservicegetter(aobject, aname, acontract, ainterfacename); function generatensgetfactory(componentsarray); function generateci(classinfo); function generateqi(interfaces); void importrelative(that, path,
scope); generator itersimpleenumerator(enumerator, interface); generator iterstringenumerator(enumerator); attributes attribute type description categorymanager nsicategorymanager returns a reference to nsicategorymanager.
... void importrelative( that, path,
scope ); parameters that the javascript object of the calling javascript code module's global
scope.
...
scope an optional object to import into; if omitted, the object passed in for the that parameter is used.
JS::CloneFunctionObject
syntax jsobject * js::clonefunctionobject(jscontext *cx, js::handleobject funobj); jsobject * js::clonefunctionobject(jscontext *cx, js::handleobject funobj, js::autoobjectvector &
scopechain); name type description cx jscontext * pointer to a js context from which to derive runtime information.
...
scopechain js::autoobjectvector the new function's
scope chain.
...if
scopechain is supplied, it uses
scopechain as its enclosing
scope.
... if
scopechain is omitted, it creates a new function object in cx's global.
JS::Evaluate
blehandlevalue rval); bool js::evaluate(jscontext *cx, const js::readonlycompileoptions &options, const char *bytes, size_t length, js::mutablehandlevalue rval); bool js::evaluate(jscontext *cx, const js::readonlycompileoptions &options, const char *filename, js::mutablehandlevalue rval); bool js::evaluate(jscontext *cx, js::autoobjectvector &
scopechain, const readonlycompileoptions &options, const char16_t *chars, size_t length, js::mutablehandlevalue rval); // added in spidermonkey 17 bool js::evaluate(jscontext *cx, js::autoobjectvector &
scopechain, const js::readonlycompileoptions &options, js::sourcebufferholder &srcbuf, js::mutablehandlevalue rval); // obsolete since jsapi 39 boo...
... obj js::handleobject the
scope in which to execute the script.
...obsolete since jsapi 39
scopechain js::autoobjectvector & the
scope in which to execute the script.
... description js::evaluate compiles and executes a script in the specified
scope, obj or
scopechain.
Shell global objects
functions available if --fuzzing-safe is not specified clone(fun[,
scope]) clone function object.
... dump
scopechain(obj) prints the
scope chain of an interpreted function or a module.
...each element of the array is either of the form: { node: {object or string}, edge: {string describing edge from node} } , if the node is a javascript object or value; or of the form: { type: {string describing node}, edge: {string describing edge} } , if the node is some internal thing that is not a proper javascript value (like a shape or a
scope chain element).
... sharedmemoryenabled() return true if sharedarraybuffer and atomics are enabled evalreturning
scope(scriptstr, [global]) evaluate the script in a new
scope and return the
scope.
XPCOM array guide
when the object goes out of
scope, all its members are released.
...oitems); // now filter out non visible objects // doing this backwards pruint32 i = fooitems.count(); while (i > 0) { --i; prbool isvisible; fooitems[i]->getisvisible(&isvisible); if (!isvisible) { fooitems.removeobjectat(i); } } // now deal with the processed list processlist(fooitems); // fooitems will release all its members // when it goes out of
scope } access to elements nscomarray<t> is a concrete c++ class, and so the [] operator is used to access its members.
...when the object goes out of
scope, all its members have their destructors called.
...t non visible objects // doing this backwards pruint32 i = fooitems.length(); while (i > 0) { --i; prbool isvisible; fooitems[i]->getisvisible(&isvisible); if (!isvisible) { fooitems.removeelementat(i); } } // now deal with the processed list processlist(fooitems); // fooitems will call the destructors of all the foostruct objects // when it goes out of
scope } access to elements nstarray<t> is a concrete c++ class, and so the [] operator is used to access its members.
Components.utils.createObjectIn
components.utils.createobjectin creates a new javascript object in the
scope of the specified object's compartment.
... syntax var newobject = components.utils.createobjectin(obj, options); parameters obj an object indicating the compartment in which the new object should be created; the new object will be created in the
scope of this object's compartment.
... return value a new object in the specified
scope.
... example to create a new object in the
scope of a specified dom window, you can simply do: function genpropdesc(value) { return { enumerable: true, configurable: true, writable: true, value: value }; } var myobject = components.utils.createobjectin(mywindow); var proplist = { name: genpropdesc("name"), date: genpropdesc("date"), id: genpropdesc("id"), func: genpropdesc(function() { alert("called func!"); }) }; object.defineproperties(myobject, proplist); components.utils.makeobjectpropsnormal(myobject); this sets up the new object in the
scope of the object mywindow, then adds properties by calling object.defineproperties(), then normalizes them by calling components.utils.makeobjectpropsnormal().
UI Tour - Firefox Developer Tools
the ui is split vertically into three panels source list pane source pane the contents of the third pane depend on the current state of the debugger and may include the following sections: toolbar watch expressions breakpoints call stack
scopes xhr breakpoints event listener breakpoints dom mutation breakpoints source list pane the source list pane lists all the javascript source files loaded into the page, and enables you to select one to debug.
...
scopes in the right-hand pane you'll see a label "
scopes" with a disclosure arrow next to it.
... when the debugger's paused, you'll be able to expand this section to see all objects that are in
scope at this point in the program: objects are organized by
scope: the most local appears first, and the global
scope (window, in the case of page scripts) appears last.
... within the
scopes pane, you can create watchpoints that pause the debugger when a value is read or assigned.
Debugger.Environment - Firefox Developer Tools
each debugger.frame instance representing a debuggee frame has an associated environment object describing the variables in
scope in that frame; and each debugger.object instance representing a debuggee function has an environment object representing the environment the function has closed over.
...we say an identifier isin
scope in an environment if the identifier is bound in that environment or any enclosing environment.
...if the given variable should be in
scope, but getvariable is unable to produce its value, it returns an ordinary javascript object (not a debugger.object instance) whose optimizedout property is true.
...ifname is not in
scope in this environment, return null.name must be a string whose value is a valid ecmascript identifier name.
Debugger.Object - Firefox Developer Tools
this accessor returns whatever name appeared after the function keyword in the source code, regardless of whether the function is the result of instantiating a function declaration (which binds the function to its name in the enclosing
scope) or evaluating a function expression (which binds the function to its name only within the function's body).
... global a debugger.object instance referring to the global object in whose
scope the referent was allocated.
...for example, a web browser might provide host annotations for global objects to distinguish top-level windows, iframes, and internal javascript
scopes.
...(this function behaves like the standard object.getownpropertydescriptor function, except that the object being inspected is implicit; the property descriptor returned is allocated as if by code
scoped to the debugger's global object (and is thus in the debugger's compartment); and its value, get, and set properties, if present, are debuggee values.) getownpropertynames() return an array of strings naming all the referent's own properties, as if object.getownpropertynames(referent) had been called in the debuggee, and the result copied in the
scope of the debugger's global object.
Content Index API - Web APIs
the content index api is an extension to service workers, which allows developers to add urls and metadata of already cached pages, under the
scope of the current service worker.
... serviceworkerglobal
scope.oncontentdelete an event handler fired whenever a contentdelete event occurs.
... async function unregistercontent(article) { // reference registration const registration = await navigator.serviceworker.ready; // feature detect content index if (!registration.index) return; // unregister content from index await registration.index.delete(article.id); } all the above methods are available within the
scope of the service worker.
... they are accessible from the workerglobal
scope.self property: // service worker script self.registration.index.add(item); self.registration.index.delete(item.id); const contentindexitems = self.registration.index.getall(); contentdelete event when an item is removed from the user agent interface, a contentdelete event is received by the service worker.
ExtendableEvent - Web APIs
the extendableevent interface extends the lifetime of the install and activate events dispatched on the global
scope as part of the service worker lifecycle.
...116" y="1" width="150" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="191" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">extendableevent</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} note: this interface is only available when the global
scope is a serviceworkerglobal
scope.
... it is not available when it is a window, or the
scope of another kind of worker.
... examples this code snippet is from the service worker prefetch sample (see prefetch example live.) the code calls extendableevent.waituntil() in serviceworkerglobal
scope.oninstall, delaying treating the serviceworkerregistration.installing worker as installed until the passed promise resolves successfully.
Push API - Web APIs
the service worker will be started as necessary to handle incoming push messages, which are delivered to the serviceworkerglobal
scope.onpush event handler.
... interfaces pushevent represents a push action, sent to the global
scope of a serviceworker.
... serviceworkerglobal
scope.onpush an event handler fired whenever a push event occurs; that is, whenever a server push message is received.
... serviceworkerglobal
scope.onpushsubscriptionchange an event handler fired whenever a pushsubscriptionchange event occurs; for example, when a push subscription has been invalidated, or is about to be invalidated (e.g.
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
indeed, outside the
scope of 3d gaming, the odds are far more likely that the camera will not correspond with an object that appears in the scene at all.
...this ability is also used by games offering weapons with
scopes, where the view isn't quite based off the head's position in the same way anymore.
...panning is great for establishing a setting or providing a sense of
scope in a vast space or on a vast object.
...tilting is good for capturing the
scope of a tall object or scene, such as a forest or a mountain, but is also a popular way to introduce a character or locale of importance or which inspires awe.
Using Web Workers - Web APIs
thus, using the window shortcut to get the current global
scope (instead of self) within a worker will return an error.
... the worker context is represented by a dedicatedworkerglobal
scope object in the case of dedicated workers (standard workers that are utilized by a single script; shared workers use sharedworkerglobal
scope).
...this is because, inside the worker, the worker is effectively the global
scope.
...you have to do it indirectly, by sending a message back to the main script via dedicatedworkerglobal
scope.postmessage, then actioning the changes from there.
CSS Containment - CSS: Cascading Style Sheets
layout containment article { contain: layout; } layout is normally
scoped to the entire document, which means that if you move one element the entire document needs to be treated as if things could have moved anywhere.
... by using contain: layout you can tell the browser it only needs to check this element — everything inside the element is
scoped to that element and does not affect the rest of the page, and the containing box establishes an independent formatting context.
... style containment article { contain: style; } despite the name, style containment does not provide
scoped styles such as you would get with the shadow dom.
... using contain: style would ensure that the counter-increment and counter-set properties created new counters
scoped to that subtree only.
itemid - HTML: Hypertext Markup Language
an itemid attribute can only be specified for an element that has both item
scope and itemtype attributes.
... also, itemid can only be specified on elements that possess an item
scope attribute whose corresponding itemtype refers to or defines a vocabulary that supports global identifiers.
... example html <dl item
scope itemtype="http://vocab.example.net/book" itemid="urn:isbn:0-330-34032-8"> <dt>title <dd itemprop="title">the reality dysfunction <dt>author <dd itemprop="author">peter f.
... hamilton <dt>publication date <dd><time itemprop="pubdate" datetime="1996-01-26">26 january 1996</time> </dl> structured data item
scope itemtype: itemid http://vocab.example.net/book: urn:isbn:0-330-34032-8 itemprop title the reality dysfunction itemprop author peter f.
HTML documentation index - HTML: Hypertext Markup Language
23 itemref attribute, global attribute, html, html microdata, microdata, reference properties that are not descendants of an element with the item
scope attribute can be associated with an item using the global attribute itemref.
... 24 item
scope attribute, global attribute, html, html microdata, microdata, reference item
scope is a boolean global attribute that defines the
scope of associated metadata.
... specifying the item
scope attribute for an element creates a new item, which results in a number of name-value pairs that are associated with the element.
...the exact nature of this group is defined by the
scope and headers attributes.
Using Promises - JavaScript
promise rejection events whenever a promise is rejected, one of two events is sent to the global
scope (generally, this is either the window or, if being used in a web worker, it's the worker or other worker-based interface).
... nesting is a control structure to limit the
scope of catch statements.
... specifically, a nested catch only catches failures in its
scope and below, not errors higher up in the chain outside the nested
scope.
...nesting also limits the
scope of inner error handlers, which—if unintended—can lead to uncaught errors.
Arrow function expressions - JavaScript
the this value of the enclosing lexical
scope is used; arrow functions follow the normal variable lookup rules.
... so while searching for this which is not present in the current
scope, an arrow function ends up finding the this from its enclosing
scope.
...thus, in this example, arguments is simply a reference to the arguments of the enclosing
scope: var arguments = [1, 2, 3]; var arr = () => arguments[0]; arr(); // 1 function foo(n) { var f = () => arguments[0] + n; // foo's implicit arguments binding.
...let's see what happens when we try to use them as methods: 'use strict'; var obj = { // does not create a new
scope i: 10, b: () => console.log(this.i, this), c: function() { console.log(this.i, this); } } obj.b(); // prints undefined, window {...} (or the global object) obj.c(); // prints 10, object {...} arrow functions do not have their own this.
Default parameters - JavaScript
2: c = b; case 3: d = go(); case 4: e = this; case 5: f = arguments; case 6: g = this.value; default: } return [a, b, c, d, e, f, g]; } withdefaults.call({value: '=^_^='}); // [undefined, 5, 5, ":p", {value:"=^_^="}, arguments, "=^_^="] withoutdefaults.call({value: '=^_^='}); // [undefined, 5, 5, ":p", {value:"=^_^="}, arguments, "=^_^="]
scope effects if default parameters are defined for one or more parameter, then a second
scope (environment record) is created, specifically for the identifiers within the parameter list.
... this
scope is a parent of the
scope created for the function body.
... the following function will throw a referenceerror when invoked, because the default parameter value does not have access to the child
scope of the function body: function f(a = go()) { // throws a `referenceerror` when `f` is invoked.
... function go() { return ':p' } } ...and this function will print undefined because variable var a is hoisted only to the top of the
scope created for the function body (and not the parent
scope created for the parameter list): function f(a, b = () => console.log(a)) { var a = 1 b() // prints `undefined`, because default parameter values exist in their own
scope } parameters without defaults after default parameters parameters are still set left-to-right, overwriting default parameters even if there are later parameters without defaults.
Function - JavaScript
however, unlike eval, the function constructor creates functions that execute in the global
scope only.
... examples difference between function constructor and function declaration functions created with the function constructor do not create closures to their creation contexts; they always are created in the global
scope.
... when running them, they will only be able to access their own local variables and global ones, not the ones from the
scope in which the function constructor was created.
...this is because the top-level
scope in node is not the global
scope, and x will be local to the module.
undefined - JavaScript
that is, it is a variable in global
scope.
...while it is possible to use it as an identifier (variable name) in any
scope other than the global
scope (because undefined is not a reserved word), doing so is a very bad idea that will make your code difficult to maintain and debug.
...javascript is a statically
scoped language, so knowing if a variable is declared can be read by seeing whether it is declared in an enclosing context.
... the global
scope is bound to the global object, so checking the existence of a variable in the global context can be done by checking the existence of a property on the global object, using the in operator, for instance: if ('x' in window) { // these statements execute only if x is defined globally } void operator and undefined the void operator is a third alternative.
Standard built-in objects - JavaScript
here, "global objects" refer to objects in the global
scope.
... the global object itself can be accessed using the this operator in the global
scope.
... in fact, the global
scope consists of the properties of the global object, including inherited properties, if any.
... other objects in the global
scope are either created by the user script or provided by the host application.
const - JavaScript
constants are block-
scoped, much like variables defined using the let keyword.
... description this declaration creates a constant whose
scope can be either global or local to the block in which it is declared.
... a constant cannot share its name with a function or a variable in the same
scope.
... if (my_fav === 7) { // this is fine and creates a block
scoped my_fav variable // (works equally well with let to declare a block
scoped non const variable) let my_fav = 20; // my_fav is now 20 console.log('my favorite number is ' + my_fav); // this gets hoisted into the global context and throws an error var my_fav = 20; } // my_fav is still 7 console.log('my favorite number is ' + my_fav); const needs to be initialized // throws an error...
import - JavaScript
import an entire module's contents this inserts mymodule into the current
scope, containing all the exports from the module in the file located in /modules/my-module.js.
...module imported above includes an export doalltheamazingthings(), you would call it like this: mymodule.doalltheamazingthings(); import a single export from a module given an object or value named myexport which has been exported from the module my-module either implicitly (because the entire module is exported) or explicitly (using the export statement), this inserts myexport into the current
scope.
... import {myexport} from '/modules/my-module.js'; import multiple exports from module this inserts both foo and bar into the current
scope.
...for example, this inserts shortname into the current
scope.
Strict mode - JavaScript
this eliminates the concatenation problem and it means that you have to explicitly export any shared variables out of the function
scope.
...the problem with with is that any name inside the block might map either to a property of the object passed to it, or to a variable in surrounding (or even global)
scope, at runtime: it's impossible to know which beforehand.
... second, eval of strict mode code does not introduce new variables into the surrounding
scope.
... in normal code eval("var x;") introduces a variable x into the surrounding function or the global
scope.
/loader - Archive of obsolete content
these modules don't share
scope and get their own set of built-ins (object, array, string ...).
... module() the module() function takes a module id and uri and creates a module instance object that is exposed as the module variable in the module
scope.
...it is used by the loader to create
scopes into which modules are loaded.
Venkman Introduction - Archive of obsolete content
the
scope object holds all arguments and local variables, and the this object holds the value of the this keyword.
... property flags properties of both
scope and this objects are listed alphabetically, grouped by data type.
... in the interactive session, context becomes animator-0.03.js and the
scope is the pause function.
Introduction to XUL - Archive of obsolete content
scope this paper makes no attempt to explain requirements.
...this paper will concentrate on javascript, deeming application programming to be beyond its
scope.
...entities are a feature of the language and therefore outside the
scope of this paper.
IIFE - MDN Web Docs Glossary: Definitions of Web-related terms
(function () { statements })(); it is a design pattern which is also known as a self-executing anonymous function and contains two major parts: the first is the anonymous function with lexical
scope enclosed within the grouping operator ().
... this prevents accessing variables within the iife idiom as well as polluting the global
scope.
... (function () { var aname = "barry"; })(); // variable aname is not accessible from the outside
scope aname // throws "uncaught referenceerror: aname is not defined" assigning the iife to a variable stores the function's return value, not the function definition itself.
MDN Web Docs Glossary: Definitions of Web-related terms
item flexbox forbidden header name forbidden response header name fork fragmentainer frame rate (fps) ftp ftu function fuzz testing g gaia garbage collection gecko general header gif gij git global object global
scope global variable glyph gonk google chrome gpl gpu graceful degradation grid grid areas grid axis grid cell grid column grid container grid lines grid row grid tracks guard gutters gzip compression h hash ...
... intrinsic size ip address ipv4 ipv6 irc iso isp itu j jank java javascript jpeg jquery json k key keyword l latency layout viewport lazy load lgpl ligature local
scope local variable locale localization long task loop lossless compression lossy compression ltr (left to right) m main axis main thread markup mathml media media (audio-visual presentation) media (css) metadata method micros...
... rest rgb ril robots.txt round trip time (rtt) routers rss rtcp (rtp control protocol) rtf rtl (right to left) rtp (real-time transport protocol) and srtp (secure rtp) rtsp: real-time streaming protocol ruby s safe same-origin policy scm
scope screen reader script-supporting element scroll container scrollport sctp sdp search engine second-level domain secure sockets layer (ssl) selector (css) self-executing anonymous function semantics seo serialization server server timing session hi...
Styling tables - Learn web development
the markup looks like so: <table> <caption>a summary of the uk's most famous punk bands</caption> <thead> <tr> <th
scope="col">band</th> <th
scope="col">year formed</th> <th
scope="col">no.
... of albums</th> <th
scope="col">most famous song</th> </tr> </thead> <tbody> <tr> <th
scope="row">buzzcocks</th> <td>1976</td> <td>9</td> <td>ever fallen in love (with someone you shouldn't've)</td> </tr> <tr> <th
scope="row">the clash</th> <td>1976</td> <td>6</td> <td>london calling</td> </tr> ...
... some rows removed for brevity <tr> <th
scope="row">the stranglers</th> <td>1974</td> <td>17</td> <td>no more heroes</td> </tr> </tbody> <tfoot> <tr> <th
scope="row" colspan="2">total albums</th> <td colspan="2">77</td> </tr> </tfoot> </table> the table is nicely marked up, easily styleable, and accessible, thanks to features such as
scope, <caption>, <thead>, <tbody>, etc.
Your first form - Learn web development
it's beyond the
scope of this article to cover the user experience of forms, but if you want to dig into that topic you should read the following articles: smashing magazine has some good articles about forms ux, including an older but still relevant extensive guide to web form usability article.
...it is beyond the
scope of this article to teach you form styling in detail, so for the moment we will just get you to add some css to make it look ok.
...it's beyond the
scope of this guide to go deeply into that subject, but if you want to know more, we have provided some examples in our sending form data article later on.
Build your own function - Learn web development
you only use them when you want to run the function immediately in the current
scope.
... in the same respect, the code inside the anonymous function is not run immediately, as it is inside the function
scope.
...change the following line: btn.onclick = displaymessage; to this block: btn.onclick = function() { displaymessage('woo, this is a different message!'); }; if we want to specify parameters inside parentheses for the function we are calling, then we can't call it directly — we need to put it inside an anonymous function so that it isn't in the immediate
scope and therefore isn't called immediately.
Client-side storage - Learn web development
('taking videos from idb'); displayvideo(request.result.mp4, request.result.webm, request.result.name); } else { // fetch the videos from the network fetchvideofromnetwork(videos[i]); } }; } } the following snippet is taken from inside fetchvideofromnetwork() — here we fetch mp4 and webm versions of the video using two separate windoworworkerglobal
scope.fetch() requests.
...this self keyword is a way to refer to the global
scope of the service worker from inside the service worker file.
...we add another listener to the service worker global
scope, which runs the handler function when the fetch event is raised.
Getting started with Svelte - Learn web development
global.css: this file contains un
scoped styles.
... in svelte, css inside a component's <style> block will be
scoped only to that component.
... components styles are
scoped, keeping them from clashing with each other.
Package management basics - Learn web development
l it parcel-experiment, but you can call it whatever you like: mkdir parcel-experiment cd parcel-experiment next, let's initialise our app as an npm package, which creates a config file — package.json — that allows us to save our configuration details in case we want to recreate this environment later on, or even publish the package to the npm registry (although this is somewhat beyond the
scope of this article).
... in the case of parcel (prior to parcel version 2), there's a special flag required — --experimental-
scope-hoisting — which will tree shake while building.
...try running the following command: parcel build index.html --experimental-
scope-hoisting you’ll see that this makes a huge difference: ✨ built in 7.87s.
HTML parser threading
the termination and interruption indicators are guarded by a more narrowly
scoped mterminatedmutex, so parseavailabledata() has the opportunity to receive an order to terminate or interrupt even while the parser thread is holding mterminatedmutex.
...for other atoms, the parser uses nshtml5atom objects that are atomic only within the
scope of an nshtml5atomtable.
...(how exactly data is inserted into the buffer list depends on parser keys when document.write() is invoked re-entrantly, but that's outside the
scope of this document, since this document is about parser threading.) whenever the argument of document.write() isn't tokenized to completion synchronously, the part left unprocessed by the main document.write() tokenizer/tree builder is processed by the third tokenizer/tree builder pair.
JNI.jsm
to use it, you first need to import the code module into your javascript
scope: components.utils.import("resource://gre/modules/jni.jsm"); this module was available in firefox since version 17.
... a note about firefox for android, this jsm file is already globally imported and is available from the privileged window
scope as window.jni.
... there also exists a jenv variable in the window
scope, so if you need to run jni from the global
scope, use a different variable name then jenv.
PromiseWorker.jsm
javascript files imported into the worker
scope and main thread
scope which allows posting to the worker and receiving in the form of a promise.
...the require.js file must be imported with workerglobal
scope/importscripts().
... resolving the promise to resolve the promise from the worker, simply return anything from the worker
scope, and the main thread promise will be resolved with the returned value.
Threads
threading types and constants prthread prthreadtype prthread
scope prthreadstate prthreadpriority prthreadprivatedtor threading functions most of the functions described here accept a pointer to the thread as an argument.
... creating, joining, and identifying threads controlling thread priorities interrupting and yielding setting global thread concurrency getting a thread's
scope creating, joining, and identifying threads pr_createthread creates a new thread.
... getting a thread's
scope pr_getthread
scope gets the scoping of the current thread.
Rhino Debugger
the rhino javascript debugger can debug scripts running in multiple threads and provides facilities to set and clear breakpoints, control execution, view variables, and evaluate arbitrary javascript code in the current
scope of an executing script.
...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.
...the expressions you enter are re-evaluated in the current
scope and their current values displayed each time control returns to the debugger or when you change the stack location in the context: window.
SpiderMonkey Internals
objects consist of a possibly shared structural description, called the map or
scope; and unshared property values in a vector, called the slots.
... jsobj.*, js
scope.* these two pairs declare and implement the js object system.
... the details of a native object's map (
scope) are mostly hidden in js
scope.[ch].
Introduction to the JavaScript shell
clone(function, [
scope]) clones the specified function object.
... if
scope isn't specified, the new object's parent is the same as the original object's.
... otherwise, the new object is placed in the
scope of the object specified by
scope.
JS::CompileFunction
syntax bool js::compilefunction(jscontext *cx, js::autoobjectvector &
scopechain, const js::readonlycompileoptions &options, const char *name, unsigned nargs, const char *const *argnames, const char16_t *chars, size_t length, js::mutablehandlefunction fun); bool js::compilefunction(jscontext *cx, js::autoobjectvector &
scopechain, const js::readonlycompileoptions &options, const char *name, unsigned nargs, const char *const *argnames, js::sourcebufferholder &srcbuf, js::mutablehandlefunction fun); bool js::compilefunction(jscontext *cx, js::autoobjectvector &...
...
scopechain, const js::readonlycompileoptions &options, const char *name, unsigned nargs, const char *const *argnames, const char *bytes, size_t length, js::mutablehandlefunction fun); name type description cx jscontext * the context in which to compile the function.
...
scopechain js::autoobjectvector & the
scope in which to compile the function.
JSAutoByteString
*/ /* when leaving this
scope, the string returned by js_encodestring is freed.
...*/ /* when leaving this
scope, the string returned by js_encodestringtoutf8 is freed.
...*/ /* when leaving this
scope, buff is freed.
JS_ExecuteScriptVersion
obj jsobject * the
scope in which to execute the script.
...instead: the
scope chain is initialized to contain obj, followed by its parent, then its parent's parent, etc.
...if the jsoption_varobjfix option is in effect (recommended), then the last object in the
scope chain is used as the variable object.
JS_GetGlobalObject
description this function is obsolete: use js_getglobalforobject or js_getglobalfor
scopechain instead.
...second, the context's global object is used as a default value of last resort by functions that need a default parent object (see js_setparent for details) and by js_get
scopechain.
...someone should document common use case "giving the global object a name", which can be done with js_getglobalobject and js_setproperty see also mxr id search for js_getglobalobject js_getglobalforobject js_getglobalfor
scopechain js::currentglobalornull bug 868110 ...
JS_GetParent
the parent of a function created by evaluating a function declaration or function expression in a script depends on the lexical
scope of the function.
... if there is no enclosing function, with statement, or block
scope, then the function's parent is the global object.
...it may be a call, with, or block object representing the function's dynamic
scope, or it may be the global object.
JS_NewObject
if the parent is non-null, we assume it is part of a
scope chain, walk to the end of that chain, and use the global object we find there.
... if the parent is null, we use the global object at the end of the
scope chain in which the context is currently executing.
... in other words, the context's current
scope acts as a default parent.
Parser API
the lexical flag is metadata indicating whether the switch statement contains any unnested let declarations (and therefore introduces a new lexical
scope).
... note: declarations in arbitrary nested
scopes are spidermonkey-specific.
...the islexical flag is metadata indicating whether the switch statement contains any unnested let declarations (and therefore introduces a new lexical
scope).
Using XPCOM Utilities to Make Things Easier
using strings explaining how all the string classes work is outside the
scope of this book, but we can show you how to use strings in the weblock component.
... having more than one interface pointer that needs to be released when a block goes out of
scope begs for a tool that can aid the developer.
... note: other-string-classes there are other abstract string classes, but they are outside the
scope of this book.
Components.utils.evalInSandbox
the sandbox will become the global
scope object when you pass it to evalinsandbox(text, sandbox).
... for example: function double(n) { return n * 2; } // create new sandbox instance var mysandbox = new components.utils.sandbox("http://www.example.com/"); mysandbox.y = 5; // insert property 'y' with value 5 into global
scope.
... mysandbox.double = double; var result = components.utils.evalinsandbox("x = y + 2; double(x) + 3", mysandbox); console.log(result); // 17 console.log(mysandbox.x); // 7 operations on objects you insert into this sandbox global
scope do not carry privileges into the sandbox: mysandbox.foo = components; // this will give a "permission denied" error components.utils.evalinsandbox("foo.classes", mysandbox); optional arguments you can optionally specify the js version, filename, and line number of the code being evaluated.
Components object
utils.createobjectin creates a new object in the
scope of the specified object's compartment.
... utils.import loads a javascript module into the current script, without sharing a
scope.
... utils.makeobjectpropsnormal ensures that all functions come from the specified object's
scope, and aren't cross-compartment wrappers.
jsdIStackFrame
makes eval() use the last object on its 'obj' param's
scope chain as the ecma 'variables object'.
...top of the
scope chain for this context.
...
scope jsdivalue top object in the
scope chain.
nsIMsgFolder
d notifyunicharpropertychanged(in nsiatom property, in astring oldvalue, in astring newvalue); void notifyitemadded(in nsisupports item); void notifyitemremoved(in nsisupports item); void notifyfolderevent(in nsiatom event); void listdescendents(in nsisupportsarray descendents); void shutdown(in boolean shutdownchildren); void setinvfeditsearch
scope(in boolean asearchthisfolder, in boolean asetonsubfolders); void copydatatooutputstreamforappend(in nsiinputstream aistream, in long alength, in nsioutputstream outputstream); void copydatadone(); void setjunkscoreformessages(in nsisupportsarray amessages, in acstring ajunkscore); void applyretentionsettings(); boolean fetchmsgpreviewtext([array, size_...
... invfeditsearch
scope boolean readonly customidentity nsimsgidentity readonly: this allows a folder to have a special identity.
... void listdescendents(in nsisupportsarray descendents); shutdown() void shutdown(in boolean shutdownchildren); setinvfeditsearch
scope() void setinvfeditsearch
scope(in boolean asearchthisfolder, in boolean asetonsubfolders); copydatatooutputstreamforappend() void copydatatooutputstreamforappend(in nsiinputstream aistream, in long alength, in nsioutputstream outputstream); copydatadone() void copydatadone(); setjun...
XPCOM Interface Reference
converternsimimeheadersnsimodulensimsgaccountnsimsgaccountmanagerextensionnsimsgcompfieldsnsimsgcustomcolumnhandlernsimsgdbhdrnsimsgdbviewnsimsgdbviewcommandupdaternsimsgdatabasensimsgfilternsimsgfiltercustomactionnsimsgfilterlistnsimsgfoldernsimsgheaderparsernsimsgidentitynsimsgincomingservernsimsgmessageservicensimsgprotocolinfonsimsgruleactionnsimsgsearchcustomtermnsimsgsearchnotifynsimsgsearch
scopetermnsimsgsearchsessionnsimsgsearchtermnsimsgsearchvaluensimsgsendlaternsimsgthreadnsimsgwindownsimsgwindowcommandsnsimutablearraynsinavbookmarkobservernsinavbookmarksservicensinavhistorybatchcallbacknsinavhistorycontainerresultnodensinavhistoryfullvisitresultnodensinavhistoryobservernsinavhistoryquerynsinavhistoryqueryoptionsnsinavhistoryqueryresultnodensinavhistoryresultnsinavhistoryresultnodens...
...erregistrarnsiwebnavigationnsiwebnavigationinfonsiwebpagedescriptornsiwebprogressnsiwebprogresslistenernsiwebprogresslistener2nsiwebsocketchannelnsiwebsocketlistenernsiwebappssupportnsiwifiaccesspointnsiwifilistenernsiwifimonitornsiwinaccessnodensiwinapphelpernsiwintaskbarnsiwindowcreatornsiwindowmediatornsiwindowwatchernsiwindowsregkeynsiwindowsshellservicensiworkernsiworkerfactorynsiworkerglobal
scopensiworkermessageeventnsiworkermessageportnsiworker
scopensiwritablepropertybagnsiwritablepropertybag2nsixformsmodelelementnsixformsnsinstanceelementnsixformsnsmodelelementnsixmlhttprequestnsixmlhttprequesteventtargetnsixmlhttprequestuploadnsixpcexceptionnsixpcscriptablensixpconnectnsixsltexceptionnsixsltprocessornsixsltprocessorobsoletensixulappinfonsixulbrowserwindownsixulbuilderlistenernsixulrunt...
...imensixulsortservicensixultemplatebuildernsixultemplatequeryprocessornsixultemplateresultnsixulwindownsixmlrpcclientnsixmlrpcfaultnsizipentrynsizipreadernsizipreadercachensizipwriternsmsgfilterfileattribvaluensmsgfolderflagtypensmsgjunkstatusnsmsgkeynsmsglabelvaluensmsgpriorityvaluensmsgruleactiontypensmsgsearchattribnsmsgsearchopnsmsgsearch
scopensmsgsearchtermnsmsgsearchtypevaluensmsgsearchvaluensmsgsearchwidgetvaluenspipromptservice see also interfaces grouped by function ...
Storage
} } finally { statement.reset(); } in c++, storage provides a helper object in storage/public/mozstoragehelper.h, mozstoragestatement
scoper, which ensures that the statement object is reset when the object falls out of
scope.
... mozstoragestatement
scoper
scoper(mspecialstatement); // you can use mspecialstatement without concern now.
... in c++ code, there is a helper class defined in storage/public/mozstoragehelper.h, mozstoragetransaction, that will attempt to get a transaction for you, and handle it appropriately when it falls out of
scope.
Frequently Asked Questions
release an nscomptr before it goes out of
scope?
...e.g., using blocks as in this sample // the most efficient scheme is to
scope your |nscomptr| to live exactly as long // as you need to hold the reference nsresult somelongfunction( nsibar* abar ) { nsresult rv; // ...
... nscomptr<nsifoo> foo( do_queryinterface(abar, &rv) ); if ( foo ) foo->dosomefoothing(); // |foo| goes out of
scope, and so |release|s its referent, here } // ...tons of stuff here, during which i don't need an |nsifoo| return rv; } editors note: move this discussion to the efficiency section, and link to it from here.
Getting Started Guide
all good getters addref the interface pointers they produce, thus providing you with an owning reference; you will hold onto the reference longer than the
scope of the function in which you acquired it, e.g., you got it as a parameter, but you're hanging onto it in a member variable (see, for example, comparison 1, below).
... you don't need an owning reference when the object is passed in as a parameter, and you don't need to keep it any longer than the
scope of this function; the object's lifetime is known to contain yours in some well defined way, e.g., in the nodes of a tree, parent nodes keep owning references to their children, children need not keep owning references to their parents.
...an nscomptr always calls release before letting go, whether the nscomptr is letting go so that it can point to a different object, or because the nscomptr is going out of
scope.
XPIDL Syntax
idl_file = 1*definition definition = [type_decl / const_decl / interface] ";" interface = [prop_list] "interface" ident [[inheritance] "{" *(ifacebody) "}"] inheritance = ":" *(
scoped_name ",")
scoped_name] ifacebody = [type_decl / op_decl /attr_decl / const_decl] ";" / codefrag type_decl = [prop_list] "typedef" type_spec *(ident ",") ident type_decl /= [prop_list] "native" ident [parens] const_decl = "const" type_spec ident "=" expr op_decl = [prop_list] (type_spec / "void") parameter_decls raise_list parameter_decls = "(" [*(param_decl ",") param_decl] ")" param_de...
...cl = [prop_list] ("in" / "out" / "inout") type_spec ident attr_decl = [prop_list] ["readonly"] "attribute" type_spec *(ident ",") ident ; descending order of precedence expr /= expr ("|" / "^" / "&") expr ; unequal precedence "|" is lowest expr /= expr ("<<" / ">>") expr expr /= expr ("+" / "-") expr expr /= expr ("*" / "/" / "%") expr expr /= ["-" / "+" / "~"] (
scoped_name / literal / "(" expr ")" ) ; numeric literals: quite frankly, i'm sure you know how these kinds of ; literals work, and these are annoying to specify in abnf.
... string_literal = 1*(%x22 *(any char except %x22 or %x0a) (%x22 / %x0a)) ; same as above, but s/"/'/g char_literal = 1*(%x27 *(any char except %x27 or %x0a) (%x27 / %x0a)) type_spec = "float" / "double" / "string" / "wstring" type_spec /= ["unsigned"] ("short" / "long" / "long" "long") type_spec /= "char" / "wchar" / "boolean" / "octet" type_spec /=
scoped_name prop_list = "[" *(property ",") property "]" property = ident [parens] raise_list = "raises" "(" *(
scoped_name) ",")
scoped_name ")"
scoped_name = *(ident "::") ident / "::" ident ; in regex: [a-za-z_][a-za-z0-9_]*; identifiers beginning with _ cause warnings ident = (%x41-5a / %x61-7a / "_") *(%x41-5a / %x61-7a / %x30-39 / "_") parens = "(" 1*(any char except ")") ")" functional...
Use watchpoints - Firefox Developer Tools
in the
scopes pane on the right side of the debugger user interface, find an object you want to watch, and right-click it to open its context menu.
... choose break on, and then one of property set property get property get or set a watchpoint icon appears to the right of the property in the
scopes pane.
... delete a watchpoint locate the watched property in the
scopes pane.
Debugger.Memory - Firefox Developer Tools
allocation site tracking the javascript engine marks each new object with the call stack at which it was allocated, if: the object is allocated in the
scope of a global object that is a debuggee of some debugger instancedbg; and dbg.memory.trackingallocationsites is set to true.
... a bernoulli trial succeeds, with probability equal to the maximum of d.memory.allocationsamplingprobability of all debugger instances d that are observing the global that this object is allocated within the
scope of.
... note that in the presence of multiple debugger instances observing the same allocations within a global’s
scope, the maximum allocationsamplingprobability of all the debuggers is used.
Index - Firefox Developer Tools
each debugger.frame instance representing a debuggee frame has an associated environment object describing the variables in
scope in that frame; and each debugger.object instance representing a debuggee function has an environment object representing the environment the function has closed over.
...the ui is split vertically into three panels 139 using the debugger map
scopes feature this feature is useful when debugging source-mapped code.
...it’s also possible to inspect variables from the generated
scopes (e.g., a bundle file with all concatenated module files).
Cache - Web APIs
note that the cache interface is exposed to windowed
scopes as well as workers.
... in the code example, caches is a property of the serviceworkerglobal
scope.
...this is an implementation of the windoworworkerglobal
scope mixin.
Fetch API - Web APIs
for making a request and fetching a resource, use the windoworworkerglobal
scope.fetch() method.
... it is implemented in multiple interfaces, specifically window and workerglobal
scope.
... fetch interfaces windoworworkerglobal
scope.fetch() the fetch() method used to fetch a resource.
IDBTransactionSync - Web APIs
recoverable_err if this transaction's
scope is dynamic, and the browser cannot commit all of the changes due to another transaction.
... objectstore() returns an object store that has already been added to the
scope of this transaction.
... exceptions the method can raise an idbdatabaseexception with the following code: not_found_err if the requested object store is not in this transaction's
scope.
Performance API - Web APIs
the now() method returns a domhighrestimestamp whose value that depends on the navigation start and
scope.
... if the
scope is a window, the value is the time the browser context was created and if the
scope is a worker, the value is the time the worker was created.
... high resolution time level 2 recommendation adds performance attribute on window and workerglobal
scope.
ServiceWorkerContainer.getRegistration() - Web APIs
the getregistration() method of the serviceworkercontainer interface gets a serviceworkerregistration object whose
scope url matches the provided document url.
... syntax serviceworkercontainer.getregistration(
scope).then(function(serviceworkerregistration) { ...
... }); parameters
scope optional a unique identifier for a service worker registration — the
scope url of the registration object you want to return.
Worker.prototype.postMessage() - Web APIs
the postmessage() method of the worker interface sends a message to the worker's inner
scope.
... the worker can send back information to the thread that spawned it using the dedicatedworkerglobal
scope.postmessage method.
... syntax worker.postmessage(message, [transfer]); parameters message the object to deliver to the worker; this will be in the data field in the event delivered to the dedicatedworkerglobal
scope.onmessage handler.
<dfn>: The Definition element - HTML: Hypertext Markup Language
this can be done by using the <dfn> and <abbr> elements in tandem, like this: html <p>the <dfn><abbr title="hubble space tele
scope">hst</abbr></dfn> is among the most productive scientific instruments ever constructed.
... it has been in orbit for over 20 years, scanning the sky and returning data and photographs of unprecedented quality and detail.</p> <p>indeed, the <abbr title="hubble space tele
scope">hst</abbr> has arguably done more to advance science than any device ever built.</p> note the <abbr> element nested inside the <dfn>.
... the former establishes that the term is an abbreviation ("hst") and specifies the full term ("hubble space tele
scope") in its title attribute.
<th> - HTML: Hypertext Markup Language
the exact nature of this group is defined by the
scope and headers attributes.
...
scope this enumerated attribute defines the cells that the header (defined in the <th>) element relates to.
... note: do not use this attribute as it is obsolete in the latest standard: use the
scope attribute instead.
itemref - HTML: Hypertext Markup Language
properties that are not descendants of an element with the item
scope attribute can be associated with an item using the global attribute itemref.
... itemref provides a list of element ids (not itemids) elsewhere in the document, with additional properties the itemref attribute can only be specified on elements that have an item
scope attribute specified.
... example html <div item
scope id="amanda" itemref="a b"></div> <p id="a">name: <span itemprop="name">amanda</span> </p> <div id="b" itemprop="band" item
scope itemref="c"></div> <div id="c"> <p>band: <span itemprop="name">jazz band</span> </p> <p>size: <span itemprop="size">12</span> players</p> </div> structured data (in json-ld format) { "@id": "amanda", "name": "amanda", "band": { "@id": "b", "name":...
Symbol.unscopables - JavaScript
setting a property to true in an unscopables object will make it unscopable and therefore it won't appear in lexical
scope variables.
... setting a property to false will make it scopable and thus it will appear in lexical
scope variables.
...a built-in unscopables setting is implemented as array.prototype[@@unscopables] to prevent that some of the array methods are being
scoped into the with statement.
serviceworker - Web app manifests
examples "serviceworker": { "src": "./serviceworker.js", "
scope": "/app", "type": "", "update_via_cache": "none" } values service worker contain the following values (only src is required): member description src the url to download the service worker script from.
...
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.
...by default, the
scope value for a service worker registration is set to the directory where the service worker script is located.
<xsl:stylesheet> - XSLT: Extensible Stylesheet Language Transformations
it also determines the collation used by certain xslt constructs (such as <xsl:key> and xsl:for-each-group) within its
scope.
... default-mode defines the default value for the mode attribute of all <xsl:template> and <xsl:apply-templates> elements within its
scope.
... default-validation defines the default value of the validation attribute of all relevant instructions appearing within its
scope.
<xsl:variable> - XSLT: Extensible Stylesheet Language Transformations
because xslt permits no side-effects, once the value of the variable has been established, it remains the same until the variable goes out of
scope syntax <xsl:variable name=name select=expression > template </xsl:variable> required attributes name gives the variable a name.
...if it occurs as a top-level element, the variable is global in
scope, and can be accessed throughout the document.
... if it occurs within a template, the variable is local in
scope, accessible only within the template in which it appears.
Communicating With Other Scripts - Archive of obsolete content
t.documentelement.dispatchevent(event); } finally, the page script "page-script.js" listens for the message and logs the greeting to the web console: window.addeventlistener("addon-message", function(event) { console.log(event.detail.greeting); }, false); after firefox 30: clone the message object this technique depends on being able to share the message payload between the content script
scope and the page script
scope.
... from firefox 30 this sharing requires an extra step: the content script needs to explicitly clone the message payload into the page script's
scope using the global cloneinto() function: var messenger = document.getelementbyid("message"); messenger.addeventlistener("click", sendcustomevent, false); function sendcustomevent() { var greeting = {"greeting" : "hello world"}; var cloned = cloneinto(greeting, document.defaultview); var event = document.createevent('customevent'); event.initcustomevent("addon-message", true, true, cloned); document.documentelement.dispatchevent(event); } messaging from page script to content script sending messages using custom dom events from the page script to the content script is just the same, but in reverse.
Private Properties - Archive of obsolete content
the second problem is more severe: the thumbnail cache maintains a strong reference to each thumbnail object, so they will never be freed, even when their corresponding image has gone out of
scope.
...when a thumbnail's image goes out of
scope, the weakmap ensures that its entry in the thumbnail cache will eventually be garbage collected.
StringView - Archive of obsolete content
notes when you include the script stringview.js into a page, no variables other than stringview itself will be added to the global
scope.
...well, just include stringview.js to your
scope and work on them in another script: /* a constructor of c-like regular expression objects...
Setting up an extension development environment - Archive of obsolete content
useful for testing debug symbols and the crash reporting system (firefox and thunderbird) javascript object examiner displays javascript object methods and properties for any available
scope developer profile and devprefs sets up the development environment described above when installed (firefox and fennec) firefox extension proxy file extension files are normally installed in the user profile.
...you can avoid this by setting the preference extensions.autodisable
scopes to 14.
Tabbed browser - Archive of obsolete content
// gbrowser is only accessible from the
scope of // the browser window (browser.xul) gbrowser.addtab(...); if gbrowser isn't defined your code is either not running in the
scope of the browser window or running too early.
...this code will work in the
scope of the browser window (e.g.
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
preference files and config files are special javascript files with limited
scopes.
...also related post in newsgroups: mozilla.dev.tech.js-engine date: wed, 17 may 2006 19:06:28 +0200 from: jehan procaccia <jehan.procaccia@int-evry.fr> newsgroups: mozilla.dev.tech.js-engine subject:
scope of js file functions in frefox/thunderbird autoconfig context firefox 2.x recently (2007/03/20), i've tested autoconfig support in firefox 2.0.0.2 on a linux fedora.
Metro browser chrome tests - Archive of obsolete content
it currently allows you to run javascript code in the same
scope as the immersive browser and report results using the same functions as the mochitest test framework.
...helper functions the eventutils helper functions are available on the eventutils object defined in the global
scope.
Abc Assembler Tests - Archive of obsolete content
* * ***** end license block ***** */ function main() { getlocal0 push
scope findproperty start pushstring "instructions that start with the letter l" callpropvoid start 1 newfunction .function_id(runtest) getlocal0 call 0 findproperty end callpropvoid end 0 returnvoid } function runtest() { // test null <= null == true findproperty compare_stricteq pushstring "null lessequals null" // testname pushtrue // expected ...
...ll .try { pushnull convert_o pop findproperty fail pushstring "convert_o null" pushstring "exception should have been thrown: typeerror: error #1009: cannot access a property or method of a null object reference." getlocal1 callpropvoid fail 3 jump finished_convert_o_null } .catch { getlocal0 push
scope setlocal2 // save typeerror findproperty compare_typeerror pushstring "convert_o null" // test name pushstring "typeerror: error #1009" // expected getlocal2 // actual callpropvoid compare_typeerror 3 } finished_convert_o_null: } ...
Using Breakpoints in Venkman - Archive of obsolete content
one of the most important aspects of debugging a script or software program is the ability to examine variables—function return values, errors, counters, variable
scopes—as they change over the course of the script execution.
... advanced breakpoints venkman allows you to associate a breakpoint with a script that will be executed in the
scope of the function when that breakpoint is hit.
DOM Interfaces - Archive of obsolete content
this method enables an author to determine the
scope of any content node.
... when content at the document-level
scope is passed in as an argument, the property's value is null.
Scratchpad - Archive of obsolete content
the code is executed in the
scope of the currently selected tab.
...once you've done this, the environment menu has a browser option; once that's selected, your
scope is the entire browser rather than just the page content, as you will see from examining some globals: window /* [object chromewindow] */ gbrowser /* [object xulelement] */ the scratchpad execution context is set to browser when a snippet file has // -sp-context: browser on the first line.
Debug.setNonUserCodeExceptions - Archive of obsolete content
the debug.setnonusercodeexceptions property determines whether any try-catch blocks in this
scope are to be treated by the debugger as user-unhandled.
... syntax debug.setnonusercodeexceptions [= bool]; remarks if this property is set to true within a given
scope, the debugger can then choose whether to take some specified action on exceptions thrown inside that
scope: for instance, if the developer wishes to break on user-unhandled exceptions.
arguments.caller - Archive of obsolete content
function whocalled() { if (whocalled.caller == null) console.log('i was called from the global
scope.'); else console.log(whocalled.caller + ' called me!'); } examples the following code was used to check the value of arguments.caller in a function, but doesn't work anymore.
... function whocalled() { if (arguments.caller == null) console.log('i was called from the global
scope.'); else console.log(arguments.caller + ' called me!'); } specifications not part of any standard.
Sharp variables in JavaScript - Archive of obsolete content
scope sharp variables are only in
scope in the statement in which they are defined.
... #1 = {}; // this doesn't do much since the sharp variable is out of
scope immediately after a = #2 = {}; // slightly more useful since we retain a reference to the new object to reference the sharp variable, simply append another sharp (#) to the end of the variable name.
Archived open Web documentation - Archive of obsolete content
well if you combine the two, you can have inherited private variables:
scope cheatsheet javascript with mozilla extensions has both function-
scoped vars and block-
scoped lets.
... along with hoisting and dynamic behavior,
scope in javascript is sometimes surprising.
Common causes of memory leaks in extensions - Extensions
for example: var windows = []; function injavascriptcodemodule(window) { // forgetting or failing to pop the window again windows.push(window); } both of these cases can happen if you forget to declare local variables with var or let, which means they end up belonging to the global
scope.
...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.
Using the DOM File API in chrome code - Extensions
scope availability in the jsm
scope file is available without needing to do anything special.
... in bootstrap
scope, this must be imported in like so: cu.importglobalproperties( [ "file" ] ) accessing a file by hard-coded pathname to reference a file by its path, you can simply use a string literal: var file = file.createfromfilename("path/to/some/file"); cross platform note: however using hard-coded paths raises cross platform issues since it uses a platform-dependent path separator (here "/").
From object to iframe — other embedding technologies - Learn web development
00" frameborder="0" allowfullscreen sandbox> <p> <a href="https://udn.realityripple.com/docs/glossary"> fallback link for browsers that don't support iframes </a> </p> </iframe> this example includes the basic essentials needed to use an <iframe>: allowfullscreen if set, the <iframe> is able to be placed in fullscreen mode using the full screen api (somewhat beyond
scope for this article.) frameborder if set to 1, this tells the browser to draw a border between this frame and other frames, which is the default behaviour.
...obviously, it's rather out of
scope for a full explanation in this article.
Index - Learn web development
in this article we'll explore fundamental concepts behind functions such as basic syntax, how to invoke and define them,
scope, and parameters.
... 228 html table advanced features and accessibility accessibility, advanced, article, beginner, codingscripting, html, headers, learn, caption, nesting,
scope, sumary, table, tbody, tfoot, thead there are a few other things you could learn about table html, but we have really given all you need to know at this moment in time.
Solve common problems in your JavaScript code - Learn web development
for example: function myfunction() { alert('this is my function.'); }; this code won't do anything unless you call it with the following statement: myfunction(); function
scope remember that functions have their own
scope — you can't access a variable value set inside a function from outside the function, unless you declared the variable globally (i.e.
... what is function
scope?
Object prototypes - Learn web development
that's because this will be referencing the global
scope in this case, not the function
scope.
...this worked fine on the method we defined earlier in the prototype because it is sitting inside a function
scope, which will be transferred successfully to the object instance
scope.
Ember interactivity: Events, classes and state - Learn web development
as you may expect from dealing with vanilla javascript objects, the this keyword refers to the "context" or "
scope" of the component.
...ember calls these constructs services, and they live for the entire lifetime of the page (a page refresh will clear them; persisting the data for longer is beyond the
scope of this tutorial).
Accessibility API cross-reference
column n/a n/a n/a the heading of a table's column columnheader column_header column_header, table_column_header columnheader <th
scope=col> edit control with drop down list box, different from droplist combobox combo_box combo_box combobox abstract role - a form of widget that performs an action but does not receive input data.
... n/a n/a rowgroup n/a a table row header rowheader row_header row_header, table_row_header rowheader <th
scope=row> vertical or horizontal scrollbar scrollbar scroll_bar scroll_bar scrollbar a landmark region that contains a collection of items and objects that, as a whole, combine to create a search facility.
Mozilla’s UAAG evaluation report
html:
scope attribute (table): available through dom html: headers attribute (table): available through dom html: axis attribute (table): available through dom html: tabindex attribute: yes, can be used to order sequential navigation html: accesskey attribute: supported with alt-{key}, menu key conflict favor the accesskey?
...(p1) ni we don't make use of
scope, headers, axis, or any other table accessibility features we have nothing under properties, or anywhere else, to orient users reading a table 10.2 highlight selection and content focus.
Message manager overview
these scripts are called frame scripts, and as the name suggests, they are
scoped to a specific browser frame.
... frame scripts are loaded into the content frame message manager
scope, and messages from chrome message managers end up here.
Performance
and since frame scripts get evaluated for each tab this means new function objects get instantiated, new constants get computed, block
scopes must be set up etc.
...other callbacks to global services) in a frame script bad: //framescript.js services.obs.addobserver("document-element-inserted", { observe: function(doc, topic, data) { if(doc.ownerglobal.top != content) return; // bail out if this is for another tab decoratedocument(doc); } }) observer notifications get fired for events that happen anywhere in the browser, they are not
scoped to the current tab.
ChromeWorker
it works exactly like a standard worker, except that it has access to js-ctypes via a global ctypes object available in the global
scope of the worker.
... see also using web workers using workers in javascript code modules worker sharedworker web workers specification workerglobal
scope github :: chromeworker - a fully working demo addon using js-ctypes from a chrome worker.
JavaScript-DOM Prototypes in Mozilla
the prototype object that xpconnect creates for the classes that have class info are shared within a
scope (window).
...this means that the next time the name of a class constructor is resolved in the same
scope, say htmlanchorelement, the code will resolve the name htmlanchorelement, find the parent name, which is htmlelement, and resolve that, but since we've already resolved htmlelement as a result of resolving the name htmlimageelement earlier, the recursion will stop right there.
FxAccountsOAuthClient.jsm
fxaccountsoauthclient fxaccountsoauthclient( object options object parameters string client_id string state string oauth_uri string content_uri [optional] string
scope [optional] string action [optional] string authorizationendpoint ); parameters client_id - oauth id returned from client registration.
...example: "https://accounts.firefox.com" [optional]
scope - a colon-separated list of
scopes that the user has authorized.
Following the Android Toasts Tutorial from a JNI Perspective
context context = getapplicationcontext(); charsequence text = "hello, firefox!"; int duration = toast.length_short; toast toast = toast.maketext(context, text, duration); toast.show(); nativewindow code as mentioned earlier, toasts are a very popular feature, so mozilla developers chose to bring it to the privileged javascript
scope via the nativewindow object.
... this is the template that will follow our object of signatures: var my_jenv = null; try { my_jenv = jni.getforthread(); // do the jni work here } finally { if (my_jenv) { jni.unloadclasses(my_jenv); } } the reason we choose my_jenv for a variable name, and not jenv, is because the global privileged window
scope of firefox for android has a variable jenv already, and we don't want to mix.
Mozilla Framework Based on Templates (MFBT)
(an unnamed temporary lives for a shorter period of time than the
scope where it's found, so it usually isn't what was desired.) data structures linkedlist.h implements a type-safe doubly-linked list class.
...
scoped.h implements
scope-based resource management, to simplify the task of cleaning up resources when leaving a
scope.
MathML Torture Test
>minion</option> <option value="stixtwo">stix two</option> <option value="texgyrebonum">tex gyre bonum</option> <option value="texgyrepagella">tex gyre pagella</option> <option value="texgyreschola">tex gyre schola</option> <option value="texgyretermes">tex gyre termes</option> <option value="xits">xits</option> </select> <br/> </p> <table> <tr> <td></td> <th
scope="col">as rendered by tex</th> <th
scope="col">as rendered by your browser</th></tr> <tr> <td>1</td> <td><img src="https://udn.realityripple.com/samples/45/d5a0dbbca3.png" width="38" height="22" alt="texbook, 16.2-16.3" /></td> <td> <math display="block"> <mrow> <msup> <mi>x</mi> <mn>2</mn> </msup> <...
...i></msub></mrow></munder><mrow><mi>ϵ</mi><mo stretchy="false">(</mo><mi>σ</mi><mo stretchy="false">)</mo></mrow><mrow><munderover><mo>∏</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mi>n</mi></munderover><msub><mi>a</mi><mrow><mi>i</mi><mo>,</mo><msub><mi>σ</mi><mi>i</mi></msub></mrow></msub></mrow></mrow></math></td> </tr> </table> <br><br> <table dir="rtl"> <tr> <td></td> <th
scope="col">maghreb style</th> <th
scope="col">machrek style</th> <th
scope="col">persian style</th></tr> <tr> <td>1</td> <td> <math dir="rtl" display="block"> <mrow> <msup> <mi>𞸎</mi> <mn>Ù¢</mn> </msup> <msup> <mi>𞸑</mi> <mn>Ù¢</mn> </msup> </mrow> </ma...
Mozilla DOM Hacking Guide
assinfo 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 of functionality implemented using domclassinfo: constructors of dom objects in the global
scope (e.g.
...this is not in the
scope of this document.
Measuring performance using the PerfMeasurement.jsm code module
the first thing you need to do is to import the module into your
scope: components.utils.import("resource://gre/modules/perfmeasurement.jsm") you can then create a perfmeasurement object.
... when you're done with your measurements, just let the monitor object go out of
scope.
PR_CreateThread
syntax #include <prthread.h> prthread* pr_createthread( prthreadtype type, void (*start)(void *arg), void *arg, prthreadpriority priority, prthread
scope scope, prthreadstate state, pruint32 stacksize); parameters pr_createthread has the following parameters: type specifies that the thread is either a user thread (pr_user_thread) or a system thread (pr_system_thread).
...
scope specifies your preference for making the thread local (pr_local_thread), global (pr_global_thread) or global bound (pr_global_bound_thread).
Rhino Examples
multithreaded script execution dynamic
scopes.java is a program that creates a single global
scope object and then shares it across multiple threads.
... sharing the global
scope allows both information to be shared across threads, and amortizes the cost of context.initstandardobjects by only performing that expensive operation once.
Self-hosted builtins in SpiderMonkey
differences from normal javascript all self-hosted code is strict, so self-hosted functions invoked in a null or undefined
scope won't be run in the
scope of the global object.
...most importantly, it's possible to invoke any function within the
scope of any object using the syntax callfunction(fun, receiver, ...args) (or callcontentfunction, see below), which causes fun to be called within the
scope of receiver with ...args as its arguments.
JSAutoCompartment
this article covers features introduced in spidermonkey 24 raii helper to enter a different compartment on the given context and automatically leave it once the jsautocompartment instance gets out of
scope.
...jsautocompartment guarantees that by automatically entering the given compartment and leaving it upon getting out of
scope: void foo(jscontext *cx, jobject *obj) { // in some compartment 'c' { jsautocompartment ac(cx, obj); // constructor enters // in the compartment of 'obj' } // destructor leaves // back in compartment 'c' } see also mxr id search for jsautocompartment bug 860050 bug 833817 bug 786068 ...
JS_ClearNewbornRoots
see js_enterlocalroot
scope for a better way to manage newborns in cases where native hooks (functions, getters, setters, etc.) create many gc-things, potentially without connecting them to predefined local roots such as *rval or argv[i] in an active jsnative function.
... using js_enterlocalroot
scope disables updating of the context's per-gc-thing-type newborn roots, until control flow unwinds and leaves the outermost nesting local root
scope.
JS_EvaluateScript
obj jsobject * the
scope in which to execute the script.
... description js_evaluatescript compiles and executes a script in the specified
scope, obj.
JS_EvaluateScriptForPrincipals
obj jsobject * the
scope in which to execute the script.
... description js_evaluatescriptforprincipals compiles and executes a script in the specified
scope, obj.
JS_InitClass
its
scope matches that of the obj argument.
...the constructor for the class is built in the same context as cx, and in the same
scope as obj.
JS_ValueToObject
(implementation note: the object's jsobjectops.defaultvalue method is called with hint=jstype_object.) the resulting object is subject to garbage collection unless the variable *objp is protected by a local root
scope, an object property, or the js_addroot function.
... note that a local root
scope is not sufficient to protect the resulting object in some cases involving the valueof method!
SpiderMonkey 45
js_setcurrentembeddertimefunction (bug 1159507) js_getcurrentembeddertime (bug 1159507) js_mayresolvestandardclass (bug 1155946) js_getiteratorprototype (bug 1225392) js_globallexical
scope (bug 1202902) js_hasextensiblelexical
scope (bug 1202902) js_extensiblelexical
scope (bug 1202902) js_initreflectparse (bug 987514) js::toprimitive (bug 1206168) js::getfirstargumentastypehint (bug 1054756) js::objecttocompletepropertydescriptor (bug 1144366) js_setimmutableprototype (bug 1211607) js_getownucpropertydescriptor (bug 1211607) js_hasownpropertybyid (bug 1211607) js_hasownpro...
...perty (bug 1211607) js_deleteucproperty (bug 1211607) js::newfunctionfromspec (bug 1054756) js::compilefornonsyntactic
scope (bug 1165486) js_checkforinterrupt (bug 1058695) js::mapdelete (bug 1159469) js::mapforeach (bug 1159469) js::newsetobject (bug 1159469) js::setsize (bug 1159469) js::sethas (bug 1159469) js::setdelete (bug 1159469) js::setadd (bug 1159469) js::setclear (bug 1159469) js::setkeys (bug 1159469) js::setvalues (bug 1159469) js::setentries (bug 1159469) js::setforeach (bug 1159469) js::exceptionstackornull (bug 814497) js::copyasyncstack (bug 1160307) js::getsavedframesource (bug 1216819) js::getsavedframeline (bug 1216819) js::getsavedframecolumn (bug 1216819) js::getsavedframefunctiondisplayname (bug 1216819) js::getsavedframeasynccause (bug 1216819) j...
Avoiding leaks in JavaScript XPCOM components
in javascript, as in many interpreted languages, functions have access to the variables that are in
scope where they are created.
...(var declarations inside javascript functions are function-
scope, including the part of the function before the declaration.) this means that the value of iterator, the wrapper for the native tree walker, is reachable from the function.
Mozilla internal string guide
you must not access the string except via the handle until you call finish() on the handle in the success case or you let the handle go out of
scope without calling finish() in the failure case, in which case the destructor of the handle puts the string in a mostly harmless but consistent state (containing a single replacement character if a capacity greater than 0 was requested, or in the char case if the three-byte utf-8 representation of the replacement character doesn't fit, an ascii substitute).
...you can just use getter_copies() to wrap a string class argument, and the class will remember to free the buffer when it goes out of
scope: { nsstring val; getvalue(getter_copies(val)); // val will free itself here if (somecondition) return ns_error_failure; ...
Components.utils.Sandbox
you can then use it with evalinsandbox() to make it the global
scope object for the specified script.
... example executing in current tab
scope more ways to load scripts into a sandbox can be found on the loading scripts page.
Components.utils.makeObjectPropsNormal
ensures that the specified object's methods are all in the object's
scope, and aren't cross-component wrappers.
... syntax void components.utils.makeobjectpropsnormal(obj); parameters obj the object for which to ensure all methods are in its
scope.
IAccessibleText
servers only need to save the last inserted block of text() and a
scope of the entire application is adequate.
...servers only need to save the last removed block of text() and a
scope of the entire application is adequate.
nsIMsgIncomingServer
downloadonbiff boolean downloadsettings nsimsgdownloadsettings emptytrashonexit boolean filter
scope nsmsgsearch
scopevalue read only.
... search
scope nsmsgsearch
scopevalue read only.
nsIMsgSearchTerm
* @param a
scopeterm
scope of search * @param aoffset offset of message in message store.
... */ boolean matchbody(in nsimsgsearch
scopeterm a
scopeterm, in unsigned long long aoffset, in unsigned long alength, in string acharset, in nsimsgdbhdr amsg, in nsimsgdatabase adb); ...
Mozilla
it currently allows you to run javascript code in the same
scope as the main firefox browser window and report results using the same functions as the mochitest test framework.
... javascript code modules javascript code modules let multiple privileged javascript
scopes share code.
Browser Console - Firefox Developer Tools
but while the web console executes code in the page window
scope, the browser console executes them in the
scope of the browser's chrome window.
... but while the web console executes code in the
scope of the content window it's attached to, the browser console executes code in the
scope of the chrome window of the browser.
Examine, modify, and watch variables - Firefox Developer Tools
examine variables when the code has stopped at a breakpoint, you can examine its state in the variables pane of the debugger: variables are grouped by
scope: in function
scope you'll see the built-in arguments and this variables as well as local variables defined by the function like user and greeting.
... similarly, in global
scope you'll see global variables you've defined, like greetme, as well as built-in globals like localstorage and console.
Debugger.Script - Firefox Developer Tools
global if the instance refers to a jsscript, a debugger.object instance referring to the global object in whose
scope this script runs.
... isincatch
scope([offset]) if the instance refers to a jsscript, this is true if this offset falls within the
scope of a try block, and false otherwise.
Migrating from Firebug - Firefox Developer Tools
examine variables the watch side panel in firebug displays the window object (the global
scope) by default.
... with the script execution halted it shows the different variable
scopes available within the current call stack frame.
Split console - Firefox Developer Tools
as usual, $0 works as a shorthand for the element currently selected in the inspector: when you use the split console with the debugger, the console's
scope is the currently executing stack frame.
... so if you hit a breakpoint in a function, the
scope will be the function's
scope.
The JavaScript input interpreter - Firefox Developer Tools
the console suggests completions from the
scope of the currently executing stack frame.
... working with iframes if a page contains embedded iframes, you can use the cd() function to change the console's
scope to a specific iframe, and then you can execute functions defined in the document hosted by that iframe.
AbsoluteOrientationSensor - Web APIs
to use this sensor, the user must grant permission to the 'accelerometer', 'gyro
scope', and 'magnetometer' device sensors through the permissions api.
... const sensor = new absoluteorientationsensor(); promise.all([navigator.permissions.query({ name: "accelerometer" }), navigator.permissions.query({ name: "magnetometer" }), navigator.permissions.query({ name: "gyro
scope" })]) .then(results => { if (results.every(result => result.state === "granted")) { sensor.start(); ...
AnalyserNode.fftSize - Web APIs
example the following example shows basic usage of an audiocontext to create an analysernode, then requestanimationframe and <canvas> to collect time domain data repeatedly and draw an "oscillo
scope style" output of the current audio input.
... analyser.fftsize = 2048; var bufferlength = analyser.frequencybincount ; var dataarray = new uint8array(bufferlength); analyser.getbytetimedomaindata(dataarray); // draw an oscillo
scope of the current audio source function draw() { drawvisual = requestanimationframe(draw); analyser.getbytetimedomaindata(dataarray); canvasctx.fillstyle = 'rgb(200, 200, 200)'; canvasctx.fillrect(0, 0, width, height); canvasctx.linewidth = 2; canvasctx.strokestyle = 'rgb(0, 0, 0)'; canvasctx.beginpath(); var slicewidth = width * 1.0 / bufferlen...
AnalyserNode.getByteTimeDomainData() - Web APIs
return value void | none example the following example shows basic usage of an audiocontext to create an analysernode, then requestanimationframe and <canvas> to collect time domain data repeatedly and draw an "oscillo
scope style" output of the current audio input.
... analyser.fftsize = 2048; const bufferlength = analyser.fftsize; const dataarray = new uint8array(bufferlength); analyser.getbytetimedomaindata(dataarray); // draw an oscillo
scope of the current audio source function draw() { drawvisual = requestanimationframe(draw); analyser.getbytetimedomaindata(dataarray); canvasctx.fillstyle = 'rgb(200, 200, 200)'; canvasctx.fillrect(0, 0, width, height); canvasctx.linewidth = 2; canvasctx.strokestyle = 'rgb(0, 0, 0)'; const slicewidth = width * 1.0 / bufferlength; let x = 0; canvasctx.beginpath(); for(var i = 0...
AnalyserNode - Web APIs
basic usage the following example shows basic usage of an audiocontext to create an analysernode, then requestanimationframe and <canvas> to collect time domain data repeatedly and draw an "oscillo
scope style" output of the current audio input.
... analyser.fftsize = 2048; var bufferlength = analyser.frequencybincount; var dataarray = new uint8array(bufferlength); analyser.getbytetimedomaindata(dataarray); // get a canvas defined with id "oscillo
scope" var canvas = document.getelementbyid("oscillo
scope"); var canvasctx = canvas.getcontext("2d"); // draw an oscillo
scope of the current audio source function draw() { requestanimationframe(draw); analyser.getbytetimedomaindata(dataarray); canvasctx.fillstyle = "rgb(200, 200, 200)"; canvasctx.fillrect(0, 0, canvas.width, canvas.height); canvasctx.linewidth = 2; canvasctx.strokesty...
AudioProcessingEvent - Web APIs
note the the returned audiobuffer is only valid in the
scope of the onaudioprocess function.
...note the the returned audiobuffer is only valid in the
scope of the onaudioprocess function.
AudioWorkletProcessor - Web APIs
it lives in the audioworkletglobal
scope and runs on the web audio rendering thread.
... processing audio an example algorithm of creating a custom audio processing mechanism is: create a separate file; in the file: extend the audioworkletprocessor class (see "deriving classes" section) and supply your own process() method in it; register the processor using audioworkletglobal
scope.registerprocessor() method; load the file using addmodule() method on your audio context's audioworklet property; create an audioworkletnode based on the processor.
BaseAudioContext.createAnalyser() - Web APIs
example the following example shows basic usage of an audiocontext to create an analyser node, then use requestanimationframe() to collect time domain data repeatedly and draw an "oscillo
scope style" output of the current audio input.
... analyser.fftsize = 2048; var bufferlength = analyser.frequencybincount; var dataarray = new uint8array(bufferlength); analyser.getbytetimedomaindata(dataarray); // draw an oscillo
scope of the current audio source function draw() { drawvisual = requestanimationframe(draw); analyser.getbytetimedomaindata(dataarray); canvasctx.fillstyle = 'rgb(200, 200, 200)'; canvasctx.fillrect(0, 0, width, height); canvasctx.linewidth = 2; canvasctx.strokestyle = 'rgb(0, 0, 0)'; canvasctx.beginpath(); var slicewidth = width * 1.0 / bufferlen...
Clients.claim() - Web APIs
the claim() method of the clients interface allows an active service worker to set itself as the controller for all clients within its
scope.
... example the following example uses claim() inside service worker's "activate" event listener so that clients loaded in the same
scope do not need to be reloaded before their fetches will go through this service worker.
ContentIndex.add() - Web APIs
needs to be under the
scope of the current service worker.
...dexed content async function registercontent(data) { const registration = await navigator.serviceworker.ready; // feature detect content index if (!registration.index) { return; } // register content try { await registration.index.add(data); } catch (e) { console.log('failed to register content: ', e.message); } } the add method can also be used within the service worker
scope.
ContentIndex - Web APIs
async function unregistercontent(article) { // reference registration const registration = await navigator.serviceworker.ready; // feature detect content index if (!registration.index) return; // unregister content from index await registration.index.delete(article.id); } all the above methods are available within the
scope of the service worker.
... they are accessible from the workerglobal
scope.self property: // service worker script self.registration.index.add(item); self.registration.index.delete(item.id); const contentindexitems = self.registration.index.getall(); specifications specification status comment unknownthe definition of 'contentindex' in that specification.
Document.querySelectorAll() - Web APIs
by default, queryselectorall() only verifies that the last element in the selector is within the search
scope.
... the :
scope pseudo-class restores the expected behavior, only matching selectors on descendants of the base element: var select = document.queryselector('.select'); var inner = select.queryselectorall(':
scope .outer .inner'); inner.length; // 0 specifications specification status comment domthe definition of 'parentnode.queryselectorall()' in that specification.
Element.querySelectorAll() - Web APIs
by default, queryselectorall() only verifies that the last element in the selector is within the search
scope.
... the :
scope pseudo-class restores the expected behavior, only matching selectors on descendants of the base element: var select = document.queryselector('.select'); var inner = select.queryselectorall(':
scope .outer .inner'); inner.length; // 0 specifications specification status comment domthe definition of 'parentnode.queryselectorall()' in that specification.
Element - Web APIs
element.undo
scope is a boolean indicating if the element is an undo
scope host, or not.
... editor's draft added the undo
scope and undomanager properties.
FetchEvent.request - Web APIs
the serviceworkerglobal
scope.onfetch event handler listens for the fetch event.
... the code also handles exceptions thrown from the serviceworkerglobal
scope.fetch operation.
HTMLElement - Web APIs
htmlelement.item
scope is a boolean representing the item
scope.
... living standard added the following properties: translate, item
scope, itemtype, itemid, itemref, itemprop, properties, and itemvalue.
HTMLStyleElement - Web APIs
linkstyle.sheet read only returns the stylesheet object associated with the given element, or null if there is none htmlstyleelement.
scoped is a boolean value indicating if the element applies to the whole document (false) or only to the parent's sub-tree (true).
... recommendation the following property has been added:
scoped.
IDBTransaction.objectStore() - Web APIs
the objectstore() method of the idbtransaction interface returns an object store that has already been added to the
scope of this transaction.
... exceptions this method may raise a domexception of one of the following types: exception description notfounderror the requested object store is not in this transaction's
scope.
IDBTransaction - Web APIs
idbtransaction.mode read only the mode for isolating access to data in the object stores that are in the
scope of the transaction.
... idbtransaction.objectstore() returns an idbobjectstore object representing an object store that is part of the
scope of this transaction.
InstallEvent - Web APIs
the parameter passed into the oninstall handler, the installevent interface represents an install action that is dispatched on the serviceworkerglobal
scope of a serviceworker.
... examples this code snippet is from the service worker prefetch sample (see prefetch running live.) the code calls extendableevent.waituntil() in serviceworkerglobal
scope.oninstall and delays treating the serviceworkerregistration.installing worker as installed until the passed promise resolves successfully.
MessageEvent - Web APIs
cross-worker/document messaging (see the above two entries, but also worker.postmessage(), worker.onmessage, serviceworkerglobal
scope.onmessage, etc.) broadcast channels (see broadcastchannel.postmessage()) and broadcastchannel.onmessage).
...rker.port.postmessage([first.value,second.value]); console.log('message posted to worker'); } second.onchange = function() { myworker.port.postmessage([first.value,second.value]); console.log('message posted to worker'); } myworker.port.onmessage = function(e) { result1.textcontent = e.data; console.log('message received from worker'); } inside the worker we use the sharedworkerglobal
scope.onconnect handler to connect to the same port discussed above.
NotificationEvent - Web APIs
the parameter passed into the onnotificationclick handler, the notificationevent interface represents a notification click event that is dispatched on the serviceworkerglobal
scope of a serviceworker.
... note: this interface is specified in the notifications api, but accessed through serviceworkerglobal
scope.
ParentNode.querySelectorAll() - Web APIs
by default, queryselectorall() only verifies that the last element in the selector is within the search
scope.
... the :
scope pseudo-class restores the expected behavior, only matching selectors on descendants of the base element: var select = document.queryselector('.select'); var inner = select.queryselectorall(':
scope .outer .inner'); inner.length; // 0 specifications specification status comment domthe definition of 'parentnode.queryselectorall()' in that specification.
RelativeOrientationSensor - Web APIs
to use this sensor, the user must grant permission to the 'accelerometer', and 'gyro
scope' device sensors through the permissions api.
... const sensor = new relativeorientationsensor(); promise.all([navigator.permissions.query({ name: "accelerometer" }), navigator.permissions.query({ name: "gyro
scope" })]) .then(results => { if (results.every(result => result.state === "granted")) { sensor.start(); ...
Request - Web APIs
est() constructor (for an image file in the same directory as the script), then return some property values of the request: const request = new request('https://www.mozilla.org/favicon.ico'); const url = request.url; const method = request.method; const credentials = request.credentials; you could then fetch this request by passing the request object in as a parameter to a windoworworkerglobal
scope.fetch() call, for example: fetch(request) .then(response => response.blob()) .then(blob => { image.src = url.createobjecturl(blob); }); in the following snippet, we create a new request using the request() constructor with some initial data and body content for an api request which need a body payload: const request = new request('https://example.com', {method: 'post', body: '{"foo":...
... you could then fetch this api request by passing the request object in as a parameter to a windoworworkerglobal
scope.fetch() call, for example and get the response: fetch(request) .then(response => { if (response.status === 200) { return response.json(); } else { throw new error('something went wrong on api server!'); } }) .then(response => { console.debug(response); // ...
ServiceWorkerContainer - Web APIs
serviceworkercontainer.getregistration() gets a serviceworkerregistration object whose
scope matches the provided document url.
... if ('serviceworker' in navigator) { // register a service worker hosted at the root of the // site using the default
scope.
ServiceWorkerRegistration.unregister() - Web APIs
the promise will resolve to false if no registration was found, otherwise it resolves to true irrespective of whether unregistration happened or not (it may not unregister if someone else just called serviceworkercontainer.register() with the same
scope.) the service worker will finish any ongoing operations before it is unregistered.
... example the following simple example registers a service worker example, but then immediately unregisters it again: if ('serviceworker' in navigator) { navigator.serviceworker.register('/sw-test/sw.js', {
scope: 'sw-test'}).then(function(registration) { // registration worked console.log('registration succeeded.'); registration.unregister().then(function(boolean) { // if boolean = true, unregister is successful }); }).catch(function(error) { // registration failed console.log('registration failed with ' + error); }); }; specifications specification status ...
ServiceWorkerRegistration - Web APIs
serviceworkerregistration.
scope read only returns a unique identifier for a service worker registration.
...an active worker will control a serviceworkerclient if the client's url falls within the
scope of the registration (the
scope option set when serviceworkercontainer.register is first called.) serviceworkerregistration.navigationpreload read only returns the instance of navigationpreloadmanager associated with the current service worker registration.
SharedWorker() - Web APIs
name optional a domstring specifying an identifying name for the sharedworkerglobal
scope representing the
scope of the worker, which is mainly useful for debugging purposes.
... name: a domstring specifying an identifying name for the sharedworkerglobal
scope representing the
scope of the worker, which is mainly useful for debugging purposes.
SharedWorker - Web APIs
they implement an interface different than dedicated workers and have a different global
scope, sharedworkerglobal
scope.
...rker.port.postmessage([first.value,second.value]); console.log('message posted to worker'); } second.onchange = function() { myworker.port.postmessage([first.value,second.value]); console.log('message posted to worker'); } myworker.port.onmessage = function(e) { result1.textcontent = e.data; console.log('message received from worker'); } inside the worker we use the sharedworkerglobal
scope.onconnect handler to connect to the same port discussed above.
Web Audio API - Web APIs
audioworkletprocessor the audioworkletprocessor interface represents audio processing code running in a audioworkletglobal
scope that generates, processes, or analyses audio directly, and can pass messages to the corresponding audioworkletnode.
... audioworkletglobal
scope the audioworkletglobal
scope interface is a workletglobal
scope-derived object representing a worker context in which an audio processing script is run; it is designed to enable the generation, processing, and analysis of audio data directly using javascript in a worklet thread rather than on the main thread.
Worker.onmessage - Web APIs
from the dedicatedworkerglobal
scope.postmessage method).
...t: onmessage = function(e) { console.log('message received from main script'); var workerresult = 'result: ' + (e.data[0] * e.data[1]); console.log('posting message back to main script'); postmessage(workerresult); } notice how in the main script, onmessage has to be called on myworker, whereas inside the worker script you just need onmessage because the worker is effectively the global
scope (dedicatedworkerglobal
scope).
Worker - Web APIs
when a message is sent to the parent document from the worker via dedicatedworkerglobal
scope.postmessage.
... worker.postmessage() sends a message — consisting of any javascript object — to the worker's inner
scope.
ARIA: cell role - Accessibility
role="columnheader" a header cell that is the structural equivalent of the html <th> element with a column
scope.
... role="rowheader" a header cell that is the structural equivalent of the html <th> element with a row
scope.
ARIA: row role - Accessibility
role="columnheader" a header cell that is the structural equivalent of the html <th> element with a column
scope.
... role="rowheader" a header cell that is the structural equivalent of the html <th> element with a row
scope.
Variable fonts guide - CSS: Cascading Style Sheets
custom axes are in fact limitless: the typeface designer can define and
scope any axis they like, and are just required to give it a four-letter tag to identify it within the font file format itself.
... working with older browsers variable font support can be checked with css feature queries (see @supports), so it's possible to use variable fonts in production and
scope the css calling the variable fonts inside a feature query block.
Using CSS counters - CSS: Cascading Style Sheets
the generated text is the value of the innermost counter of the given name in
scope at the given pseudo-element.the counter is rendered in the specified style (decimal by default).
...the generated text is the value of all counters with the given name in
scope at the given pseudo-element, from outermost to innermost, separated by the specified string.
Pseudo-classes - CSS: Cascading Style Sheets
st :host() :host-context() :hover :indeterminate :in-range :invalid :is() :lang() :last-child :last-of-type :left :link :local-link :not() :nth-child() :nth-col() :nth-last-child() :nth-last-col() :nth-last-of-type() :nth-of-type() :only-child :only-of-type :optional :out-of-range :past :placeholder-shown :read-only :read-write :required :right :root :
scope :state() :target :target-within :user-invalid :valid :visited :where() specifications specification status comment fullscreen api living standard defined :fullscreen.
... selectors level 4 working draft defined :any-link, :blank, :local-link, :
scope, :drop, :current, :past, :future, :placeholder-shown, :user-invalid, :nth-col(), :nth-last-col(), :is() and :where().
Using CSS custom properties (variables) - CSS: Cascading Style Sheets
like any other property, this is written inside a ruleset, like so: element { --main-bg-color: brown; } note that the selector given to the ruleset defines the
scope that the custom property can be used in.
... a common best practice is to define custom properties on the :root pseudo-class, so that it can be applied globally across your html document: :root { --main-bg-color: brown; } however, this doesn't always have to be the case: you maybe have a good reason for limiting the
scope of your custom properties.
content - CSS: Cascading Style Sheets
the generated text is the value of the innermost counter of the given name in
scope at the given pseudo-element.
...the generated text is the value of all counters with the given name in
scope at the given pseudo-element, from outermost to innermost, separated by the specified string.
Content categories - Developer guides
note: a more detailed discussion of these content categories and their comparative functionalities is beyond the
scope of this article; for that, you may wish to read the relevant portions of the html specification.
... a few other elements belong to this category, but only if a specific condition is fulfilled: <area>, if it is a descendant of a <map> element <link>, if the itemprop attribute is present <meta>, if the itemprop attribute is present <style>, if the
scoped attribute is present sectioning content elements belonging to the sectioning content model create a section in the current outline that defines the
scope of <header> elements, <footer> elements, and heading content.
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
here are some sample colors in hsl notation: table { border: 1px solid black; font: 16px "open sans", helvetica, arial, sans-serif; border-spacing: 0; border-collapse: collapse; } th, td { border: 1px solid black; padding:4px 6px; text-align: left; } th { background-color: hsl(0, 0%, 75%); } <table> <thead> <tr> <th
scope="col">color in hsl notation</th> <th
scope="col">example</th> </tr> </thead> <tbody> <tr> <td><code>hsl(90deg, 100%, 50%)</code></td> <td style="background-color: hsl(90deg, 100%, 50%);"> </td> </tr> <tr> <td><code>hsl(90, 100%, 50%)</code></td> <td style="background-color: hsl(90, 100%, 50%);"> </td> </tr> <tr> <td><code>hsl(0.15turn, 50%, 75%)</code></t...
... color theory resources a full review of color theory is beyond the
scope of this article, but there are plenty of articles about color theory available, as well as courses you can find at nearby schools and universities.
<style>: The Style Information element - HTML: Hypertext Markup Language
deprecated attributes
scoped this attribute specifies that the styles only apply to the elements of its parent(s) and children.
... <style> p { color: white; background-color: blue; padding: 5px; border: 1px solid black; } </style> <style media="all and (max-width: 500px)"> p { color: blue; background-color: yellow; } </style> </head> <body> <p>this is my paragraph.</p> </body> </html> technical summary content categories metadata content, and if the
scoped attribute is present: flow content.
Memory Management - JavaScript
in this context, the notion of an "object" is extended to something broader than regular javascript objects and also contain function
scopes (or the global lexical
scope).
...they will go out of
scope after the function call has completed.
Array.prototype[@@iterator]() - JavaScript
examples iteration using for...of loop html <ul id="letterresult"> </ul> javascript var arr = ['a', 'b', 'c']; var earr = arr[symbol.iterator](); var letterresult = document.getelementbyid('letterresult'); // your browser must support for..of loop // and let-
scoped variables in for loops // const and var could also be used for (let letter of earr) { letterresult.innerhtml += "<li>" + letter + "</li>"; } result alternative iteration var arr = ['a', 'b', 'c', 'd', 'e']; var earr = arr[symbol.iterator](); console.log(earr.next().value); // a console.log(earr.next().value); // b console.log(earr.next().value); // c console.log(earr.next().value); // d c...
... function logiterable(it) { if (!(symbol.iterator in object.getprototypeof(it) /* or "symbol.iterator in object.__proto__" or "it[symbol.iterator]" */)) { console.log(it, ' is not an iterable object...'); return; } var iterator = it[symbol.iterator](); // your browser must support for..of loop // and let-
scoped variables in for loops // const and var could also be used for (let letter of iterator) { console.log(letter); } } // array logiterable(['a', 'b', 'c']); // a // b // c // string logiterable('abc'); // a // b // c logiterable(123); // 123 " is not an iterable object..." specifications specification ecmascript (ecma-262)the definition of 'array.prototype[@@i...
AsyncFunction - JavaScript
note: async functions created with the asyncfunction constructor do not create closures to their creation contexts; they are always created in the global
scope.
... when running them, they will only be able to access their own local variables and global ones, not the ones from the
scope in which the asyncfunction constructor was called.
Error.prototype.stack - JavaScript
the stack string proceeds from the most recent calls to earlier ones, leading back to the original global
scope call.
... description each step will be separated by a newline, with the first part of the line being the function name (if not a call from the global
scope), then by an at (@) sign, the file location (except when the function is the error constructor as the error is being thrown), a colon, and, if there is a file location, the line number.
Function.prototype.bind() - JavaScript
if no arguments are provided to bind , or if the thisarg is null or undefined, the this of the executing
scope is treated as the thisarg for the new function.
...creating a bound function from the function, using the original object, neatly solves this problem: this.x = 9; // 'this' refers to global 'window' object here in a browser const module = { x: 81, getx: function() { return this.x; } }; module.getx(); // returns 81 const retrievex = module.getx; retrievex(); // returns 9; the function gets invoked at the global
scope // create a new function with 'this' bound to module // new programmers might confuse the // global variable 'x' with module's property 'x' const boundgetx = retrievex.bind(module); boundgetx(); // returns 81 partially applied functions the next simplest use of bind() is to make a function with pre-specified initial arguments.
GeneratorFunction - JavaScript
note: generator function created with the generatorfunction constructor do not create closures to their creation contexts; they are always created in the global
scope.
... when running them, they will only be able to access their own local variables and global ones, not the ones from the
scope in which the generatorfunction constructor was called.
instanceof - JavaScript
frames or windows) different
scopes have different execution environments.
...unlike standard javascript globals, the test obj instanceof xpcominterface works as expected, even if obj is from a different
scope.
typeof - JavaScript
but with the addition of block-
scoped let and statements/const using typeof on let and const variables (or using typeof on a class) in a block before they are declared will throw a referenceerror.
... block
scoped variables are in a "temporal dead zone" from the start of the block until the initialization is processed, during which, it will throw an error if accessed.
switch - JavaScript
block-
scope variables within switch statements with ecmascript 2015 (es6) support made available in most modern browsers, there will be cases where you would want to use let and const statements to declare block-
scoped variables.
...ultimately, this is due to both let statements being interpreted as duplicate declarations of the same variable name within the same block
scope.
try...catch - JavaScript
try { throw 'myexception'; // generates an exception } catch (e) { // statements to handle any exceptions logmyerrors(e); // pass exception object to error handler } the catch-block specifies an identifier (e in the example above) that holds the value of the exception; this value is only available in the
scope of the catch-block.
...this identifier is only available in the catch-block's
scope.
Index - XSLT: Extensible Stylesheet Language Transformations
14 an overview needshelp, needsmarkupwork, transforming_xml_with_xslt, xml, xslt the extensible stylesheet language/transform is a very powerful language, and a complete discussion of it is well beyond the
scope of this article, but a brief discussion of some basic concepts will be helpful in understanding the description of netscape's capabilities that follows.
...because xslt permits no side-effects, once the value of the variable has been established, it remains the same until the variable goes out of
scope 53 <xsl:when> element, reference, xslt, when the <xsl:when> element always appears within an <xsl:choose> element, acting like a case statement.
Content Processes - Archive of obsolete content
a full discussion of the different kinds of security wrappers and how they work is out of
scope for this document, but the main point is this: security wrappers are very complex, and very error-prone.
core/heritage - Archive of obsolete content
to do that we need to freeze constructor's prototype chain to make sure functions are frozen: object.freeze(dog.prototype); object.freeze(pet.prototype); note: also, this is not quite enough as object.prototype stays mutable & in fact we do little bit more in sdk to address that, but it's not in the
scope of this documentation.
lang/type - Archive of obsolete content
the difference is that the type constructor can be from a
scope that has a different top level object: for example, it could be from a different iframe, module or sandbox.
Displaying annotations - Archive of obsolete content
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, ancho...
Storing annotations - Archive of obsolete content
first, import the simple-storage module with a declaration like: var simplestorage = require('sdk/simple-storage'); in the module
scope, initialize an array which will contain the stored annotations: if (!simplestorage.storage.annotations) simplestorage.storage.annotations = []; now we'll add a function to the module
scope which deals with a new annotation.
File I/O - Archive of obsolete content
here are some of the special locations the directory service supports: (
scope: d = product-wide, f = profile wide) string
scope meaning achrom d %curprocd%/chrome aplugns d %curprocd%/plugins (deprecated - use aplugnsdl) aplugnsdl d comsd n/a %curprocd%/components curprocd n/a current working directory (usually the application's installation directory).
Post data to window - Archive of obsolete content
posting data to the current tab there is a convenience method in global
scope (in firefox, chrome://browser/content/browser.js): loaduri(auri, areferrer, apostdata, aallowthirdpartyfixup); posting data to a new window window.opendialog('chrome://browser/content', '_blank', 'all,dialog=no', auri, aflags, areferrer, apostdata); ...
Rosetta - Archive of obsolete content
also, regarding some languages (like c), it is even not well defined the meaning of part of their semantics in respect to a
scope that is more restricted than the full access to the resources they usually deal with – imagine, for example, the meaning of a c pointer within a html page!
View Source for XUL Applications - Archive of obsolete content
importing gviewsourceutils xul applications wanting to show the source code for documents should import the viewsourceutils.js script instead of attempting to open the viewsource.xul window themselves: <script type="application/javascript" src="chrome://global/content/viewsourceutils.js"/> viewsourceutils.js exposes a gviewsourceutils global into the
scope of the window that imports that script.
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
te; var domfragment = jsontodom(jsontemplatebtn, document, capturednodes); palette.appendchild(domfragment); alert("capturednodes contains any created nodes that have optionally been captured (for later convenient javascript access) by giving them a 'key' attribute; for example: " + capturednodes.mytestbutton123); another example this here is another example of using jsontodom but in the html
scope, a complex form is created with ease.
Firefox addons developer guide - Archive of obsolete content
sure documentation is relevant for all platforms: gnu/linux, macos, windows; add anchor links to figures & listings; add credits to original authors and license; completed sometimes, interfaces names are misspelled: s/nsl/nsi; talk about fuel; titles of chapters and sub-headings should have caps for first letter of each word; we should add a part about bad and good practices (leaks, global
scopes, ...); add external resources (mozdev.org/community/books.html); add to chapter 3 or 5 more informations about overlay (how to overlay some interesting part of firefox like status bar, menus or toolbar) add previous/next at the end of each chapter questions: opensource appendix.
Processing XML with E4X - Archive of obsolete content
these filter operations are specified using an expression contained in parentheses: var html = <html> <p id="p1">first paragraph</p> <p id="p2">second paragraph</p> </html>; alert(html.p.(@id == "p1")); // alerts "first paragraph" nodes matching the path before the expression (in this case the paragraph elements) are added to the
scope chain before the expression is evaluated, as if they had been specified using the with statement.
Namespaces - Archive of obsolete content
you can declare the default namespace for your e4x objects by placing the statement: default xml namespace = "http://www.w3.org/1999/xhtml"; within the same
scope as your e4x.
2D collision detection - Game development
implementing sat is out of
scope for this page so see the recommended tutorials below: separating axis theorem (sat) explanation collision detection and response collision detection using the separating axis theorem sat (separating axis theorem) separating axis theorem collision performance while some of these algorithms for collision detection are simple enough to calculate, it can be a waste of cycles to test *every*...
Bounding volume collision detection with THREE.js - Game development
// expand three.js sphere to support collision tests vs box3 // we are creating a vector outside the method
scope to // avoid spawning a new instance of vector3 on every check three.sphere.__closest = new three.vector3(); three.sphere.prototype.intersectsbox = function (box) { // get box closest point to sphere center by clamping three.sphere.__closest.set(this.center.x, this.center.y, this.center.z); three.sphere.__closest.clamp(box.min, box.max); var distance = this.center.distancetosqua...
Efficient animation for web games - Game development
a take-away to help combat poor animation performance, chris lord wrote animator.js, a simple, easy-to-use animation library, heavily influenced by various parts of clutter, but with a focus on avoiding
scope-creep.
Gecko FAQ - Gecko Redirect 1
by the end of calendar year 2000, gecko is expected to support the following recommended open internet standards fully except for the areas noted below and open bugs documented in bugzilla: html 4.0 - full support except for: elements: bdo, basefont attributes: shape attribute on the a element, abbr, axis, headers,
scope-row,
scope-col,
scope-rowgroup,
scope-colgroup, charoff, datasrc, datafld, dataformat, datapagesize, summary, event, dir, align on table columns, label attribute of option, alternate text of area elements, longdesc various metadata attributes: cite, datetime, lang, hreflang bidirectional text layout, which is only used in hebrew and arabic (ibm has begun work to add bidi support in a future...
Vue conditional rendering: editing existing todos - Learn web development
: string, required: true }, id: { type: string, required: true } }, data() { return { newlabel: this.label }; }, methods: { onsubmit() { if (this.newlabel && this.newlabel !== this.label) { this.$emit("item-edited", this.newlabel); } }, oncancel() { this.$emit("edit-cancelled"); } } }; </script> <style
scoped> .edit-label { font-family: arial, sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; color: #0b0c0c; display: block; margin-bottom: 5px; } input { display: inline-block; margin-top: 0.4rem; width: 100%; min-height: 4.4rem; padding: 0.4rem 0.8rem; border: 2px solid #565656; } form { display: flex; flex-direction: row; flex-wrap: wra...
Introduction to automated testing - Learn web development
automation makes things easy throughout this module we have detailed loads of different ways in which you can test your websites and apps, and explained the sort of
scope your cross-browser testing efforts should have in terms of what browsers to test, accessibility considerations, and more.
Chrome Worker Modules
in particular, globals (string, math, object, self) and the worker global
scope itself (this) are shared between workers.
ESLint
here are some common issues: my script is imported into the global browser.xul
scope.
Cross Process Object Wrappers
performance although the wrapper looks just like an object completely contained in the chrome script
scope, it's really just a reference to an object in the content process.
Process scripts
however, a problem with frame scripts is that they can be loaded multiple times in the content process, in multiple
scopes that are insulated from each other.
Message manager overview
these scripts are called frame scripts, and as the name suggests, they are
scoped to a specific browser frame.
Chrome-only API reference
it works exactly like a standard worker, except that it has access to js-ctypes via a global ctypes object available in the global
scope of the worker.
Overview of Mozilla embedding APIs
// save webbrowser before it goes out of
scope :-) web navigation the nsiwebnavigation interface is used to load uris into the webbrowser and provide access to session history capabilities - such as back and forward.
Embedding Tips
eturn ns_error_failure; nsxpidlcstring previous; catman->addcategoryentry(javascript_global_property_category, "my_prop_name", "my_prop_contract_id", pr_true, pr_true, getter_copies(previous)); this will cause a component with the contract id my_prop_contract_id to be lazily created when the my_prop_name is resolved in any javascript window
scope.
IPDL Tutorial
process: class pluginchild : public ppluginchild { protected: void recvinit(const nscstring& pluginpath) { mpluginlibrary = pr_loadlibrary(pluginpath.get()); sendready(); } void recvshutdown() { pr_unloadlibrary(mpluginlibrary); } private: prlibrary* mpluginlibrary; }; launching the subprocess and hooking these protocol actors into our ipc "transport layer" is beyond the
scope of this document.
Addon
scope read only integer indicates what
scope the add-on is installed in, per profile, user, system, or application.
Assert.jsm
to use it, you first need to import the code module into your javascript
scope: components.utils.import("resource://testing-common/assert.jsm"); the assert class offers methods for performing common logical assertions.
DeferredTask.jsm
to use it, you first need to import the code module into your javascript
scope: components.utils.import("resource://gre/modules/deferredtask.jsm"); use this, for instance, if you write data to a file and you expect that you may have to rewrite data very soon afterwards.
Dict.jsm
to use it, you first need to import the code module into your javascript
scope: components.utils.import("resource://gre/modules/dict.jsm"); creating a dictionary you can create a new, empty dictionary by simply calling the dict() constructor: var newdict = new dict(); if you wish, you may also pass in an object literal of key/value pairs with which to initialize the dictionary: var someobj = {}; var newdict = new dict({key1: "foo", key2: someobj}); note that values may be any javascript object type.
DownloadLastDir.jsm
to use this, you first need to import the code module into your javascript
scope: components.utils.import("resource://gre/modules/downloadlastdir.jsm"); if you are using addon sdk, you can import the code module as: let { cu } = require("chrome"); let downloadlastdir = cu.import("resource://gre/modules/downloadlastdir.jsm").downloadlastdir; once you've imported the module, you can then use the downloadlastdir object it exports.
Downloads.jsm
to use it, you first need to import the code module into your javascript
scope: components.utils.import("resource://gre/modules/downloads.jsm"); method overview promise<download> createdownload(object aproperties); promise<void> fetch(asource, atarget, [optional] object aoptions); promise<downloadlist> getlist(atype); promise<downloadsummary> getsummary(atype); constants constant description public work on downloads that were not started from a private browsing window.
FileUtils.jsm
to use it, you first need to import the code module into your javascript
scope: components.utils.import("resource://gre/modules/fileutils.jsm"); the file constructor if you have a path to a file (or directory) you want to obtain an nsifile for, you can do so using the file constructor, like this: var f = new fileutils.file(mypath); method overview nsifile getfile(string key, array patharray, bool followlinks); nsifile getdir(string key, array patharray, bool shouldcreate, bool followlinks); nsifileoutputstream openfileoutputstream(nsifile file, int modeflags); nsifileoutputstream openatomicfileoutputstream(nsifile file, int modeflags); nsifileoutputst...
Geometry.jsm
to use these routines, you first need to import the code module into your javascript
scope: components.utils.import("resource://gre/modules/geometry.jsm"); once you've imported the module, you can then use the point and rect classes.
ISO8601DateUtils.jsm
to use this, you first need to import the code module into your javascript
scope: components.utils.import("resource://gre/modules/iso8601dateutils.jsm"); once you've imported the module, you can then use the iso8601dateutils object it exports.
Log.jsm
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.
NetUtil.jsm
to use these utilities, you first need to import the code module into your javascript
scope: components.utils.import("resource://gre/modules/netutil.jsm"); once you've imported the module, you can then use its methods.
PerfMeasurement.jsm
before you can use this module, you need to import it into your
scope: components.utils.import("resource://gre/modules/perfmeasurement.jsm") see measuring performance using the perfmeasurement.jsm code module for details on how to use this api.
PopupNotifications.jsm
to use this, you first need to import the code module into your javascript
scope: components.utils.import("resource://gre/modules/popupnotifications.jsm"); once you've imported the module, you can then use the popupnotifications object it exports; this object provides methods for creating and displaying popup notification panels.
Promise.jsm
to use it, you first need to import the code module into your javascript
scope: components.utils.import("resource://gre/modules/promise.jsm"); note: a preliminary promise module is also available starting from gecko 17, though it didn't conform to the promises/a+ proposal until gecko 25: components.utils.import("resource://gre/modules/commonjs/promise/core.js"); // gecko 17 to 20 components.utils.import("resource://gre/modules/commonjs/sdk/core/promise.js"); // gec...
PromiseUtils.jsm
to use it, you first need to import the code module into your javascript
scope: components.utils.import("resource://gre/modules/promiseutils.jsm"); method overview deferred defer(); methods defer() creates a new pending promise and provides methods to resolve or reject this promise.
Services.jsm
to use it, you first need to import the code module into your javascript
scope: const {services} = chromeutils.import("resource://gre/modules/services.jsm"); then you can obtain references to services by simply accessing them from the services object exported by the code module.
Sqlite.jsm
before you can use this module, you need to import it into your
scope: components.utils.import("resource://gre/modules/sqlite.jsm") obtaining a connection sqlite.jsm exports the sqlite symbol.
Task.jsm
to use it, you first need to import the code module into your javascript
scope: components.utils.import("resource://gre/modules/task.jsm"); introduction for an introduction to tasks, you may start from the task.js documentation, keeping in mind that only the core subset is implemented in this module.
Using workers in JavaScript code modules
it works exactly like a standard worker, except that it has access to js-ctypes via a global ctypes object available in the global
scope of the worker obsolete since gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5)this feature is obsolete.
openLocationLastURL.jsm
to use this, you first 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.
source-editor.jsm
to use it, you first need to import the code module into your javascript
scope: components.utils.import("resource:///modules/source-editor.jsm"); warning: much of the functionality of the source editor is implemented by a secondary code module (by default, source-editor-orion.jsm).
Localization sign-off reviews
sign-off review criteria since the
scope of each qa review process varies, the criteria used to evaluate a localizer's work also varies.
mozilla::MonitorAutoEnter
when the mozilla::monitorautoenter goes out of
scope, its destructor will exit() the underlying mozilla::monitorautoenter.
mozilla::MutexAutoLock
when the mozilla::mutexautolock goes out of
scope, its destructor will unlock() the underlying mozilla::mutex.
mozilla::MutexAutoUnlock
when the mozilla::mutexautounlock goes out of
scope, its destructor will lock() the underlying mozilla::mutex.
DMD
instructions on how to root your device is outside the
scope of this document.
NSPR API Reference
s miscellaneous types size type pointer difference types boolean types status type for return values threads threading types and constants threading functions creating, joining, and identifying threads controlling thread priorities controlling per-thread private data interrupting and yielding setting global thread concurrency getting a thread's
scope process initialization identity and versioning name and version constants initialization and cleanup module initialization locks lock type lock functions condition variables condition variable type condition variable functions monitors monitor type monitor functions cached monitors cached monitor functions i/o types directory type file descript...
Index
issueraltnames non-critical name-list where: subjaltnames: identifies the name of an extension should be set to 0 since this is non-critical extension name-list: comma separated list of names * add crl number extension: the crl number is a non-critical crl extension which conveys a monotonically increasing sequence number for a given crl
scope and crl issuer.
NSS tools : crlutil
issueraltnames non-critical name-list where: subjaltnames: identifies the name of an extension should be set to 0 since this is non-critical extension name-list: comma separated list of names * add crl number extension: the crl number is a non-critical crl extension which conveys a monotonically increasing sequence number for a given crl
scope and crl issuer.
NSS Tools crlutil
issueraltnames non-critical name-list where: subjaltnames: identifies the name of an extension should be set to 0 since this is non-critical extension name-list: comma separated list of names add crl number extension: the crl number is a non-critical crl extension which conveys a monotonically increasing sequence number for a given crl
scope and crl issuer.
NSS tools : crlutil
issueraltnames non-critical name-list where: subjaltnames: identifies the name of an extension should be set to 0 since this is non-critical extension name-list: comma separated list of names * add crl number extension: the crl number is a non-critical crl extension which conveys a monotonically increasing sequence number for a given crl
scope and crl issuer.
Necko walkthrough
once this object goes out of
scope, mcallback->oninputstreamready is called.
Rhino documentation
scopes and contexts describes how to use
scopes and contexts for the best performance and flexibility, with an eye toward multithreaded environments.
Scripting Java
} previously such functionality was available only to embeddings that used org.mozilla.javascript.importertoplevel class as the top level
scope.
SpiderMonkey Build Documentation
building your application while "how to build your complete application" is clearly out of
scope for this document, here are some tips that will help get you on your way: the spidermonkey developers frequently and deliberately change the jsapi abi.
GC Rooting Guide
obj.set(foo()); } (note that the above should probably check the return value and propagate an error on null), or: jsobject* somefunction(jscontext* cx) { js::rooted<jsobject*> obj(cx, foo()); { // make a
scope to force the destructor to run before obj is unwrapped.
Exact Stack Rooting
this is used to make handles for things like
scope chain objects, which aren't explicitly rooted themselves, but are always reachable from the implicit stack roots.
JIT Optimization Outcomes
singleton types are assigned to objects that are "one of a kind", such as global objects, literal objects declared in the global
scope, and top-level function objects.
JSAPI Cookbook
// javascript var global = this; there is a function, js_getglobalfor
scopechain(cx), that makes a best guess, and sometimes that is the best that can be done.
JS::AutoIdArray
examples { js::autoidarray ids(cx, js_enumerate(cx, obj)); if (!ids) // check the returned value from js_enumerate return false; for (int32_t i = 0, len = ids.length(); i < len; i++) { somefunc(cx, ids[i]); } /* when leaving this
scope, the jsidarray returned by js_enumerate is freed.
JS::CompileOptions
the code declaring the instance guarantees that such option values will outlive the compileoptions itself: objects are otherwise rooted; principals have had their reference counts bumped; strings will not be freed until the compileoptions goes out of
scope.
JS_NewGlobalObject
but otherwise, callers must take care to fire the hook exactly once before compiling any script in the global's
scope (we have assertions in place to enforce this).
JS_NewScriptObject
once you have created a script, you should immediately ensure that its script object is reachable (perhaps by using js_addroot or js_enterlocalroot
scope).
JS_ValueToFunction
unless the function happens to be a native function, this means it isn't attached to any global or enclosing
scope, and therefore must not be treated like a real function.
JSDBGAPI
pctolinenumber js_linenumbertopc js_getfunctionscript js_getfunctionnative js_getfunctionfastnative js_getscriptprincipals typedef jsstackframe js_frameiterator js_getframescript js_getframepc js_getscriptedcaller js_stackframeprincipals js_evalframeprincipals js_getframeannotation js_setframeannotation js_getframeprincipalarray js_isnativeframe js_getframeobject js_getframe
scopechain js_getframecallobject js_getframethis js_getframefunction js_getframefunctionobject js_isconstructorframe js_isdebuggerframe js_getframereturnvalue js_setframereturnvalue js_getframecalleeobject js_getscriptfilename js_getscriptbaselinenumber js_getscriptlineextent js_getscriptversion js_gettopscriptfilenameflags js_getscriptfilenameflags js_flagscriptfilenameprefix ...
Zest implementation
future versions of zest are planned which will significantly increase the
scope of the language.
Using RAII classes in Mozilla
ensuring raii classes are not used as temporaries a common mistake when using raii classes is to accidentally forget to name object, which causes its
scope to be different from what is intended.
Building the WebLock UI
as you can see, weblock is initialized as a global javascript variable, available in the
scope of these functions and others: var weblock = components.classes["@dougt/weblock"] .getservice() .queryinterface(components.interfaces.iweblock); in addition to this basic setup, you must also write javascript that uses the addsite method to add new sites to the white list.
Setting up the Gecko 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).
Detailed XPCOM hashtable guide
contains hash functions for most key types, including narrow and wide strings, pointers, and most binary data: void* (or nsisupports*) cast using ns_ptr_to_int32 char* string nscrt::hashcode() prunichar* string nsastring hashstring() nsacstring nsid& nsidhashkey::hashkey() writing a good hash function is well beyond the
scope of this document, and has been discussed extensively in computer-science circles for many years.
IAccessibleTable
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.
IAccessibleTable2
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.
nsIAbstractWorker
see also using web workers nsiworkermessageport nsiworkermessageevent nsiworker
scope nsiworkerglobal
scope nsiworker ...
nsIContentFrameMessageManager
examples once you obtain the conten frame messge manager, you can send messages to listeners who registered with services.mm.addmessagelistener get content message manager from browser this could would run in a nsidomwindow
scope.
nsIDOMXPathEvaluator
creatensresolver() creates an nsidomxpathexpression which resolves name spaces with respect to the definitions in
scope for a specified node.
nsIJetpack
when evaluated, the script's global
scope will include all privileged apis.
nsIMsgFilterCustomAction
* * @param type the filter type * @param
scope the search
scope * * @return true if valid */ boolean isvalidfortype(in nsmsgfiltertypetype type, in nsmsgsearch
scopevalue
scope); /** * after the user inputs a particular action value for the action, determine * if that value is valid.
nsINavBookmarksService
from c++ code inside the places component, use nsbookmarksupdatebatcher defined in nsnavbookmarks.h to
scope batches.
nsINavHistoryResult
when a result goes out of
scope it will continue to observe changes till it is cycle collected.
nsIPropertyBag
the window
scope is not always accessible so the window.navigator cannot be accessed.
nsIWebContentHandlerRegistrar
to take from: http://mxr.mozilla.org/mozilla-release/source/browser/components/feeds/src/webcontentconverter.js#372 and http://stackoverflow.com/questions/24900655/use-registerprotocolhandler-without-contentwindow place holder see also nsiwebcontentsonverterservice (under construction: page doesnt exist yet) registerprotocolhandler from non-privelaged
scope web api interfaces > navigator.registercontenthandler() web api interfaces > navigator.registerprotocolhandler() ...
nsIWorkerMessageEvent
see also using web workers nsiworkermessageport nsiworkerglobal
scope nsiworker
scope nsiabstractworker nsiworker ...
nsIWorkerMessagePort
see also using web workers nsiworkermessageevent nsiworkerglobal
scope nsiworker
scope nsiabstractworker nsiworker ...
XPCOM Interface Reference by grouping
et nsistylesheetservice url nsiuri nsiurl util nsidomserializer nsidomxpathevaluator nsidomxpathexception nsidomxpathexpression nsidomxpathresult xslt nsixsltexception nsixsltprocessor download nsidownload nsidownloadmanager nsidownloadprogresslistener element internal nsiworker nsiworkerglobal
scope nsiworkermessageevent nsiworkermessageport nsiworker
scope tree nsitreeboxobject nsitreecolumn nsitreecolumns nsitreecontentview nsitreeselection nsitreeview xform nsixformsmodelelement nsixformsnsinstanceelement nsixformsnsmodelelement xmlhttprequest nsixmlhttprequesteventtarget favicon nsifavicondatacallback ...
NS_CStringContainerInit
therefore, it is generally better to use nsembedcstring, to instantiate a nsacstring object, since it automatically releases allocated memory when the object goes out of
scope.
NS_CStringContainerInit2
it is generally better to use one of the helper classes, such as nscstring, instead of coding directly to ns_cstringcontainerinit2 because those classes take care of cleaning up the string object when it goes out of
scope.
NS_StringContainerInit
therefore, it is generally better to use nsembedstring, to instantiate a nsastring object, since it automatically releases allocated memory when the object goes out of
scope.
Address Book examples
for example, in order to register a load listener for a contact, the following should take place within the
scope of the contact editor dialog: /* an example load listener for a contact * acard the nsiabcard being loaded * adocument a reference to the contact editor document */ function foo(acard, adocument) { // do something useful, like disabling // input fields that cards for this // address book type do not support.
Filelink Providers
the xhtml page should have a function in the global
scope called onloadprovider.
Using js-ctypes
this is as simple as including the following line of code in the desired javascript
scope: components.utils.import("resource://gre/modules/ctypes.jsm") loading a native library once you've imported the code module, you can call the ctypes.open() method to load each native library you wish to use.
ABI
http://en.wikipedia.org/wiki/application_binary_interface os specific windows https://msdn.microsoft.com/en-us/library/k2b2ssfy.aspx https://msdn.microsoft.com/en-us/library/9b372w95.aspx details with respect to js-ctypes this explains how to use it in the js-ctypes
scope.
CData
however, this only works if the object's type happens to be bound to an appropriate name in
scope.
Access debugging in add-ons - Firefox Developer Tools
window.addeventlistener("debugger:editorunloaded") relevant files: chrome://browser/content/devtools/debugger-controller.js chrome://browser/content/devtools/debugger-toolbar.js chrome://browser/content/devtools/debugger-view.js chrome://browser/content/devtools/debugger-panes.js unfortunately there is not yet any api to evaluate watches/expressions within the debugged
scope, or highlight elements on the page that are referenced as variables in the debugged
scope.
Dominators - Firefox Developer Tools
so when an object becomes unreachable (for example, because it is only referenced by a single local variable which goes out of
scope) then any objects it references also become unreachable, as long as no other objects reference them: conversely, this means that objects are kept alive as long as some other reachable object is holding a reference to them.
Firefox Developer Tools
browser console see messages logged by the browser itself and by add-ons, and run javascript code in the browser's
scope.
AnalyserNode.getFloatTimeDomainData() - Web APIs
example the following example shows basic usage of an audiocontext to create an analysernode, then requestanimationframe and <canvas> to collect time domain data repeatedly and draw an "oscillo
scope style" output of the current audio input.
Attr.namespaceURI - Web APIs
if (attribute.localname == "value" && attribute.namespaceuri == "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul") { // this is a xul value } notes this is not a computed value that is the result of a namespace lookup based on an examination of the namespace declarations in
scope.
AudioWorklet - Web APIs
the worklet's code is run in the audioworkletglobal
scope global execution context, using a separate web audio thread which is shared by the worklet and other audio nodes.
AudioWorkletNode() - Web APIs
a processor with the provided name must first be registered using the audioworkletglobal
scope.registerprocessor() method.
BaseAudioContext.decodeAudioData() - Web APIs
syntax older callback syntax: baseaudiocontext.decodeaudiodata(arraybuffer, successcallback, errorcallback); newer promise-based syntax: promise<decodeddata> baseaudiocontext.decodeaudiodata(arraybuffer); parameters arraybuffer an arraybuffer containing the audio data to be decoded, usually grabbed from xmlhttprequest, windoworworkerglobal
scope.fetch() or filereader.
Using the Beacon API - Web APIs
window.onsubmit = function send_analytics() { var data = json.stringify({ location: location.href, time: date() }); navigator.sendbeacon('/analytics', data); }; workernavigator.sendbeacon() the beacon api's workernavigator.sendbeacon() method works identically to the usual method, but is accessible from worker global
scope.
Beacon API - Web APIs
worker context the beacon api's navigator.sendbeacon() method is used to send a beacon of data to the server from the worker global
scope.
CacheStorage - Web APIs
the interface: provides a master directory of all the named caches that can be accessed by a serviceworker or other type of worker or window
scope (you’re not limited to only using it with service workers, even though the service workers spec defines it).
Using images - Web APIs
it's beyond the
scope of this tutorial to look at image pre-loading tactics, but you should keep that in mind.
ChildNode.after() - Web APIs
.log(parent.outerhtml); // "<div><p></p>text</div>" inserting an element and text var parent = document.createelement("div"); var child = document.createelement("p"); parent.appendchild(child); var span = document.createelement("span"); child.after(span, "text"); console.log(parent.outerhtml); // "<div><p></p><span></span>text</div>" childnode.after() is unscopable the after() method is not
scoped into the with statement.
ChildNode.before() - Web APIs
g(parent.outerhtml); // "<div>text<p></p></div>" inserting an element and text var parent = document.createelement("div"); var child = document.createelement("p"); parent.appendchild(child); var span = document.createelement("span"); child.before(span, "text"); console.log(parent.outerhtml); // "<div><span></span>text<p></p></div>" childnode.before() is unscopable the before() method is not
scoped into the with statement.
ChildNode.remove() - Web APIs
syntax node.remove(); example using remove() <div id="div-01">here is div-01</div> <div id="div-02">here is div-02</div> <div id="div-03">here is div-03</div> var el = document.getelementbyid('div-02'); el.remove(); // removes the div with the 'div-02' id childnode.remove() is unscopable the remove() method is not
scoped into the with statement.
ChildNode.replaceWith() - Web APIs
examples using replacewith() var parent = document.createelement("div"); var child = document.createelement("p"); parent.appendchild(child); var span = document.createelement("span"); child.replacewith(span); console.log(parent.outerhtml); // "<div><span></span></div>" childnode.replacewith() is unscopable the replacewith() method is not
scoped into the with statement.
Clients - Web APIs
clients.claim() allows an active service worker to set itself as the controller for all clients within its
scope.
ClipboardItem - Web APIs
the benefit of having the clipboarditem interface to represent data, is that it enables developers to cope with the varying
scope of file types and data easily.
console - Web APIs
window on browsing
scopes and workerglobal
scope as specific variants in workers via the property console.
Console API - Web APIs
find out about these at: google chrome devtools implementation safari devtools implementation usage is very simple — the console object — available via window.console, or workerglobal
scope.console in workers; accessible using just console — contains many methods that you can call to perform rudimentary debugging tasks, generally focused around logging various values to the browser's web console.
ContentIndex.delete() - Web APIs
async function unregistercontent(article) { // reference registration const registration = await navigator.serviceworker.ready; // feature detect content index if (!registration.index) return; // unregister content from index await registration.index.delete(article.id); } the delete method can also be used within the service worker
scope.
Credential Management API - Web APIs
this is sometimes referred to as public suffix list (psl) matching; however the spec only recommends using psl to determine the effective
scope of a credential.
DOMHighResTimeStamp - Web APIs
if the script's global object is a workerglobal
scope (that is, the script is running as a web worker), the time origin is the moment at which the worker was created.
DOMMatrix - Web APIs
while it's beyond the
scope of this article to explain the mathematics involved, this 4×4 size is enough to describe any transformation you might apply to either 2d or 3d geometries.
Detecting device orientation - Web APIs
processing orientation events all you need to do in order to begin receiving orientation change is to listen to the deviceorientation event: note: gyronorm.js is a polyfill for normalizing the accelerometer and gyro
scope data on mobile devices.
DeviceMotionEvent.accelerationIncludingGravity - Web APIs
this value is not typically as useful as devicemotionevent.acceleration, but may be the only value available on devices that aren't able of removing gravity from the acceleration data, such as on devices that don't have a gyro
scope.
Document.cookie - Web APIs
__host- signals to the browser that in addition to the restriction to only use the cookie from a secure origin, the
scope of the cookie is limited to a path attribute passed down by the server.
Element.namespaceURI - Web APIs
if (element.localname == "browser" && element.namespaceuri == "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul") { // this is a xul browser } notes this is not a computed value that is the result of a namespace lookup based on an examination of the namespace declarations in
scope.
Event - Web APIs
deprecated properties event.
scoped read only a boolean indicating whether the given event will bubble across through the shadow root into the standard dom.
ExtendableMessageEvent - Web APIs
the extendablemessageevent interface of the service worker api represents the event object of a message event fired on a service worker (when a message is received on the serviceworkerglobal
scope from another context) — extends the lifetime of such events.
FetchEvent - Web APIs
this is the event type for fetch events dispatched on the service worker global
scope.
Using Fetch - Web APIs
feature detection fetch api support can be detected by checking for the existence of headers, request, response or fetch() on the window or worker
scope.
FileSystemFlags - Web APIs
note that these option flags currently don't have any useful meaning when used in the
scope of web content, where security precautions prevent the creation of new files or the replacement of existing ones.
GlobalEventHandlers - Web APIs
event handlers these event handlers are defined on the globaleventhandlers mixin, and implemented by htmlelement, document, window, as well as by workerglobal
scope for web workers.
The HTML DOM API - Web APIs
broadcastchannel dedicatedworkerglobal
scope messagechannel messageevent messageport sharedworker sharedworkerglobal
scope worker workerglobal
scope workerlocation workernavigator websocket interfaces these interfaces, defined by the html specification, are used by the websockets_api.
IDBDatabaseSync - Web APIs
idbtransactionsync transaction ( in optional domstringlist storenames, in optional unsigned int timeout ) raises (idbdatabaseexception); parameters storenames the names of object stores and indexes in the
scope of the new transaction.
IDBEnvironment - Web APIs
important: the indexeddb property that was previously defined in this mixin is instead now windoworworkerglobal
scope.indexeddb (that is, defined as a member of the windoworworkerglobal
scope mixin).
IDBTransaction.mode - Web APIs
the mode read-only property of the idbtransaction interface returns the current mode for accessing the data in the object stores in the
scope of the transaction (i.e.
IndexedDB API - Web APIs
you create a transaction on a database, specify the
scope (such as which object stores you want to access), and determine the kind of access (read only or readwrite) that you want.
LocalFileSystemSync - Web APIs
the global methods in the window object requestfilesystemsync() and resolvelocalfilesystemsyncurl() methods are exposed to the worker's global
scope.
MediaDevices - Web APIs
example 'use strict'; // put variables in global
scope to make them available to the browser console.
Metadata - Web APIs
this interface isn't available through the global
scope; instead, you obtain a metadata object describing a filesystementry using the method filesystementry.getmetadata().
Node.namespaceURI - Web APIs
if (node.localname == "browser" && node.namespaceuri == "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul") { // this is a xul browser } notes this is not a computed value that is the result of a namespace lookup based on an examination of the namespace declarations in
scope.
Notifications API - Web APIs
serviceworkerglobal
scope includes the serviceworkerglobal
scope.onnotificationclick handler, for firing custom functions when a notification is clicked.
OrientationSensor - Web APIs
const sensor = new absoluteorientationsensor(); promise.all([navigator.permissions.query({ name: "accelerometer" }), navigator.permissions.query({ name: "magnetometer" }), navigator.permissions.query({ name: "gyro
scope" })]) .then(results => { if (results.every(result => result.state === "granted")) { sensor.start(); ...
PaintWorklet - Web APIs
@supports (background: paint(id)) { background-image: paint(checkerboard); } specifications specification status comment css painting api level 1the definition of 'paintworkletglobal
scope' in that specification.
ParentNode.append() - Web APIs
text let parent = document.createelement("div") parent.append("some text") console.log(parent.textcontent) // "some text" appending an element and text let parent = document.createelement("div") let p = document.createelement("p") parent.append("some text", p) console.log(parent.childnodes) // nodelist [ #text "some text", <p> ] parentnode.append() is unscopable the append() method is not
scoped into the with statement.
ParentNode.prepend() - Web APIs
parent.append("some text"); parent.prepend("headline: "); console.log(parent.textcontent); // "headline: some text" appending an element and text var parent = document.createelement("div"); var p = document.createelement("p"); parent.prepend("some text", p); console.log(parent.childnodes); // nodelist [ #text "some text", <p> ] parentnode.prepend() is unscopable the prepend() method is not
scoped into the with statement.
Using the Payment Request API - Web APIs
let preauthsuccess = ...; evt.respondwith(preauthsuccess); }); this payment handler would need to live in a service worker at https://example.com/preauth
scope.
Permissions.query() - Web APIs
the permissions.query() method of the permissions interface returns the state of a user permission on the global
scope.
Permissions - Web APIs
opera android full support 30safari ios no support nosamsung internet android full support 4.0gyro
scope permissionchrome full support 51edge full support 79firefox ?
Response - Web APIs
you can create a new response object using the response.response() constructor, but you are more likely to encounter a response object being returned as the result of another api operation—for example, a service worker fetchevent.respondwith, or a simple windoworworkerglobal
scope.fetch().
Sensor - Web APIs
accelerometer ambientlightsensor gyro
scope linearaccelerationsensor magnetometer orientationsensor properties sensor.activated read only returns a boolean indicating whether the sensor is active.
ServiceWorker - Web APIs
if ('serviceworker' in navigator) { navigator.serviceworker.register('service-worker.js', {
scope: './' }).then(function (registration) { var serviceworker; if (registration.installing) { serviceworker = registration.installing; document.queryselector('#kind').textcontent = 'installing'; } else if (registration.waiting) { serviceworker = registration.waiting; document.queryselector('#kind').textcontent = 'waiting'; ...
ServiceWorkerRegistration.active - Web APIs
an active worker controls a serviceworkerclient if the client's url falls within the
scope of the registration (the
scope option set when serviceworkercontainer.register is first called.) note: this feature is available in web workers.
ServiceWorkerRegistration.showNotification() - Web APIs
buzz!', icon: '../images/touch/chrome-touch-icon-192x192.png', vibrate: [200, 100, 200, 100, 200, 100, 200], tag: 'vibration-sample' }); }); } }); } to invoke the above function at an appropriate time, you could use the serviceworkerglobal
scope.onnotificationclick event handler.
ServiceWorkerRegistration.update() - Web APIs
example the following simple example registers a service worker example then adds an event handler to a button so you can explicitly update the service worker whenever desired: if ('serviceworker' in navigator) { navigator.serviceworker.register('/sw-test/sw.js', {
scope: 'sw-test'}).then(function(registration) { // registration worked console.log('registration succeeded.'); button.onclick = function() { registration.update(); } }).catch(function(error) { // registration failed console.log('registration failed with ' + error); }); }; specifications specification status comment service workersthe definiti...
Storage Access API - Web APIs
documentation for firefox's new storage access policy for blocking tracking cookies includes a detailed description of the
scope of storage access grants.
Streams API - Web APIs
this request could then be passed to a windoworworkerglobal
scope.fetch() to commence fetching the stream.
SyncEvent - Web APIs
the syncevent interface represents a sync action that is dispatched on the serviceworkerglobal
scope of a serviceworker.
TextRange - Web APIs
textrange.execcommand() executes a command on the current document, the current selection, or the given
scope.
WebGL2RenderingContext.beginQuery() - Web APIs
possible values: gl.any_samples_passed: specifies an occlusion query: these queries detect whether an object is visible (whether the
scoped drawing commands pass the depth test and if so, how many samples pass).
WebGL2RenderingContext.endQuery() - Web APIs
possible values: gl.any_samples_passed: specifies an occlusion query: these queries detect whether an object is visible (whether the
scoped drawing commands pass the depth test and if so, how many samples pass).
WebGL2RenderingContext.getQuery() - Web APIs
possible values: gl.any_samples_passed: specifies an occlusion query: these queries detect whether an object is visible (whether the
scoped drawing commands pass the depth test and if so, how many samples pass).
Clearing with colors - Web APIs
owser does not seem to support html5 canvas.</canvas> body { text-align : center; } canvas { display : block; width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } // run everything inside window load event handler, to make sure // dom is fully loaded and styled before trying to manipulate it, // and to not mess up the global
scope.
Matrix math for the web - Web APIs
after adding the w component to the point, notice how neatly the matrix and the point line up: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] [4, 3, 2, 1] // point at [x, y, z, w] the w component has some additional uses that are out of
scope for this article.
Lighting in WebGL - Web APIs
simulating lighting and shading in 3d although going into detail about the theory behind simulated lighting in 3d graphics is far beyond the
scope of this article, it's helpful to know a bit about how it works.
WebGL best practices - Web APIs
(+/-2.0 max is probably not good enough for you) implicit defaults the vertex language has the following predeclared globally
scoped default precision statements: precision highp float; precision highp int; precision lowp sampler2d; precision lowp samplercube; the fragment language has the following predeclared globally
scoped default precision statements: precision mediump int; precision lowp sampler2d; precision lowp samplercube; in webgl 1, "highp float" support is optional in fragment shaders using highp precision ...
Geometry and reference spaces in WebXR - Web APIs
fundamentals of 3d geometry while we'll examine here the required math operations used to compute the positions, orientations, and movement of objects in virtual space—plus the need to integrate the human viewer of the scene into the mix—a thorough introduction to geometry and the use of matrices and vectors to manage 3d representations of a scene is well beyond the
scope of what can be accomplished in this article.
Background audio processing using AudioWorklet - Web APIs
constructor() { super(); } process(inputlist, outputlist, parameters) { /* using the inputs (or not, as needed), write the output into each of the outputs */ return true; } }; registerprocessor("my-audio-processor", myaudioprocessor); after the implementation of the processor comes a call to the global function registerprocessor(), which is only available within the
scope of the audio context's audioworklet, which is the invoker of the processor script as a result of your call to audioworklet.addmodule().
Visualizations with Web Audio API - Web APIs
creating a waveform/oscillo
scope to create the oscillo
scope visualisation (hat tip to soledad penadés for the original code in voice-change-o-matic), we first follow the standard pattern described in the previous section to set up the buffer: analyser.fftsize = 2048; var bufferlength = analyser.frequencybincount; var dataarray = new uint8array(bufferlength); next, we clear the canvas of what had been drawn on it before to ge...
Web Locks API - Web APIs
the api provides optional functionality that may be used as needed, including: returning values from the asynchronous task shared and exclusive lock modes conditional acquisition diagnostics to query the state of locks in an origin an escape hatch to protect against deadlocks locks are
scoped to origins; the locks acquired by a tab from https://example.com have no effect on the locks acquired by a tab from https://example.org:8080 as they are separate origins.
Window.controllers - Web APIs
each missing removal can cause bug 415775: assertion: xpconnect is being called on a
scope without a 'components' property!
Window.isSecureContext - Web APIs
syntax var issecure = window.issecurecontext examples feature detection you can use feature detection to check whether they are in a secure context or not by using the issecurecontext boolean which is exposed on the global
scope.
Window: rejectionhandled event - Web APIs
the rejectionhandled event is sent to the script's global
scope (usually window but also worker) whenever a javascript promise is rejected but after the promise rejection has been handled.
Window.self - Web APIs
by using self, you can refer to the global
scope in a way that will work not only in a window context (self will resolve to window.self) but also in a worker context (self will then resolve to workerglobal
scope.self).
Window: unhandledrejection event - Web APIs
the unhandledrejection event is sent to the global
scope of a script when a javascript promise that has no rejection handler is rejected; typically, this is the window, but may also be a worker.
WindowClient - Web APIs
the windowclient interface of the serviceworker api represents the
scope of a service worker client that is a document in a browsing context, controlled by an active worker.
WindowEventHandlers - Web APIs
properties the events properties, of the form onxyz, are defined on the windoweventhandlers, and implemented by window, and workerglobal
scope for web workers.
Worker() - Web APIs
name: a domstring specifying an identifying name for the dedicatedworkerglobal
scope representing the
scope of the worker, which is mainly useful for debugging purposes.
WorkerLocation - Web APIs
such an object is initialized for each worker and is available via the workerglobal
scope.location property obtained by calling self.location.
WorkerNavigator - Web APIs
such an object is initialized for each worker and is available via the workerglobal
scope.navigator property obtained by calling window.self.navigator.
:has() - CSS: Cascading Style Sheets
the :has() css pseudo-class represents an element if any of the selectors passed as parameters (relative to the :
scope of the given element) match at least one element.
CSS reference - CSS: Cascading Style Sheets
-eventspolygon()<position>positionprefix (@counter-style)ptpxqqquotesrradradial-gradient()range (@counter-style)<ratio>:read-only:read-writerect()remrepeat()repeating-linear-gradient()repeating-radial-gradient():requiredresize<resolution>revertrgb()rgba():rightright@right-bottom:rootrotaterotate()rotate3d()rotatex()rotatey()rotatez()row-gapsssaturate()scalescale()scale3d()scalex()scaley()scalez():
scopescroll-behaviorscroll-marginscroll-margin-blockscroll-margin-block-endscroll-margin-block-startscroll-margin-bottomscroll-margin-inlinescroll-margin-inline-endscroll-margin-inline-startscroll-margin-leftscroll-margin-rightscroll-margin-topscroll-paddingscroll-padding-blockscroll-padding-block-endscroll-padding-block-startscroll-padding-bottomscroll-padding-inlinescroll-padding-inline-endscroll-pad...
env() - CSS: Cascading Style Sheets
the difference is that, as well as being user-agent defined rather than user-defined, environment variables are globally
scoped to a document, whereas custom properties are
scoped to the element(s) on which they are declared.
CSS: Cascading Style Sheets
from css3, the
scope of the specification increased significantly and the progress on different css modules started to differ so much, that it became more effective to develop and release recommendations separately per module.
Demos of open web technologies
etarium (source code) loader with blend modes text reveal with clip-path ambient shadow with custom properties luminiscent vial css-based single page application (source code) transformations impress.js (source code) games ioquake3 (source code) kai 'opua (source code) web apis notifications api html5 notifications (source code) web audio api web audio fireworks o
scope.js - javascript oscillo
scope html5 web audio showcase (source code) html5 audio visualizer (source code) graphical filter editor and visualizer (source code) file api slide my text - presentation from plain text files web workers web worker fractals photo editor coral generator raytracer hotcold touch typing ...
HTML5 Parser - Developer guides
foreignobject and annotation-xml (and various less important elements) establish a nested html
scope, so you can nest svg, mathml and html as you’d expect to be able to nest them.
<keygen> - HTML: Hypertext Markup Language
(note: choice of the number of key strengths, default values for each strength, and the ui by which the user is offered a choice, are outside of the
scope of this specification.) the <keygen> element is only valid within an html form.
Using HTTP cookies - HTTP
here is an example: set-cookie: id=a3fwa; expires=wed, 21 oct 2021 07:28:00 gmt; secure; httponly define where cookies are sent the domain and path attributes define the
scope of the cookie: what urls the cookies should be sent to.
Feature Policy - HTTP
the features include (see features list): accelerometer ambient light sensor autoplay camera encrypted media fullscreen geolocation gyro
scope magnetometer microphone midi paymentrequest picture-in-picture usb vr / xr examples using feature policy see feature policy demos for example usage of many policies.
Feature-Policy - HTTP
gyro
scope controls whether the current document is allowed to gather information about the orientation of the device through the gyro
scope interface.
HTTP Index - HTTP
133 feature-policy: gyro
scope the http feature-policy header gyro
scope directive controls whether the current document is allowed to gather information about the orientation of the device through the gyro
scope interface.
Link prefetching FAQ - HTTP
standardization of this technique is part of the
scope of html 5, see the current working draft, section §5.11.3.13.
An overview of HTTP - HTTP
http and connections a connection is controlled at the transport layer, and therefore fundamentally out of
scope for http.
HTTP resources and specifications - HTTP
content security policy 1.0 content security policy 1.0 csp 1.1 and csp 3.0 doesn't extend the http standard obsolete microsoft document specifying legacy document modes* defines x-ua-compatible note rfc 5689 http extensions for web distributed authoring and versioning (webdav) these extensions of the web, as well as carddav and caldav, are out-of-
scope for http on the web.
JavaScript modules - JavaScript
last but not least, let's make this clear — module features are imported into the
scope of a single script — they aren't available in the global
scope.
JavaScript Guide - JavaScript
chapters this guide is divided into several chapters: introduction about this guide about javascript javascript and java ecmascript tools hello world grammar and types basic syntax & comments declarations variable
scope variable hoisting data structures and types literals control flow and error handling if...else switch try/catch/throw error objects loops and iteration for while do...while break/continue for..in for..of functions defining functions calling functions function
scope closures arguments & parameters arrow functions expressions and...
arguments[@@iterator]() - JavaScript
syntax arguments[symbol.iterator]() examples iteration using for...of loop function f() { // your browser must support for..of loop // and let-
scoped variables in for loops for (let letter of arguments) { console.log(letter); } } f('w', 'y', 'k', 'o', 'p'); specifications specification ecmascript (ecma-262)the definition of 'createunmappedargumentsobject' in that specification.
arguments.callee - JavaScript
1 : factorial(n - 1)*n; }); this has numerous benefits: the function can be called like any other from inside your code it does not create a variable in the outer
scope (except for ie 8 and below) it has better performance than accessing the arguments object another feature that was deprecated was arguments.callee.caller, or more specifically function.caller.
Array.prototype[@@unscopables] - JavaScript
this is where now the built-in @@unscopables array.prototype[@@unscopables] symbol property comes into play and prevents that some of the array methods are being
scoped into the with statement.
Array - JavaScript
array.prototype[@@unscopables] a symbol containing property names to exclude from a with binding
scope.
Symbol - JavaScript
to create symbols available across files and even across realms (each of which has its own global
scope), use the methods symbol.for() and symbol.keyfor() to set and retrieve symbols from the global symbol registry.
TypedArray.prototype[@@iterator]() - JavaScript
examples iteration using for...of loop var arr = new uint8array([10, 20, 30, 40, 50]); // your browser must support for..of loop // and let-
scoped variables in for loops for (let n of arr) { console.log(n); } alternative iteration var arr = new uint8array([10, 20, 30, 40, 50]); var earr = arr[symbol.iterator](); console.log(earr.next().value); // 10 console.log(earr.next().value); // 20 console.log(earr.next().value); // 30 console.log(earr.next().value); // 40 console.log(earr.next().value); // 50 specifications specification ecmas...
TypedArray.prototype.entries() - JavaScript
examples iteration using for...of loop var arr = new uint8array([10, 20, 30, 40, 50]); var earray = arr.entries(); // your browser must support for..of loop // and let-
scoped variables in for loops for (let n of earray) { console.log(n); } alternative iteration var arr = new uint8array([10, 20, 30, 40, 50]); var earr = arr.entries(); console.log(earr.next().value); // [0, 10] console.log(earr.next().value); // [1, 20] console.log(earr.next().value); // [2, 30] console.log(earr.next().value); // [3, 40] console.log(earr.next().value); // [4, 50] specifications ...
TypedArray.prototype.keys() - JavaScript
examples iteration using for...of loop var arr = new uint8array([10, 20, 30, 40, 50]); var earray = arr.keys(); // your browser must support for..of loop // and let-
scoped variables in for loops for (let n of earray) { console.log(n); } alternative iteration var arr = new uint8array([10, 20, 30, 40, 50]); var earr = arr.keys(); console.log(earr.next().value); // 0 console.log(earr.next().value); // 1 console.log(earr.next().value); // 2 console.log(earr.next().value); // 3 console.log(earr.next().value); // 4 specifications specification ...
TypedArray.prototype.values() - JavaScript
examples iteration using for...of loop var arr = new uint8array([10, 20, 30, 40, 50]); var earray = arr.values(); // your browser must support for..of loop // and let-
scoped variables in for loops for (let n of earray) { console.log(n); } alternative iteration var arr = new uint8array([10, 20, 30, 40, 50]); var earr = arr.values(); console.log(earr.next().value); // 10 console.log(earr.next().value); // 20 console.log(earr.next().value); // 30 console.log(earr.next().value); // 40 console.log(earr.next().value); // 50 specifications specification ...
WebAssembly.compileStreaming() - JavaScript
because the compilestreaming() function accepts a promise for a response object, you can directly pass it a windoworworkerglobal
scope.fetch() call, and it will pass the response into the function when it fulfills.
WebAssembly.instantiateStreaming() - JavaScript
because the instantiatestreaming() function accepts a promise for a response object, you can directly pass it a windoworworkerglobal
scope.fetch() call, and it will pass the response into the function when it fulfills.
WebAssembly - JavaScript
because the instantiatestreaming() function accepts a promise for a response object, you can directly pass it a windoworworkerglobal
scope.fetch() call, and it will pass the response into the function when it fulfills.
globalThis - JavaScript
in this way, you can access the global object in a consistent manner without having to know which environment the code is being run in.to help you remember the name, just remember that in global
scope the this value is globalthis.
this - JavaScript
calling f.bind(someobject) creates a new function with the same body and
scope as f, but where this occurs in the original function, in the new function it is permanently bound to the first argument of bind, regardless of how the function is being used.
function declaration - JavaScript
typeof foo is function function declaration hoisting function declarations in javascript are hoisted to the top of the enclosing function or global
scope.
Web app manifests
click each one for more information about it: background_colorcategoriesdescriptiondirdisplayiarc_rating_idiconslangnameorientationprefer_related_applicationsrelated_applications
scopescreenshotsserviceworkershort_nameshortcutsstart_urltheme_color example manifest { "name": "hackerweb", "short_name": "hackerweb", "start_url": ".", "display": "standalone", "background_color": "#fff", "description": "a simply readable hacker news app.", "icons": [{ "src": "images/touch/homescreen48.png", "sizes": "48x48", "type": "image/png" }, { "src": "images/t...
Authoring MathML - MathML
this is out of the
scope of this document but anyone with basic knowledge of web languages will easily be able to mix these features with mathml.
<mtable> - MathML
alignment
scope unimplemented class, id, style provided for use with stylesheets.
Digital audio concepts - Web media technologies
e source audio constrained storage (either because the storage space is small, or because there's a large amount of sound to store into it) a need to constrain the network bandwidth required to broadcast the audio; this is especially important for live streams and teleconferencing psychoacoustics 101 diving into the details of psychoacoustics and how audio compression works is far beyond the
scope of this article, but it is useful to have a general idea of how audio gets compressed by common algorithms can help understand and make better decisions about audio codec selection.