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:
parent
52e46bd9e2
commit
a42a464d1f
3 changed files with 22 additions and 0 deletions
10
js/main.js
10
js/main.js
|
@ -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";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue