Skip to content

Commit

Permalink
fixes #160
Browse files Browse the repository at this point in the history
  • Loading branch information
ray-lothian committed Nov 13, 2022
1 parent 4d968b7 commit 7bfa6be
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions v2/firefox/common.js
Expand Up @@ -553,14 +553,19 @@ const onBeforeSendHeaders = d => {
i < requestHeaders.length;
i += 1, name = (requestHeaders[i] || {}).name
) {
if (name === 'User-Agent' || name === 'user-agent') {
name = name.toLowerCase();
if (name === 'user-agent') {
requestHeaders[i].value = str === 'empty' ? '' : str;
return {
requestHeaders
};
}
// https://github.com/ray-lothian/UserAgent-Switcher/issues/160
else if (name.startsWith('sec-ch-')) {
requestHeaders[i] = null;
}
}
}
return {
requestHeaders: requestHeaders.filter(a => a)
};
};

const onCommitted = d => {
Expand Down

0 comments on commit 7bfa6be

Please sign in to comment.