Move most scripts to the background page
Dramatically improve load times for frontend pages. Closes #133
This commit is contained in:
parent
5405b062d2
commit
08ccdf8d97
5 changed files with 215 additions and 292 deletions
|
@ -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));
|
||||
}
|
||||
});
|
||||
}());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue