CodeIgniter Forums

Full Version: running chrome.runtime.sendMessage
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Huh I have a need to run some javascript from my CI app. This is what I need to run:
// 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)
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? 
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.
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.