1
0
Fork 0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-07-04 20:46:39 +02:00
CanvasBlocker/test/navigatorTestWorker.js
2020-04-13 10:10:44 +02:00

24 lines
No EOL
563 B
JavaScript

(function(){
"use strict";
const values = {};
const navigator = self.navigator;
Object.keys(navigator.__proto__).sort().forEach(function(property){
const value = navigator[property];
if ((typeof value) === "string"){
values[property] = value;
}
});
if (self.postMessage){
self.postMessage(values);
}
self.addEventListener("connect", function(event){
event.ports.forEach(function(port){
port.postMessage(values);
});
});
self.addEventListener("message", function(event){
event.source.postMessage(values);
return values;
});
}());