PageSourceSearch

https://www.trimiya.com/webassets/cdn/shop/t/819/assets/blockUnblock4446.js?v=131602190500172244651722852159

js trimiya.com collected 2026-09-24 14:55:05 UTC 4,647 bytes, 3 lines download raw bytes

1const TYPE_ATTRIBUTE="javascript/blocked",patterns={blacklist:window.YETT_BLACKLIST,whitelist:window.YETT_WHITELIST},backupScripts={blacklisted:[]},isOnBlacklist=(src,type)=>src&&(!type||type!==TYPE_ATTRIBUTE)&&(!patterns.blacklist||patterns.blacklist.some(pattern=>pattern.test(src)))&&(!patterns.whitelist||patterns.whitelist.every(pattern=>!pattern.test(src))),willBeUnblocked=function(script){const src=script.getAttribute("src");return patterns.blacklist&&patterns.blacklist.every(entry=>!entry.test(src))||patterns.whitelist&&patterns.whitelist.some(entry=>entry.test(src))},observer=new MutationObserver(mutations=>{for(let i=0;i<mutations.length;i++){const{addedNodes}=mutations[i];for(let i2=0;i2<addedNodes.length;i2++){const node=addedNodes[i2];if(node.nodeType===1&&node.tagName==="SCRIPT"){const src=node.src,type=node.type;if(isOnBlacklist(src,type)){backupScripts.blacklisted.push([node,node.type]),node.type=TYPE_ATTRIBUTE;const beforeScriptExecuteListener=function(event){node.getAttribute("type")===TYPE_ATTRIBUTE&&event.preventDefault(),node.removeEventListener("beforescriptexecute",beforeScriptExecuteListener)};node.addEventListener("beforescriptexecute",beforeScriptExecuteListener),node.parentElement&&node.parentElement.removeChild(node)}}}}});observer.observe(document.documentElement,{childList:!0,subtree:!0});const createElementBackup=document.createElement,originalDescriptors={src:Object.getOwnPropertyDescriptor(HTMLScriptElement.prototype,"src"),t
1ype:Object.getOwnPropertyDescriptor(HTMLScriptElement.prototype,"type")};document.createElement=function(...args){if(args[0].toLowerCase()!=="script")return createElementBackup.bind(document)(...args);const scriptElt=createElementBackup.bind(document)(...args);try{Object.defineProperties(scriptElt,{src:{...originalDescriptors.src,set(value){isOnBlacklist(value,scriptElt.type)&&originalDescriptors.type.set.call(this,TYPE_ATTRIBUTE),originalDescriptors.src.set.call(this,value)}},type:{...originalDescriptors.type,get(){const typeValue=originalDescriptors.type.get.call(this);return typeValue===TYPE_ATTRIBUTE||isOnBlacklist(this.src,typeValue)?null:typeValue},set(value){const typeValue=isOnBlacklist(scriptElt.src,scriptElt.type)?TYPE_ATTRIBUTE:value;originalDescriptors.type.set.call(this,typeValue)}}}),scriptElt.setAttribute=function(name,value){name==="type"||name==="src"?scriptElt[name]=value:HTMLScriptElement.prototype.setAttribute.call(scriptElt,name,value)}}catch{console.warn("Yett: unable to prevent script execution for script src ",scriptElt.src,`.
2`,'A likely cause would be because you are using a third-party browser extension that monkey patches the "document.createElement" function.')}return scriptElt};const URL_REPLACER_REGEXP=new RegExp("[|\\{}()[\\]^$+*?.]","g"),unblock_script=function(...scriptUrlsOrRegexes){scriptUrlsOrRegexes.length<1?(patterns.blacklist=[],patterns.whitelist=[]):(patterns.blacklist&&(patterns.blacklist=patterns.blacklist.filter(pattern=>scriptUrlsOrRegexes.every(urlOrRegexp=>{if(typeof urlOrRegexp=="string")return!pattern.test(urlOrRegexp);if(urlOrRegexp instanceof RegExp)return pattern.toString()!==urlOrRegexp.toString()}))),patterns.whitelist&&(patterns.whitelist=[...patterns.whitelist,...scriptUrlsOrRegexes.map(urlOrRegexp=>{if(typeof urlOrRegexp=="string"){const permissiveRegexp=".*"+urlOrRegexp.replace(URL_REPLACER_REGEXP,"\\$&")+".*";if(patterns.whitelist.every(p=>p.toString()!==permissiveRegexp.toString()))return new RegExp(permissiveRegexp)}else if(urlOrRegexp instanceof RegExp&&patterns.whitelist.every(p=>p.toString()!==urlOrRegexp.toString()))return urlOrRegexp;return null}).filter(Boolean)]));const tags=document.querySelectorAll(`script[type="${TYPE_ATTRIBUTE}"]`);for(let i=0;i<tags.length;i++){const script=tags[i];willBeUnblocked(script)&&(backupScripts.blacklisted.push([script,"application/javascript"]),script.parentElement.removeChild(script))}let indexOffset=0;[...backupScripts.blacklisted].forEach(([script,type],index)=>{if(willBeUnblocked(script)){const scriptNode=document.createElement("script");for(let i=0;i<script.attributes.length;i++){let attribute=script.attributes[i];attribute.name!=="src"&&attribute.name!=="type"&&scriptNode.setAttribute(attribute.name,script.attributes[i].value)}scriptNode.setAttribute("src",script.src),scriptNode.setAttribute("type",type||"application/javascript"),document.head.appendChild(scriptNode),backupScripts.blacklisted.splice(index-indexOffset,1),indexOffset++}}),patterns.blacklist&&patterns.blacklist.length<1&&observer.disconnect()};
3//# sourceMappingURL=/cdn/shop/t/819/assets/blockUnblock.js.map?v=131602190500172244651722852159

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.