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

Stop sharing access token with ghosterysearch #17

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

Always

Just for now

Stop sharing access token with ghosterysearch

  • Loading branch information
chrmod committed Oct 30, 2020
commit 2188539fd947a55f7fd7fcfe422012e5c97ea451
@@ -90,21 +90,6 @@ async function start() {
};
}, { 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"]);

browser.runtime.onMessage.addListener(({ action }) => {
if (action === 'getTokenCount') {
return Promise.resolve(tokenPool.tokens.length);
@@ -113,4 +98,4 @@ async function start() {
})
}

start();
start();
ProTip! Use n and p to navigate between commits in a pull request.