Size
5.9 KB
Version
1.0.0
Created
Oct 31, 2025
Updated
about 2 months ago
1// ==UserScript==
2// @name PrepMart Unlimited Access
3// @description A new extension
4// @version 1.0.0
5// @match https://*.prepmart.in/*
6// @icon https://www.prepmart.in/prepmart-favicon.png?1761906642
7// ==/UserScript==
8(function() {
9 'use strict';
10
11 console.log('PrepMart Unlimited Access extension loaded');
12
13 // Function to hide subscription popup
14 function hideSubscriptionPopup() {
15 const popup = document.querySelector('#subscriptionPopup');
16 if (popup) {
17 popup.style.display = 'none';
18 popup.classList.remove('show');
19 console.log('Subscription popup hidden');
20 }
21
22 // Remove modal backdrop if exists
23 const backdrop = document.querySelector('.modal-backdrop');
24 if (backdrop) {
25 backdrop.remove();
26 console.log('Modal backdrop removed');
27 }
28
29 // Restore body scroll
30 document.body.classList.remove('modal-open');
31 document.body.style.overflow = '';
32 document.body.style.paddingRight = '';
33 }
34
35 // Function to remove login button
36 function removeLoginButton() {
37 const loginButton = document.querySelector('.buttons a[href="/userLogin.php"]');
38 if (loginButton) {
39 loginButton.remove();
40 console.log('Login button removed');
41 }
42
43 // Also remove the entire buttons div if it only contains login
44 const buttonsDiv = document.querySelector('.buttons');
45 if (buttonsDiv && buttonsDiv.children.length === 0) {
46 buttonsDiv.remove();
47 console.log('Empty buttons container removed');
48 }
49 }
50
51 // Function to bypass question limits
52 function bypassQuestionLimits() {
53 // Remove any question limit overlays or restrictions
54 const limitOverlays = document.querySelectorAll('[class*="limit"], [class*="restrict"], [id*="limit"], [id*="restrict"]');
55 limitOverlays.forEach(overlay => {
56 if (overlay.textContent.toLowerCase().includes('limit') ||
57 overlay.textContent.toLowerCase().includes('subscribe') ||
58 overlay.textContent.toLowerCase().includes('premium')) {
59 overlay.remove();
60 console.log('Question limit overlay removed:', overlay);
61 }
62 });
63
64 // Unlock all questions by removing disabled states
65 const disabledElements = document.querySelectorAll('[disabled], .disabled, [class*="locked"], [class*="premium"]');
66 disabledElements.forEach(element => {
67 element.removeAttribute('disabled');
68 element.classList.remove('disabled', 'locked', 'premium');
69 });
70
71 // Make all links clickable
72 const restrictedLinks = document.querySelectorAll('a[onclick*="subscribe"], a[onclick*="login"], a[onclick*="premium"]');
73 restrictedLinks.forEach(link => {
74 link.removeAttribute('onclick');
75 link.style.pointerEvents = 'auto';
76 link.style.opacity = '1';
77 });
78
79 console.log('Question limits bypassed');
80 }
81
82 // Function to remove subscription-related elements
83 function removeSubscriptionElements() {
84 // Remove any subscription banners or cards
85 const subscriptionElements = document.querySelectorAll('[class*="subscription"], [class*="pricing"], [id*="subscription"], [id*="pricing"]');
86 subscriptionElements.forEach(element => {
87 // Don't remove the popup itself (we just hide it), but remove other subscription elements
88 if (element.id !== 'subscriptionPopup') {
89 element.remove();
90 console.log('Subscription element removed:', element);
91 }
92 });
93 }
94
95 // Initialize the extension
96 function init() {
97 console.log('Initializing PrepMart Unlimited Access...');
98
99 // Hide subscription popup immediately
100 hideSubscriptionPopup();
101
102 // Remove login button
103 removeLoginButton();
104
105 // Bypass question limits
106 bypassQuestionLimits();
107
108 // Remove subscription elements
109 removeSubscriptionElements();
110 }
111
112 // Run on page load
113 if (document.readyState === 'loading') {
114 document.addEventListener('DOMContentLoaded', init);
115 } else {
116 init();
117 }
118
119 // Watch for dynamic content changes
120 const observer = new MutationObserver(function(mutations) {
121 mutations.forEach(function(mutation) {
122 // Check if subscription popup appears
123 const popup = document.querySelector('#subscriptionPopup.show');
124 if (popup) {
125 hideSubscriptionPopup();
126 }
127
128 // Check if login button reappears
129 const loginButton = document.querySelector('.buttons a[href="/userLogin.php"]');
130 if (loginButton) {
131 removeLoginButton();
132 }
133
134 // Continuously bypass any new restrictions
135 bypassQuestionLimits();
136 });
137 });
138
139 // Start observing the document
140 observer.observe(document.body, {
141 childList: true,
142 subtree: true,
143 attributes: true,
144 attributeFilter: ['class', 'style']
145 });
146
147 // Prevent popup from showing via JavaScript
148 window.addEventListener('load', function() {
149 // Override Bootstrap modal show function if it exists
150 if (typeof window.bootstrap !== 'undefined' && window.bootstrap.Modal) {
151 const originalShow = window.bootstrap.Modal.prototype.show;
152 window.bootstrap.Modal.prototype.show = function() {
153 const modalElement = this._element;
154 if (modalElement && modalElement.id === 'subscriptionPopup') {
155 console.log('Blocked subscription popup from showing');
156 return;
157 }
158 return originalShow.apply(this, arguments);
159 };
160 }
161 });
162
163 console.log('PrepMart Unlimited Access extension initialized successfully');
164})();