Allow returning string in custom protocols.
This commit is contained in:
parent
8464fb4f64
commit
912bac698c
3 changed files with 113 additions and 20 deletions
13
spec/main.js
13
spec/main.js
|
@ -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',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue