[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1754
  • Last Modified:

Load Google.com inside an iframe

is it possible?
0
COwebmaster
Asked:
COwebmaster
  • 3
  • 3
  • 2
  • +1
3 Solutions
 
Scott Fell, EE MVEDeveloperCommented:
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
 
quizwedgeCommented:
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
 
Mahesh BhutkarCommented:
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
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 MVEDeveloperCommented:
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
 
quizwedgeCommented:
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
 
COwebmasterAuthor Commented:
so there is no way to open any google sites within an iframe I gather, yes?
0
 
Scott Fell, EE MVEDeveloperCommented:
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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now