Possible to prevent our website from running inside another domain's frameset or IFrame?

后端 未结 4 614
醉梦人生
醉梦人生 2021-02-09 17:05

We\'ve been having an problem recently where other sites are running our e-commerce site inside a frameset where our site (with the offenders affiliate id tacked on) is the only

4条回答
  •  孤独总比滥情好
    2021-02-09 17:32

    I believe the proper modern method to achieve this is with The X-Frame-Options response header.

    From the MDN:

    The X-Frame-Options HTTP response header can be used to indicate whether or not a browser should be allowed to render a page in a frame or iframe. Sites can use this to avoid clickjacking attacks, by ensuring that their content is not embedded into other sites.

    Take a look at: How to prevent IFRAME from redirecting top-level window

提交回复
热议问题