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.
24 lines
626 B
24 lines
626 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) { //addEventListener doesnt seams to work well
|
|
var newCtx = e.data;
|
|
|
|
if (lastCtx && newCtx != lastCtx) {
|
|
con.map(function (eport) {
|
|
eport.postMessage({ type: "newCtx", "newCtx": newCtx, "lastCtx": lastCtx});
|
|
});
|
|
}
|
|
lastCtx = newCtx;
|
|
};
|
|
|
|
}, false);
|