Skip to content

Commit

Permalink
Fix "Failed - Network error" issue
Browse files Browse the repository at this point in the history
  • Loading branch information
pgmichael committed Apr 6, 2019
1 parent c3fcbf8 commit 57692be
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
11 changes: 7 additions & 4 deletions js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ class WaveNet {
if (!this.validateSettings(settings)) return

let audioContent = await this.getAudioContent(settings, string)
chrome.downloads.download({
'url': `data:audio/mp3;base64,${audioContent}`,
'filename': 'download.mp3'
})
if (audioContent !== null) {
const blob = await (await fetch(`data:audio/mp3;base64,${audioContent}`)).blob()
chrome.downloads.download({
'url': URL.createObjectURL(blob),
'filename': 'download.mp3'
})
}
})
}

Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "WaveNet for Chrome",
"version": "1.6.0",
"version": "1.6.1",
"manifest_version": 2,
"description": "A wrapper for Google Cloud Text-to-Speech that transform highlighted text into high-quality natural sounding audio.",
"icons": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wavenet-for-chrome",
"version": "1.6.0",
"version": "1.6.1",
"description": "A wrapper for Google Cloud Text-to-Speech that transform highlighted text into high-quality natural sounding audio.",
"main": ".eslintrc.js",
"scripts": {
Expand Down

0 comments on commit 57692be

Please sign in to comment.