1
0
Fork 0
firefox/testing/web-platform/tests/content-security-policy/support/ping.js
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

12 lines
429 B
JavaScript

if (typeof ServiceWorkerGlobalScope === "function") {
self.onmessage = function (e) { e.source.postMessage("ping"); };
} else if (typeof SharedWorkerGlobalScope === "function") {
onconnect = function (e) {
var port = e.ports[0];
port.onmessage = function () { port.postMessage("ping"); }
port.postMessage("ping");
};
} else if (typeof DedicatedWorkerGlobalScope === "function") {
self.postMessage("ping");
}