Workshops & Events
Workshops & Events
YINtrospection: A JOURNEY TO SELF-DISCOVERY - CACAO, YIN, JOURNALING & SOUND WITH MAXIMILIEN
390.000 IDR
December 20, January 24
// ============================================ // COMPLETE JAVASCRIPT BLOCKING SOLUTION // ============================================ (function() { 'use strict'; console.log('π JavaScript Blocker Activated'); // ==================== // 1. INTERCEPT SCRIPT CREATION // ==================== const originalCreateElement = document.createElement; document.createElement = function(tagName) { const element = originalCreateElement.call(this, tagName); // Block ALL script elements if (tagName.toLowerCase() === 'script') { console.log('π« Blocked script element creation'); // Completely neutralize the script element const originalSetAttribute = element.setAttribute; const originalSetAttributeNS = element.setAttributeNS; // Block setting src attribute element.setAttribute = function(name, value) { if (name === 'src') { console.log(`π« Blocked script src: ${value}`); return undefined; } return originalSetAttribute.call(this, name, value); }; // Block setting src via setAttributeNS element.setAttributeNS = function(namespace, name, value) { if (name === 'src') { console.log(`π« Blocked script src (NS): ${value}`); return undefined; } return originalSetAttributeNS.call(this, namespace, name, value); }; // Block text content (inline scripts) Object.defineProperty(element, 'textContent', { set: function(value) { console.log('π« Blocked inline script content'); return undefined; }, get: function() { return ''; }, configurable: false }); // Block innerHTML Object.defineProperty(element, 'innerHTML', { set: function(value) { console.log('π« Blocked script innerHTML'); return undefined; }, get: function() { return ''; }, configurable: false }); // Block script execution methods element.onload = null; element.onerror = null; } return element; }; // ==================== // 2. REMOVE EXISTING SCRIPTS // ==================== function removeAllScripts() { // Remove all script tags const scripts = document.querySelectorAll('script'); console.log(`ποΈ Removing ${scripts.length} existing script elements`); scripts.forEach(script => { script.remove(); }); // Remove noscript tags that might contain fallbacks document.querySelectorAll('noscript').forEach(noscript => { noscript.remove(); }); } // ==================== // 3. BLOCK EVENT LISTENERS ON SCRIPTS // ==================== const originalAddEventListener = EventTarget.prototype.addEventListener; EventTarget.prototype.addEventListener = function(type, listener, options) { // Block load/error events on script elements if (this.tagName && this.tagName.toLowerCase() === 'script') { if (type === 'load' || type === 'error') { console.log(`π« Blocked ${type} event on script`); return undefined; } } return originalAddEventListener.call(this, type, listener, options); }; // ==================== // 4. MUTATION OBSERVER - BLOCK DYNAMIC SCRIPTS // ==================== const observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { mutation.addedNodes.forEach(function(node) { // Check if node is a script if (node.tagName && node.tagName.toLowerCase() === 'script') { console.log('π« MutationObserver blocked dynamic script'); node.remove(); } // Check children for scripts if (node.querySelectorAll) { node.querySelectorAll('script').forEach(script => { console.log('π« MutationObserver blocked child script'); script.remove(); }); } }); }); }); // Start observing observer.observe(document.documentElement, { childList: true, subtree: true }); // ==================== // 5. BLOCK JAVASCRIPT PROTOCOLS // ==================== const originalCreateElementNS = document.createElementNS; document.createElementNS = function(namespace, tagName) { const element = originalCreateElementNS.call(this, namespace, tagName); if (tagName.toLowerCase() === 'script') { console.log('π« Blocked createElementNS script'); // Block all attributes element.setAttribute = function() { return undefined; }; element.setAttributeNS = function() { return undefined; }; Object.defineProperty(element, 'textContent', { set: function() { return undefined; }, get: function() { return ''; } }); } return element; }; // ==================== // 6. BLOCK JAVASCRIPT URLS // ==================== const originalAnchorClick = HTMLAnchorElement.prototype.click; HTMLAnchorElement.prototype.click = function() { if (this.href && this.href.toLowerCase().startsWith('javascript:')) { console.log('π« Blocked JavaScript URL execution'); return undefined; } return originalAnchorClick.call(this); }; // Block javascript: URLs in iframes and other elements const originalWindowOpen = window.open; window.open = function(url) { if (url && url.toLowerCase().startsWith('javascript:')) { console.log('π« Blocked JavaScript URL in window.open'); return null; } return originalWindowOpen.apply(this, arguments); }; // ==================== // 7. BLOCK EVAL AND FUNCTION CONSTRUCTOR // ==================== window.eval = function() { console.log('π« Blocked eval()'); return undefined; }; window.Function = function() { console.log('π« Blocked Function constructor'); return function() {}; }; // ==================== // 8. REMOVE EVENT HANDLERS // ==================== function removeEventHandlers() { // Remove on* attributes from all elements document.querySelectorAll('*').forEach(element => { for (let prop in element) { if (prop.startsWith('on') && typeof element[prop] === 'function') { element[prop] = null; } } }); } // ==================== // 9. BLOCK DYNAMIC SCRIPT APPENDING // ==================== const originalAppendChild = Node.prototype.appendChild; const originalInsertBefore = Node.prototype.insertBefore; const originalReplaceChild = Node.prototype.replaceChild; Node.prototype.appendChild = function(node) { if (node.tagName && node.tagName.toLowerCase() === 'script') { console.log('π« Blocked appendChild script'); return node; } return originalAppendChild.call(this, node); }; Node.prototype.insertBefore = function(newNode, referenceNode) { if (newNode.tagName && newNode.tagName.toLowerCase() === 'script') { console.log('π« Blocked insertBefore script'); return newNode; } return originalInsertBefore.call(this, newNode, referenceNode); }; Node.prototype.replaceChild = function(newNode, oldNode) { if (newNode.tagName && newNode.tagName.toLowerCase() === 'script') { console.log('π« Blocked replaceChild script'); return oldNode; } return originalReplaceChild.call(this, newNode, oldNode); }; // ==================== // 10. INITIAL CLEANUP // ==================== function initializeBlocker() { // Run immediately removeAllScripts(); removeEventHandlers(); // Run after a short delay to catch dynamically loaded scripts setTimeout(removeAllScripts, 100); setTimeout(removeAllScripts, 500); setTimeout(removeAllScripts, 1000); // Continuous cleanup every 2 seconds setInterval(removeAllScripts, 2000); } // Start the blocker based on document state if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', initializeBlocker); } else { initializeBlocker(); } // ==================== // 11. CSP META TAG (Bonus - adds Content Security Policy) // ==================== function addCSP() { const meta = document.createElement('meta'); meta.httpEquiv = 'Content-Security-Policy'; meta.content = "script-src 'none'; object-src 'none';"; document.head.appendChild(meta); } // Add CSP if you want maximum blocking addCSP(); // ==================== // 12. EXPOSE CONTROLS (Optional) // ==================== window.JavaScriptBlocker = { enable: function() { console.log('β JavaScript Blocker Enabled'); }, disable: function() { console.log('β οΈ JavaScript Blocker Disabled'); observer.disconnect(); // Note: This won't fully restore original behavior }, removeScripts: removeAllScripts, status: 'active' }; console.log('β JavaScript Blocker fully loaded and active'); })();
YINtrospection: A JOURNEY TO SELF-DISCOVERY - CACAO, YIN, JOURNALING & SOUND WITH MAXIMILIEN
390.000 IDR
December 20, January 24