简体   繁体   English

Javascript可在Firefox中使用,但不能在Chrome中使用

[英]Javascript working in Firefox, but not in Chrome

I am testing the following javascript project: https://github.com/cwilso/AudioRecorder . 我正在测试以下javascript项目: https : //github.com/cwilso/AudioRecorder When I try to run the same project demo from this link: https://webaudiodemos.appspot.com/AudioRecorder/index.html it works on both browsers. 当我尝试通过以下链接运行相同的项目演示: https : //webaudiodemos.appspot.com/AudioRecorder/index.html时,它可在两种浏览器上使用。 But, when I download the project from github and run it localy from my computer, it doesn't work on Chrome. 但是,当我从github下载该项目并在我的计算机上本地运行该项目时,它无法在Chrome上运行。 It just freezes(no waveform and the record button doesn't work). 它只是冻结(没有波形,并且记录按钮不起作用)。

Google chrome has some javascript limitations when the webpage is not run from a webserver or localhost server. 当网页不是从网络服务器或本地主机服务器运行时,Google chrome有一些JavaScript限制。

I'm not sure that's the issue but I'm putting my bet on it. 我不确定这是问题所在,但我敢打赌。

You can try adding "-allow-file-access-from-files" to your chrome shortcut and see if that fixes the problem. 您可以尝试在Chrome快捷方式中添加“ -allow-file-access-from-files”,看看是否可以解决问题。 If it does that means that audiorecorder only works properly on a localhost or webserver. 如果这样做,则意味着audiorecorder仅可在localhost或网络服务器上正常工作。


Above file access issue in chrome is what I ran into a long time ago with less.js chrome中的上述文件访问问题是我很久以前使用less.js遇到的问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM