Bypass Detector

Adds a bypass button for supported URLs

目前为 2024-10-27 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Bypass Detector
  3. // @namespace https://tampermonkey.net/
  4. // @version 0.1
  5. // @description Adds a bypass button for supported URLs
  6. // @author You
  7. // @match *://*/*
  8. // @license MIT
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // List of supported domains
  16. const SUPPORTED_DOMAINS = [
  17. 'example.com'
  18. ];
  19.  
  20. // Check if current URL is from a supported domain
  21. function isSupportedURL(url) {
  22. return SUPPORTED_DOMAINS.some(domain => url.includes(domain));
  23. }
  24.  
  25. // Create and add bypass button
  26. function addBypassButton() {
  27. if (isSupportedURL(window.location.href)) {
  28. const button = document.createElement('button');
  29. button.innerHTML = 'Bypass Link';
  30. button.style.cssText = `
  31. position: fixed;
  32. top: 20px;
  33. right: 20px;
  34. z-index: 10000;
  35. padding: 10px 20px;
  36. background-color: #4CAF50;
  37. color: white;
  38. border: none;
  39. border-radius: 5px;
  40. cursor: pointer;
  41. font-size: 14px;
  42. `;
  43.  
  44. button.addEventListener('mouseover', () => {
  45. button.style.backgroundColor = '#45a049';
  46. });
  47.  
  48. button.addEventListener('mouseout', () => {
  49. button.style.backgroundColor = '#4CAF50';
  50. });
  51.  
  52. button.addEventListener('click', () => {
  53. const encodedUrl = encodeURIComponent(window.location.href);
  54. window.location.href = `{encodedUrl}`;
  55. });
  56.  
  57. document.body.appendChild(button);
  58. }
  59. }
  60.  
  61. // Run when page loads
  62. window.addEventListener('load', addBypassButton);
  63. })();