aboutsummaryrefslogtreecommitdiffstats
path: root/platform/firefox/frameModule.js
diff options
context:
space:
mode:
authorDeathamns <deathamns@gmail.com>2015-01-16 11:42:34 +0100
committerDeathamns <deathamns@gmail.com>2015-01-16 11:42:34 +0100
commit48134d94695b833083405927318413dc261f5aab (patch)
tree6c9675f31e80e5a7b88eee2175c88516b99a6174 /platform/firefox/frameModule.js
parentf6e996c25a5a9cb293bf38158efb5544f0a9ac3d (diff)
downloaduBlock-48134d94695b833083405927318413dc261f5aab.zip
uBlock-48134d94695b833083405927318413dc261f5aab.tar.gz
uBlock-48134d94695b833083405927318413dc261f5aab.tar.bz2
Firefox: minimal effort to support older versions
Diffstat (limited to 'platform/firefox/frameModule.js')
-rw-r--r--platform/firefox/frameModule.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/platform/firefox/frameModule.js b/platform/firefox/frameModule.js
index ad24e49..8288fcf 100644
--- a/platform/firefox/frameModule.js
+++ b/platform/firefox/frameModule.js
@@ -153,13 +153,24 @@ const contentObserver = {
// so check context.top instead of context
if ( context.top && context.location ) {
// https://bugzil.la/1092216
- getMessageManager(context).sendRpcMessage(this.cpMessageName, {
+ let messageManager = getMessageManager(context);
+ let details = {
openerURL: openerURL || null,
url: location.spec,
type: type,
frameId: type === this.MAIN_FRAME ? -1 : (context === context.top ? 0 : 1),
parentFrameId: context === context.top ? -1 : 0
- });
+ };
+
+ // TODO: frameId from outerWindowID?
+ // https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMWindowUtils
+
+ if ( typeof messageManager.sendRpcMessage === 'function' ) {
+ messageManager.sendRpcMessage(this.cpMessageName, details);
+ } else {
+ // Compatibility for older versions
+ messageManager.sendSyncMessage(this.cpMessageName, details);
+ }
}
return this.ACCEPT;