• Aloso@programming.dev
    link
    fedilink
    arrow-up
    13
    ·
    2 years ago

    They still have their place; for example to embed Google Maps or a YouTube video. Generally, whenever you want to embed something from a different website you have no control over, that shouldn’t inherit your style sheets, and should be sandboxed to prevent cross site scripting attacks.

      • Aloso@programming.dev
        link
        fedilink
        arrow-up
        12
        ·
        edit-2
        2 years ago

        Iframes may not necessarily run in a different process (although they do at least in Chrome and Firefox, if the iframe is from a different host than the main frame), but they have a different JavaScript execution context, and the iframe has no access to the main frame’s DOM or global variables. Also, iframes have a number of restrictions, which can be individually disabled with the sandbox attribute.