Skip to content

Commit 0561049

Browse files
committed
chore: remove fallback in loadImageBlob
1 parent 10facb3 commit 0561049

1 file changed

Lines changed: 1 addition & 16 deletions

File tree

src/helpers.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { requestUrl } from "obsidian";
2-
31
export function withTimeout<T>(ms: number, promise: Promise<T>): Promise<T> {
42
const timeout = new Promise((_resolve, reject) => {
53
const id = setTimeout(() => {
@@ -61,20 +59,7 @@ export async function loadImageBlob(imgSrc: string): Promise<Blob> {
6159
});
6260
};
6361
image.onerror = async () => {
64-
try {
65-
await requestUrl(image.src);
66-
67-
// console.log("possible CORS violation, falling back to allOrigins proxy");
68-
// https://github.com/gnuns/allOrigins
69-
const blob = await loadImageBlob(
70-
`https://api.allorigins.win/raw?url=${encodeURIComponent(
71-
imgSrc
72-
)}`
73-
);
74-
resolve(blob);
75-
} catch {
76-
reject();
77-
}
62+
reject();
7863
};
7964
image.src = imgSrc;
8065
});

0 commit comments

Comments
 (0)