Skip to content

Commit

Permalink
Get nsIContentFrameMessageManager that doesn't crash.
Browse files Browse the repository at this point in the history
  • Loading branch information
arantius committed Nov 4, 2014
1 parent f82a7e8 commit 405480c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions modules/contentObserver.js
Expand Up @@ -177,7 +177,7 @@ ContentObserver.prototype.runScripts = function(aRunWhen, aContentWin) {
}
*/

var response = this.windowMessageManager(aContentWin).sendSyncMessage(
var response = this.contentFrameMessageManager(aContentWin).sendSyncMessage(
'greasemonkey:scripts-for-url', {
'url': url,
'when': aRunWhen,
Expand Down Expand Up @@ -210,10 +210,11 @@ ContentObserver.prototype.windowIsTop = function(aContentWin) {
return true;
};

ContentObserver.prototype.windowMessageManager = function(aContentWin) {
ContentObserver.prototype.contentFrameMessageManager = function(aContentWin) {
return aContentWin.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell)
.QueryInterface(Ci.nsIDocShellTreeItem)
.rootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIContentFrameMessageManager);
};
Expand Down

0 comments on commit 405480c

Please sign in to comment.