• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

How to detect internal browser usage?

Scheduled Pinned Locked Moved Plugins
4 Posts 2 Posters 233 Views
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.
  • J Offline
    jeemang
    last edited by 10 Jan 2011, 20:25

    Howdy;

    I'm working on developing an HTML user interface component using the WebDialog class and since it has a whole bunch of JavaScript I'd like to be able to debug it in Safari. The problem, of course, are the Ruby callbacks: almost every event that occurs sets the URL of the browser to skp:action_callback@action_name, which Safari obviously can't open.

    So, I'd like to modify my Ruby call method to include a check to see if the HTML is being rendered within Sketchup or not, but I'm having some trouble figuring out how to do this. The best I've been able to come up with is to check the output of the navigator.userAgent method but this doesn't seem very robust.

    Does anyone know of a better way to do this?

    Many thanks,

    Josh

    1 Reply Last reply Reply Quote 0
    • T Offline
      thomthom
      last edited by 10 Jan 2011, 21:34

      I think the user agent string is only available under SU8.
      Not sure what other method to use. You should ask Rich Morin - he's been working in the same lines as what you mention.

      Thomas Thomassen — SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund

      1 Reply Last reply Reply Quote 0
      • J Offline
        jeemang
        last edited by 11 Jan 2011, 18:03

        Thanks for the reply. I assume the fellow you mention is somewhere on this forum?

        Josh

        1 Reply Last reply Reply Quote 0
        • T Offline
          thomthom
          last edited by 11 Jan 2011, 23:09

          Yes. I gave him a nudge in this direction.

          Thomas Thomassen — SketchUp Monkey & Coding addict
          List of my plugins and link to the CookieWare fund

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          1 / 1
          • First post
            1/4
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement