mirror of
https://github.com/Kenshin/simpread.git
synced 2026-01-25 14:28:34 +00:00
fixed: 当链接是https 但资源引用是http 时导致的replace原文的图片链接失败。
This commit is contained in:
parent
ab33bf17d7
commit
a059a677a2
@ -44,10 +44,10 @@ browser.runtime.onMessage.addListener( function( request, sender, sendResponse )
|
||||
if (request.type == msg.MESSAGE_ACTION.NOTION_DL_IMG) {
|
||||
try {
|
||||
const option = request.value
|
||||
const { url } = option
|
||||
const { url, protocol } = option
|
||||
const dlRes = await axios({
|
||||
method: 'get',
|
||||
url,
|
||||
url: url.replace(/https?:/, protocol),
|
||||
responseType: 'blob',
|
||||
})
|
||||
|
||||
|
||||
@ -1390,7 +1390,8 @@ class Notion {
|
||||
return new Promise((resolve, reject) => {
|
||||
browser.runtime.sendMessage(
|
||||
msg.Add(msg.MESSAGE_ACTION.NOTION_DL_IMG, {
|
||||
url:url.replace(/https?:/, window.location.protocol),
|
||||
url,
|
||||
protocol: window.location.protocol
|
||||
}),
|
||||
(res) => {
|
||||
if (res.done) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user