mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-10 02:08:38 +09:00
Improve origin-clean algorithm
This commit is contained in:
parent
21eef2bff9
commit
85e68b684f
5 changed files with 41 additions and 39 deletions
|
|
@ -126,5 +126,25 @@ CoerceDouble(const JS::Value& v, double* d)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool CheckWriteOnlySecurity(bool aCORSUsed, nsIPrincipal* aPrincipal) {
|
||||
if (!aPrincipal) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!aCORSUsed) {
|
||||
nsIGlobalObject* incumbentSettingsObject = dom::GetIncumbentGlobal();
|
||||
if (NS_WARN_IF(!incumbentSettingsObject)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
nsIPrincipal* principal = incumbentSettingsObject->PrincipalOrNull();
|
||||
if (NS_WARN_IF(!principal) || !(principal->Subsumes(aPrincipal))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace CanvasUtils
|
||||
} // namespace mozilla
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue