OS.js is an open-source desktop implementation for your browser with a fully-fledged window manager, Application APIs, GUI toolkits and filesystem abstraction.
This is the Example Iframe Package for OS.js v3 that includes bi-directional communication.