@Dan Thanks for providing the additional info, in particular the scenario that you are trying to achieve.
In this instance, you can achieve your goal by simply using the onBeforeNavigate method without the need to run at document start. So, based on your background.js example code, the solution would look like:
appAPI.ready(function() {
var resourceArray = ['http://www.bing.com/'];
appAPI.webRequest.onBeforeNavigate.addListener(function(details, opaqueData) {
// Where:
// * details.pageUrl is the URL of the tab requesting the page
// * opaqueData is the data passed to the context of the callback function
// Redirect requests for blocked pages
for (var i = 0; i < opaqueData.length; ++i) {
if (details.pageUrl.indexOf(opaqueData[i]) !== -1) {
console.log("You are at Bing... That's bad m'kay.");
return { redirectTo: 'http://www.google.com' };
}
}
}, resourceArray); // resourceArray is the opaque parameter that is passed to the callback function
});
[Disclosure: I am a Crossrider employee]