mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-22 04:13:06 +09:00
19 lines
489 B
JavaScript
19 lines
489 B
JavaScript
function ok(v, msg) {
|
|
client.postMessage({status: "ok", result: !!v, message: msg});
|
|
}
|
|
|
|
var client;
|
|
onmessage = function(e) {
|
|
if (e.data.message == "start") {
|
|
self.clients.matchAll().then(function(clients) {
|
|
client = clients[0];
|
|
try {
|
|
close();
|
|
ok(false, "close() should throw");
|
|
} catch (e) {
|
|
ok(e.name === "InvalidAccessError", "close() should throw InvalidAccessError");
|
|
}
|
|
client.postMessage({status: "done"});
|
|
});
|
|
}
|
|
}
|