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: 496
Joined: Wed Jan 12, 2011 1:07 am
Location: Low Earth Orbit
Contact:

Quirks of Facebook (and google)

Post by sdfgeoff » Tue Oct 30, 2012 10:31 pm

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: 496
Joined: Wed Jan 12, 2011 1:07 am
Location: Low Earth Orbit
Contact:

Re: Quirks of Facebook (and google)

Post by sdfgeoff » Tue Oct 30, 2012 10:32 pm

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: 7127
Joined: Mon Aug 01, 2005 8:47 am
Location: Ơ̸̦͇̲̬̭̱̰͎̞͈̣͎͚̳ͬ͋̃̀̇͊͂͋͐ͦ̽ͣ̂ͥ͊̅̀̚͠ B̶͖̯͉̜̰̲̓̔͋̈́ͅ È̯ Y̪̤̼͉̠̙͝

Re: Quirks of Facebook (and google)

Post by Isaac » Tue Oct 30, 2012 10:38 pm

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
s☼-£♦и̫͍ͥ̍ͪ͌̓͗͡о̡̹̱͊̅ͮ̓̕͢б̧̝̻̪̤̳̜͐̓̉ͤ͢͜ ͙̬͙̆̑ͮ̐ͭ̾̂́͘i̎̌̾̓̽̀̈̓̀҉͉̙̦͎̘̝͕f̻͕͔̘ͣͣ̓͊̿͢͜ ͍͔͈͕̮̫ͣ̆ͮ̊͋/♂6Æ!♪╩"▲L└уͭ̂͐̇҉̴̣̼̞̠̯͓̺̞ф̜̊͌̈́̋̏̐́ц̨͔̮̿̇ ̨̛͖̙͖̖̮̗̱ͩ̆͞ͅа̥͇̞̖͚̟̅͐ͤ͞͠͠э̜̘̩̳̬͔̾ͯ̀ͫ̒̐̿ͅͅг̭̖̀ͦ̒̑ͥ̌ͮͫ͞ё͔̟̃ͬ̾̓͟ё̦̞̙̫͔̩͑̀͂ͯ̄̔̃̑̀͠ͅͅ
User avatar
sdfgeoff
DBB Ace
DBB Ace
Posts: 496
Joined: Wed Jan 12, 2011 1:07 am
Location: Low Earth Orbit
Contact:

Re: Quirks of Facebook (and google)

Post by sdfgeoff » Tue Oct 30, 2012 10:40 pm

yeah, sorry, this is more Tech than Cafe
Eh?
User avatar
Isaac
DBB Artist
DBB Artist
Posts: 7127
Joined: Mon Aug 01, 2005 8:47 am
Location: Ơ̸̦͇̲̬̭̱̰͎̞͈̣͎͚̳ͬ͋̃̀̇͊͂͋͐ͦ̽ͣ̂ͥ͊̅̀̚͠ B̶͖̯͉̜̰̲̓̔͋̈́ͅ È̯ Y̪̤̼͉̠̙͝

Re: Quirks of Facebook (and google)

Post by Isaac » Tue Oct 30, 2012 10:44 pm

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
s☼-£♦и̫͍ͥ̍ͪ͌̓͗͡о̡̹̱͊̅ͮ̓̕͢б̧̝̻̪̤̳̜͐̓̉ͤ͢͜ ͙̬͙̆̑ͮ̐ͭ̾̂́͘i̎̌̾̓̽̀̈̓̀҉͉̙̦͎̘̝͕f̻͕͔̘ͣͣ̓͊̿͢͜ ͍͔͈͕̮̫ͣ̆ͮ̊͋/♂6Æ!♪╩"▲L└уͭ̂͐̇҉̴̣̼̞̠̯͓̺̞ф̜̊͌̈́̋̏̐́ц̨͔̮̿̇ ̨̛͖̙͖̖̮̗̱ͩ̆͞ͅа̥͇̞̖͚̟̅͐ͤ͞͠͠э̜̘̩̳̬͔̾ͯ̀ͫ̒̐̿ͅͅг̭̖̀ͦ̒̑ͥ̌ͮͫ͞ё͔̟̃ͬ̾̓͟ё̦̞̙̫͔̩͑̀͂ͯ̄̔̃̑̀͠ͅͅ
User avatar
Jeff250
DBB Master
DBB Master
Posts: 6386
Joined: Sun Sep 05, 1999 2:01 am
Location: ☃☃☃

Re: Quirks of Facebook (and google)

Post by Jeff250 » Wed Oct 31, 2012 1:11 am

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: 9982
Joined: Sun Dec 09, 2001 3:01 am
Location: Brisbane, Australia
Contact:

Re: Quirks of Facebook (and google)

Post by roid » Wed Oct 31, 2012 3:14 am

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: 7127
Joined: Mon Aug 01, 2005 8:47 am
Location: Ơ̸̦͇̲̬̭̱̰͎̞͈̣͎͚̳ͬ͋̃̀̇͊͂͋͐ͦ̽ͣ̂ͥ͊̅̀̚͠ B̶͖̯͉̜̰̲̓̔͋̈́ͅ È̯ Y̪̤̼͉̠̙͝

Re: Quirks of Facebook (and google)

Post by Isaac » Thu Nov 01, 2012 3:45 pm

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
s☼-£♦и̫͍ͥ̍ͪ͌̓͗͡о̡̹̱͊̅ͮ̓̕͢б̧̝̻̪̤̳̜͐̓̉ͤ͢͜ ͙̬͙̆̑ͮ̐ͭ̾̂́͘i̎̌̾̓̽̀̈̓̀҉͉̙̦͎̘̝͕f̻͕͔̘ͣͣ̓͊̿͢͜ ͍͔͈͕̮̫ͣ̆ͮ̊͋/♂6Æ!♪╩"▲L└уͭ̂͐̇҉̴̣̼̞̠̯͓̺̞ф̜̊͌̈́̋̏̐́ц̨͔̮̿̇ ̨̛͖̙͖̖̮̗̱ͩ̆͞ͅа̥͇̞̖͚̟̅͐ͤ͞͠͠э̜̘̩̳̬͔̾ͯ̀ͫ̒̐̿ͅͅг̭̖̀ͦ̒̑ͥ̌ͮͫ͞ё͔̟̃ͬ̾̓͟ё̦̞̙̫͔̩͑̀͂ͯ̄̔̃̑̀͠ͅͅ
Valin Halcyon
DBB Admiral
DBB Admiral
Posts: 1102
Joined: Sun Jan 02, 2000 3:01 am

Re: Quirks of Facebook (and google)

Post by Valin Halcyon » Thu Nov 01, 2012 4:24 pm

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 » Sat Dec 01, 2012 9:33 pm

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: 6386
Joined: Sun Sep 05, 1999 2:01 am
Location: ☃☃☃

Re: Quirks of Facebook (and google)

Post by Jeff250 » Sun Dec 02, 2012 2:37 pm

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