file stringlengths 16 94 | text stringlengths 32 24.4k | vector list |
|---|---|---|
javascript/reference/lexical_grammar/index.md | JavaScript - Lexical grammar - Literals - Numeric literals - Decimal:
Example:
1234567890
42
Decimal literals can start with a zero (`0`) followed by another decimal digit, but if all digits after the leading `0` are smaller than 8, the number is interpreted as an octal number. This is considered a legacy syntax, an... | [
-1.68294095993042,
0.7560296058654785,
0.2090333104133606,
-1.0834347009658813,
-0.035405900329351425,
-0.9914980530738831,
0.8457766771316528,
0.43565917015075684,
-0.32594454288482666,
-0.8715927600860596,
-0.8786742687225342,
0.07412809133529663,
-0.7853662371635437,
-0.4617497026920318... |
javascript/reference/lexical_grammar/index.md | JavaScript - Lexical grammar - Literals - Numeric literals - Decimal - Exponential:
The decimal exponential literal is specified by the following format: `beN`; where `b` is a base number (integer or floating), followed by an `E` or `e` character (which serves as separator or exponent indicator) and `N`, which is expo... | [
-1.0686898231506348,
0.355633020401001,
0.023908548057079315,
-0.9472447037696838,
0.20024749636650085,
-1.8687305450439453,
1.0021655559539795,
0.8373748064041138,
0.09560935199260712,
-0.20201130211353302,
-1.1724779605865479,
0.8922410011291504,
-1.4155641794204712,
-0.5147773027420044,... |
javascript/reference/lexical_grammar/index.md | JavaScript - Lexical grammar - Literals - Numeric literals - Binary:
Binary number syntax uses a leading zero followed by a lowercase or uppercase Latin letter "B" (`0b` or `0B`). Any character after the `0b` that is not 0 or 1 will terminate the literal sequence.
Example:
0b10000000000000000000000000000000 // 21474... | [
-1.8552677631378174,
0.25350114703178406,
-0.14990459382534027,
-1.0572141408920288,
0.3191206455230713,
-0.3705490529537201,
0.8875366449356079,
0.7590270042419434,
-0.2753099799156189,
-0.48688334226608276,
-1.6176872253417969,
0.34712129831314087,
0.07474793493747711,
-0.319737076759338... |
javascript/reference/lexical_grammar/index.md | JavaScript - Lexical grammar - Literals - Numeric literals - Octal:
Octal number syntax uses a leading zero followed by a lowercase or uppercase Latin letter "O" (`0o` or `0O)`. Any character after the `0o` that is outside the range (01234567) will terminate the literal sequence.
Example:
0O755 // 493
0o644 // 420 | [
-1.5940107107162476,
0.755187451839447,
-0.7974110245704651,
-1.190731167793274,
-0.0561223067343235,
-1.2324175834655762,
0.6053748726844788,
0.8193793892860413,
-0.38490599393844604,
-0.47345465421676636,
-0.9267631769180298,
0.12548109889030457,
-0.30378231406211853,
-0.2918242812156677... |
javascript/reference/lexical_grammar/index.md | JavaScript - Lexical grammar - Literals - Numeric literals - Hexadecimal:
Hexadecimal number syntax uses a leading zero followed by a lowercase or uppercase Latin letter "X" (`0x` or `0X`). Any character after the `0x` that is outside the range (0123456789ABCDEF) will terminate the literal sequence.
Example:
0xFFFFF... | [
-1.4662554264068604,
-0.0010392870754003525,
-0.2623831033706665,
-1.0120692253112793,
-0.028147824108600616,
-0.814332127571106,
0.6213359832763672,
0.335104376077652,
0.25679758191108704,
-0.9101969003677368,
-1.3196781873703003,
-0.19316528737545013,
-0.650619387626648,
-0.5513568520545... |
javascript/reference/lexical_grammar/index.md | JavaScript - Lexical grammar - Literals - Numeric literals - BigInt literal:
The BigInt type is a numeric primitive in JavaScript that can represent integers with arbitrary precision. BigInt literals are created by appending `n` to the end of an integer.
Example:
123456789123456789n // 123456789123456789
0o77777... | [
-2.2462329864501953,
0.2757975459098816,
-0.21907927095890045,
-0.21896357834339142,
0.3199201822280884,
-1.0665974617004395,
0.6900980472564697,
0.18037532269954681,
-0.48167428374290466,
-0.6624243259429932,
-0.6712943911552429,
0.20291149616241455,
-0.8373596668243408,
-0.28335240483283... |
javascript/reference/lexical_grammar/index.md | JavaScript - Lexical grammar - Literals - Numeric literals - Numeric separators:
To improve readability for numeric literals, underscores (`_`, `U+005F`) can be used as separators:
Example:
1_000_000_000_000
1_050.95
0b1010_0001_1000_0101
0o2_2_5_6
0xA0_B0_C0
1_000_000_000_000_000_000_000n
Note these limitations:
... | [
-1.6303303241729736,
0.1828419417142868,
-0.42266160249710083,
-0.2078765630722046,
0.4463033676147461,
-0.9848538637161255,
-0.014028269797563553,
0.58346027135849,
0.13973981142044067,
0.05068822577595711,
-1.0764344930648804,
0.07439535856246948,
-0.6025477051734924,
-0.5513858199119568... |
javascript/reference/lexical_grammar/index.md | JavaScript - Lexical grammar - Literals - String literals:
A string literal is zero or more Unicode code points enclosed in single or double quotes. Unicode code points may also be represented by an escape sequence. All code points may appear literally in a string literal except for these code points:
- U+005C \ (bac... | [
-1.7966240644454956,
0.18606644868850708,
-0.5252296328544617,
-0.7644481062889099,
0.6107915639877319,
-1.3233938217163086,
0.9976215362548828,
0.574334442615509,
0.07754123210906982,
-0.23291140794754028,
-0.9267945885658264,
0.1885783076286316,
-0.6228377819061279,
-0.1496218740940094,
... |
javascript/reference/lexical_grammar/index.md | JavaScript - Lexical grammar - Literals - String literals - Escape sequences:
Special characters can be encoded using escape sequences:
- Escape sequence: `\0`, Unicode code point: null character (U+0000 NULL)
- Escape sequence: `\'`, Unicode code point: single quote (U+0027 APOSTROPHE)
- Escape sequence: `\"`, Unico... | [
-1.5630863904953003,
-0.05869048833847046,
-0.5412769913673401,
-0.535425066947937,
0.029471054673194885,
-1.0328631401062012,
0.42465752363204956,
0.0863371416926384,
-0.14048418402671814,
0.1380934864282608,
-1.1615837812423706,
0.6082254648208618,
-0.9687727093696594,
0.5726491808891296... |
javascript/reference/lexical_grammar/index.md | JavaScript - Lexical grammar - Literals - String literals - Hexadecimal escape sequences:
Hexadecimal escape sequences consist of `\x` followed by exactly two hexadecimal digits representing a code unit or code point in the range 0x0000 to 0x00FF.
Example:
"\xA9"; // "©" | [
-1.8966120481491089,
-0.4734848737716675,
-1.0405473709106445,
-0.7588936686515808,
-0.11729523539543152,
-0.3753261864185333,
-0.07412579655647278,
-0.07106010615825653,
0.08027966320514679,
-0.4057818055152893,
-0.9943547248840332,
-0.0043471455574035645,
-0.8790042400360107,
-0.27063593... |
javascript/reference/lexical_grammar/index.md | JavaScript - Lexical grammar - Literals - String literals - Unicode escape sequences:
A Unicode escape sequence consists of exactly four hexadecimal digits following `\u`. It represents a code unit in the UTF-16 encoding. For code points U+0000 to U+FFFF, the code unit is equal to the code point. Code points U+10000 t... | [
-1.2891666889190674,
-0.4773220419883728,
-1.6835397481918335,
-0.4237041175365448,
0.5369329452514648,
-0.5694553256034851,
0.23587286472320557,
0.5654134154319763,
-0.3210327625274658,
-0.5411027073860168,
-1.1296906471252441,
0.21607664227485657,
-0.5364387631416321,
-0.0589574612677097... |
javascript/reference/lexical_grammar/index.md | JavaScript - Lexical grammar - Literals - String literals - Unicode code point escapes:
A Unicode code point escape consists of `\u{`, followed by a code point in hexadecimal base, followed by `}`. The value of the hexadecimal digits must be in the range 0 and 0x10FFFF inclusive. Code points in the range U+10000 to U+... | [
-1.3168046474456787,
-0.05658555403351784,
-1.3089871406555176,
-0.7035292983055115,
0.7481664419174194,
-1.3420944213867188,
0.4234435260295868,
-0.22335068881511688,
-0.4477137625217438,
-0.7649325132369995,
-0.574906051158905,
0.229400634765625,
-0.6473603248596191,
0.08823208510875702,... |
javascript/reference/lexical_grammar/index.md | JavaScript - Lexical grammar - Literals - Regular expression literals:
Regular expression literals are enclosed by two forward slashes (`/`). The lexer consumes all characters up to the next unescaped forward slash or the end of the line, unless the forward slash appears within a character class (`[]`). Some character... | [
-1.2367023229599,
0.7103535532951355,
-0.5922956466674805,
-0.12925933301448822,
-0.2316049486398697,
-1.1143391132354736,
0.1262495368719101,
0.9906750917434692,
0.00063372403383255,
-0.6215912699699402,
-0.5869848132133484,
0.19307845830917358,
-0.20973898470401764,
-0.6742554306983948,
... |
javascript/reference/lexical_grammar/index.md | JavaScript - Lexical grammar - Literals - Template literals:
One template literal consists of several tokens: ``xxx${` (template head), `}xxx${` (template middle), and `}xxx`` (template tail) are individual tokens, while any expression may come between them.
See also template literals for more information.
Example:
... | [
-1.0376577377319336,
0.005880214273929596,
0.3329598605632782,
-0.36415231227874756,
0.2289130687713623,
-1.8359137773513794,
0.35208532214164734,
0.6595848798751831,
-0.5879781246185303,
-1.1704777479171753,
-0.36142024397850037,
0.017890051007270813,
-0.5237733125686646,
-0.5646997094154... |
javascript/reference/lexical_grammar/index.md | JavaScript - Lexical grammar - Automatic semicolon insertion:
Some JavaScript statements' syntax definitions require semicolons (`;`) at the end. They include:
- `var`, `let`, `const`, `using`, `await using`
- Expression statements
- `do...while`
- `continue`, `break`, `return`, `throw`
- `debugger`
- Class field dec... | [
0.85250324010849,
0.09338141977787018,
-0.2541969418525696,
0.1844819337129593,
1.0612953901290894,
-0.9694519639015198,
0.6350665092468262,
1.4939985275268555,
-0.7691368460655212,
-0.3023621439933777,
-0.16560816764831543,
0.6034553647041321,
-0.1440301388502121,
0.3904476463794708,
-0... |
api/notification/maxactions_static/index.md | API - Notification - maxActions static:
Secure context: This feature is available only in secure contexts (HTTPS). Note: This feature is available in Web Workers.
The `maxActions` read-only static property of the `Notification` interface returns the maximum number of actions that can be displayed in a notification. | [
-0.0019005468348041177,
-0.6065815687179565,
-0.16979631781578064,
0.6878436803817749,
0.43561798334121704,
-0.7148944139480591,
0.05210168659687042,
1.7618871927261353,
0.6634828448295593,
0.21238568425178528,
0.38053691387176514,
0.3943652808666229,
0.3143182396888733,
0.0456909686326980... |
api/notification/maxactions_static/index.md | API - Notification - maxActions static - Value:
An integer. | [
-0.9110212326049805,
-0.8896141052246094,
-0.007320234552025795,
0.22282344102859497,
-0.252588152885437,
-0.7217519879341125,
0.7929943203926086,
0.4828375577926636,
-0.003961376845836639,
0.33430197834968567,
-0.2098006308078766,
0.19459465146064758,
0.10526666045188904,
-0.2874757647514... |
api/notification/maxactions_static/index.md | API - Notification - maxActions static - Description:
Notification actions are buttons or controls that appear within persistent notifications. Actions are set using the `actions` option of the second argument of the `showNotification()` method.
Browsers typically limit the maximum number of actions they will display... | [
0.4018082916736603,
-0.6864889860153198,
-0.17425774037837982,
0.6402984261512756,
0.03572492301464081,
-1.674203872680664,
0.5289186835289001,
2.0042002201080322,
-0.03895800933241844,
0.34375783801078796,
-0.03105207532644272,
0.30916279554367065,
0.00023108161985874176,
0.49305278062820... |
api/notification/maxactions_static/index.md | API - Notification - maxActions static - Examples - Log the maximum possible number of actions:
The following snippet logs the maximum number of supported actions.
Example:
const maxActions = Notification.maxActions;
console.log(
`This device can display at most ${maxActions} actions on each notification.`,
); | [
0.09211450815200806,
-0.43230319023132324,
-0.3085264265537262,
0.6634738445281982,
-0.2579360008239746,
-1.8530668020248413,
0.15878942608833313,
1.285577416419983,
0.31859564781188965,
0.14409230649471283,
-0.44398853182792664,
0.1561574637889862,
0.11015830934047699,
-0.0251765698194503... |
api/service_worker_api/using_service_workers/index.md | API - Service Worker API - Using Service Workers:
This article provides information on getting started with service workers, including basic architecture, registering a service worker, the installation and activation process for a new service worker, updating your service worker, cache control and custom responses, al... | [
0.5005141496658325,
-0.287282258272171,
-1.1432240009307861,
0.5993279218673706,
0.5747048258781433,
-1.1226000785827637,
-0.0064028408378362656,
1.7487406730651855,
0.25241607427597046,
0.12863190472126007,
0.2502653896808624,
0.18817570805549622,
0.7823449969291687,
0.39238518476486206,
... |
api/service_worker_api/using_service_workers/index.md | API - Service Worker API - Using Service Workers - The premise of service workers:
One overriding problem that web users have suffered with for years is loss of connectivity. The best web app in the world will provide a terrible user experience if you can't download it. There have been various attempts to create techn... | [
0.3706246316432953,
-0.1564219444990158,
-1.1694951057434082,
0.3181985020637512,
0.6479542255401611,
-1.4949361085891724,
-0.6885848045349121,
0.7450926303863525,
0.4106765389442444,
0.5799838900566101,
-0.7670750021934509,
-0.04114365950226784,
0.2434999942779541,
-0.23950324952602386,
... |
api/service_worker_api/using_service_workers/index.md | API - Service Worker API - Using Service Workers - Setting up to play with service workers:
Service workers are enabled by default in all modern browsers. To run code using service workers, you'll need to serve your code via HTTPS — Service workers are restricted to running across HTTPS for security reasons. A server ... | [
0.08261051028966904,
0.5935201048851013,
-0.49049413204193115,
0.4369856119155884,
0.5473264455795288,
-1.201908826828003,
-0.24617436528205872,
-0.1281987577676773,
0.8917115330696106,
0.3324834704399109,
-0.24478352069854736,
0.05577652156352997,
0.8192752003669739,
-0.3392217755317688,
... |
api/service_worker_api/using_service_workers/index.md | API - Service Worker API - Using Service Workers - Basic architecture:
With service workers, the following steps are generally observed for basic setup:
- The service worker code is fetched and then registered using `serviceWorkerContainer.register()`. If successful, the service worker is executed in a `ServiceWorker... | [
0.7804227471351624,
-0.5316837430000305,
-1.2841157913208008,
0.8745307326316833,
0.3497793972492218,
-1.1526079177856445,
-0.7117994427680969,
1.3936071395874023,
0.8974959850311279,
0.09921527653932571,
0.06754955649375916,
0.14887887239456177,
0.578831672668457,
0.3888244926929474,
-0... |
api/service_worker_api/using_service_workers/index.md | API - Service Worker API - Using Service Workers - Demo:
To demonstrate just the very basics of registering and installing a service worker, we have created a demo called simple service worker, which is a simple Star Wars Lego image gallery. It uses a promise-powered function to read image data from a JSON object and ... | [
-0.7002891898155212,
-0.8458974957466125,
-1.5922192335128784,
1.0061793327331543,
0.22306790947914124,
-1.4798228740692139,
0.07666251808404922,
0.9076763391494751,
0.17361518740653992,
0.029424678534269333,
0.2691066861152649,
0.7130976319313049,
0.9203609228134155,
0.6061716675758362,
... |
api/service_worker_api/using_service_workers/index.md | API - Service Worker API - Using Service Workers - Demo - Registering your worker:
The first block of code in our app's JavaScript file — `app.js` — is as follows. This is our entry point into using service workers.
Example:
const registerServiceWorker = async () => {
if ("serviceWorker" in navigator) {
try {
... | [
0.41183194518089294,
0.04693704843521118,
-0.9348356127738953,
0.6252402067184448,
0.7804474830627441,
-1.3727827072143555,
0.39707711338996887,
1.4585293531417847,
-0.4125533699989319,
0.4210189878940582,
-0.05928652733564377,
0.23934197425842285,
0.7086051106452942,
0.4994378685951233,
... |
api/service_worker_api/using_service_workers/index.md | API - Service Worker API - Using Service Workers - Demo - Registering your worker - Why is my service worker failing to register?:
A service worker fails to register for one of the following reasons:
- You are not running your application in a secure context (over HTTPS).
- The path of the service worker file is inco... | [
-0.6080921292304993,
0.09132341295480728,
-0.6452430486679077,
0.24253296852111816,
0.45382487773895264,
-1.4078946113586426,
-0.0799381211400032,
0.4466906487941742,
0.7363390922546387,
0.4850010871887207,
0.17647962272167206,
0.32205942273139954,
0.7019444108009338,
-0.05341164395213127,... |
api/service_worker_api/using_service_workers/index.md | API - Service Worker API - Using Service Workers - Demo - Install and activate: populating your cache:
After your service worker is registered, the browser will attempt to install then activate the service worker for your page/site.
The `install` event is the first event that is fired on service worker installation o... | [
1.089690923690796,
0.25643253326416016,
-0.6104030013084412,
0.7346377968788147,
0.984128475189209,
-1.331402063369751,
0.3028571605682373,
1.5628515481948853,
-0.02171344682574272,
0.29204651713371277,
0.3407943546772003,
0.3526841402053833,
-0.20328567922115326,
1.1273399591445923,
-1.... |
api/service_worker_api/using_service_workers/index.md | API - Service Worker API - Using Service Workers - Demo - Custom responses to requests:
Now you've got your site assets cached, you need to tell service workers to do something with the cached content. This is done with the `fetch` event.
- A `fetch` event fires every time any resource controlled by a service worker ... | [
0.7998473644256592,
-0.43003132939338684,
-0.1058463454246521,
0.4972999691963196,
0.5159685015678406,
-1.287895917892456,
-0.43245282769203186,
0.6993467211723328,
0.8103744387626648,
0.11086968332529068,
0.006714295595884323,
0.5836323499679565,
-0.11760139465332031,
0.38197898864746094,... |
api/service_worker_api/using_service_workers/index.md | API - Service Worker API - Using Service Workers - Recovering failed requests:
So `caches.match(event.request)` is great when there is a match in the service worker cache, but what about cases when there isn't a match? If we didn't provide any kind of failure handling, our promise would resolve with `undefined` and we... | [
0.18228009343147278,
0.3611087203025818,
-0.6518489718437195,
0.13679426908493042,
0.8060473203659058,
-0.7851916551589966,
0.7664003372192383,
1.4006235599517822,
-0.30152344703674316,
-0.13944585621356964,
-0.17069369554519653,
0.9256001114845276,
-0.14630833268165588,
1.0012847185134888... |
api/service_worker_api/using_service_workers/index.md | API - Service Worker API - Using Service Workers - Service Worker navigation preload:
If enabled, the navigation preload feature starts downloading resources as soon as the fetch request is made, and in parallel with service worker activation. This ensures that download starts immediately on navigation to a page, rath... | [
0.6175415515899658,
0.008729133754968643,
-0.8573635220527649,
0.4211258292198181,
0.7619515061378479,
-0.8009605407714844,
0.5514841079711914,
1.6250983476638794,
-0.09151911735534668,
-0.11908666789531708,
0.229060560464859,
0.46274900436401367,
-0.30277854204177856,
0.6252009272575378,
... |
api/service_worker_api/using_service_workers/index.md | API - Service Worker API - Using Service Workers - Updating your service worker:
If your service worker has previously been installed, but then a new version of the worker is available on refresh or page load, the new version is installed in the background, but not yet activated. It is only activated when there are no... | [
1.1191350221633911,
-0.37030455470085144,
-1.134482741355896,
1.0810788869857788,
0.5531850457191467,
-1.4472334384918213,
-0.00009902380406856537,
1.3166104555130005,
0.6663080453872681,
0.4907720386981964,
-0.10560616105794907,
0.426641583442688,
0.1739806979894638,
0.49337446689605713,
... |
api/service_worker_api/using_service_workers/index.md | API - Service Worker API - Using Service Workers - Updating your service worker - Deleting old caches:
As we saw in the last section, when you update a service worker to a new version, you'll create a new cache in its `install` event handler. While there are open pages that are controlled by the previous version of th... | [
1.226783275604248,
-0.02873859368264675,
-0.9199223518371582,
0.6476275324821472,
0.649823009967804,
-1.4379703998565674,
-0.46727511286735535,
1.456428050994873,
0.6420652866363525,
0.5199466943740845,
-0.14395368099212646,
-0.04113404452800751,
-0.07659552991390228,
0.3385501205921173,
... |
api/service_worker_api/using_service_workers/index.md | API - Service Worker API - Using Service Workers - Developer tools:
- Chrome
- Firefox
- The "Forget about this site" button, available in Firefox's toolbar customization options, can be used to clear service workers and their caches.
- Edge | [
-0.310393363237381,
-0.26238906383514404,
-1.1361943483352661,
0.23516368865966797,
0.26370853185653687,
-1.6625404357910156,
0.4000770151615143,
0.4600978195667267,
0.7235696315765381,
0.8714454174041748,
-0.3084780275821686,
0.1553529053926468,
0.4243348240852356,
-0.11529546231031418,
... |
api/element/closest/index.md | API - Element - closest:
The `closest()` method of the `Element` interface traverses the element and its parents (heading toward the document root) until it finds a node that matches the specified CSS selector. | [
-0.107705257833004,
-0.4327482581138611,
-0.14656147360801697,
0.34930863976478577,
-0.07526031136512756,
-2.001002550125122,
0.7938968539237976,
-0.12373408675193787,
-0.27989494800567627,
0.7251092195510864,
-0.21328066289424896,
0.02747320383787155,
0.338897168636322,
0.1371805220842361... |
api/element/closest/index.md | API - Element - closest - Syntax:
Example:
closest(selectors) | [
-0.28156793117523193,
-0.5452479720115662,
-0.5665541887283325,
-0.6585970520973206,
-0.3803216218948364,
-1.4816887378692627,
-0.28580352663993835,
-0.2619606554508209,
0.011813543736934662,
0.3255094885826111,
-0.3903978765010834,
0.35102933645248413,
0.12583445012569427,
0.3887357711791... |
api/element/closest/index.md | API - Element - closest - Syntax - Parameters:
- `selectors`: A string of valid CSS selectors to match the `Element` and its ancestors against. | [
-0.4247266352176666,
-0.4798603355884552,
-0.28789055347442627,
0.05744641274213791,
0.44692450761795044,
-2.151268243789673,
0.2289522886276245,
0.019237499684095383,
-0.5643962025642395,
0.21445603668689728,
0.10866585373878479,
0.16924983263015747,
0.3466520607471466,
0.0789774209260940... |
api/element/closest/index.md | API - Element - closest - Syntax - Return value:
The closest ancestor `Element` or itself, which matches the `selectors`. If there is no such element, `null` is returned. | [
-0.6882502436637878,
-0.16903358697891235,
0.022102423012256622,
0.04670541733503342,
-0.4890724718570709,
-1.2179924249649048,
0.07097659260034561,
0.15175378322601318,
-0.13561105728149414,
0.007845609448850155,
-0.47463199496269226,
0.5322532653808594,
0.018134940415620804,
0.9057217836... |
api/element/closest/index.md | API - Element - closest - Syntax - Exceptions:
- `SyntaxError` `DOMException`: Thrown if the `selectors` is not a valid CSS selector. | [
-0.374867707490921,
-0.7403062582015991,
-0.283261239528656,
0.04214956611394882,
-0.1279590129852295,
-2.3902273178100586,
0.08186767995357513,
0.0602530837059021,
0.3115444779396057,
0.2921958565711975,
-0.49614980816841125,
0.7129554152488708,
0.3184603750705719,
-0.006737302988767624,
... |
api/element/closest/index.md | API - Element - closest - Examples - HTML:
Example:
<article>
<div id="div-01">
Here is div-01
<div id="div-02">
Here is div-02
<div id="div-03">Here is div-03</div>
</div>
</div>
</article> | [
-0.7470173835754395,
-0.3384588658809662,
0.04120819270610809,
-0.5899270176887512,
-0.3000941872596741,
-1.39462411403656,
0.26164570450782776,
-0.02176385372877121,
-0.5178754329681396,
0.15916861593723297,
-1.3221855163574219,
0.03694247454404831,
0.10877269506454468,
0.1428873538970947... |
api/element/closest/index.md | API - Element - closest - Examples - JavaScript:
Example:
const el = document.getElementById("div-03");
// the closest ancestor with the id of "div-02"
console.log(el.closest("#div-02")); // <div id="div-02">
// the closest ancestor which is a div in a div
console.log(el.closest("div div")); // <div id="div-03">
/... | [
-0.6941325664520264,
-0.7157233357429504,
0.44566887617111206,
-0.11613018810749054,
-0.4584360122680664,
-1.028182029724121,
0.5744436979293823,
0.03214188665151596,
-0.4611169993877411,
0.31669551134109497,
-0.5779455900192261,
0.24983659386634827,
-0.3975357711315155,
0.4053467810153961... |
api/element/closest/index.md | API - Element - closest - Examples - Compatibility notes:
- In Edge 15-18 `document.createElement(tagName).closest(tagName)` will return `null` if the element is not first connected (directly or indirectly) to the context object, for example the `Document` object in the case of the normal DOM. | [
-0.5538610219955444,
-1.0173635482788086,
0.3845393657684326,
0.31292733550071716,
-0.2197420746088028,
-1.3321430683135986,
0.3236422836780548,
0.30220186710357666,
-0.2758468985557556,
0.5083518028259277,
-0.30299216508865356,
0.8474717140197754,
0.13188301026821136,
-0.14206016063690186... |
api/element/getattribute/index.md | API - Element - getAttribute:
The `getAttribute()` method of the `Element` interface returns the value of a specified attribute on the element.
If the given attribute does not exist, the value returned will be `null`.
If you need to inspect the `Attr` node's properties, you can use the `getAttributeNode()` method in... | [
-0.045763153582811356,
-0.17995032668113708,
0.1497827172279358,
0.16382993757724762,
0.09677787125110626,
-2.337594747543335,
1.0504153966903687,
0.11239805817604065,
0.35388219356536865,
0.060410358011722565,
-0.48152846097946167,
-0.06367097795009613,
0.13175372779369354,
0.353964716196... |
api/element/getattribute/index.md | API - Element - getAttribute - Syntax:
Example:
getAttribute(attributeName) | [
0.16546113789081573,
-0.27838775515556335,
-0.340537428855896,
-0.661648690700531,
-0.4426601827144623,
-1.392275094985962,
0.4643218219280243,
0.16744942963123322,
-0.0567597821354866,
-0.37200987339019775,
-0.09528858959674835,
0.21896356344223022,
-0.3835674524307251,
0.2158282101154327... |
api/element/getattribute/index.md | API - Element - getAttribute - Syntax - Parameters:
- `attributeName`: The name of the attribute whose value you want to get. | [
-0.12171195447444916,
0.18406453728675842,
-0.06665851920843124,
0.19687320291996002,
-0.2852945327758789,
-1.7094371318817139,
1.1445008516311646,
0.17405548691749573,
-0.021429236978292465,
-0.26376259326934814,
-0.2879096269607544,
0.7706897854804993,
-0.34770467877388,
0.22149148583412... |
api/element/getattribute/index.md | API - Element - getAttribute - Syntax - Return value:
A string containing the value of `attributeName` if the attribute exists, otherwise `null`. | [
-0.4425608813762665,
-0.3354668915271759,
0.04125656932592392,
-0.2065744698047638,
-0.5007550120353699,
-2.0548412799835205,
0.6067169904708862,
0.1543286144733429,
-0.2163490504026413,
-0.04414846748113632,
-0.32609033584594727,
0.41204676032066345,
-0.1100851371884346,
0.515859007835388... |
api/element/getattribute/index.md | API - Element - getAttribute - Examples:
Example:
<!-- example div in an HTML DOC -->
<div id="div1">Hi Champ!</div>
Example:
const div1 = document.getElementById("div1");
// <div id="div1">Hi Champ!</div>
const exampleAttr = div1.getAttribute("id");
// "div1"
const lang = div1.getAttribute("lang");
// null | [
-0.2068202942609787,
-0.3351882994174957,
0.06815750896930695,
-0.43668049573898315,
-0.1818189024925232,
-1.995757818222046,
0.02296806499361992,
0.36948731541633606,
-0.5957844853401184,
-0.17135488986968994,
-0.6483190655708313,
-0.14512310922145844,
-0.4073074460029602,
0.1404775381088... |
api/element/getattribute/index.md | API - Element - getAttribute - Description - Lower casing:
When called on an HTML element in a DOM flagged as an HTML document, `getAttribute()` lower-cases its argument before proceeding. | [
-0.5634426474571228,
-0.3147045373916626,
0.5748257637023926,
-0.003142166882753372,
0.15490487217903137,
-2.160245895385742,
0.003121323883533478,
0.06335250288248062,
-0.6329614520072937,
0.6211290955543518,
-0.582892656326294,
0.708016037940979,
0.5225499272346497,
0.029774226248264313,... |
api/element/getattribute/index.md | API - Element - getAttribute - Description - Decoded character references in attribute values:
HTML character references in an attribute's source markup (for example, `<`, `&`, or `<`) are decoded by the HTML parser when the document is parsed, so `getAttribute()` returns the decoded value, not the origina... | [
-0.47496065497398376,
-0.6223474144935608,
-0.07328440248966217,
-0.0021041780710220337,
0.33885905146598816,
-1.8351513147354126,
0.4917701482772827,
0.012962587177753448,
0.025758586823940277,
0.3088304102420807,
-0.5340887904167175,
0.21580713987350464,
0.18696632981300354,
-0.084615290... |
api/element/getattribute/index.md | API - Element - getAttribute - Description - Retrieving nonce values:
For security reasons, CSP nonces from non-script sources, such as CSS selectors, and `.getAttribute("nonce")` calls are hidden.
Example:
let nonce = script.getAttribute("nonce");
// returns empty string
Instead of retrieving the nonce from the co... | [
-0.5873207449913025,
0.1872936636209488,
-0.6528457403182983,
0.3353424370288849,
-0.07399310171604156,
-2.179616689682007,
0.5028256773948669,
0.7760786414146423,
-0.16843724250793457,
0.3368804156780243,
0.2964051067829132,
0.17866401374340057,
-0.47705498337745667,
-0.024884086102247238... |
api/speechrecognition/index.md | API - SpeechRecognition:
The `SpeechRecognition` interface of the Web Speech API is the controller interface for the recognition service; this also handles the `SpeechRecognitionEvent` sent from the recognition service.
Note: On some browsers, like Chrome, using Speech Recognition on a web page involves a server-base... | [
0.16220460832118988,
0.08597937226295471,
-0.06019008904695511,
0.010862082242965698,
0.10442887246608734,
-1.3765588998794556,
-0.03039722703397274,
0.6304055452346802,
1.485997200012207,
0.41502341628074646,
-0.25795602798461914,
0.34752094745635986,
0.4407483637332916,
-0.03217096626758... |
api/speechrecognition/index.md | API - SpeechRecognition - Constructor:
- `SpeechRecognition()`: Creates a new `SpeechRecognition` object. | [
-0.8277085423469543,
0.30731600522994995,
0.178420752286911,
0.2674888074398041,
-0.7191923260688782,
-1.3071486949920654,
0.4520983397960663,
0.9214912056922913,
0.19164341688156128,
0.019148528575897217,
-0.6319338083267212,
0.07212121784687042,
0.34211069345474243,
0.3694711923599243,
... |
api/speechrecognition/index.md | API - SpeechRecognition - Instance properties:
`SpeechRecognition` also inherits properties from its parent interface, `EventTarget`.
- `SpeechRecognition.lang`: Returns and sets the language of the current `SpeechRecognition`. If not specified, this defaults to the HTML `lang` attribute value, or the user agent's la... | [
0.9498785138130188,
0.4271980822086334,
-0.37833157181739807,
0.17931729555130005,
0.13928553462028503,
-0.72897869348526,
0.6656657457351685,
1.3496507406234741,
0.15990473330020905,
0.03957913815975189,
-0.5655898451805115,
1.0293328762054443,
0.17047306895256042,
0.4032847285270691,
-... |
api/speechrecognition/index.md | API - SpeechRecognition - Instance properties - Deprecated properties:
The concept of grammar has been removed from the Web Speech API. Related features remain in the specification and are still recognized by supporting browsers for backwards compatibility, but they have no effect on speech recognition services.
- `S... | [
-0.13779564201831818,
0.3671359717845917,
-0.010233607143163681,
0.20860478281974792,
0.05484648048877716,
-1.6876044273376465,
0.04131641983985901,
0.7428540587425232,
1.4067972898483276,
0.029704507440328598,
-0.9761495590209961,
0.23939651250839233,
0.3173673748970032,
0.127944245934486... |
api/speechrecognition/index.md | API - SpeechRecognition - Static methods:
- `SpeechRecognition.available()` (experimental): Checks whether the specified languages are available for speech recognition at the given quality level.
- `SpeechRecognition.install()` (experimental): Installs the required language packs for on-device speech recognition in th... | [
0.08585898578166962,
0.1571725755929947,
0.2806607484817505,
0.5480384826660156,
-0.10459060966968536,
-1.1844875812530518,
0.4476051926612854,
1.0283129215240479,
0.5320821404457092,
0.34463223814964294,
-1.284967064857483,
-0.020334415137767792,
0.5721169114112854,
0.07373271882534027,
... |
api/speechrecognition/index.md | API - SpeechRecognition - Instance methods:
`SpeechRecognition` also inherits methods from its parent interface, `EventTarget`.
- `SpeechRecognition.abort()`: Stops the speech recognition service from listening to incoming audio, and doesn't attempt to return a `SpeechRecognitionResult`.
- `SpeechRecognition.start()`... | [
0.5974381566047668,
0.5022866129875183,
-0.43325164914131165,
0.7031548619270325,
-0.24525921046733856,
-0.9960702061653137,
0.463424950838089,
0.8533727526664734,
0.47184181213378906,
0.44617360830307007,
-0.7092514038085938,
0.4632532596588135,
0.08545417338609695,
0.3611706793308258,
... |
api/speechrecognition/index.md | API - SpeechRecognition - Events:
Listen to these events using `addEventListener()` or by assigning an event listener to the `oneventname` property of this interface.
- `audiostart`: Fired when the user agent has started to capture audio.
- `audioend`: Fired when the user agent has finished capturing audio.
- `end`: ... | [
0.9432695508003235,
0.07748803496360779,
-1.0139751434326172,
0.5024494528770447,
-0.15144415199756622,
-1.0475795269012451,
1.1077121496200562,
1.037469744682312,
-0.1136821061372757,
0.3590182960033417,
0.3324103057384491,
0.00010772049427032471,
-0.442801296710968,
0.5227754712104797,
... |
api/speechrecognition/index.md | API - SpeechRecognition - Examples:
In our Speech color changer example, we create a new `SpeechRecognition` object instance using the `SpeechRecognition()` constructor.
After some other values have been defined, we then set it so that the recognition service starts when a button is clicked (see `SpeechRecognition.st... | [
0.23903422057628632,
-0.03135489672422409,
0.29145172238349915,
0.1853114664554596,
-0.10941056162118912,
-1.0899951457977295,
-0.18471980094909668,
1.034092664718628,
0.5028649568557739,
0.33981817960739136,
-0.80539870262146,
0.5239757299423218,
0.1699880212545395,
-0.1027563214302063,
... |
api/speechrecognition/available_static/index.md | API - SpeechRecognition - available static:
The `available()` static method of the Web Speech API checks whether the specified languages are available for speech recognition at the given quality level.
To install a language pack for speech recognition locally, use the `SpeechRecognition.install()` method.
Access to ... | [
0.22159719467163086,
-0.6442937850952148,
0.10094624757766724,
0.4930649399757385,
0.24418139457702637,
-1.9740855693817139,
-0.24977508187294006,
1.0308117866516113,
1.3660304546356201,
0.6029627919197083,
-0.6339340806007385,
0.630824089050293,
0.7723965644836426,
-0.19829286634922028,
... |
api/speechrecognition/available_static/index.md | API - SpeechRecognition - available static - Syntax:
Example:
available(options) | [
0.026133310049772263,
0.17923781275749207,
-0.12402644753456116,
-0.26314520835876465,
-0.48903095722198486,
-1.046716332435608,
2.0286169052124023,
1.6034549474716187,
1.4713048934936523,
0.508569598197937,
0.14194385707378387,
-0.0504426509141922,
0.9467183351516724,
0.12995299696922302,... |
api/speechrecognition/available_static/index.md | API - SpeechRecognition - available static - Syntax - Parameters:
- `options`: An object specifying options for the availability check. Possible properties include:
- `langs`: An array of one or more strings containing `BCP 47 language tags`, each representing a language to check for availability. Passing an empty `... | [
0.42999982833862305,
0.08241495490074158,
-0.302415668964386,
-0.07935948669910431,
0.24210643768310547,
-1.304154396057129,
1.24203622341156,
1.805395483970642,
0.07543182373046875,
-0.17380785942077637,
-0.20722557604312897,
0.27857857942581177,
0.5266981720924377,
0.25363045930862427,
... |
api/speechrecognition/available_static/index.md | API - SpeechRecognition - available static - Syntax - Return value:
A `Promise` that resolves with an enumerated value indicating the availability of the specified languages for speech recognition.
Possible values include:
- `available`: Indicates that all the specified languages are supported at the given `quality`... | [
0.7526178956031799,
-0.07304063439369202,
-0.08607988059520721,
0.5979660749435425,
0.2639469504356384,
-1.0775316953659058,
0.7775304913520813,
1.427830457687378,
0.05605067312717438,
0.041519645601511,
-0.3064405918121338,
0.8554468750953674,
0.09520938992500305,
0.6158026456832886,
-0... |
api/speechrecognition/available_static/index.md | API - SpeechRecognition - available static - Syntax - Return value - Final return value for multiple languages with different statuses:
Only one status value is returned, even if multiple languages are specified in the `langs` array. If different specified languages have different availability statuses, the final retu... | [
0.8685395121574402,
-0.37131211161613464,
0.3600301444530487,
0.5627428889274597,
0.20786848664283752,
-1.2556084394454956,
0.8035972714424133,
1.0512657165527344,
-0.10276495665311813,
-0.023497212678194046,
-0.3687458038330078,
0.5940470695495605,
0.26606878638267517,
0.4330672025680542,... |
api/speechrecognition/available_static/index.md | API - SpeechRecognition - available static - Syntax - Exceptions:
- `InvalidStateError` `DOMException`: The current document is not fully active.
- `SyntaxError` `DOMException`: One or more of the strings specified in `langs` is not a valid BCP 47 language tag. | [
-0.38497865200042725,
-0.29913660883903503,
0.39227429032325745,
-0.19993527233600616,
0.05477716028690338,
-1.8148504495620728,
0.8628613948822021,
1.2247787714004517,
0.333439439535141,
0.17569948732852936,
-0.3193454146385193,
0.7687110304832458,
0.7811840772628784,
-0.3136259615421295,... |
api/speechrecognition/available_static/index.md | API - SpeechRecognition - available static - Examples - Checking on-device availability and installing language packs:
For on-device speech recognition to work, the browser must have a language pack installed for the language you want to recognize. If you run the `start()` method after specifying `processLocally = tru... | [
0.22659209370613098,
0.21446667611598969,
0.4349909722805023,
-0.08668766915798187,
0.18391746282577515,
-1.244483470916748,
0.6100034117698669,
1.012110710144043,
0.9445855617523193,
0.007140996865928173,
-0.8098282217979431,
0.3001248836517334,
-0.05765915662050247,
0.3140906095504761,
... |
api/speechrecognition/available_static/index.md | API - SpeechRecognition - available static - Examples - Checking on-device model capabilities:
The following code snippet is a modification of the previous example in which we call the `available()` method with the `quality` option set to `dictation`, to check whether on-device recognition will support this quality le... | [
0.054977476596832275,
0.06207588315010071,
0.2531941831111908,
0.19046330451965332,
0.2603670656681061,
-1.1776165962219238,
0.0439256951212883,
0.8283444046974182,
0.6561319828033447,
0.39880457520484924,
-0.8363654017448425,
0.39514675736427307,
0.4435417354106903,
0.13125230371952057,
... |
api/speechrecognition/install_static/index.md | API - SpeechRecognition - install static:
The `install()` static method of the Web Speech API installs the required language packs for on-device speech recognition in the specified languages and quality level.
To check if the language packs are already available, use the `SpeechRecognition.available()` method.
Acces... | [
0.10890799015760422,
-0.38190674781799316,
-0.16657303273677826,
0.5985240936279297,
-0.09743063151836395,
-1.944935917854309,
-0.07940403372049332,
0.9570059776306152,
1.3325265645980835,
0.43947741389274597,
-0.5197714567184448,
0.6851564645767212,
0.6970873475074768,
0.05339516699314117... |
api/speechrecognition/install_static/index.md | API - SpeechRecognition - install static - Syntax:
Example:
install(options) | [
-0.5366947054862976,
0.04340236261487007,
0.07067900896072388,
-0.42575258016586304,
-0.45194122195243835,
-0.8425018787384033,
0.3416319191455841,
0.2780904769897461,
0.9527301788330078,
-0.02960854023694992,
-0.15089154243469238,
-0.5333555936813354,
0.3385775089263916,
0.481412410736084... |
api/speechrecognition/install_static/index.md | API - SpeechRecognition - install static - Syntax - Parameters:
- `options`: An object specifying options for the installation. Possible properties include:
- `langs`: An array of one or more strings containing `BCP 47 language tags`, each representing a language that you want to install the language pack for.
- `... | [
0.5165004730224609,
0.07896233350038528,
-0.46299219131469727,
0.13342587649822235,
0.2697411775588989,
-1.6886141300201416,
0.9166866540908813,
1.5079584121704102,
0.18470263481140137,
0.12200003117322922,
-0.04021722450852394,
0.29691219329833984,
0.4441884756088257,
0.2918561100959778,
... |
api/speechrecognition/install_static/index.md | API - SpeechRecognition - install static - Syntax - Return value:
A `Promise` that resolves with a boolean value indicating whether the language pack was installed successfully. The conditions that result in each return value are as follows:
- `true`: All installation attempts succeeded for the requested languages, o... | [
0.376294881105423,
-0.2586958408355713,
-0.2497791200876236,
0.4693320393562317,
0.08618216216564178,
-1.4823635816574097,
0.9120701551437378,
1.271580696105957,
0.25118428468704224,
-0.15414583683013916,
-0.26508086919784546,
0.7789735794067383,
0.23768401145935059,
0.43106070160865784,
... |
api/speechrecognition/install_static/index.md | API - SpeechRecognition - install static - Syntax - Exceptions:
- `InvalidStateError` `DOMException`: The current document is not fully active.
- `SyntaxError` `DOMException`: One or more of the strings specified in `langs` is not a valid BCP 47 language tag. | [
-0.4461316168308258,
-0.46442800760269165,
0.5276519656181335,
-0.4598354995250702,
0.02572423219680786,
-1.9041199684143066,
0.8148951530456543,
1.1775808334350586,
0.29024577140808105,
0.07315418124198914,
-0.3218706548213959,
0.6001147627830505,
0.6678520441055298,
-0.43143269419670105,... |
api/speechrecognition/install_static/index.md | API - SpeechRecognition - install static - Examples - Checking on-device availability and installing language packs:
For on-device speech recognition to work, the browser must have a language pack installed for the language you want to recognize. If you run the `start()` method after specifying `processLocally = true`... | [
0.056132588535547256,
0.40959757566452026,
0.17186301946640015,
-0.1398846060037613,
0.2431773841381073,
-1.4506093263626099,
0.4476219713687897,
0.980557918548584,
0.781109094619751,
-0.09034092724323273,
-0.7866299748420715,
0.19326171278953552,
-0.038652971386909485,
0.38771355152130127... |
api/speechrecognition/install_static/index.md | API - SpeechRecognition - install static - Examples - Checking on-device model capabilities:
The following code snippet is a modification of the previous example in which we call the `available()` method with the `quality` option set to `dictation`, to check whether on-device recognition will support this quality leve... | [
0.4618017375469208,
-0.013707033358514309,
0.492948055267334,
0.1760193258523941,
0.03258216381072998,
-1.2112386226654053,
0.2688344717025757,
0.9278731346130371,
0.9257627725601196,
0.029232431203126907,
-0.8371331095695496,
0.21047401428222656,
0.2772080600261688,
0.23116803169250488,
... |
api/mediacapabilities/encodinginfo/index.md | API - MediaCapabilities - encodingInfo:
Note: This feature is available in Web Workers.
The `encodingInfo()` method of the `MediaCapabilities` interface returns a promise that fulfills with the tested media configuration's capabilities for encoding media. This contains the three boolean properties `supported`, `smoot... | [
0.2805539071559906,
-0.21521517634391785,
-0.7838971018791199,
0.11316466331481934,
0.5787512063980103,
-0.9261351227760315,
0.19985222816467285,
1.5567874908447266,
0.14610642194747925,
-0.446790486574173,
0.028197243809700012,
0.5232377052307129,
0.9044128060340881,
0.2525845766067505,
... |
api/mediacapabilities/encodinginfo/index.md | API - MediaCapabilities - encodingInfo - Syntax:
Example:
encodingInfo(configuration) | [
-0.018650315701961517,
-0.1837015450000763,
-0.5643033981323242,
0.16068477928638458,
-0.3168739080429077,
-1.5443586111068726,
0.41234090924263,
0.835899829864502,
-0.17578676342964172,
-0.5949512720108032,
-0.19942276179790497,
0.02928030490875244,
0.17864279448986053,
0.1574556976556778... |
api/mediacapabilities/encodinginfo/index.md | API - MediaCapabilities - encodingInfo - Syntax - Parameters:
- `configuration`: An object with a property `type` and either a `video` or `audio` property containing a configuration of the appropriate type:
- `type`: The type of media being tested. This takes one of two values:
- `record`: Represents a configur... | [
0.22957681119441986,
-0.023279104381799698,
-0.5535910129547119,
0.7651979327201843,
0.6821660995483398,
-0.23125289380550385,
0.7953488826751709,
1.5537067651748657,
-0.30781006813049316,
0.21526572108268738,
0.14751173555850983,
-0.03949739411473274,
0.16398842632770538,
0.16289632022380... |
api/mediacapabilities/encodinginfo/index.md | API - MediaCapabilities - encodingInfo - Syntax - Return value:
A `Promise` fulfilling with an object containing three Boolean attributes:
- `supported`: `true` if the media content can be encoded at all. Otherwise, it is `false`.
- `smooth`: `true` if playback of the media will be smooth (of high quality). Otherwise... | [
0.49890369176864624,
0.4569148123264313,
-0.8608871102333069,
0.08795538544654846,
0.3904831111431122,
-0.7163903117179871,
0.9263842701911926,
1.5844656229019165,
-0.4246350824832916,
-0.44061043858528137,
-0.3009345233440399,
0.8198738098144531,
0.5079554319381714,
-0.26867586374282837,
... |
api/mediacapabilities/encodinginfo/index.md | API - MediaCapabilities - encodingInfo - Syntax - Exceptions:
- `TypeError`: Thrown if the `configuration` passed to the `encodingInfo()` method is invalid, which may be for any of the following reasons:
- the type is not video or audio,
- the `contentType` is not a valid codec MIME type,
- there is some other e... | [
0.004283536691218615,
-0.5613451600074768,
-0.33091655373573303,
0.6307374835014343,
-0.04573916271328926,
-1.3946415185928345,
0.22377300262451172,
1.2969565391540527,
0.42710304260253906,
-0.45044705271720886,
-0.39395567774772644,
-0.6921404600143433,
0.2513121962547302,
0.0156008824706... |
api/mediacapabilities/encodinginfo/index.md | API - MediaCapabilities - encodingInfo - Examples - Setting a media configuration:
Example:
// Create media configuration to be tested
const mediaConfig = {
type: "record",
video: {
contentType: "video/webm;codecs=vp8.0", // valid content type
width: 1920, // width of the video
height: 1080, // height... | [
0.5602867603302002,
-0.3468027114868164,
-0.4243605136871338,
0.49162864685058594,
-0.00240413099527359,
-0.8175359964370728,
0.8288447856903076,
0.8882096409797668,
-0.19709625840187073,
-0.15118327736854553,
-0.5973922610282898,
-0.344377338886261,
0.42461568117141724,
-0.364180564880371... |
api/clients/openwindow/index.md | API - Clients - openWindow:
Note: This feature is available in Web Workers.
The `openWindow()` method of the `Clients` interface creates a new top level browsing context and loads a given URL. If the calling script doesn't have permission to show popups, `openWindow()` will throw an `InvalidAccessError`.
In Firefox,... | [
-0.20108774304389954,
-0.15429693460464478,
-0.6709060668945312,
-0.013614427298307419,
0.22501394152641296,
-1.057478904724121,
0.3608677387237549,
1.0307451486587524,
-0.35897740721702576,
0.28295469284057617,
0.1313316524028778,
0.76028972864151,
0.42879071831703186,
0.10764311254024506... |
api/clients/openwindow/index.md | API - Clients - openWindow - Syntax:
Example:
openWindow(url) | [
-1.4985482692718506,
0.11885733902454376,
-0.46991783380508423,
-0.4656394124031067,
-0.388651967048645,
-1.0291780233383179,
0.29194122552871704,
0.4552887976169586,
0.3627847135066986,
-0.301919549703598,
-0.19641093909740448,
0.30398306250572205,
-0.212674081325531,
0.02346375584602356,... |
api/clients/openwindow/index.md | API - Clients - openWindow - Syntax - Parameters:
- `url`: A string representing the URL of the client you want to open in the window. Generally this value must be a URL from the same origin as the calling script. | [
-0.8655991554260254,
0.16932645440101624,
-0.31943297386169434,
-0.2016889601945877,
-0.12392749637365341,
-1.9516499042510986,
0.47756242752075195,
-0.24806244671344757,
0.05373205244541168,
0.21820393204689026,
-0.2345270961523056,
0.7828801274299622,
-0.5241731405258179,
0.2463402152061... |
api/clients/openwindow/index.md | API - Clients - openWindow - Syntax - Return value:
A `Promise` that resolves to a `WindowClient` object if the URL is from the same origin as the service worker or a `null value` otherwise. | [
-0.9836742877960205,
0.3726170063018799,
-0.09018638730049133,
0.03740721195936203,
-0.1432608813047409,
-1.3103145360946655,
1.0961854457855225,
0.6217086911201477,
-0.4172053933143616,
0.3050377368927002,
-0.2901419699192047,
0.46703726053237915,
-0.09308229386806488,
0.3897193968296051,... |
api/clients/openwindow/index.md | API - Clients - openWindow - Syntax - Exceptions:
- `InvalidAccessError` `DOMException`: The promise is rejected with this exception if none of the windows in the app's origin have transient activation. | [
-0.3724435567855835,
-0.1545131951570511,
-0.07932048290967941,
-0.5355695486068726,
-0.32680612802505493,
-2.3436241149902344,
0.3836369812488556,
0.21076999604701996,
0.24851620197296143,
0.03862354904413223,
-0.6003166437149048,
0.24223199486732483,
0.2282443344593048,
0.378530144691467... |
api/clients/openwindow/index.md | API - Clients - openWindow - Security requirements:
- At least one window in the app's origin must have transient activation. | [
-0.8428952097892761,
0.20089907944202423,
-0.2753797471523285,
0.027317240834236145,
-0.5223346948623657,
-0.27709177136421204,
-0.23048292100429535,
-0.23849108815193176,
0.5334178805351257,
-0.49666982889175415,
-0.43014228343963623,
-0.48844724893569946,
0.00542178750038147,
-0.28435474... |
api/clients/openwindow/index.md | API - Clients - openWindow - Examples - Opening a window on a notification click:
In this example a service worker creates and then shows a notification that contains an associated URL, which is under the service worker's scope. When the user clicks the notification:
- If the page at the notification's URL is already... | [
-1.1234461069107056,
-0.19242194294929504,
-0.10458298027515411,
0.03186066448688507,
0.06995026767253876,
-1.1759601831436157,
0.5855048298835754,
0.436073362827301,
0.04105767607688904,
0.6562032699584961,
-0.242245152592659,
0.7037219405174255,
-0.011166974902153015,
0.4484349489212036,... |
api/web_serial_api/index.md | API - Web Serial API:
Secure context: This feature is available only in secure contexts (HTTPS). Note: This feature is available in Web Workers.
The Web Serial API provides a way for websites to read from and write to serial devices. These devices may be connected via a serial port, or be USB or Bluetooth devices tha... | [
0.02319253422319889,
-0.09237192571163177,
-0.18999983370304108,
0.12528330087661743,
0.16611862182617188,
-0.7488240599632263,
0.19218233227729797,
1.1680848598480225,
0.3392719626426697,
0.3472149968147278,
0.23035749793052673,
1.186411738395691,
0.4651477336883545,
-0.6078267693519592,
... |
api/web_serial_api/index.md | API - Web Serial API - Concepts and Usage:
The Web Serial API provides the ability to connect to devices that communicate via a serial protocol. This includes USB and Bluetooth devices that connect over USB or Bluetooth but expose a virtual serial port to the operating system (via USB CDC-ACM or Bluetooth SPP).
Note ... | [
-0.09265267103910446,
0.5444478392601013,
-1.0549180507659912,
-0.083880215883255,
-0.10524313151836395,
-0.36211222410202026,
0.11673741042613983,
1.0103328227996826,
-0.08433626592159271,
0.6975701451301575,
-0.2672213315963745,
1.0316814184188843,
0.6487996578216553,
0.24469497799873352... |
api/web_serial_api/index.md | API - Web Serial API - Interfaces:
- `Serial` (experimental): Provides attributes and methods for finding and connecting to serial ports from a web page.
- `SerialPort` (experimental): Provides access to a serial port on the host device. | [
-0.40136533975601196,
-0.9326450228691101,
-0.04000179469585419,
-0.07803855836391449,
-0.5752606987953186,
-1.127989411354065,
0.6589116454124451,
0.42144811153411865,
0.5642642378807068,
0.35162755846977234,
0.07821592688560486,
0.7820770144462585,
1.0388959646224976,
-0.1566666662693023... |
api/web_serial_api/index.md | API - Web Serial API - Extensions to other interfaces:
- `Navigator.serial` (read only) (experimental): Returns a `Serial` object, which represents the main thread entry point into the Web Serial API.
- `WorkerNavigator.serial` (read only) (experimental): Returns a `Serial` object, which represents the worker entry po... | [
-1.07037353515625,
-0.7186270356178284,
-0.26201343536376953,
0.2573663294315338,
-0.260272741317749,
-1.0622628927230835,
0.3868039846420288,
0.40435412526130676,
0.8875831365585327,
0.5523093938827515,
-0.21984274685382843,
0.03856988251209259,
0.4544219970703125,
-0.14015412330627441,
... |
api/web_serial_api/index.md | API - Web Serial API - HTTP headers:
- `Permissions-Policy` `serial` directive: Controls whether the current document is allowed to use the Web Serial API to communicate with serial devices, either directly connected via a serial port, or via USB or Bluetooth devices emulating a serial port. | [
-0.30166003108024597,
-0.247623473405838,
-0.47299450635910034,
-0.0655592828989029,
-0.40168997645378113,
-1.2707240581512451,
0.09288062155246735,
1.0397248268127441,
0.5277469754219055,
0.3509584963321686,
-0.22339725494384766,
1.2037267684936523,
0.5680124163627625,
-0.1295519769191742... |
api/web_serial_api/index.md | API - Web Serial API - Examples:
The following examples demonstrate some of the functionality provided by the Web Serial API. | [
-1.155930995941162,
-0.032638631761074066,
-0.04479193687438965,
-0.8550346493721008,
-0.5685743093490601,
-0.848809003829956,
0.9244952201843262,
0.7880554795265198,
0.48599523305892944,
0.05831145495176315,
0.1482248455286026,
0.6294574737548828,
-0.07969360053539276,
-0.1249878481030464... |
api/web_serial_api/index.md | API - Web Serial API - Examples - Checking for available ports:
The following example shows how to check for available ports and allows the user to grant it permission to access additional ports.
The `connect` and `disconnect` events let sites react when a device is connected or disconnected from the system. The `get... | [
0.30408042669296265,
-0.4368561804294586,
-0.43702349066734314,
-0.1070714071393013,
-0.0031647086143493652,
-1.0675073862075806,
-0.12509343028068542,
0.42523422837257385,
0.17024187743663788,
0.825397789478302,
0.035193219780921936,
0.667205810546875,
0.5181552767753601,
-0.0043535642325... |
api/web_serial_api/index.md | API - Web Serial API - Examples - Reading data from a port:
The following example shows how to read data from a port. The outer loop handles non-fatal errors, creating a new reader until a fatal error is encountered and `SerialPort.readable` becomes `null`.
Example:
while (port.readable) {
const reader = port.read... | [
-0.27646005153656006,
-0.1491200476884842,
0.1528044044971466,
-0.08165541291236877,
0.32934263348579407,
-0.8567737340927124,
-0.29222896695137024,
0.5573837757110596,
0.9965863227844238,
0.43293339014053345,
-0.53557288646698,
-0.17458027601242065,
-0.4613451659679413,
0.0519804581999778... |
api/web_storage_api/using_the_web_storage_api/index.md | API - Web Storage API - Using the Web Storage API:
The Web Storage API provides mechanisms by which browsers can securely store key/value pairs.
This article provides a walkthrough of how to make use of this technology. | [
0.36278918385505676,
0.2846568822860718,
-0.670532763004303,
0.2590043246746063,
-0.28350284695625305,
-1.241225004196167,
0.5951540470123291,
1.4204996824264526,
0.35299739241600037,
-0.2597602903842926,
-0.011479198932647705,
0.9431545734405518,
-0.19430063664913177,
0.38261595368385315,... |
api/web_storage_api/using_the_web_storage_api/index.md | API - Web Storage API - Using the Web Storage API - Basic concepts:
Storage objects are simple key-value stores, similar to objects, but they stay intact through page loads. The keys and the values are always strings (note that, as with objects, integer keys will be automatically converted to strings). You can access ... | [
0.460430771112442,
-0.24054475128650665,
-0.6927728056907654,
0.22076696157455444,
0.24910449981689453,
-0.8350012898445129,
0.03379996120929718,
1.7744988203048706,
-0.07030671834945679,
-0.11533907055854797,
-0.02033655345439911,
0.9522011280059814,
-0.01915234699845314,
0.37250182032585... |
api/web_storage_api/using_the_web_storage_api/index.md | API - Web Storage API - Using the Web Storage API - Feature-detecting localStorage:
To be able to use localStorage, we should first verify that it is supported and available in the current browsing session. | [
0.12083561718463898,
-0.1472475230693817,
0.15078192949295044,
0.2477710247039795,
-0.5443170070648193,
-1.1874362230300903,
-0.12622225284576416,
0.8680729269981384,
1.1953173875808716,
-0.74598228931427,
-0.3258882164955139,
0.7617401480674744,
0.025655072182416916,
0.2327498495578766,
... |
api/web_storage_api/using_the_web_storage_api/index.md | API - Web Storage API - Using the Web Storage API - Feature-detecting localStorage - Testing for availability:
Browsers that support localStorage have a property on the window object named `localStorage`. However, just testing that the property exists, like in normal feature detection, may be insufficient. Various bro... | [
0.7945228219032288,
0.09679009765386581,
-0.04737532511353493,
0.36675360798835754,
0.42679810523986816,
-1.1832689046859741,
0.676153302192688,
1.8690812587738037,
-0.06819771230220795,
-0.17811135947704315,
0.11076796054840088,
1.0150415897369385,
-0.29170510172843933,
0.7550535202026367... |
api/web_storage_api/using_the_web_storage_api/index.md | API - Web Storage API - Using the Web Storage API - Example:
To illustrate some typical web storage usage, we have created an example, imaginatively called Web Storage Demo. The landing page provides controls that can be used to customize the color, font, and decorative image:
When you choose different options, the p... | [
0.8279966115951538,
0.01581822708249092,
-0.141217440366745,
0.1472969502210617,
-0.1476287543773651,
-1.1709777116775513,
0.5696203112602234,
1.8115679025650024,
-0.42968329787254333,
0.3451515734195709,
0.34529104828834534,
1.2114551067352295,
-0.07642337679862976,
0.34587129950523376,
... |
api/web_storage_api/using_the_web_storage_api/index.md | API - Web Storage API - Using the Web Storage API - Example - Testing whether your storage has been populated:
To start with, in main.js, we test whether the storage object has already been populated (i.e., the page was previously accessed):
Example:
if (!localStorage.getItem("bgcolor")) {
populateStorage();
} els... | [
0.4906272888183594,
-0.551659107208252,
-0.15123897790908813,
0.2990768551826477,
0.048620834946632385,
-1.4600956439971924,
-0.061404939740896225,
1.4545142650604248,
-0.854830265045166,
0.09433355182409286,
0.2238525152206421,
0.8461783528327942,
0.10384340584278107,
0.3336760997772217,
... |
api/web_storage_api/using_the_web_storage_api/index.md | API - Web Storage API - Using the Web Storage API - Example - Getting values from storage:
As noted above, values can be retrieved from storage using `Storage.getItem()`. This takes the key of the data item as an argument, and returns the data value.
For example:
Example:
function setStyles() {
const currentColor... | [
0.7799559831619263,
-0.5946879982948303,
0.03611300140619278,
0.20947974920272827,
-0.23729732632637024,
-0.8030055165290833,
-0.43577954173088074,
2.0842998027801514,
-0.09588394314050674,
-0.3179744482040405,
0.17643721401691437,
1.1255278587341309,
0.4344366788864136,
0.3973467946052551... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.