图像爆炸.google [英] frame burst of images.google

查看:67
本文介绍了图像爆炸.google的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我无法弄清楚的。


我试图推出image.google.com的顶级框架到我的

页面。


如果你去
http://images.google.com/images?q=milk+tits

点击页面
http://xahlee.org/Periodic_dosage_di...caryatids.html

它应该踢出谷歌的框架,但它不是。


如果我在脚本中放置一个alert() ,它甚至不会弹出。但我无法在google'的html中看到

有js或禁用js。


然而,它适用于safari,但不是在Mac Opera或Mac Firefox中也没有

iCab。但是,如果从带有框架集的localhost和从下载的谷歌中获得的顶部框架运行它都可以。


任何想法?


Xah
xa*@xahlee.org

a ?? http://xahlee.org/

there''s this one i can''t figure out.

I''m trying to kick out image.google.com''s top frame when it goes to my
page.

If you go to
http://images.google.com/images?q=milk+tits
click on the page
http://xahlee.org/Periodic_dosage_di...caryatids.html
it should kick out the google''s frame, but it isn''t.

If i put a alert() in the script, it won''t even popup. But i can''t see
anywhere in google''s html that has js or disables js.

however, it works in safari, but not in Mac Opera nor Mac Firefox nor
iCab. However, it all works if run from localhost with the frameset and
top frame from downloaded google.

any ideas?

Xah
xa*@xahlee.org
a?? http://xahlee.org/

推荐答案

Xah Lee写道:
Xah Lee wrote:
[...]
我正试图推出image.google.com当它进入我的页面时,它的顶部框架。

如果你去
http://images.google.com/images?q=milk+tits
点击页面
< a rel =nofollowhref =http://xahlee.org/Periodic_dosage_dir/20031016_caryatids.html\"target =_ blank> http://xahlee.org/Periodic_dosage_di...caryatids.html
如果我在脚本中放置一个alert(),它甚至不会弹出。但我无法在google'的html中看到任何地方有js或禁用js。


您的代码是(漂亮打印):


函数f()

{

if(window.top.location.href!= window.self.location.href)

{

window.top.location.href = window。 self.location.href;

}

}

window.setTimeout(f,1000 * 3);


关注< URL:http://jibbering.com/faq/#FAQ4_43>会告诉你

它会导致


|错误:未捕获的异常:拒绝获取属性的权限Location.href


您正在尝试读取`window.top.location.href''。由于框架集文档的URL域名为images.google.com,因此包含访问代码的框架文档的

URL的域名是xahlee.org,

同源策略禁止这样做。不要比较位置,而是比较

对象引用。


你的window.setTimeout()调用是不可靠的;如果不支持window.setTimeout(),一个

主机对象的方法,则脚本会中断;如果需要

完全加载框架集3秒钟,你的脚本就会中断;

如果不支持函数对象引用作为
$ b的第一个参数$ b window.setTimeout(),你的脚本失败或中断。


其中一个或两个可能是没有进一步脚本代码的原因(例如

`review然后执行(...)'')。此外,window.self是

引用与window相同的对象,所以使用前者是低效的




试试这个:


函数isMethodType(s)

{

return(s == " function" || s ==" object");

}


if(typeof window!=" undefined"

&&& isMethodType(typeof window.setTimeout)

&& isMethodType(typeof window.clearTimeout))

{

var f = function()

{

if(typeof window.top!=" undefined")

{

if(window.top)

{

if(window!= window.top)

{

window.top.location = window.location;

}

else

{

if (typeof f.timeout!=" undefined")

{

window.clearTimeout(f.timeout);

}

}

}

其他

{

f.timeout = window.setTimeout(" f()",3000);

}

}

};


f();

}

然而,它适用于safari,但不适用于Mac Opera或Mac Firefox也不是iCab。但是,如果使用带有框架集的localhost和来自下载谷歌的顶部框架运行,则一切正常。
[...]
I''m trying to kick out image.google.com''s top frame when it goes to my
page.

If you go to
http://images.google.com/images?q=milk+tits
click on the page
http://xahlee.org/Periodic_dosage_di...caryatids.html
it should kick out the google''s frame, but it isn''t.

If i put a alert() in the script, it won''t even popup. But i can''t see
anywhere in google''s html that has js or disables js.
Your code is (pretty-printed):

function f()
{
if (window.top.location.href != window.self.location.href)
{
window.top.location.href = window.self.location.href;
}
}
window.setTimeout(f,1000*3);

Following <URL:http://jibbering.com/faq/#FAQ4_43> would have told you that
it causes

| Error: uncaught exception: Permission denied to get property Location.href

You are attempting to read `window.top.location.href''. Since the domain
of the frameset document''s URL is "images.google.com" and the domain of the
URL of the frame document that contains the accessing code is "xahlee.org",
the Same Origin Policy forbids that. Do not compare locations but compare
object references instead.

Your window.setTimeout() call is unreliable; if window.setTimeout(), a
host object''s method, is not supported, your script breaks; if it takes
more then 3 seconds to load the frameset completely, your script breaks;
if Function object references are not supported as first argument of
window.setTimeout(), your script fails or breaks.

Either or both may be the reason why no further script code (e.g.
`alert(...)'') is executed then. Furthermore, `window.self'' is
referring to the same object as `window'' does, so it is inefficient
to use the former.

Try this:

function isMethodType(s)
{
return (s == "function" || s == "object");
}

if (typeof window != "undefined"
&& isMethodType(typeof window.setTimeout)
&& isMethodType(typeof window.clearTimeout))
{
var f = function()
{
if (typeof window.top != "undefined")
{
if (window.top)
{
if (window != window.top)
{
window.top.location = window.location;
}
else
{
if (typeof f.timeout != "undefined")
{
window.clearTimeout(f.timeout);
}
}
}
else
{
f.timeout = window.setTimeout("f()", 3000);
}
}
};

f();
}
however, it works in safari, but not in Mac Opera nor Mac Firefox nor
iCab. However, it all works if run from localhost with the frameset and
top frame from downloaded google.




域(localhost)与之相同。 br />

BTW:您的标记无效。 < URL:http://validator.w3.org/>


BTW 2:这与样式表无关,所以不要交叉到

comp.infosystems。 www.authoring.stylesheets

F''up2 comp.lang.javascript


PointedEars



The domain (localhost) is the same then.

BTW: Your markup is not Valid. <URL:http://validator.w3.org/>

BTW 2: This has nothing to do with stylesheets, so do not crosspost to
comp.infosystems.www.authoring.stylesheets.
F''up2 comp.lang.javascript

PointedEars


Xah Lee写道:

? ?我正试图将image.google.com的顶部框架踢出去

我的

页面。


如果你去
http:// images.google.com/images?q=milk+tits

点击页面
http://xahlee.org/Periodic_dosage_di...caryatids.html

它应该踢出谷歌的框架,但它不是。

??


Thomas''PointedEars ''Lahn写道:

?? ... ??


不错的建议,但没有一个在这方面有用。

这是非常令人费解的。因为在尝试了很多东西来诊断

问题之后,谷歌可能已经实施了一些机制,以便

来禁用它们的框架。因为,当我用一些变化调整

脚本时,点击谷歌图片将导致

我的页面在谷歌的面板框架下方完全空白,如如果我的

页面试图刷新并变得拙劣。或者,一些变化会导致谷歌的顶部框架空白以及我的页面......但它可以在

Safari中工作,我无法找到任何<脚本>在谷歌的来源。


如果我在我的页面中放置一个警报(),它可能会或可能不会取决于

脚本变体我''正在使用。


这里的变体应该可行:

< script type =" text / javascript" defer>

if(window.top!= window.self){window.top.location.href =

window.self.location.href;}

< / script>


我尝试过使用?? defera ??,setTimeout的组合......可能是

难以测试,因为它在本地工作。你需要在谷歌图片中找到一个搜索

字符串才能点击你的页面。


Xah
xa*@xahlee.org

a ?? http://xahlee.org/

Xah Lee wrote:
??I''m trying to kick out image.google.com''s top frame when it goes to
my
page.

If you go to
http://images.google.com/images?q=milk+tits
click on the page
http://xahlee.org/Periodic_dosage_di...caryatids.html
it should kick out the google''s frame, but it isn''t.
??

Thomas ''PointedEars'' Lahn wrote:
??...??

nice suggestions, but none are useful in this context.

this is quite puzzling. Because after tried many things to diagnose the
problem, it might be that google has implemented some mechanism so as
to disable kicking out their frames. Because, when i tweaked the
script with some variation, clicking on the google image will result in
my page being completely blank below the google''s panel frame, as if my
page tried to refresh and got botched. Or, some variation results both
google''s top frame being blank as well as my page... but it works in
Safari and i couldn''t locate any <script> in google''s sources.

if i put a alert() in my page, it may or may not act depending on the
script variation i''m using.

Here''s a variation that should just work:
<script type="text/javascript" defer>
if ( window.top != window.self) {window.top.location.href =
window.self.location.href;}
</script>

i''ve tried combinations of using a??defera??, setTimeout,... itmay be
hard to test because it works locally. You''ll need to find a search
string in google images so that it hits your page.

Xah
xa*@xahlee.org
a?? http://xahlee.org/

< br>

Frameset Infinity!
http:// xahlee .org / js / frame2 / frameset.html


HTML框架教程+无限!
http://xahlee.org/js/frame/0.html


Xah
xa*@xahlee.org

a ?? http://xahlee.org/

Frameset Infinity!
http://xahlee.org/js/frame2/frameset.html

HTML Frame tutorial + Infinity!
http://xahlee.org/js/frame/0.html

Xah
xa*@xahlee.org
a?? http://xahlee.org/


这篇关于图像爆炸.google的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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