Skip to content

Commit 9640946

Browse files
committed
[chrome] fix blob url fetch using rewritten fetch
1 parent e934575 commit 9640946

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

packages/chrome/src/IsolatedFrame.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,9 @@ function makeController(url: URL): Controller {
333333
let headers = new Headers();
334334
headers.set("Content-Type", response.type);
335335

336-
return {
336+
return new Response(response.body, {
337337
headers,
338-
body: response.body,
339-
status: 200,
340-
} as unknown as BareResponseFetch;
338+
}) as BareResponseFetch;
341339
},
342340
});
343341

packages/chrome/src/components/Omnibar/UrlInput.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ export function UrlInput(props: {
6464
</>,
6565
<>
6666
<span class="subdomain">
67-
{use(props.url).map((t) => console.log(t, splitUrl(t)))}
6867
{use(props.url).map((t) => splitUrl(t)[0])}
6968
</span>
7069
<span class="domain">

packages/inject/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { setupHistoryEmulation } from "./history";
99
import { client, loadScramjet } from "./scramjet";
1010

1111
const history_replaceState = globalThis?.History?.prototype?.replaceState;
12+
const realFetch = fetch;
1213

1314
export const methods: FrameboundMethods = {
1415
async navigate({ url }) {
@@ -20,7 +21,7 @@ export const methods: FrameboundMethods = {
2021
window.dispatchEvent(popStateEvent);
2122
},
2223
async fetchBlob(url) {
23-
const response = await fetch(url);
24+
const response = await realFetch(url);
2425
const ab = await response.arrayBuffer();
2526
return {
2627
body: ab,

0 commit comments

Comments
 (0)