| 1 | import assert from "node:assert/strict"; |
| 2 | import { readFileSync } from "node:fs"; |
| 3 | import { test } from "node:test"; |
| 4 | |
| 5 | test("guest browser views keep every node integration surface disabled", () => { |
| 6 | const source = readFileSync(new URL("./electronGuestViews.ts", import.meta.url), "utf8"); |
| 7 | for (const setting of [ |
| 8 | "sandbox: true", |
| 9 | "contextIsolation: true", |
| 10 | "nodeIntegration: false", |
| 11 | "nodeIntegrationInSubFrames: false", |
| 12 | "nodeIntegrationInWorker: false", |
| 13 | ]) { |
| 14 | assert.match(source, new RegExp(setting.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")), setting); |
| 15 | } |
| 16 | assert.doesNotMatch(source, /nodeIntegration(?:InSubFrames|InWorker)?:\s*true/); |
| 17 | }); |
| 18 |