Bug 1287007 - Enable proxying of most APIs.
MozReview-Commit-ID: KrI42XrsVVG
--- a/toolkit/components/extensions/ExtensionChild.jsm
+++ b/toolkit/components/extensions/ExtensionChild.jsm
@@ -107,21 +107,24 @@ class WannabeChildAPIManager extends Chi
proxyContext.setContentWindow(this.context.contentWindow);
// Synchronously unload the ProxyContext because we synchronously create it.
this.context.callOnClose({close: proxyContext.unload.bind(proxyContext)});
}
getFallbackImplementation(namespace, name) {
// This is gross and should be removed ASAP.
- let shouldSynchronouslyUseParentAPI = true;
- // The test API is known to be fully compatible with webext-oop,
- // except for events due to bugzil.la/1300234
- if (namespace == "test" && name != "onMessage") {
- shouldSynchronouslyUseParentAPI = false;
+ let shouldSynchronouslyUseParentAPI = false;
+ // Incompatible APIs are listed here.
+ if (namespace == "runtime" && name == "connectNative" || // Returns a custom Port.
+ namespace == "runtime" && name == "sendNativeMessage" || // Fix together with connectNative.
+ namespace == "tabs" && name == "onRemoved" || // bugzil.la/1300234
+ namespace == "webNavigation" || // ChildAPIManager is oblivious to filters.
+ namespace == "webRequest") { // Incompatible by design (synchronous).
+ shouldSynchronouslyUseParentAPI = true;
}
if (shouldSynchronouslyUseParentAPI) {
let proxyContext = ParentAPIManager.proxyContexts.get(this.id);
let apiObj = findPathInObject(proxyContext.apiObj, namespace, false);
if (apiObj && name in apiObj) {
return new LocalAPIImplementation(apiObj, name, this.context);
}
// If we got here, then it means that the JSON schema claimed that the API