mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-07-04 20:46:39 +02:00
parent
87fa607d28
commit
308d7c4005
3 changed files with 76 additions and 5 deletions
24
test/navigatorTestWorker.js
Normal file
24
test/navigatorTestWorker.js
Normal file
|
@ -0,0 +1,24 @@
|
|||
(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;
|
||||
});
|
||||
}());
|
Loading…
Add table
Add a link
Reference in a new issue