CloseWindowByName

Simple script to handle a specific Auto Claim case. I won't be answering questions about this script. May or may not update it. May or may not work for you. It's just a workaround in case you don't have an ad blocker.

目前为 2021-10-08 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name CloseWindowByName
  3. // @version 0.5
  4. // @description Simple script to handle a specific Auto Claim case. I won't be answering questions about this script. May or may not update it. May or may not work for you. It's just a workaround in case you don't have an ad blocker.
  5. // @author satology
  6. // @match http://*/*
  7. // @match https://*/*
  8. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  9. // @grant window.close
  10. // @namespace satology.onrender.com
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. const regexs = [/betteradsystem\.com/, /request\-global\.czilladx\.com/, /bmfads\.com/, /coinverti\.com/, /^https\:\/\/faucetcrypto\.com\/$/];
  16.  
  17. try {
  18. if(regexs.some((exp) => document.referrer && document.referrer.match(exp) )) {
  19. let delay = 11000 + 2000 * Math.random();
  20. setTimeout(window.close, delay);
  21. }
  22. } catch (err) {}
  23. try {
  24. if(regexs.some((exp) => window.name && window.name.match(exp) )) {
  25. // let delay = 11000 + 13000 * Math.random();
  26. let delay = 11000 + 2000 * Math.random();
  27. setTimeout(window.close, delay);
  28. }
  29. } catch (err) {}
  30. try {
  31. if(regexs.some((exp) => window.opener && window.opener.match(exp) )) {
  32. // let delay = 11000 + 13000 * Math.random();
  33. let delay = 11000 + 2000 * Math.random();
  34. setTimeout(window.close, delay);
  35. }
  36. } catch (err) {}
  37. })();