Hi Everyone, So we have a website which create short url's and on the actual tiny url it creates, it's 2 frames (top frame contains the actual website the short url is referring to and bottom frame, it's ads). <frameset cols="100%" frameborder="0"> <frameset rows="*, <?php echo SITE_CONFIG_TOP_IFRAME_HEIGHT; ?>"> <frame src="<?php echo $shortUrlObj->fullUrl; ?>" noresize> <frame src="framedRedirectTop.php?url=<?php echo $shortUrlObj->shortUrlUID; ?>" class="framedRedirectTopFrame" noresize> </frameset> <noframes> <?php echo t("browser_no_frame_support"); ?> </noframes> </frameset> Code (markup): Now the problem is that when the <frame src="<?php echo $shortUrlObj->fullUrl; ?>" noresize> opens the actual website, some of them have this code implemented: <script type="text/javascript"> <!--// if(window.location != top.location) { top.location = window.location; } --> </script> Code (markup): So basically it redirects the whole page to the website removing the bottom frame with the ads. We need a way to make both stick and to disable that Javascript Bust. After extensive research, we have implemented this: <script type="text/javascript"> var prevent_bust = 0; // Event handler to catch execution of the busting script. window.onbeforeunload = function() { prevent_bust++ }; // Continuously monitor whether busting script has fired. setInterval(function() { if (prevent_bust > 0) { // Yes: it has fired. prevent_bust -= 2; // Avoid further action. // Get a 'No Content' status which keeps us on the same page. window.top.location = 'SHORT URL WEBSITE'; } }, 1); </script> Code (markup): The best it does is redirect to our home page. But then of course, that is not viable as the content the user is searching is not there. The problem here is that what needs to be shown on top is obviously the tiny url website with /XXX (which refers to the actual url id). So if we redirect to it, it goes into a constant loop. We are maybe thinking that the solution is maybe to PARSE or GRAB the source of the website in question using PHP and adding code to remove such javascript before shooting it in the frame (kind of like out first frame which refers to an external page). Is that a viable solution? or has anything worked on something similar and found a solution? Any help is much appreciated.
I think the parsing solution is the one that will work and is essentially what proxy sites do... only they manipulate all the links and image calls too. The big issue is that the javascript won't be on the page (or shouldn't be) but in a separate file that gets called so you need to identify which scripts get called and parse them too.