Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Scripting with Easy Auto Refresh

There is a lot that Easy Auto Refresh can do, besides just refreshing the web page. Did you know you can execute JavaScript after each page refresh or at each countdown interval? Think of all the amazing things you can do!

To run a script after a page refresh, follow the steps below.

How to Run a Script After a Refresh

  1. Download Easy Auto Refresh.
  2. Open Easy Auto Refresh and click Advanced Options.
  3. Checkmark the option Refresh by clicking link or button.
  4. In the textbox, enter the following code:
    document.querySelector('body');
    
    setTimeout(() => {
      console.log('Hello World!')
    }, 1000);
    
  5. If you want the script to run after a page refresh, checkmark the option Click element after page refresh. If you want to run the script at each countdown interval (without an actual page refresh), leave the checkbox empty.
  6. Click the Start button to begin the countdown.

The above steps will run your script at each countdown interval. If you also checkmarked the option to Click element after page refresh, the page will first refresh, and then run your script.

The key to running a script after a refresh is to include the line document.querySelector('body'); followed by a setTimeout() which contains the code that you want to execute on the page. You can run any code that you like within the setTimeout() method to perform any number of actions, such as clicking advanced buttons or elements on the page, changing css styles, and much more.

Here are a couple of examples.

Hello World

The following script prints "Hello Easy Auto Refresh!" to the browser console after each refresh.


Demo



Changing the Page Color

The following script changes the web page background color after each countdown interval.


Demo



Animating a Map

The following script automatically clicks the "Play" button on an animated weather map, after each page refresh.



Demo



The advanced options are available in the registered version of Easy Auto Refresh. Unlock your copy today to harness the full scripting capabilities of automatic page refreshing in Chrome.


This post first appeared on Ksoft Newsletter - News, Tips, Downloads To Make Y, please read the originial post: here

Share the post

Scripting with Easy Auto Refresh

×

Subscribe to Ksoft Newsletter - News, Tips, Downloads To Make Y

Get updates delivered right to your inbox!

Thank you for your subscription

×