Prevent duplicate conversations and refocus on click (still buggy)
This commit is contained in:
parent
7ec27f814f
commit
783a3f7c15
7 changed files with 116 additions and 21 deletions
|
@ -26,12 +26,9 @@
|
|||
});
|
||||
};
|
||||
|
||||
var windowId, windowMap = {};
|
||||
|
||||
extension.trigger('log', 'loaded page');
|
||||
var windowId, windowMap = JSON.parse(localStorage.getItem('idPairs'));
|
||||
|
||||
window.addEventListener('storage', function (e) {
|
||||
extension.trigger('log', 'got storage event');
|
||||
if (e.key = 'idPairs') {
|
||||
windowMap = JSON.parse(e.newValue);
|
||||
|
||||
|
@ -48,12 +45,13 @@
|
|||
chrome.windows.getCurrent(function (windowInfo) {
|
||||
window.document.title = windowId = windowInfo.id;
|
||||
|
||||
extension.trigger('log', 'got page id');
|
||||
|
||||
var conversationId = windowMap[windowId];
|
||||
|
||||
if (typeof conversationId !== 'undefined') {
|
||||
loadConversation(conversationId);
|
||||
}
|
||||
});
|
||||
|
||||
// lets background.js know when a panel disconnects
|
||||
var port = chrome.runtime.connect({name: "panel_presence"});
|
||||
}());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue