Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/** The timer interface
* @type {object} */
const timer = require('timer');
/** The system module
* @type {object} */
const system = runtime.level >= fs.ROOT_LEVEL ? require('system') : null;
/** The web page's document
* @type {Document} */
const document = system ? system.window.document : null;
/** The translation function
* @type {function} */
const tr = translate.translate;
// If the application was loaded as a launcher...
if(runtime.arguments.launcher) {
debug.log('Running dolphin launcher...');
// Run the launcher's file in the global's context
system.loadScript(runtime.path + '/launcher.js', () => {
debug.error(tr('Failed to load the launcher file'));
});
} else {
/** The translation package path
* @type {string} */
// NOTE: We load the translation only here because the launcher will have
// to load it by itself (translations are not synchronous between
// main and child processes)
let tr_path = fs.makeAbsolute('translations/' + translate.language + '.ntp');