Solved

Load Google.com inside an iframe

Posted on 2014-01-14
9
1,357 Views
Last Modified: 2014-02-07
is it possible?
0
Comment
Question by:COwebmaster
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 52

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 167 total points
ID: 39781344
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
 
LVL 14

Assisted Solution

by:quizwedge
quizwedge earned 333 total points
ID: 39781497
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
 
LVL 6

Expert Comment

by:Mahesh Bhutkar
ID: 39781544
0
 

Author Comment

by:COwebmaster
ID: 39782600
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39782639
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
 
LVL 14

Accepted Solution

by:
quizwedge earned 333 total points
ID: 39782864
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
 

Author Comment

by:COwebmaster
ID: 39843396
so there is no way to open any google sites within an iframe I gather, yes?
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39843454
Yes, there is no way to place google in an iframe.  Use google custom search.  That is what it is meant for.
0
 

Author Closing Comment

by:COwebmaster
ID: 39843459
Thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now