Welcome Guest, Not a member yet? Register   Sign In
sending a message from a CI application to a content script
#7

(This post was last modified: 10-19-2018, 09:43 AM by richb201.)

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
Reply


Messages In This Thread
RE: sending a message from a CI application to a content script - by richb201 - 10-19-2018, 09:19 AM



Theme © iAndrew 2016 - Forum software by © MyBB