Move most scripts to the background page

Dramatically improve load times for frontend pages.

Closes #133
This commit is contained in:
lilia 2015-03-15 16:04:39 -07:00
parent 5405b062d2
commit 08ccdf8d97
5 changed files with 215 additions and 292 deletions

View file

@ -21,14 +21,15 @@
extension.windows.getCurrent(function (windowInfo) {
var bg = extension.windows.getBackground();
window.$ = bg.$;
var conversation = bg.getConversationForWindow(windowInfo.id);
if (conversation) {
window.document.title = conversation.getTitle();
new Whisper.ConversationView({
new bg.Whisper.ConversationView({
model: conversation
}).$el.prependTo($('body'));
}).$el.prependTo($('body', document));
} else {
$('<div>').text('Error').prependTo($('body'));
$('<div>').text('Error').prependTo($('body', document));
}
});
}());