test/popup.test.js (658 bytes)
1 "use strict"; 2 const test = require("node:test"); 3 const assert = require("node:assert/strict"); 4 const fs = require("node:fs"); 5 const path = require("node:path"); 6 7 const read = (file) => fs.readFileSync(path.join(__dirname, "..", file), "utf8"); 8 9 // Most sites do not let a page of another site show them in a frame 10 // (X-Frame-Options or frame-ancestors), YouTube among them. A preview of a 11 // bookmark in a frame of the popup stays empty for them, so the popup has 12 // no frame. 13 test("the popup shows no page of another site in a frame", () => { 14 for (const file of ["popup.html", "popup.js"]) { 15 assert.doesNotMatch(read(file), /iframe/i, file); 16 } 17 });