1

Im getting this error:

Unsafe JavaScript attempt to access frame with URL "URL1" from frame with URL "URL2". Domains, protocols and ports must match.

What I try to do is to insert into my html page iframe (embed youtube video) but link is taken from database on the server side. during rendering site. Its property. Is it really wrong, should I do it in different way ?

thanks for help

EDIT:

I just set url=<%= VideoLink %> in my iframe. This is asp.net code property so I do believe its good question

Ok I even decided to set static link, know the source look like this and error still appears:

<iframe runat="server" ID="iframeYouTubeMini" title="YouTube video player" class="youtube-player" width="152" height="107" src="http://www.youtube.com/embed/test?controls=0" frameborder="0" allowfullscreen></iframe>
3
  • 2
    This is a "cross-site scripting" security issue. en.wikipedia.org/wiki/Cross-site_scripting. This is unrelated to c# or asp.net or your database. With minor exceptions, a frame can not access the DOM of another from a different domain. Run a search for your error on StackOverflow and you'll find many related questions. Commented Jul 30, 2011 at 18:19
  • but I just set url=<%= VideoLink %> in my iframe. This is asp.net code property so I do believe its good question. Commented Jul 30, 2011 at 19:23
  • Shouldn't you be setting the src property of iframe instead? Commented Jul 30, 2011 at 20:21

1 Answer 1

2

This is an error you will see in WebKit browsers (Google Chrome) and has to do with Cross Site Scripting. I've seen this exact same error in my SenchaTouch application when loading videos from Vimeo.

From what I've seen, there is no real way around it, and other than throwing a console error, it won't affect your application. My application runs exactly as expected with this error.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for this answer Chase, seems the same way for me. until some other developer screams bloody murder at me I guess I'll just ignore it :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.