Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track Deep Linking vs. Credential Sharing in assetlinks.json #152

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
18 changes: 17 additions & 1 deletion dist/well-known.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,23 @@ function parseResponseWithRedirects(url, parser) {

return Promise.all([
// ecommerce
parseResponse('/.well-known/assetlinks.json'),
parseResponse('/.well-known/assetlinks.json', r => {
return r.json().then(data => {
let hasDeepLinking = false;
let hasCredentialSharing = false;
data.forEach(statement => {
if (statement.relation === 'delegate_permission/common.handle_all_urls') {
hasDeepLinking = true;
} else if (statement.relation === 'delegate_permission/common.get_login_creds') {
hasCredentialSharing = true;
}
});
return {
deep_linking: hasDeepLinking,
credential_sharing: hasCredentialSharing
};
});
}),
parseResponse('/.well-known/apple-app-site-association'),
// privacy sandbox
parseResponse('/.well-known/related-website-set.json'), //Related Website Set
Expand Down
Loading