Skip to content

Instantly share code, notes, and snippets.

@cwgreene
Created July 1, 2020 22:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cwgreene/e79b3437ac8793633ce0f7d46c9ebf65 to your computer and use it in GitHub Desktop.
Save cwgreene/e79b3437ac8793633ce0f7d46c9ebf65 to your computer and use it in GitHub Desktop.
console.log("hello world");
chrome.webRequest.onBeforeRequest.addListener(
function(details) {
console.log(details);
if (details.url.match(/test/) && details.method=="POST"){
console.log("hi");
}
},
{urls: ["<all_urls>"]},
["blocking"]);
{
"manifest_version": 2,
"version":"1",
"name": "Test Extension",
"permissions": [
"webRequest",
"webRequestBlocking",
"*://localhost:*/"
],
"background":
{
"scripts":["code.js"],
"persistent": true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment