1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2024-12-24 05:40:45 +01:00
CanvasBlocker/test/cspTest.js
2021-09-08 23:09:08 +02:00

28 lines
706 B
JavaScript

/* globals testAPI, canvasAPI*/
const addLine = function(){
"use strict";
const output = document.getElementById("results");
return function(text){
const line = document.createElement("div");
line.textContent = text;
output.appendChild(line);
};
}();
addLine("window name at start: " + window.name);
window.name = "CanvasBlocker CSP test";
addLine("window name after set: " + window.name);
(async function(){
"use strict";
const hashValue = await testAPI.hash(canvasAPI.fingerprint(window).url);
addLine("canvas hash: " + hashValue);
}());
document.getElementById("reloadWith304").addEventListener("click", function(){
"use strict";
document.cookie = "304=1";
location.reload();
});