mirror of
https://github.com/classilla/tenfourfox.git
synced 2024-07-31 21:29:00 +00:00
17 lines
436 B
JavaScript
17 lines
436 B
JavaScript
|
onmessage = function(e) {
|
||
|
if (!e.source) {
|
||
|
dump("ERROR: message doesn't have a source.");
|
||
|
}
|
||
|
|
||
|
if (!(e instanceof ExtendableMessageEvent)) {
|
||
|
e.source.postMessage("ERROR. event is not an extendable message event.");
|
||
|
}
|
||
|
|
||
|
// The client should be a window client
|
||
|
if (e.source instanceof WindowClient) {
|
||
|
e.source.postMessage(e.data);
|
||
|
} else {
|
||
|
e.source.postMessage("ERROR. source is not a window client.");
|
||
|
}
|
||
|
};
|