Skip to content

Commit fa75f28

Browse files
tsunoyutunetheweb
andauthored
Track Deep Linking vs. Credential Sharing in assetlinks.json (#152)
* updated /.well-known/assetlinks.json parsing * updated /.well-known/assetlinks.json parsing and test URLs * Update .markdown-lint.yml * Update pull_request_template.md * Update pull_request_template.md * Update wpt-test.yml --------- Co-authored-by: Barry Pollard <[email protected]> Co-authored-by: Barry Pollard <[email protected]>
1 parent e080feb commit fa75f28

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

dist/well-known.js

+17-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,23 @@ function parseResponseWithRedirects(url, parser) {
8181

8282
return Promise.all([
8383
// ecommerce
84-
parseResponse('/.well-known/assetlinks.json'),
84+
parseResponse('/.well-known/assetlinks.json', r => {
85+
return r.json().then(data => {
86+
let hasDeepLinking = false;
87+
let hasCredentialSharing = false;
88+
data.forEach(statement => {
89+
if (statement.relation === 'delegate_permission/common.handle_all_urls') {
90+
hasDeepLinking = true;
91+
} else if (statement.relation === 'delegate_permission/common.get_login_creds') {
92+
hasCredentialSharing = true;
93+
}
94+
});
95+
return {
96+
deep_linking: hasDeepLinking,
97+
credential_sharing: hasCredentialSharing
98+
};
99+
});
100+
}),
85101
parseResponse('/.well-known/apple-app-site-association'),
86102
// privacy sandbox
87103
parseResponse('/.well-known/related-website-set.json'), //Related Website Set

0 commit comments

Comments
 (0)