0

I tried using chrome.extension.sendMessage in my extension and upset a lot of users who weren't on the same Chrome version as me (v20.0.1132.47). I tried looking at the documentation here - http://code.google.com/chrome/extensions/extension.html#method-sendMessage but there is nothing indicating when this method was introduced.

Compare this to the isAllowedIncognitoAccess method which clearly states "This function was added in version 12.0.706.0. If you require this function, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version."

Does anyone know what the minimum Chrome version is to use this method?

1 Answers1

1

c.e.sendMessage and c.e.onMessage is introduced in Chrome 20. Before the update, c.e.sendRequest and c.e.onRequest had to be used. c.e.sendRequest takes the same arguments as sendMessage, but onRequest is slightly different.

// Chrome 20+
chrome.extension.onMessage.addListener(function(details) {
    var message = details.message;           // Any (string, object, ...)
    var sender = details.sender;             // MessageSender type
    var sendResponse = details.sendResponse; // Function
});
// Chrome 19-
chrome.extension.onRequest.addListener(message, sender, sendResponse) {
    // message, sender and sendResponse defined in the parameters
});
Rob W
  • 341,306
  • 83
  • 791
  • 678