function setElemhideCSSRules(e){function t(){if(!n.sheet)return void window.setTimeout(t,0);for(var i=0,l=0;i<e.length;i+=SELECTOR_GROUP_SIZE,l++){var o=e.slice(i,i+SELECTOR_GROUP_SIZE).join(", ");n.sheet.insertRule(o+" { display: none !important; }",l)}}if(elemhideElt&&elemhideElt.parentNode&&elemhideElt.parentNode.removeChild(elemhideElt),e){elemhideElt=document.createElement("style"),elemhideElt.setAttribute("type","text/css"),elemhideElt.setAttribute("abt","234"),(document.head||document.documentElement).appendChild(elemhideElt);var n=elemhideElt;t()}}function checkCollapse(e){var t=e.target,n=t.localName,i="iframe"==n||"frame"==n?"load":"error";if(n in typeMap&&e.type==i){var l=t.src;if(!l)return;var o=typeMap[n];chrome.runtime.sendMessage({reqtype:"should-collapse",url:l,documentUrl:document.URL,type:o},function(e){0===Object.keys(e).length&&e.constructor===Object&&(e=!1),e&&t.parentNode&&("frame"==n?t.style.setProperty("visibility","hidden","!important"):t.parentNode.removeChild(t))})}}function init(){document.documentElement instanceof HTMLElement&&(document.addEventListener("error",checkCollapse,!0),document.addEventListener("load",checkCollapse,!0),chrome.runtime.sendMessage({reqtype:"get-settings",selectors:!0,frameUrl:window.location.href},function(e){setElemhideCSSRules(e.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);