#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    5
    Rep Power
    0

    Webpage redirection time


    Hi all,

    I want to calculate time consumed in redirecting from 1 webpage to another webpage.
    For Example:
    1) I am using Facebook in Google Chrome browser.
    I have shared 1 link on my Facebook profile
    2) When I click on this link from my Facebook profile, then this website will open in new tab.
    3) I want to calculate time difference in miliseconds or microseconds between below two events:
    First Event: Time of clicking link from my Facebook profile.
    Second Event: Time of completely loading webpage of shared link.

    Thank you in advance.
  2. #2
  3. A Not To Shabby Code Smurf
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Aug 2008
    Posts
    1,151
    Rep Power
    183
    First Event: Most likely not doable... you have no control over the client side code (aka "JavaScript") within Facebook; hence you have no way to detect any type of event that occurs; within your Facebook page. There are Facebook Developer APIs; which might give you a remote chance in detecting document events, not sure though... seems like that could open up cross domain security wholes.

    Second Event: trigger a timer based function to start counting onBeforeLoad (yes... I know there is no such global function, but it can be done) and then stop the timer based function "onLoad".

    If this is a way to determine how much bandwidth your using... let me give some advice... design your site... so that it is does not need to consume a huge chuck of data; just to view one page of your site... design efficiently.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    5
    Rep Power
    0
    First Event: It's not only about Facebook. Let me explain the scenario again:

    We are on a webpage having link to another domain.
    For example
    1) 1 link is shared on plus.google.com which navigates to another domain link may be webdeveloper website.
    2) 1 link is shared in 1 domain which navigates to another domain like devshed website.

    I don't want to measure bandwidth. I just want to measure time different between First Event and Second Event.


    Originally Posted by web_loone08
    First Event: Most likely not doable... you have no control over the client side code (aka "JavaScript") within Facebook; hence you have no way to detect any type of event that occurs; within your Facebook page. There are Facebook Developer APIs; which might give you a remote chance in detecting document events, not sure though... seems like that could open up cross domain security wholes.

    Second Event: trigger a timer based function to start counting onBeforeLoad (yes... I know there is no such global function, but it can be done) and then stop the timer based function "onLoad".

    If this is a way to determine how much bandwidth your using... let me give some advice... design your site... so that it is does not need to consume a huge chuck of data; just to view one page of your site... design efficiently.
  6. #4
  7. A Not To Shabby Code Smurf
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Aug 2008
    Posts
    1,151
    Rep Power
    183
    Again... my answer is still the same. If you have no way to control the clients side scripting language; from within the domain, where your link resides; then you have no way detect the window and/or document events, that you would need to start a JavaScript timer.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    5
    Rep Power
    0
    Thank you for your responses.
    I decided to go ahead with firebug for Firefox and Developer Tools for Chrome.
    My problem is solved.

    Originally Posted by web_loone08
    Again... my answer is still the same. If you have no way to control the clients side scripting language; from within the domain, where your link resides; then you have no way detect the window and/or document events, that you would need to start a JavaScript timer.

IMN logo majestic logo threadwatch logo seochat tools logo