# Embed website + allow open link in a new tab ![iframe embed](https://ipfs.near.social/ipfs/bafkreihrmur7dhenzcdjxbrv2dc6blp4rlxv3464taanjkf4vdtqibne2a) ### Step1: Embed the js script to the site This allow the website can post message to #NEAR #BOS so the link can be opened externally. ``` <script> window.addEventListener("message", function(event) { var links = document.querySelectorAll("a"); for( var i = 0; i < links.length ; i++ ){ links[i].addEventListener("click" , function(e){ if(event.data.iframeDisableLink){ e.preventDefault(); } //post url to the parent window (#BOS in this case) window.parent.postMessage({ url: this.href }, "*"); }); } }); </script> ``` Learn more about how it works here: https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage ### Step2: Using the Widget replace `YOUR_URL_HERE` with the actual website ``` <Widget src="cuongdcdev.near/widget/IframeEmbedExternal" props={{ src: "YOUR_URL_HERE", }} ></Widget> ```