2012-12-13 2 views
3

실패하지만, 점점 다음과 같은 오류 유지 : 사용하여 다음을"URL과 프레임에 액세스 할 수있는 안전하지 않은 자바 스크립트 시도"내가 XSL 페이지 내부에 YouTube 동영상을 삽입하기 위해 노력하고있어

Unsafe JavaScript attempt to access frame with URL [URL removed] from frame with URL http://www.youtube.com/embed/[video code removed]?showinfo=0&rel=0&fs=1. Domains, protocols and ports must match. 

을 간단한 iframe.

<iframe width="663" height="373" src="http://www.youtube.com/embed/[video code removed]?showinfo=0&amp;rel=0&amp;fs=1" frameborder="0"></iframe> 

이 문제를 조사한 결과,이 오류는 대개 페이지의 JavaScript에 영향을주지 않습니다. 그러나, 우리의 경우, 그것은 내가 가지고있는 호버 효과에 아주 나쁜 영향을 미치고 있습니다. 자바 스크립트를 통해 비디오를 인스턴스화하는 것을 포함하여 여러 가지 수정 사항을 시도했지만 아무 소용이 없습니다. 누군가가 대답을 알고 있기를 바래요!

+0

[youtube api] (https://developers.google.com/youtube/)를 사용하셨습니까? – epascarello

+0

나는 iframe API 및 JavaScript API를 가지고 있습니다. 둘 다 같은 오류를 반환합니다. –

답변

0

저는 YouTube가 발신자 프레임에 어떤 이유로 착수하려고 시도하고 있으며 그것이 크로스 도메인 호출이기 때문에 비활성화되어 있다고 생각합니다.

아마 정책에 도움이 될 수 있습니다이 문서 : 또한 HTML5, sandboxing iframes

, 당신은 구글의 문서에 따르면, "기원"매개 변수를 지정할 수 있습니다 :

As an extra security measure, you should also include the origin parameter to the URL, specifying the URL scheme (http:// or https://) and full domain of your host page as the parameter value. While origin is optional, including it protects against malicious third-party JavaScript being injected into your page and hijacking control of your YouTube player.

는 지금이 내가 생각할 수있는 모든 것입니다 . 희망이 도움이됩니다.