in reply to Re^2: How can I tell a browser to refresh from perl?
in thread How can I tell a browser to refresh from perl?

> As the third sentence of my original post says,

And as another sentence said

>  Is there a better way to do it? 

JS doesn't spawn a process and doesn't depend on AppleScript or OS or browser at all.

You can also use JS in a hidden iframe checking in short frequency if something changed, before conditionally reloading the parent frame. (Hence no "flickering")

But that's becoming OT here, Google is your friend.

I know newer technologies like WebSockets allow to push content, but IIRC this will need a server keeping the connection alive.

See http://en.wikipedia.org/wiki/Push_technology for various options

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!

  • Comment on Re^3: How can I tell a browser to refresh from perl?

Replies are listed 'Best First'.
Re^4: How can I tell a browser to refresh from perl?
by LanX (Saint) on Feb 11, 2017 at 16:15 UTC
    No flicker for me.

    page.html

    <iframe src="loader.html" style='display:none' > </iframe> <h1>parent</h1> <script> var version=9; document.writeln("Version "+version+" loaded at "+ Date()); </script>
    loader.html
    <h3>loader</h3> <script> setTimeout( function () { window.location.reload(true) }, 1000); var date=Date(); var version=9; document.writeln(date); if (parent.version<version){ parent.location.reload(true); } </script>

    Though in the next step,I would try to get rid of the version number in the source and try to put the load state into the #searchstring

    YMMV

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!

    update

    Works with FF and IE.

    For local files not with Chrome, because of same origin policy with file:// protocol

    Possible Workarounds:

  • change security settings

    Is also creating flicker in Chrome tab bar

    Possible Workarounds:

  • use AJAX XML-HTTP-request request instead of iframe