Allow returning string in custom protocols.

This commit is contained in:
Cheng Zhao 2013-08-25 12:36:06 +08:00
parent 8464fb4f64
commit 912bac698c
3 changed files with 113 additions and 20 deletions

View file

@ -22,6 +22,10 @@ ipc.on('process.exit', function(pid, rid, code) {
process.exit(code);
});
ipc.on('eval', function(ev, pid, rid, script) {
ev.result = eval(script);
});
process.on('uncaughtException', function() {
window.openDevTools();
});
@ -30,6 +34,15 @@ app.on('window-all-closed', function() {
app.terminate();
});
app.on('will-finish-launching', function() {
// Reigster some protocols, used by the protocol spec.
// FIXME(zcbenz): move this to somewhere else.
var protocol = require('protocol');
protocol.registerProtocol('atom-string', function(url) {
return url;
});
});
app.on('finish-launching', function() {
window = new BrowserWindow({
title: 'atom-shell tests',