5

I want to load a web page inside a iframe tag element.

For example: <iframe src="https://www.google.com/" title="Google"></iframe>

Which gives me this error: Refused to display 'https://www.google.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

How can I solve this problem in Nuxt.js app (or Vue.js - it should be very similar config)? I tried with nuxt-helmet, but according to dosc I can use either DENY or SAMEORIGIN because ALLOW-FROM has limited browser support.

Emil Majer
  • 143
  • 1
  • 3
  • 11
  • 2
    Does this answer your question? [How to set 'X-Frame-Options' on iframe?](https://stackoverflow.com/questions/27358966/how-to-set-x-frame-options-on-iframe) – Greedo Oct 12 '20 at 13:00
  • 3
    You cant. thats a header form `google.com`. – Marc Oct 12 '20 at 13:00
  • 1
    I suggest you to read this post https://stackoverflow.com/questions/27358966/how-to-set-x-frame-options-on-iframe I advise you that in most cases, you should not use iframe. However, if you really need it, see this post as it contains your answer: https://stackoverflow.com/questions/52044101/how-to-add-headers-on-nuxt-static-files-response – demathos Oct 12 '20 at 13:08

0 Answers0