set_utctime_solscan.js 721 B

123456789101112131415161718192021222324252627282930313233
  1. function sleep(sleepdelay) {
  2. return new Promise((resolve, reject) => {
  3. setTimeout(() => {
  4. resolve(sleepdelay);
  5. }, sleepdelay);
  6. })
  7. }
  8. async function set_utctime_solscan() {
  9. try {
  10. let table_ = document.querySelector("table.w-full");
  11. let thead_ = table_.getElementsByTagName("thead")[0];
  12. let arr_th_ = Array.from(thead_.getElementsByTagName("th"));
  13. let time_click_ = arr_th_[2].querySelectorAll("div.items-center.cursor-pointer")[0];
  14. if (arr_th_[2].innerText.trim() == "Time") {
  15. time_click_.click();
  16. }
  17. } catch (e) {
  18. await sleep(1000);
  19. }
  20. }
  21. (async function () {
  22. await set_utctime_solscan();
  23. })();