mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2024-12-22 12:50:36 +01:00
Update navigator test to include storage.quota
This commit is contained in:
parent
87790c9731
commit
36b54f3ab5
@ -60,15 +60,28 @@ function processNavigatorObject(navigator, keys, name){
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
iframeAPI.forEachMethod(function(windowToUse, name){
|
iframeAPI.forEachMethod(async function(windowToUse, name){
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const navigator = windowToUse.navigator;
|
const navigator = windowToUse.navigator;
|
||||||
processNavigatorObject(navigator, Object.keys(navigator.__proto__), name);
|
const values = {};
|
||||||
|
const keys = Object.keys(navigator.__proto__);
|
||||||
|
keys.forEach(function(property){
|
||||||
|
const value = navigator[property];
|
||||||
|
if ((typeof value) === "string"){
|
||||||
|
values[property] = value;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const storage = await navigator.storage.estimate();
|
||||||
|
values.storage_quota = storage.quota.toString(10);
|
||||||
|
keys.push("storage_quota");
|
||||||
|
console.log(name, values);
|
||||||
|
processNavigatorObject(values, keys, name);
|
||||||
});
|
});
|
||||||
|
|
||||||
function processWorkerNavigatorObject(data, name){
|
function processWorkerNavigatorObject(data, name){
|
||||||
"use strict";
|
"use strict";
|
||||||
|
console.log(name, data);
|
||||||
processNavigatorObject(data.values, Object.keys(data.values), name);
|
processNavigatorObject(data.values, Object.keys(data.values), name);
|
||||||
if (data.nestedValues){
|
if (data.nestedValues){
|
||||||
processWorkerNavigatorObject(data.nestedValues, "nested " + name);
|
processWorkerNavigatorObject(data.nestedValues, "nested " + name);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
(function(){
|
(async function(){
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const values = {};
|
const values = {};
|
||||||
@ -10,6 +10,8 @@
|
|||||||
values[property] = value;
|
values[property] = value;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
const storage = await navigator.storage.estimate();
|
||||||
|
values.storage_quota = storage.quota.toString(10);
|
||||||
|
|
||||||
const ports = [];
|
const ports = [];
|
||||||
const sources = [];
|
const sources = [];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user