/
githubmr
/
facebook-react
Обзор
Документация
Войти
/
githubmr
/
facebook-react
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
v16.11.0
packages/react-devtools/app.js
48 строк
1 KB
Brian Vaughn
Added FB copyright header
27 авг 2019, 20:54
27 авг 2019, 20:54
8e1434e
Код
Авторство
О чём код?
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow */ const {app, BrowserWindow} = require('electron'); // Module to create native browser window. const {join} = require('path'); const argv = require('minimist')(process.argv.slice(2)); const projectRoots = argv._; let mainWindow = null; app.on('window-all-closed', function() { app.quit(); }); app.on('ready', function() { // Create the browser window. mainWindow = new BrowserWindow({ width: 800, height: 600, icon: join(__dirname, 'icons/icon128.png'), frame: false, //titleBarStyle: 'customButtonsOnHover', webPreferences: { nodeIntegration: true, }, }); // and load the index.html of the app. mainWindow.loadURL('file://' + __dirname + '/app.html'); // eslint-disable-line no-path-concat mainWindow.webContents.executeJavaScript( // We use this so that RN can keep relative JSX __source filenames // but "click to open in editor" still works. js1 passes project roots // as the argument to DevTools. 'window.devtools.setProjectRoots(' + JSON.stringify(projectRoots) + ')', ); // Emitted when the window is closed. mainWindow.on('closed', function() { mainWindow = null; }); });