1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-13 11:29:53 +03:00

fix for BUS holding after onClose

This commit is contained in:
cTn 2013-06-19 13:06:14 +02:00
parent 52e46bd9e2
commit a42a464d1f
3 changed files with 22 additions and 0 deletions

View file

@ -1,3 +1,13 @@
// Get access to the background window object
// This object is used to pass current connectionId to the backround page
// so the onClosed event can close the port for us if it was left opened, without this
// users can experience weird behavior if they would like to access the serial bus afterwards.
var backgroundPage;
chrome.runtime.getBackgroundPage(function(result) {
backgroundPage = result;
backgroundPage.connectionId = -1;
});
// OS detection
var OS = "Unknown";
if (navigator.appVersion.indexOf("Win") != -1) OS = "Windows";