mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-16 21:05:30 +03:00
Remove ChromeOS support
This commit is contained in:
parent
5a56a6d70c
commit
fec4ab4b6a
10 changed files with 23 additions and 202 deletions
|
@ -43,7 +43,6 @@ before_install:
|
||||||
script:
|
script:
|
||||||
- yarn test
|
- yarn test
|
||||||
- yarn gulp release
|
- yarn gulp release
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then yarn gulp release --chromeos; fi
|
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
|
|
31
README.md
31
README.md
|
@ -6,9 +6,7 @@
|
||||||
|
|
||||||
Betaflight Configurator is a crossplatform configuration tool for the Betaflight flight control system.
|
Betaflight Configurator is a crossplatform configuration tool for the Betaflight flight control system.
|
||||||
|
|
||||||
It runs as an app within Google Chrome and allows you to configure the Betaflight software running on any [supported Betaflight target](https://github.com/betaflight/betaflight/tree/master/src/main/target).
|
It runs as an application under different operating systems and allows you to configure the Betaflight software running on any supported Betaflight target. [Downloads are available in Releases.](https://github.com/betaflight/betaflight-configurator/releases)
|
||||||
|
|
||||||
There is also now a standalone version available, since Google Chrome Apps are getting deprecated on platforms that aren't Chrome OS. [Downloads are available in Releases.](https://github.com/betaflight/betaflight-configurator/releases)
|
|
||||||
|
|
||||||
Various types of aircraft are supported by the tool and by Betaflight, e.g. quadcopters, hexacopters, octocopters and fixed-wing aircraft.
|
Various types of aircraft are supported by the tool and by Betaflight, e.g. quadcopters, hexacopters, octocopters and fixed-wing aircraft.
|
||||||
|
|
||||||
|
@ -17,6 +15,7 @@ Various types of aircraft are supported by the tool and by Betaflight, e.g. quad
|
||||||
Betaflight Configurator is a [fork](#credits) of the Cleanflight Configurator with support for Betaflight instead of Cleanflight.
|
Betaflight Configurator is a [fork](#credits) of the Cleanflight Configurator with support for Betaflight instead of Cleanflight.
|
||||||
|
|
||||||
This configurator is the only configurator with support for Betaflight specific features. It will likely require that you run the latest firmware on the flight controller.
|
This configurator is the only configurator with support for Betaflight specific features. It will likely require that you run the latest firmware on the flight controller.
|
||||||
|
|
||||||
If you are experiencing any problems please make sure you are running the [latest firmware version](https://github.com/betaflight/betaflight/releases/).
|
If you are experiencing any problems please make sure you are running the [latest firmware version](https://github.com/betaflight/betaflight/releases/).
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
@ -31,17 +30,6 @@ Download the installer from [Releases.](https://github.com/betaflight/betaflight
|
||||||
|
|
||||||
Changes to the security model used in the latest versions of MacOS X 10.14 (Mojave) and 10.15 (Catalina) mean that the operating system will show an error message ('"Betaflight Configurator.app" is damaged and can’t be opened. You should move it to the Trash.') when trying to install the application. To work around this, run the following command in a terminal after installing: `sudo xattr -rd com.apple.quarantine /Applications/Betaflight\ Configurator.app`.
|
Changes to the security model used in the latest versions of MacOS X 10.14 (Mojave) and 10.15 (Catalina) mean that the operating system will show an error message ('"Betaflight Configurator.app" is damaged and can’t be opened. You should move it to the Trash.') when trying to install the application. To work around this, run the following command in a terminal after installing: `sudo xattr -rd com.apple.quarantine /Applications/Betaflight\ Configurator.app`.
|
||||||
|
|
||||||
|
|
||||||
### Via Chrome Web Store (for ChromeOS)
|
|
||||||
|
|
||||||
[](https://chrome.google.com/webstore/detail/dlgclabibdhkfnbkajgkplmkpndajfom)
|
|
||||||
|
|
||||||
1. Visit the [Betaflight Configurator product page in the Chrome web store](https://chrome.google.com/webstore/detail/dlgclabibdhkfnbkajgkplmkpndajfom)
|
|
||||||
2. Click **+ Add to Chrome**
|
|
||||||
|
|
||||||
Please note - the application will automatically update itself when new versions are released. Please ensure you maintain configuration backups as described in the Betaflight documentation.
|
|
||||||
|
|
||||||
|
|
||||||
### Unstable Testing Versions
|
### Unstable Testing Versions
|
||||||
|
|
||||||
Unstable testing versions of the lates builds of the configurator for most platforms can be downloaded from [here](https://github.com/betaflight/betaflight-configurator-nightlies/releases/).
|
Unstable testing versions of the lates builds of the configurator for most platforms can be downloaded from [here](https://github.com/betaflight/betaflight-configurator-nightlies/releases/).
|
||||||
|
@ -84,12 +72,12 @@ To build or release only for one specific platform you can append the plaform af
|
||||||
If no platform is provided, all the platforms will be done in sequence.
|
If no platform is provided, all the platforms will be done in sequence.
|
||||||
|
|
||||||
* **MacOS X** use `yarn gulp <task-name> --osx64`
|
* **MacOS X** use `yarn gulp <task-name> --osx64`
|
||||||
* **Linux** use `yarn gulp <task-name> --linux64`
|
* **Linux** use `yarn gulp <task-name> --linux64`
|
||||||
* **Windows** use `yarn gulp <task-name> --win32`
|
* **Windows** use `yarn gulp <task-name> --win32`
|
||||||
* **ChromeOS** use `yarn gulp <task-name> --chromeos`
|
|
||||||
* **Android** use `yarn gulp <task-name> --android`
|
* **Android** use `yarn gulp <task-name> --android`
|
||||||
|
|
||||||
You can also use multiple platforms e.g. `yarn gulp <taskname> --osx64 --linux64`.
|
|
||||||
|
You can also use multiple platforms e.g. `yarn gulp <taskname> --osx64 --linux64`. Other platforms like `--win64`, `--linux32` and `--armv7` can be used too, but they are not officially supported, so use them at your own risk.
|
||||||
|
|
||||||
## Languages
|
## Languages
|
||||||
|
|
||||||
|
@ -101,7 +89,7 @@ If you prefer to have the application in English or any other language, you can
|
||||||
|
|
||||||
### Graphics Issues
|
### Graphics Issues
|
||||||
|
|
||||||
If you experience graphics display problems or smudged/dithered fonts display issues in Betaflight Configurator, try invoking the betaflight-configurator executable file with the --disable-gpu command line switch. This will switch off hardware graphics acceleration. Likewise, setting your graphics card antialiasing option to OFF (e.g. FXAA parameter on NVidia graphics cards) might be a remedy as well.
|
If you experience graphics display problems or smudged/dithered fonts display issues in Betaflight Configurator, try invoking the `betaflight-configurator` executable file with the `--disable-gpu` command line switch. This will switch off hardware graphics acceleration. Likewise, setting your graphics card antialiasing option to OFF (e.g. FXAA parameter on NVidia graphics cards) might be a remedy as well.
|
||||||
|
|
||||||
### Linux users
|
### Linux users
|
||||||
|
|
||||||
|
@ -111,10 +99,6 @@ In most Linux distributions your user won't have access to serial interfaces by
|
||||||
sudo usermod -aG dialout ${USER}
|
sudo usermod -aG dialout ${USER}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Linux / MacOS X users
|
|
||||||
|
|
||||||
If you have 3D model animation problems, enable "Override software rendering list" in Chrome flags chrome://flags/#ignore-gpu-blacklist
|
|
||||||
|
|
||||||
## Support
|
## Support
|
||||||
|
|
||||||
If you need help please reach out on the [betaflightgroup](https://betaflightgroup.slack.com) slack channel before raising issues on github. Register and [request slack access here](https://slack.betaflight.com).
|
If you need help please reach out on the [betaflightgroup](https://betaflightgroup.slack.com) slack channel before raising issues on github. Register and [request slack access here](https://slack.betaflight.com).
|
||||||
|
@ -142,4 +126,3 @@ We accept clean and reasonable patches, submit them!
|
||||||
ctn - primary author and maintainer of Baseflight Configurator from which Cleanflight Configurator project was forked.
|
ctn - primary author and maintainer of Baseflight Configurator from which Cleanflight Configurator project was forked.
|
||||||
|
|
||||||
Hydra - author and maintainer of Cleanflight Configurator from which this project was forked.
|
Hydra - author and maintainer of Cleanflight Configurator from which this project was forked.
|
||||||
|
|
||||||
|
|
34
gulpfile.js
34
gulpfile.js
|
@ -112,10 +112,10 @@ gulp.task('default', debugBuild);
|
||||||
|
|
||||||
// Get platform from commandline args
|
// Get platform from commandline args
|
||||||
// #
|
// #
|
||||||
// # gulp <task> [<platform>]+ Run only for platform(s) (with <platform> one of --linux64, --linux32, --armv7, --osx64, --win32, --win64, --chromeos or --android)
|
// # gulp <task> [<platform>]+ Run only for platform(s) (with <platform> one of --linux64, --linux32, --armv7, --osx64, --win32, --win64, or --android)
|
||||||
// #
|
// #
|
||||||
function getInputPlatforms() {
|
function getInputPlatforms() {
|
||||||
const supportedPlatforms = ['linux64', 'linux32', 'armv7', 'osx64', 'win32','win64', 'chromeos', 'android'];
|
const supportedPlatforms = ['linux64', 'linux32', 'armv7', 'osx64', 'win32', 'win64', 'android'];
|
||||||
var platforms = [];
|
var platforms = [];
|
||||||
var regEx = /--(\w+)/;
|
var regEx = /--(\w+)/;
|
||||||
console.log(process.argv);
|
console.log(process.argv);
|
||||||
|
@ -193,30 +193,36 @@ function removeItem(platforms, item) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRunDebugAppCommand(arch) {
|
function getRunDebugAppCommand(arch) {
|
||||||
|
|
||||||
|
let command;
|
||||||
|
|
||||||
switch (arch) {
|
switch (arch) {
|
||||||
case 'osx64':
|
case 'osx64':
|
||||||
return 'open ' + path.join(DEBUG_DIR, pkg.name, arch, pkg.name + '.app');
|
const pkgName = `${pkg.name}.app`;
|
||||||
|
command = `open ${path.join(DEBUG_DIR, pkg.name, arch, pkgName)}`;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'linux64':
|
case 'linux64':
|
||||||
case 'linux32':
|
case 'linux32':
|
||||||
case 'armv7':
|
case 'armv7':
|
||||||
return path.join(DEBUG_DIR, pkg.name, arch, pkg.name);
|
command = path.join(DEBUG_DIR, pkg.name, arch, pkg.name);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'win32':
|
case 'win32':
|
||||||
case 'win64':
|
case 'win64':
|
||||||
return path.join(DEBUG_DIR, pkg.name, arch, pkg.name + '.exe');
|
command = path.join(DEBUG_DIR, pkg.name, arch, `${pkg.name}.exe`);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return '';
|
command = '';
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return command;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getReleaseFilename(platform, ext) {
|
function getReleaseFilename(platform, ext) {
|
||||||
|
@ -258,7 +264,6 @@ function dist_src() {
|
||||||
return packageJson
|
return packageJson
|
||||||
.pipe(source('package.json'))
|
.pipe(source('package.json'))
|
||||||
.pipe(gulp.src(distSources, { base: 'src' }))
|
.pipe(gulp.src(distSources, { base: 'src' }))
|
||||||
.pipe(gulp.src('manifest.json', { passthrougth: true }))
|
|
||||||
.pipe(gulp.src('yarn.lock', { passthrougth: true }))
|
.pipe(gulp.src('yarn.lock', { passthrougth: true }))
|
||||||
.pipe(gulp.dest(DIST_DIR));
|
.pipe(gulp.dest(DIST_DIR));
|
||||||
}
|
}
|
||||||
|
@ -295,7 +300,6 @@ function dist_resources() {
|
||||||
// Create runable app directories in ./apps
|
// Create runable app directories in ./apps
|
||||||
function apps(done) {
|
function apps(done) {
|
||||||
var platforms = getPlatforms();
|
var platforms = getPlatforms();
|
||||||
removeItem(platforms, 'chromeos');
|
|
||||||
removeItem(platforms, 'android');
|
removeItem(platforms, 'android');
|
||||||
|
|
||||||
buildNWAppsWrapper(platforms, 'normal', APPS_DIR, done);
|
buildNWAppsWrapper(platforms, 'normal', APPS_DIR, done);
|
||||||
|
@ -355,7 +359,6 @@ function post_build(arch, folder, done) {
|
||||||
// Create debug app directories in ./debug
|
// Create debug app directories in ./debug
|
||||||
function debug(done) {
|
function debug(done) {
|
||||||
var platforms = getPlatforms();
|
var platforms = getPlatforms();
|
||||||
removeItem(platforms, 'chromeos');
|
|
||||||
removeItem(platforms, 'android');
|
removeItem(platforms, 'android');
|
||||||
|
|
||||||
buildNWAppsWrapper(platforms, 'sdk', DEBUG_DIR, done);
|
buildNWAppsWrapper(platforms, 'sdk', DEBUG_DIR, done);
|
||||||
|
@ -567,15 +570,6 @@ function release_zip(arch, appDirectory) {
|
||||||
return compressFiles(src, base, output, 'Betaflight Configurator');
|
return compressFiles(src, base, output, 'Betaflight Configurator');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create distribution package for chromeos platform
|
|
||||||
function release_chromeos() {
|
|
||||||
var src = path.join(DIST_DIR, '**');
|
|
||||||
var output = getReleaseFilename('chromeos', 'zip');
|
|
||||||
var base = DIST_DIR;
|
|
||||||
|
|
||||||
return compressFiles(src, base, output, '.');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Compress files from srcPath, using basePath, to outputFile in the RELEASE_DIR
|
// Compress files from srcPath, using basePath, to outputFile in the RELEASE_DIR
|
||||||
function compressFiles(srcPath, basePath, outputFile, zipFolder) {
|
function compressFiles(srcPath, basePath, outputFile, zipFolder) {
|
||||||
return gulp.src(srcPath, { base: basePath })
|
return gulp.src(srcPath, { base: basePath })
|
||||||
|
@ -729,10 +723,6 @@ function listReleaseTasks(appDirectory) {
|
||||||
|
|
||||||
var releaseTasks = [];
|
var releaseTasks = [];
|
||||||
|
|
||||||
if (platforms.indexOf('chromeos') !== -1) {
|
|
||||||
releaseTasks.push(release_chromeos);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (platforms.indexOf('linux64') !== -1) {
|
if (platforms.indexOf('linux64') !== -1) {
|
||||||
releaseTasks.push(function release_linux64_zip() {
|
releaseTasks.push(function release_linux64_zip() {
|
||||||
return release_zip('linux64', appDirectory);
|
return release_zip('linux64', appDirectory);
|
||||||
|
|
|
@ -1,65 +0,0 @@
|
||||||
{
|
|
||||||
"manifest_version": 2,
|
|
||||||
"minimum_chrome_version": "49",
|
|
||||||
"version": "10.8.0",
|
|
||||||
"author": "Betaflight Squad",
|
|
||||||
"name": "Betaflight - Configurator",
|
|
||||||
"short_name": "Betaflight",
|
|
||||||
"description": "Crossplatform configuration tool for Betaflight flight control system",
|
|
||||||
|
|
||||||
"offline_enabled": true,
|
|
||||||
|
|
||||||
"default_locale": "en",
|
|
||||||
|
|
||||||
"app": {
|
|
||||||
"background": {
|
|
||||||
"scripts": ["js/chromeAppEventPage.js"],
|
|
||||||
"persistent": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"permissions": [
|
|
||||||
"https://api.openstreetmap.org/",
|
|
||||||
"https://*.github.com/",
|
|
||||||
"https://*.githubusercontent.com/",
|
|
||||||
"http://*.baseflight.net/",
|
|
||||||
"https://*.amazonaws.com/",
|
|
||||||
"https://*.betaflight.tech/",
|
|
||||||
"https://www.google-analytics.com/",
|
|
||||||
"serial",
|
|
||||||
"usb",
|
|
||||||
"storage",
|
|
||||||
"clipboardRead",
|
|
||||||
"fileSystem",
|
|
||||||
"fileSystem.write",
|
|
||||||
"fileSystem.retainEntries",
|
|
||||||
"notifications",
|
|
||||||
"alwaysOnTopWindows",
|
|
||||||
{"usbDevices": [
|
|
||||||
{"vendorId": 1155, "productId": 57105},
|
|
||||||
{"vendorId": 10473, "productId": 393}
|
|
||||||
]},
|
|
||||||
"webview",
|
|
||||||
"unlimitedStorage"
|
|
||||||
],
|
|
||||||
"sockets": {
|
|
||||||
"tcp": {
|
|
||||||
"connect": "*:*"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"webview": {
|
|
||||||
"partitions": [
|
|
||||||
{
|
|
||||||
"name": "map",
|
|
||||||
"accessible_resources" : ["tabs/map.html",
|
|
||||||
"js/tabs/map.js",
|
|
||||||
"/js/libraries/openlayers/ol.css",
|
|
||||||
"/js/libraries/openlayers/ol.js",
|
|
||||||
"/images/icons/cf_icon_position.png",
|
|
||||||
"/images/icons/cf_icon_position_nofix.png"]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"icons": {
|
|
||||||
"128": "images/bf_icon_128.png"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -57,28 +57,6 @@ Clipboard._configureClipboardAsNwJs = function(nwGui) {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
Clipboard._configureClipboardAsChrome = function() {
|
|
||||||
|
|
||||||
console.log('Chrome Clipboard available');
|
|
||||||
|
|
||||||
this.available = true;
|
|
||||||
this.readAvailable = false; // FIXME: for some reason the read is not working
|
|
||||||
this.writeAvailable = true;
|
|
||||||
|
|
||||||
this.writeText = function(text, onSuccess, onError) {
|
|
||||||
navigator.clipboard.writeText(text)
|
|
||||||
.then(onSuccess)
|
|
||||||
.catch(onError);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.readText = function(onSuccess, onError) {
|
|
||||||
navigator.clipboard.readText()
|
|
||||||
.then(onSuccess)
|
|
||||||
.catch(onError);
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
Clipboard._configureClipboardAsCordova = function() {
|
Clipboard._configureClipboardAsCordova = function() {
|
||||||
|
|
||||||
console.log('Cordova Clipboard available');
|
console.log('Cordova Clipboard available');
|
||||||
|
@ -116,8 +94,6 @@ Clipboard._configureClipboardAsOther = function() {
|
||||||
|
|
||||||
if (GUI.isNWJS()){
|
if (GUI.isNWJS()){
|
||||||
Clipboard._configureClipboardAsNwJs(GUI.nwGui);
|
Clipboard._configureClipboardAsNwJs(GUI.nwGui);
|
||||||
} else if (GUI.isChromeApp()) {
|
|
||||||
Clipboard._configureClipboardAsChrome();
|
|
||||||
} else if (GUI.isCordova()) {
|
} else if (GUI.isCordova()) {
|
||||||
Clipboard._configureClipboardAsCordova();
|
Clipboard._configureClipboardAsCordova();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -5,10 +5,6 @@
|
||||||
var ConfigStorage = {
|
var ConfigStorage = {
|
||||||
// key can be one string, or array of strings
|
// key can be one string, or array of strings
|
||||||
get: function(key, callback) {
|
get: function(key, callback) {
|
||||||
if (GUI.isChromeApp()) {
|
|
||||||
chrome.storage.local.get(key,callback);
|
|
||||||
} else {
|
|
||||||
//console.log('Abstraction.get',key);
|
|
||||||
if (Array.isArray(key)) {
|
if (Array.isArray(key)) {
|
||||||
var obj = {};
|
var obj = {};
|
||||||
key.forEach(function (element) {
|
key.forEach(function (element) {
|
||||||
|
@ -33,19 +29,13 @@ var ConfigStorage = {
|
||||||
callback({});
|
callback({});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
// set takes an object like {'userLanguageSelect':'DEFAULT'}
|
// set takes an object like {'userLanguageSelect':'DEFAULT'}
|
||||||
set: function(input) {
|
set: function(input) {
|
||||||
if (GUI.isChromeApp()) {
|
|
||||||
chrome.storage.local.set(input);
|
|
||||||
} else {
|
|
||||||
//console.log('Abstraction.set',input);
|
|
||||||
Object.keys(input).forEach(function (element) {
|
Object.keys(input).forEach(function (element) {
|
||||||
var tmpObj = {};
|
var tmpObj = {};
|
||||||
tmpObj[element] = input[element];
|
tmpObj[element] = input[element];
|
||||||
window.localStorage.setItem(element, JSON.stringify(tmpObj));
|
window.localStorage.setItem(element, JSON.stringify(tmpObj));
|
||||||
});
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
/*
|
|
||||||
If an id is also specified and a window with a matching id has been shown before, the remembered bounds of the window will be used instead.
|
|
||||||
*/
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
function startApplication() {
|
|
||||||
chrome.app.window.create('main.html', {
|
|
||||||
id: 'main-window',
|
|
||||||
frame: 'chrome',
|
|
||||||
innerBounds: {
|
|
||||||
minWidth: 1024,
|
|
||||||
minHeight: 550,
|
|
||||||
},
|
|
||||||
}, function (createdWindow) {
|
|
||||||
if (getChromeVersion() >= 54) {
|
|
||||||
createdWindow.icon = 'images/bf_icon_128.png';
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
chrome.app.runtime.onLaunched.addListener(startApplication);
|
|
||||||
|
|
||||||
function getChromeVersion () {
|
|
||||||
const raw = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);
|
|
||||||
|
|
||||||
return raw ? parseInt(raw[2], 10) : false;
|
|
||||||
}
|
|
|
@ -5,7 +5,6 @@ window.TABS = {}; // filled by individual tab js file
|
||||||
|
|
||||||
const GUI_MODES = {
|
const GUI_MODES = {
|
||||||
NWJS: "NW.js",
|
NWJS: "NW.js",
|
||||||
ChromeApp: "Chrome",
|
|
||||||
Cordova: "Cordova",
|
Cordova: "Cordova",
|
||||||
Other: "Other",
|
Other: "Other",
|
||||||
};
|
};
|
||||||
|
@ -67,11 +66,7 @@ const GuiControl = function () {
|
||||||
if (typeof cordovaApp !== 'undefined') {
|
if (typeof cordovaApp !== 'undefined') {
|
||||||
this.Mode = GUI_MODES.Cordova;
|
this.Mode = GUI_MODES.Cordova;
|
||||||
} else {
|
} else {
|
||||||
if (window.chrome && chrome.storage && chrome.storage.local) {
|
this.Mode = GUI_MODES.Other;
|
||||||
this.Mode = GUI_MODES.ChromeApp;
|
|
||||||
} else {
|
|
||||||
this.Mode = GUI_MODES.Other;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -81,8 +76,6 @@ function GUI_checkOperatingSystem() {
|
||||||
return "Windows";
|
return "Windows";
|
||||||
} else if (navigator.appVersion.indexOf("Mac") !== -1) {
|
} else if (navigator.appVersion.indexOf("Mac") !== -1) {
|
||||||
return "MacOS";
|
return "MacOS";
|
||||||
} else if (navigator.appVersion.indexOf("CrOS") !== -1) {
|
|
||||||
return "ChromeOS";
|
|
||||||
} else if (navigator.appVersion.indexOf("Android") !== -1) {
|
} else if (navigator.appVersion.indexOf("Android") !== -1) {
|
||||||
return "Android";
|
return "Android";
|
||||||
} else if (navigator.appVersion.indexOf("Linux") !== -1) {
|
} else if (navigator.appVersion.indexOf("Linux") !== -1) {
|
||||||
|
@ -395,12 +388,10 @@ GuiControl.prototype.selectDefaultTabWhenConnected = function() {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
GuiControl.prototype.isChromeApp = function () {
|
|
||||||
return this.Mode === GUI_MODES.ChromeApp;
|
|
||||||
};
|
|
||||||
GuiControl.prototype.isNWJS = function () {
|
GuiControl.prototype.isNWJS = function () {
|
||||||
return this.Mode === GUI_MODES.NWJS;
|
return this.Mode === GUI_MODES.NWJS;
|
||||||
};
|
};
|
||||||
|
|
||||||
GuiControl.prototype.isCordova = function () {
|
GuiControl.prototype.isCordova = function () {
|
||||||
return this.Mode === GUI_MODES.Cordova;
|
return this.Mode === GUI_MODES.Cordova;
|
||||||
};
|
};
|
||||||
|
|
|
@ -14,17 +14,6 @@ function appReady() {
|
||||||
CONFIGURATOR.version = data.version;
|
CONFIGURATOR.version = data.version;
|
||||||
CONFIGURATOR.gitChangesetId = data.gitChangesetId;
|
CONFIGURATOR.gitChangesetId = data.gitChangesetId;
|
||||||
|
|
||||||
// Version in the ChromeApp's manifest takes precedence.
|
|
||||||
if(chrome.runtime && chrome.runtime.getManifest && !GUI.isCordova()) {
|
|
||||||
const manifest = chrome.runtime.getManifest();
|
|
||||||
CONFIGURATOR.version = manifest.version;
|
|
||||||
// manifest.json for ChromeApp can't have a version
|
|
||||||
// with a prerelease tag eg 10.0.0-RC4
|
|
||||||
// Work around is to specify the prerelease version in version_name
|
|
||||||
if (manifest.version_name) {
|
|
||||||
CONFIGURATOR.version = manifest.version_name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
i18n.init(function() {
|
i18n.init(function() {
|
||||||
startProcess();
|
startProcess();
|
||||||
|
|
||||||
|
@ -181,10 +170,6 @@ function startProcess() {
|
||||||
GUI.nwGui.Shell.openExternal(url);
|
GUI.nwGui.Shell.openExternal(url);
|
||||||
});
|
});
|
||||||
nwWindow.on('close', closeHandler);
|
nwWindow.on('close', closeHandler);
|
||||||
} else if (GUI.isChromeApp()) {
|
|
||||||
chrome.app.window.onClosed.addListener(closeHandler);
|
|
||||||
// This event does not actually get fired:
|
|
||||||
chrome.runtime.onSuspend.addListener(closeHandler);
|
|
||||||
} else if (GUI.isCordova()) {
|
} else if (GUI.isCordova()) {
|
||||||
window.addEventListener('beforeunload', closeHandler);
|
window.addEventListener('beforeunload', closeHandler);
|
||||||
document.addEventListener('backbutton', function(e) {
|
document.addEventListener('backbutton', function(e) {
|
||||||
|
|
|
@ -116,9 +116,8 @@ TABS.vtx.initialize = function (callback) {
|
||||||
// Load schema
|
// Load schema
|
||||||
const urlVtxSchema = chrome.runtime.getURL(`resources/jsonschema/vtxconfig_schema-${vtxConfig.version}.json`);
|
const urlVtxSchema = chrome.runtime.getURL(`resources/jsonschema/vtxconfig_schema-${vtxConfig.version}.json`);
|
||||||
|
|
||||||
if (GUI.isChromeApp() || GUI.isCordova()) {
|
if (GUI.isCordova()) {
|
||||||
// FIXME the ChromeOs don't let us use a Schema Validator because almost all of them use eval, and/or use require
|
// FIXME On android : Fetch API cannot load : URL scheme "file" is not supported
|
||||||
// On android : Fetch API cannot load : URL scheme "file" is not supported
|
|
||||||
callback_valid();
|
callback_valid();
|
||||||
} else {
|
} else {
|
||||||
fetch(urlVtxSchema)
|
fetch(urlVtxSchema)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue