Skip to content

Commit

Permalink
List unmatched third party domains. (#2404)
Browse files Browse the repository at this point in the history
This makes it easier to contribute to third party web +
makes it possible for us to track unmatched domains (even though
we don't do that at the moment).
  • Loading branch information
soulgalore committed Apr 1, 2019
1 parent 13488aa commit de86528
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
10 changes: 10 additions & 0 deletions lib/plugins/html/templates/url/thirdparty/index.pug
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ if thirdparty.assets && Object.keys(thirdparty.assets).length > 0
li #{asset.url}
b (#{asset.entity.name})

if thirdparty.possibileMissedThirdPartyDomains
h3 Unmatched third party domains
p Here's a list of domains that didn't match any tool in
a(href='https://github.com/patrickhulce/third-party-web') Third party web
| . If you are sure they are third party domains, please do a PR to that project.
table
each domain in thirdparty.possibileMissedThirdPartyDomains
tr
td #{domain}

- const pagexray = pageInfo.data.pagexray.run || pageInfo.data.pagexray.pageSummary;
if pagexray.firstParty.requests
include ./firstParty.pug
15 changes: 14 additions & 1 deletion lib/plugins/thirdparty/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,19 @@ module.exports = {
const make = this.make;
const thirdPartyAssetsByCategory = {};
const toolsByCategory = {};
const possibileMissedThirdPartyDomains = [];
if (message.type === 'pagexray.run') {
const firstPartyRegEx = message.data.firstPartyRegEx;
for (let d of Object.keys(message.data.domains)) {
const entity = getEntity(d);
if (entity !== undefined) {
// Here is a match
} else {
if (!d.match(firstPartyRegEx)) {
possibileMissedThirdPartyDomains.push(d);
}
}
}
const byCategory = {};
this.groups[message.url] = message.group;
for (let asset of message.data.assets) {
Expand Down Expand Up @@ -70,7 +82,8 @@ module.exports = {
{
category: byCategory,
assets: thirdPartyAssetsByCategory,
toolsByCategory
toolsByCategory,
possibileMissedThirdPartyDomains: possibileMissedThirdPartyDomains
},
{
url: message.url,
Expand Down

0 comments on commit de86528

Please sign in to comment.