Yes, Insite, that is what I am following.
Sending messages from web pages
Similar to cross-extension messaging, your app or extension can receive and respond to messages from regular web pages.
a few lines down they have this example:
// 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);
});
I thought maybe I could wrap this in javascript and drop it into the init function in my Controller:
PHP Code:
private function _init()
{
$this->output->set_template('default2');
$this->load->js('assets/themes/default/js/jquery-1.9.1.min.js');
$this->load->js('assets/themes/default/hero_files/bootstrap-transition.js');
$this->load->js('assets/themes/default/hero_files/bootstrap-collapse.js');
$this->load->js('js/jquery.orgchart.js'); // for charts
echo '<script type="text/javascript">'
var editorExtensionId = "abcdefghijklmnoabcdefhijklmnoabc";
// Make a simple request:
chrome.runtime.sendMessage(editorExtensionId, {openUrlInEditor: url},
function(response) {
if (!response.success)
handleError(url);
};
'</script>'
}
But that 2nd line with the var is causing a parsing error. Am I going down the right path here? I assumed that I need to run javascript, but I guess I need to have it appear the rendered html, right? How do I do that?
proof that an old dog can learn new tricks