1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2024-11-11 07:38:58 +01:00
CanvasBlocker/test/cspTest.js

21 lines
557 B
JavaScript
Raw Normal View History

2020-01-06 15:15:04 +01:00
/* globals testAPI, canvasAPI*/
2019-12-16 19:27:28 +01:00
const addLine = function(){
2019-12-14 21:22:18 +01:00
"use strict";
2019-12-16 19:27:28 +01:00
const output = document.getElementById("results");
2019-12-14 21:22:18 +01:00
return function(text){
2019-12-16 19:27:28 +01:00
const line = document.createElement("div");
2019-12-14 21:22:18 +01:00
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);
2019-12-16 19:27:28 +01:00
(async function(){
2019-12-14 21:22:18 +01:00
"use strict";
2020-01-06 15:15:04 +01:00
const hashValue = await testAPI.hash(canvasAPI.fingerprint(window).url);
2019-12-16 19:27:28 +01:00
addLine("canvas hash: " + hashValue);
}());