Last active
August 18, 2023 10:04
-
-
Save TimBroddin/723ca7f4f3b9c1d4c6a4d96718f26952 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener("DOMContentLoaded", function() { | |
const title = document.title; | |
const updateData = () => { | |
const timer = document.querySelector('div[data-aq="bidding-container"] div[data-aq="timer-running"]'); | |
const lastMinute = document.querySelector('.timer-countdown-label'); | |
const highestBid = document.querySelector('div[data-aq="highest-bid"] > h3'); | |
if(timer) { | |
const hours = timer.querySelector('span[data-aq="hours"]'); | |
const minutes = timer.querySelector('span[data-aq="minutes"]'); | |
const seconds = timer.querySelector('span[data-aq="seconds"]'); | |
document.title = `${hours.innerText}:${minutes.innerText}:${seconds.innerText} - ${highestBid.innerText} - ${title}`; | |
} else if (lastMinute) { | |
document.title = `🚨 ${lastMinute.innerText} - ${highestBid.innerText} - ${title}`; | |
} else { | |
document.title = title; | |
} | |
}; | |
setInterval(updateData, 250); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Adds timer & current bid to the tab bar:
