Is it possible to run a external web application in iframe?
For example, I have below iframe in my application.
<iframe src="http://www.w3schools.com"></iframe>
It loads the url on load but when I click on any of the link it redirects to that link, leaving the iframe. Instead I want to load that redirected page in that iframe only.
Is it possible? If yes, then how?
Thank you.
To tell you frankly, it is completely dependent on the external website. For the example you provided - w3schools.com, all the hyperlinks have an attribute target="_top" which forces the webpages to open on the parent most window. I guess you really cannot control it.
Add this line in head tag in your webpage.
<base target="_parent" />
Related
I am working on a site for a Client and they want to display the following URL in an iFrame:
https://www.vigrxplus.com/ct/3134
If you access that site directly, it will show the Promo code on the source website.
However, if you access that site via an iFrame, it will not show the Promo code on the source website:
https://jsfiddle.net/qc3zvo0b/
<iframe width="100%" height="1000" src="https://www.vigrxplus.com/ct/3134"></iframe>
(Make sure to test the iFrame without prior Cookies from having previously visited the source website directly.)
Attempting to enable all sandbox features for iFrame did not fix this.
The source site also seems to do some kind of redirect.
So how can this be fixed such that the iFrame behaves just like visiting the site directly?
So I created an HTML GUI for a touchscreen monitor. The browser is supposed to always stay in fullscreen. Now I want to embed another website inside my HTML, which works pretty well.
My only problem now is, that when I click through the embedded webpage, new pages open without my GUI. This is a problem because I added navigation functionality to the GUI and since it always runs in fullscreen I can't use the back and forward buttons either.
So is there a way to make Firefox always open my HTML GUI, when it opens a new page and open the requested page as embedded in my GUI?
You should provide more information about how did you embed other site in your html gui.
The solution is to use <iframe> element, then all the links inside the iframe should be open in that iframe. And if you want any other link from your GUI to be open in that iframe, just add target="name_of_the_iframe" to that element, and a attribute name="name_of_the_iframe" to the iframe (ofcourse "name_of_the_iframe" is an example).
You can try using an iframe
From w3schools: "An iframe is used to display a web page within a web page."
Take a look at this link: https://www.w3schools.com/html/html_iframe.asp
My site is http://inquizgaming.info/
When you click a link here in edge, it gives you a message saying:
"This content can’t be shown in a frame
There is supposed to be some content here, but the publisher doesn’t allow it to be displayed in a frame. This is to help protect the security of any information you might enter into this site.
Try this:
Open this in a new window"
In chrome, the page just stays blank.
This doesn't make a lot of sense to me, as i am not framing (i.e. using ,, or etc.) these links.
The entire body of the code for that first "Join Discord" button is:
<section id="banner">
<div class="inner">
<h2>Inquisitional Gaming</h2>
<p>An open gaming community for all platforms!</p>
<ul class="actions">
<li>Join Our Discord!</li><br>
</ul>
</div>
</section>
And from this, i just can't seem to understand what the issue is. I've been looking all over online. I am new to html, css, and JS. I am a novice at website building, and i am sure the problem is somewhere im not thinking of.
EDIT: When i right-click (or hold on mobile) and open it in a new window, the link works fine. This is EXTREMELY frustrating.
http://68.185.245.9/ is your host IP. With what I'm gathering, you have an index file linking to your IP which in turn shows your page, but it's linking it with a frame and thus breaks the ability for your links to redirect you. Have your service provider reconfigure your DNS so it has an A record pointing towards your host IP.
If you open your site http://inquizgaming.info/ and right-click to inspect the HTML you see the <frameset border="0" rows="*,1">.
If you now click on a link on your site, the discordapp.com server answers with the HTTP-Header 'X-Frame-Options' set to 'sameorigin'. This Header indicates, that the browser is not allowed to render https://discordapp.com/invite/qDf8DG9 in the visiting browser.
You can read the details about the the HTTP-Header here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
As you cannot change the HTTP-Response from discordapp.com' you need to either remove the all the <frameset>, <frame> and <iframe> or you can add a target="_blank" attribute to every link referencing the external link.
If you open the link in a new window, and the link works perfectly fine, then try adding this to your <a> tag...
Join Our Discord!
The target="_blank" attribute tells the browser to open the link in a new window. Also, it's good practice to place out-going links (that contain content not specific to your website) in a new window.
EDIT: As others have said, your website code is placed within several <frame> tags. Some functionalities, such as the <a> tag, will behave differently. Inspecting your website (using developer's tools by pressing Ctrl+Shift+I on Chrome or Firefox) will show the firstmost tags being <frame> containers.
How does one keep all redirects from an iframe within the iframe? Sort of like a browser within the page. I've seen it done many times on translating sites, vpn sites, security sites, etc.
For Clarification: http://bit.ly/1m8EF4e
<-- Google translation of a wikipedia page. Notice how redirects are still within the iFrame of the translator.
<a href="(src)" target="_self"> for opening the link in a same iframe
for new tab change the targer value to _blank
i am working on php site. i want to show the web page content of external site in my site. Is there any solution to show only content of external site web page in my site.
Your solution will be appreciated.
Thanks in advance.
There's no need for jQuery, CSS even PHP if the site isn't preventing itself from being iframed.
iframe simply works like this:
<iframe src="http://google.com" ...></iframe>
If the site is preventing being iframed, you may want to use file_get_contents, then display the data retrieved in a DIV or other non-iframe element.