Actually link window.document instead of document. Fixes problems in node-webkit