Load Google.com inside an iframe

is it possible?
COwebmasterAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
quizwedgeConnect With a Mentor Commented:
https://plus.google.com also has x-frame-options:SAMEORIGIN.

One way to check is to load the site in Chrome with the developer tools open. (View -> Developer -> Developer Tools) Click on the network tab and look for the page. It should be the first one, in this case plus.google.com. Click on that page and scroll down to where it says "Response Headers". Under Response Headers you'll see "x-frame-options". If it says SAMEORIGIN, that means you have to be the same domain to iframe it.

Note, you have to have the Developer Tools open before you load the page (or open them and reload the page.) The network tab only shows items loaded after you've opened the developer tools.
0
 
Scott Fell, EE MVEConnect With a Mentor Developer & EE ModeratorCommented:
What you want is google custom search https://developers.google.com/custom-search/

This will allow you to load the results in a div.
0
 
quizwedgeConnect With a Mentor Commented:
I agree with Scott that custom search is what you want.

For security and/or to prevent competitors from using their main search page, Google only allows Google to iframe the google.com using x-frame-options:SAMEORIGIN (https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options?redirectlocale=en-US&redirectslug=The_X-FRAME-OPTIONS_response_header)

The only way I've seen around this is to set up a reverse proxy. Seems that custom search would be the more stable and easier solution.
0
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
Mahesh BhutkarCommented:
0
 
COwebmasterAuthor Commented:
i want to load in http://plus.google.com into an iframe, not results from any query.  Is that possible or do they prevent from doing that?
0
 
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Are you asking how to do an iframe or if it is within their TOS?  

You may wan to read deeper but it looks like as long as you are not selling any ads around the content it might be ok http://www.google.com/+/policy/embedded-content.html
0
 
COwebmasterAuthor Commented:
so there is no way to open any google sites within an iframe I gather, yes?
0
 
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Yes, there is no way to place google in an iframe.  Use google custom search.  That is what it is meant for.
0
 
COwebmasterAuthor Commented:
Thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.