1
0
Fork 0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-07-04 20:46:39 +02:00

Big linting

This commit is contained in:
kkapsner 2019-11-28 01:26:35 +01:00
parent b5e6d049ce
commit aef6bd3d59
58 changed files with 2074 additions and 1856 deletions

View file

@ -11,13 +11,59 @@
const searchParameters = new URLSearchParams(window.location.search);
var title = document.createElement("h1");
const title = document.createElement("h1");
title.className = "title";
title.textContent = extension.getTranslation("whitelist_inspection_title");
document.body.appendChild(title);
document.querySelector("head title").textContent = title.textContent;
const whitelistSettings = [
{
title: extension.getTranslation("whitelist_all_apis"),
name: "blockMode",
whitelistValue: "allow",
protectedValue: "fake"
},
{
title: extension.getTranslation("section_canvas-api"),
name: "protectedCanvasPart",
whitelistValue: "nothing",
protectedValue: "readout"
},
{
title: extension.getTranslation("section_audio-api"),
name: "protectAudio",
whitelistValue: false,
protectedValue: true
},
{
title: extension.getTranslation("section_history-api"),
name: "historyLengthThreshold",
whitelistValue: 10000,
protectedValue: 2
},
{
title: extension.getTranslation("section_window-api"),
name: "protectWindow",
whitelistValue: false,
protectedValue: true
},
{
title: extension.getTranslation("section_DOMRect-api"),
name: "protectDOMRect",
whitelistValue: false,
protectedValue: true
},
{
title: extension.getTranslation("section_navigator-api"),
name: "protectNavigator",
whitelistValue: false,
protectedValue: true
},
];
settings.onloaded(function(){
const sets = settingContainers.urlContainer.get();
@ -47,51 +93,6 @@
}
}
const whitelistSettings = [
{
title: extension.getTranslation("whitelist_all_apis"),
name: "blockMode",
whitelistValue: "allow",
protectedValue: "fake"
},
{
title: extension.getTranslation("section_canvas-api"),
name: "protectedCanvasPart",
whitelistValue: "nothing",
protectedValue: "readout"
},
{
title: extension.getTranslation("section_audio-api"),
name: "protectAudio",
whitelistValue: false,
protectedValue: true
},
{
title: extension.getTranslation("section_history-api"),
name: "historyLengthThreshold",
whitelistValue: 10000,
protectedValue: 2
},
{
title: extension.getTranslation("section_window-api"),
name: "protectWindow",
whitelistValue: false,
protectedValue: true
},
{
title: extension.getTranslation("section_DOMRect-api"),
name: "protectDOMRect",
whitelistValue: false,
protectedValue: true
},
{
title: extension.getTranslation("section_navigator-api"),
name: "protectNavigator",
whitelistValue: false,
protectedValue: true
},
];
const table = document.createElement("table");
whitelistSettings.forEach(function(setting){
const row = document.createElement("tr");