sketchucation logo sketchucation
    • Login
    ℹ️ GoFundMe | Our friend Gus Robatto needs some help in a challenging time Learn More

    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

      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
      • thomthomT Offline
        thomthom
        last edited by

        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

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

          Josh

          1 Reply Last reply Reply Quote 0
          • thomthomT Offline
            thomthom
            last edited by

            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
            • First post
              Last post
            Buy SketchPlus
            Buy SUbD
            Buy WrapR
            Buy eBook
            Buy Modelur
            Buy Vertex Tools
            Buy SketchCuisine
            Buy FormFonts

            Advertisement