Refactor to use chrome.webRequest