Skip to content

Instantly share code, notes, and snippets.

@SC-One
Created August 3, 2022 19:03
Show Gist options
  • Save SC-One/3437af09a89eb01d7cb87d67c79226fd to your computer and use it in GitHub Desktop.
Save SC-One/3437af09a89eb01d7cb87d67c79226fd to your computer and use it in GitHub Desktop.
Automatic refresh window in js (usecase: browser console)
win1 = window.open("https://www.binance.com/en/price/binance-usd")
var windowObject = win1.document
var counter = 0
timer1 = setInterval(function() {
win1.location.href = "https://www.binance.com/en/price/binance-usd"
counter++
console.log("Counter: ", counter)
// if (windowObject < win1.document || windowObject > win1.document) {
// alert("Hi diffrent page")
// }
}, 3 * 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment