How to get the url of the iframe?


Lundro

How to get an iframe that loads a page in another website (CORS) ?URL

iFrameObject.contentWindow.location.href 

return the goodsCORS Error

renew:

The user will navigate inside the iframe and get another url which I don't know. This is what I'm checking, if the user visits the url, the iframe closes itself.

Related question: How to get data from an external site inside a Cordova app? (I am trying to get the information in the parameters of the url)

Mark Bonelli

You can simply get its srcproperties:

var URL = iFrameObject.src;
// something like "http://example.com"

Update: Since the frame's URL will change and become different from the srcproperty, you won't be able to access it without violating the cross-origin policy. You can't do anything in iframeother sources .

Related


How to get current page loaded url from iframe

User 4082518 I'm using an iframe to load faroo.com as the default src in the frame when I search and move to other webpages that use Faroo. But still in the iframe src its showing faroo.com is just the url i want to capture the page that is loaded in the ifram

How to refresh iframe url?

test user I'm using ionic to create an app where iframes are being used to display URLs. Here is the HTML code: <iframe id="myFrame" width="100%" height={{iframeHeight}}> Here is the angular js: $scope.iframeHeight = window.innerHeight;

How to get the url of the iframe?

Lundro How to get an iframe that loads a page in another website (CORS) ?URL iFrameObject.contentWindow.location.href return the goodsCORS Error renew: The user will navigate inside the iframe and get another url which I don't know. This is what I'm checking

How to get src/url from <iframe> using Java

AMU String str = " <iframe width=\"640\" height=\"360\" src=\"https://www.youtube.com/embed/UMUeWqnwmjs\" frameborder=\"0\" allowfullscreen></iframe>"; How to get Src from this tag? KrzysztofKrasoń In this simple case you can use regexp (which should not nor

Get current URL from IFRAME

Chris: Is there an easy way to get the current url from an iframe? Viewers will browse multiple sites. I'm guessing I'll use something in javascript. kkyy : For security reasons, you can only get that url as long as the content of the iframe and the referencin

How to get the url of an iframe video element using PHP

Esael Developer good afternoon friends, I'm trying to be able to get the video from the url of the iframe, what I'm seeing is that I have to click the video first so that the video element is visible in the html. Is there no way to automate the process? Automa

How to get current page loaded url from iframe

User 4082518 I'm using an iframe to load faroo.com as the default src in the frame when I search and move to other webpages that use Faroo. But still in the iframe src its showing faroo.com is just the url i want to capture the page that is loaded in the ifram

How to refresh iframe url?

test user I'm using ionic to create an app where iframes are being used to display URLs. Here is the HTML code: <iframe id="myFrame" width="100%" height={{iframeHeight}}> Here is the angular js: $scope.iframeHeight = window.innerHeight;

How to get src/url from <iframe> using Java

AMU String str = " <iframe width=\"640\" height=\"360\" src=\"https://www.youtube.com/embed/UMUeWqnwmjs\" frameborder=\"0\" allowfullscreen></iframe>"; How to get Src from this tag? KrzysztofKrasoń In this simple case you can use regexp (which should not nor

How to get src/url from <iframe> using Java

AMU String str = " <iframe width=\"640\" height=\"360\" src=\"https://www.youtube.com/embed/UMUeWqnwmjs\" frameborder=\"0\" allowfullscreen></iframe>"; How to get Src from this tag? KrzysztofKrasoń In this simple case you can use regexp (which should not nor

How to get the url of an iframe video element using PHP

Esael Developer good afternoon friends, I'm trying to be able to get the video from the url of the iframe, what I'm seeing is that I have to click the video first so that the video element is visible in the html. Is there no way to automate the process? Automa

How to get parent window url from iframe?

username I know this is a security issue. But is there any way in HTML5. Cause I see the following code which opens a window with the parent URL displayed in the "tweet" box. <iframe src="https://platform.twitter.com/widgets/tweet_button.html" style="b

How to get parent window url from iframe?

username I know this is a security issue. But is there any way in HTML5. Cause I see the code below opens a window with "URL" entered in the "tweet" box <iframe src="https://platform.twitter.com/widgets/tweet_button.html" style="border: 0; width:130px;

Get current URL from IFRAME

Chris: Is there an easy way to get the current url from an iframe? Viewers will browse multiple sites. I'm guessing I'll use something in javascript. kkyy : For security reasons, you can only get that url as long as the content of the iframe and the referencin

How to get the url of an iframe video element using PHP

Esael Developer good afternoon friends, I'm trying to be able to get the video from the url of the iframe, what I'm seeing is that I have to click the video first so that the video element is visible in the html. Is there no way to automate the process? Automa

How to get the url of an iframe video element using PHP

Esael Developer good afternoon friends, I'm trying to be able to get the video from the url of the iframe, what I'm seeing is that I have to click the video first so that the video element is visible in the html. Is there no way to automate the process? Automa

How to get current page loaded url from iframe

User 4082518 I'm using an iframe to load faroo.com as the default src in the frame when I search and move to other webpages that use Faroo. But still in the iframe src its showing faroo.com is just the url i want to capture the page that is loaded in the ifram

How to refresh iframe url?

test user I'm using ionic to create an app where iframes are being used to display URLs. Here is the HTML code: <iframe id="myFrame" width="100%" height={{iframeHeight}}> Here is the angular js: $scope.iframeHeight = window.innerHeight;

How to get src/url from <iframe> using Java

AMU String str = " <iframe width=\"640\" height=\"360\" src=\"https://www.youtube.com/embed/UMUeWqnwmjs\" frameborder=\"0\" allowfullscreen></iframe>"; How to get Src from this tag? KrzysztofKrasoń In this simple case you can use regexp (which should not nor

How to get src/url from <iframe> using Java

AMU String str = " <iframe width=\"640\" height=\"360\" src=\"https://www.youtube.com/embed/UMUeWqnwmjs\" frameborder=\"0\" allowfullscreen></iframe>"; How to get Src from this tag? KrzysztofKrasoń In this simple case you can use regexp (which should not nor

How to get the url of an iframe video element using PHP

Esael Developer good afternoon friends, I'm trying to be able to get the video from the url of the iframe, what I'm seeing is that I have to click the video first so that the video element is visible in the html. Is there no way to automate the process? Automa

How to get the url of an iframe video element using PHP

Esael Developer good afternoon friends, I'm trying to be able to get the video from the url of the iframe, what I'm seeing is that I have to click the video first so that the video element is visible in the html. Is there no way to automate the process? Automa

How to get the url of an iframe video element using PHP

Esael Developer good afternoon friends, I'm trying to be able to get the video from the url of the iframe, what I'm seeing is that I have to click the video first so that the video element is visible in the html. Is there no way to automate the process? Automa

How to get parent window url from iframe?

username I know this is a security issue. But is there any way in HTML5. Cause I see the code below opens a window with "URL" entered in the "tweet" box <iframe src="https://platform.twitter.com/widgets/tweet_button.html" style="border: 0; width:130px;

How to get url of current page from iframe and display on browser

Karage Kinki I have two domains. One for selling products https://sellproducts.com and the other for selling product documentation https://docs.product.wiki In https://sellproducts.com I have a page called docs ( https://sellproducts.com/docs ) which I use ifr