Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update site option test #126

Merged
merged 1 commit into from
Mar 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 6 additions & 28 deletions tracker-site-blocking/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,21 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Option blocked request loaded via fetch</title>
<title>Option blocked request loaded via script</title>

<script src="../tracker-reporting/utils.js"></script>
<script>
// eslint-disable-next-line no-unused-vars
function init () {
// eslint-disable-next-line no-undef
callAfterDelay(loadTracker);
}

function loadTracker () {
const targetElement = document.getElementById('target-div');
fetch('https://www.publisher-company.site/shared/utils.mjs', { mode: 'no-cors' })
.then(resp => {
targetElement.innerText = 'RESULT: Tracker loaded';
})
// eslint-disable-next-line node/handle-callback-err
.catch(err => {
targetElement.innerText = 'RESULT: Tracker not loaded';
});
}
</script>
<script src="http://publisher-company.site/shared/utils.mjs"></script>

</head>
<body onload="init()">
<body>
<p><a href="../index.html">[Home]</a></p>

<p>This will test conditional tracker blocking per site (option blocking). Clicking the buttons below will open bad.third-party.site (Site A) or first-party.site (Site B).</p>
<p>The test tracker should be blocked on Site A, but not on Site B</p>
<p>The test tracker should be blocked on Site A, but not on Site B. Check dashboard and devtools network tab to see if the tracker was blocked</p>

<ul>
<li><button type="button" onclick="window.open('https://bad.third-party.site/tracker-site-blocking/index.html', '_')">Open Site A</button></li>
<li><button type="button" onclick="window.open('https://www.first-party.site/tracker-site-blocking/index.html', '_')">Open Site B</button></li>
<li><button type="button" onclick="window.location.href = 'https://bad.third-party.site/tracker-site-blocking/index.html'">Open Site A</button></li>
<li><button type="button" onclick="window.location.href = 'https://www.first-party.site/tracker-site-blocking/index.html'">Open Site B</button></li>
</ul>

<div id="target-div">
</div>

</body>
</html>