Skip to content

Commit

Permalink
Privacy 2024 - Implement CCPA link metric (#119)
Browse files Browse the repository at this point in the history
* implement CCPA link metric

* formatting

* move ccpa_link to privacy.js

* Update dist/privacy.js

---------

Co-authored-by: Barry Pollard <barry_pollard@hotmail.com>
Co-authored-by: Max Ostapenko <1611259+max-ostapenko@users.noreply.github.com>
  • Loading branch information
3 people committed Jun 10, 2024
1 parent ff5902c commit 1645f94
Showing 1 changed file with 67 additions and 1 deletion.
68 changes: 67 additions & 1 deletion dist/privacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ return JSON.stringify({
'geolocation.+watchPosition'
),
},

/**
* List of hostnames with CNAME record
*/
Expand All @@ -341,5 +340,72 @@ return JSON.stringify({
}

return results;
})(),

ccpa_link: (() => {
const allowedCCPALinkPhrases = [
//https://petsymposium.org/popets/2022/popets-2022-0030.pdf page 612
'do not sell my personal information',
'do not sell my information',
'do not sell my info',
'do not sell my personal info',
'do not sell or share my personal information',
'do not sell or share my information',
'do not sell or share my info',
'do not sell or share my personal info',
//https://cppa.ca.gov/faq.html
'your privacy choices',
'your california privacy choices'
]

// https://petsymposium.org/popets/2022/popets-2022-0030.pdf page 627
const CCPAExclusionPhrases = [
'terms',
'user agreement',
'service agreement',
'conditions of use',
'terms of usage',
'privacy notice',
'privacy policy',
'privacy & cookies',
'preferences',
'terms of sale',
'login',
'terms and conditions apply',
'accessibility',
'your data in search',
'shield',
'promo',
'campaign',
'deal',
'ad choice',
'january',
'february',
'march',
'april',
'may',
'june',
'july',
'august',
'september',
'october',
'november',
'december',
'archive',
'previous',
'versions',
'settings'
]

const CCPALinks = Array.from(document.querySelectorAll('a')).filter(link => {
const text = link.textContent.toLowerCase()
return allowedCCPALinkPhrases.some(phrase => text.includes(phrase)) && !CCPAExclusionPhrases.some(phrase => text.includes(phrase))
})

return {
hasCCPALink: CCPALinks.length > 0,
CCPALinkPhrases: CCPALinks.map(link => link.textContent.trim().toLowerCase())
}
})()

});

0 comments on commit 1645f94

Please sign in to comment.