Skip to content

Instantly share code, notes, and snippets.

@TimBroddin
Last active August 18, 2023 10:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TimBroddin/723ca7f4f3b9c1d4c6a4d96718f26952 to your computer and use it in GitHub Desktop.
Save TimBroddin/723ca7f4f3b9c1d4c6a4d96718f26952 to your computer and use it in GitHub Desktop.
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);
});
@TimBroddin
Copy link
Author

Adds timer & current bid to the tab bar:
CleanShot 2023-08-18 at 11 50 48@2x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment