-1

I'm trying to build a webpage with the following specs:

  • A list of buttons on top
  • An area underneath the buttons where other websites can render
  • When a button is pushed, the area renders a different website

Seems pretty simple. So I built this with a few JS buttons on top and an iFrame below it. When I receive an onClick, I simply change the src attribute on the iFrame.

This works very well. Until... I try to put Google into the iFrame. Google refuses because it sets 'X-Frame-Options' to 'SAMEORIGIN'.

I fully understand what's happening here and more importantly, why it happens. But I still need to build this page.

Is there any way to get what I want without resorting to things that makes it look like I'm doing something unsavory? And yes, I realize I'm sort of duplicating the functionality of a browser window with a list of bookmarks, but I need things to look and operate in a certain way.

Sander Smith
  • 1,371
  • 4
  • 20
  • 30

1 Answers1

0

You could offer a search box and a submit button on a custom 'google' page which your iframe looks at (just a local script) and send the user to a new tab with that search automatically entered into Google. You cannot gleam anything from the iframe anyway so this wouldn't take away from your ability to do anything (other than keep the user on your tab), but if they're going to Google, you just don't have the choice.

Rack Sinchez
  • 111
  • 3