Skip to content

Commit

Permalink
fix #417
Browse files Browse the repository at this point in the history
  • Loading branch information
dimdenGD committed Aug 9, 2023
1 parent 4c4de23 commit cc36cd7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Old Twitter Layout (2023)",
"description": "__MSG_ext_description__",
"version": "1.7.5.5",
"version": "1.7.5.6",
"manifest_version": 3,
"homepage_url": "https://github.com/dimdenGD/OldTwitter",
"background": {
Expand Down
4 changes: 2 additions & 2 deletions scripts/background_v2.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ chrome.webRequest.onHeadersReceived.addListener(
details.responseHeaders.splice(i, 1);
}
}
let parsedUrl = new URL(details.originUrl);
let origin = new URL(details.originUrl ? details.originUrl : details.url ? details.url : 'https://twitter.com').origin;
if(!details.responseHeaders.find(h => h.name.toLowerCase() === 'access-control-allow-origin')) details.responseHeaders.push({
name: "access-control-allow-origin",
value: parsedUrl.origin
value: origin
});
return {
responseHeaders: details.responseHeaders
Expand Down

0 comments on commit cc36cd7

Please sign in to comment.