1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2024-12-23 05:10:27 +01:00
CanvasBlocker/test/cspTest.js

21 lines
557 B
JavaScript
Raw Permalink 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);
}());