Loot Links Ad Skipper

Redirects to the publisher link if "loot" is in the URL

当前为 2024-02-08 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Loot Links Ad Skipper
  3. // @namespace mali
  4. // @license none
  5. // @version 2
  6. // @description Redirects to the publisher link if "loot" is in the URL
  7. // @author malidev
  8. // @match https://*/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. if (window.location.href.includes("loot")) {
  15. if (PUBLISHER_LINK) {
  16. window.location.href = decodeURIComponent(decodeBase64WithKey(PUBLISHER_LINK));
  17. } else {
  18. console.error("PUBLISHER_LINK variable is not defined on the page.");
  19. }
  20. }
  21. function decodeBase64WithKey(encodedText, keyLength = 5) {
  22. let decodedText = '';
  23. let decodedString = atob(encodedText);
  24. let key = decodedString.substring(0, keyLength);
  25. let encodedMessage = decodedString.substring(keyLength);
  26. for (let i = 0; i < encodedMessage.length; i++) {
  27. let encodedCharCode = encodedMessage.charCodeAt(i);
  28. let keyCharCode = key.charCodeAt(i % key.length);
  29. let decodedCharCode = encodedCharCode ^ keyCharCode;
  30. decodedText += String.fromCharCode(decodedCharCode);
  31. }
  32. return decodedText;
  33. }
  34. })();