aboutsummaryrefslogtreecommitdiff
path: root/files/fr/web/api/navigator/cookieenabled/index.html
blob: 91d3ae78e010d1c1138a479b60e4d4d14df5fa3b (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><code>navigator.cookieEnabled</code> 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>