Skip to content

Commit a4ea4c7

Browse files
authored
Migrate app off glitch.me onto own hosted infra (#165)
* Migrate app off glitch.me onto own hosted infra * Update for review * Remove unnecessary https workaround * Fix for ESlint
1 parent 65341bf commit a4ea4c7

File tree

7 files changed

+16
-23
lines changed

7 files changed

+16
-23
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
🛡 Collection of pages for testing various privacy and security features of browsers and browser extensions.
33

44
## How to use it?
5-
The site with all tests is live [here](https://privacy-test-pages.glitch.me/). All tests run either on page load or provide instructions on how to run them.
5+
The site with all tests is live [here](https://privacy-test-pages.site/). All tests run either on page load or provide instructions on how to run them.
66

77
### Privacy Protections Tests
88

@@ -21,14 +21,14 @@ Please note that we are not taking external contributions for new test pages, bu
2121

2222
### Test domains
2323

24-
We have couple of test domains, that all resolve to `privacy-test-pages.glitch.me`, which help us simulate various scenarios:
24+
We have couple of test domains, that all resolve to `privacy-test-pages.site`, which help us simulate various scenarios:
2525

2626
- `www.first-party.site` - an alternative first-party domain used for tests that require first-party resources on other subdomains (e.g., `hsts.first-party.site`)
2727
- `good.third-party.site` - non-tracking third party, it's not on our blocklist and will not be blocked by our clients
2828
- `broken.third-party.site` - tracking third party that we can't block (e.g. due to brekage), it's on our blocklist, but it will not be blocked by our clients
2929
- `bad.third-party.site` - tracking third party that's on our blocklist and our clients will block
3030

31-
We also have additional test domains that resolve to `ad-attribution-test-pages.glitch.me`, specifically for the Ad Attribution tests hosted [here](https://www.search-company.site):
31+
We also have additional test domains specifically for the Ad Attribution tests hosted [here](https://www.search-company.site):
3232

3333
- `www.search-company.site` - Simulated search provider
3434
- `convert.ad-company.site` - Simulated ad provider conversion ping

helpers/runMenu.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function initMenu () {
4242
'bad.third-party.site',
4343
'good.third-party.site',
4444
'broken.third-party.site',
45-
'privacy-test-pages.glitch.me'
45+
'privacy-test-pages.site'
4646
].forEach((hostname) => {
4747
const li = document.createElement('li');
4848
const a = document.createElement('a');

privacy-protections/click-to-load/index.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ <h2>Metrics</h2>
2929
<p><button id="download">Download the result</button></p>
3030

3131
<h2>All the social buttons from the SDK</h2>
32-
<div class="fb-like" data-href="https://privacy-test-pages.glitch.me/privacy-protections/click-to-load/" data-width="" data-layout="standard" data-action="like" data-size="small" data-share="true"></div>
33-
<br><div class="fb-like" data-href="https://privacy-test-pages.glitch.me/privacy-protections/click-to-load/" data-width="" data-layout="standard" data-action="recommend" data-size="small" data-share="true"></div>
34-
<br><div class="fb-share-button" data-href="https://privacy-test-pages.glitch.me/privacy-protections/click-to-load/" data-layout="button_count" data-size="small"><a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Fplugins%2F&amp;src=sdkpreparse" class="fb-xfbml-parse-ignore">Share</a></div>
35-
<!---<br><div class="fb-save" data-uri=https://privacy-test-pages.glitch.me/privacy-protections/click-to-load/" data-size="small">Deprecated per https://developers.facebook.com/docs/plugins/save</div>--->
32+
<div class="fb-like" data-href="https://privacy-test-pages.site/privacy-protections/click-to-load/" data-width="" data-layout="standard" data-action="like" data-size="small" data-share="true"></div>
33+
<br><div class="fb-like" data-href="https://privacy-test-pages.site/privacy-protections/click-to-load/" data-width="" data-layout="standard" data-action="recommend" data-size="small" data-share="true"></div>
34+
<br><div class="fb-share-button" data-href="https://privacy-test-pages.site/privacy-protections/click-to-load/" data-layout="button_count" data-size="small"><a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Fplugins%2F&amp;src=sdkpreparse" class="fb-xfbml-parse-ignore">Share</a></div>
35+
<!---<br><div class="fb-save" data-uri=https://privacy-test-pages.site/privacy-protections/click-to-load/" data-size="small">Deprecated per https://developers.facebook.com/docs/plugins/save</div>--->
3636

3737
<h2>All the social buttons in iFrames</h2>
38-
<iframe src="https://www.facebook.com/plugins/like.php?href=https%3A%2F%2Fprivacy-test-pages.glitch.me%2F&width=450&layout=standard&action=like&size=small&share=true&height=35&appId" width="450" height="35" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowfullscreen="true" allow="autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share"></iframe>
39-
<br><iframe src="https://www.facebook.com/plugins/like.php?href=https%3A%2F%2Fprivacy-test-pages.glitch.me%2F&width=450&layout=standard&action=recommend&size=small&share=true&height=35&appId" width="450" height="35" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowfullscreen="true" allow="autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share"></iframe>
40-
<br><iframe src="https://www.facebook.com/plugins/share_button.php?href=https%3A%2F%2Fprivacy-test-pages.glitch.me%2Fprivacy-protections%2Fclick-to-load%2F&layout=button_count&size=small&width=99&height=20&appId" width="99" height="20" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowfullscreen="true" allow="autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share"></iframe>
38+
<iframe src="https://www.facebook.com/plugins/like.php?href=https%3A%2F%2Fprivacy-test-pages.site%2F&width=450&layout=standard&action=like&size=small&share=true&height=35&appId" width="450" height="35" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowfullscreen="true" allow="autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share"></iframe>
39+
<br><iframe src="https://www.facebook.com/plugins/like.php?href=https%3A%2F%2Fprivacy-test-pages.site%2F&width=450&layout=standard&action=recommend&size=small&share=true&height=35&appId" width="450" height="35" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowfullscreen="true" allow="autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share"></iframe>
40+
<br><iframe src="https://www.facebook.com/plugins/share_button.php?href=https%3A%2F%2Fprivacy-test-pages.site%2Fprivacy-protections%2Fclick-to-load%2F&layout=button_count&size=small&width=99&height=20&appId" width="99" height="20" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowfullscreen="true" allow="autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share"></iframe>
4141

4242
<h2>Login buttons (SDK &amp; custom)</h2>
4343
<p style="color: #9F6000;background-color: #FEEFB3; margin: 10px 22px; padding: 10px; font-size:1.2em;vertical-align:middle;">&#x26A0; Login buttons only work with a valid Facebook developer account. This page is not configured with a real account, so is unlikely to show a proper login button, and the login flow may create errors. For true login testing, use a real FB account and actual pages with login.</p>

privacy-protections/storage-partitioning/helpers/common.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const FIRST_PARTY_HOSTNAME = isLocalTest ? 'first-party.example' : 'www.first-pa
99
const FIRST_PARTY_HTTP = isLocalTest ? `http://${FIRST_PARTY_HOSTNAME}:3000` : `http://${THIRD_PARTY_HOSTNAME}`;
1010
const FIRST_PARTY_HTTPS = `https://${FIRST_PARTY_HOSTNAME}`;
1111

12-
const HSTS_HOSTNAME = isLocalTest ? 'hsts.first-party.example' : 'privacy-test-pages.glitch.me';
12+
const HSTS_HOSTNAME = isLocalTest ? 'hsts.first-party.example' : 'privacy-test-pages.site';
1313

1414
// Inject an iframe to retrieve values from test APIs
1515
function accessStorageInIframe (frameOrigin, sessionId, mode, apiTypes = [], frameId) {

privacy-protections/storage-partitioning/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@ if (window.location.hostname === 'localhost') {
252252
runButton.setAttribute('disabled', '');
253253
}
254254

255-
// warn the user if loaded over privacy-test-pages.glitch.me
256-
if (window.location.hostname === 'privacy-test-pages.glitch.me') {
255+
// warn the user if loaded over privacy-test-pages.site
256+
if (window.location.hostname === 'privacy-test-pages.site') {
257257
const warning = document.getElementById('warning');
258258
warning.innerHTML = `⚠ Test must be accessed via ${FIRST_PARTY_HTTPS}. Redirecting you... ⚠`;
259259
runButton.setAttribute('disabled', '');

privacy-protections/storage-partitioning/server/routes.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,7 @@ router.get('/set_hsts.png', (req, res) => {
8989
});
9090

9191
router.get('/get_hsts.png', (req, res) => {
92-
let isHTTPS = req.protocol === 'https';
93-
// The X-Forwarded-Proto header is added by Glitch's proxy
94-
// and reveals the original protocol used during the connection
95-
// This header will always show HTTPS for all custom domains,
96-
// it's only correct for privacy-test-pages.glitch.me.
97-
if (req.headers['x-forwarded-proto']) {
98-
isHTTPS = req.headers['x-forwarded-proto'].split(',', 1)[0] === 'https';
99-
}
92+
const isHTTPS = req.protocol === 'https';
10093
if (isHTTPS) {
10194
const headers = { 'Cache-Control': 'max-age=0' };
10295
res.sendFile('image.png', { root: __dirname, headers });

server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ app.get('/come-back', (req, res) => {
232232
const jsReferrer = document.referrer;
233233
document.body.innerHTML += '<p>header: <strong>${req.headers.referer || ''}</strong></p><p>js: <strong>' + jsReferrer + '</strong></p>';
234234
setTimeout(() => {
235-
location.href = 'https://privacy-test-pages.glitch.me/privacy-protections/referrer-trimming/?run&header=${req.headers.referer || ''}&js=' + jsReferrer + '&testid=${req.query.testid || ''}';
235+
location.href = 'https://privacy-test-pages.site/privacy-protections/referrer-trimming/?run&header=${req.headers.referer || ''}&js=' + jsReferrer + '&testid=${req.query.testid || ''}';
236236
}, 1000);
237237
</script>
238238
</body>

0 commit comments

Comments
 (0)