Open Chrome's javascript console in the developer tools for your app by right clicking and selecting Inspect Element, then clicking on 'console' in the top list of tabs. You will see:
Refused to execute JavaScript URL because it violates the following
Content Security Policy directive: "default-src 'self'
chrome-extension-resource:". Note that 'script-src' was not explicitly
set, so 'default-src' is used as a fallback.
In a packaged app, due to the stricter Content Security Policy, you are not able to use javascript in an HTML file. You must create your HTML and then from a javascript file find the element and register an onclick handler.
For an example, see the Window State sample packaged app, look at window.html and window.js.
window.close()
will work from a javascript file. Though, you should be aware of the packaged app specific app window api and see the other options there, such as chrome.app.window.current().fullscreen()
.