1
1

app.js 721 B

12345678910111213141516171819202122232425262728293031323334
  1. var app = module.exports = require('appjs');
  2. app.serveFilesFrom(__dirname + '/content');
  3. var window = app.createWindow(
  4. {
  5. width : 1280,
  6. height : 720,
  7. icons : __dirname + '/content/icons'
  8. });
  9. window.on('create', function()
  10. {
  11. window.frame.show();
  12. window.frame.center();
  13. });
  14. window.on('ready', function()
  15. {
  16. window.require = require;
  17. window.process = process;
  18. window.module = module;
  19. function F12(e) { return e.keyIdentifier === 'F12' }
  20. function Command_Option_J(e) { return e.keyCode === 74 && e.metaKey && e.altKey }
  21. window.addEventListener('keydown', function(e)
  22. {
  23. if (F12(e) || Command_Option_J(e))
  24. window.frame.openDevTools();
  25. });
  26. window.dispatchEvent(new window.Event('app-ready'));
  27. });