blob: eff4726ea44fa7a1076009ce0ed42fbca5ad512a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
---
title: Navigator.cookieEnabled
slug: Web/API/Navigator/cookieEnabled
translation_of: Web/API/Navigator/cookieEnabled
---
<p>{{ ApiRef("HTML DOM") }}</p>
<p><span class="seoSummary"><code>navigator.cookieEnabled</code></span> retourne une valeur booléenne qui indique si les cookies sont activés. Cette propriété est en lecture seule.</p>
<h2 id="Syntax">Syntax</h2>
<pre class="brush: js">var cookieEnabled = navigator.cookieEnabled;
</pre>
<ul>
<li><code>cookieEnabled</code> est un <a href="/en-US/docs/Glossary/Boolean">Boolean</a>: <code>true</code> ou <code>false</code>.</li>
</ul>
<h2 id="Example">Example</h2>
<pre class="brush: js">if (!navigator.cookieEnabled) {
// Ce navigateur ne supporte pas ou bloque les cookies.
}
</pre>
<h2 id="Spécifications">Spécifications</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{SpecName("HTML WHATWG", "webappapis.html#dom-navigator-cookieenabled", "Navigator.cookieEnabled")}}</td>
<td>{{Spec2("HTML WHATWG")}}</td>
<td>Définition initiale</td>
</tr>
</tbody>
</table>
<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2>
<p>{{Compat("api.Navigator.cookieEnabled")}}</p>
|