Can't run contnet script. Error: No window matching {"matchesHost":["<all_urls>"]}

I am trying to run a content script when an error is encountered. Below are my example’s files:

manifest.json

{
  "manifest_version": 2,
  "name": "testOnError",
  "version": "1.0",
  "background": {
    "scripts": ["testOnError.js"]
  },
  "permissions": [
    "webRequest",
	"<all_urls>",
    "activeTab"
  ]
}

testOnError.js:

var target = "<all_urls>"; 
function logError(responseDetails) {
  console.log("-- inside logError  --");

	  var errorURL=responseDetails.url;
	  console.log("response url: "+errorURL);

	  errorTab=responseDetails.tabId;
	  console.log("response tab: "+errorTab);
	  
		var makeItGreen = 'document.body.style.border = "5px solid green"';
		var executing = browser.tabs.executeScript(errorTab,{
		code: makeItGreen
	});
}

browser.webRequest.onErrorOccurred.addListener(
  logError,
  {urls: [target],
  types: ["main_frame"]}
);

The script does not get executed, and I get the following error:
Error: No window matching {"matchesHost":["<all_urls>"]}

I see the “Error: No matching message handler” in Nightly 56.

Similar to https://bugzilla.mozilla.org/show_bug.cgi?id=1290016.

That error happens if you try to attach a content script to a tab which you are not allowed to access. The about:neterror page (which is the result of a failed navigation) is such a page. The error message is simply not helpful (but actually true: You are allowed to attach to frames matching <all_urls>. Contradicting what the name implies, that pattern doesn’t match about:-URLs and the content script can thus not be applied).