You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

22 lines
581 B

"use strict";
//Show a big banner in the top of the page if the company has been
//changed in another tab or window (in the same browser)
var con = [];
var lastCtx = null;
addEventListener("connect", function(ee) {
var port = ee.ports[0];
con.push(port);
port.onmessage = function (e) {
var newCtx = e.data;
if (lastCtx && newCtx !== lastCtx) {
con.forEach(function (eport) {
eport.postMessage({type: "newCtx", "newCtx": newCtx, "lastCtx": lastCtx});
});
}
lastCtx = newCtx;
};
}, false);