Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do frames and iframes have isolated javascript contexts?

I've made some experiments in Chrome but I'm not sure so I need a confirmation :

Am I correct in thinking that iframes and frames have a separate JavaScript context, making them impossible to share variables between those frames/iframes?

To simplify, let's assume that the client will always be the same version of Chrome (it's my case)

like image 729
Klaim Avatar asked Nov 21 '11 16:11

Klaim


People also ask

Is iframe isolated?

In the world of web development, iframes are a secure method of embedding content from other sites onto your own page. They are simply isolated containers on a web page that are managed completely independently by another host, usually a third party.

Are iFrames considered bad practice?

Iframes Bring Security Risks. If you create an iframe, your site becomes vulnerable to cross-site attacks. You may get a submittable malicious web form, phishing your users' personal data. A malicious user can run a plug-in.

Are iFrames still used 2021?

<iframe> is not an obsolete or deprecated tag. It's still widelly used in the web, mostly for media purposes.

Are iFrames still relevant?

iFrames are an HTML tag and have been around for absolutely ages having been introduced back in 1997. Despite their age, they are still commonly used and are supported by all modern browsers.


1 Answers

Yes.

However, you can use the frames collection or the parent to access other frames (assuming they're from the same domain).

like image 163
SLaks Avatar answered Nov 05 '22 05:11

SLaks