Skip to content

Commit

Permalink
Merge branch 'engstrom-master' into development. This closes PR #151
Browse files Browse the repository at this point in the history
…and bug #145.
  • Loading branch information
adam-p committed Jan 12, 2014
2 parents 0aaff78 + 97e0dc5 commit f3512c7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/chrome/backgroundscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ chrome.contextMenus.create({

// Handle rendering requests from the content script.
// See the comment in markdown-render.js for why we do this.
chrome.runtime.onMessage.addListener(function(request, sender, responseCallback) {
chrome.extension.onMessage.addListener(function(request, sender, responseCallback) {
// The content script can load in a not-real tab (like the search box), which
// has an invalid `sender.tab` value. We should just ignore these pages.
if (typeof(sender.tab) === 'undefined' ||
Expand Down
2 changes: 1 addition & 1 deletion src/chrome/contentscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function requestHandler(request, sender, sendResponse) {
return false;
}
}
chrome.runtime.onMessage.addListener(requestHandler);
chrome.extension.onMessage.addListener(requestHandler);


// The rendering service provided to the content script.
Expand Down
6 changes: 3 additions & 3 deletions src/common/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,12 +369,12 @@ var PRIVILEGED_REQUEST_EVENT_NAME = 'markdown-here-request-event';
function makeRequestToPrivilegedScript(doc, requestObj, callback) {
if (typeof(chrome) !== 'undefined') {
// If `callback` is undefined and we pass it anyway, Chrome complains with this:
// Uncaught Error: Invocation of form runtime.sendMessage(object, undefined, null) doesn't match definition runtime.sendMessage(optional string extensionId, any message, optional function responseCallback)
// Uncaught Error: Invocation of form extension.sendMessage(object, undefined, null) doesn't match definition extension.sendMessage(optional string extensionId, any message, optional function responseCallback)
if (callback) {
chrome.runtime.sendMessage(requestObj, callback);
chrome.extension.sendMessage(requestObj, callback);
}
else {
chrome.runtime.sendMessage(requestObj);
chrome.extension.sendMessage(requestObj);
}
}
else if (typeof(safari) !== 'undefined') {
Expand Down

0 comments on commit f3512c7

Please sign in to comment.