Window navigator.cookieEnabled
Příklad
Povoleny cookies ve vašem prohlížeči?
let cookies = navigator.cookieEnabled;
Další příklady „Vyzkoušejte si to sami“ níže.
Definice a použití
Vlastnost cookieEnabled
se vrátí true
, pokud jsou v prohlížeči povoleny soubory cookie.
Viz také:
Syntax
navigator.cookieEnabled
Návratová hodnota
Typ | Popis |
Booleovský | true pokud jsou v prohlížeči povoleny soubory cookie, jinak false . |
Další příklady
Zobrazit všechny vlastnosti navigátoru:
let text = "<p>Browser CodeName: " + navigator.appCodeName + "</p>" +
"<p>Browser Name: " + navigator.appName + "</p>" +
"<p>Browser Version: " + navigator.appVersion + "</p>" +
"<p>Cookies Enabled: " + navigator.cookieEnabled + "</p>" +
"<p>Browser Language: " + navigator.language + "</p>" +
"<p>Browser Online: " + navigator.onLine + "</p>" +
"<p>Platform: " + navigator.platform + "</p>" +
"<p>User-agent header: " + navigator.userAgent + "</p>";
Podpora prohlížeče
navigator.cookieEnabled
je podporován ve všech prohlížečích:
Chrome | IE | Edge | Firefox | Safari | Opera |
Yes | Yes | Yes | Yes | Yes | Yes |