浏览代码

Only load 3rd party JavaScript when config.enableThirdPartyRequests is true.

j8
Jesse Bickel 10 年前
父节点
当前提交
3f42f8bf67
共有 2 个文件被更改,包括 16 次插入2 次删除
  1. 1
    0
      config.js
  2. 15
    2
      index.html

+ 1
- 0
config.js 查看文件

69
     /*noticeMessage: 'Service update is scheduled for 16th March 2015. ' +
69
     /*noticeMessage: 'Service update is scheduled for 16th March 2015. ' +
70
     'During that time service will not be available. ' +
70
     'During that time service will not be available. ' +
71
     'Apologise for inconvenience.'*/
71
     'Apologise for inconvenience.'*/
72
+    enableThirdPartyRequests: true
72
 };
73
 };

+ 15
- 2
index.html 查看文件

11
     <meta itemprop="image" content="/images/jitsilogo.png?v=1"/>
11
     <meta itemprop="image" content="/images/jitsilogo.png?v=1"/>
12
       <link rel="stylesheet" href="css/all.css"/>
12
       <link rel="stylesheet" href="css/all.css"/>
13
     <script>console.log("(TIME) index.html loaded:\t", window.performance.now());</script>
13
     <script>console.log("(TIME) index.html loaded:\t", window.performance.now());</script>
14
-    <script src="https://api.callstats.io/static/callstats.min.js"></script>
15
     <script src="config.js?v=15"></script><!-- adapt to your needs, i.e. set hosts and bosh path -->
14
     <script src="config.js?v=15"></script><!-- adapt to your needs, i.e. set hosts and bosh path -->
16
     <script src="interface_config.js?v=6"></script>
15
     <script src="interface_config.js?v=6"></script>
17
     <script src="libs/app.bundle.min.js?v=139"></script>
16
     <script src="libs/app.bundle.min.js?v=139"></script>
18
-    <script src="analytics.js?v=1"></script><!-- google analytics plugin -->
19
     <!--
17
     <!--
20
         Link used for inline installation of chrome desktop streaming extension,
18
         Link used for inline installation of chrome desktop streaming extension,
21
         is updated automatically from the code with the value defined in config.js -->
19
         is updated automatically from the code with the value defined in config.js -->
224
             <a id="feedbackButton" data-container="body" data-toggle="popover" data-placement="right" data-i18n="[data-content]feedback"><i class="fa fa-heart"></i></a>
222
             <a id="feedbackButton" data-container="body" data-toggle="popover" data-placement="right" data-i18n="[data-content]feedback"><i class="fa fa-heart"></i></a>
225
         </div>
223
         </div>
226
     </div>
224
     </div>
225
+    <script type="text/javascript">
226
+      if (config.enableThirdPartyRequests === true)
227
+      { 
228
+        [
229
+          'https://api.callstats.io/static/callstats.min.js',
230
+          'analytics.js?v=1'
231
+        ].forEach(function(extSrc) 
232
+        {
233
+          var extScript = document.createElement('script');
234
+          extScript.src = extSrc;
235
+          extScript.async = false;
236
+          document.head.appendChild(extScript);
237
+        });
238
+      }
239
+    </script>
227
   </body>
240
   </body>
228
 </html>
241
 </html>

正在加载...
取消
保存