first commit
This commit is contained in:
commit
46aea254d0
19 changed files with 569 additions and 0 deletions
29
dist/firefox/background.firefox.js
vendored
Normal file
29
dist/firefox/background.firefox.js
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
const WINDOWS_UA = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.7444.163 Safari/537.36';
|
||||
|
||||
browser.webRequest.onBeforeSendHeaders.addListener(
|
||||
(details) => {
|
||||
const headers = details.requestHeaders || [];
|
||||
let found = false;
|
||||
|
||||
for (const header of headers) {
|
||||
if (header.name && header.name.toLowerCase() === 'user-agent') {
|
||||
header.value = WINDOWS_UA;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
headers.push({ name: 'User-Agent', value: WINDOWS_UA });
|
||||
}
|
||||
|
||||
return { requestHeaders: headers };
|
||||
},
|
||||
{
|
||||
urls: [
|
||||
'https://figma.com/*',
|
||||
'https://*.figma.com/*'
|
||||
]
|
||||
},
|
||||
['blocking', 'requestHeaders']
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue