Skip to content

Commit 0223eb0

Browse files
committed
tests: Test JSON.stringify of navigator.mimeTypes and navigator.plugins
1 parent 9905394 commit 0223eb0

File tree

1 file changed

+16
-0
lines changed
  • web/packages/selfhosted/test/polyfill/spoofing

1 file changed

+16
-0
lines changed

web/packages/selfhosted/test/polyfill/spoofing/test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,20 @@ describe("Spoofing is not easily detectable", () => {
6262
});
6363
expect(instance).be.true;
6464
});
65+
66+
it("Spoof of navigator.plugins works with JSON.stringify", async () => {
67+
const json = await browser.execute(() => {
68+
return JSON.stringify(navigator.plugins);
69+
});
70+
expect(json).to.equal(
71+
'{"0":{"0":{},"1":{}},"1":{"0":{},"1":{}},"2":{"0":{},"1":{}},"3":{"0":{},"1":{}},"4":{"0":{},"1":{}},"5":{"0":{},"1":{},"2":{},"3":{}}}',
72+
);
73+
});
74+
75+
it("Spoof of navigator.mimeTypes works with JSON.stringify", async () => {
76+
const json = await browser.execute(() => {
77+
return JSON.stringify(navigator.mimeTypes);
78+
});
79+
expect(json).to.equal('{"0":{},"1":{},"2":{},"3":{},"4":{},"5":{}}');
80+
});
6581
});

0 commit comments

Comments
 (0)