Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum
https://www.tinywebgallery.com/forum/

Iframe redirecting user to source page
https://www.tinywebgallery.com/forum/viewtopic.php?f=21&t=4127
Page 1 of 1

Author:  laylabadge [ 23. Jul 2016, 14:43 ]
Post subject:  Iframe redirecting user to source page

On pages where I have an advanced iframe i'm finding that users are being redirected to the iframe source page.

I had everything working perfectly then out of nowhere the user is being redirected to the source page.

Pages without an iframe stay on the current site and aren't redirected.

https://www.coasttocoastmanpower.com/

Thank you

Author:  TinyWebGallery [ 23. Jul 2016, 15:00 ]
Post subject:  Re: Iframe redirecting user to source page

Seems the other page has added a iframe buster script which redirect to the page if it is in an iframe.

The only lagel thing you can do is to use the sandbox attribute (see the administration -> Basic tab at the bottom) which disables Javascript in the iframe. But the problem is than if the other page still works fine if you do this.
Or you ask the owner of the other page to remove this again.

Best, Michael

Author:  laylabadge [ 23. Jul 2016, 15:08 ]
Post subject:  Re: Iframe redirecting user to source page

Thanks for the reply.

I am the owner of both pages. I have no idea what script could be causing this. Any ideas?

Author:  TinyWebGallery [ 23. Jul 2016, 15:57 ]
Post subject:  Re: Iframe redirecting user to source page

function parentIsEvil() { var html = null; try { var doc = top.location.pathname; } catch(err){ }; if(typeof doc === "undefined") { return true } else { return false }; }; if (parentIsEvil()) { top.location = self.location.href; };var url

is doing this.

You have this directly in the html.

Best, Michael

Author:  TinyWebGallery [ 23. Jul 2016, 15:57 ]
Post subject:  Re: Iframe redirecting user to source page

Actually this block:

<!-- Open Graph Meta Tags & Twitter Card generated by Social Warfare v2.0.3 http://warfareplugins.com -->
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="CCM Job Posts">
<meta name="twitter:description" content="">
<meta name="twitter:site" content="@NRS3PL">
<script type="text/javascript">function parentIsEvil() { var html = null; try { var doc = top.location.pathname; } catch(err){ }; if(typeof doc === "undefined") { return true } else { return false }; }; if (parentIsEvil()) { top.location = self.location.href; };var url = "https://www.nationalretailsystems.com/ccm-job-posts/";if(url.indexOf("stfi.re") != -1) { var canonical = ""; var links = document.getElementsByTagName("link"); for (var i = 0; i < links.length; i ++) { if (links[i].getAttribute("rel") === "canonical") { canonical = links[i].getAttribute("href")}}; canonical = canonical.replace("?sfr=1", "");top.location = canonical; console.log(canonical);};</script>
<style>@font-face {font-family: "sw-icon-font";src:url("https://www.nationalretailsystems.com/wp-content/plugins/social-warfare/fonts/sw-icon-font.eot?ver=2.0.3");src:url("https://www.nationalretailsystems.com/wp-content/plugins/social-warfare/fonts/sw-icon-font.eot?ver=2.0.3#iefix") format("embedded-opentype"),url("https://www.nationalretailsystems.com/wp-content/plugins/social-warfare/fonts/sw-icon-font.woff?ver=2.0.3") format("woff"), url("https://www.nationalretailsystems.com/wp-content/plugins/social-warfare/fonts/sw-icon-font.ttf?ver=2.0.3") format("truetype"),url("https://www.nationalretailsystems.com/wp-content/plugins/social-warfare/fonts/sw-icon-font.svg?ver=2.0.3#1445203416") format("svg");font-weight: normal;font-style: normal;}</style>
<!-- Open Graph Meta Tags & Twitter Card generated by Social Warfare v2.0.3 http://warfareplugins.com -->

Author:  laylabadge [ 23. Jul 2016, 17:05 ]
Post subject:  Re: Iframe redirecting user to source page

Thank you! That plugin had an option to disable iframes. Fixed now.

On a separate note - how do I make the url stay on the current site and not direct to the source if the user were to right click and open the iframe in another window?

I don't want the user to know they at looking at content from a different site. I own both sites so can make changes on both.

Thanks again

Author:  laylabadge [ 23. Jul 2016, 17:19 ]
Post subject:  Re: Iframe redirecting user to source page

Sorry one other question.

Is there a setting which forces the iframe source page content to refresh?

I am sourcing a job post page and find that it can take a long time or requires user to clear history for changes or new content to be reflected when viewing the page through the iframe. Any suggestions?

Author:  TinyWebGallery [ 23. Jul 2016, 17:31 ]
Post subject:  Re: Iframe redirecting user to source page

Advanced tab-> Reload interval

Best, Michael

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/