While I get your point, headers and footers and menus tend to all live within rectangular boxes.
Headers and footers, yes. Menus generally need to expand when you interact with them, especially on mobile.
Do a drop down list of links on a header in an iframe
Headers and their menus are often problematic for this approach, unless they are 100% static (e.g. HN would work but Reddit and Google wouldn't since they both put things in their header which can expand over the content). I.e. you can make it transparent but that doesn't solve eating the interactions. The code needed to work around that is more than just using JS to do the imports.