We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 10facb3 commit 0561049Copy full SHA for 0561049
1 file changed
src/helpers.ts
@@ -1,5 +1,3 @@
1
-import { requestUrl } from "obsidian";
2
-
3
export function withTimeout<T>(ms: number, promise: Promise<T>): Promise<T> {
4
const timeout = new Promise((_resolve, reject) => {
5
const id = setTimeout(() => {
@@ -61,20 +59,7 @@ export async function loadImageBlob(imgSrc: string): Promise<Blob> {
61
59
});
62
60
};
63
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
- }
+ reject();
78
79
image.src = imgSrc;
80
0 commit comments