Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Embed WebPage  RSS feed

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I wanted to know if I can have a webapge of my own and then embed a frame in it which displays some other website in it.. like google.com? If it's possible, how would I go about it?

Thanks in advance!
 
Author and ninkuma
Marshal
Posts: 66612
161
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nothing to do with JSP; you can simply use an HTML iframe.
 
Santosh Bobade
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But certain websites would not work with iframe, take for example google.com. How would I make it work with such sites?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66612
161
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Santosh Bobade wrote:But certain websites would not work with iframe, take for example google.com. How would I make it work with such sites?



If the site has a "frame buster" script, then yeah, you'll need to be more clever; like suck in the source and remove the script.

But the question is, if the site doesn't want you to be embedding it in your own, should you?
 
Saloon Keeper
Posts: 8764
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, in some cases you can't do this even with a more sophisticated approach. For instance, Google uses X-FRAME-OPTIONS with SAMEORIGIN, meaning that you will never be able to embed it in an iframe if you're using a mainstream browser. The reason for this is to prevent clickjacking.
 
Santosh Bobade
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, you are correct. This is done for preventing clickjacking but I am trying to do something harmless. With this code, I could get the webpage. But how would I display this entire page in just one part of my page, currently (as expected from this code which I found on web) it overlays on my entire page. How would I just display it in a frame or just part of my webpage?


 
Stephan van Hulst
Saloon Keeper
Posts: 8764
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Santosh Bobade wrote:but I am trying to do something harmless


And how would Google know that you're doing something harmless?

Simply put, you can't do this.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!