HighDots Forums  

frame burst of images.google

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss frame burst of images.google in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Xah Lee
 
Posts: n/a

Default frame burst of images.google - 02-10-2006 , 11:04 PM






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
xah (AT) xahlee (DOT) org
http://xahlee.org/


Reply With Quote
  #2  
Old   
Thomas 'PointedEars' Lahn
 
Posts: n/a

Default Re: frame burst of images.google - 02-11-2006 , 11:08 AM






Xah Lee wrote:

Quote:
[...]
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

Quote:
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();
}

Quote:
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.
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


Reply With Quote
  #3  
Old   
Xah Lee
 
Posts: n/a

Default Re: frame burst of images.google - 02-11-2006 , 03:11 PM



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 “defer”, 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
xah (AT) xahlee (DOT) org
http://xahlee.org/


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.