mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 17:31:47 +09:00
Merge remote-tracking branch 'origin/tracking' into custom
This commit is contained in:
commit
0d1cf674f0
39 changed files with 18940 additions and 10805 deletions
|
|
@ -560,6 +560,23 @@ BasePrincipal::GetCspJSON(nsAString& outCSPinJSON)
|
|||
return mCSP->ToJSON(outCSPinJSON);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
BasePrincipal::IsSameOrigin(nsIURI* aURI, bool aIsPrivateWin, bool* aRes) {
|
||||
*aRes = false;
|
||||
nsCOMPtr<nsIURI> prinURI;
|
||||
nsresult rv = GetURI(getter_AddRefs(prinURI));
|
||||
if (NS_FAILED(rv) || !prinURI) {
|
||||
return NS_OK;
|
||||
}
|
||||
nsIScriptSecurityManager* ssm = nsContentUtils::GetSecurityManager();
|
||||
if (!ssm) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
;
|
||||
}
|
||||
*aRes = NS_SUCCEEDED(ssm->CheckSameOriginURI(prinURI, aURI, aIsPrivateWin));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
BasePrincipal::GetIsNullPrincipal(bool* aResult)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -282,6 +282,7 @@ public:
|
|||
NS_IMETHOD GetUnknownAppId(bool* aUnknownAppId) final;
|
||||
NS_IMETHOD GetUserContextId(uint32_t* aUserContextId) final;
|
||||
NS_IMETHOD GetPrivateBrowsingId(uint32_t* aPrivateBrowsingId) final;
|
||||
NS_IMETHOD IsSameOrigin(nsIURI* aURI, bool aIsPrivateWin, bool* aRes) override;
|
||||
|
||||
bool EqualsIgnoringAddonId(nsIPrincipal *aOther);
|
||||
|
||||
|
|
|
|||
|
|
@ -223,6 +223,12 @@ interface nsIPrincipal : nsISerializable
|
|||
*/
|
||||
readonly attribute AUTF8String originSuffix;
|
||||
|
||||
/**
|
||||
* Uses NS_Security Compare to determine if the
|
||||
* other URI is same-origin as the uri of the Principal
|
||||
*/
|
||||
bool IsSameOrigin(in nsIURI otherURI, in bool aIsPrivateWin);
|
||||
|
||||
/**
|
||||
* The base domain of the codebase URI to which this principal pertains
|
||||
* (generally the document URI), handling null principals and
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue