file
stringlengths
16
94
text
stringlengths
32
24.4k
vector
list
api/document/requeststorageaccessfor/index.md
API - Document - requestStorageAccessFor: Deprecated: This feature is no longer recommended. Non-standard: This feature is not standardized. The `requestStorageAccessFor()` method of the `Document` interface allows top-level sites to request third-party cookie access on behalf of embedded content originating from ano...
[ 0.8990296721458435, -0.6787352561950684, -0.15345661342144012, -0.4597338140010834, -0.03230232372879982, -0.5720565319061279, 0.7921256422996521, 1.378004789352417, -0.6331466436386108, -0.24321311712265015, -0.22318898141384125, 1.0015287399291992, 0.3282744884490967, 0.6244894862174988,...
api/document/requeststorageaccessfor/index.md
API - Document - requestStorageAccessFor - Syntax: Example: requestStorageAccessFor(requestedOrigin)
[ -0.2000526785850525, -0.20587199926376343, 0.5063202977180481, -0.5252693295478821, -0.5937074422836304, -1.6737018823623657, -0.4395970106124878, 0.5513296127319336, -0.01691458374261856, -0.9995750188827515, 0.2999992370605469, 0.581596851348877, -0.4108583927154541, 0.28063005208969116,...
api/document/requeststorageaccessfor/index.md
API - Document - requestStorageAccessFor - Syntax - Parameters: - `requestedOrigin`: A string representing the URL of the origin you are requesting third-party cookie access for.
[ 0.27590662240982056, -0.014435924589633942, -0.12542986869812012, 0.00005742162466049194, -0.12533248960971832, -1.0452265739440918, 0.011944059282541275, 0.6827447414398193, -0.14048345386981964, 0.09931045025587082, 0.1251915842294693, 0.4639577865600586, -0.43369778990745544, 0.05322042...
api/document/requeststorageaccessfor/index.md
API - Document - requestStorageAccessFor - Syntax - Return value: A `Promise` that fulfills with `undefined` if the access to third-party cookies was granted and rejects if access was denied. `requestStorageAccessFor()` requests are automatically denied unless the top-level content is currently processing a user gest...
[ -0.3821244537830353, -0.2149355560541153, 0.38090917468070984, -0.33347266912460327, -0.14701567590236664, -1.2216787338256836, 0.2812002897262573, 0.816724419593811, -0.3385258615016937, -0.051027409732341766, -0.24985668063163757, 0.5882719159126282, 0.22209450602531433, 0.28905507922172...
api/document/requeststorageaccessfor/index.md
API - Document - requestStorageAccessFor - Syntax - Exceptions: - `InvalidStateError` `DOMException`: Thrown if the current `Document` is not yet active. - `NotAllowedError` `DOMException`: Thrown if: - The document's window is not a secure context. - The document is not the top-level document. - The document ha...
[ 0.6557883024215698, -0.3934345841407776, 0.3862452805042267, 0.38729679584503174, -0.24210180342197418, -1.5959808826446533, -1.043169617652893, 1.0331546068191528, 0.48540210723876953, 0.05839669331908226, -0.8918892741203308, 0.4273911416530609, 0.018497716635465622, -0.23943348228931427...
api/document/requeststorageaccessfor/index.md
API - Document - requestStorageAccessFor - Description: The `requestStorageAccessFor()` method addresses challenges in adopting the Storage Access API on top-level sites that use cross-site images or scripts requiring cookies. It is relevant to user agents that by default block access to third-party, unpartitioned coo...
[ 0.6746984124183655, -0.5743950605392456, -0.6266965866088867, 0.12452515959739685, 0.5239679217338562, -0.7777108550071716, 0.2038080394268036, 1.5252280235290527, -0.6595457792282104, -0.053293533623218536, 0.06734682619571686, 1.138136863708496, 0.21067452430725098, 0.397388219833374, ...
api/document/requeststorageaccessfor/index.md
API - Document - requestStorageAccessFor - Examples: Example: function rSAFor() { if ("requestStorageAccessFor" in document) { document.requestStorageAccessFor("https://example.com").then( (res) => { // Use storage access doThingsWithCookies(); }, (err) => { // Handle e...
[ 0.048395365476608276, -0.01992601715028286, 0.2004324048757553, 0.21654528379440308, 0.1146329790353775, -0.9989287257194519, -0.5427372455596924, 1.2194360494613647, -0.1305846869945526, -0.2610720992088318, 0.05008965730667114, 0.6708795428276062, 0.029488418251276016, 0.3076420128345489...
api/document/evaluate/index.md
API - Document - evaluate: The `evaluate()` method of the `Document` interface selects elements based on the XPath expression given in parameters. XPath expressions can be evaluated on both HTML and XML documents.
[ 0.14713667333126068, -0.6106806993484497, -0.720440685749054, 0.18300914764404297, -0.1501905918121338, -1.8537092208862305, 0.7737577557563782, -0.4598528742790222, 0.486505925655365, 0.12071600556373596, -0.2250194549560547, 0.05114082247018814, 1.2850507497787476, -0.11813999712467194, ...
api/document/evaluate/index.md
API - Document - evaluate - Syntax: Example: evaluate(xpathExpression, contextNode, namespaceResolver, resultType, result)
[ 0.0663018748164177, -0.8496273756027222, 0.18973082304000854, 0.4659329652786255, -0.2237074226140976, -1.2332404851913452, 0.1766820102930069, 0.5789181590080261, 1.2366962432861328, -0.5388995409011841, 0.021130889654159546, -0.10998993366956711, 0.20544971525669098, 0.03173523396253586,...
api/document/evaluate/index.md
API - Document - evaluate - Syntax - Parameters: - `xpathExpression`: A string representing the xpath to be evaluated. - `contextNode`: The context node for the query. It's common to pass `document` as the context node. - `namespaceResolver` (optional): A function that will be passed any namespace prefixes and should ...
[ 0.24987980723381042, -0.1288348287343979, 0.23379135131835938, 0.9515236020088196, -0.06089123710989952, -0.7146625518798828, 0.782832682132721, 0.19521476328372955, 0.7622530460357666, 0.34296709299087524, -0.540508508682251, -0.12016497552394867, 0.12978845834732056, 0.07809612154960632,...
api/document/evaluate/index.md
API - Document - evaluate - Syntax - Return value: An `XPathResult` linking to the selected nodes. If `result` was `null`, it is a new object, if not, it is the same object as the one passed as the `result` parameter.
[ 0.01632782444357872, -0.2950436770915985, -0.21399147808551788, 0.8890584111213684, -0.4144112467765808, -1.1242183446884155, 1.2759584188461304, 0.44394129514694214, 0.15611770749092102, 0.1990562528371811, -0.37244758009910583, 0.512940526008606, 0.7204234004020691, 0.19218073785305023, ...
api/document/evaluate/index.md
API - Document - evaluate - Examples - Finding all H2 headings by XPath: Example: const headings = document.evaluate( "/html/body//h2", document, null, XPathResult.ANY_TYPE, null, ); /* Search the document for all h2 elements. * The result will likely be an unordered node iterator. */ let thisHeading = hea...
[ -0.47128114104270935, -0.3712773323059082, 0.07012923061847687, 1.2262014150619507, -0.3260279595851898, -1.5198746919631958, 1.140642762184143, 0.14434854686260223, 0.1416870802640915, 0.14547757804393768, -1.1390938758850098, -0.25994250178337097, -0.16345365345478058, 0.2826566994190216...
api/document/evaluate/index.md
API - Document - evaluate - Examples - Getting element by xml:id: This function is a replacement for `Document.getElementById()` for when you need to search by `xml:id` instead. Example: function getElementByIdWrapper(xmlDoc, id) { return xmlDoc.evaluate( `//*[@xml:id="${id}"]`, xmlDoc, () => "http://w...
[ -0.1421239674091339, -0.32715702056884766, -0.2738181948661804, -0.2640959620475769, -0.34371960163116455, -1.409008264541626, 0.6262370944023132, -0.03454352915287018, -0.4938315749168396, 0.029515374451875687, -0.3934428095817566, -0.15040108561515808, -0.11444534361362457, 0.37216460704...
api/document/startviewtransition/index.md
API - Document - startViewTransition: The `startViewTransition()` method of the `Document` interface starts a new same-document (`SPA`), document-scoped view transition and returns a `ViewTransition` object to represent it. The sequence of steps followed when `startViewTransition()` is invoked is explained in the vie...
[ 0.2656809985637665, -0.46217817068099976, 0.0625162273645401, 0.5265865325927734, -0.21599794924259186, -0.7155860066413879, 0.5821800231933594, 0.6512338519096375, 0.40990200638771057, 0.3365463316440582, -0.084822878241539, -0.31845012307167053, 0.9980520009994507, 0.47311651706695557, ...
api/document/startviewtransition/index.md
API - Document - startViewTransition - Syntax: Example: startViewTransition() startViewTransition(updateCallback) startViewTransition(options)
[ -0.5523090958595276, -0.4103119671344757, 0.24561500549316406, 0.4571053683757782, -0.3943294584751129, -0.9753893613815308, -0.09330862760543823, 0.8303821086883545, 0.10055050253868103, 0.02979644201695919, 0.1354912370443344, -1.0273642539978027, 0.7252368330955505, 1.1732258796691895, ...
api/document/startviewtransition/index.md
API - Document - startViewTransition - Syntax - Parameters: - `updateCallback` (optional): A callback function invoked to update the DOM during the SPA view transition process. It returns a `Promise`. The callback is invoked once the API has taken a snapshot of the current page. When the promise returned by the callba...
[ 0.0008148765191435814, -0.35775789618492126, -0.11804456263780594, 0.39446955919265747, -0.17817021906375885, -1.3955857753753662, 0.8618093132972717, 1.385903239250183, 0.2246110737323761, 0.4186779856681824, -0.13777191936969757, -0.42910489439964294, 0.6166014075279236, 0.63132905960083...
api/document/startviewtransition/index.md
API - Document - startViewTransition - Syntax - Return value: A `ViewTransition` object instance.
[ 0.1830381155014038, -0.7196276783943176, -0.02361084707081318, 0.32784512639045715, -0.2602441906929016, -1.0244969129562378, 0.3627338409423828, 0.7806112766265869, 0.16722656786441803, 0.09885697066783905, 0.09108377993106842, -0.257443368434906, 0.8208606839179993, 1.0465553998947144, ...
api/document/startviewtransition/index.md
API - Document - startViewTransition - Examples: See View transition API > Examples for a list of full examples.
[ -0.018477683886885643, -0.38788363337516785, 0.22632786631584167, 0.4999803900718689, -0.532202422618866, -0.2721598446369171, -0.4544200301170349, 0.8249807357788086, 0.41395071148872375, -0.21490606665611267, 0.7209159135818481, -0.5232522487640381, 0.952894389629364, 0.9885975122451782,...
api/document/startviewtransition/index.md
API - Document - startViewTransition - Examples - Basic usage: In this same-document view transition, we check if the browser supports view transitions. If there's no support, we set the background color using a fallback method which is applied immediately. Otherwise, we can safely call `document.startViewTransition()...
[ -0.5022537708282471, -0.3214702904224396, 0.1299024075269699, 0.12968124449253082, -0.08141545206308365, -1.065798282623291, -0.020100392401218414, 1.0173072814941406, -0.16346241533756256, 0.4171580374240875, -0.5661622285842896, -0.3017624020576477, 0.23132187128067017, 0.220672756433486...
api/document/browsingtopics/index.md
API - Document - browsingTopics: Non-standard: This feature is not standardized. Deprecated: This feature is no longer recommended. Warning: This feature is currently opposed by two browser vendors. See the Standards positions section below for details of opposition. Note: An Enrollment process is required to use th...
[ 0.8436220288276672, -0.29006296396255493, -0.3245803117752075, 0.2809838354587555, 0.48759371042251587, -1.385571837425232, 0.3039921820163727, 0.18078041076660156, 0.07094156742095947, 0.19676704704761505, -0.7244066596031189, 0.665534496307373, 0.5950355529785156, 0.4573822617530823, 0...
api/document/browsingtopics/index.md
API - Document - browsingTopics - Syntax: Example: browsingTopics() browsingTopics(options)
[ -0.07306046783924103, -0.00010284781455993652, -0.4759354591369629, 0.5818937420845032, -0.7923564910888672, -1.063615322113037, 1.1210087537765503, 0.590964138507843, 0.05843840539455414, 0.2686070501804352, 0.3578401505947113, 0.0725492537021637, 0.6832294464111328, -0.122896209359169, ...
api/document/browsingtopics/index.md
API - Document - browsingTopics - Syntax - Parameters: - `options` (optional): An options object, which can contain the following properties: - `skipObservation`: A boolean value that, if set to `true`, causes the browser to not observe topics when `browsingTopics()` is invoked. The default is `false`, which causes ...
[ -0.5189728736877441, -0.5739040374755859, 0.1131022721529007, 0.2856985330581665, -0.09368863701820374, -0.9603092074394226, 0.6677793264389038, -0.20822645723819733, 0.7173961997032166, 0.29480376839637756, -0.9016019105911255, -0.6536292433738708, 0.6357563138008118, 0.5857266783714294, ...
api/document/browsingtopics/index.md
API - Document - browsingTopics - Syntax - Return value: A `Promise` that fulfills with an array of up to three objects representing the current user's selected topics for the last three epochs. Each object contains the following properties: - `configVersion`: A string identifying the algorithm (other than the model ...
[ -0.558992326259613, -0.6931094527244568, 0.013651430606842041, 0.5366238951683044, 0.20121094584465027, -1.5872647762298584, 0.70651775598526, 0.5454304218292236, -0.23234495520591736, 0.47288432717323303, -0.5568448901176453, 0.7672847509384155, 0.6885464787483215, 0.4385750889778137, -...
api/document/browsingtopics/index.md
API - Document - browsingTopics - Syntax - Exceptions: - `NotAllowedError` `DOMException`: Thrown if: - Usage of the Topics API is disallowed by a `browsing-topics` Permissions Policy. - The calling site does not have the Topics API included in a successful privacy sandbox enrollment process.
[ 0.31431296467781067, -1.0393543243408203, 0.03845224529504776, 0.843601405620575, -0.22099371254444122, -1.729431390762329, -1.0675971508026123, 0.6187409162521362, 0.7265459299087524, 0.5601031184196472, -0.805601954460144, 0.11438813805580139, 0.4776279330253601, -0.1589086949825287, -...
api/document/browsingtopics/index.md
API - Document - browsingTopics - Examples: Example: // Get an array of top topics for this user const topics = await document.browsingTopics(); // Request an ad creative const response = await fetch("https://ads.example/get-creative", { method: "POST", headers: { "Content-Type": "application/json", }, b...
[ -0.20956113934516907, -0.5832526683807373, 0.30722472071647644, 0.29740846157073975, -0.2154165804386139, -1.1586719751358032, -0.22057372331619263, -0.26003462076187134, -0.15138031542301178, 0.08450637757778168, -0.30782845616340637, 0.19965076446533203, 0.4330451786518097, 0.01089802384...
api/document/cookie/index.md
API - Document - cookie: The `Document` property `cookie` lets you read and write cookies associated with the document. It serves as a getter and setter for the actual values of the cookies. Note: The `document.cookie` can be a source of performance issues because it is a synchronous API and blocks the main thread wh...
[ -0.17266009747982025, 0.14834295213222504, 0.1525394171476364, -0.12813425064086914, -0.04294649884104729, -0.63639235496521, -0.25491857528686523, 0.7768443822860718, 0.3139813542366028, -0.05681292712688446, -0.20661261677742004, -0.17152810096740723, 0.6933075189590454, 0.57441318035125...
api/document/cookie/index.md
API - Document - cookie - Value: A string containing a semicolon-separated list of all cookies (i.e., `key=value` pairs). Note that each key and value may be surrounded by whitespace (space and tab characters): in fact, RFC 6 mandates a single space after each semicolon, but some user agents may not abide by this. Yo...
[ 0.2740248441696167, -0.45415082573890686, 0.15746836364269257, 0.24654847383499146, 0.6482174396514893, -0.19847816228866577, 1.105745553970337, 0.9194309711456299, -0.41623246669769287, -0.38816767930984497, 0.4131007194519043, 0.7214500308036804, 0.18517015874385834, 0.11963726580142975,...
api/document/cookie/index.md
API - Document - cookie - Examples - Example 1: Simple usage: Example: <button id="show">Show cookies</button> <button id="clear">Clear</button> <div> <code id="cookie-value"></code> </div> Example: const showBtn = document.getElementById("show"); const clearBtn = document.getElementById("clear"); const output = ...
[ -0.031122423708438873, -0.06135550141334534, -0.04416521638631821, 0.028582438826560974, -0.12571342289447784, -0.5046370029449463, -0.20431484282016754, 0.4413430988788605, 0.1351759284734726, -0.0775449275970459, -0.07911604642868042, 0.06201949715614319, -0.24247433245182037, -0.2379728...
api/document/cookie/index.md
API - Document - cookie - Examples - Example 2: Get a sample cookie named test2: Example: <button id="show">Show cookie value</button> <button id="clear">Clear</button> <div> <code id="cookie-value"></code> </div> Example: const showBtn = document.getElementById("show"); const clearBtn = document.getElementById("...
[ -0.37498319149017334, 0.03056538850069046, 0.14352883398532867, 0.1250331848859787, 0.13839571177959442, -0.5418219566345215, -0.34645822644233704, 0.22955292463302612, -0.10277703404426575, 0.24426183104515076, 0.16497637331485748, 0.2943365275859833, -0.29418861865997314, 0.0441536679863...
api/document/cookie/index.md
API - Document - cookie - Examples - Example 3: Do something only once: In order to use the following code, please replace all occurrences of the word `doSomethingOnlyOnce` (the name of the cookie) with a custom name. Example: <button id="do-once">Only do something once</button> <button id="clear">Clear</button> <di...
[ 0.1608995795249939, -0.27296921610832214, 0.06351675093173981, -0.020602965727448463, -0.09695526212453842, -0.742339015007019, -0.0083041712641716, 0.7633878588676453, -0.09387525916099548, -0.11147148907184601, -0.39358314871788025, 0.23643267154693604, -0.2461932748556137, 0.00516726076...
api/document/cookie/index.md
API - Document - cookie - Examples - Example 4: Reset the previous cookie: Example: <button id="reset">Reset only once cookie</button> <button id="clear">Clear</button> <div> <code id="output"></code> </div> Example: const resetBtn = document.getElementById("reset"); const clearBtn = document.getElementById("clea...
[ -0.2272750586271286, -0.013459419831633568, -0.23514458537101746, 0.21646499633789062, 0.06136518716812134, -0.928633987903595, 0.24508234858512878, 0.7910588979721069, -0.04140753671526909, 0.1786828339099884, -0.08845086395740509, 0.03353671729564667, -0.23615354299545288, 0.051820620894...
api/document/cookie/index.md
API - Document - cookie - Examples - Example 5: Check a cookie existence: Example: <button id="check">Check a cookie exists</button> <button id="clear">Clear</button> <div> <code id="output"></code> </div> Example: const checkBtn = document.getElementById("check"); const clearBtn = document.getElementById("clear"...
[ 0.35617056488990784, -0.5574859976768494, 0.12904858589172363, 0.18161100149154663, -0.200827494263649, -0.48091477155685425, -0.4517644941806793, 0.6106405258178711, -0.18444424867630005, 0.4256131947040558, 0.14818555116653442, -0.38149863481521606, -0.27698689699172974, 0.07331462204456...
api/document/cookie/index.md
API - Document - cookie - Examples - Example 6: Check that a cookie has a specific value: Example: <button id="check">Check that a cookie has a specific value</button> <button id="clear">Clear</button> <div> <code id="output"></code> </div> Example: const checkBtn = document.getElementById("check"); const clearBt...
[ 0.10249026864767075, 0.11732970178127289, 0.47641170024871826, -0.09811476618051529, 0.0947546660900116, -0.45656147599220276, -0.18727008998394012, 0.5621159076690674, 0.37754181027412415, -0.28933703899383545, 0.03709937632083893, 0.07322883605957031, 0.26399070024490356, 0.3004749417304...
api/document/cookie/index.md
API - Document - cookie - Security: It is important to note that the `path` attribute does not protect against unauthorized reading of the cookie from a different path. It can be easily bypassed using the DOM, for example by creating a hidden `iframe` element with the path of the cookie, then accessing this iframe's `...
[ 0.7510234117507935, 0.035253193229436874, -0.41839656233787537, 0.1523328423500061, -0.23387214541435242, -0.5006276965141296, 0.26851096749305725, 0.8674763441085815, -0.37105000019073486, 0.23978100717067719, 0.15251483023166656, 0.17185069620609283, 0.1923237144947052, -0.23404198884963...
api/document/cookie/index.md
API - Document - cookie - Notes: - Starting with Firefox 2, a better mechanism for client-side storage is available - WHATWG DOM Storage. - You can delete a cookie by updating its expiration time to zero. - Keep in mind that the more cookies you have, the more data will be transferred between the server and the client...
[ 0.32048720121383667, -0.19395580887794495, -0.2848264276981354, 0.19005732238292694, 0.3475133776664734, -0.7352264523506165, 0.3342585861682892, 1.250048279762268, -0.6689252853393555, -0.24230071902275085, 0.5328758955001831, 0.514074444770813, -0.016188260167837143, 0.3961983323097229, ...
api/fetch_api/index.md
API - Fetch API: The Fetch API provides an interface for fetching resources (including across the network). It is a more powerful and flexible replacement for `XMLHttpRequest`.
[ -0.014681600965559483, -0.2023485004901886, 0.07169774174690247, 0.68864905834198, 0.01800374686717987, -1.4465999603271484, 0.1711101233959198, 0.47369787096977234, 0.8693095445632935, -0.4974730610847473, -0.4512091875076294, 0.07456675171852112, 0.2837718427181244, -0.2288990169763565, ...
api/fetch_api/index.md
API - Fetch API - Concepts and usage: The Fetch API uses `Request` and `Response` objects (and other things involved with network requests), as well as related concepts such as CORS and the HTTP Origin header semantics. For making a request and fetching a resource, use the `fetch()` method. It is a global method in b...
[ 0.8426449298858643, 0.13139359652996063, -0.36145031452178955, 0.7355502843856812, 0.4904303550720215, -1.2267388105392456, 0.33185991644859314, 1.2465635538101196, -0.27230027318000793, 0.030002661049365997, -0.21552540361881256, 1.2016475200653076, 0.3897746205329895, 0.6107980012893677,...
api/fetch_api/index.md
API - Fetch API - Concepts and usage - Deferred Fetch: The `fetchLater()` API enables a developer to request a deferred fetch, that can be sent after a specified period of time, or when the page is closed or navigated away from. See Using Deferred Fetch.
[ 0.2879394590854645, -0.508429765701294, 0.2050420492887497, 0.6351423263549805, 0.4228901267051697, -1.076192021369934, -0.00936448760330677, 0.477641224861145, 0.29767468571662903, -0.26607874035835266, -0.37759265303611755, 1.115281581878662, -0.3727104365825653, 0.6900671124458313, -0...
api/fetch_api/index.md
API - Fetch API - Interfaces: - `Window.fetch()` and `WorkerGlobalScope.fetch()`: The `fetch()` method used to fetch a resource. - `Window.fetchLater()`: Used to make a deferred fetch request. - `DeferredRequestInit`: Represents the set of options that can be used to configure a deferred fetch request. - `FetchLaterRe...
[ -0.16506920754909515, -0.1102127805352211, 0.2745461165904999, 0.695651650428772, -0.5283179879188538, -0.7633213400840759, -0.34426021575927734, 0.1968746781349182, 0.7498776316642761, -0.324507474899292, -0.3564704358577728, 0.41704878211021423, 0.23066985607147217, 0.41164636611938477, ...
api/fetch_api/index.md
API - Fetch API - HTTP headers: - `deferred-fetch`: Controls the top-level quota for the `fetchLater()` API. - `deferred-fetch-minimal`: Controls the shared cross-origin subframe quota for the `fetchLater()` API.
[ 0.13856840133666992, -0.11370807141065598, 0.32290351390838623, 0.5323240756988525, -0.33150991797447205, -1.4263557195663452, 0.03592851012945175, 0.4088737368583679, 0.6677632331848145, -0.24615579843521118, -0.6790867447853088, 0.5298632383346558, 0.13893799483776093, 0.7606223225593567...
api/screen_capture_api/index.md
API - Screen Capture API: The Screen Capture API introduces additions to the existing Media Capture and Streams API to let the user select a screen or portion of a screen (such as a window) to capture as a media stream. This stream can then be recorded or shared with others over the network.
[ 1.3689537048339844, -0.7531414031982422, -0.6619219183921814, 0.39223477244377136, 0.26002827286720276, -0.6537936329841614, -0.7159140110015869, 1.0633183717727661, 0.24644726514816284, 0.304007351398468, 0.41292500495910645, -0.19848665595054626, 0.10824248194694519, 0.41165292263031006,...
api/screen_capture_api/index.md
API - Screen Capture API - Screen Capture API concepts and usage: The Screen Capture API is relatively simple to use. Its main method is `MediaDevices.getDisplayMedia()`, whose job is to ask the user to select a screen or portion of a screen to capture in the form of a `MediaStream`. To start capturing video from the...
[ 0.5895898938179016, -0.12042906135320663, -1.0523242950439453, -0.16200944781303406, 0.42888104915618896, -0.7749709486961365, -0.3136785328388214, 1.2309054136276245, -0.4295274317264557, 0.4170288145542145, 0.19697998464107513, 0.29451116919517517, -0.19382163882255554, 0.618380904197692...
api/screen_capture_api/index.md
API - Screen Capture API - Screen Capture API concepts and usage - Screen capture extensions: The Screen Capture API has additional features that extend its capabilities:
[ -0.12015416473150253, 0.06819285452365875, -0.6845128536224365, 0.1924118995666504, 0.14563976228237152, -0.8836284875869751, 0.3001193106174469, 1.1678568124771118, 0.7501894235610962, -0.266260027885437, -0.45392876863479614, 0.22023704648017883, -0.02953159064054489, 0.39687711000442505...
api/screen_capture_api/index.md
API - Screen Capture API - Screen Capture API concepts and usage - Screen capture extensions - Limiting the screen area captured in the stream: - The Element Capture API restricts the captured region to a specified rendered DOM element and its descendants. - The Region Capture API crops the captured region to the area...
[ 0.9038622975349426, -0.24227087199687958, -0.6635227203369141, -0.10788513720035553, 0.09737536311149597, -1.3927539587020874, 0.08806148171424866, 1.1285582780838013, 0.3523649275302887, 0.3296798765659332, 0.17413166165351868, 0.44058001041412354, 0.27688077092170715, 0.47577476501464844...
api/screen_capture_api/index.md
API - Screen Capture API - Screen Capture API concepts and usage - Screen capture extensions - Controlling the captured screen area: The Captured Surface Control API allows the capturing application to provide limited control over the captured display surface, for example zooming and scrolling its contents. See Using...
[ 0.23900112509727478, -0.10123477876186371, -0.8275015354156494, -0.2819124162197113, 0.16177445650100708, -0.8592429757118225, -0.07968194782733917, 1.4574400186538696, 0.6153901219367981, 0.5616574883460999, -0.34032562375068665, 0.7881041169166565, 0.2782624065876007, 0.7358525395393372,...
api/screen_capture_api/index.md
API - Screen Capture API - Interfaces: - `BrowserCaptureMediaStreamTrack`: Represents a single video track; extends the `MediaStreamTrack` class with methods to limit the part of a self-capture stream (for example, a user's screen or window) that is captured. - `CaptureController`: Provides methods that can be used to...
[ 0.10902829468250275, -0.45288586616516113, -0.6853860020637512, 0.5155535340309143, 0.02201087772846222, -0.664264440536499, -1.0151705741882324, 0.5349132418632507, 0.7683672904968262, -0.02185642346739769, -0.08665525913238525, -0.3838579058647156, 0.27436667680740356, 0.141988143324852,...
api/screen_capture_api/index.md
API - Screen Capture API - Additions to the MediaDevices interface: - `MediaDevices.getDisplayMedia()`: The `getDisplayMedia()` method is added to the `MediaDevices` interface. Similar to `getUserMedia()`, this method creates a promise that resolves with a `MediaStream` containing the display area selected by the user...
[ -0.09290554374456406, -0.6987183094024658, -0.2463040053844452, -0.12849989533424377, -0.46558913588523865, -0.45534518361091614, -0.5410430431365967, 0.7373886108398438, 0.5414973497390747, -0.27177509665489197, -0.26235467195510864, -0.4796971380710602, -0.10245618969202042, 0.4895318150...
api/screen_capture_api/index.md
API - Screen Capture API - Additions to existing dictionaries: The Screen Capture API adds properties to the following dictionaries defined by other specifications.
[ -0.5057270526885986, -0.25667276978492737, -0.06215943768620491, 0.0211104154586792, -0.16745656728744507, -1.0959738492965698, -0.3969176113605499, 0.7069878578186035, 1.3993042707443237, -0.6894986629486084, -0.12714242935180664, -0.41042158007621765, -0.35268980264663696, 0.465519011020...
api/screen_capture_api/index.md
API - Screen Capture API - Additions to existing dictionaries - MediaTrackConstraints: - `MediaTrackConstraints.displaySurface`: A `ConstrainDOMString` indicating what type of display surface is to be captured. The value is one of `browser`, `monitor`, or `window`. - `MediaTrackConstraints.logicalSurface`: Indicates w...
[ 0.3518315255641937, -0.7034744620323181, 0.04007667303085327, 0.49478113651275635, -0.147151380777359, -0.5991037487983704, -1.0381767749786377, 0.08898121118545532, 0.8358106017112732, 0.23222149908542633, -0.7072230577468872, -0.7124162912368774, 0.0592229962348938, 0.21797806024551392, ...
api/screen_capture_api/index.md
API - Screen Capture API - Additions to existing dictionaries - MediaTrackSettings: - `MediaTrackSettings.cursor`: A string which indicates whether or not the display surface currently being captured includes the mouse cursor, and if so, whether it's only visible while the mouse is in motion or if it's always visible....
[ -0.36533141136169434, -0.8894847631454468, -0.2874179184436798, 0.0734047070145607, 0.10808797180652618, -0.5308255553245544, -0.9748314023017883, -0.09082777053117752, 1.0110288858413696, 0.008772752247750759, -0.4344472885131836, -0.4908067286014557, 0.568142831325531, 0.607258677482605,...
api/screen_capture_api/index.md
API - Screen Capture API - Additions to existing dictionaries - MediaTrackSupportedConstraints: - `MediaTrackSupportedConstraints.displaySurface`: A boolean, which is `true` if the current environment supports the `MediaTrackConstraints.displaySurface` constraint. - `MediaTrackSupportedConstraints.logicalSurface`: A b...
[ -0.08239734917879105, -0.24826811254024506, 0.3593282699584961, 0.16024558246135712, -0.7180330753326416, -0.5719565153121948, -1.2330729961395264, 0.1997470259666443, 1.0591185092926025, -0.16668421030044556, -0.9500110149383545, -0.9232184886932373, -0.0837683230638504, 0.380794733762741...
api/screen_capture_api/index.md
API - Screen Capture API - Security considerations: Websites that support Permissions Policy (either using the HTTP `Permissions-Policy` header or the `iframe` attribute `allow`) can specify a desire to use the Screen Capture API using the directive `display-capture`: Example: <iframe allow="display-capture" src="/s...
[ 0.5905323624610901, -0.32845500111579895, -0.723020076751709, -0.1981511265039444, 0.1453121155500412, -0.7395492792129517, 0.5353606939315796, 1.3083635568618774, -0.543868899345398, 0.479775607585907, -0.018854642286896706, 0.7261869311332703, 0.4161686301231384, 0.409191370010376, -1....
api/selection/setbaseandextent/index.md
API - Selection - setBaseAndExtent: The `setBaseAndExtent()` method of the `Selection` interface sets the selection to be a range including all or parts of two specified DOM nodes, and any content located between them. The anchor and focus nodes can be located in a `shadow tree`, if supported by the browser.
[ 0.5099783539772034, -0.817131519317627, -0.519394040107727, 1.246976613998413, 0.08110621571540833, -2.1585516929626465, 1.0736844539642334, 0.7848208546638489, 0.25243908166885376, 0.6035315990447998, -0.23643198609352112, 0.12298537790775299, 0.641539454460144, 0.14150969684123993, -0....
api/selection/setbaseandextent/index.md
API - Selection - setBaseAndExtent - Syntax: Example: setBaseAndExtent(anchorNode, anchorOffset, focusNode, focusOffset)
[ 0.2935727834701538, -0.2712883949279785, -0.88413006067276, 0.6065998077392578, -0.6763783693313599, -1.5003465414047241, 1.1786247491836548, 1.317138671875, 0.4952371120452881, -0.6509438753128052, 0.24303585290908813, 0.5347592234611511, -0.6620232462882996, 0.13110566139221191, 0.1991...
api/selection/setbaseandextent/index.md
API - Selection - setBaseAndExtent - Syntax - Parameters: - `anchorNode`: The node at the start of the selection. - `anchorOffset`: The number of child nodes from the start of the anchor node that should be excluded from the selection. So for example, if the value is 0 the whole node is included. If the value is 1, th...
[ 1.1446691751480103, -0.1518220603466034, -0.6550092101097107, 0.7192599177360535, 0.6221904158592224, -1.0235158205032349, 0.9995720386505127, 2.0757322311401367, -0.15649975836277008, 0.24272145330905914, -0.11704734712839127, -0.040453072637319565, -0.20177459716796875, 1.032361030578613...
api/selection/setbaseandextent/index.md
API - Selection - setBaseAndExtent - Syntax - Return value: None (`undefined`).
[ 0.1796165257692337, 0.08649075031280518, -1.001266360282898, 0.3675055503845215, -0.4185020327568054, -0.992948055267334, 1.8331094980239868, 1.2465722560882568, -0.08525215834379196, -0.0063164122402668, 0.6738373041152954, 0.3077036440372467, 0.02012622356414795, 0.13055703043937683, -...
api/selection/setbaseandextent/index.md
API - Selection - setBaseAndExtent - Syntax - Exceptions: - `IndexSizeError` `DOMException`: Thrown if `anchorOffset` is larger than the number of child nodes inside `anchorNode`, or if `focusOffset` is larger than the number of child nodes inside `focusNode`.
[ -0.12066170573234558, -0.8526102304458618, -0.563772439956665, 0.3150700032711029, -0.2791721224784851, -0.91206955909729, 0.324541836977005, 0.6608016490936279, 1.2048840522766113, -0.3947587013244629, -0.5339362621307373, 0.5642576813697815, 0.22655847668647766, -0.04189860820770264, 0...
api/selection/setbaseandextent/index.md
API - Selection - setBaseAndExtent - Examples: In this example, we have two paragraphs containing spans, each one containing a single word. The first one is set as the `anchorNode` and the second is set as the `focusNode`. We also have an additional paragraph that sits in between the two nodes. Next, we have two form...
[ 0.23006679117679596, -0.4373881220817566, -0.23160307109355927, 1.281526803970337, 0.5808049440383911, -1.011080265045166, 1.5006252527236938, 0.5613450407981873, -0.04614850878715515, 0.8875906467437744, -0.11617332696914673, 0.3178229331970215, 0.07709372043609619, 0.01810470223426819, ...
api/storage_access_api/index.md
API - Storage Access API: Secure context: This feature is available only in secure contexts (HTTPS). The Storage Access API provides a way for cross-site content loaded in a third-party context (i.e., embedded in an `iframe`) to gain access to third-party cookies and unpartitioned state that it would typically only h...
[ 0.8826215267181396, -0.2710449993610382, -0.31248876452445984, 0.10956749320030212, 0.26314133405685425, -0.899684488773346, 0.12951141595840454, 1.6798909902572632, -0.23316708207130432, -0.04810371994972229, -0.166807621717453, 0.5759931802749634, 0.0529632493853569, 0.1643143892288208, ...
api/storage_access_api/index.md
API - Storage Access API - Concepts and usage: Browsers implement several storage access features and policies restricting access to third-party cookies and unpartitioned state. These range from giving embedded resources under each top-level origin a unique cookie storage space (partitioned cookies) to outright blocki...
[ 1.0133991241455078, -0.02043314464390278, -0.15798011422157288, 0.05048186331987381, 0.580704391002655, -0.6269561648368835, 0.4858103394508362, 1.590767741203308, -0.43491965532302856, -0.3170652687549591, -0.07184553146362305, 0.9749753475189209, -0.39275234937667847, 0.4637907147407532,...
api/storage_access_api/index.md
API - Storage Access API - Concepts and usage - Unpartitioned versus partitioned cookies: The Storage Access API is only needed to provide access to unpartitioned third-party cookies! Unpartitioned cookies are those where all cookies set on the same site are stored in the same cookie jar — the traditional way since th...
[ 0.39703571796417236, -0.09149939566850662, 0.21557478606700897, -0.03955459222197533, 0.3957889974117279, -0.8913010954856873, 0.3393528163433075, 1.4255187511444092, -0.1662135124206543, -0.03631538152694702, 0.3089277446269989, 0.9242972135543823, -0.05645734444260597, 0.4962307214736938...
api/storage_access_api/index.md
API - Storage Access API - Concepts and usage - How it works: Third party content embedded in an `iframe` that needs to access cookie or other unpartitioned state can request access using the Storage Access API as follows: - `Document.hasStorageAccess()` can be called to check if the embedded content already has acce...
[ 1.2073748111724854, -0.04388222098350525, -0.22113583981990814, -0.49694573879241943, 0.6338251829147339, -0.5988839268684387, 0.4662390351295471, 1.4257071018218994, -0.5207052230834961, -0.6943017244338989, 0.01035294309258461, 0.7548964023590088, -0.39142346382141113, -0.124717526137828...
api/storage_access_api/index.md
API - Storage Access API - Concepts and usage - Storage access headers: The API requires that a resource must call `requestStorageAccess()` for each new context to opt-in to activating the storage-access permission, which must already have been granted. This in turn means that the embedded resource must first be reque...
[ 1.814141869544983, -0.8507153987884521, -0.5023088455200195, 0.9115622043609619, -0.019139863550662994, -0.8133367300033569, -0.524860680103302, 1.4077599048614502, -0.10237003117799759, -0.8134477734565735, -0.13013377785682678, 0.04429926723241806, 0.37324872612953186, 0.325417697429657,...
api/storage_access_api/index.md
API - Storage Access API - Concepts and usage - Request/response flow - JavaScript sequences: Consider the example of a library loaded in an `iframe` that needs to be shared across a number of sites and relies on credentials stored in unpartitioned cookies. First let's look at the case where permission has not been g...
[ 1.1602855920791626, -0.5210577845573425, -0.5044642686843872, 0.6026450991630554, 0.32783883810043335, -0.9318907856941223, 0.09086200594902039, 0.9717633724212646, 0.6354510188102722, -0.38651642203330994, -0.09807868301868439, -0.3871241509914398, -0.4015849530696869, 0.23831751942634583...
api/storage_access_api/index.md
API - Storage Access API - Concepts and usage - Request/response flow - Storage access header sequences: The storage access headers enable an improved workflow that allows the server to request that the browser activate a permission that has been granted and retry the request with cookies included. This avoids the req...
[ 0.9487625360488892, -0.38700807094573975, -0.4680635631084442, 0.46894001960754395, 0.41283899545669556, -1.054585337638855, -0.29837262630462646, 0.7090280055999756, 0.004527278244495392, -0.6396762728691101, -0.07220005989074707, 0.2727629840373993, -0.06503771245479584, 0.51638978719711...
api/storage_access_api/index.md
API - Storage Access API - Security considerations: Several different security measures could cause a `Document.requestStorageAccess()` call to fail. Check the below list if you are having trouble getting a request to work: - The permission request must be associated with a user gesture (`transient activation`) such ...
[ 1.5962337255477905, -0.1457139253616333, -0.4726956784725189, 0.015404105186462402, 0.34751105308532715, -0.5358233451843262, 0.11284266412258148, 1.1917377710342407, -0.5078611373901367, -0.44201982021331787, 0.24624982476234436, 0.48104846477508545, 0.35706111788749695, 0.006409399211406...
api/storage_access_api/index.md
API - Storage Access API - Browser-specific variations: Although the API surface is the same, websites using the Storage Access API should expect differences in the level and extent of third-party cookie access they receive between different browsers, due to differences in their storage access policies.
[ 0.7709892392158508, -0.18143241107463837, -0.460182785987854, 0.13801264762878418, -0.17000773549079895, -0.8988361358642578, -0.11949063837528229, 1.5648994445800781, 0.03654511272907257, 0.0449642613530159, 0.16973592340946198, 0.5558517575263977, -0.24522648751735687, 0.4447501301765442...
api/storage_access_api/index.md
API - Storage Access API - Browser-specific variations - Chrome: - Cookies must have `SameSite=None` explicitly set on them, because the default value for Chrome is `SameSite=Lax` (`SameSite=None` is the default in Firefox and Safari). - Cookies must have the `Secure` attribute set on them. - The storage access grants...
[ 0.38492441177368164, -0.31755778193473816, 0.7178375720977783, 0.4210411310195923, -0.05135730281472206, -1.54220449924469, -0.9377704858779907, 1.1318289041519165, 0.3392617702484131, 0.00917198695242405, -0.06303495913743973, 0.10088665783405304, -0.43810293078422546, -0.1330478638410568...
api/storage_access_api/index.md
API - Storage Access API - Browser-specific variations - Firefox: - If the embedded origin `tracker.example` has already obtained third-party cookie access on the top-level origin `foo.example`, and the user visits a page from `foo.example` embedding a page from `tracker.example` again in less than 30 days, the embedd...
[ 0.25591185688972473, -0.7006577849388123, 0.2388148009777069, 0.49778658151626587, 0.09935066103935242, -1.0260244607925415, -0.6152787208557129, 1.2127760648727417, 0.5264230966567993, 0.20946481823921204, -0.15986944735050201, 0.46000587940216064, -0.33159390091896057, 0.0521905273199081...
api/storage_access_api/index.md
API - Storage Access API - Browser-specific variations - Safari: - The storage access grants are phased out after 30 days of browser usage passed without user interaction. Successful use of the Storage Access API resets this counter. - After an embed has activated the storage-access permission and its content has been...
[ 0.40828728675842285, -0.43751585483551025, -0.3254585862159729, 0.24686917662620544, -0.29813480377197266, -0.8287685513496399, 0.7412950992584229, 1.9849364757537842, 0.04783155024051666, -0.03272454813122749, 0.2919897139072418, 0.8382822871208191, -0.15198209881782532, 0.323326975107193...
api/storage_access_api/index.md
API - Storage Access API - Examples: - See Using the Storage Access API for an implementation guide with code examples.
[ 0.48608314990997314, -0.2654902935028076, -0.0791369378566742, 0.04540330916643143, -0.5312896966934204, -1.6946884393692017, -0.1915098875761032, 0.6878845691680908, 0.8385822772979736, -0.955051064491272, -0.0307327788323164, -0.03281527757644653, 0.0942840427160263, 0.08643174171447754,...
api/storage_access_api/index.md
API - Storage Access API - API methods: - `Document.hasStorageAccess()`: Returns a `Promise` that resolves with a boolean value indicating whether the document has access to third-party cookies. - `Document.hasUnpartitionedCookieAccess()`: New name for `Document.hasStorageAccess()`. - `Document.requestStorageAccess()`...
[ 1.0547771453857422, -0.5792293548583984, 0.005147416144609451, 0.2399297058582306, -0.15664342045783997, -0.7266187071800232, 0.010907545685768127, 1.3549067974090576, -0.08873725682497025, -0.08290252089500427, -0.10661496222019196, 0.26899227499961853, 0.36610814929008484, 0.371390610933...
api/storage_access_api/index.md
API - Storage Access API - API methods - Additions to other APIs: - `Permissions.query()`, the `"storage-access"` feature name: In supporting browsers, this can query whether third-party cookie access has been granted in general, that is, to another same-site embed. If so, you can call `requestStorageAccess()` without...
[ 0.6890861392021179, -0.2897755205631256, -0.004335647448897362, 0.11914020776748657, -0.08831579238176346, -0.865794837474823, -0.5186729431152344, 1.1170860528945923, 0.35791072249412537, -0.07081823796033859, 0.03691558539867401, -0.09584906697273254, 0.012119919061660767, 0.437468260526...
api/storage_access_api/index.md
API - Storage Access API - API methods - Additions to HTTP - Permissions-Policy: - `Permissions-Policy: storage-access`: The `storage-access` `Permissions-Policy` directive controls whether a document loaded in a third-party context (i.e., embedded in an `iframe`) is allowed to use the storage access API to request ac...
[ 0.7809544205665588, -1.2159970998764038, -0.08080461621284485, -0.05005364865064621, -0.5033979415893555, -1.1873852014541626, 0.1810876876115799, 1.0911270380020142, -0.3195009231567383, 0.18384991586208344, -0.6374099254608154, -0.03182968124747276, 0.4526720345020294, 0.2760984599590301...
api/storage_access_api/index.md
API - Storage Access API - API methods - Additions to HTTP - Storage access headers: - `Sec-Fetch-Storage-Access`: Indicates the "storage access status" for the current request context, which will be one of `none`, `inactive`, or `active`. - `Activate-Storage-Access`: Used in response to `Sec-Fetch-Storage-Access` to ...
[ 0.6233251690864563, -0.7681521773338318, 0.014348022639751434, 0.5737287998199463, -0.3174571990966797, -1.282790184020996, -0.615050733089447, 1.0811400413513184, 0.9793404340744019, -0.31534358859062195, -0.6749269366264343, -0.16895046830177307, -0.5270299911499023, 0.21173083782196045,...
api/storage_access_api/using/index.md
API - Storage Access API - Using: The Storage Access API can be used by embedded cross-site documents to verify whether they have access to third-party cookies and unpartitioned state and, if not, to request access. We'll briefly look at a common storage access scenario. Note: When we talk about third-party cookies i...
[ 0.9310153722763062, -0.40691885352134705, -0.33218491077423096, 0.21422162652015686, 0.09620574116706848, -0.7430517673492432, -0.2741832137107849, 1.3464524745941162, -0.31732311844825745, -0.1531943529844284, 0.1370498090982437, 0.2870453894138336, 0.3415137827396393, 0.6239351630210876,...
api/storage_access_api/using/index.md
API - Storage Access API - Using - Usage notes: The Storage Access API is designed to allow embedded content to request access to third-party cookies and unpartitioned state — most modern browsers block such access by default to protect user privacy. Since embedded content won't know what a browser's behavior is going...
[ 0.9101009964942932, -0.32185888290405273, -0.09681834280490875, -0.15438365936279297, 0.1254962533712387, -0.5178196430206299, 0.017778433859348297, 1.3187743425369263, -0.4145301580429077, -0.31087225675582886, -0.04888051748275757, 0.1586301624774933, -0.0671614408493042, 0.2076199054718...
api/storage_access_api/using/index.md
API - Storage Access API - Using - Allowing a sandboxed iframe> to use the API: First of all, if the `<iframe>` is sandboxed, the embedding website needs to add the `allow-storage-access-by-user-activation` sandbox token to allow Storage Access API requests to be successful, along with `allow-scripts` and `allow-same-...
[ 1.3149961233139038, -0.2078479677438736, -0.39093852043151855, -0.20597702264785767, -0.060539357364177704, -1.0307575464248657, 0.04262185096740723, 1.568338394165039, -0.2369832694530487, -0.2595594525337219, -0.041402172297239304, -0.19229747354984283, -0.44807109236717224, 0.1985929012...
api/storage_access_api/using/index.md
API - Storage Access API - Using - Checking and requesting storage access: Now on to the code executed inside the embedded document. In this code: - We first use feature detection (`if (document.hasStorageAccess) {}`) to check whether the API is supported. If not, we run our code that accesses cookies anyway, and hop...
[ 1.0035086870193481, 0.43485888838768005, -0.23955345153808594, -0.2528378367424011, 0.6470829844474792, -0.2604895532131195, 0.33246493339538574, 1.3829755783081055, -0.5967695116996765, -0.356193870306015, -0.36178019642829895, 0.6337974071502686, -0.10812081396579742, 0.39250221848487854...
api/storage_access_api/using/index.md
API - Storage Access API - Using - Checking and requesting storage access - Related website sets: The Chrome-only related website sets feature can be considered a progressive enhancement mechanism that works alongside the Storage Access API — supporting browsers grant default third-party cookie and unpartitioned state...
[ 0.44091013073921204, -0.8667436838150024, -0.6937832236289978, 0.7211059331893921, -0.2755720317363739, -1.221562147140503, -0.5606920719146729, 1.1602250337600708, -0.20836390554904938, 0.4186919927597046, 0.1106804758310318, 0.43522632122039795, -0.028252556920051575, -0.1009854525327682...
api/storage_access_api/using/index.md
API - Storage Access API - Using - Requesting storage access from the top-level site on behalf of embedded resources: The Storage Access API features above allow an embedded document to request its own third-party cookie access. There is an additional experimental method available, `Document.requestStorageAccessFor()`...
[ 1.006857991218567, 0.07727374881505966, -0.529442310333252, 0.03370901197195053, 0.5793466567993164, -0.7366460561752319, 0.6445090770721436, 1.4632917642593384, -0.39205875992774963, -0.21568666398525238, 0.013092871755361557, 0.880186915397644, -0.7229071259498596, 0.25968480110168457, ...
api/url/index.md
API - URL: Note: This feature is available in Web Workers. The `URL` interface is used to parse, construct, normalize, and encode `URLs`. It works by providing properties which allow you to easily read and modify the components of a URL. You normally create a new `URL` object by specifying the URL as a string when c...
[ -0.26167601346969604, 0.3483312427997589, 0.050248220562934875, 0.5914431810379028, 0.051711007952690125, -1.4946527481079102, 0.34428027272224426, -0.7924006581306458, 0.6325377225875854, 0.13341550529003143, -0.8582260608673096, 0.4059761166572571, 0.7425766587257385, 0.21584594249725342...
api/url/index.md
API - URL - Constructor: - `URL()`: Creates and returns a `URL` object from a URL string and optional base URL string. Throws if the passed arguments don't define a valid URL.
[ -0.9722286462783813, -0.20724937319755554, -0.0902591273188591, 0.8804545402526855, -0.09748268872499466, -1.639100193977356, 0.19973444938659668, 0.026773452758789062, -0.26962170004844666, 0.25890326499938965, -0.5979809165000916, 1.0187664031982422, 0.05624372512102127, 0.00632548332214...
api/url/index.md
API - URL - Instance properties: - `hash`: A string containing a `'#'` followed by the fragment identifier of the URL. - `host`: A string containing the domain (that is the hostname) followed by (if a port was specified) a `':'` and the port of the URL. - `hostname`: A string containing the domain of the URL. - `href`...
[ -0.40993502736091614, -0.36341220140457153, -0.04172400385141373, 0.2268623411655426, -0.03445415943861008, -0.8375754952430725, 0.7879138588905334, -0.47234293818473816, 0.3969328999519348, -0.21409249305725098, -0.7572734355926514, 0.27967825531959534, -0.38948777318000793, -0.1662245392...
api/url/index.md
API - URL - Static methods: - `canParse()`: Returns a boolean indicating whether or not a URL defined from a URL string and optional base URL string is parsable and valid. - `createObjectURL()`: Returns a string containing a unique blob URL, that is a URL with `blob:` as its scheme, followed by an opaque string unique...
[ -0.7542383670806885, -0.07461533695459366, 0.05455440282821655, 0.9945098161697388, 0.15697157382965088, -0.7599117755889893, 0.31081146001815796, -0.07435363531112671, 0.5419809818267822, 0.03344714641571045, -0.8861373066902161, 0.4858468770980835, 0.03726973384618759, -0.113597609102725...
api/url/index.md
API - URL - Instance methods: - `toString()`: Returns a string containing the whole URL. It is a synonym for `URL.href`, though it can't be used to modify the value. - `toJSON()`: Returns a string containing the whole URL. It returns the same string as the `href` property.
[ -1.1666845083236694, 0.06095649302005768, 0.28835710883140564, 0.5851612091064453, -0.0010428503155708313, -0.9973552227020264, 0.7184152007102966, -0.04863300919532776, 0.2841396629810333, -0.3236863613128662, -0.7918986082077026, 0.7191859483718872, 0.5045458078384399, 0.1101371943950653...
api/url/index.md
API - URL - Usage notes: The constructor takes a `url` parameter, and an optional `base` parameter to use as a base if the `url` parameter is a relative URL. Note that in the case below "dogs" is the filename segment (because it has no trailing slash), and the relative URL "cats" is interpreted relative to the direct...
[ -0.23504915833473206, -0.428988516330719, -0.543405294418335, 1.187110185623169, 0.02525635063648224, -0.8181151151657104, -0.7391436100006104, -0.3271559476852417, 0.0034532323479652405, -0.27976518869400024, -0.6957498788833618, 1.193699598312378, 0.23357975482940674, 0.46138715744018555...
api/url/pathname/index.md
API - URL - pathname: Note: This feature is available in Web Workers. The `pathname` property of the `URL` interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a `/` character. HTTPS, HTTP, or other URLs with hierarchical s...
[ -0.48334118723869324, -0.5058706998825073, -0.19625774025917053, 0.17629915475845337, 0.5475812554359436, -0.5859532356262207, 0.8196212649345398, 0.5233395099639893, 0.18479755520820618, 0.5938361287117004, -0.5534946918487549, 0.8382836580276489, 0.4313044250011444, -0.024753522127866745...
api/url/pathname/index.md
API - URL - pathname - Value: A string.
[ -1.0918872356414795, -0.15273191034793854, -0.9097545146942139, -0.36330747604370117, -0.614210307598114, 0.4482278525829315, 1.770048975944519, 0.6905732154846191, -0.27733922004699707, -0.6332526803016663, 0.19077953696250916, -0.15135297179222107, -0.4190441370010376, -0.218967124819755...
api/url/pathname/index.md
API - URL - pathname - Examples - Pathname with invisible segment: The URL below has just one path segment, the empty string. The `pathname` value is constructed by prefixing a `/` character to the empty string. Example: const url = new URL("https://developer.mozilla.org"); console.log(url.pathname); // Logs "/"
[ -0.8169304132461548, -0.07718832790851593, 0.35878854990005493, 0.31061992049217224, 0.16072523593902588, -0.2732493579387665, 0.47377461194992065, 0.27208971977233887, -0.10503008961677551, -0.10553351044654846, -0.22244015336036682, 0.43020540475845337, 0.4577462077140808, -0.31575047969...
api/url/pathname/index.md
API - URL - pathname - Examples - Pathname with query parameters: The example below shows the pathname for an HTTPS URL with query parameters. Example: const url = new URL( "https://developer.mozilla.org/en-US/docs/Web/API/URL/pathname?q=value", ); console.log(url.pathname); // Logs "/en-US/docs/Web/API/URL/pathna...
[ 0.12009093165397644, -0.3376346230506897, -0.809510350227356, 0.7329254746437073, -0.468822717666626, -0.7951271533966064, -0.005146434530615807, -0.03446456417441368, -0.11850513517856598, -0.11716549098491669, -0.7102134227752686, 0.6866503953933716, 0.4173027276992798, -0.56138968467712...
api/url/pathname/index.md
API - URL - pathname - Examples - Pathname with a slug: Some systems define the term slug to mean the final segment of a non-empty path if it identifies a page in human-readable keywords. For example, the URL below has the slug `this-that-other-outre-collection`. Example: const url = new URL( "https://example.org/...
[ -0.5144504308700562, -0.6691681146621704, -0.6219163537025452, 0.7009627819061279, -0.06060093641281128, -1.3166441917419434, -0.19969797134399414, 0.13654200732707977, -0.2577683925628662, 0.31618592143058777, -0.026061013340950012, 0.3284202218055725, 0.12578940391540527, -0.076993532478...
api/url/pathname/index.md
API - URL - pathname - Examples - Pathname with opaque path: When the URL uses a non-hierarchical scheme, the `pathname` property behaves slightly differently. The following example shows a `data:` URL with no path at all, in which case the `pathname` is the empty string. Example: const url = new URL("data:"); conso...
[ -0.8260565996170044, -0.946354866027832, -0.0647875964641571, 0.36154234409332275, -0.01912955939769745, -0.5610049366950989, 0.22281423211097717, 0.195266991853714, 0.5715866684913635, 0.3700563907623291, -0.7849690914154053, 0.2269921898841858, -0.10139738768339157, -0.39982590079307556,...
api/url/hostname/index.md
API - URL - hostname: Note: This feature is available in Web Workers. The `hostname` property of the `URL` interface is a string containing either the `domain name` or `IP address` of the URL. If the URL does not have a hostname, this property contains an empty string, `""`. IPv4 and IPv6 addresses are normalized, su...
[ -0.39272525906562805, -0.13098132610321045, -0.051599614322185516, 0.010987073183059692, 0.24596479535102844, -1.3130148649215698, 1.281825304031372, -0.025127330794930458, 0.29069629311561584, -0.4086129367351532, -0.8913224339485168, 1.2661795616149902, -0.1685074269771576, -0.7245113849...
api/url/hostname/index.md
API - URL - hostname - Value: A string.
[ -1.0436898469924927, -0.17748086154460907, -0.7498304843902588, -0.5692685842514038, -0.2850770056247711, -0.24117125570774078, 1.7338913679122925, 0.5358287692070007, -0.30790194869041443, -0.9692324995994568, 0.26842162013053894, 0.19426968693733215, -0.7339199185371399, -0.5683484077453...
api/url/hostname/index.md
API - URL - hostname - Examples: Example: const url = new URL( "https://developer.mozilla.org/en-US/docs/Web/API/URL/hostname", ); console.log(url.hostname); // Logs: 'developer.mozilla.org' url.hostname = "你好.com"; console.log(url.hostname); // Logs: 'xn--6qq79v.com'
[ -0.021464381366968155, -0.4261399209499359, -0.7993931770324707, 0.30765289068222046, -0.3394157886505127, -0.8823642134666443, -0.01704760268330574, -0.08837203681468964, 0.26960158348083496, -0.5954748392105103, -0.18310733139514923, 0.984748125076294, -0.39689549803733826, -0.6285048127...
api/url/href/index.md
API - URL - href: Note: This feature is available in Web Workers. The `href` property of the `URL` interface is a string containing the whole URL.
[ -0.8002137541770935, 0.08445880562067032, -0.23286305367946625, -0.09476727247238159, -0.2058822363615036, -1.252256155014038, 0.7025100588798523, 0.021540634334087372, 0.14227205514907837, -0.20424464344978333, -0.7148029208183289, 0.9821717739105225, 0.4743082523345947, 0.340019136667251...
api/url/href/index.md
API - URL - href - Value: A string.
[ -0.9793834090232849, -0.4884894788265228, -0.004083169624209404, -0.2567669749259949, 0.18227776885032654, -1.0378742218017578, 1.168742299079895, -0.1318180412054062, -0.7348131537437439, -0.10314531624317169, -0.8006482124328613, 0.5526012182235718, -0.5444338321685791, 0.028737843036651...
api/url/href/index.md
API - URL - href - Examples - Full URL with path: Example: const url = new URL( "https://developer.mozilla.org/en-US/docs/Web/API/URL/href", ); console.log(url.href); // https://developer.mozilla.org/en-US/docs/Web/API/URL/href
[ -0.7161125540733337, -0.43309804797172546, -0.28448110818862915, 0.623631477355957, -0.32121217250823975, -0.8304114937782288, -0.33186236023902893, 0.013623610138893127, 0.3746049106121063, -0.44612938165664673, -0.4654576778411865, 0.5958092212677002, 0.11181999742984772, -0.072085089981...
api/url/href/index.md
API - URL - href - Examples - Origin-only URL: For hierarchical schemes such as `https:`, the pathname must always be non-empty. When the URL has no path (for example, only an origin), the URL parser sets the pathname to `"/"`, so `href` includes a trailing slash. See the `pathname` property for more details. Example...
[ -0.29376575350761414, -0.49526670575141907, -0.1349049210548401, 0.6085928678512573, -0.2356569766998291, -1.2482600212097168, 0.34240642189979553, 0.32599425315856934, 0.17555683851242065, -0.15681560337543488, -0.7769519686698914, 0.3827536404132843, 0.14538061618804932, -0.1463146209716...