Solved

Load Google.com inside an iframe

Posted on 2014-01-14
9
1,470 Views
Last Modified: 2014-02-07
is it possible?
0
Comment
Question by:COwebmaster
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 53

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
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 

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
 
LVL 53

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 53

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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

738 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