mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Add debug logs to isAllowedByPolicy()
This commit is contained in:
parent
4c5d82c94c
commit
aea8ac548c
1 changed files with 4 additions and 1 deletions
|
|
@ -7,7 +7,8 @@ const PASSKEYS_WAIT_FOR_LIFETIMER = 30;
|
|||
// Apply a script to the page for intercepting Passkeys (WebAuthn) requests
|
||||
const enablePasskeys = async function() {
|
||||
const passkeysLogDebug = function(message, extra) {
|
||||
if (kpxcPasskeysUtils.debugLogging) {
|
||||
// `global.js` runs at `document_idle`
|
||||
if (kpxcPasskeysUtils.debugLogging && typeof debugLogMessage === 'function') {
|
||||
debugLogMessage(message, extra);
|
||||
}
|
||||
};
|
||||
|
|
@ -71,11 +72,13 @@ const enablePasskeys = async function() {
|
|||
// https://www.w3.org/TR/webauthn-2/#sctn-permissions-policy
|
||||
const policy = document.featurePolicy || document.permissionsPolicy;
|
||||
if (policy) {
|
||||
passkeysLogDebug('Checking Permissions Policy');
|
||||
return policy.allowsFeature(`publickey-credentials-${action}`);
|
||||
}
|
||||
|
||||
// fallback to sameOriginWithAncestors
|
||||
try {
|
||||
passkeysLogDebug('Checking sameOriginWithAncestors');
|
||||
return window.origin === window.top.origin;
|
||||
} catch (_err) {
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue