Search code examples
google-custom-search

Refused to display 'https://cse.google.com/cse?cx=...' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'


  1. I have a Google Custom Search result page with iframe fro showing results.
  2. I decide to create new one profile, and use this new in the same context.
  3. So I create profile and all I did on my site - just change search ID.
  4. As a result I got

    "Refused to display 'https://cse.google.com/cse?cx=...' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'."
    
  5. Then I change my ID back to the old one and it's start to work correctly.


Solution

  • Google stop to support iframes for the custom search result. So your old ID's are support iframes, as legacy support but the newly created profiles does not.