CDC Booking Page Reload every 15m

Refresh the page

اعتبارا من 30-04-2025. شاهد أحدث إصدار.

// ==UserScript==
// @name         CDC Booking Page Reload every 15m
// @namespace    http://tampermonkey.net/
// @version      0.4
// @description  Refresh the page
// @author       afjw
// @match        https://bookingportal.cdc.com.sg/*
// @grant        none
// @license      MIT
// ==/UserScript==

function isTargetPage() {
    return location.href === 'https://bookingportal.cdc.com.sg/NewPortal/Booking/BookingPL.aspx';
}

if (isTargetPage()) {
  // Set up automatic reload every 15 minutes
  setInterval(() => {
    location.reload();
  }, 5 * 60 * 1000); // 15 minutes in milliseconds

  // Optional: Set up a MutationObserver if you want to watch for DOM changes
  const observer = new MutationObserver((mutationsList, observer) => {
    // Your logic to respond to DOM changes
    console.log('DOM changed');
  });

  // Start observing the body (or any other node you care about)
  observer.observe(document.body, {
    childList: true,
    subtree: true
  });
}