Failed to execute 'atob' on 'Window'

前端 未结 4 1579
被撕碎了的回忆
被撕碎了的回忆 2020-12-03 13:29

I\'m trying to save my HTML file in Chrome when the user presses ctrl + s keys but Chrome is crashed.

(I want to download just the source code of my HTM

4条回答
  •  隐瞒了意图╮
    2020-12-03 13:40

    In my case, I was going nuts since there wasn't any issues with the string to be decoded, since I could successfully decode it on online tools. Until I found out that you first have to decodeURIComponent what you are decoding, like so:

    atob(decodeURIComponent(dataToBeDecoded));
    

提交回复
热议问题