Browse Source

cleanup: Remove obsolete code related to SS extension

- Remove external install dialogs and fix related screensharing error handling.
- Remove obsolete options from config.js and from configWhitelist.js
master^2
Jaya Allamsetty 4 years ago
parent
commit
07cad2a98f

+ 12
- 91
conference.js View File

@@ -1,4 +1,4 @@
1
-/* global $, APP, JitsiMeetJS, config, interfaceConfig */
1
+/* global APP, JitsiMeetJS, config, interfaceConfig */
2 2
 
3 3
 import EventEmitter from 'events';
4 4
 import Logger from 'jitsi-meet-logger';
@@ -1642,8 +1642,6 @@ export default {
1642 1642
      * @private
1643 1643
      */
1644 1644
     _createDesktopTrack(options = {}) {
1645
-        let externalInstallation = false;
1646
-        let DSExternalInstallationInProgress = false;
1647 1645
         const didHaveVideo = !this.isLocalVideoMuted();
1648 1646
 
1649 1647
         const getDesktopStreamPromise = options.desktopStream
@@ -1652,43 +1650,7 @@ export default {
1652 1650
                 desktopSharingSourceDevice: options.desktopSharingSources
1653 1651
                     ? null : config._desktopSharingSourceDevice,
1654 1652
                 desktopSharingSources: options.desktopSharingSources,
1655
-                devices: [ 'desktop' ],
1656
-                desktopSharingExtensionExternalInstallation: {
1657
-                    interval: 500,
1658
-                    checkAgain: () => DSExternalInstallationInProgress,
1659
-                    listener: (status, url) => {
1660
-                        switch (status) {
1661
-                        case 'waitingForExtension': {
1662
-                            DSExternalInstallationInProgress = true;
1663
-                            externalInstallation = true;
1664
-                            const listener = () => {
1665
-                                // Wait a little bit more just to be sure that
1666
-                                // we won't miss the extension installation
1667
-                                setTimeout(() => {
1668
-                                    DSExternalInstallationInProgress = false;
1669
-                                },
1670
-                                500);
1671
-                                APP.UI.removeListener(
1672
-                                    UIEvents.EXTERNAL_INSTALLATION_CANCELED,
1673
-                                    listener);
1674
-                            };
1675
-
1676
-                            APP.UI.addListener(
1677
-                                UIEvents.EXTERNAL_INSTALLATION_CANCELED,
1678
-                                listener);
1679
-                            APP.UI.showExtensionExternalInstallationDialog(url);
1680
-                            break;
1681
-                        }
1682
-                        case 'extensionFound':
1683
-                            // Close the dialog.
1684
-                            externalInstallation && $.prompt.close();
1685
-                            break;
1686
-                        default:
1687
-
1688
-                            // Unknown status
1689
-                        }
1690
-                    }
1691
-                }
1653
+                devices: [ 'desktop' ]
1692 1654
             });
1693 1655
 
1694 1656
         return getDesktopStreamPromise.then(desktopStreams => {
@@ -1712,15 +1674,8 @@ export default {
1712 1674
                 );
1713 1675
             }
1714 1676
 
1715
-            // close external installation dialog on success.
1716
-            externalInstallation && $.prompt.close();
1717
-
1718 1677
             return desktopStreams;
1719 1678
         }, error => {
1720
-            DSExternalInstallationInProgress = false;
1721
-
1722
-            // close external installation dialog on success.
1723
-            externalInstallation && $.prompt.close();
1724 1679
             throw error;
1725 1680
         });
1726 1681
     },
@@ -1924,70 +1879,36 @@ export default {
1924 1879
     /**
1925 1880
      * Handles {@link JitsiTrackError} returned by the lib-jitsi-meet when
1926 1881
      * trying to create screensharing track. It will either do nothing if
1927
-     * the dialog was canceled on user's request or display inline installation
1928
-     * dialog and ask the user to install the extension, once the extension is
1929
-     * installed it will switch the conference to screensharing. The last option
1930
-     * is that an unrecoverable error dialog will be displayed.
1882
+     * the dialog was canceled on user's request or display an error if
1883
+     * screensharing couldn't be started.
1931 1884
      * @param {JitsiTrackError} error - The error returned by
1932 1885
      * {@link _createDesktopTrack} Promise.
1933 1886
      * @private
1934 1887
      */
1935 1888
     _handleScreenSharingError(error) {
1936
-        if (error.name === JitsiTrackErrors.CHROME_EXTENSION_USER_CANCELED) {
1889
+        if (error.name === JitsiTrackErrors.SCREENSHARING_USER_CANCELED) {
1937 1890
             return;
1938 1891
         }
1939 1892
 
1940 1893
         logger.error('failed to share local desktop', error);
1941 1894
 
1942
-        if (error.name
1943
-                === JitsiTrackErrors.CHROME_EXTENSION_USER_GESTURE_REQUIRED) {
1944
-            // If start with screen sharing the extension will fail to install
1945
-            // (if not found), because the request has been triggered by the
1946
-            // script. Show a dialog which asks user to click "install" and try
1947
-            // again switching to the screen sharing.
1948
-            APP.UI.showExtensionInlineInstallationDialog(
1949
-                () => {
1950
-                    // eslint-disable-next-line no-empty-function
1951
-                    this.toggleScreenSharing().catch(() => {});
1952
-                }
1953
-            );
1954
-
1955
-            return;
1956
-        }
1957
-
1958 1895
         // Handling:
1959
-        // JitsiTrackErrors.PERMISSION_DENIED
1960
-        // JitsiTrackErrors.CHROME_EXTENSION_INSTALLATION_ERROR
1961 1896
         // JitsiTrackErrors.CONSTRAINT_FAILED
1962
-        // JitsiTrackErrors.GENERAL
1897
+        // JitsiTrackErrors.PERMISSION_DENIED
1898
+        // JitsiTrackErrors.SCREENSHARING_GENERIC_ERROR
1963 1899
         // and any other
1964 1900
         let descriptionKey;
1965 1901
         let titleKey;
1966 1902
 
1967 1903
         if (error.name === JitsiTrackErrors.PERMISSION_DENIED) {
1968
-
1969
-            // in FF the only option for user is to deny access temporary or
1970
-            // permanently and we only receive permission_denied
1971
-            // we always show some info cause in case of permanently, no info
1972
-            // shown will be bad experience
1973
-            //
1974
-            // TODO: detect interval between requesting permissions and received
1975
-            // error, this way we can detect user interaction which will have
1976
-            // longer delay
1977
-            if (JitsiMeetJS.util.browser.isFirefox()) {
1978
-                descriptionKey
1979
-                    = 'dialog.screenSharingFirefoxPermissionDeniedError';
1980
-                titleKey = 'dialog.screenSharingFirefoxPermissionDeniedTitle';
1981
-            } else {
1982
-                descriptionKey = 'dialog.screenSharingPermissionDeniedError';
1983
-                titleKey = 'dialog.screenSharingFailedToInstallTitle';
1984
-            }
1904
+            descriptionKey = 'dialog.screenSharingPermissionDeniedError';
1905
+            titleKey = 'dialog.screenSharingFailedTitle';
1985 1906
         } else if (error.name === JitsiTrackErrors.CONSTRAINT_FAILED) {
1986 1907
             descriptionKey = 'dialog.cameraConstraintFailedError';
1987 1908
             titleKey = 'deviceError.cameraError';
1988
-        } else {
1989
-            descriptionKey = 'dialog.screenSharingFailedToInstall';
1990
-            titleKey = 'dialog.screenSharingFailedToInstallTitle';
1909
+        } else if (error.name === JitsiTrackErrors.SCREENSHARING_GENERIC_ERROR) {
1910
+            descriptionKey = 'dialog.screenSharingFailed';
1911
+            titleKey = 'dialog.screenSharingFailedTitle';
1991 1912
         }
1992 1913
 
1993 1914
         APP.UI.messageHandler.showError({

+ 0
- 16
config.js View File

@@ -154,22 +154,6 @@ var config = {
154 154
 
155 155
     // Desktop sharing
156 156
 
157
-    // The ID of the jidesha extension for Chrome.
158
-    desktopSharingChromeExtId: null,
159
-
160
-    // Whether desktop sharing should be disabled on Chrome.
161
-    // desktopSharingChromeDisabled: false,
162
-
163
-    // The media sources to use when using screen sharing with the Chrome
164
-    // extension.
165
-    desktopSharingChromeSources: [ 'screen', 'window', 'tab' ],
166
-
167
-    // Required version of Chrome extension
168
-    desktopSharingChromeMinExtVersion: '0.1',
169
-
170
-    // Whether desktop sharing should be disabled on Firefox.
171
-    // desktopSharingFirefoxDisabled: false,
172
-
173 157
     // Optional desktop sharing frame rate options. Default value: min:5, max:5.
174 158
     // desktopSharingFrameRate: {
175 159
     //     min: 5,

+ 3
- 10
lang/main.json View File

@@ -202,15 +202,10 @@
202 202
         "e2eeWarning": "WARNING: Not all participants in this meeting seem to have support for End-to-End encryption. If you enable it they won't be able to see nor hear you.",
203 203
         "enterDisplayName": "Please enter your name here",
204 204
         "error": "Error",
205
-        "externalInstallationMsg": "You need to install our desktop sharing extension.",
206
-        "externalInstallationTitle": "Extension required",
207
-        "goToStore": "Go to the webstore",
208 205
         "gracefulShutdown": "Our service is currently down for maintenance. Please try again later.",
209 206
         "IamHost": "I am the host",
210 207
         "incorrectRoomLockPassword": "Incorrect password",
211 208
         "incorrectPassword": "Incorrect username or password",
212
-        "inlineInstallationMsg": "You need to install our desktop sharing extension.",
213
-        "inlineInstallExtension": "Install now",
214 209
         "internalError": "Oops! Something went wrong. The following error occurred: {{error}}",
215 210
         "internalErrorTitle": "Internal error",
216 211
         "kickMessage": "You can contact {{participantDisplayName}} for more details.",
@@ -272,11 +267,9 @@
272 267
         "reservationErrorMsg": "Error code: {{code}}, message: {{msg}}",
273 268
         "retry": "Retry",
274 269
         "screenSharingAudio": "Share audio",
275
-        "screenSharingFailedToInstall": "Oops! Your screen sharing extension failed to install.",
276
-        "screenSharingFailedToInstallTitle": "Screen sharing extension failed to install",
277
-        "screenSharingFirefoxPermissionDeniedError": "Something went wrong while we were trying to share your screen. Please make sure that you have given us permission to do so.",
278
-        "screenSharingFirefoxPermissionDeniedTitle": "Oops! We weren’t able to start screen sharing!",
279
-        "screenSharingPermissionDeniedError": "Oops! Something went wrong with your screen sharing extension permissions. Please reload and try again.",
270
+        "screenSharingFailed": "Oops! Something went wrong, we weren’t able to start screen sharing!",
271
+        "screenSharingFailedTitle": "Screen sharing failed!",
272
+        "screenSharingPermissionDeniedError": "Oops! Something went wrong with your screen sharing permissions. Please reload and try again.",
280 273
         "sendPrivateMessage": "You recently received a private message. Did you intend to reply to that privately, or you want to send your message to the group?",
281 274
         "sendPrivateMessageCancel": "Send to the group",
282 275
         "sendPrivateMessageOk": "Send privately",

+ 0
- 76
modules/UI/UI.js View File

@@ -553,82 +553,6 @@ UI.getLargeVideo = function() {
553 553
     return VideoLayout.getLargeVideo();
554 554
 };
555 555
 
556
-/**
557
- * Shows "Please go to chrome webstore to install the desktop sharing extension"
558
- * 2 button dialog with buttons - cancel and go to web store.
559
- * @param url {string} the url of the extension.
560
- */
561
-UI.showExtensionExternalInstallationDialog = function(url) {
562
-    let openedWindow = null;
563
-
564
-    const submitFunction = function(e, v) {
565
-        if (v) {
566
-            e.preventDefault();
567
-            if (openedWindow === null || openedWindow.closed) {
568
-                openedWindow
569
-                    = window.open(
570
-                        url,
571
-                        'extension_store_window',
572
-                        'resizable,scrollbars=yes,status=1');
573
-            } else {
574
-                openedWindow.focus();
575
-            }
576
-        }
577
-    };
578
-
579
-    const closeFunction = function(e, v) {
580
-        if (openedWindow) {
581
-            // Ideally we would close the popup, but this does not seem to work
582
-            // on Chrome. Leaving it uncommented in case it could work
583
-            // in some version.
584
-            openedWindow.close();
585
-            openedWindow = null;
586
-        }
587
-        if (!v) {
588
-            eventEmitter.emit(UIEvents.EXTERNAL_INSTALLATION_CANCELED);
589
-        }
590
-    };
591
-
592
-    messageHandler.openTwoButtonDialog({
593
-        titleKey: 'dialog.externalInstallationTitle',
594
-        msgKey: 'dialog.externalInstallationMsg',
595
-        leftButtonKey: 'dialog.goToStore',
596
-        submitFunction,
597
-        loadedFunction: $.noop,
598
-        closeFunction
599
-    });
600
-};
601
-
602
-/**
603
- * Shows a dialog which asks user to install the extension. This one is
604
- * displayed after installation is triggered from the script, but fails because
605
- * it must be initiated by user gesture.
606
- * @param callback {function} function to be executed after user clicks
607
- * the install button - it should make another attempt to install the extension.
608
- */
609
-UI.showExtensionInlineInstallationDialog = function(callback) {
610
-    const submitFunction = function(e, v) {
611
-        if (v) {
612
-            callback();
613
-        }
614
-    };
615
-
616
-    const closeFunction = function(e, v) {
617
-        if (!v) {
618
-            eventEmitter.emit(UIEvents.EXTERNAL_INSTALLATION_CANCELED);
619
-        }
620
-    };
621
-
622
-    messageHandler.openTwoButtonDialog({
623
-        titleKey: 'dialog.externalInstallationTitle',
624
-        msgKey: 'dialog.inlineInstallationMsg',
625
-        leftButtonKey: 'dialog.inlineInstallExtension',
626
-        submitFunction,
627
-        loadedFunction: $.noop,
628
-        closeFunction
629
-    });
630
-};
631
-
632 556
 /**
633 557
  * Show shared video.
634 558
  * @param {string} id the id of the sender of the command

+ 0
- 5
react/features/base/config/configWhitelist.js View File

@@ -72,11 +72,6 @@ export default [
72 72
     'debug',
73 73
     'debugAudioLevels',
74 74
     'defaultLanguage',
75
-    'desktopSharingChromeDisabled',
76
-    'desktopSharingChromeExtId',
77
-    'desktopSharingChromeMinExtVersion',
78
-    'desktopSharingChromeSources',
79
-    'desktopSharingFirefoxDisabled',
80 75
     'desktopSharingFrameRate',
81 76
     'desktopSharingSources',
82 77
     'disable1On1Mode',

+ 0
- 2
react/features/base/tracks/functions.js View File

@@ -104,8 +104,6 @@ export function createLocalTracksF(options = {}, firePermissionPromptIsShownEven
104 104
                 {
105 105
                     cameraDeviceId,
106 106
                     constraints,
107
-                    desktopSharingExtensionExternalInstallation:
108
-                        options.desktopSharingExtensionExternalInstallation,
109 107
                     desktopSharingFrameRate,
110 108
                     desktopSharingSourceDevice:
111 109
                         options.desktopSharingSourceDevice,

+ 0
- 6
service/UI/UIEvents.js View File

@@ -53,12 +53,6 @@ export default {
53 53
      */
54 54
     LOCAL_FLIPX_CHANGED: 'UI.local_flipx_changed',
55 55
 
56
-    /**
57
-     * Notifies that the button "Cancel" is pressed on the dialog for
58
-     * external extension installation.
59
-     */
60
-    EXTERNAL_INSTALLATION_CANCELED: 'UI.external_installation_canceled',
61
-
62 56
     /**
63 57
      * Notifies that the side toolbar container has been toggled. The actual
64 58
      * event must contain the identifier of the container that has been toggled

Loading…
Cancel
Save