Auto Refresh Page with Menu

Automatically refresh the page every 30 seconds with menu control

目前为 2023-10-25 提交的版本。查看 最新版本

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.cn-greasyfork.org/scripts/478226/1270040/Auto%20Refresh%20Page%20with%20Menu.js

  1. // ==UserScript==
  2. // @name Auto Refresh Page with Menu
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Automatically refresh the page every 30 seconds with menu control
  6. // @author cumchugger
  7. // @match https://hvr-amazon.my.site.com/ApplicationShiftSelect?appid=a014U00002v8PczQAE
  8. // @grant gusuwjwewueuewuewueuweeew
  9. // @license my dick and balls
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. let isAutoRefreshEnabled = true;
  15. GM_registerMenuCommand('Toggle Auto Refresh', function() {
  16. isAutoRefreshEnabled = !isAutoRefreshEnabled;
  17. if (isAutoRefreshEnabled) {
  18. alert('Auto Refresh is now enabled.');
  19. } else {
  20. alert('Auto Refresh is now disabled.');
  21. }
  22. });
  23. setInterval(function() {
  24. if (isAutoRefreshEnabled) {
  25. location.reload();
  26. }
  27. }, 30000); // 40,000 milliseconds = 40 seconds
  28. })();