Skip to content

Commit 77a719d

Browse files
authored
Remove last references to chrome.app (#4469)
* Remove last references to chrome.app * Update reference * Remove unused import
1 parent 1cecebc commit 77a719d

File tree

4 files changed

+4
-32
lines changed

4 files changed

+4
-32
lines changed

src/js/DarkTheme.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import GUI from "./gui";
2-
import windowWatcherUtil from "./utils/window_watchers";
31
import { checkSetupAnalytics } from "./Analytics";
42
import $ from "jquery";
53

@@ -29,10 +27,6 @@ DarkTheme.apply = function () {
2927
} else {
3028
self.applyNormal();
3129
}
32-
33-
if (chrome.app.window !== undefined) {
34-
windowWatcherUtil.passValue(chrome.app.window.get("receiver_msp"), "darkTheme", isEnabled);
35-
}
3630
});
3731
};
3832

src/js/receiver_msp/receiver_msp.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import "../jqueryPlugins.js";
22
import windowWatcherUtil from "../utils/window_watchers.js";
33
import DarkTheme from "../DarkTheme.js";
4-
import { isWeb } from "../utils/isWeb.js";
54
import $ from "jquery";
65

76
// This is a hack to get the i18n var of the parent, but the i18n.localizePage not works
@@ -68,7 +67,7 @@ function transmitChannels() {
6867
// Callback given to us by the window creator so we can have it send data over MSP for us:
6968
if (!window.setRawRx(channelValues)) {
7069
// MSP connection has gone away
71-
isWeb() ? close() : chrome.app.window.current().close();
70+
close();
7271
}
7372
}
7473

@@ -145,13 +144,7 @@ $(".button-enable .btn").on("click", function () {
145144
const shrinkHeight = $(".warning").height();
146145

147146
$(".warning").slideUp("short", function () {
148-
if (isWeb()) {
149-
resizeTo(outerWidth, outerHeight - shrinkHeight);
150-
} else {
151-
chrome.app.window.current().innerBounds.minHeight -= shrinkHeight;
152-
chrome.app.window.current().innerBounds.height -= shrinkHeight;
153-
chrome.app.window.current().innerBounds.maxHeight -= shrinkHeight;
154-
}
147+
resizeTo(outerWidth, outerHeight - shrinkHeight);
155148
});
156149

157150
enableTX = true;

src/js/utils/common.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import semver from "semver";
22
import { mixerList } from "../model";
33
import CONFIGURATOR from "../data_storage";
4-
import { gui_log } from "../gui_log";
54
import $ from "jquery";
65

76
export function millitime() {
@@ -34,19 +33,6 @@ export function isInt(n) {
3433
return n % 1 === 0;
3534
}
3635

37-
/*
38-
* checkChromeRuntimeError() has to be called after each chrome API call
39-
*/
40-
41-
export function checkChromeRuntimeError() {
42-
if (chrome.runtime.lastError) {
43-
console.error(`Chrome API Error: ${chrome.runtime.lastError.message}.\n Traced ${new Error().stack}`);
44-
gui_log(`Chrome API Error: ${chrome.runtime.lastError.message}.`);
45-
return true;
46-
}
47-
return false;
48-
}
49-
5036
const majorFirmwareVersions = {
5137
1.47: "4.6.*",
5238
1.46: "4.5.*",

src/js/utils/window_watchers.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { isWeb } from "../utils/isWeb";
21
/*
3-
This utility is intended to communicate between chrome windows.
2+
This utility is intended to communicate between browser windows.
43
One window could watch passed values from another window and react to them.
54
*/
65

@@ -41,7 +40,7 @@ windowWatcherUtil.passValue = function (windows, key, val) {
4140
return;
4241
}
4342

44-
const contentWindow = isWeb() ? win : win.contentWindow;
43+
const contentWindow = win;
4544

4645
if (contentWindow.bindings) {
4746
contentWindow.bindings[key] = val;

0 commit comments

Comments
 (0)