in reply to Re: Reload Browser Tab on Windows
in thread Reload Browser Tab on Windows

> What kind of a script?

Sorry Script= Perl Program

This is not JS-Monks after all! ;-)

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^3: Reload Browser Tab on Windows
by haukex (Archbishop) on Dec 21, 2020 at 21:17 UTC
    Sorry Script= Perl Program
    This is not JS-Monks after all! ;-)

    Sure, I just thought you might be playing with WebPerl ;-) I'm a little unclear on your architecture: would I be correct in guessing that you've got a Perl script that's generating static HTML, and that's why you want to reload the browser from the Perl script instead of from inside the HTML? (And even if that's the case, why not just whip up a quick server that serves the HTML on a local address? That way you could solve this using JS / Websockets / etc.)

      yes it's static html.

      > and that's why you want to reload the browser from the Perl script instead of from inside the HTML?

      I don't get it, any JS or meta-tag solution would indiscriminately work from a static file too.

      > (And even if that's the case, why not just whip up a quick server that serves the HTML on a local address? That way you could solve this using JS / Websockets / etc.)

      I like automating my desktop beyond my IDE, it's purely for reducing turnaround time

      And installing Mojo and getting acquainted with websockets would stop my current project.

      (That's basically the drama of my many projects, instead of "getting done" I'm hopping around trying to "get it right")

      Anyway I have a powershell solution now, which fits into one line. No need to install anything else. :)

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery

        I don't get it, any JS or meta-tag solution would indiscriminately work from a static file too.

        Well yes, they would work insofar as they can reload the page, but in the root node you said "reload the page after running my script", so I thought this timing was important: my guess was that your script would be generating the static HTML file and you want to reload the browser with that newly generated HTML. This is IMHO much simpler (and probably more importantly, cross-platform and cross-browser portable) to do with a live connection to an HTTP server...

        And installing Mojo and getting acquainted with websockets would stop my current project.

        It's not that difficult ;-) In the very basic form, you just need some HTTP server and the HTML page can poll the server. The EventSource API and WebSockets are just advanced forms. If you were to give more specifics, like what this script is generating, how complex the script is (i.e. if it could be integrated into a webserver easily or it should stay standalone), how long the generation takes (i.e. whether it can be done in a few ms on the fly or it takes a minute), how often it gets run, and so on, I could make a more specific suggestion.