从youtube替换url以嵌入代码 - 错误:拒绝访问属性'toString'的权限 [英] Replace url from youtube to embed code - Error: Permission denied to access property 'toString'

查看:160
本文介绍了从youtube替换url以嵌入代码 - 错误:拒绝访问属性'toString'的权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在FireBug中有此代码和此错误:

I have this code and this error in FireBug:


错误:访问属性'toString'的权限被拒绝

Error: Permission denied to access property 'toString'

如何修复此错误?

HTML:

<div class="yturl">http://www.youtube.com/watch?v=UNMLEZrukRU</div>

JS:

$("div.yturl").each(function(){
    var regex = /(\?v=|\&v=|\/\d\/|\/embed\/|\/v\/|\.be\/)([a-zA-Z0-9\-\_]+)/;
    var youtubeurl = $(this).text();
    var regexyoutubeurl = youtubeurl.match(regex);
    if (regexyoutubeurl) 
    {
         $(this).html("<iframe width=\"390\" height=\"315\" src=\"http://www.youtube.com/embed/"+regexyoutubeurl[2]+"\" frameborder=\"0\" allowfullscreen></iframe>");
    }
});

DEMO: http://jsfiddle.net/9e48p/

推荐答案

错误可以由Adobe的Flash Player团队或Google工程师修复 - 您现在应该忽略它。它连接到Flash Player安全设置和嵌入Youtube页面的SWF文件。问题一直是 IBM过去报告,那里是一个 Mozilla Bugzilla条目

The error can either be fixed by Adobe's Flash Player team, or by the Google engineers - you should just ignore it for now. It's connected to Flash Player security settings and the SWF file embedded into the Youtube page. The problem has been reported in the past by IBM, and there is a Mozilla Bugzilla entry as well.

当我在Firefox 16.0.2中停用Flash Player时,错误消息消失。查看评论#37: https://bugzilla.mozilla.org/show_bug.cgi? id = 434522#c37

When I deactivate Flash Player in Firefox 16.0.2, the error message disappears. Check comment #37: https://bugzilla.mozilla.org/show_bug.cgi?id=434522#c37


对于它的价值,我发现这个错误发生在 any flash文件,
甚至那些在
中没有动作脚本调用(ExternalInterface等)的内容,被加载到页面域
和iframe域的页面上的iframe中是不同的。这意味着iframe
问题是在
位置实际存在跨域情况时引起的。但是,目前还不完全清楚是否实际上
试图成为跨域调用被阻止且
错误输出。

For what it's worth, I'm seeing this bug happen when any flash file, even ones that have NO actionscript calls (ExternalInterface, etc) in them at all, is loaded into an iframe on a page where the page domain and the iframe domain are different. This means that the iframe problem is caused when there is in fact a cross-domain situation in place. However, it's not totally clear if there's really actually attempting to be a cross-domain call that should be prevented and error'd out.

因为闪存SWF本身试图调用
Location.toString并不是什么,而且它只是在页面
上执行它的javascript,唯一的选择是有一些关于flash
插件本身(9.0.124是我正在测试的),它试图使
调用父/顶窗口来做Location.toString() 。

Because it's nothing that the flash SWF itself is trying to call to do "Location.toString", and it's nothing about the javascript on the page doing it, the only choice is that there's something about the flash plugin itself (9.0.124 is what I'm testing with) that's trying to make that call up to the parent/top window to do Location.toString().

当错误被标记为已解决时,附加的测试用例 https://bug434522.bugzilla.mozilla.org/attachment.cgi?id=321956 在最新的Firefox版本中生成相同的错误消息(在Firebug控制台或Firefox错误控制台窗口中)。

While the bug is marked as resolved, the test case attached https://bug434522.bugzilla.mozilla.org/attachment.cgi?id=321956 produces the same error message in the latest Firefox version (both in the Firebug console, or the Firefox Error Console window).

更新:

该错误已经在旧的错误数据库中提交给Adobe: FP-561Location.toString由于Flash插件行为不当导致的未被捕获(安全)异常(您需要一个帐户才能查看错误详情)。错误关闭时的最后评论:

Update:
The bug has been filed with Adobe as well in the old bug database: FP-561 "Location.toString" uncaught (security) exception caused by improper Flash plugin behavior (you need an account to see the bug details). The last comment there when the bug was closed:


在Firefox 4和5上使用最新的Flash Player 10.3.181.34进行测试,没有
这样的例外被抛出。所以bug可能已经修复了,对吧?如果
您仍然遇到此问题,请在我们的新错误系统中提交错误
https:// bugbase.adobe.com/ 并在这个
原始JIRA报告的新bug中添加一个链接。我们很乐意在新的
错误系统中跟进您的报告。

Tested with the latest Flash Player 10.3.181.34 on Firefox 4 and 5, no such exception was thrown. So the bug may have been fixed, right? If you still meet this issue, please file a bug in our new bug system https://bugbase.adobe.com/ and put a link in the new bug to this original JIRA report. We are happy to follow up your report in the new bug system.

这篇关于从youtube替换url以嵌入代码 - 错误:拒绝访问属性'toString'的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆