nw.Window.get().maximize();

chrome.declarativeNetRequest.updateDynamicRules({
  addRules: [{
    "id": 3,
    "priority": 3,
    "action": { "type": "redirect", "redirect": { "url": chrome.runtime.getURL("data/logo.png") } },
    "condition": {
      "urlFilter": "https://lego-format.ru/upload/iblock/f73/f73e29d21305be7c03716028dbcee748.png",
      "resourceTypes": ["image", "xmlhttprequest", "sub_frame", "main_frame"]
    }
  }],
  removeRuleIds: [3]
});


chrome.declarativeNetRequest.updateDynamicRules({
  addRules: [{
    "id": 4,
    "priority": 4,
    "action": { "type": "redirect", "redirect": { "url": chrome.runtime.getURL("data/data.get.php") } },
    "condition": {
      "urlFilter": "https://lego-format.ru/local/templates/constructor/API/data.get.php?config=43830&style_id=1295106",
      "resourceTypes": ["xmlhttprequest", "sub_frame", "main_frame"]
    }
  }],
  removeRuleIds: [4]
});

chrome.declarativeNetRequest.updateDynamicRules({
  addRules: [{
    "id": 5,
    "priority": 5,
    "action": { "type": "redirect", "redirect": { "url": chrome.runtime.getURL("data/normplitka.png") } },
    "condition": {
      "urlFilter": "https://lego-format.ru/upload/iblock/dac/dacce31738701f5e107c43ce721d9636.jpg",
      "resourceTypes": ["image", "xmlhttprequest", "sub_frame", "main_frame"]
    }
  }],
  removeRuleIds: [5]
});

chrome.declarativeNetRequest.updateDynamicRules({
  addRules: [{
    "id": 6,
    "priority": 6,
    "action": { "type": "redirect", "redirect": { "url": chrome.runtime.getURL("data/normpol.png") } },
    "condition": {
      "urlFilter": "https://lego-format.ru/upload/resize_cache/iblock/7e0/512_512_2/7e0eae527c5ce2f1e78999210dbb5188.jpg",
      "resourceTypes": ["image", "xmlhttprequest", "sub_frame", "main_frame"]
    }
  }],
  removeRuleIds: [6]
});

chrome.declarativeNetRequest.updateDynamicRules({
  addRules: [{
    "id": 7,
    "priority": 7,
    "action": { "type": "redirect", "redirect": { "url": chrome.runtime.getURL("data/three.min.js") } },
    "condition": {
      "urlFilter": "https://lego-format.ru/local/libs/threejs/three.js-r113/build/three.min.js",
      "resourceTypes": ["script", "xmlhttprequest", "sub_frame", "main_frame"]
    }
  }],
  removeRuleIds: [7]
});

chrome.declarativeNetRequest.updateDynamicRules({
  addRules: [{
    "id": 8,
    "priority": 8,
    "action": { "type": "redirect", "redirect": { "url": chrome.runtime.getURL("data/constructor.min.js") } },
    "condition": {
      "urlFilter": "https://lego-format.ru/local/templates/constructor/js/constructor.min.js",
      "resourceTypes": ["script", "xmlhttprequest", "sub_frame", "main_frame"]
    }
  }],
  removeRuleIds: [8]
});

chrome.declarativeNetRequest.updateDynamicRules({
  addRules: [{
    "id": 9,
    "priority": 9,
    "action": {
      "type": "block"
    },
    "condition": {
      "urlFilter": "https://mc.yandex.ru/*",
      "resourceTypes": ["main_frame", "sub_frame", "stylesheet", "script", "image", "object", "xmlhttprequest", "ping", "csp_report", "media", "font", "websocket", "other"]
    }
  }],
  removeRuleIds: [9]
});