mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-03 14:28:39 +09:00
Implement "cookie-averse document objects".
See: https://html.spec.whatwg.org/multipage/dom.html#cookie-averse-document-object This resolves #196.
This commit is contained in:
parent
4923ad3b10
commit
3df0152d88
3 changed files with 43 additions and 0 deletions
|
|
@ -1255,6 +1255,11 @@ nsHTMLDocument::GetCookie(nsAString& aCookie, ErrorResult& rv)
|
|||
rv.Throw(NS_ERROR_DOM_SECURITY_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// If the document is a cookie-averse document, return an empty string.
|
||||
if (IsCookieAverse()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// not having a cookie service isn't an error
|
||||
nsCOMPtr<nsICookieService> service = do_GetService(NS_COOKIESERVICE_CONTRACTID);
|
||||
|
|
@ -1310,6 +1315,11 @@ nsHTMLDocument::SetCookie(const nsAString& aCookie, ErrorResult& rv)
|
|||
return;
|
||||
}
|
||||
|
||||
// If the document is a cookie-averse document, do nothing.
|
||||
if (IsCookieAverse()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// not having a cookie service isn't an error
|
||||
nsCOMPtr<nsICookieService> service = do_GetService(NS_COOKIESERVICE_CONTRACTID);
|
||||
if (service && mDocumentURI) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue