How to block popunders from embedded tube videos?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jimstones22
    Confirmed User
    • May 2017
    • 67

    #1

    How to block popunders from embedded tube videos?

    Is there any way to embed videos from tube sites without getting intrusive popunders for your visitors to deal with when they click on a video. Anyone know of a way to block their popunders for site visitors by editing the embed code?

    Are there any tube sites with no popunders anyone can recommend?
    Last edited by jimstones22; 06-28-2017, 11:43 AM. Reason: embedded, video, code, tube, popunder, block
  • tomash999
    Confirmed User
    • Sep 2015
    • 88

    #2
    You can try something like this:
    1. Change the iframe to point to your server. If you load it via Javascript then do the next steps on the client side.
    2. On your server add an endpoint for iframe. This URL will load the original iframe and inject Javascript.
    3. In the injected code (for the iframe only), override the `window.open` function
    Code:
    window.open = function(strUrl, strWindowName, [strWindowFeatures]){
      // your custom code
    }
    
    // or just ignore all the popups in the iframe
    window.open = null

    Comment

    Working...