Move most scripts to the background page
Dramatically improve load times for frontend pages. Closes #133
This commit is contained in:
@@ -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));
|
||||
}
|
||||
});
|
||||
}());
|
||||
|
Reference in New Issue
Block a user