1 2 3 4 5 6 7 8 9 10 11 12 13
const { app } = require("electron"); const pkgHack = { idx: 0, data: [true, true, true, true, true, true], }; Object.defineProperty(app, "isPackaged", { get() { let ret = pkgHack.data[pkgHack.idx++]; if (ret === undefined) ret = true; console.log("get isPackaged", ret); return true; }, });