omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Web page load times using ui.webview

    Pythonista
    2
    3
    1631
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • champak
      champak last edited by

      Hi

      I used the code posted in this thread https://forum.omz-software.com/topic/4435/open-multiple-web-browser-tabs/13 that discusses opening multiple tabs on safari which worked to open the tabs.
      As an additional level I am interested in profiling the web page load times for each tab.
      According to the Pythonista documentation on ui there is a delegate method that case be used to listen in on the outcome as mentioned here - http://omz-software.com/pythonista/docs/ios/ui.html#webview
      Delegate methods:

      class MyWebViewDelegate (object):
      def webview_should_start_load(self, webview, url, nav_type):
      return True
      def webview_did_start_load(self, webview):
      pass
      def webview_did_finish_load(self, webview):
      pass
      def webview_did_fail_load(self, webview, error_code, error_msg):
      pass

      I guess my question is how do I attach a delegate action with each tab load and use the markers webview_did_start_load and webview_did_finish_load to compute the load times?
      Any pointers will be appreciated.

      Thanks
      Suman

      mikael 1 Reply Last reply Reply Quote 0
      • mikael
        mikael @champak last edited by

        @champak, there are several different answers depending on what you are trying to accomplish.

        Do you want to:

        1. Measure full rendered load times in Safari (and it is important that it is full Safari)
        2. Measure full rendered load times in some browser (and it is important that they are visibly rendered, i.e. you expect the rendering to take a significant amount of time)
        3. Measure the load time of all page components, of different pages (And it is important nothing gets cached between the pages)
        4. Measure the load time of a set of ”tabs” (and the only thing that matters is the overall load time of the whole ”package” of pages)
        1 Reply Last reply Reply Quote 0
        • champak
          champak last edited by

          Hi Mikael

          Thanks much for your response - appreciate it!
          To answer your question, my requirements is a combination of 2 and 3 and to be more precise -
          I am trying to measure the load time of all page components of different pages (each page renders a different html site / content) across different browsers -
          For eg:
          Tab 1 - https://www.microsoft.com
          Tab 2 - https://www.msn.com
          Tab 3 - https://www.cnn.com
          Tab 4 - https://www.nytimes.com
          And I want to measure it across let's say 10 iterations with opening and closing the browser each time and making sure nothing is stored on the cache (clean on exit).

          Thanks for your help and appreciate any pointers on this.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by NodeBB Forums | Contributors