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

后端 未结 4 621
醉梦人生
醉梦人生 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:25

    Take a look at this article. It offers a fairly simple solution for detecting frames and breaking out of them.

    How to Break Out of Frames with JavaScript

    In addition, I would take it one step further. Whenever you detect a frame, grab the affiliate ID of the offending site framer, and push that to the server with AJAX along with the URL they are using. Then, either automatically or manually, you can verify that they are framing your site, and cancel their affiliate code one at a time.

提交回复
热议问题