Javascript Window.open:访问DOM

时间:2014-05-30 21:44:34

标签: javascript dom youtube

我一直在尝试使用window.open弹出窗口。 我尝试了以下代码[此处显示缩短的URL]:

var sub=window.open('http://youtube.com...','Subscribe to Boss Gamerz','height=170,width=390');
sub.document.body.style.overflow = "hidden";
sub.focus();

这会打开一个新的弹出窗口,但不会像我预期的那样删除滚动条。 相反,铬在控制台中给出了一条错误消息:

Uncaught SecurityError: Blocked a frame with origin "http://example.com"
from accessing a frame with origin "swappedout://".  The frame requesting
access has a protocol of "http", the frame being accessed has a protocol
of "swappedout". Protocols must match.

如何正确使用此功能?

0 个答案:

没有答案