Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attach authorization header to ghosterysearch.com/login #5

Merged
merged 2 commits into from Oct 20, 2020
Merged
Changes from 1 commit
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

Next

Attach authorization header to ghosterysearch.com/login

  • Loading branch information
chrmod committed Oct 19, 2020
commit acb61861e14da405e275cf4fc7cfe0d704e21438
@@ -81,6 +81,21 @@ async function start() {
requestHeaders,
};
}, { urls: [`${SERP_BASE_URL}/search*`]}, ["blocking", "requestHeaders"]);

browser.webRequest.onBeforeSendHeaders.addListener(async (details) => {
const { requestHeaders } = details;
const accessToken = AccessToken.get();
if (!accessToken) {
return;
}
requestHeaders.push({
name: "Authorization",
value: `Bearer ${accessToken}`,
});
return {
requestHeaders,
};
}, { urls: [`${SERP_BASE_URL}/login*`]}, ["blocking", "requestHeaders"]);
}

start();
@@ -1,5 +1,5 @@
{
"version": "0.1.3",
"version": "0.1.4",
"browser_specific_settings": {
"gecko": {
"id": "search@ghostery.com"
ProTip! Use n and p to navigate between commits in a pull request.