CodeIgniter Forums
running chrome.runtime.sendMessage - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: running chrome.runtime.sendMessage (/showthread.php?tid=72657)



running chrome.runtime.sendMessage - richb201 - 01-19-2019

Huh I have a need to run some javascript from my CI app. This is what I need to run:
Code:
// The ID of the extension we want to talk to.
var editorExtensionId = "abcdefghijklmnoabcdefhijklmnoabc";

// Make a simple request:
chrome.runtime.sendMessage(editorExtensionId, {openUrlInEditor: url},
 function(response) {
   if (!response.success)
     handleError(url);
 });
This is basically what I need to send a message from my CI app to my Chrome Extension and came from the Chrome developers forum. I know the Id of my extension. I am not sure what is meant by : {openUrlInEditor: url}, but I assume that is the message I want to send? In my case I probably will send a "jsonized" buffer. 

But how do I get the above code to run when a Grocery crud callback is triggered? 


RE: running chrome.runtime.sendMessage - ciadmin - 01-19-2019

CodeIgniter runs server-side, and what you are describing is client-side, and sounds like something that would be added to your Grocery crud JS callback handling.


RE: running chrome.runtime.sendMessage - richb201 - 01-19-2019

I was aware that it is client side. I figured there must be some way to get the javascript embedded into the html page that CI/GC is creating and associating that with the button that I created in GC.