Files
brave-core/test/data/favicon_read.html
T
Francois Marier 25e3b6f5df Make all favicon requests on-demand (fixes brave/internal#716)
This patch can be dropped once https://crbug.com/1096660 is fixed
as long as the test is retained and still passes.
2020-08-31 14:43:35 -07:00

34 lines
856 B
HTML

<html>
<head>
<title>Favicon Read</title>
<script>
function redirectToNextHop() {
const urlParams = new URLSearchParams(window.location.search);
const uid = urlParams.get('uid');
bit = parseInt(urlParams.get('bit') ? urlParams.get('bit') : "0");
nextBit = bit + 1;
if (bit > 3) {
url = new URL(window.location);
url.hostname = 'a.com';
url.pathname = '/simple.html';
url.search = '';
window.location = url.toString();
} else {
rand = parseInt(Math.random() * 1000000);
nextHop = new URL(window.location);
nextHop.hostname = 'fav' + bit + '.a.com';
nextHop.pathname = '/favicon_read.html';
nextHop.search = '?bit=' + nextBit + '&uid=' + uid + '&rand=' + rand;
window.location = nextHop.toString();
}
}
</script>
</head>
<body>
<script>
setTimeout(redirectToNextHop, 100);
</script>
</body>
</html>