Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Prevent execute html content before boomerang.js finished #47

Open
Artemis909 opened this issue Apr 7, 2014 · 0 comments
Open

Prevent execute html content before boomerang.js finished #47

Artemis909 opened this issue Apr 7, 2014 · 0 comments

Comments

@Artemis909
Copy link

situation is:

Javascript boomerang.js used as test of client net speed, problem is that html content is executed by browser and is not waiting for boomerang result. But boomerang result is needed because there are some changes in html content.

How it is possible to do not execute html content before boomernag.js has result?

   <!DOCTYPE html>
   <html lang="en">
   <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel='stylesheet' type='text/css' media='all' href='css/style.css' />
    <link rel='stylesheet' type='text/css' media='all' href='css/colorbox.css' />
    <script type="text/javascript" src="js/speedtest/boomerang.min.js"></script>
    <script>
      BOOMR.init({ beacon_url: "http://www.zzz.xx", user_ip: '10.0.0.1', site_domain: "http://www.zzz.xx", BW: { nruns: 3, base_url: 'http://www.zzz.xx/test_images/', cookie: 'SPEED-test'}});
      </script>
       <script type="text/javascript" src="js/preload.js"></script>

preload.js is just check cookies and if exist do not make test again, if does not, run speedtest by BOOMR.subscribe

          var version_set=getCookie("speedtest_version_set");

         if (version_set == "low"){

                                  $(document).ready(website_init_low);      

           } else if (version_set == "high"){

                                  $(document).ready(website_init_high);

                } else {


             BOOMR.subscribe('before_beacon', function(o) {  

              if(o.bw) {  
                          netspeed = Math.abs(parseInt(o.bw*8/1024)); 
               var netspeed_limit = 5000; 

          if (netspeed < netspeed_limit) { 

                     document.cookie="speedtest_version_set = low";
                     $(document).ready(website_init_low);

            } else {
                    document.cookie="speedtest_version_set = high";  
                    $(document).ready(website_init_high);


            }

   }
     });

           }
bluesmoon added a commit to bluesmoon/boomerang that referenced this issue Feb 6, 2015
Changed BW calculation PNG images to be incompressible

Also closes issue YahooArchive#46
bluesmoon added a commit to bluesmoon/boomerang that referenced this issue Mar 21, 2016
Changed BW calculation PNG images to be incompressible

Also closes issue YahooArchive#46
bluesmoon pushed a commit to bluesmoon/boomerang that referenced this issue Mar 8, 2017
Fixes bug 92560, exclude list not honored in IE, reviewed by Nic
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant