简体   繁体   English

如果直接嵌入数据,为什么MozAudioAvailable的帧缓冲区会抛出?

[英]Why does MozAudioAvailable's Framebuffer throw if I embed data directly?

I read here: https://wiki.mozilla.org/Audio_Data_API#Security the following. 我在这里阅读: https : //wiki.mozilla.org/Audio_Data_API#Security以下。

The MozAudioAvailable event's frameBuffer attribute will throw if the origin of audio resource does not match the document's origin. 如果音频资源的来源与文档的来源不匹配,则会抛出MozAudioAvailable事件的frameBuffer属性。

When I tried linking to an audio file in the same directory and then accessing MozAudioAvailable's Framebuffer, no security error was thrown. 当我尝试链接到同一目录中的音频文件,然后访问MozAudioAvailable的Framebuffer时,未引发安全错误。 But when I tried to embed the data in the page and do the same, a security error was thrown. 但是,当我尝试将数据嵌入页面中并执行相同操作时,抛出了安全错误。 Why? 为什么?

html-source: http://pastebin.com/6DrbNFv2 html来源: http : //pastebin.com/6DrbNFv2

It's enforcing the Same Origin Policy. 它正在实施“同源起源”策略。 You can view the details at this Wikipedia article . 您可以在此Wikipedia文章上查看详细信息。 Basically, to not generate a security warning, content must be from the same location. 基本上,为了不生成安全警告,内容必须来自同一位置。 Same location is defined as domain name, application layer protocol, and port number matching. 相同的位置定义为域名,应用程序层协议和端口号匹配。 In the case when your resources are in the same directory, these match. 如果您的资源位于同一目录中,则它们匹配。 When embedded, they do not. 当嵌入时,它们不会。

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

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