Skip to content

Commit 3dad10e

Browse files
committed
feat: Resolve CORS issue.
logseq/marketplace#233 (comment)
1 parent 2523b31 commit 3dad10e

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

Diff for: README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ We may provide a script to delete those images in the future.
3434
- Navigate to the plugins dashboard: `t` `p`
3535
- Click the Load unpacked plugin button, then select the sample directory to load it
3636

37-
> Note: You can't use the plugin downloaded from marketplace due to CORS restriction. Please load it manually.
37+
> ~~Note: You can't use the plugin downloaded from marketplace due to CORS restriction. Please load it manually.~~
38+
> Now you can install the plugin from the marketplace directly because Logseq now provides an option to run plugin out of the sandbox.
3839
3940
## Configuration
4041

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "logseq-plugin-image-uploader",
3-
"version": "0.0.10",
3+
"version": "0.0.11",
44
"main": "dist/index.html",
55
"scripts": {
66
"dev": "vite",

Diff for: src/ImageUploadUtils.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ async function uploadImage(url: string): Promise<string> {
88
})
99
.then((res) => res.text())
1010
.then((content) => {
11-
console.log(content);
11+
console.log("[logseq-plugin-image-uploader]: " + content);
1212
return JSON.parse(content);
1313
})
1414
.then((resJSON) => {
@@ -21,7 +21,7 @@ async function uploadImage(url: string): Promise<string> {
2121
.catch((error) => {
2222
console.error('Error:', error);
2323
logseq.App.showMsg("Error: " + error.message, "error");
24-
logseq.App.showMsg("Please check if PicGo is running. And this plugin can only be run in manually loaded mode due to CORS restriction, please download it from GitHub release page.", "error");
24+
logseq.App.showMsg("Please check if PicGo is running. Check out more details in the developer tool's console.", "error");
2525
})
2626
}
2727

0 commit comments

Comments
 (0)