Last active
August 29, 2015 14:03
-
-
Save cpsubrian/ab0726e6ad5f6f8fc06f to your computer and use it in GitHub Desktop.
Replicate Atom-Shell Stall/Idle Problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Atom.app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = require('app') | |
, ipc = require('ipc') | |
, BrowserWindow = require('browser-window') | |
, mainWindow; | |
app.on('window-all-closed', function() { | |
if (process.platform != 'darwin') | |
app.quit(); | |
}); | |
app.on('ready', function() { | |
mainWindow = new BrowserWindow({ | |
'width': 500, | |
'height': 500, | |
'use-content-size': true, | |
'resizeable': false, | |
'always-on-top': true | |
}); | |
console.time('done'); | |
function done() { | |
setTimeout(function () { | |
console.timeEnd('done'); | |
}, 50); | |
} | |
mainWindow.loadUrl('file://' + __dirname + '/index.html'); | |
mainWindow.webContents.once('did-finish-load', function () { | |
mainWindow.once('iframe-loaded', function () { | |
done(); | |
}); | |
mainWindow.webContents.send('load', 'file://' + __dirname + '/iframe.html'); | |
}); | |
mainWindow.on('closed', function () { | |
mainWindow = null; | |
}); | |
}); | |
// Uncomment the following line to speed up the app. | |
//setInterval(function(){}, 5); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Hello</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<style type="text/css"> | |
html, body, iframe { | |
width: 100%; | |
height: 100%; | |
margin: 0; | |
padding: 0; | |
position: relative; | |
border: none; | |
} | |
iframe { | |
background: #eee; | |
} | |
</style> | |
</head> | |
<body> | |
<iframe id="frame" scrolling="no" seamless="seamless"></iframe> | |
<script> | |
var ipc = require('ipc') | |
, browser = require('remote').getCurrentWindow() | |
, frame = document.getElementById('frame'); | |
ipc.on('load', function (url) { | |
frame.onload = function () { | |
browser.emit('iframe-loaded'); | |
}; | |
frame.src = url; | |
}); | |
</script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
run: run-osx | |
run-osx: | |
./Atom.app/Contents/MacOS/Atom ./ | |
PHONY: run | |
PHONY: run-osx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "ab0726e6ad5f6f8fc06f", | |
"version": "0.0.0", | |
"main": "app.js" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment