Skip to content

Instantly share code, notes, and snippets.

@codeaholicguy
Created July 4, 2018 07:47
Show Gist options
  • Save codeaholicguy/16a85bd56f25d991895c60532cb29daa to your computer and use it in GitHub Desktop.
Save codeaholicguy/16a85bd56f25d991895c60532cb29daa to your computer and use it in GitHub Desktop.
const targetPage = 'https://services.giaohangtietkiem.vn/*'
const addTokenHeader = (e) => {
e.requestHeaders.push({name: 'Token', value: 'token'})
return {requestHeaders: e.requestHeaders}
}
browser.webRequest.onBeforeSendHeaders.addListener(
addTokenHeader,
{urls: [targetPage]},
['blocking', 'requestHeaders']
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment