How to link preview to my own website URL not themeforesrt?

wordpress
themeforest

#1

Hi, I have a question. How to use my own website demo URL as preview url, I don’t want to use preview.themeforest.net/…?


#2

You can’t do it directly, but you can write some JavaScript that will “escape” the iframe and redirect from preview.themeforest.net to your own URL.


#3

There is a complete example shared on github, exactly for this scope :slight_smile: . Kindly check this out https://github.com/proteusthemes/themeforest-preview-bar


#4
<script>
(function(window) {
  if (window.location !== window.top.location) {
    window.top.location = window.location;
  }
})(this);
</script>