Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions manual/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,7 @@ <h1><a href="https://threejs.org">three.js</a></h1>

}

autoDefaultLinkAttribute(iframe);
document.body.replaceChild( iframe, oldIframe );

}
Expand Down Expand Up @@ -559,6 +560,28 @@ <h1><a href="https://threejs.org">three.js</a></h1>

}

function autoDefaultLinkAttribute( iframe ) {

// To set default attribute _blank to prevent link open inside the iFrame viewer

iframe.addEventListener( 'load', function () {

const links = iframe.contentDocument.querySelectorAll( 'a' );

links.forEach( function ( link ) {

if ( link.target !== undefined && link.target.trim() === "" ) {

link.setAttribute( 'target', '_blank' );

}

} );

} );

}

//

console.log( [
Expand Down
Loading