devopera
devopera copied to clipboard
Message passing to extensions from webpages
The docs on Dev.Opera says:
From the web page, use the runtime.sendMessage or runtime.connect APIs to send a message to a specific app or extension. For example:
// The ID of the extension we want to talk to var editorExtensionId = '<sample extension id>'; // Make a simple request chrome.runtime.sendMessage(editorExtensionId, { openUrlInEditor: url }, function(response) { if (!response.success) { handleError(url); } } );
But in Opera chrome.runtime is actually undefined so the method provided by the doc is not working. I don't know if the doc here is still correct.
F.Y.I. I'm using Opera v35.0.2066.37 on OS X.