Announcement

Collapse
No announcement yet.

Loading a website and sending a command via rr to control java script... possible?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Loading a website and sending a command via rr to control java script... possible?

    Have you ever wanted to view live radar in RR?

    This thread will be used to help me create an application and plugin that works seamlessly with RR.

    Currently only an external application exists.

    The source code can be downloaded here: http://bit.ly/RRadar_src (Download as .zip)

    The application can be downloaded here: http://bit.ly/RRadar_app (Continue with bitly warning message)

    Commands (use SENDKEY in RR)
    Alt+P = Play Radar (must have radar selected)
    Alt+S = Stop Radar (must have radar selected)
    Left Arrow = Move map left
    Right Arrow = Move map right
    Up Arrow = Move map up
    Down Arrow = Move map down
    - = Zoom Out (Shift can be on or off)
    + = Zoom In (Shift can be on or off)
    Last edited by dlane2155; 09-19-2013, 08:27 PM. Reason: Updated: 9/19/2013

  • #3
    If you can tell RR to navigate to the URL, then you might be able to tell it to navigate:

    javascript:document.getElementById('youridhere').c lick()

    Look up the ID of the button in the page source and try it. Not sure how RR does anything.


    EDIT: Not sure why my post has a space in the middle of the word click, but obviously it should be click and not c lick.
    Last edited by ClockWorK; 09-13-2013, 09:39 AM.

    Comment


    • #4
      Cool subject

      Comment


      • #5
        Originally posted by ClockWorK View Post
        If you can tell RR to navigate to the URL, then you might be able to tell it to navigate:

        javascript:document.getElementById('youridhere').c lick()

        Look up the ID of the button in the page source and try it. Not sure how RR does anything.


        EDIT: Not sure why my post has a space in the middle of the word click, but obviously it should be click and not c lick.
        I tried this using the following:

        javascript:document.getElementById("LayerSatellite _animate_start").click()

        Is this something you should be able to enter in the url bar and hit enter? When I do, it searches the web. I have no java programming experience...

        Comment


        • #6
          No , if you use RR, use Skintool ! But i have tried without success!
          The easier would be a plugin or an autoit script

          Comment


          • #7
            If using IE, it should work even in the url bar.

            I can use
            javascript:window.scroll(200,200);
            to scroll the current window. However, i had to type it in the URL box. When I pasted it into IE, IE cut out the "javascript:" part and tried to search.

            So, if you paste in your document.getElementById("LayerSatellite _animate_start").click() text, make sure the "javascript:" part is still there, or retype it.
            Last edited by ClockWorK; 09-14-2013, 06:23 PM.

            Comment


            • #8
              Originally posted by ClockWorK View Post
              If using IE, it should work even in the url bar.

              I can use
              javascript:window.scroll(200,200);
              to scroll the current window. However, i had to type it in the URL box. When I pasted it into IE, IE cut out the "javascript:" part and tried to search.

              So, if you paste in your document.getElementById("LayerSatellite _animate_start").click() text, make sure the "javascript:" part is still there, or retype it.
              Thank you! I was not using a ";" at the end of the line. I did not try this is IE, but google chrome. I'm sure it will work in IE, but not in Firefox. I think if you want to do it in Firefox there may be a plugin available.

              If anyone is interested in doing this as well, these are the javascript urls that will work on the page:

              Start Radar Animation:
              javascript:document.getElementById("LayerRadarAnim Gif_animate_start").click();

              Stop Radar Animation:
              javascript:document.getElementById("LayerRadarAnim Gif_animate_stop").click();

              Now it's time to make a skin file and see if I can get it work within RR. If everything works well I will continue researching different things I can do using javascript to change the settings for the map. I can see this being useful on lots of different websites, assuming the way the website is coded doesn't change too drastically too often!

              Comment


              • #9
                Okay, having some issues implementing this into RR.

                I've learned you can set the browser path to whatever browser you choose in the config and at least WEBURL will work. I have not tried other commands. I have tried this with IE, Chrome, and Opera so far.

                Using WEBURL;url will open the browser if it's not open for each of the 3 browsers above. That is how I want to load the weather site.

                The problem is when I use a second WEBURL;javascript:... command it doesn't send the url to the same tab.

                IE closes the current window.
                Chrome opens a new window.
                Opera opens a new tab.

                It's pointless to even try Firefox because it doesn't allow javascript in the address bar.

                I can do this with SENDKEY, but it's ugly because as RR is "typing" in the address bar it drops down. I have not found any way to turn off the address bar drop down in Chrome or Opera.

                Any ideas? I would prefer to use Chrome or Opera.

                Comment


                • #10
                  It's possible that you share your vb code ? I have begun to do the same thing with vb.net but without success for the commands!

                  Comment


                  • #11
                    Originally posted by pierrotm777 View Post
                    It's possible that you share your vb code ? I have begun to do the same thing with vb.net but without success for the commands!
                    It is not VB. I did this with C#. I cannot tell you how to do shortcut keys in VB but I'm sure searching the web you would find out how fairly quickly.

                    Here are my files.
                    http://bit.ly/RRadar_src

                    Download as a .zip.
                    Last edited by dlane2155; 09-19-2013, 08:28 PM. Reason: Updated link

                    Comment


                    • #12
                      From an early test today, it looks as though embedding Chromium into an application is not the best option. Embedded internet explorer operates much smoother.

                      Can someone help me have my program automatically ignore script errors on the webpage?

                      The error that pops up is shown in the attached image.

                      Click image for larger version

Name:	script error.png
Views:	1
Size:	47.6 KB
ID:	2287873

                      I would like so that this window never pops up and "yes" is automatically selected. I do not know why I see this error in my application. When I run this website in Internet Explorer, this script error does not occur. It seems that this error mostly occurs when the map is centered over the ocean, far away from a land mass. Any help would be appreciated!

                      Comment


                      • #14
                        Originally posted by Enforcer View Post
                        in vb.net


                        me.WebBrowser2.ScriptErrorsSuppressed = True
                        Thanks Enforcer. It worked!

                        Comment

                        Working...
                        X