소스 검색

feat(ScreenObtainer): trigger external for not verified site

Will trigger external installation also for sites that are not the main
whitelisted domain. This allows to reuse one extension for many sites
(they still have to be on the whitelist, but only one can be "main").
dev1
paweldomas 8 년 전
부모
커밋
6927eae529
1개의 변경된 파일11개의 추가작업 그리고 1개의 파일을 삭제
  1. 11
    1
      modules/RTC/ScreenObtainer.js

+ 11
- 1
modules/RTC/ScreenObtainer.js 파일 보기

@@ -50,6 +50,15 @@ const CHROME_EXTENSION_POPUP_ERROR
50 50
 const CHROME_EXTENSION_IFRAME_ERROR
51 51
     = 'Chrome Web Store installations can only be started by the top frame.';
52 52
 
53
+/**
54
+ * The error returned by chrome when trying to start inline installation
55
+ * not from the "main" whitelisted site.
56
+ * @type {string}
57
+ */
58
+const CHROME_EXTENSION_INLINE_ERROR
59
+    = 'Installs can only be initiated by one of'
60
+        + ' the Chrome Web Store item\'s verified sites.';
61
+
53 62
 /**
54 63
  * The error message returned by chrome when the extension is installed.
55 64
  */
@@ -407,7 +416,8 @@ const ScreenObtainer = {
407 416
         const webStoreInstallUrl = getWebStoreInstallUrl(this.options);
408 417
 
409 418
         if ((CHROME_EXTENSION_POPUP_ERROR === e
410
-             || CHROME_EXTENSION_IFRAME_ERROR === e)
419
+             || CHROME_EXTENSION_IFRAME_ERROR === e
420
+             || CHROME_EXTENSION_INLINE_ERROR === e)
411 421
                 && options.interval > 0
412 422
                 && typeof options.checkAgain === 'function'
413 423
                 && typeof options.listener === 'function') {

Loading…
취소
저장