OK. By using the above logic I was able to get messages from the browser tab out to my content script. One small problem! Any ideas?
This is the line that gets executed when a user wants to logoff.
<li><a href="javascript:LogoffSu();"<?php echo site_url('Users/logout')?>'>Logout</a></li>
I modified it so that I run the javascript LogoffSu() first and that sends the event. But now, Users/logout is not running. Here is the LogoffSu()
var LogoffSu = function() {
var event = document.createEvent('Event');
event.initEvent('LogoffSu');
document.dispatchEvent(event);
return;
}
Also, if the user closes the tab, I want to run that same LogoffSu(). Is that possible? I added this but it doesn't seem to work:
<body onload="LoginSu();" onunload="LogoffSu();">
Rich
proof that an old dog can learn new tricks