Don't forget to add "system.display" permission as noted at the beginning of the documentation page.
As for a `window` object, it cannot be transferred neither in web messaging nor in the extension-specific API, which currently supports only the primitive types compatible with JSON: string, number, boolean, null, and arrays/objects of these types. To see what will be transferred use JSON.stringify(obj). The window object is not jsonifiable. The window.screen object returns `{}` because it's the way the specification declares its properties. You can transfer individual properties of `screen` e.g. in an array like func: ()=>[screen.availWidth, screen.availHeight]