Quirks of Facebook (and google)

For all coding issues - MODers and programmers, HTML and more.

Moderators: Jeff250, fliptw

Post Reply
User avatar
sdfgeoff
DBB Ace
DBB Ace
Posts: 498
Joined: Wed Jan 12, 2011 1:07 am
Location: Low Earth Orbit
Contact:

Quirks of Facebook (and google)

Post by sdfgeoff »

Well, I like IRC, and use it quite a bit, so I've been creating custom pages to put it on.

In an online browser game I play, I made a page that will load chat down the bottom, and the game up the top. That works fine.
So how about facebook? Well, facebook doesn't load in a frame.
So I tried to load google so I could then find facebook. No such luck, google didn't work either.

I was now wondering if my code was wrong.
But I tried one more: duckduckgoo.com
That loaded fine, and from there I tried to access both facebook and google.
Facebook loaded, but overwrote the frameset.
Google didn't load at all.

How can a page even detect that it's in a frame?
Why would a page guard against it, I can't see it being a security risk.

If you are interested, the code I used:

Code: Select all

<head>
<title>sdfgeoff's chat bar</title>
<meta name='author' content='sdfgeoff'>
<meta name='date' content='30 October 2012'></meta>

<frameset rows="*,300">
  <frame src="http://duckduckgoo.com" name="PG">
  <frame src="http://widget00.mibbit.com/?settings=bdf88975c778a8d1535311aebda07265&server=irc.mibbit.net&channel=%23DEEP_Space&nick=Friend_23%3F%3F&noservernotices=true" name="Chat">
</frameset>
</head>
<body>
</body>
Eh?
User avatar
sdfgeoff
DBB Ace
DBB Ace
Posts: 498
Joined: Wed Jan 12, 2011 1:07 am
Location: Low Earth Orbit
Contact:

Re: Quirks of Facebook (and google)

Post by sdfgeoff »

Oh, and the facebook html source code is an absolute nightmare. I think they deliberately made it impossible to read.
Google is the same
Eh?
User avatar
Isaac
DBB Artist
DBB Artist
Posts: 7736
Joined: Mon Aug 01, 2005 8:47 am
Location: 🍕

Re: Quirks of Facebook (and google)

Post by Isaac »

By the powers invested in me, I call upon the titans to move thy thread into the proper section. Arise, Jeff! Arise!

edit: I'd stay away from frames and do some kind of ajax get function, but I'm a noob so I'll stfu
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ :E ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
User avatar
sdfgeoff
DBB Ace
DBB Ace
Posts: 498
Joined: Wed Jan 12, 2011 1:07 am
Location: Low Earth Orbit
Contact:

Re: Quirks of Facebook (and google)

Post by sdfgeoff »

yeah, sorry, this is more Tech than Cafe
Eh?
User avatar
Isaac
DBB Artist
DBB Artist
Posts: 7736
Joined: Mon Aug 01, 2005 8:47 am
Location: 🍕

Re: Quirks of Facebook (and google)

Post by Isaac »

Wha? Tech? That's hardware and closed source software you bought at Walmart.

Let me welcome you to the coders corner: http://descentbb.net/viewforum.php?f=7
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ :E ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
User avatar
Jeff250
DBB Master
DBB Master
Posts: 6530
Joined: Sun Sep 05, 1999 2:01 am
Location: ❄️❄️❄️

Re: Quirks of Facebook (and google)

Post by Jeff250 »

Look into the X-Frame-Options HTTP header.
Isaac wrote:Arise, Jeff!
As a mod, I can't move stuff *into* my forums, only out of...
User avatar
roid
DBB Master
DBB Master
Posts: 9996
Joined: Sun Dec 09, 2001 3:01 am
Location: Brisbane, Australia
Contact:

Re: Quirks of Facebook (and google)

Post by roid »

i thought the ability to detect you were in a frame and/or force a page refresh was a Java thing, can facebook work without java? I'd try that out.

But with html5 in the mix too thesedays i guess everything gets more complex. So who knows if it's java now or what
User avatar
Isaac
DBB Artist
DBB Artist
Posts: 7736
Joined: Mon Aug 01, 2005 8:47 am
Location: 🍕

Re: Quirks of Facebook (and google)

Post by Isaac »

roid wrote:i thought the ability to detect you were in a frame and/or force a page refresh was a Java thing, can facebook work without java? I'd try that out.

But with html5 in the mix too thesedays i guess everything gets more complex. So who knows if it's java now or what
java!=javascript
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ :E ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
Valin Halcyon
DBB Admiral
DBB Admiral
Posts: 1113
Joined: Sun Jan 02, 2000 3:01 am

Re: Quirks of Facebook (and google)

Post by Valin Halcyon »

The reason is less honorable pages used to use frames to "hijack" a major page, like FB or Google and put ads around it. It was unethical, and a major legal issue. The ability to detect someone trying to do that was quickly added to the DOM, and rapidly adopted to prevent the problem.
User avatar
Thenior
DBB Captain
DBB Captain
Posts: 667
Joined: Wed Oct 06, 2004 9:40 am

Re: Quirks of Facebook (and google)

Post by Thenior »

Valin is right, most browsers won't even let you load cross-domain ajax. Think about all the scams that could be done...
User avatar
Jeff250
DBB Master
DBB Master
Posts: 6530
Joined: Sun Sep 05, 1999 2:01 am
Location: ❄️❄️❄️

Re: Quirks of Facebook (and google)

Post by Jeff250 »

The question is about cross-domain frames, which are allowed, unless the framed response includes the X-Frame-Options HTTP header (which Google and Facebook *do* include), or, as Valin points out, you have javascript enabled and the framed page has some script to try to detect if it is framed.
Post Reply