A couple of problems:
- Just open the window -- the obvious answer is worth the slight inconvenience (of having to lay the cord, or open and leave the window cracked, or etc.), relative to the much greater cost of a device specifically to do this.
- Even a fairly naive solution is possible: say, a relatively large iron-core transformer, which will mostly hold itself together by attractive force, and while it will draw a fair amount of reactive current, it'll still do alright as a transformer. But:
- A naive solution is bulky, very heavy, likely crushes double-glazed windows (or doesn't work at all through them, due to the increased thickness), and only works when both sides are lined up correctly, and if they're misaligned, probably blows a fuse instead. Or if operated without the two halves placed together. An example would be something like, two microwave oven transformer cores facing together, which would be good for a few hundred watts -- much less than the nameplate rating of the microwave for several reasons, most importantly the effect of the separation distance.
- A technological solution exists, and indeed works down to fairly low power levels (some watts, as in phone chargers), but doesn't scale well, and especially isn't going to be affordable. A rough rule of thumb for power electronics is to figure $1/W of capacity; an extension cord might be rated for 1500 W so expect an isolator like this to cost over a thousand bucks. That's only a ballpark figure of course, and could range from tens of thousands (for a one-off, significant engineering effort required), to a few hundred (if produced in the millions). Is anyone really going to buy such a thing, when an extension cord will do almost all the time?
To be clear, there are niche applications for such technology -- even back in the 2000s, wireless (or at least, contactless) EV charging was a thing. Granted, EVs themselves were largely speculative in those days, but Magne Charge was in use. There are numerous modern proposals of course, ranging from in-road coils (laughable, at least for quite a while) to chargers that basically connect physically (like the Magne) but with looser tolerances so a vehicle can simply be parked up against it. (One in particular I've seen, uses resonant power transfer mechanisms (which allows more distance and misalignment), targeting industrial application -- recharging fork lifts for example.)
So, in summary -- entirely possible, unfortunately just not economically feasible. Or, if you can convince enough people they need it -- but that's an entirely different matter...