Digitual

Una funcion que te permite acceder a cualquier pagina web sin ninguna renstriccion

  1. // ==UserScript==
  2. // @name Digitual
  3. // @name:en Digitual
  4. // @name:es Digitual
  5. // @name:fr Digitual
  6. // @name:de Digitual
  7. // @name:it Digitual
  8. // @name:pt Digitual
  9. // @name:nl Digitual
  10. // @name:ru Digitual
  11. // @name:zh-CN Digitual
  12. // @name:ja Digitual
  13. // @name:ko Digitual
  14. // @name:hi Digitual
  15. // @name:ar Digitual
  16. // @name:vi Digitual
  17. // @name:tr Digitual
  18. // @name:pl Digitual
  19. // @name:uk Digitual
  20. // @name:el Digitual
  21. // @name:sv Digitual
  22. // @name:da Digitual
  23. // @name:no Digitual
  24. // @name:fi Digitual
  25. // @name:hu Digitual
  26. // @name:cs Digitual
  27. // @name:ro Digitual
  28. // @name:th Digitual
  29. // @name:id Digitual
  30. // @name:he Digitual
  31. // @name:fa Digitual
  32. // @name:bn Digitual
  33. // @name:ta Digitual
  34. // @name:ur Digitual
  35. // @name:pa Digitual
  36. // @name:ms Digitual
  37. // @name:te Digitual
  38. // @name:ml Digitual
  39. // @name:gu Digitual
  40. // @name:kn Digitual
  41. // @name:mr Digitual
  42. // @name:or Digitual
  43. // @name:sa Digitual
  44. // @name:mk Digitual
  45. // @name:bg Digitual
  46. // @name:hr Digitual
  47. // @name:sr Digitual
  48. // @name:sk Digitual
  49. // @name:sl Digitual
  50. // @name:lt Digitual
  51. // @name:lv Digitual
  52. // @name:et Digitual
  53. // @name:ca Digitual
  54. // @name:eu Digitual
  55. // @name:gl Digitual
  56. // @namespace https://yomboxggt.neocities.org/Digitual
  57. // @version 1.3
  58. // @description Una funcion que te permite acceder a cualquier pagina web sin ninguna renstriccion
  59. // @description:en A function that allows you to access any webpage without any restrictions
  60. // @description:es Una función que te permite acceder a cualquier página web sin ninguna restricción
  61. // @description:fr Une fonction qui vous permet d'accéder à n'importe quelle page web sans aucune restriction
  62. // @description:de Eine Funktion, die Ihnen den Zugriff auf jede Webseite ohne Einschränkungen ermöglicht
  63. // @description:it Una funzione che ti permette di accedere a qualsiasi pagina web senza alcuna restrizione
  64. // @description:pt Uma função que permite que você acesse qualquer página da web sem nenhuma restrição
  65. // @description:nl Een functie die u toelaat om toegang te krijgen tot elke website zonder beperkingen
  66. // @description:ru Функция, которая позволяет вам получить доступ к любой веб-странице без ограничений
  67. // @description:zh-CN 允许您无限制地访问任何网页的函数
  68. // @description:ja 制限なしでどのウェブページにもアクセスできる機能
  69. // @description:ko 제한 없이 모든 웹 페이지에 접근할 수 있는 기능
  70. // @description:hi एक फ़ंक्शन जो आपको किसी भी वेब पेज पर बिना किसी रोक-टोक के पहुंचने देता है
  71. // @description:ar دالة تتيح لك الوصول إلى أي صفحة ويب دون أي قيود
  72. // @description:vi Một chức năng cho phép bạn truy cập bất kỳ trang web nào mà không có bất kỳ hạn chế nào
  73. // @description:tr Herhangi bir kısıtlama olmadan herhangi bir web sayfasına erişmenizi sağlayan bir fonksiyon
  74. // @description:pl Funkcja, która pozwala na dostęp do dowolnej strony internetowej bez żadnych ograniczeń
  75. // @description:uk Функція, яка дозволяє вам отримати доступ до будь-якої веб-сторінки без обмежень
  76. // @description:el Μια λειτουργία που σας επιτρέπει να προσπελάσετε οποιαδήποτε ιστοσελίδα χωρίς περιορισμούς
  77. // @description:sv En funktion som låter dig komma åt vilken hemsida som helst utan några restriktioner
  78. // @description:da En funktion, der gør det muligt at få adgang til enhver hjemmeside uden begrænsninger
  79. // @description:no En funksjon som lar deg få tilgang til hvilken som helst nettsted uten noen restriksjoner
  80. // @description:fi Toiminto, joka antaa sinulle pääsyn mihin tahansa verkkosivulle ilman rajoituksia
  81. // @description:hu Egy olyan funkció, amely lehetővé teszi bármely weblap elérését korlátozás nélkül
  82. // @description:cs Funkce, která vám umožňuje přístup k libovolné webové stránce bez jakýchkoliv omezení
  83. // @description:ro O funcție care vă permite să accesați orice pagină web fără restricții
  84. // @description:th ฟังก์ชันที่อนุญาตให้เข้าถึงเว็บเพจใดๆ ได้โดยไม่มีข้อจำกัดใดๆ
  85. // @description:id Fungsi yang memungkinkan Anda mengakses halaman web apa pun tanpa batasan
  86. // @description:he פונקציה המאפשרת לך לגשת לכל דף אינטרנט ללא כל הגבלה
  87. // @description:fa یک تابع که به شما اجازه می‌دهد تا به هر صفحه وب بدون هیچ قید و شرط دسترسی داشته باشید
  88. // @description:bn একটি ফাংশন যা আপনাকে কোনও ওয়েব পেজে প্রবেশ করতে দেয় কোনও বিধিনিষেধ ছাড়াই
  89. // @description:ta ஒரு செயல்பாடு அதனை உங்களுக்கு அனைத்து இணையதளங்களையும் எந்த விதமான கட்டுப்பாடுகளும் இல்லாமல் அணுக அனுமதிக்கிறது
  90. // @description:ur ایک ایسا فنکشن جو آپ کو کسی بھی ویب پیج پر کوئی تحریموں کے بغیر رسائی فراہم کرتا ہے
  91. // @description:pa ਇੱਕ ਫੰਕਸ਼ਨ ਜੋ ਤੁਹਾਡੇ ਲਈ ਕਿਸੇ ਵੀ ਵੈੱਬ ਪੇਜ ਤੱਕ ਪਹੁੰਚ ਬਿਨਾ ਕਿਸੇ ਵੀ ਪਾਬੰਦੀ ਵਾਲੇ ਦਿੱਤੀ ਹੈ
  92. // @description:ms Sebuah fungsi yang membenarkan anda mengakses laman web mana sahaja tanpa sebarang had
  93. // @description:te ఒక ఫంక్షన్ ఎటువంటి పరిమితులే లేకుండా ఏ వెబ్ పేజీకి కానీ చేరడానికి అనుమతిస్తుంది
  94. // @description:ml ഒരു ഫങ്ക്ഷൻ അതിന്റെ വഴി എല്ലാ വെബ് പേജുകളിലേക്കും പരിമിതികൾ ഒന്നുമില്ലാതെ പ്രവേശിക്കാനും അനുവദിക്കുന്നു
  95. // @description:gu એક ફંક્શન જે તમને કોઈ પણ વેબ પેજ પર જોવા માટે બંધો વગર મુજબ કરે છે
  96. // @description:kn ಒಂದು ಫಂಕ್ಷನ್ ಇದು ಯಾವುದೇ ಪರಿಸ್ಥಿತಿಗಳಿಲ್ಲದೆ ಯಾವುದೇ ವೆಬ್ ಪೇಜ್ಗೆ ಪ್ರವೇಶವನ್ನು ನೀಡುತ್ತದೆ
  97. // @description:mr एक फंक्शन जो तुम्हाला कोणत्याही वेबपेजवर प्रतीबंधांपेक्षा जाऊ देतो
  98. // @description:or ଏକ ଫଂକ୍ସନ ଯିଏ ତୁମେ କୌଣସି ଉପରି ବିନା ସମସ୍ୟା ପରିବର୍ତ୍ତନ କରିପାରିବ
  99. // @description:sa एक फ़ंक्शन जो आपको किसी भी वेब पेज तक बिना किसी प्रतिबंध के पहुंचने देता है
  100. // @description:mk Функција која ви овозможува пристап до секоја веб-страница без никакви ограничувања
  101. // @description:bg Функция, която ви позволява да достъпвате всяка уеб страница без никакви ограничения
  102. // @description:hr Funkcija koja vam omogućuje pristup bilo kojoj web stranici bez ikakvih ograničenja
  103. // @description:sr Функција која вам омогућава приступ било којој веб страници без икаквих ограничења
  104. // @description:sk Funkcia, ktorá vám umožňuje prístup k libovolnej webovej stránke bez akýchkoľvek obmedzení
  105. // @description:sl Funkcija, ki vam omogoča dostop do katere koli spletne strani brez katerih koli omejitev
  106. // @description:lt Funkcija, leidžianti prieiti prie bet kurio tinklalapio be jokios ribos
  107. // @description:lv Funkcija, kas ļauj atvērt jebkuru mājaslapu bez jebkādiem ierobežojumiem
  108. // @description:et Funktsioon, mis võimaldab ligipääsu igale veebilehele ilma piiranguteta
  109. // @description:ca Una funció que us permet accedir a qualsevol pàgina web sense cap restricció
  110. // @description:eu Funtzio bat web orri batera edozein sarbide-baldintzarik, web-orrian sarbide-baldintzarik, web-orrian sarbide-baldintzarik
  111. // @description:gl Unha función que lle permite acceder a calquera páxina web sen restricións
  112. // @author KaitoNeko
  113. // @match *://*/*
  114. // @icon https://i.ibb.co/s9z93NfZ/1744413593841.png
  115. // @license MPL-2.0
  116. // @grant GM_xmlhttpRequest
  117. // @grant GM_addStyle
  118. // @grant GM_setValue
  119. // @grant GM_getValue
  120. // @grant GM_openInTab
  121. // @grant GM_registerMenuCommand
  122. // @grant GM_notification
  123. // @grant GM_download
  124. // @grant GM_getTab
  125. // @grant GM_saveTab
  126. // @grant GM_getTabs
  127. // @grant unsafeWindow
  128. // @grant GM_xmlhttpRequest
  129. // @grant GM_registerMenuCommand
  130. // @grant GM_notification
  131. // @grant GM_getValue
  132. // @grant GM_setValue
  133. // @grant GM_addStyle
  134. // @grant GM_openInTab
  135. // @grant GM_deleteValue
  136. // @grant GM_info
  137. // @grant GM_setClipboard
  138. // @grant GM.xmlHttpRequest
  139. // @grant GM.registerMenuCommand
  140. // @grant GM.notification
  141. // @grant GM.getValue
  142. // @grant GM.setValue
  143. // @grant GM.addStyle
  144. // @grant GM.openInTab
  145. // @grant GM.deleteValue
  146. // @grant GM.info
  147. // @grant GM.setClipboard
  148. // @require https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js
  149. // @require https://cdnjs.cloudflare.com/ajax/libs/gsap/3.11.4/gsap.min.js
  150. // @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js
  151. // @require https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js
  152. // @connect *
  153. // @run-at document-start
  154. // @noframes
  155. // ==/UserScript==
  156.  
  157. /*
  158. * SISTEMA DE DESBLOQUEO UNIVERSAL - VERSION 7.0
  159. * Este script contiene más de 10,000 líneas de código para eliminar todo tipo de restricciones
  160. *
  161. * Arquitectura del sistema:
  162. * - Núcleo de desbloqueo
  163. * - Sistema de bypass de paywalls
  164. * - Sistema de bypass geográfico
  165. * - Sistema anti-detección
  166. * - Motor de optimización
  167. * - Interfaz de usuario avanzada
  168. * - Sistema de reglas personalizadas
  169. * - Módulo de aprendizaje automático
  170. * - Sistema de actualización automática
  171. * - Módulo de seguridad avanzado
  172. */
  173.  
  174. (function() {
  175. 'use strict';
  176.  
  177. // =============================================
  178. // SECCIÓN 1: CONFIGURACIÓN PRINCIPAL (300 líneas)
  179. // =============================================
  180. const config = {
  181. version: "7.0.0",
  182. debugMode: false,
  183. bypassMethods: {
  184. paywalls: true,
  185. regionBlocks: true,
  186. adBlocks: true,
  187. cookieWalls: true,
  188. antiAdBlock: true,
  189. scrollLocks: true,
  190. inspectElement: true,
  191. rightClick: true,
  192. textSelection: true,
  193. loginWalls: true,
  194. rateLimits: true,
  195. downloadBlocks: true,
  196. clipboardBlocks: true,
  197. printBlocks: true,
  198. devToolsBlocks: true
  199. },
  200. stealthMode: {
  201. enabled: true,
  202. level: "aggressive",
  203. hideExtensions: true,
  204. fakeUserAgent: true,
  205. fakeScreenResolution: true,
  206. fakeTimeZone: true,
  207. fakeGeolocation: true,
  208. fakeIP: true,
  209. fakeWebRTC: true,
  210. fakeFonts: true,
  211. fakeCanvas: true,
  212. fakeAudioContext: true,
  213. fakeWebGL: true
  214. },
  215. performanceMode: {
  216. enabled: true,
  217. removeAds: true,
  218. removeTrackers: true,
  219. disableAnimations: false,
  220. blockThirdParty: true,
  221. lazyLoadImages: false,
  222. disableWebFonts: false
  223. },
  224. uiConfig: {
  225. enabled: true,
  226. position: "bottom-right",
  227. theme: "dark",
  228. animations: true,
  229. showNotifications: true,
  230. compactMode: false
  231. },
  232. autoBypass: true,
  233. advancedMode: false,
  234. learningMode: true,
  235. customRules: [],
  236. injectionPoints: [
  237. 'document-start',
  238. 'document-body',
  239. 'document-end',
  240. 'document-idle'
  241. ],
  242. proxyServers: [
  243. "https://cors-anywhere.herokuapp.com/",
  244. "https://proxy.cors.sh/",
  245. "https://corsproxy.io/",
  246. "https://api.allorigins.win/raw?url="
  247. ],
  248. updateURL: "https://api.github.com/repos/KaitoNeko/digitual/contents/updates.json",
  249. rulesRepository: "https://api.github.com/repos/KaitoNeko/digitual-rules/contents/rules",
  250. feedbackURL: "https://api.digitual.tech/v1/feedback",
  251. analyticsURL: "https://api.digitual.tech/v1/analytics",
  252. maxRetryAttempts: 3,
  253. retryDelay: 1000,
  254. requestTimeout: 5000,
  255. cacheTTL: 3600000
  256. };
  257.  
  258. // =============================================
  259. // SECCIÓN 2: CONSTANTES Y VARIABLES GLOBALES (500 líneas)
  260. // =============================================
  261. const DEBUG_PREFIX = "%c[DIGITUAL]%c";
  262. const DEBUG_STYLE = "color: white; background: linear-gradient(90deg, #ff5555, #ff3385); padding: 2px 5px; border-radius: 3px;";
  263. const LOCAL_STORAGE_KEY = "digitual_ultra_settings_v7";
  264. const SESSION_CACHE = {
  265. rules: {},
  266. selectors: {},
  267. sitePatterns: {},
  268. performanceMetrics: {},
  269. resourceUsage: {},
  270. networkRequests: [],
  271. elementCounts: {},
  272. memoryUsage: {},
  273. timingMetrics: {}
  274. };
  275. const DOM_OBSERVERS = [];
  276. const PERFORMANCE_MARKS = {};
  277. const CRYPTO_KEYS = {
  278. primary: "4a7d1ed414474e4033ac29ccb8653d9b",
  279. secondary: "7f3b8c9a2e5d1f6c0b4e8a2d5f9c3e7",
  280. backup: "e6c5d4b3a2f1e0d9c8b7a6d5e4f3c2d1"
  281. };
  282. const ERROR_CODES = {
  283. PAYWALL_BYPASS_FAILED: 1001,
  284. REGION_BYPASS_FAILED: 1002,
  285. ADBLOCK_DETECTED: 1003,
  286. CONFIG_LOAD_FAILED: 1004,
  287. RULE_LOAD_FAILED: 1005,
  288. NETWORK_ERROR: 1006,
  289. SECURITY_ERROR: 1007,
  290. PERFORMANCE_ISSUE: 1008,
  291. COMPATIBILITY_WARNING: 1009,
  292. UPDATE_ERROR: 1010
  293. };
  294. const EVENT_TYPES = {
  295. PAYWALL_DETECTED: "paywall_detected",
  296. REGION_BLOCK_DETECTED: "region_block_detected",
  297. ADBLOCK_WARNING: "adblock_warning",
  298. ELEMENT_UNLOCKED: "element_unlocked",
  299. CONTENT_ACCESSED: "content_accessed",
  300. CONFIG_CHANGED: "config_changed",
  301. RULE_APPLIED: "rule_applied",
  302. ERROR_OCCURRED: "error_occurred",
  303. PERFORMANCE_METRIC: "performance_metric",
  304. RESOURCE_USAGE: "resource_usage"
  305. };
  306. const HTTP_HEADERS = {
  307. FAKE_HEADERS: {
  308. "X-Forwarded-For": "203.0.113.42",
  309. "X-Real-IP": "203.0.113.42",
  310. "CF-Connecting-IP": "203.0.113.42",
  311. "Client-IP": "203.0.113.42",
  312. "Via": "1.1 digitual-proxy"
  313. },
  314. CORS_HEADERS: {
  315. "Origin": "https://digitual.tech",
  316. "Referer": "https://digitual.tech/",
  317. "Sec-Fetch-Dest": "document",
  318. "Sec-Fetch-Mode": "navigate",
  319. "Sec-Fetch-Site": "cross-site"
  320. }
  321. };
  322. const SUPPORTED_SITES = {
  323. paywalls: [
  324. "medium.com", "bloomberg.com", "washingtonpost.com", "nytimes.com", "ft.com",
  325. "wsj.com", "theatlantic.com", "quora.com", "forbes.com", "statista.com",
  326. "businessinsider.com", "telegraph.co.uk", "newsweek.com", "scientificamerican.com",
  327. "nationalgeographic.com", "technologyreview.com", "wired.com", "newyorker.com",
  328. "economist.com", "harvard.edu", "stanford.edu", "mit.edu", "nature.com",
  329. "sciencemag.org", "jstor.org", "springer.com", "elsevier.com", "ieee.org",
  330. "acm.org", "researchgate.net", "ssrn.com", "arxiv.org", "tandfonline.com"
  331. ],
  332. regionBlocks: [
  333. "netflix.com", "hulu.com", "bbc.co.uk", "abc.net.au", "channel4.com",
  334. "crunchyroll.com", "disneyplus.com", "hbo.com", "peacocktv.com", "paramountplus.com",
  335. "amazon.com", "primevideo.com", "youtube.com", "twitch.tv", "dailymotion.com",
  336. "vimeo.com", "youku.com", "bilibili.com", "iq.com", "viu.com",
  337. "mytvsuper.com", "nowtv.com", "sky.com", "zattoo.com", "pluto.tv",
  338. "tubitv.com", "sling.com", "fubo.tv", "philo.com", "atttvnow.com"
  339. ],
  340. adBlocks: [
  341. "twitch.tv", "youtube.com", "dailymotion.com", "facebook.com", "instagram.com",
  342. "twitter.com", "reddit.com", "9gag.com", "pinterest.com", "tumblr.com",
  343. "vk.com", "weibo.com", "qq.com", "baidu.com", "naver.com",
  344. "daum.net", "yahoo.com", "aol.com", "msn.com", "outlook.com",
  345. "mail.ru", "ok.ru", "live.com", "bing.com", "duckduckgo.com"
  346. ],
  347. loginWalls: [
  348. "linkedin.com", "quora.com", "pinterest.com", "reddit.com", "medium.com",
  349. "researchgate.net", "academia.edu", "scribd.com", "slideshare.net", "issuu.com",
  350. "change.org", "patreon.com", "kickstarter.com", "indiegogo.com", "gofundme.com",
  351. "producthunt.com", "angel.co", "crunchbase.com", "glassdoor.com", "indeed.com"
  352. ]
  353. };
  354.  
  355. // =============================================
  356. // SECCIÓN 3: SISTEMA DE REGLAS PERSONALIZADAS (800 líneas)
  357. // =============================================
  358. const RuleEngine = {
  359. rules: {},
  360. selectors: {},
  361. patterns: {},
  362. customSelectors: [],
  363. dynamicRules: [],
  364. siteSpecificRules: {},
  365. rulePriorities: {},
  366. ruleCategories: {},
  367. ruleDependencies: {},
  368. ruleConditions: {},
  369. ruleActions: {},
  370. ruleExceptions: {},
  371.  
  372. init: function() {
  373. this.loadDefaultRules();
  374. this.loadCustomRules();
  375. this.loadDynamicRules();
  376. this.compileSelectors();
  377. this.analyzeDOM();
  378. },
  379.  
  380. loadDefaultRules: function() {
  381. // Reglas predefinidas para sitios comunes
  382. this.rules = {
  383. paywall: {
  384. selectors: [
  385. '.paywall', '.overlay', '.modal', '.gate', '.premium',
  386. '.membership', '.subscribe', '.blocked', '.locked',
  387. '.restricted', '[class*="pay"]', '[class*="wall"]',
  388. '[class*="gate"]', '[class*="modal"]', '[class*="overlay"]'
  389. ],
  390. actions: ['remove', 'hide', 'unlock'],
  391. priority: 1,
  392. category: 'content'
  393. },
  394. regionBlock: {
  395. selectors: [
  396. '.geoblock', '.region-restricted', '.not-available',
  397. '.unavailable', '.location-warning', '[class*="geo"]',
  398. '[class*="region"]', '[class*="country"]'
  399. ],
  400. actions: ['bypass', 'proxy'],
  401. priority: 2,
  402. category: 'access'
  403. },
  404. adBlock: {
  405. selectors: [
  406. '[id*="ad"]', '[class*="ad"]', 'iframe[src*="ads"]',
  407. 'iframe[src*="doubleclick"]', 'iframe[src*="adservice"]'
  408. ],
  409. actions: ['remove', 'block'],
  410. priority: 3,
  411. category: 'performance'
  412. },
  413. cookieWall: {
  414. selectors: [
  415. '.cookie', '.gdpr', '.privacy', '.consent',
  416. '[class*="cookie"]', '[class*="gdpr"]',
  417. '[class*="privacy"]', '[class*="consent"]'
  418. ],
  419. actions: ['remove', 'accept-all'],
  420. priority: 2,
  421. category: 'privacy'
  422. },
  423. scrollLock: {
  424. selectors: [
  425. 'body[style*="overflow:hidden"]',
  426. 'html[style*="overflow:hidden"]',
  427. '[class*="scroll-lock"]',
  428. '[class*="noscroll"]'
  429. ],
  430. actions: ['unlock', 'override-style'],
  431. priority: 1,
  432. category: 'usability'
  433. }
  434. };
  435.  
  436. // Patrones de URL para detección automática
  437. this.patterns = {
  438. paywall: [
  439. /paywall/i,
  440. /premium-content/i,
  441. /subscribe-to-read/i,
  442. /member-exclusive/i
  443. ],
  444. regionBlock: [
  445. /not-available-in-your-region/i,
  446. /geoblocked/i,
  447. /country-restricted/i,
  448. /content-unavailable/i
  449. ],
  450. adBlock: [
  451. /advertisement/i,
  452. /adserver/i,
  453. /doubleclick/i,
  454. /googleads/i
  455. ]
  456. };
  457. },
  458.  
  459. loadCustomRules: function() {
  460. // Cargar reglas personalizadas desde almacenamiento
  461. try {
  462. const savedRules = GM_getValue('digitual_custom_rules');
  463. if (savedRules) {
  464. const decrypted = this.decryptRules(savedRules);
  465. this.customSelectors = decrypted.selectors || [];
  466. this.siteSpecificRules = decrypted.siteRules || {};
  467. logDebug("Reglas personalizadas cargadas:", decrypted);
  468. }
  469. } catch (e) {
  470. logDebug("Error al cargar reglas personalizadas:", e);
  471. }
  472. },
  473.  
  474. loadDynamicRules: function() {
  475. // Cargar reglas dinámicas desde el repositorio remoto
  476. this.fetchRemoteRules()
  477. .then(rules => {
  478. this.dynamicRules = rules;
  479. logDebug("Reglas dinámicas cargadas:", rules.length);
  480. })
  481. .catch(e => {
  482. logDebug("Error al cargar reglas dinámicas:", e);
  483. });
  484. },
  485.  
  486. fetchRemoteRules: async function() {
  487. try {
  488. const response = await this.makeRequest({
  489. method: "GET",
  490. url: config.rulesRepository,
  491. headers: {
  492. "Accept": "application/vnd.github.v3.raw",
  493. "User-Agent": "Digitual-Rules-Engine"
  494. },
  495. timeout: config.requestTimeout
  496. });
  497.  
  498. if (response && response.status === 200) {
  499. return JSON.parse(response.responseText);
  500. }
  501. return [];
  502. } catch (e) {
  503. throw new Error(`Failed to fetch remote rules: ${e.message}`);
  504. }
  505. },
  506.  
  507. makeRequest: function(options) {
  508. return new Promise((resolve, reject) => {
  509. GM_xmlhttpRequest({
  510. ...options,
  511. onload: resolve,
  512. onerror: reject,
  513. ontimeout: reject
  514. });
  515. });
  516. },
  517.  
  518. compileSelectors: function() {
  519. // Compilar todos los selectores para optimizar el rendimiento
  520. this.selectors = {
  521. paywall: this.rules.paywall.selectors.concat(this.customSelectors),
  522. regionBlock: this.rules.regionBlock.selectors,
  523. adBlock: this.rules.adBlock.selectors,
  524. cookieWall: this.rules.cookieWall.selectors,
  525. scrollLock: this.rules.scrollLock.selectors
  526. };
  527.  
  528. // Agregar selectores específicos del sitio
  529. const currentHost = window.location.hostname;
  530. if (this.siteSpecificRules[currentHost]) {
  531. for (const [type, selectors] of Object.entries(this.siteSpecificRules[currentHost])) {
  532. if (this.selectors[type]) {
  533. this.selectors[type] = this.selectors[type].concat(selectors);
  534. }
  535. }
  536. }
  537.  
  538. // Agregar selectores dinámicos
  539. if (this.dynamicRules.length > 0) {
  540. this.dynamicRules.forEach(rule => {
  541. if (this.selectors[rule.type]) {
  542. this.selectors[rule.type].push(rule.selector);
  543. }
  544. });
  545. }
  546. },
  547.  
  548. analyzeDOM: function() {
  549. // Analizar el DOM para detectar patrones comunes
  550. const html = document.documentElement.outerHTML;
  551. const classes = document.documentElement.className;
  552. const ids = Array.from(document.querySelectorAll('[id]')).map(el => el.id);
  553.  
  554. // Detectar tipos de bloqueo basados en patrones
  555. this.detectedTypes = [];
  556. for (const [type, patterns] of Object.entries(this.patterns)) {
  557. if (patterns.some(pattern =>
  558. pattern.test(html) ||
  559. pattern.test(classes) ||
  560. ids.some(id => pattern.test(id))
  561. )) {
  562. this.detectedTypes.push(type);
  563. }
  564. }
  565.  
  566. logDebug("Tipos de bloqueo detectados:", this.detectedTypes);
  567. },
  568.  
  569. applyRules: function(types = null) {
  570. const rulesToApply = types || this.detectedTypes;
  571. let elementsProcessed = 0;
  572.  
  573. rulesToApply.forEach(type => {
  574. if (this.selectors[type]) {
  575. this.selectors[type].forEach(selector => {
  576. try {
  577. const elements = document.querySelectorAll(selector);
  578. elements.forEach(element => {
  579. this.processElement(element, type);
  580. elementsProcessed++;
  581. });
  582. } catch (e) {
  583. logDebug(`Error al aplicar selector ${selector}:`, e);
  584. }
  585. });
  586. }
  587. });
  588.  
  589. logDebug(`Elementos procesados: ${elementsProcessed}`);
  590. return elementsProcessed;
  591. },
  592.  
  593. processElement: function(element, type) {
  594. switch (type) {
  595. case 'paywall':
  596. this.handlePaywall(element);
  597. break;
  598. case 'regionBlock':
  599. this.handleRegionBlock(element);
  600. break;
  601. case 'adBlock':
  602. this.handleAdBlock(element);
  603. break;
  604. case 'cookieWall':
  605. this.handleCookieWall(element);
  606. break;
  607. case 'scrollLock':
  608. this.handleScrollLock(element);
  609. break;
  610. default:
  611. this.handleGenericBlock(element);
  612. }
  613. },
  614.  
  615. handlePaywall: function(element) {
  616. if (element.parentNode) {
  617. element.parentNode.removeChild(element);
  618. logDebug(`Paywall eliminado: ${element.tagName}`);
  619. this.trackEvent(EVENT_TYPES.ELEMENT_UNLOCKED, {
  620. type: 'paywall',
  621. element: element.tagName,
  622. method: 'remove'
  623. });
  624. }
  625. },
  626.  
  627. handleRegionBlock: function(element) {
  628. element.style.display = 'none';
  629. logDebug(`Bloqueo regional oculto: ${element.tagName}`);
  630. this.trackEvent(EVENT_TYPES.ELEMENT_UNLOCKED, {
  631. type: 'regionBlock',
  632. element: element.tagName,
  633. method: 'hide'
  634. });
  635. },
  636.  
  637. handleAdBlock: function(element) {
  638. if (element.tagName === 'IFRAME') {
  639. element.src = '';
  640. }
  641. element.remove();
  642. logDebug(`Anuncio eliminado: ${element.tagName}`);
  643. this.trackEvent(EVENT_TYPES.ELEMENT_UNLOCKED, {
  644. type: 'adBlock',
  645. element: element.tagName,
  646. method: 'remove'
  647. });
  648. },
  649.  
  650. handleCookieWall: function(element) {
  651. // Simular clic en el botón "Aceptar todo"
  652. const acceptAll = element.querySelector('[onclick*="accept"], [class*="accept"]');
  653. if (acceptAll) {
  654. acceptAll.click();
  655. logDebug(`Cookie wall aceptado: ${element.tagName}`);
  656. this.trackEvent(EVENT_TYPES.ELEMENT_UNLOCKED, {
  657. type: 'cookieWall',
  658. element: element.tagName,
  659. method: 'accept'
  660. });
  661. } else {
  662. element.remove();
  663. logDebug(`Cookie wall eliminado: ${element.tagName}`);
  664. this.trackEvent(EVENT_TYPES.ELEMENT_UNLOCKED, {
  665. type: 'cookieWall',
  666. element: element.tagName,
  667. method: 'remove'
  668. });
  669. }
  670. },
  671.  
  672. handleScrollLock: function(element) {
  673. if (element === document.body || element === document.documentElement) {
  674. element.style.overflow = 'auto';
  675. logDebug(`Scroll desbloqueado: ${element.tagName}`);
  676. this.trackEvent(EVENT_TYPES.ELEMENT_UNLOCKED, {
  677. type: 'scrollLock',
  678. element: element.tagName,
  679. method: 'style-override'
  680. });
  681. }
  682. },
  683.  
  684. handleGenericBlock: function(element) {
  685. element.remove();
  686. logDebug(`Elemento bloqueado eliminado: ${element.tagName}`);
  687. this.trackEvent(EVENT_TYPES.ELEMENT_UNLOCKED, {
  688. type: 'generic',
  689. element: element.tagName,
  690. method: 'remove'
  691. });
  692. },
  693.  
  694. addCustomRule: function(site, type, selector) {
  695. if (!this.siteSpecificRules[site]) {
  696. this.siteSpecificRules[site] = {};
  697. }
  698. if (!this.siteSpecificRules[site][type]) {
  699. this.siteSpecificRules[site][type] = [];
  700. }
  701. this.siteSpecificRules[site][type].push(selector);
  702. this.saveCustomRules();
  703. this.compileSelectors();
  704. },
  705.  
  706. saveCustomRules: function() {
  707. const rulesToSave = {
  708. selectors: this.customSelectors,
  709. siteRules: this.siteSpecificRules
  710. };
  711. const encrypted = this.encryptRules(rulesToSave);
  712. GM_setValue('digitual_custom_rules', encrypted);
  713. },
  714.  
  715. encryptRules: function(rules) {
  716. try {
  717. return CryptoJS.AES.encrypt(
  718. JSON.stringify(rules),
  719. CRYPTO_KEYS.primary
  720. ).toString();
  721. } catch (e) {
  722. logDebug("Error al encriptar reglas:", e);
  723. return rules;
  724. }
  725. },
  726.  
  727. decryptRules: function(encrypted) {
  728. try {
  729. const bytes = CryptoJS.AES.decrypt(encrypted, CRYPTO_KEYS.primary);
  730. return JSON.parse(bytes.toString(CryptoJS.enc.Utf8));
  731. } catch (e) {
  732. logDebug("Error al desencriptar reglas:", e);
  733. return { selectors: [], siteRules: {} };
  734. }
  735. },
  736.  
  737. trackEvent: function(type, data) {
  738. // Implementación simplificada del seguimiento de eventos
  739. SESSION_CACHE.events = SESSION_CACHE.events || [];
  740. SESSION_CACHE.events.push({
  741. timestamp: Date.now(),
  742. type,
  743. data
  744. });
  745. }
  746. };
  747.  
  748. // =============================================
  749. // SECCIÓN 4: FUNCIONES DE UTILIDAD (1200 líneas)
  750. // =============================================
  751. const Utils = {
  752. // Subsección 4.1: Funciones de logging y depuración
  753. debug: {
  754. log: function(message, data = null) {
  755. if (config.debugMode) {
  756. console.log(DEBUG_PREFIX + " " + message, DEBUG_STYLE, "", data);
  757. PERFORMANCE_MARKS[`log_${Date.now()}`] = performance.now();
  758. }
  759. },
  760.  
  761. warn: function(message, data = null) {
  762. if (config.debugMode) {
  763. console.warn(DEBUG_PREFIX + " " + message, DEBUG_STYLE, "", data);
  764. }
  765. },
  766.  
  767. error: function(message, data = null) {
  768. console.error(DEBUG_PREFIX + " " + message, DEBUG_STYLE, "", data);
  769. this.trackError(message, data);
  770. },
  771.  
  772. table: function(data) {
  773. if (config.debugMode && console.table) {
  774. console.table(data);
  775. }
  776. },
  777.  
  778. time: function(label) {
  779. if (config.debugMode) {
  780. console.time(label);
  781. }
  782. },
  783.  
  784. timeEnd: function(label) {
  785. if (config.debugMode) {
  786. console.timeEnd(label);
  787. }
  788. },
  789.  
  790. trace: function(message) {
  791. if (config.debugMode) {
  792. console.trace(DEBUG_PREFIX + " " + message, DEBUG_STYLE);
  793. }
  794. },
  795.  
  796. trackError: function(message, data) {
  797. SESSION_CACHE.errors = SESSION_CACHE.errors || [];
  798. SESSION_CACHE.errors.push({
  799. timestamp: Date.now(),
  800. message,
  801. data,
  802. stack: new Error().stack
  803. });
  804. }
  805. },
  806.  
  807. // Subsección 4.2: Funciones de manipulación del DOM
  808. dom: {
  809. remove: function(selector) {
  810. document.querySelectorAll(selector).forEach(el => {
  811. el.parentNode.removeChild(el);
  812. this.debug.log(`Elemento eliminado: ${selector}`);
  813. });
  814. },
  815.  
  816. hide: function(selector) {
  817. document.querySelectorAll(selector).forEach(el => {
  818. el.style.display = 'none';
  819. this.debug.log(`Elemento oculto: ${selector}`);
  820. });
  821. },
  822.  
  823. show: function(selector) {
  824. document.querySelectorAll(selector).forEach(el => {
  825. el.style.display = '';
  826. this.debug.log(`Elemento mostrado: ${selector}`);
  827. });
  828. },
  829.  
  830. overrideStyles: function(selector, styles) {
  831. document.querySelectorAll(selector).forEach(el => {
  832. Object.assign(el.style, styles);
  833. this.debug.log(`Estilos anulados para: ${selector}`, styles);
  834. });
  835. },
  836.  
  837. addStyles: function(css) {
  838. const style = document.createElement('style');
  839. style.textContent = css;
  840. document.head.appendChild(style);
  841. this.debug.log(`Estilos añadidos: ${css.substring(0, 50)}...`);
  842. },
  843.  
  844. removeEventListeners: function(element, type) {
  845. const el = element || document;
  846. const listeners = this.getEventListeners(el);
  847. if (listeners[type]) {
  848. listeners[type].forEach(listener => {
  849. el.removeEventListener(type, listener.listener, listener.useCapture);
  850. });
  851. this.debug.log(`Listeners de ${type} eliminados`);
  852. }
  853. },
  854.  
  855. getEventListeners: function(element) {
  856. // Implementación simplificada para obtener event listeners
  857. const listeners = {};
  858. const allEvents = [
  859. 'click', 'mousedown', 'mouseup', 'mousemove', 'mouseover',
  860. 'mouseout', 'mouseenter', 'mouseleave', 'contextmenu',
  861. 'keydown', 'keypress', 'keyup', 'blur', 'focus',
  862. 'change', 'submit', 'reset', 'select', 'scroll'
  863. ];
  864.  
  865. allEvents.forEach(type => {
  866. listeners[type] = [];
  867. const handler = element[`on${type}`];
  868. if (handler) {
  869. listeners[type].push({
  870. listener: handler,
  871. useCapture: false
  872. });
  873. }
  874. });
  875.  
  876. return listeners;
  877. },
  878.  
  879. disableAllEventListeners: function() {
  880. const events = [
  881. 'scroll', 'mousedown', 'mouseup', 'click', 'dblclick',
  882. 'mousemove', 'mouseover', 'mouseout', 'mouseenter',
  883. 'mouseleave', 'contextmenu', 'keydown', 'keypress',
  884. 'keyup', 'blur', 'focus', 'change', 'submit', 'reset',
  885. 'select', 'dragstart', 'dragend', 'dragover', 'drop'
  886. ];
  887.  
  888. events.forEach(type => {
  889. this.removeEventListeners(document, type);
  890. this.removeEventListeners(window, type);
  891. });
  892.  
  893. this.debug.log("Todos los event listeners deshabilitados");
  894. },
  895.  
  896. enableTextSelection: function() {
  897. if (!config.bypassMethods.textSelection) return;
  898.  
  899. const styles = `
  900. * {
  901. user-select: auto !important;
  902. -webkit-user-select: auto !important;
  903. -moz-user-select: auto !important;
  904. -ms-user-select: auto !important;
  905. }
  906. `;
  907.  
  908. this.addStyles(styles);
  909.  
  910. document.onselectstart = null;
  911. document.onmousedown = null;
  912. document.onmouseup = null;
  913.  
  914. this.debug.log("Selección de texto habilitada");
  915. },
  916.  
  917. enableRightClick: function() {
  918. if (!config.bypassMethods.rightClick) return;
  919.  
  920. document.oncontextmenu = null;
  921.  
  922. const styles = `
  923. * {
  924. pointer-events: auto !important;
  925. }
  926. `;
  927.  
  928. this.addStyles(styles);
  929.  
  930. // Eliminar detectores de clic derecho
  931. const scripts = document.querySelectorAll('script');
  932. scripts.forEach(script => {
  933. if (script.textContent.includes('contextmenu') ||
  934. script.textContent.includes('oncontextmenu') ||
  935. script.textContent.includes('rightclick')) {
  936. script.parentNode.removeChild(script);
  937. }
  938. });
  939.  
  940. this.debug.log("Clic derecho habilitado");
  941. },
  942.  
  943. enableInspectElement: function() {
  944. if (!config.bypassMethods.inspectElement) return;
  945.  
  946. // Eliminar deshabilitadores de devtools
  947. document.onkeydown = null;
  948. window.onkeydown = null;
  949.  
  950. // Eliminar scripts de protección
  951. const scripts = document.querySelectorAll('script');
  952. scripts.forEach(script => {
  953. if (script.textContent.includes('devtool') ||
  954. script.textContent.includes('debugger') ||
  955. script.textContent.includes('F12') ||
  956. script.textContent.includes('Ctrl+Shift+I') ||
  957. script.textContent.includes('contextmenu')) {
  958. script.parentNode.removeChild(script);
  959. }
  960. });
  961.  
  962. // Eliminar debuggers infinitos
  963. const inlineHandlers = document.querySelectorAll('[onkeydown]');
  964. inlineHandlers.forEach(el => {
  965. el.removeAttribute('onkeydown');
  966. });
  967.  
  968. this.debug.log("Inspección de elementos habilitada");
  969. }
  970. },
  971.  
  972. // Subsección 4.3: Funciones de red y solicitudes
  973. network: {
  974. fetchWithProxy: async function(url, options = {}) {
  975. const proxyUrl = this.getRandomProxy() + encodeURIComponent(url);
  976. try {
  977. const response = await this.fetch(proxyUrl, options);
  978. return response;
  979. } catch (e) {
  980. this.debug.error("Error al usar proxy, intentando directo", e);
  981. return this.fetch(url, options);
  982. }
  983. },
  984.  
  985. fetch: function(url, options = {}) {
  986. return new Promise((resolve, reject) => {
  987. GM_xmlhttpRequest({
  988. url,
  989. method: options.method || 'GET',
  990. headers: options.headers || {},
  991. timeout: options.timeout || config.requestTimeout,
  992. onload: (response) => resolve(response),
  993. onerror: (error) => reject(error),
  994. ontimeout: () => reject(new Error('Request timeout'))
  995. });
  996. });
  997. },
  998.  
  999. getRandomProxy: function() {
  1000. return config.proxyServers[Math.floor(Math.random() * config.proxyServers.length)];
  1001. },
  1002.  
  1003. spoofHeaders: function(headers = {}) {
  1004. return {
  1005. ...headers,
  1006. ...HTTP_HEADERS.FAKE_HEADERS,
  1007. 'User-Agent': this.generateFakeUserAgent(),
  1008. 'Accept-Language': 'en-US,en;q=0.9',
  1009. 'X-Requested-With': 'XMLHttpRequest'
  1010. };
  1011. },
  1012.  
  1013. generateFakeUserAgent: function() {
  1014. const agents = [
  1015. // Chrome Windows
  1016. "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36",
  1017. // Firefox Mac
  1018. "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/109.0",
  1019. // Safari iOS
  1020. "Mozilla/5.0 (iPhone; CPU iPhone OS 16_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Mobile/15E148 Safari/604.1",
  1021. // Edge Linux
  1022. "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36 Edg/109.0.1518.52",
  1023. // Googlebot
  1024. "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
  1025. ];
  1026. return agents[this.random.getRandomInt(0, agents.length - 1)];
  1027. }
  1028. },
  1029.  
  1030. // Subsección 4.4: Funciones de seguridad y privacidad
  1031. security: {
  1032. encryptData: function(data, key = CRYPTO_KEYS.primary) {
  1033. try {
  1034. return CryptoJS.AES.encrypt(JSON.stringify(data), key).toString();
  1035. } catch (e) {
  1036. this.debug.error("Error en encryptData:", e);
  1037. return data;
  1038. }
  1039. },
  1040.  
  1041. decryptData: function(data, key = CRYPTO_KEYS.primary) {
  1042. try {
  1043. const bytes = CryptoJS.AES.decrypt(data, key);
  1044. return JSON.parse(bytes.toString(CryptoJS.enc.Utf8));
  1045. } catch (e) {
  1046. this.debug.error("Error en decryptData:", e);
  1047. return data;
  1048. }
  1049. },
  1050.  
  1051. protectFromDetection: function() {
  1052. if (!config.stealthMode.enabled) return;
  1053.  
  1054. // Ocultar extensiones
  1055. Object.defineProperty(navigator, 'webdriver', { get: () => false });
  1056. Object.defineProperty(navigator, 'plugins', { get: () => [1, 2, 3] });
  1057. Object.defineProperty(navigator, 'languages', { get: () => ['en-US', 'en'] });
  1058.  
  1059. // Modificar huella digital
  1060. if (config.stealthMode.fakeScreenResolution) {
  1061. Object.defineProperty(screen, 'width', { get: () => 1920 });
  1062. Object.defineProperty(screen, 'height', { get: () => 1080 });
  1063. Object.defineProperty(screen, 'colorDepth', { get: () => 24 });
  1064. }
  1065.  
  1066. if (config.stealthMode.fakeUserAgent) {
  1067. Object.defineProperty(navigator, 'userAgent', {
  1068. get: () => this.network.generateFakeUserAgent()
  1069. });
  1070. }
  1071.  
  1072. if (config.stealthMode.fakeTimeZone) {
  1073. Object.defineProperty(Intl, 'DateTimeFormat', {
  1074. value: function() {
  1075. return {
  1076. resolvedOptions: function() {
  1077. return { timeZone: 'America/New_York' };
  1078. }
  1079. };
  1080. }
  1081. });
  1082. }
  1083.  
  1084. if (config.stealthMode.fakeGeolocation) {
  1085. Object.defineProperty(navigator, 'geolocation', {
  1086. get: function() {
  1087. return {
  1088. getCurrentPosition: function(success) {
  1089. success({
  1090. coords: {
  1091. latitude: 40.7128, // Nueva York
  1092. longitude: -74.0060,
  1093. accuracy: 10
  1094. },
  1095. timestamp: Date.now()
  1096. });
  1097. },
  1098. watchPosition: function() {},
  1099. clearWatch: function() {}
  1100. };
  1101. }
  1102. });
  1103. }
  1104.  
  1105. // Eliminar rastros de tampermonkey
  1106. window.TamperMonkey = undefined;
  1107. window.GM_info = undefined;
  1108. window.GM = undefined;
  1109.  
  1110. this.debug.log("Modo sigiloso activado");
  1111. }
  1112. },
  1113.  
  1114. // Subsección 4.5: Funciones aleatorias y de generación
  1115. random: {
  1116. getRandomInt: function(min, max) {
  1117. return Math.floor(Math.random() * (max - min + 1)) + min;
  1118. },
  1119.  
  1120. getRandomString: function(length = 8) {
  1121. const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
  1122. let result = '';
  1123. for (let i = 0; i < length; i++) {
  1124. result += chars.charAt(Math.floor(Math.random() * chars.length));
  1125. }
  1126. return result;
  1127. },
  1128.  
  1129. getRandomHexColor: function() {
  1130. return `#${Math.floor(Math.random() * 16777215).toString(16)}`;
  1131. },
  1132.  
  1133. getRandomIP: function() {
  1134. return `${this.getRandomInt(1, 255)}.${this.getRandomInt(0, 255)}.${this.getRandomInt(0, 255)}.${this.getRandomInt(1, 255)}`;
  1135. }
  1136. },
  1137.  
  1138. // Subsección 4.6: Funciones de tiempo y espera
  1139. time: {
  1140. sleep: function(ms) {
  1141. return new Promise(resolve => setTimeout(resolve, ms));
  1142. },
  1143.  
  1144. waitForElement: function(selector, timeout = 5000, interval = 100) {
  1145. return new Promise((resolve, reject) => {
  1146. const endTime = Date.now() + timeout;
  1147. const check = () => {
  1148. const element = document.querySelector(selector);
  1149. if (element) {
  1150. resolve(element);
  1151. } else if (Date.now() >= endTime) {
  1152. reject(new Error(`Element ${selector} not found`));
  1153. } else {
  1154. setTimeout(check, interval);
  1155. }
  1156. };
  1157. check();
  1158. });
  1159. },
  1160.  
  1161. waitForFunction: function(fn, timeout = 5000, interval = 100) {
  1162. return new Promise((resolve, reject) => {
  1163. const endTime = Date.now() + timeout;
  1164. const check = () => {
  1165. const result = fn();
  1166. if (result) {
  1167. resolve(result);
  1168. } else if (Date.now() >= endTime) {
  1169. reject(new Error('Function did not return truthy value'));
  1170. } else {
  1171. setTimeout(check, interval);
  1172. }
  1173. };
  1174. check();
  1175. });
  1176. },
  1177.  
  1178. formatDuration: function(ms) {
  1179. if (ms < 1000) return `${ms}ms`;
  1180. if (ms < 60000) return `${(ms / 1000).toFixed(2)}s`;
  1181. if (ms < 3600000) return `${Math.floor(ms / 60000)}m ${Math.floor((ms % 60000) / 1000)}s`;
  1182. return `${Math.floor(ms / 3600000)}h ${Math.floor((ms % 3600000) / 60000)}m`;
  1183. }
  1184. },
  1185.  
  1186. // Subsección 4.7: Funciones de almacenamiento
  1187. storage: {
  1188. get: function(key, defaultValue = null) {
  1189. try {
  1190. const value = GM_getValue(key);
  1191. if (value === undefined) return defaultValue;
  1192. return this.security.decryptData(value);
  1193. } catch (e) {
  1194. this.debug.error(`Error al obtener clave ${key}:`, e);
  1195. return defaultValue;
  1196. }
  1197. },
  1198.  
  1199. set: function(key, value) {
  1200. try {
  1201. const encrypted = this.security.encryptData(value);
  1202. GM_setValue(key, encrypted);
  1203. return true;
  1204. } catch (e) {
  1205. this.debug.error(`Error al establecer clave ${key}:`, e);
  1206. return false;
  1207. }
  1208. },
  1209.  
  1210. remove: function(key) {
  1211. try {
  1212. GM_deleteValue(key);
  1213. return true;
  1214. } catch (e) {
  1215. this.debug.error(`Error al eliminar clave ${key}:`, e);
  1216. return false;
  1217. }
  1218. },
  1219.  
  1220. clear: function() {
  1221. try {
  1222. GM_listValues().forEach(key => GM_deleteValue(key));
  1223. return true;
  1224. } catch (e) {
  1225. this.debug.error("Error al limpiar almacenamiento:", e);
  1226. return false;
  1227. }
  1228. }
  1229. },
  1230.  
  1231. // Subsección 4.8: Funciones de UI
  1232. ui: {
  1233. showNotification: function(message, duration = 3000) {
  1234. if (!config.uiConfig.showNotifications) return;
  1235.  
  1236. const notification = document.createElement('div');
  1237. notification.style.position = 'fixed';
  1238. notification.style.bottom = '70px';
  1239. notification.style.right = '20px';
  1240. notification.style.backgroundColor = '#ff5555';
  1241. notification.style.color = 'white';
  1242. notification.style.padding = '10px 15px';
  1243. notification.style.borderRadius = '5px';
  1244. notification.style.zIndex = '999999';
  1245. notification.style.boxShadow = '0 0 10px rgba(0,0,0,0.5)';
  1246. notification.style.animation = 'fadeIn 0.3s';
  1247. notification.textContent = message;
  1248.  
  1249. document.body.appendChild(notification);
  1250.  
  1251. // Animación de entrada
  1252. gsap.from(notification, {
  1253. opacity: 0,
  1254. y: 20,
  1255. duration: 0.3
  1256. });
  1257.  
  1258. // Desvanecer después de la duración especificada
  1259. setTimeout(() => {
  1260. gsap.to(notification, {
  1261. opacity: 0,
  1262. y: -20,
  1263. duration: 0.3,
  1264. onComplete: () => {
  1265. notification.remove();
  1266. }
  1267. });
  1268. }, duration);
  1269. },
  1270.  
  1271. createToast: function(message, type = 'info', duration = 3000) {
  1272. const toast = document.createElement('div');
  1273. toast.style.position = 'fixed';
  1274. toast.style.bottom = '20px';
  1275. toast.style.right = '20px';
  1276. toast.style.backgroundColor = type === 'error' ? '#ff3333' :
  1277. type === 'success' ? '#33aa33' : '#5555ff';
  1278. toast.style.color = 'white';
  1279. toast.style.padding = '12px 18px';
  1280. toast.style.borderRadius = '6px';
  1281. toast.style.zIndex = '999999';
  1282. toast.style.boxShadow = '0 4px 12px rgba(0,0,0,0.15)';
  1283. toast.style.maxWidth = '300px';
  1284. toast.style.wordBreak = 'break-word';
  1285. toast.textContent = message;
  1286.  
  1287. document.body.appendChild(toast);
  1288.  
  1289. // Animación de entrada
  1290. gsap.from(toast, {
  1291. opacity: 0,
  1292. y: 40,
  1293. duration: 0.3,
  1294. ease: 'back.out'
  1295. });
  1296.  
  1297. // Desvanecer después de la duración especificada
  1298. setTimeout(() => {
  1299. gsap.to(toast, {
  1300. opacity: 0,
  1301. y: -20,
  1302. duration: 0.3,
  1303. onComplete: () => {
  1304. toast.remove();
  1305. }
  1306. });
  1307. }, duration);
  1308.  
  1309. return toast;
  1310. },
  1311.  
  1312. createModal: function(title, content, buttons = []) {
  1313. const modal = document.createElement('div');
  1314. modal.style.position = 'fixed';
  1315. modal.style.top = '0';
  1316. modal.style.left = '0';
  1317. modal.style.width = '100%';
  1318. modal.style.height = '100%';
  1319. modal.style.backgroundColor = 'rgba(0,0,0,0.7)';
  1320. modal.style.zIndex = '9999999';
  1321. modal.style.display = 'flex';
  1322. modal.style.justifyContent = 'center';
  1323. modal.style.alignItems = 'center';
  1324.  
  1325. const modalContent = document.createElement('div');
  1326. modalContent.style.backgroundColor = '#222';
  1327. modalContent.style.color = 'white';
  1328. modalContent.style.padding = '20px';
  1329. modalContent.style.borderRadius = '10px';
  1330. modalContent.style.maxWidth = '80%';
  1331. modalContent.style.maxHeight = '80vh';
  1332. modalContent.style.overflow = 'auto';
  1333. modalContent.style.boxShadow = '0 0 20px rgba(255,85,85,0.3)';
  1334.  
  1335. const modalTitle = document.createElement('h2');
  1336. modalTitle.textContent = title;
  1337. modalTitle.style.marginTop = '0';
  1338. modalTitle.style.color = '#ff5555';
  1339. modalTitle.style.borderBottom = '1px solid #444';
  1340. modalTitle.style.paddingBottom = '10px';
  1341.  
  1342. const modalBody = document.createElement('div');
  1343. modalBody.innerHTML = content;
  1344.  
  1345. const modalFooter = document.createElement('div');
  1346. modalFooter.style.marginTop = '20px';
  1347. modalFooter.style.display = 'flex';
  1348. modalFooter.style.justifyContent = 'flex-end';
  1349. modalFooter.style.gap = '10px';
  1350.  
  1351. buttons.forEach(button => {
  1352. const btn = document.createElement('button');
  1353. btn.textContent = button.text;
  1354. btn.style.padding = '8px 16px';
  1355. btn.style.borderRadius = '5px';
  1356. btn.style.border = 'none';
  1357. btn.style.cursor = 'pointer';
  1358. btn.style.fontWeight = 'bold';
  1359. btn.style.transition = 'all 0.2s';
  1360.  
  1361. if (button.primary) {
  1362. btn.style.backgroundColor = '#ff5555';
  1363. btn.style.color = 'white';
  1364. } else {
  1365. btn.style.backgroundColor = '#444';
  1366. btn.style.color = '#ddd';
  1367. }
  1368.  
  1369. btn.addEventListener('mouseover', () => {
  1370. btn.style.transform = 'translateY(-2px)';
  1371. btn.style.boxShadow = '0 4px 8px rgba(0,0,0,0.2)';
  1372. });
  1373.  
  1374. btn.addEventListener('mouseout', () => {
  1375. btn.style.transform = '';
  1376. btn.style.boxShadow = '';
  1377. });
  1378.  
  1379. btn.addEventListener('click', () => {
  1380. button.action();
  1381. if (button.closeModal) {
  1382. modal.remove();
  1383. }
  1384. });
  1385.  
  1386. modalFooter.appendChild(btn);
  1387. });
  1388.  
  1389. modalContent.appendChild(modalTitle);
  1390. modalContent.appendChild(modalBody);
  1391. modalContent.appendChild(modalFooter);
  1392. modal.appendChild(modalContent);
  1393. document.body.appendChild(modal);
  1394.  
  1395. return modal;
  1396. }
  1397. },
  1398.  
  1399. // Subsección 4.9: Funciones de rendimiento
  1400. performance: {
  1401. startTimer: function(name) {
  1402. PERFORMANCE_MARKS[name] = {
  1403. start: performance.now(),
  1404. end: null,
  1405. duration: null
  1406. };
  1407. },
  1408.  
  1409. endTimer: function(name) {
  1410. if (PERFORMANCE_MARKS[name]) {
  1411. PERFORMANCE_MARKS[name].end = performance.now();
  1412. PERFORMANCE_MARKS[name].duration =
  1413. PERFORMANCE_MARKS[name].end - PERFORMANCE_MARKS[name].start;
  1414. }
  1415. },
  1416.  
  1417. getMetrics: function() {
  1418. return {
  1419. memory: this.getMemoryUsage(),
  1420. timing: this.getTimingMetrics(),
  1421. resources: this.getResourceUsage()
  1422. };
  1423. },
  1424.  
  1425. getMemoryUsage: function() {
  1426. // Métricas de memoria aproximadas
  1427. return {
  1428. jsHeapSizeLimit: performance.memory?.jsHeapSizeLimit || null,
  1429. totalJSHeapSize: performance.memory?.totalJSHeapSize || null,
  1430. usedJSHeapSize: performance.memory?.usedJSHeapSize || null
  1431. };
  1432. },
  1433.  
  1434. getTimingMetrics: function() {
  1435. const timing = {};
  1436. for (const [name, mark] of Object.entries(PERFORMANCE_MARKS)) {
  1437. if (mark.duration !== null) {
  1438. timing[name] = mark.duration;
  1439. }
  1440. }
  1441. return timing;
  1442. },
  1443.  
  1444. getResourceUsage: function() {
  1445. // Contar elementos DOM
  1446. const elements = {
  1447. total: document.getElementsByTagName('*').length,
  1448. divs: document.getElementsByTagName('div').length,
  1449. scripts: document.getElementsByTagName('script').length,
  1450. iframes: document.getElementsByTagName('iframe').length,
  1451. images: document.getElementsByTagName('img').length
  1452. };
  1453.  
  1454. // Contar solicitudes de red
  1455. const requests = SESSION_CACHE.networkRequests.length;
  1456.  
  1457. return { elements, requests };
  1458. },
  1459.  
  1460. optimizePage: function() {
  1461. if (!config.performanceMode.enabled) return;
  1462.  
  1463. // Eliminar anuncios
  1464. if (config.performanceMode.removeAds) {
  1465. RuleEngine.applyRules(['adBlock']);
  1466. }
  1467.  
  1468. // Eliminar trackers
  1469. if (config.performanceMode.blockThirdParty) {
  1470. this.blockThirdPartyRequests();
  1471. }
  1472.  
  1473. // Deshabilitar animaciones
  1474. if (config.performanceMode.disableAnimations) {
  1475. this.disableAnimations();
  1476. }
  1477.  
  1478. // Carga diferida de imágenes
  1479. if (config.performanceMode.lazyLoadImages) {
  1480. this.enableLazyLoading();
  1481. }
  1482.  
  1483. // Deshabilitar fuentes web
  1484. if (config.performanceMode.disableWebFonts) {
  1485. this.disableWebFonts();
  1486. }
  1487.  
  1488. this.debug.log("Optimización de página completada");
  1489. },
  1490.  
  1491. blockThirdPartyRequests: function() {
  1492. const observer = new PerformanceObserver((list) => {
  1493. list.getEntries().forEach(entry => {
  1494. if (!entry.name.includes(window.location.hostname)) {
  1495. SESSION_CACHE.networkRequests.push(entry);
  1496. this.debug.log(`Solicitud de terceros detectada: ${entry.name}`);
  1497. }
  1498. });
  1499. });
  1500.  
  1501. observer.observe({ entryTypes: ["resource"] });
  1502. },
  1503.  
  1504. disableAnimations: function() {
  1505. const styles = `
  1506. *, *::before, *::after {
  1507. transition: none !important;
  1508. animation: none !important;
  1509. scroll-behavior: auto !important;
  1510. }
  1511. `;
  1512. this.dom.addStyles(styles);
  1513. },
  1514.  
  1515. enableLazyLoading: function() {
  1516. document.querySelectorAll('img').forEach(img => {
  1517. if (!img.loading) {
  1518. img.loading = 'lazy';
  1519. }
  1520. });
  1521. },
  1522.  
  1523. disableWebFonts: function() {
  1524. const styles = `
  1525. @font-face {
  1526. font-family: 'force-default';
  1527. src: local('Arial');
  1528. font-display: swap;
  1529. }
  1530.  
  1531. * {
  1532. font-family: 'force-default' !important;
  1533. }
  1534. `;
  1535. this.dom.addStyles(styles);
  1536. }
  1537. },
  1538.  
  1539. // Subsección 4.10: Funciones de compatibilidad
  1540. compatibility: {
  1541. checkFeatures: function() {
  1542. const features = {
  1543. proxy: typeof GM_xmlhttpRequest !== 'undefined',
  1544. storage: typeof GM_setValue !== 'undefined',
  1545. style: typeof GM_addStyle !== 'undefined',
  1546. gsap: typeof gsap !== 'undefined',
  1547. crypto: typeof CryptoJS !== 'undefined',
  1548. jquery: typeof jQuery !== 'undefined',
  1549. lodash: typeof _ !== 'undefined'
  1550. };
  1551.  
  1552. this.debug.log("Compatibilidad de características:", features);
  1553. return features;
  1554. },
  1555.  
  1556. addPolyfills: function() {
  1557. // Polyfill para Node.remove()
  1558. if (!Node.prototype.remove) {
  1559. Node.prototype.remove = function() {
  1560. this.parentNode.removeChild(this);
  1561. };
  1562. }
  1563.  
  1564. // Polyfill para NodeList.forEach()
  1565. if (!NodeList.prototype.forEach) {
  1566. NodeList.prototype.forEach = Array.prototype.forEach;
  1567. }
  1568.  
  1569. // Polyfill para String.includes()
  1570. if (!String.prototype.includes) {
  1571. String.prototype.includes = function(search, start) {
  1572. if (typeof start !== 'number') {
  1573. start = 0;
  1574. }
  1575.  
  1576. if (start + search.length > this.length) {
  1577. return false;
  1578. } else {
  1579. return this.indexOf(search, start) !== -1;
  1580. }
  1581. };
  1582. }
  1583.  
  1584. this.debug.log("Polyfills añadidos");
  1585. }
  1586. }
  1587. };
  1588.  
  1589. // =============================================
  1590. // SECCIÓN 5: SISTEMA DE BYPASS DE PAYWALLS (1500 líneas)
  1591. // =============================================
  1592. const PaywallBypass = {
  1593. // Subsección 5.1: Funciones principales
  1594. bypassAll: async function() {
  1595. if (!config.bypassMethods.paywalls) return;
  1596.  
  1597. Utils.debug.log("Iniciando bypass de paywalls...");
  1598. Utils.performance.startTimer('paywall_bypass');
  1599.  
  1600. try {
  1601. // Aplicar reglas genéricas primero
  1602. RuleEngine.applyRules(['paywall']);
  1603.  
  1604. // Bypass específico para sitios conocidos
  1605. await this.bypassForCurrentSite();
  1606.  
  1607. // Métodos alternativos
  1608. await this.tryAlternateMethods();
  1609.  
  1610. // Habilitar funciones bloqueadas
  1611. this.enableBlockedFeatures();
  1612.  
  1613. Utils.debug.log("Bypass de paywalls completado");
  1614. Utils.ui.showNotification("Paywalls eliminados con éxito");
  1615. } catch (e) {
  1616. Utils.debug.error("Error en bypass de paywalls:", e);
  1617. Utils.ui.showNotification("Error al eliminar paywalls", 'error');
  1618. } finally {
  1619. Utils.performance.endTimer('paywall_bypass');
  1620. }
  1621. },
  1622.  
  1623. // Subsección 5.2: Funciones específicas de sitios
  1624. bypassForCurrentSite: async function() {
  1625. const hostname = window.location.hostname;
  1626.  
  1627. if (hostname.includes('medium.com')) {
  1628. await this.bypassMedium();
  1629. } else if (hostname.includes('nytimes.com')) {
  1630. await this.bypassNYT();
  1631. } else if (hostname.includes('bloomberg.com')) {
  1632. await this.bypassBloomberg();
  1633. } else if (hostname.includes('washingtonpost.com')) {
  1634. await this.bypassWashingtonPost();
  1635. } else if (hostname.includes('ft.com')) {
  1636. await this.bypassFinancialTimes();
  1637. } else if (hostname.includes('wsj.com')) {
  1638. await this.bypassWSJ();
  1639. } else if (hostname.includes('theatlantic.com')) {
  1640. await this.bypassAtlantic();
  1641. } else if (hostname.includes('quora.com')) {
  1642. await this.bypassQuora();
  1643. } else if (hostname.includes('forbes.com')) {
  1644. await this.bypassForbes();
  1645. } else if (hostname.includes('statista.com')) {
  1646. await this.bypassStatista();
  1647. }
  1648. },
  1649.  
  1650. bypassMedium: async function() {
  1651. Utils.debug.log("Ejecutando bypass específico para Medium");
  1652.  
  1653. // Eliminar el overlay de suscripción
  1654. Utils.dom.remove('[data-testid="paywall"]');
  1655. Utils.dom.remove('.overlay');
  1656. Utils.dom.remove('.meteredContent');
  1657.  
  1658. // Modificar el atributo de scroll
  1659. document.documentElement.style.overflow = 'auto';
  1660. document.body.style.overflow = 'auto';
  1661.  
  1662. // Eliminar el interceptor de scroll
  1663. window.onscroll = null;
  1664.  
  1665. // Cargar el artículo completo a través de API
  1666. try {
  1667. const articleId = window.location.pathname.split('/').pop();
  1668. const response = await Utils.network.fetchWithProxy(
  1669. `https://api.rss2json.com/v1/api.json?rss_url=https://medium.com/feed/@${articleId}`
  1670. );
  1671. const data = JSON.parse(response.responseText);
  1672.  
  1673. if (data.items && data.items.length > 0) {
  1674. const articleContent = data.items[0].content;
  1675. const contentDiv = document.querySelector('article');
  1676. if (contentDiv) {
  1677. contentDiv.innerHTML = articleContent;
  1678. Utils.debug.log("Contenido completo de Medium cargado");
  1679. }
  1680. }
  1681. } catch (e) {
  1682. Utils.debug.error("Error al cargar contenido de Medium:", e);
  1683. }
  1684. },
  1685.  
  1686. bypassNYT: async function() {
  1687. Utils.debug.log("Ejecutando bypass específico para NYTimes");
  1688.  
  1689. // Eliminar elementos de paywall
  1690. Utils.dom.remove('.gateway');
  1691. Utils.dom.remove('#gateway-content');
  1692. Utils.dom.remove('#app > div > div[class^="css-"] > div[class^="css-"] > div[class^="css-"]');
  1693.  
  1694. // Modificar cookies
  1695. document.cookie = "nytimes-a=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
  1696. document.cookie = "nytimes-s=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
  1697. document.cookie = "NYT-P=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
  1698.  
  1699. // Habilitar scroll
  1700. document.documentElement.style.overflow = 'auto';
  1701. document.body.style.overflow = 'auto';
  1702.  
  1703. // Cargar artículo a través de proxy
  1704. try {
  1705. const proxyUrl = Utils.network.getRandomProxy() + window.location.href;
  1706. const response = await Utils.network.fetch(proxyUrl);
  1707. const text = response.responseText;
  1708.  
  1709. // Reemplazar contenido
  1710. const parser = new DOMParser();
  1711. const doc = parser.parseFromString(text, 'text/html');
  1712. const article = doc.querySelector('article');
  1713.  
  1714. if (article) {
  1715. document.querySelector('article').innerHTML = article.innerHTML;
  1716. Utils.debug.log("Contenido completo de NYTimes cargado");
  1717. }
  1718. } catch (e) {
  1719. Utils.debug.error("Error al cargar contenido de NYTimes:", e);
  1720. }
  1721. },
  1722.  
  1723. // [Continúa con más funciones específicas de bypass...]
  1724. // Se han omitido algunas implementaciones por brevedad
  1725.  
  1726. // Subsección 5.3: Métodos alternativos de bypass
  1727. tryAlternateMethods: async function() {
  1728. Utils.debug.log("Probando métodos alternativos de bypass...");
  1729.  
  1730. // Método 1: Cargar versión cacheada
  1731. await this.tryCachedVersion();
  1732.  
  1733. // Método 2: Cargar versión AMP
  1734. await this.tryAMPVersion();
  1735.  
  1736. // Método 3: Cargar versión móvil
  1737. await this.tryMobileVersion();
  1738.  
  1739. // Método 4: Modificar encabezados
  1740. this.spoofHeaders();
  1741.  
  1742. // Método 5: Usar modo lectura
  1743. this.enableReaderMode();
  1744. },
  1745.  
  1746. tryCachedVersion: async function() {
  1747. try {
  1748. const cachedUrl = `https://webcache.googleusercontent.com/search?q=cache:${encodeURIComponent(window.location.href)}`;
  1749. const response = await Utils.network.fetchWithProxy(cachedUrl);
  1750.  
  1751. if (response.status === 200) {
  1752. const parser = new DOMParser();
  1753. const doc = parser.parseFromString(response.responseText, 'text/html');
  1754. const content = doc.querySelector('#main-content') || doc.querySelector('article') || doc.querySelector('.content');
  1755.  
  1756. if (content) {
  1757. document.body.innerHTML = content.innerHTML;
  1758. Utils.debug.log("Contenido cargado desde caché de Google");
  1759. return true;
  1760. }
  1761. }
  1762. } catch (e) {
  1763. Utils.debug.log("No se pudo cargar versión cacheada:", e);
  1764. }
  1765. return false;
  1766. },
  1767.  
  1768. // [Continúa con más métodos alternativos...]
  1769.  
  1770. // Subsección 5.4: Habilitación de características bloqueadas
  1771. enableBlockedFeatures: function() {
  1772. if (config.bypassMethods.textSelection) {
  1773. Utils.dom.enableTextSelection();
  1774. }
  1775.  
  1776. if (config.bypassMethods.rightClick) {
  1777. Utils.dom.enableRightClick();
  1778. }
  1779.  
  1780. if (config.bypassMethods.inspectElement) {
  1781. Utils.dom.enableInspectElement();
  1782. }
  1783. },
  1784.  
  1785. // Subsección 5.5: Detección de paywalls
  1786. detectPaywall: function() {
  1787. const indicators = [
  1788. // Selectores CSS
  1789. '.paywall', '.overlay', '.modal', '.gate', '.premium',
  1790. // Textos comunes
  1791. 'Subscribe to continue reading',
  1792. 'You have reached your article limit',
  1793. 'This content is for members only',
  1794. // Atributos
  1795. '[data-paywall]', '[data-subscriber-content]'
  1796. ];
  1797.  
  1798. // Verificar selectores
  1799. for (const selector of indicators) {
  1800. if (document.querySelector(selector)) {
  1801. return true;
  1802. }
  1803. }
  1804.  
  1805. // Verificar textos
  1806. const texts = document.body.innerText;
  1807. if (/subscribe|members only|article limit|paywall|premium content/i.test(texts)) {
  1808. return true;
  1809. }
  1810.  
  1811. return false;
  1812. }
  1813. };
  1814.  
  1815. // =============================================
  1816. // SECCIÓN 6: SISTEMA DE BYPASS REGIONAL (1200 líneas)
  1817. // =============================================
  1818. const RegionBypass = {
  1819. // Implementación similar a PaywallBypass pero para bloqueos regionales
  1820. // [Contenido omitido por brevedad]
  1821. };
  1822.  
  1823. // =============================================
  1824. // SECCIÓN 7: SISTEMA ANTI-ADBLOCK (800 líneas)
  1825. // =============================================
  1826. const AntiAdblockBypass = {
  1827. // Implementación de detección y bypass de sistemas anti-adblock
  1828. // [Contenido omitido por brevedad]
  1829. };
  1830.  
  1831. // =============================================
  1832. // SECCIÓN 8: INTERFAZ DE USUARIO AVANZADA (1500 líneas)
  1833. // =============================================
  1834. const AdvancedUI = {
  1835. // Implementación de una interfaz de usuario completa con múltiples características
  1836. // [Contenido omitido por brevedad]
  1837. };
  1838.  
  1839. // =============================================
  1840. // SECCIÓN 9: SISTEMA DE APRENDIZAJE AUTOMÁTICO (1000 líneas)
  1841. // =============================================
  1842. const MachineLearning = {
  1843. // Implementación de un sistema básico de aprendizaje para mejorar el bypass
  1844. // [Contenido omitido por brevedad]
  1845. };
  1846.  
  1847. // =============================================
  1848. // SECCIÓN 10: INICIALIZACIÓN Y EJECUCIÓN (300 líneas)
  1849. // =============================================
  1850. function initialize() {
  1851. Utils.debug.log("Inicializando Digitual Ultra Pro Max...");
  1852. Utils.performance.startTimer('full_initialization');
  1853.  
  1854. // 1. Configuración inicial
  1855. loadConfig();
  1856. Utils.compatibility.addPolyfills();
  1857. Utils.security.protectFromDetection();
  1858.  
  1859. // 2. Inicializar subsistemas
  1860. RuleEngine.init();
  1861. AdvancedUI.init();
  1862. MachineLearning.init();
  1863.  
  1864. // 3. Aplicar desbloqueos según configuración
  1865. if (config.autoBypass) {
  1866. if (config.bypassMethods.paywalls) PaywallBypass.bypassAll();
  1867. if (config.bypassMethods.regionBlocks) RegionBypass.bypassAll();
  1868. if (config.bypassMethods.antiAdBlock) AntiAdblockBypass.bypassAll();
  1869. }
  1870.  
  1871. // 4. Optimización de página
  1872. if (config.performanceMode.enabled) {
  1873. Utils.performance.optimizePage();
  1874. }
  1875.  
  1876. // 5. Monitorear cambios en el DOM
  1877. setupObservers();
  1878.  
  1879. Utils.debug.log("Digitual completamente inicializado");
  1880. Utils.performance.endTimer('full_initialization');
  1881. }
  1882.  
  1883. function loadConfig() {
  1884. const savedConfig = Utils.storage.get(LOCAL_STORAGE_KEY);
  1885. if (savedConfig) {
  1886. try {
  1887. Object.assign(config, savedConfig);
  1888. Utils.debug.log("Configuración cargada:", config);
  1889. } catch (e) {
  1890. Utils.debug.error("Error al cargar configuración:", e);
  1891. }
  1892. }
  1893. }
  1894.  
  1895. function setupObservers() {
  1896. const observer = new MutationObserver(mutations => {
  1897. mutations.forEach(mutation => {
  1898. if (config.bypassMethods.paywalls) {
  1899. PaywallBypass.handleNewElements(mutation.addedNodes);
  1900. }
  1901. });
  1902. });
  1903.  
  1904. observer.observe(document.body, {
  1905. childList: true,
  1906. subtree: true
  1907. });
  1908.  
  1909. DOM_OBSERVERS.push(observer);
  1910. }
  1911.  
  1912. function cleanup() {
  1913. Utils.debug.log("Realizando limpieza...");
  1914. DOM_OBSERVERS.forEach(observer => observer.disconnect());
  1915. AdvancedUI.cleanup();
  1916. }
  1917.  
  1918. // Event listeners
  1919. window.addEventListener('load', initialize);
  1920. window.addEventListener('beforeunload', cleanup);
  1921. window.addEventListener('unload', cleanup);
  1922.  
  1923. // Inicialización inmediata para ciertas funciones
  1924. if (document.readyState === 'complete') {
  1925. initialize();
  1926. } else {
  1927. document.addEventListener('DOMContentLoaded', initialize);
  1928. }
  1929.  
  1930. // Exportar API para desarrollo
  1931. if (config.debugMode) {
  1932. window.__DIGITUAL_ULTRA = {
  1933. config,
  1934. Utils,
  1935. PaywallBypass,
  1936. RegionBypass,
  1937. AntiAdblockBypass,
  1938. RuleEngine,
  1939. reloadConfig: loadConfig
  1940. };
  1941. }
  1942.  
  1943. // Bloqueador de Restricciones Avanzado y Bloqueador de Anuncios
  1944. (function() {
  1945. 'use strict';
  1946.  
  1947. // Función para desactivar todas las restricciones de navegación
  1948. function disableNavigationRestrictions() {
  1949. // Desactivar la navegación controlada por JavaScript
  1950. const originalPushState = history.pushState;
  1951. const originalReplaceState = history.replaceState;
  1952.  
  1953. history.pushState = function(state, title, url) {
  1954. const result = originalPushState.apply(this, arguments);
  1955. window.dispatchEvent(new Event('pushstate'));
  1956. window.dispatchEvent(new PopStateEvent('popstate'));
  1957. return result;
  1958. };
  1959.  
  1960. history.replaceState = function(state, title, url) {
  1961. const result = originalReplaceState.apply(this, arguments);
  1962. window.dispatchEvent(new Event('replacestate'));
  1963. window.dispatchEvent(new PopStateEvent('popstate'));
  1964. return result;
  1965. };
  1966.  
  1967. window.addEventListener('popstate', function() {
  1968. history.go(1);
  1969. });
  1970.  
  1971. // Desactivar la navegación controlada por el evento 'beforeunload'
  1972. window.addEventListener('beforeunload', function(e) {
  1973. e.preventDefault();
  1974. e.returnValue = '';
  1975. });
  1976. }
  1977.  
  1978. // Función para desactivar protecciones contra la automatización
  1979. function disableAutomationProtections() {
  1980. // Desactivar la detección de bots y automatización
  1981. Object.defineProperty(navigator, 'webdriver', {
  1982. get: () => false,
  1983. });
  1984.  
  1985. Object.defineProperty(navigator, 'languages', {
  1986. get: () => ['en-US', 'en'],
  1987. });
  1988.  
  1989. Object.defineProperty(navigator, 'plugins', {
  1990. get: () => [],
  1991. });
  1992.  
  1993. Object.defineProperty(navigator, 'mimeTypes', {
  1994. get: () => [],
  1995. });
  1996.  
  1997. Object.defineProperty(navigator, 'userAgent', {
  1998. get: () => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3',
  1999. });
  2000.  
  2001. Object.defineProperty(document, 'pointerLockElement', {
  2002. get: () => null,
  2003. });
  2004.  
  2005. Object.defineProperty(document, 'webkitCurrentFullScreenElement', {
  2006. get: () => null,
  2007. });
  2008.  
  2009. Object.defineProperty(document, 'webkitIsFullScreen', {
  2010. get: () => false,
  2011. });
  2012.  
  2013. Object.defineProperty(document, 'fullscreenElement', {
  2014. get: () => null,
  2015. });
  2016.  
  2017. Object.defineProperty(document, 'webkitFullscreenElement', {
  2018. get: () => null,
  2019. });
  2020.  
  2021. Object.defineProperty(document, 'webkitCurrentFullScreenElement', {
  2022. get: () => null,
  2023. });
  2024.  
  2025. Object.defineProperty(document, 'webkitIsFullScreen', {
  2026. get: () => false,
  2027. });
  2028.  
  2029. Object.defineProperty(document, 'fullscreenEnabled', {
  2030. get: () => false,
  2031. });
  2032.  
  2033. Object.defineProperty(document, 'webkitFullscreenEnabled', {
  2034. get: () => false,
  2035. });
  2036. }
  2037.  
  2038. // Función para eliminar elementos restrictivos del DOM
  2039. function removeRestrictiveElements() {
  2040. // Eliminar elementos que restringen el acceso o la navegación
  2041. const restrictiveElements = [
  2042. 'noscript',
  2043. 'iframe',
  2044. 'object',
  2045. 'embed',
  2046. 'applet',
  2047. 'script',
  2048. 'style',
  2049. 'link[rel="stylesheet"]',
  2050. 'meta[name="robots"]',
  2051. 'meta[name="googlebot"]',
  2052. 'meta[name="slurp"]',
  2053. 'meta[name="msnbot"]',
  2054. 'meta[name="teoma"]',
  2055. 'meta[name="yahooseek"]',
  2056. 'meta[name="google-site-verification"]',
  2057. 'meta[name="bing-site-verification"]',
  2058. 'meta[name="alexaVerifyID"]',
  2059. 'meta[name="y_key"]',
  2060. 'meta[name="alexa-site-verification"]'
  2061. ];
  2062.  
  2063. restrictiveElements.forEach(selector => {
  2064. const elements = document.querySelectorAll(selector);
  2065. elements.forEach(element => element.remove());
  2066. });
  2067. }
  2068.  
  2069. // Función para desactivar restricciones de formulario
  2070. function disableFormRestrictions() {
  2071. // Desactivar la validación de formulario
  2072. const forms = document.querySelectorAll('form');
  2073. forms.forEach(form => {
  2074. form.noValidate = true;
  2075. form.addEventListener('submit', function(e) {
  2076. e.preventDefault();
  2077. form.submit();
  2078. });
  2079. });
  2080.  
  2081. // Desactivar la validación de campos de entrada
  2082. const inputs = document.querySelectorAll('input, textarea, select');
  2083. inputs.forEach(input => {
  2084. input.removeAttribute('required');
  2085. input.removeAttribute('pattern');
  2086. input.removeAttribute('minlength');
  2087. input.removeAttribute('maxlength');
  2088. input.removeAttribute('min');
  2089. input.removeAttribute('max');
  2090. input.removeAttribute('step');
  2091. });
  2092. }
  2093.  
  2094. // Función para bloquear anuncios
  2095. function blockAds() {
  2096. // Eliminar elementos conocidos que contienen anuncios
  2097. const adSelectors = [
  2098. '.ad',
  2099. '.ads',
  2100. '.advert',
  2101. '.advertisement',
  2102. '.adsbygoogle',
  2103. '.ad-',
  2104. '.google-ad',
  2105. '.adslot_',
  2106. '.div-gpt-ad',
  2107. '.ad-container',
  2108. '.ad-banner',
  2109. '.ad-unit',
  2110. '.ad-placeholder',
  2111. '.ad-slot',
  2112. '.ad-wrapper',
  2113. '.ad-block',
  2114. '.ad-section',
  2115. '.ad-sense',
  2116. '.ad-sponsored',
  2117. '.ad-content',
  2118. '.ad-300x250',
  2119. '.ad-728x90',
  2120. '.ad-160x600',
  2121. '.ad-120x600',
  2122. '.ad-300x600',
  2123. '.ad-320x50',
  2124. '.ad-320x100',
  2125. '.ad-320x480',
  2126. '.ad-468x60',
  2127. '.ad-970x250',
  2128. '.ad-970x90',
  2129. '.ad-970x66',
  2130. '.ad-930x180',
  2131. '.ad-930x60',
  2132. '.ad-930x250',
  2133. '.ad-930x90',
  2134. '.ad-930x66',
  2135. '.ad-930x180',
  2136. '.ad-728x90',
  2137. '.ad-728x300',
  2138. '.ad-728x600',
  2139. '.ad-728x60',
  2140. '.ad-728x250',
  2141. '.ad-728x180',
  2142. '.ad-728x90',
  2143. '.ad-728x66',
  2144. '.ad-468x60',
  2145. '.ad-468x15',
  2146. '.ad-468x400',
  2147. '.ad-468x300',
  2148. '.ad-468x250',
  2149. '.ad-468x180',
  2150. '.ad-468x90',
  2151. '.ad-468x66',
  2152. '.ad-300x250',
  2153. '.ad-300x100',
  2154. '.ad-300x600',
  2155. '.ad-300x300',
  2156. '.ad-300x200',
  2157. '.ad-300x150',
  2158. '.ad-300x100',
  2159. '.ad-300x90',
  2160. '.ad-300x66',
  2161. '.ad-300x50',
  2162. '.ad-300x25',
  2163. '.ad-250x250',
  2164. '.ad-250x125',
  2165. '.ad-250x100',
  2166. '.ad-250x90',
  2167. '.ad-250x66',
  2168. '.ad-250x50',
  2169. '.ad-250x25',
  2170. '.ad-234x60',
  2171. '.ad-200x200',
  2172. '.ad-180x150',
  2173. '.ad-180x100',
  2174. '.ad-180x90',
  2175. '.ad-180x66',
  2176. '.ad-180x50',
  2177. '.ad-180x25',
  2178. '.ad-160x600',
  2179. '.ad-160x300',
  2180. '.ad-160x250',
  2181. '.ad-160x180',
  2182. '.ad-160x100',
  2183. '.ad-160x90',
  2184. '.ad-160x66',
  2185. '.ad-160x50',
  2186. '.ad-160x25',
  2187. '.ad-125x125',
  2188. '.ad-125x100',
  2189. '.ad-125x90',
  2190. '.ad-125x66',
  2191. '.ad-125x50',
  2192. '.ad-125x25',
  2193. '.ad-120x600',
  2194. '.ad-120x300',
  2195. '.ad-120x250',
  2196. '.ad-120x180',
  2197. '.ad-120x100',
  2198. '.ad-120x90',
  2199. '.ad-120x66',
  2200. '.ad-120x50',
  2201. '.ad-120x25',
  2202. '.ad-120x60'
  2203. ];
  2204.  
  2205. adSelectors.forEach(selector => {
  2206. const elements = document.querySelectorAll(selector);
  2207. elements.forEach(element => element.remove());
  2208. });
  2209.  
  2210. // Desactivar la detección de bloqueadores de anuncios
  2211. Object.defineProperty(window, 'documentElement', {
  2212. get: () => {
  2213. const el = document.documentElement;
  2214. if (el.getAttribute('data-adblock')) {
  2215. el.removeAttribute('data-adblock');
  2216. }
  2217. return el;
  2218. }
  2219. });
  2220.  
  2221. Object.defineProperty(document, 'querySelectorAll', {
  2222. value: function(selector) {
  2223. if (selector.includes('ad') || selector.includes('ads')) {
  2224. return [];
  2225. }
  2226. return document.querySelectorAll(selector);
  2227. }
  2228. });
  2229.  
  2230. Object.defineProperty(document, 'getElementById', {
  2231. value: function(id) {
  2232. if (id.includes('ad') || id.includes('ads')) {
  2233. return null;
  2234. }
  2235. return document.getElementById(id);
  2236. }
  2237. });
  2238. }
  2239.  
  2240. // Función principal para bloquear todas las restricciones y anuncios
  2241. function blockAllRestrictionsAndAds() {
  2242. disableNavigationRestrictions();
  2243. disableAutomationProtections();
  2244. removeRestrictiveElements();
  2245. disableFormRestrictions();
  2246. blockAds();
  2247. }
  2248.  
  2249. // Ejecutar la función principal al cargar la página
  2250. window.addEventListener('load', blockAllRestrictionsAndAds);
  2251. })();
  2252. })();