Skip to content

Commit f6d559e

Browse files
authored
remove kioskmode (#4027)
Marked as deprecated since 2016.
1 parent 4311034 commit f6d559e

4 files changed

Lines changed: 9 additions & 34 deletions

File tree

js/defaults.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const defaults = {
99
address: address,
1010
port: port,
1111
basePath: "/",
12-
kioskmode: false,
1312
electronOptions: {},
1413
ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"],
1514

js/deprecated.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = {
2-
configs: ["kioskmode"],
2+
configs: [],
33
clock: ["secondsColor"]
44
};

js/electron.js

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,11 @@ function createWindow () {
6060
backgroundColor: "#000000"
6161
};
6262

63-
/*
64-
* DEPRECATED: "kioskmode" backwards compatibility, to be removed
65-
* settings these options directly instead provides cleaner interface
66-
*/
67-
if (config.kioskmode) {
68-
electronOptionsDefaults.kiosk = true;
69-
} else {
70-
electronOptionsDefaults.show = false;
71-
electronOptionsDefaults.frame = false;
72-
electronOptionsDefaults.transparent = true;
73-
electronOptionsDefaults.hasShadow = false;
74-
electronOptionsDefaults.fullscreen = true;
75-
}
63+
electronOptionsDefaults.show = false;
64+
electronOptionsDefaults.frame = false;
65+
electronOptionsDefaults.transparent = true;
66+
electronOptionsDefaults.hasShadow = false;
67+
electronOptionsDefaults.fullscreen = true;
7668

7769
const electronOptions = Object.assign({}, electronOptionsDefaults, config.electronOptions);
7870

@@ -132,22 +124,6 @@ function createWindow () {
132124
mainWindow = null;
133125
});
134126

135-
if (config.kioskmode) {
136-
mainWindow.on("blur", function () {
137-
mainWindow.focus();
138-
});
139-
140-
mainWindow.on("leave-full-screen", function () {
141-
mainWindow.setFullScreen(true);
142-
});
143-
144-
mainWindow.on("resize", function () {
145-
setTimeout(function () {
146-
mainWindow.reload();
147-
}, 1000);
148-
});
149-
}
150-
151127
//remove response headers that prevent sites of being embedded into iframes if configured
152128
mainWindow.webContents.session.webRequest.onHeadersReceived((details, callback) => {
153129
let curHeaders = details.responseHeaders;

tests/unit/classes/deprecated_spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ describe("Deprecated", () => {
55
expect(typeof deprecated).toBe("object");
66
});
77

8-
it("should contain configs array with deprecated options as strings", () => {
9-
expect(Array.isArray(["deprecated.configs"])).toBe(true);
8+
it("should contain clock array with deprecated options as strings", () => {
9+
expect(Array.isArray(["deprecated.clock"])).toBe(true);
1010
for (let option of deprecated.configs) {
1111
expect(typeof option).toBe("string");
1212
}
13-
expect(deprecated.configs).toEqual(expect.arrayContaining(["kioskmode"]));
13+
expect(deprecated.clock).toEqual(expect.arrayContaining(["secondsColor"]));
1414
});
1515
});

0 commit comments

Comments
 (0)