Skip to content

Commit 8b6a228

Browse files
authored
Fix GitLab Privacy Policy (#3970)
* Fix GitLab Privacy Policy * Fix GitLab email protection * Lint filters file * Fix email protection also for security email * Fix linting * Update to new engine * lint * Update gitlab filters
1 parent 91b9e84 commit 8b6a228

2 files changed

Lines changed: 30 additions & 3 deletions

File tree

declarations/GitLab.filters.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
export function removeCloudflareEmailProtection(document, possibleEmail) {
2+
const placeholder = 'EMAIL_PLACEHOLDER';
3+
const replaceWith = `(email protected, possibly ${placeholder})`;
4+
5+
const emails = document.querySelectorAll('.__cf_email__');
6+
7+
emails.forEach(email => {
8+
email.outerHTML = replaceWith;
9+
});
10+
11+
// These make the fetching stable, sometimes it displays the email and sometimes
12+
// it doesn't. In both cases we want to show the "email protected" text.
13+
document.body.innerHTML = document.body.innerHTML.replaceAll('[\\[email protected\\]](https://about.gitlab.com/cdn-cgi/l/email-protection)', replaceWith);
14+
document.body.innerHTML = document.body.innerHTML.replaceAll(possibleEmail, replaceWith);
15+
document.body.innerHTML = document.body.innerHTML.replaceAll(placeholder, possibleEmail.toLowerCase());
16+
}

declarations/GitLab.json

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@
44
"terms": {
55
"Privacy Policy": {
66
"fetch": "https://about.gitlab.com/privacy/",
7-
"select": [
8-
".privacy"
9-
],
7+
"select": "main .content",
108
"remove": [
119
"#collapsible-sidebar",
1210
".header-anchor"
11+
],
12+
"filter": [
13+
{
14+
"removeCloudflareEmailProtection": "DPO@gitlab.com"
15+
}
1316
]
1417
},
1518
"Vulnerability Disclosure Policy": {
@@ -19,6 +22,14 @@
1922
],
2023
"remove": [
2124
".breadcrumb"
25+
],
26+
"filter": [
27+
{
28+
"removeCloudflareEmailProtection": "security@gitlab.com"
29+
},
30+
{
31+
"removeCloudflareEmailProtection": "Security@gitlab.com"
32+
}
2233
]
2334
},
2435
"Terms of Service": {

0 commit comments

Comments
 (0)