UrlPlayer: clearing the hash in the URL for Safari

This commit is contained in:
He4eT 2021-07-27 17:40:44 +05:00
commit e5c96709d8

View file

@ -17,9 +17,15 @@ const prepareVM = ({ url, setStatus, setParts }) => {
return args return args
} }
const cleanUrl = url => _ =>
url.startsWith('blob:')
? url.replace(/#(.*)$/g, '')
: url
return Promise.resolve() return Promise.resolve()
.then(st('loading', 'Downloading file')) .then(st('loading', 'Downloading file'))
.then(_ => fetch(url)) .then(cleanUrl(url))
.then(fetch)
.then(st('loading', 'Processing file')) .then(st('loading', 'Processing file'))
.then(response => response.arrayBuffer()) .then(response => response.arrayBuffer())
.then(arrayBuffer => new Uint8Array(arrayBuffer)) .then(arrayBuffer => new Uint8Array(arrayBuffer))