您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

external_api.js 23KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754
  1. import EventEmitter from 'events';
  2. import { urlObjectToString } from '../../../react/features/base/util/uri';
  3. import {
  4. PostMessageTransportBackend,
  5. Transport
  6. } from '../../transport';
  7. import electronPopupsConfig from './electronPopupsConfig.json';
  8. const logger = require('jitsi-meet-logger').getLogger(__filename);
  9. const ALWAYS_ON_TOP_FILENAMES = [
  10. 'css/all.css', 'libs/alwaysontop.min.js'
  11. ];
  12. /**
  13. * Maps the names of the commands expected by the API with the name of the
  14. * commands expected by jitsi-meet
  15. */
  16. const commands = {
  17. avatarUrl: 'avatar-url',
  18. displayName: 'display-name',
  19. email: 'email',
  20. hangup: 'video-hangup',
  21. submitFeedback: 'submit-feedback',
  22. toggleAudio: 'toggle-audio',
  23. toggleChat: 'toggle-chat',
  24. toggleFilmStrip: 'toggle-film-strip',
  25. toggleShareScreen: 'toggle-share-screen',
  26. toggleVideo: 'toggle-video'
  27. };
  28. /**
  29. * Maps the names of the events expected by the API with the name of the
  30. * events expected by jitsi-meet
  31. */
  32. const events = {
  33. 'avatar-changed': 'avatarChanged',
  34. 'audio-availability-changed': 'audioAvailabilityChanged',
  35. 'audio-mute-status-changed': 'audioMuteStatusChanged',
  36. 'display-name-change': 'displayNameChange',
  37. 'email-change': 'emailChange',
  38. 'feedback-submitted': 'feedbackSubmitted',
  39. 'incoming-message': 'incomingMessage',
  40. 'outgoing-message': 'outgoingMessage',
  41. 'participant-joined': 'participantJoined',
  42. 'participant-left': 'participantLeft',
  43. 'video-ready-to-close': 'readyToClose',
  44. 'video-conference-joined': 'videoConferenceJoined',
  45. 'video-conference-left': 'videoConferenceLeft',
  46. 'video-availability-changed': 'videoAvailabilityChanged',
  47. 'video-mute-status-changed': 'videoMuteStatusChanged',
  48. 'screen-sharing-status-changed': 'screenSharingStatusChanged'
  49. };
  50. /**
  51. * Last id of api object
  52. * @type {number}
  53. */
  54. let id = 0;
  55. /**
  56. * Adds given number to the numberOfParticipants property of given APIInstance.
  57. *
  58. * @param {JitsiMeetExternalAPI} APIInstance - The instance of the API.
  59. * @param {int} number - The number of participants to be added to
  60. * numberOfParticipants property (this parameter can be negative number if the
  61. * numberOfParticipants should be decreased).
  62. * @returns {void}
  63. */
  64. function changeParticipantNumber(APIInstance, number) {
  65. APIInstance._numberOfParticipants += number;
  66. }
  67. /**
  68. * Generates the URL for the iframe.
  69. *
  70. * @param {string} domain - The domain name of the server that hosts the
  71. * conference.
  72. * @param {string} [options] - Another optional parameters.
  73. * @param {Object} [options.configOverwrite] - Object containing configuration
  74. * options defined in config.js to be overridden.
  75. * @param {Object} [options.interfaceConfigOverwrite] - Object containing
  76. * configuration options defined in interface_config.js to be overridden.
  77. * @param {string} [options.jwt] - The JWT token if needed by jitsi-meet for
  78. * authentication.
  79. * @param {boolean} [options.noSSL] - If the value is true https won't be used.
  80. * @param {string} [options.roomName] - The name of the room to join.
  81. * @returns {string} The URL.
  82. */
  83. function generateURL(domain, options = {}) {
  84. return urlObjectToString({
  85. ...options,
  86. url:
  87. `${options.noSSL ? 'http' : 'https'}://${
  88. domain}/#jitsi_meet_external_api_id=${id}`
  89. });
  90. }
  91. /**
  92. * Parses the arguments passed to the constructor. If the old format is used
  93. * the function translates the arguments to the new format.
  94. *
  95. * @param {Array} args - The arguments to be parsed.
  96. * @returns {Object} JS object with properties.
  97. */
  98. function parseArguments(args) {
  99. if (!args.length) {
  100. return {};
  101. }
  102. const firstArg = args[0];
  103. switch (typeof firstArg) {
  104. case 'string': // old arguments format
  105. case undefined: {
  106. // Not sure which format but we are trying to parse the old
  107. // format because if the new format is used everything will be undefined
  108. // anyway.
  109. const [
  110. roomName,
  111. width,
  112. height,
  113. parentNode,
  114. configOverwrite,
  115. interfaceConfigOverwrite,
  116. noSSL,
  117. jwt,
  118. onload
  119. ] = args;
  120. return {
  121. roomName,
  122. width,
  123. height,
  124. parentNode,
  125. configOverwrite,
  126. interfaceConfigOverwrite,
  127. noSSL,
  128. jwt,
  129. onload
  130. };
  131. }
  132. case 'object': // new arguments format
  133. return args[0];
  134. default:
  135. throw new Error('Can\'t parse the arguments!');
  136. }
  137. }
  138. /**
  139. * Compute valid values for height and width. If a number is specified it's
  140. * treated as pixel units. If the value is expressed in px, em, pt or
  141. * percentage, it's used as is.
  142. *
  143. * @param {any} value - The value to be parsed.
  144. * @returns {string|undefined} The parsed value that can be used for setting
  145. * sizes through the style property. If invalid value is passed the method
  146. * retuns undefined.
  147. */
  148. function parseSizeParam(value) {
  149. let parsedValue;
  150. // This regex parses values of the form 100px, 100em, 100pt or 100%.
  151. // Values like 100 or 100px are handled outside of the regex, and
  152. // invalid values will be ignored and the minimum will be used.
  153. const re = /([0-9]*\.?[0-9]+)(em|pt|px|%)$/;
  154. if (typeof value === 'string' && String(value).match(re) !== null) {
  155. parsedValue = value;
  156. } else if (typeof value === 'number') {
  157. parsedValue = `${value}px`;
  158. }
  159. return parsedValue;
  160. }
  161. /**
  162. * The IFrame API interface class.
  163. */
  164. export default class JitsiMeetExternalAPI extends EventEmitter {
  165. /**
  166. * Constructs new API instance. Creates iframe and loads Jitsi Meet in it.
  167. *
  168. * @param {string} domain - The domain name of the server that hosts the
  169. * conference.
  170. * @param {Object} [options] - Optional arguments.
  171. * @param {string} [options.roomName] - The name of the room to join.
  172. * @param {number|string} [options.width] - Width of the iframe. Check
  173. * parseSizeParam for format details.
  174. * @param {number|string} [options.height] - Height of the iframe. Check
  175. * parseSizeParam for format details.
  176. * @param {DOMElement} [options.parentNode] - The node that will contain the
  177. * iframe.
  178. * @param {Object} [options.configOverwrite] - Object containing
  179. * configuration options defined in config.js to be overridden.
  180. * @param {Object} [options.interfaceConfigOverwrite] - Object containing
  181. * configuration options defined in interface_config.js to be overridden.
  182. * @param {boolean} [options.noSSL] - If the value is true https won't be
  183. * used.
  184. * @param {string} [options.jwt] - The JWT token if needed by jitsi-meet for
  185. * authentication.
  186. * @param {string} [options.onload] - The onload function that will listen
  187. * for iframe onload event.
  188. * @param {Array<Object>} [options.invitees] - Array of objects containing
  189. * information about new participants that will be invited in the call.
  190. */
  191. constructor(domain, ...args) {
  192. super();
  193. const {
  194. roomName = '',
  195. width = '100%',
  196. height = '100%',
  197. parentNode = document.body,
  198. configOverwrite = {},
  199. interfaceConfigOverwrite = {},
  200. noSSL = false,
  201. jwt = undefined,
  202. onload = undefined,
  203. invitees
  204. } = parseArguments(args);
  205. this._parentNode = parentNode;
  206. this._url = generateURL(domain, {
  207. configOverwrite,
  208. interfaceConfigOverwrite,
  209. jwt,
  210. noSSL,
  211. roomName
  212. });
  213. this._createIFrame(height, width, onload);
  214. this._transport = new Transport({
  215. backend: new PostMessageTransportBackend({
  216. postisOptions: {
  217. scope: `jitsi_meet_external_api_${id}`,
  218. window: this._frame.contentWindow
  219. }
  220. })
  221. });
  222. if (Array.isArray(invitees) && invitees.length > 0) {
  223. this.invite(invitees);
  224. }
  225. this._isLargeVideoVisible = true;
  226. this._numberOfParticipants = 0;
  227. this._participants = {};
  228. this._myUserID = undefined;
  229. this._onStageParticipant = undefined;
  230. this._setupListeners();
  231. id++;
  232. }
  233. /**
  234. * Creates the iframe element.
  235. *
  236. * @param {number|string} height - The height of the iframe. Check
  237. * parseSizeParam for format details.
  238. * @param {number|string} width - The with of the iframe. Check
  239. * parseSizeParam for format details.
  240. * @param {Function} onload - The function that will listen
  241. * for onload event.
  242. * @returns {void}
  243. *
  244. * @private
  245. */
  246. _createIFrame(height, width, onload) {
  247. const frameName = `jitsiConferenceFrame${id}`;
  248. this._frame = document.createElement('iframe');
  249. this._frame.allow = 'camera; microphone';
  250. this._frame.src = this._url;
  251. this._frame.name = frameName;
  252. this._frame.id = frameName;
  253. this._setSize(height, width);
  254. this._frame.setAttribute('allowFullScreen', 'true');
  255. this._frame.style.border = 0;
  256. if (onload) {
  257. // waits for iframe resources to load
  258. // and fires event when it is done
  259. this._frame.onload = onload;
  260. }
  261. this._frame = this._parentNode.appendChild(this._frame);
  262. }
  263. /**
  264. * Returns arrays with the all resources for the always on top feature.
  265. *
  266. * @returns {Array<string>}
  267. */
  268. _getAlwaysOnTopResources() {
  269. const iframeWindow = this._frame.contentWindow;
  270. const iframeDocument = iframeWindow.document;
  271. let baseURL = '';
  272. const base = iframeDocument.querySelector('base');
  273. if (base && base.href) {
  274. baseURL = base.href;
  275. } else {
  276. const { protocol, host } = iframeWindow.location;
  277. baseURL = `${protocol}//${host}`;
  278. }
  279. return ALWAYS_ON_TOP_FILENAMES.map(
  280. filename => (new URL(filename, baseURL)).href
  281. );
  282. }
  283. /**
  284. * Returns the id of the on stage participant.
  285. *
  286. * @returns {string} - The id of the on stage participant.
  287. */
  288. _getOnStageParticipant() {
  289. return this._onStageParticipant;
  290. }
  291. /**
  292. * Getter for the large video element in Jitsi Meet.
  293. *
  294. * @returns {HTMLElement|undefined} - The large video.
  295. */
  296. _getLargeVideo() {
  297. const iframe = this.getIFrame();
  298. if (!this._isLargeVideoVisible
  299. || !iframe
  300. || !iframe.contentWindow
  301. || !iframe.contentWindow.document) {
  302. return;
  303. }
  304. return iframe.contentWindow.document.getElementById('largeVideo');
  305. }
  306. /**
  307. * Sets the size of the iframe element.
  308. *
  309. * @param {number|string} height - The height of the iframe.
  310. * @param {number|string} width - The with of the iframe.
  311. * @returns {void}
  312. *
  313. * @private
  314. */
  315. _setSize(height, width) {
  316. const parsedHeight = parseSizeParam(height);
  317. const parsedWidth = parseSizeParam(width);
  318. if (parsedHeight !== undefined) {
  319. this._frame.style.height = parsedHeight;
  320. }
  321. if (parsedWidth !== undefined) {
  322. this._frame.style.width = parsedWidth;
  323. }
  324. }
  325. /**
  326. * Setups listeners that are used internally for JitsiMeetExternalAPI.
  327. *
  328. * @returns {void}
  329. *
  330. * @private
  331. */
  332. _setupListeners() {
  333. this._transport.on('event', ({ name, ...data }) => {
  334. const userID = data.id;
  335. switch (name) {
  336. case 'video-conference-joined':
  337. this._myUserID = userID;
  338. this._participants[userID] = {
  339. avatarURL: data.avatarURL
  340. };
  341. // eslint-disable-next-line no-fallthrough
  342. case 'participant-joined': {
  343. this._participants[userID] = this._participants[userID] || {};
  344. this._participants[userID].displayName = data.displayName;
  345. this._participants[userID].formattedDisplayName
  346. = data.formattedDisplayName;
  347. changeParticipantNumber(this, 1);
  348. break;
  349. }
  350. case 'participant-left':
  351. changeParticipantNumber(this, -1);
  352. delete this._participants[userID];
  353. break;
  354. case 'display-name-change': {
  355. const user = this._participants[userID];
  356. if (user) {
  357. user.displayName = data.displayname;
  358. user.formattedDisplayName = data.formattedDisplayName;
  359. }
  360. break;
  361. }
  362. case 'email-change': {
  363. const user = this._participants[userID];
  364. if (user) {
  365. user.email = data.email;
  366. }
  367. break;
  368. }
  369. case 'avatar-changed': {
  370. const user = this._participants[userID];
  371. if (user) {
  372. user.avatarURL = data.avatarURL;
  373. }
  374. break;
  375. }
  376. case 'on-stage-participant-changed':
  377. this._onStageParticipant = userID;
  378. this.emit('largeVideoChanged');
  379. break;
  380. case 'large-video-visibility-changed':
  381. this._isLargeVideoVisible = data.isVisible;
  382. this.emit('largeVideoChanged');
  383. break;
  384. case 'video-conference-left':
  385. changeParticipantNumber(this, -1);
  386. delete this._participants[this._myUserID];
  387. break;
  388. }
  389. const eventName = events[name];
  390. if (eventName) {
  391. this.emit(eventName, data);
  392. return true;
  393. }
  394. return false;
  395. });
  396. }
  397. /**
  398. * Adds event listener to Meet Jitsi.
  399. *
  400. * @param {string} event - The name of the event.
  401. * @param {Function} listener - The listener.
  402. * @returns {void}
  403. *
  404. * @deprecated
  405. * NOTE: This method is not removed for backward comatability purposes.
  406. */
  407. addEventListener(event, listener) {
  408. this.on(event, listener);
  409. }
  410. /**
  411. * Adds event listeners to Meet Jitsi.
  412. *
  413. * @param {Object} listeners - The object key should be the name of
  414. * the event and value - the listener.
  415. * Currently we support the following
  416. * events:
  417. * incomingMessage - receives event notifications about incoming
  418. * messages. The listener will receive object with the following structure:
  419. * {{
  420. * 'from': from,//JID of the user that sent the message
  421. * 'nick': nick,//the nickname of the user that sent the message
  422. * 'message': txt//the text of the message
  423. * }}
  424. * outgoingMessage - receives event notifications about outgoing
  425. * messages. The listener will receive object with the following structure:
  426. * {{
  427. * 'message': txt//the text of the message
  428. * }}
  429. * displayNameChanged - receives event notifications about display name
  430. * change. The listener will receive object with the following structure:
  431. * {{
  432. * jid: jid,//the JID of the participant that changed his display name
  433. * displayname: displayName //the new display name
  434. * }}
  435. * participantJoined - receives event notifications about new participant.
  436. * The listener will receive object with the following structure:
  437. * {{
  438. * jid: jid //the jid of the participant
  439. * }}
  440. * participantLeft - receives event notifications about the participant that
  441. * left the room.
  442. * The listener will receive object with the following structure:
  443. * {{
  444. * jid: jid //the jid of the participant
  445. * }}
  446. * video-conference-joined - receives event notifications about the local
  447. * user has successfully joined the video conference.
  448. * The listener will receive object with the following structure:
  449. * {{
  450. * roomName: room //the room name of the conference
  451. * }}
  452. * video-conference-left - receives event notifications about the local user
  453. * has left the video conference.
  454. * The listener will receive object with the following structure:
  455. * {{
  456. * roomName: room //the room name of the conference
  457. * }}
  458. * screenSharingStatusChanged - receives event notifications about
  459. * turning on/off the local user screen sharing.
  460. * The listener will receive object with the following structure:
  461. * {{
  462. * on: on //whether screen sharing is on
  463. * }}
  464. * readyToClose - all hangup operations are completed and Jitsi Meet is
  465. * ready to be disposed.
  466. * @returns {void}
  467. *
  468. * @deprecated
  469. * NOTE: This method is not removed for backward comatability purposes.
  470. */
  471. addEventListeners(listeners) {
  472. for (const event in listeners) { // eslint-disable-line guard-for-in
  473. this.addEventListener(event, listeners[event]);
  474. }
  475. }
  476. /**
  477. * Removes the listeners and removes the Jitsi Meet frame.
  478. *
  479. * @returns {void}
  480. */
  481. dispose() {
  482. this._transport.dispose();
  483. this.removeAllListeners();
  484. if (this._frame) {
  485. this._frame.parentNode.removeChild(this._frame);
  486. }
  487. }
  488. /**
  489. * Executes command. The available commands are:
  490. * displayName - sets the display name of the local participant to the value
  491. * passed in the arguments array.
  492. * toggleAudio - mutes / unmutes audio with no arguments.
  493. * toggleVideo - mutes / unmutes video with no arguments.
  494. * toggleFilmStrip - hides / shows the filmstrip with no arguments.
  495. * If the command doesn't require any arguments the parameter should be set
  496. * to empty array or it may be omitted.
  497. *
  498. * @param {string} name - The name of the command.
  499. * @returns {void}
  500. */
  501. executeCommand(name, ...args) {
  502. if (!(name in commands)) {
  503. logger.error('Not supported command name.');
  504. return;
  505. }
  506. this._transport.sendEvent({
  507. data: args,
  508. name: commands[name]
  509. });
  510. }
  511. /**
  512. * Executes commands. The available commands are:
  513. * displayName - sets the display name of the local participant to the value
  514. * passed in the arguments array.
  515. * toggleAudio - mutes / unmutes audio. no arguments
  516. * toggleVideo - mutes / unmutes video. no arguments
  517. * toggleFilmStrip - hides / shows the filmstrip. no arguments
  518. * toggleChat - hides / shows chat. no arguments.
  519. * toggleShareScreen - starts / stops screen sharing. no arguments.
  520. *
  521. * @param {Object} commandList - The object with commands to be executed.
  522. * The keys of the object are the commands that will be executed and the
  523. * values are the arguments for the command.
  524. * @returns {void}
  525. */
  526. executeCommands(commandList) {
  527. for (const key in commandList) { // eslint-disable-line guard-for-in
  528. this.executeCommand(key, commandList[key]);
  529. }
  530. }
  531. /**
  532. * Check if the audio is available.
  533. *
  534. * @returns {Promise} - Resolves with true if the audio available, with
  535. * false if not and rejects on failure.
  536. */
  537. isAudioAvailable() {
  538. return this._transport.sendRequest({
  539. name: 'is-audio-available'
  540. });
  541. }
  542. /**
  543. * Invite people to the call.
  544. *
  545. * @param {Array<Object>} invitees - The invitees.
  546. * @returns {Promise} - Resolves on success and rejects on failure.
  547. */
  548. invite(invitees) {
  549. if (!Array.isArray(invitees) || invitees.length === 0) {
  550. return Promise.reject(new TypeError('Invalid Argument'));
  551. }
  552. return this._transport.sendRequest({
  553. name: 'invite',
  554. invitees
  555. });
  556. }
  557. /**
  558. * Returns the audio mute status.
  559. *
  560. * @returns {Promise} - Resolves with the audio mute status and rejects on
  561. * failure.
  562. */
  563. isAudioMuted() {
  564. return this._transport.sendRequest({
  565. name: 'is-audio-muted'
  566. });
  567. }
  568. /**
  569. * Returns the avatar URL of a participant.
  570. *
  571. * @param {string} participantId - The id of the participant.
  572. * @returns {string} The avatar URL.
  573. */
  574. getAvatarURL(participantId) {
  575. const { avatarURL } = this._participants[participantId] || {};
  576. return avatarURL;
  577. }
  578. /**
  579. * Returns the display name of a participant.
  580. *
  581. * @param {string} participantId - The id of the participant.
  582. * @returns {string} The display name.
  583. */
  584. getDisplayName(participantId) {
  585. const { displayName } = this._participants[participantId] || {};
  586. return displayName;
  587. }
  588. /**
  589. * Returns the email of a participant.
  590. *
  591. * @param {string} participantId - The id of the participant.
  592. * @returns {string} The email.
  593. */
  594. getEmail(participantId) {
  595. const { email } = this._participants[participantId] || {};
  596. return email;
  597. }
  598. /**
  599. * Returns the formatted display name of a participant.
  600. *
  601. * @param {string} participantId - The id of the participant.
  602. * @returns {string} The formatted display name.
  603. */
  604. _getFormattedDisplayName(participantId) {
  605. const { formattedDisplayName }
  606. = this._participants[participantId] || {};
  607. return formattedDisplayName;
  608. }
  609. /**
  610. * Returns the iframe that loads Jitsi Meet.
  611. *
  612. * @returns {HTMLElement} The iframe.
  613. */
  614. getIFrame() {
  615. return this._frame;
  616. }
  617. /**
  618. * Returns the number of participants in the conference. The local
  619. * participant is included.
  620. *
  621. * @returns {int} The number of participants in the conference.
  622. */
  623. getNumberOfParticipants() {
  624. return this._numberOfParticipants;
  625. }
  626. /**
  627. * Check if the video is available.
  628. *
  629. * @returns {Promise} - Resolves with true if the video available, with
  630. * false if not and rejects on failure.
  631. */
  632. isVideoAvailable() {
  633. return this._transport.sendRequest({
  634. name: 'is-video-available'
  635. });
  636. }
  637. /**
  638. * Returns the audio mute status.
  639. *
  640. * @returns {Promise} - Resolves with the audio mute status and rejects on
  641. * failure.
  642. */
  643. isVideoMuted() {
  644. return this._transport.sendRequest({
  645. name: 'is-video-muted'
  646. });
  647. }
  648. /**
  649. * Removes event listener.
  650. *
  651. * @param {string} event - The name of the event.
  652. * @returns {void}
  653. *
  654. * @deprecated
  655. * NOTE: This method is not removed for backward comatability purposes.
  656. */
  657. removeEventListener(event) {
  658. this.removeAllListeners(event);
  659. }
  660. /**
  661. * Removes event listeners.
  662. *
  663. * @param {Array<string>} eventList - Array with the names of the events.
  664. * @returns {void}
  665. *
  666. * @deprecated
  667. * NOTE: This method is not removed for backward comatability purposes.
  668. */
  669. removeEventListeners(eventList) {
  670. eventList.forEach(event => this.removeEventListener(event));
  671. }
  672. /**
  673. * Returns the configuration for electron for the windows that are open
  674. * from Jitsi Meet.
  675. *
  676. * @returns {Promise<Object>}
  677. *
  678. * NOTE: For internal use only.
  679. */
  680. _getElectronPopupsConfig() {
  681. return Promise.resolve(electronPopupsConfig);
  682. }
  683. }