summaryrefslogtreecommitdiffstats
path: root/devtools/shared/commands/resource/tests/test_worker.js
blob: 60ccc6d52b0c74c853e7bed6184d8c8a9311a48f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

console.log("[WORKER] started", globalThis.location.toString(), globalThis);

globalThis.onmessage = function (e) {
  const { type, message } = e.data;

  if (type === "log-in-worker") {
    // Printing `e` so we can check that we have an object and not a stringified version
    console.log("[WORKER]", message, e);
  }
};