function setElemhideCSSRules(a){function c(){if(!b.sheet)return window.setTimeout(c,0),void 0;for(var d=0,e=0;d<a.length;d+=SELECTOR_GROUP_SIZE,e++){var f=a.slice(d,d+SELECTOR_GROUP_SIZE).join(", ");b.sheet.insertRule(f+" { display: none !important; }",e)}}if(elemhideElt&&elemhideElt.parentNode&&elemhideElt.parentNode.removeChild(elemhideElt),a){elemhideElt=document.createElement("style"),elemhideElt.setAttribute("type","text/css"),elemhideElt.setAttribute("adt","123"),(document.head||document.documentElement).appendChild(elemhideElt);var b=elemhideElt;c()}}function checkCollapse(a){var b=a.target,c=b.localName,d="iframe"==c||"frame"==c?"load":"error";if(c in typeMap&&a.type==d){var e=b.src;if(!e)return;var f=typeMap[c];chrome.extension.sendRequest({reqtype:"should-collapse",url:e,documentUrl:document.URL,type:f},function(a){a&&b.parentNode&&("frame"==c?b.style.setProperty("visibility","hidden","!important"):b.parentNode.removeChild(b))})}}function init(){document.documentElement instanceof HTMLElement&&(document.addEventListener("error",checkCollapse,!0),document.addEventListener("load",checkCollapse,!0),chrome.extension.sendRequest({reqtype:"get-settings",selectors:!0,frameUrl:window.location.href},function(a){setElemhideCSSRules(a.selectors)}))}var SELECTOR_GROUP_SIZE=20,elemhideElt=null,typeMap={img:"IMAGE",input:"IMAGE",audio:"MEDIA",video:"MEDIA",frame:"SUBDOCUMENT",iframe:"SUBDOCUMENT"};document.documentElement?init():window.setTimeout(init,0);