mirror of
https://github.com/MagicMirrorOrg/MagicMirror.git
synced 2026-03-12 17:51:41 +08:00
@@ -9,7 +9,6 @@ const defaults = {
|
||||
address: address,
|
||||
port: port,
|
||||
basePath: "/",
|
||||
kioskmode: false,
|
||||
electronOptions: {},
|
||||
ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"],
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
module.exports = {
|
||||
configs: ["kioskmode"],
|
||||
configs: [],
|
||||
clock: ["secondsColor"]
|
||||
};
|
||||
|
||||
@@ -60,19 +60,11 @@ function createWindow () {
|
||||
backgroundColor: "#000000"
|
||||
};
|
||||
|
||||
/*
|
||||
* DEPRECATED: "kioskmode" backwards compatibility, to be removed
|
||||
* settings these options directly instead provides cleaner interface
|
||||
*/
|
||||
if (config.kioskmode) {
|
||||
electronOptionsDefaults.kiosk = true;
|
||||
} else {
|
||||
electronOptionsDefaults.show = false;
|
||||
electronOptionsDefaults.frame = false;
|
||||
electronOptionsDefaults.transparent = true;
|
||||
electronOptionsDefaults.hasShadow = false;
|
||||
electronOptionsDefaults.fullscreen = true;
|
||||
}
|
||||
electronOptionsDefaults.show = false;
|
||||
electronOptionsDefaults.frame = false;
|
||||
electronOptionsDefaults.transparent = true;
|
||||
electronOptionsDefaults.hasShadow = false;
|
||||
electronOptionsDefaults.fullscreen = true;
|
||||
|
||||
const electronOptions = Object.assign({}, electronOptionsDefaults, config.electronOptions);
|
||||
|
||||
@@ -132,22 +124,6 @@ function createWindow () {
|
||||
mainWindow = null;
|
||||
});
|
||||
|
||||
if (config.kioskmode) {
|
||||
mainWindow.on("blur", function () {
|
||||
mainWindow.focus();
|
||||
});
|
||||
|
||||
mainWindow.on("leave-full-screen", function () {
|
||||
mainWindow.setFullScreen(true);
|
||||
});
|
||||
|
||||
mainWindow.on("resize", function () {
|
||||
setTimeout(function () {
|
||||
mainWindow.reload();
|
||||
}, 1000);
|
||||
});
|
||||
}
|
||||
|
||||
//remove response headers that prevent sites of being embedded into iframes if configured
|
||||
mainWindow.webContents.session.webRequest.onHeadersReceived((details, callback) => {
|
||||
let curHeaders = details.responseHeaders;
|
||||
|
||||
@@ -5,11 +5,11 @@ describe("Deprecated", () => {
|
||||
expect(typeof deprecated).toBe("object");
|
||||
});
|
||||
|
||||
it("should contain configs array with deprecated options as strings", () => {
|
||||
expect(Array.isArray(["deprecated.configs"])).toBe(true);
|
||||
it("should contain clock array with deprecated options as strings", () => {
|
||||
expect(Array.isArray(["deprecated.clock"])).toBe(true);
|
||||
for (let option of deprecated.configs) {
|
||||
expect(typeof option).toBe("string");
|
||||
}
|
||||
expect(deprecated.configs).toEqual(expect.arrayContaining(["kioskmode"]));
|
||||
expect(deprecated.clock).toEqual(expect.arrayContaining(["secondsColor"]));
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user