• Aloso
    link
    fedilink
    1311 months 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.

    • @emidio
      cake
      link
      411 months ago

      Are iframes really sandboxed in different processes than the main frame? On which browsers?

      • Aloso
        link
        fedilink
        12
        edit-2
        11 months ago

        Iframes cannot access the main frame’s DOM if the iframe is from a different origin than the main frame, and they never share the same JavaScript execution context, so an iframe can’t access the main frame’s variables etc.

        It’s not required that iframes run in a different process, but I think they do at least in Chrome and Firefox if they’re from a different origin. Also, iframes with the sandbox attribute have a number of additional restrictions, which can be individually disabled when needed.