Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

chrome-launcher.js 26KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. /**
  2. * @license Copyright 2016 Google Inc. All Rights Reserved.
  3. * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
  4. * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
  5. */
  6. 'use strict';
  7. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  9. return new (P || (P = Promise))(function (resolve, reject) {
  10. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  11. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  12. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  13. step((generator = generator.apply(thisArg, _arguments || [])).next());
  14. });
  15. };
  16. Object.defineProperty(exports, "__esModule", { value: true });
  17. exports.killAll = exports.launch = exports.Launcher = void 0;
  18. const childProcess = require("child_process");
  19. const fs = require("fs");
  20. const net = require("net");
  21. const rimraf = require("rimraf");
  22. const chromeFinder = require("./chrome-finder");
  23. const random_port_1 = require("./random-port");
  24. const flags_1 = require("./flags");
  25. const utils_1 = require("./utils");
  26. const log = require('lighthouse-logger');
  27. const spawn = childProcess.spawn;
  28. const execSync = childProcess.execSync;
  29. const isWsl = utils_1.getPlatform() === 'wsl';
  30. const isWindows = utils_1.getPlatform() === 'win32';
  31. const _SIGINT = 'SIGINT';
  32. const _SIGINT_EXIT_CODE = 130;
  33. const _SUPPORTED_PLATFORMS = new Set(['darwin', 'linux', 'win32', 'wsl']);
  34. const instances = new Set();
  35. const sigintListener = () => __awaiter(void 0, void 0, void 0, function* () {
  36. yield killAll();
  37. process.exit(_SIGINT_EXIT_CODE);
  38. });
  39. function launch(opts = {}) {
  40. return __awaiter(this, void 0, void 0, function* () {
  41. opts.handleSIGINT = utils_1.defaults(opts.handleSIGINT, true);
  42. const instance = new Launcher(opts);
  43. // Kill spawned Chrome process in case of ctrl-C.
  44. if (opts.handleSIGINT && instances.size === 0) {
  45. process.on(_SIGINT, sigintListener);
  46. }
  47. instances.add(instance);
  48. yield instance.launch();
  49. const kill = () => __awaiter(this, void 0, void 0, function* () {
  50. instances.delete(instance);
  51. if (instances.size === 0) {
  52. process.removeListener(_SIGINT, sigintListener);
  53. }
  54. return instance.kill();
  55. });
  56. return { pid: instance.pid, port: instance.port, kill, process: instance.chrome };
  57. });
  58. }
  59. exports.launch = launch;
  60. function killAll() {
  61. return __awaiter(this, void 0, void 0, function* () {
  62. let errors = [];
  63. for (const instance of instances) {
  64. try {
  65. yield instance.kill();
  66. // only delete if kill did not error
  67. // this means erroring instances remain in the Set
  68. instances.delete(instance);
  69. }
  70. catch (err) {
  71. errors.push(err);
  72. }
  73. }
  74. return errors;
  75. });
  76. }
  77. exports.killAll = killAll;
  78. class Launcher {
  79. constructor(opts = {}, moduleOverrides = {}) {
  80. this.opts = opts;
  81. this.tmpDirandPidFileReady = false;
  82. this.fs = moduleOverrides.fs || fs;
  83. this.rimraf = moduleOverrides.rimraf || rimraf;
  84. this.spawn = moduleOverrides.spawn || spawn;
  85. log.setLevel(utils_1.defaults(this.opts.logLevel, 'silent'));
  86. // choose the first one (default)
  87. this.startingUrl = utils_1.defaults(this.opts.startingUrl, 'about:blank');
  88. this.chromeFlags = utils_1.defaults(this.opts.chromeFlags, []);
  89. this.requestedPort = utils_1.defaults(this.opts.port, 0);
  90. this.chromePath = this.opts.chromePath;
  91. this.ignoreDefaultFlags = utils_1.defaults(this.opts.ignoreDefaultFlags, false);
  92. this.connectionPollInterval = utils_1.defaults(this.opts.connectionPollInterval, 500);
  93. this.maxConnectionRetries = utils_1.defaults(this.opts.maxConnectionRetries, 50);
  94. this.envVars = utils_1.defaults(opts.envVars, Object.assign({}, process.env));
  95. if (typeof this.opts.userDataDir === 'boolean') {
  96. if (!this.opts.userDataDir) {
  97. this.useDefaultProfile = true;
  98. this.userDataDir = undefined;
  99. }
  100. else {
  101. throw new utils_1.InvalidUserDataDirectoryError();
  102. }
  103. }
  104. else {
  105. this.useDefaultProfile = false;
  106. this.userDataDir = this.opts.userDataDir;
  107. }
  108. }
  109. get flags() {
  110. const flags = this.ignoreDefaultFlags ? [] : flags_1.DEFAULT_FLAGS.slice();
  111. flags.push(`--remote-debugging-port=${this.port}`);
  112. if (!this.ignoreDefaultFlags && utils_1.getPlatform() === 'linux') {
  113. flags.push('--disable-setuid-sandbox');
  114. }
  115. if (!this.useDefaultProfile) {
  116. // Place Chrome profile in a custom location we'll rm -rf later
  117. // If in WSL, we need to use the Windows format
  118. flags.push(`--user-data-dir=${isWsl ? utils_1.toWinDirFormat(this.userDataDir) : this.userDataDir}`);
  119. }
  120. flags.push(...this.chromeFlags);
  121. flags.push(this.startingUrl);
  122. return flags;
  123. }
  124. static defaultFlags() {
  125. return flags_1.DEFAULT_FLAGS.slice();
  126. }
  127. /** Returns the highest priority chrome installation. */
  128. static getFirstInstallation() {
  129. if (utils_1.getPlatform() === 'darwin')
  130. return chromeFinder.darwinFast();
  131. return chromeFinder[utils_1.getPlatform()]()[0];
  132. }
  133. /** Returns all available chrome installations in decreasing priority order. */
  134. static getInstallations() {
  135. return chromeFinder[utils_1.getPlatform()]();
  136. }
  137. // Wrapper function to enable easy testing.
  138. makeTmpDir() {
  139. return utils_1.makeTmpDir();
  140. }
  141. prepare() {
  142. const platform = utils_1.getPlatform();
  143. if (!_SUPPORTED_PLATFORMS.has(platform)) {
  144. throw new utils_1.UnsupportedPlatformError();
  145. }
  146. this.userDataDir = this.userDataDir || this.makeTmpDir();
  147. this.outFile = this.fs.openSync(`${this.userDataDir}/chrome-out.log`, 'a');
  148. this.errFile = this.fs.openSync(`${this.userDataDir}/chrome-err.log`, 'a');
  149. // fix for Node4
  150. // you can't pass a fd to fs.writeFileSync
  151. this.pidFile = `${this.userDataDir}/chrome.pid`;
  152. log.verbose('ChromeLauncher', `created ${this.userDataDir}`);
  153. this.tmpDirandPidFileReady = true;
  154. }
  155. launch() {
  156. return __awaiter(this, void 0, void 0, function* () {
  157. if (this.requestedPort !== 0) {
  158. this.port = this.requestedPort;
  159. // If an explict port is passed first look for an open connection...
  160. try {
  161. return yield this.isDebuggerReady();
  162. }
  163. catch (err) {
  164. log.log('ChromeLauncher', `No debugging port found on port ${this.port}, launching a new Chrome.`);
  165. }
  166. }
  167. if (this.chromePath === undefined) {
  168. const installation = Launcher.getFirstInstallation();
  169. if (!installation) {
  170. throw new utils_1.ChromeNotInstalledError();
  171. }
  172. this.chromePath = installation;
  173. }
  174. if (!this.tmpDirandPidFileReady) {
  175. this.prepare();
  176. }
  177. this.pid = yield this.spawnProcess(this.chromePath);
  178. return Promise.resolve();
  179. });
  180. }
  181. spawnProcess(execPath) {
  182. return __awaiter(this, void 0, void 0, function* () {
  183. const spawnPromise = (() => __awaiter(this, void 0, void 0, function* () {
  184. if (this.chrome) {
  185. log.log('ChromeLauncher', `Chrome already running with pid ${this.chrome.pid}.`);
  186. return this.chrome.pid;
  187. }
  188. // If a zero value port is set, it means the launcher
  189. // is responsible for generating the port number.
  190. // We do this here so that we can know the port before
  191. // we pass it into chrome.
  192. if (this.requestedPort === 0) {
  193. this.port = yield random_port_1.getRandomPort();
  194. }
  195. log.verbose('ChromeLauncher', `Launching with command:\n"${execPath}" ${this.flags.join(' ')}`);
  196. const chrome = this.spawn(execPath, this.flags, { detached: true, stdio: ['ignore', this.outFile, this.errFile], env: this.envVars });
  197. this.chrome = chrome;
  198. this.fs.writeFileSync(this.pidFile, chrome.pid.toString());
  199. log.verbose('ChromeLauncher', `Chrome running with pid ${chrome.pid} on port ${this.port}.`);
  200. return chrome.pid;
  201. }))();
  202. const pid = yield spawnPromise;
  203. yield this.waitUntilReady();
  204. return pid;
  205. });
  206. }
  207. cleanup(client) {
  208. if (client) {
  209. client.removeAllListeners();
  210. client.end();
  211. client.destroy();
  212. client.unref();
  213. }
  214. }
  215. // resolves if ready, rejects otherwise
  216. isDebuggerReady() {
  217. return new Promise((resolve, reject) => {
  218. const client = net.createConnection(this.port);
  219. client.once('error', err => {
  220. this.cleanup(client);
  221. reject(err);
  222. });
  223. client.once('connect', () => {
  224. this.cleanup(client);
  225. resolve();
  226. });
  227. });
  228. }
  229. // resolves when debugger is ready, rejects after 10 polls
  230. waitUntilReady() {
  231. const launcher = this;
  232. return new Promise((resolve, reject) => {
  233. let retries = 0;
  234. let waitStatus = 'Waiting for browser.';
  235. const poll = () => {
  236. if (retries === 0) {
  237. log.log('ChromeLauncher', waitStatus);
  238. }
  239. retries++;
  240. waitStatus += '..';
  241. log.log('ChromeLauncher', waitStatus);
  242. launcher.isDebuggerReady()
  243. .then(() => {
  244. log.log('ChromeLauncher', waitStatus + `${log.greenify(log.tick)}`);
  245. resolve();
  246. })
  247. .catch(err => {
  248. if (retries > launcher.maxConnectionRetries) {
  249. log.error('ChromeLauncher', err.message);
  250. const stderr = this.fs.readFileSync(`${this.userDataDir}/chrome-err.log`, { encoding: 'utf-8' });
  251. log.error('ChromeLauncher', `Logging contents of ${this.userDataDir}/chrome-err.log`);
  252. log.error('ChromeLauncher', stderr);
  253. return reject(err);
  254. }
  255. utils_1.delay(launcher.connectionPollInterval).then(poll);
  256. });
  257. };
  258. poll();
  259. });
  260. }
  261. kill() {
  262. return new Promise((resolve, reject) => {
  263. if (this.chrome) {
  264. this.chrome.on('close', () => {
  265. delete this.chrome;
  266. this.destroyTmp().then(resolve);
  267. });
  268. log.log('ChromeLauncher', `Killing Chrome instance ${this.chrome.pid}`);
  269. try {
  270. if (isWindows) {
  271. // While pipe is the default, stderr also gets printed to process.stderr
  272. // if you don't explicitly set `stdio`
  273. execSync(`taskkill /pid ${this.chrome.pid} /T /F`, { stdio: 'pipe' });
  274. }
  275. else {
  276. process.kill(-this.chrome.pid);
  277. }
  278. }
  279. catch (err) {
  280. const message = `Chrome could not be killed ${err.message}`;
  281. log.warn('ChromeLauncher', message);
  282. reject(new Error(message));
  283. }
  284. }
  285. else {
  286. // fail silently as we did not start chrome
  287. resolve();
  288. }
  289. });
  290. }
  291. destroyTmp() {
  292. return new Promise(resolve => {
  293. // Only clean up the tmp dir if we created it.
  294. if (this.userDataDir === undefined || this.opts.userDataDir !== undefined) {
  295. return resolve();
  296. }
  297. if (this.outFile) {
  298. this.fs.closeSync(this.outFile);
  299. delete this.outFile;
  300. }
  301. if (this.errFile) {
  302. this.fs.closeSync(this.errFile);
  303. delete this.errFile;
  304. }
  305. this.rimraf(this.userDataDir, () => resolve());
  306. });
  307. }
  308. }
  309. exports.Launcher = Launcher;
  310. ;
  311. exports.default = Launcher;
  312. //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hyb21lLWxhdW5jaGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2Nocm9tZS1sYXVuY2hlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7OztHQUlHO0FBQ0gsWUFBWSxDQUFDOzs7Ozs7Ozs7Ozs7QUFFYiw4Q0FBOEM7QUFDOUMseUJBQXlCO0FBQ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