Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

ScreenObtainer.js 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724
  1. /* global chrome, $, alert */
  2. import JitsiTrackError from '../../JitsiTrackError';
  3. import * as JitsiTrackErrors from '../../JitsiTrackErrors';
  4. import browser from '../browser';
  5. const logger = require('jitsi-meet-logger').getLogger(__filename);
  6. const GlobalOnErrorHandler = require('../util/GlobalOnErrorHandler');
  7. /**
  8. * Indicates whether the Chrome desktop sharing extension is installed.
  9. * @type {boolean}
  10. */
  11. let chromeExtInstalled = false;
  12. /**
  13. * Indicates whether an update of the Chrome desktop sharing extension is
  14. * required.
  15. * @type {boolean}
  16. */
  17. let chromeExtUpdateRequired = false;
  18. let gumFunction = null;
  19. /**
  20. * The error returned by chrome when trying to start inline installation from
  21. * popup.
  22. */
  23. const CHROME_EXTENSION_POPUP_ERROR
  24. = 'Inline installs can not be initiated from pop-up windows.';
  25. /**
  26. * The error returned by chrome when trying to start inline installation from
  27. * iframe.
  28. */
  29. const CHROME_EXTENSION_IFRAME_ERROR
  30. = 'Chrome Web Store installations can only be started by the top frame.';
  31. /**
  32. * The error returned by chrome when trying to start inline installation
  33. * not from the "main" whitelisted site.
  34. * @type {string}
  35. */
  36. const CHROME_EXTENSION_INLINE_ERROR
  37. = 'Installs can only be initiated by one of'
  38. + ' the Chrome Web Store item\'s verified sites.';
  39. /**
  40. * The error returned by chrome when trying to start inline installation
  41. * with extension that doesn't support inline installation.
  42. *
  43. * @type {string}
  44. */
  45. const CHROME_EXTENSION_INLINE_NOT_SUPPORTED_ERROR
  46. = 'Inline installation is not supported for this item. '
  47. + 'The user will be redirected to the Chrome Web Store.';
  48. /**
  49. * The error message returned by chrome when the extension is installed.
  50. */
  51. const CHROME_NO_EXTENSION_ERROR_MSG // eslint-disable-line no-unused-vars
  52. = 'Could not establish connection. Receiving end does not exist.';
  53. /**
  54. * The error message returned by chrome when the extension install action needs
  55. * to be initiated by a user gesture.
  56. * @type {string}
  57. */
  58. const CHROME_USER_GESTURE_REQ_ERROR
  59. = 'Chrome Web Store installations can only be initated by a user gesture.';
  60. /**
  61. * The error message returned by chrome when the extension install has been
  62. * cancelled by the user.
  63. * @type {string}
  64. */
  65. const CHROME_USER_CANCEL_EXTENSION_INSTALL = 'User cancelled install';
  66. /**
  67. * Handles obtaining a stream from a screen capture on different browsers.
  68. */
  69. const ScreenObtainer = {
  70. /**
  71. * If not <tt>null</tt> it means that the initialization process is still in
  72. * progress. It is used to make desktop stream request wait and continue
  73. * after it's done.
  74. * {@type Promise|null}
  75. */
  76. intChromeExtPromise: null,
  77. obtainStream: null,
  78. /**
  79. * Initializes the function used to obtain a screen capture
  80. * (this.obtainStream).
  81. *
  82. * @param {object} options
  83. * @param {boolean} [options.desktopSharingChromeDisabled]
  84. * @param {boolean} [options.desktopSharingChromeExtId]
  85. * @param {boolean} [options.desktopSharingFirefoxDisabled]
  86. * @param {Function} gum GUM method
  87. */
  88. init(options = {
  89. desktopSharingChromeDisabled: false,
  90. desktopSharingChromeExtId: null,
  91. desktopSharingFirefoxDisabled: false
  92. }, gum) {
  93. this.options = options;
  94. gumFunction = gum;
  95. this.obtainStream = this._createObtainStreamMethod(options);
  96. if (!this.obtainStream) {
  97. logger.info('Desktop sharing disabled');
  98. }
  99. },
  100. /**
  101. * Returns a method which will be used to obtain the screen sharing stream
  102. * (based on the browser type).
  103. *
  104. * @param {object} options passed from {@link init} - check description
  105. * there
  106. * @returns {Function}
  107. * @private
  108. */
  109. _createObtainStreamMethod(options) {
  110. if (browser.isNWJS()) {
  111. return (_, onSuccess, onFailure) => {
  112. window.JitsiMeetNW.obtainDesktopStream(
  113. onSuccess,
  114. (error, constraints) => {
  115. let jitsiError;
  116. // FIXME:
  117. // This is very very dirty fix for recognising that the
  118. // user have clicked the cancel button from the Desktop
  119. // sharing pick window. The proper solution would be to
  120. // detect this in the NWJS application by checking the
  121. // streamId === "". Even better solution would be to
  122. // stop calling GUM from the NWJS app and just pass the
  123. // streamId to lib-jitsi-meet. This way the desktop
  124. // sharing implementation for NWJS and chrome extension
  125. // will be the same and lib-jitsi-meet will be able to
  126. // control the constraints, check the streamId, etc.
  127. //
  128. // I cannot find documentation about "InvalidStateError"
  129. // but this is what we are receiving from GUM when the
  130. // streamId for the desktop sharing is "".
  131. if (error && error.name === 'InvalidStateError') {
  132. jitsiError = new JitsiTrackError(
  133. JitsiTrackErrors.CHROME_EXTENSION_USER_CANCELED
  134. );
  135. } else {
  136. jitsiError = new JitsiTrackError(
  137. error, constraints, [ 'desktop' ]);
  138. }
  139. (typeof onFailure === 'function')
  140. && onFailure(jitsiError);
  141. });
  142. };
  143. } else if (browser.isElectron()) {
  144. return this.obtainScreenOnElectron;
  145. } else if (browser.isTemasysPluginUsed()) {
  146. // XXX Don't require Temasys unless it's to be used because it
  147. // doesn't run on React Native, for example.
  148. const plugin
  149. = require('./adapter.screenshare').WebRTCPlugin.plugin;
  150. if (!plugin.HasScreensharingFeature) {
  151. logger.warn(
  152. 'Screensharing not supported by this plugin version');
  153. return null;
  154. } else if (!plugin.isScreensharingAvailable) {
  155. logger.warn(
  156. 'Screensharing not available with Temasys plugin on'
  157. + ' this site');
  158. return null;
  159. }
  160. logger.info('Using Temasys plugin for desktop sharing');
  161. return obtainWebRTCScreen;
  162. } else if (browser.isChrome() || browser.isOpera()) {
  163. if (browser.isVersionLessThan('34')) {
  164. logger.info('Chrome extension not supported until ver 34');
  165. return null;
  166. } else if (options.desktopSharingChromeDisabled
  167. || options.desktopSharingChromeMethod === false
  168. || !options.desktopSharingChromeExtId) {
  169. // TODO: desktopSharingChromeMethod is deprecated, remove.
  170. return null;
  171. }
  172. logger.info('Using Chrome extension for desktop sharing');
  173. this.intChromeExtPromise
  174. = initChromeExtension(options).then(() => {
  175. this.intChromeExtPromise = null;
  176. });
  177. return this.obtainScreenFromExtension;
  178. } else if (browser.isFirefox()) {
  179. if (options.desktopSharingFirefoxDisabled) {
  180. return null;
  181. } else if (window.location.protocol === 'http:') {
  182. logger.log('Screen sharing is not supported over HTTP. '
  183. + 'Use of HTTPS is required.');
  184. return null;
  185. }
  186. return this.obtainScreenOnFirefox;
  187. }
  188. logger.log(
  189. 'Screen sharing not supported by the current browser: ',
  190. browser.getName());
  191. return null;
  192. },
  193. /**
  194. * Checks whether obtaining a screen capture is supported in the current
  195. * environment.
  196. * @returns {boolean}
  197. */
  198. isSupported() {
  199. return this.obtainStream !== null;
  200. },
  201. /**
  202. * Obtains a screen capture stream on Firefox.
  203. * @param callback
  204. * @param errorCallback
  205. */
  206. obtainScreenOnFirefox(options, callback, errorCallback) {
  207. obtainWebRTCScreen(options.gumOptions, callback, errorCallback);
  208. },
  209. /**
  210. * Obtains a screen capture stream on Electron.
  211. *
  212. * @param {Object} [options] - Screen sharing options.
  213. * @param {Array<string>} [options.desktopSharingSources] - Array with the
  214. * sources that have to be displayed in the desktop picker window ('screen',
  215. * 'window', etc.).
  216. * @param onSuccess - Success callback.
  217. * @param onFailure - Failure callback.
  218. */
  219. obtainScreenOnElectron(options = {}, onSuccess, onFailure) {
  220. if (window.JitsiMeetScreenObtainer
  221. && window.JitsiMeetScreenObtainer.openDesktopPicker) {
  222. const { desktopSharingSources, gumOptions } = options;
  223. window.JitsiMeetScreenObtainer.openDesktopPicker(
  224. {
  225. desktopSharingSources: desktopSharingSources
  226. || this.options.desktopSharingChromeSources
  227. },
  228. (streamId, streamType) =>
  229. onGetStreamResponse(
  230. {
  231. response: {
  232. streamId,
  233. streamType
  234. },
  235. gumOptions
  236. },
  237. onSuccess,
  238. onFailure
  239. ),
  240. err => onFailure(new JitsiTrackError(
  241. JitsiTrackErrors.ELECTRON_DESKTOP_PICKER_ERROR,
  242. err
  243. ))
  244. );
  245. } else {
  246. onFailure(new JitsiTrackError(
  247. JitsiTrackErrors.ELECTRON_DESKTOP_PICKER_NOT_FOUND));
  248. }
  249. },
  250. /**
  251. * Asks Chrome extension to call chooseDesktopMedia and gets chrome
  252. * 'desktop' stream for returned stream token.
  253. */
  254. obtainScreenFromExtension(options, streamCallback, failCallback) {
  255. if (this.intChromeExtPromise !== null) {
  256. this.intChromeExtPromise.then(() => {
  257. this.obtainScreenFromExtension(
  258. options, streamCallback, failCallback);
  259. });
  260. return;
  261. }
  262. const {
  263. desktopSharingChromeExtId,
  264. desktopSharingChromeSources
  265. } = this.options;
  266. const {
  267. gumOptions
  268. } = options;
  269. const doGetStreamFromExtensionOptions = {
  270. desktopSharingChromeExtId,
  271. desktopSharingChromeSources:
  272. options.desktopSharingSources || desktopSharingChromeSources,
  273. gumOptions
  274. };
  275. if (chromeExtInstalled) {
  276. doGetStreamFromExtension(
  277. doGetStreamFromExtensionOptions,
  278. streamCallback,
  279. failCallback);
  280. } else {
  281. if (chromeExtUpdateRequired) {
  282. /* eslint-disable no-alert */
  283. alert(
  284. 'Jitsi Desktop Streamer requires update. '
  285. + 'Changes will take effect after next Chrome restart.');
  286. /* eslint-enable no-alert */
  287. }
  288. // for opera there is no inline install
  289. // extension "Download Chrome Extension" allows us to open
  290. // the chrome webstore and install from there and then activate our
  291. // extension
  292. if (browser.isOpera()) {
  293. this.handleExternalInstall(options, streamCallback,
  294. failCallback);
  295. return;
  296. }
  297. try {
  298. chrome.webstore.install(
  299. getWebStoreInstallUrl(this.options),
  300. arg => {
  301. logger.log('Extension installed successfully', arg);
  302. chromeExtInstalled = true;
  303. // We need to give a moment to the endpoint to become
  304. // available.
  305. waitForExtensionAfterInstall(this.options, 200, 10)
  306. .then(() => {
  307. doGetStreamFromExtension(
  308. doGetStreamFromExtensionOptions,
  309. streamCallback,
  310. failCallback);
  311. })
  312. .catch(() => {
  313. this.handleExtensionInstallationError(options,
  314. streamCallback, failCallback);
  315. });
  316. },
  317. this.handleExtensionInstallationError.bind(this,
  318. options, streamCallback, failCallback)
  319. );
  320. } catch (e) {
  321. this.handleExtensionInstallationError(options, streamCallback,
  322. failCallback, e);
  323. }
  324. }
  325. },
  326. /* eslint-disable max-params */
  327. handleExternalInstall(options, streamCallback, failCallback, e) {
  328. const webStoreInstallUrl = getWebStoreInstallUrl(this.options);
  329. options.listener('waitingForExtension', webStoreInstallUrl);
  330. this.checkForChromeExtensionOnInterval(options, streamCallback,
  331. failCallback, e);
  332. },
  333. handleExtensionInstallationError(options, streamCallback, failCallback, e) {
  334. const webStoreInstallUrl = getWebStoreInstallUrl(this.options);
  335. if ((CHROME_EXTENSION_POPUP_ERROR === e
  336. || CHROME_EXTENSION_IFRAME_ERROR === e
  337. || CHROME_EXTENSION_INLINE_ERROR === e
  338. || CHROME_EXTENSION_INLINE_NOT_SUPPORTED_ERROR === e)
  339. && options.interval > 0
  340. && typeof options.checkAgain === 'function'
  341. && typeof options.listener === 'function') {
  342. this.handleExternalInstall(options, streamCallback,
  343. failCallback, e);
  344. return;
  345. }
  346. const msg
  347. = `Failed to install the extension from ${webStoreInstallUrl}`;
  348. logger.log(msg, e);
  349. let error;
  350. if (e === CHROME_USER_CANCEL_EXTENSION_INSTALL) {
  351. error = JitsiTrackErrors.CHROME_EXTENSION_USER_CANCELED;
  352. } else if (e === CHROME_USER_GESTURE_REQ_ERROR) {
  353. error = JitsiTrackErrors.CHROME_EXTENSION_USER_GESTURE_REQUIRED;
  354. } else {
  355. error = JitsiTrackErrors.CHROME_EXTENSION_INSTALLATION_ERROR;
  356. }
  357. failCallback(new JitsiTrackError(error, msg));
  358. },
  359. /* eslint-enable max-params */
  360. checkForChromeExtensionOnInterval(options, streamCallback, failCallback) {
  361. if (options.checkAgain() === false) {
  362. failCallback(new JitsiTrackError(
  363. JitsiTrackErrors.CHROME_EXTENSION_INSTALLATION_ERROR));
  364. return;
  365. }
  366. waitForExtensionAfterInstall(this.options, options.interval, 1)
  367. .then(() => {
  368. chromeExtInstalled = true;
  369. options.listener('extensionFound');
  370. this.obtainScreenFromExtension(options,
  371. streamCallback, failCallback);
  372. })
  373. .catch(() => {
  374. this.checkForChromeExtensionOnInterval(options,
  375. streamCallback, failCallback);
  376. });
  377. }
  378. };
  379. /**
  380. * Obtains a desktop stream using getUserMedia.
  381. * For this to work on Chrome, the
  382. * 'chrome://flags/#enable-usermedia-screen-capture' flag must be enabled.
  383. *
  384. * On firefox, the document's domain must be white-listed in the
  385. * 'media.getusermedia.screensharing.allowed_domains' preference in
  386. * 'about:config'.
  387. */
  388. function obtainWebRTCScreen(options, streamCallback, failCallback) {
  389. gumFunction(
  390. [ 'screen' ],
  391. stream => streamCallback({ stream }),
  392. failCallback,
  393. options
  394. );
  395. }
  396. /**
  397. * Constructs inline install URL for Chrome desktop streaming extension.
  398. * The 'chromeExtensionId' must be defined in options parameter.
  399. * @param options supports "desktopSharingChromeExtId"
  400. * @returns {string}
  401. */
  402. function getWebStoreInstallUrl(options) {
  403. return (
  404. `https://chrome.google.com/webstore/detail/${
  405. options.desktopSharingChromeExtId}`);
  406. }
  407. /**
  408. * Checks whether an update of the Chrome extension is required.
  409. * @param minVersion minimal required version
  410. * @param extVersion current extension version
  411. * @returns {boolean}
  412. */
  413. function isUpdateRequired(minVersion, extVersion) {
  414. try {
  415. const s1 = minVersion.split('.');
  416. const s2 = extVersion.split('.');
  417. const len = Math.max(s1.length, s2.length);
  418. for (let i = 0; i < len; i++) {
  419. let n1 = 0,
  420. n2 = 0;
  421. if (i < s1.length) {
  422. n1 = parseInt(s1[i], 10);
  423. }
  424. if (i < s2.length) {
  425. n2 = parseInt(s2[i], 10);
  426. }
  427. if (isNaN(n1) || isNaN(n2)) {
  428. return true;
  429. } else if (n1 !== n2) {
  430. return n1 > n2;
  431. }
  432. }
  433. // will happen if both versions have identical numbers in
  434. // their components (even if one of them is longer, has more components)
  435. return false;
  436. } catch (e) {
  437. GlobalOnErrorHandler.callErrorHandler(e);
  438. logger.error('Failed to parse extension version', e);
  439. return true;
  440. }
  441. }
  442. /**
  443. *
  444. * @param callback
  445. * @param options
  446. */
  447. function checkChromeExtInstalled(callback, options) {
  448. if (typeof chrome === 'undefined' || !chrome || !chrome.runtime) {
  449. // No API, so no extension for sure
  450. callback(false, false);
  451. return;
  452. }
  453. chrome.runtime.sendMessage(
  454. options.desktopSharingChromeExtId,
  455. { getVersion: true },
  456. response => {
  457. if (!response || !response.version) {
  458. // Communication failure - assume that no endpoint exists
  459. logger.warn(
  460. 'Extension not installed?: ', chrome.runtime.lastError);
  461. callback(false, false);
  462. return;
  463. }
  464. // Check installed extension version
  465. const extVersion = response.version;
  466. logger.log(`Extension version is: ${extVersion}`);
  467. const updateRequired
  468. = isUpdateRequired(
  469. options.desktopSharingChromeMinExtVersion,
  470. extVersion);
  471. callback(!updateRequired, updateRequired);
  472. }
  473. );
  474. }
  475. /**
  476. *
  477. * @param options
  478. * @param streamCallback
  479. * @param failCallback
  480. */
  481. function doGetStreamFromExtension(options, streamCallback, failCallback) {
  482. const {
  483. desktopSharingChromeSources,
  484. desktopSharingChromeExtId,
  485. gumOptions
  486. } = options;
  487. // Sends 'getStream' msg to the extension.
  488. // Extension id must be defined in the config.
  489. chrome.runtime.sendMessage(
  490. desktopSharingChromeExtId,
  491. {
  492. getStream: true,
  493. sources: desktopSharingChromeSources
  494. },
  495. response => {
  496. if (!response) {
  497. // possibly re-wraping error message to make code consistent
  498. const lastError = chrome.runtime.lastError;
  499. failCallback(lastError instanceof Error
  500. ? lastError
  501. : new JitsiTrackError(
  502. JitsiTrackErrors.CHROME_EXTENSION_GENERIC_ERROR,
  503. lastError));
  504. return;
  505. }
  506. logger.log('Response from extension: ', response);
  507. onGetStreamResponse(
  508. {
  509. response,
  510. gumOptions
  511. },
  512. streamCallback,
  513. failCallback
  514. );
  515. }
  516. );
  517. }
  518. /**
  519. * Initializes <link rel=chrome-webstore-item /> with extension id set in
  520. * config.js to support inline installs. Host site must be selected as main
  521. * website of published extension.
  522. * @param options supports "desktopSharingChromeExtId"
  523. */
  524. function initInlineInstalls(options) {
  525. if ($('link[rel=chrome-webstore-item]').length === 0) {
  526. $('head').append('<link rel="chrome-webstore-item">');
  527. }
  528. $('link[rel=chrome-webstore-item]').attr('href',
  529. getWebStoreInstallUrl(options));
  530. }
  531. /**
  532. *
  533. * @param options
  534. *
  535. * @return {Promise} - a Promise resolved once the initialization process is
  536. * finished.
  537. */
  538. function initChromeExtension(options) {
  539. // Initialize Chrome extension inline installs
  540. initInlineInstalls(options);
  541. return new Promise(resolve => {
  542. // Check if extension is installed
  543. checkChromeExtInstalled((installed, updateRequired) => {
  544. chromeExtInstalled = installed;
  545. chromeExtUpdateRequired = updateRequired;
  546. logger.info(
  547. `Chrome extension installed: ${
  548. chromeExtInstalled} updateRequired: ${
  549. chromeExtUpdateRequired}`);
  550. resolve();
  551. }, options);
  552. });
  553. }
  554. /**
  555. * Checks "retries" times on every "waitInterval"ms whether the ext is alive.
  556. * @param {Object} options the options passed to ScreanObtainer.obtainStream
  557. * @param {int} waitInterval the number of ms between retries
  558. * @param {int} retries the number of retries
  559. * @returns {Promise} returns promise that will be resolved when the extension
  560. * is alive and rejected if the extension is not alive even after "retries"
  561. * checks
  562. */
  563. function waitForExtensionAfterInstall(options, waitInterval, retries) {
  564. if (retries === 0) {
  565. return Promise.reject();
  566. }
  567. return new Promise((resolve, reject) => {
  568. let currentRetries = retries;
  569. const interval = window.setInterval(() => {
  570. checkChromeExtInstalled(installed => {
  571. if (installed) {
  572. window.clearInterval(interval);
  573. resolve();
  574. } else {
  575. currentRetries--;
  576. if (currentRetries === 0) {
  577. reject();
  578. window.clearInterval(interval);
  579. }
  580. }
  581. }, options);
  582. }, waitInterval);
  583. });
  584. }
  585. /**
  586. * Handles response from external application / extension and calls GUM to
  587. * receive the desktop streams or reports error.
  588. * @param {object} options
  589. * @param {object} options.response
  590. * @param {string} options.response.streamId - the streamId for the desktop
  591. * stream.
  592. * @param {string} options.response.error - error to be reported.
  593. * @param {object} options.gumOptions - options passed to GUM.
  594. * @param {Function} onSuccess - callback for success.
  595. * @param {Function} onFailure - callback for failure.
  596. * @param {object} gumOptions - options passed to GUM.
  597. */
  598. function onGetStreamResponse(
  599. options = {
  600. response: {},
  601. gumOptions: {}
  602. },
  603. onSuccess,
  604. onFailure) {
  605. const { streamId, streamType, error } = options.response || {};
  606. if (streamId) {
  607. gumFunction(
  608. [ 'desktop' ],
  609. stream => onSuccess({
  610. stream,
  611. sourceId: streamId,
  612. sourceType: streamType
  613. }),
  614. onFailure,
  615. {
  616. desktopStream: streamId,
  617. ...options.gumOptions
  618. });
  619. } else {
  620. // As noted in Chrome Desktop Capture API:
  621. // If user didn't select any source (i.e. canceled the prompt)
  622. // then the callback is called with an empty streamId.
  623. if (streamId === '') {
  624. onFailure(new JitsiTrackError(
  625. JitsiTrackErrors.CHROME_EXTENSION_USER_CANCELED));
  626. return;
  627. }
  628. onFailure(new JitsiTrackError(
  629. JitsiTrackErrors.CHROME_EXTENSION_GENERIC_ERROR,
  630. error));
  631. }
  632. }
  633. export default ScreenObtainer;