Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
810a3c17fd |
@@ -45,7 +45,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Listen for responses from the content script
|
// Listen for responses from the content script
|
||||||
window.addEventListener("message", (event) => {
|
window.addEventListener("message", function onUuid(event) {
|
||||||
if (event.source !== window) return;
|
if (event.source !== window) return;
|
||||||
if (event.data?.type !== "AUTISTMASK_RESPONSE") return;
|
if (event.data?.type !== "AUTISTMASK_RESPONSE") return;
|
||||||
const { id, result, error } = event.data;
|
const { id, result, error } = event.data;
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Listen for events pushed from the extension
|
// Listen for events pushed from the extension
|
||||||
window.addEventListener("message", (event) => {
|
window.addEventListener("message", function onUuid(event) {
|
||||||
if (event.source !== window) return;
|
if (event.source !== window) return;
|
||||||
if (event.data?.type !== "AUTISTMASK_EVENT") return;
|
if (event.data?.type !== "AUTISTMASK_EVENT") return;
|
||||||
const { eventName, data } = event.data;
|
const { eventName, data } = event.data;
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ const UUID_V4 =
|
|||||||
/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
|
/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
|
||||||
|
|
||||||
describe("the EIP-6963 provider UUID is fresh per page load", () => {
|
describe("the EIP-6963 provider UUID is fresh per page load", () => {
|
||||||
test("a load announces a UUIDv4", () => {
|
test("a load announces a UUIDv4 without being asked", () => {
|
||||||
const uuids = announcedUuids();
|
const uuids = announcedUuids();
|
||||||
expect(uuids.length).toBeGreaterThan(0);
|
expect(uuids.length).toBeGreaterThan(0);
|
||||||
expect(uuids[0]).toMatch(UUID_V4);
|
expect(uuids[0]).toMatch(UUID_V4);
|
||||||
|
|||||||
Reference in New Issue
Block a user