Skip to content

Commit

Permalink
feat: 解决跨域抓取问题
Browse files Browse the repository at this point in the history
  • Loading branch information
xiewme committed Dec 2, 2019
1 parent dc0843e commit 5e1b7e0
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/preview.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@slimkit/plus-editor",
"version": "1.2.5",
"version": "1.2.6",
"description": "rich-text editor for plus",
"main": "dist/main.bundle.js",
"repository": "[email protected]:mutoe/plus-editor.git",
Expand Down
2 changes: 1 addition & 1 deletion src/caller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function callMethod(fnName: string, params: any = undefined) {
}
} else {
// not in webview
// tryHijackUploadCall(fnName, params)
tryHijackUploadCall(fnName, params)
return false
}

Expand Down
2 changes: 1 addition & 1 deletion src/uploader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ async function uploadRemoteImage(params: {
})
img.addEventListener('error', () => reject())
img.crossOrigin = 'anonymous'
img.src = params.src
img.src = `${apiV2BaseUrl.replace(/\/+/, '')}/crawl?url=${encodeURIComponent(params.src)}`
})

const spark = new Spark.ArrayBuffer()
Expand Down

0 comments on commit 5e1b7e0

Please sign in to comment.