/* Mac build: run content script in regular tabs too (no incognito requirement). */
{
  setInterval(function () {
 try{
    var messageRemove = document.getElementById("usercom-launcher-dot-frame");
    messageRemove.style.display = "none";
 }catch(e){

 }
  }, 1000);
document.addEventListener("keydown", function (event) {
  if (
      event.key === "F12" || 
      (event.ctrlKey && event.shiftKey && (event.key === "I" || event.key === "J")) || 
      (event.ctrlKey && event.key === "U")
  ) {
      event.preventDefault();
      event.stopPropagation();
  }
}, true);
document.addEventListener("contextmenu", function (event) {
  event.preventDefault();
});

setInterval(function () {
  document.querySelectorAll('.header-account-triggers').forEach(el => {
    el.style.display = 'none';
  });
  document.querySelectorAll('.package-container').forEach(el => {
    el.style.display = 'none';
  });
}, 500);
chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
 
    if (request.to === "content") {
        switch(request.type){
        case "setStorage":
          sendResponse("ok");
         
            var $storageData = request.value;
            for (const [key, value] of Object.entries($storageData)) {
                var $storageSet;
                if(typeof value === 'object'){
                    $storageSet =  JSON.stringify(value);
                }else{
                    $storageSet =  value;
                }
                localStorage.setItem(key, $storageSet);
              } 
            window.location.reload();
           
        break;
        case "setUserAgent":
          sendResponse("ok");
          localStorage.setItem("SeoSystemLocalAgent", request.value);
        break;
        case "changeUseage":
          changeUsege(request.value.limit,request.value.used);
        break;
        case "clearStorage":
          localStorage.clear();
          sendResponse("ok");
          setInterval(function(){
            window.location.href = 'https://google.com';
            
          },1000);
          
        break;
        }
     
    }
  });

}

























