Browse Source

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

j8
Jesse Bickel 10 years ago
parent
commit
3f42f8bf67
2 changed files with 16 additions and 2 deletions
  1. 1
    0
      config.js
  2. 15
    2
      index.html

+ 1
- 0
config.js View File

@@ -69,4 +69,5 @@ var config = {
69 69
     /*noticeMessage: 'Service update is scheduled for 16th March 2015. ' +
70 70
     'During that time service will not be available. ' +
71 71
     'Apologise for inconvenience.'*/
72
+    enableThirdPartyRequests: true
72 73
 };

+ 15
- 2
index.html View File

@@ -11,11 +11,9 @@
11 11
     <meta itemprop="image" content="/images/jitsilogo.png?v=1"/>
12 12
       <link rel="stylesheet" href="css/all.css"/>
13 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 14
     <script src="config.js?v=15"></script><!-- adapt to your needs, i.e. set hosts and bosh path -->
16 15
     <script src="interface_config.js?v=6"></script>
17 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 18
         Link used for inline installation of chrome desktop streaming extension,
21 19
         is updated automatically from the code with the value defined in config.js -->
@@ -224,5 +222,20 @@
224 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 223
         </div>
226 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 240
   </body>
228 241
 </html>

Loading…
Cancel
Save