Selaa lähdekoodia

fix(screen_sharing): Detection for external install of plugin from iframe

dev1
hristoterezov 8 vuotta sitten
vanhempi
commit
d403a25c56
1 muutettua tiedostoa jossa 9 lisäystä ja 1 poistoa
  1. 9
    1
      modules/RTC/ScreenObtainer.js

+ 9
- 1
modules/RTC/ScreenObtainer.js Näytä tiedosto

42
 const CHROME_EXTENSION_POPUP_ERROR
42
 const CHROME_EXTENSION_POPUP_ERROR
43
     = "Inline installs can not be initiated from pop-up windows.";
43
     = "Inline installs can not be initiated from pop-up windows.";
44
 
44
 
45
+/**
46
+ * The error returned by chrome when trying to start inline installation from
47
+ * iframe.
48
+ */
49
+const CHROME_EXTENSION_IFRAME_ERROR
50
+    = "Chrome Web Store installations can only be started by the top frame.";
51
+
45
 /**
52
 /**
46
  * The error message returned by chrome when the extension is installed.
53
  * The error message returned by chrome when the extension is installed.
47
  */
54
  */
266
     handleExtensionInstallationError(options, streamCallback, failCallback, e) {
273
     handleExtensionInstallationError(options, streamCallback, failCallback, e) {
267
         const webStoreInstallUrl = getWebStoreInstallUrl(this.options);
274
         const webStoreInstallUrl = getWebStoreInstallUrl(this.options);
268
 
275
 
269
-        if (CHROME_EXTENSION_POPUP_ERROR === e
276
+        if ((CHROME_EXTENSION_POPUP_ERROR === e
277
+             || CHROME_EXTENSION_IFRAME_ERROR === e)
270
                 && options.interval > 0
278
                 && options.interval > 0
271
                 && typeof(options.checkAgain) === "function"
279
                 && typeof(options.checkAgain) === "function"
272
                 && typeof(options.listener) === "function") {
280
                 && typeof(options.listener) === "function") {

Loading…
Peruuta
Tallenna