diff --git a/patches/gecko-support-native-manifests.patch b/patches/gecko-support-native-manifests.patch index c88b99b2..947aa5f3 100644 --- a/patches/gecko-support-native-manifests.patch +++ b/patches/gecko-support-native-manifests.patch @@ -8,28 +8,35 @@ Adds support for native manifests to GeckoView. Signed-off-by: celenity --- diff --git a/toolkit/components/extensions/NativeManifests.sys.mjs b/toolkit/components/extensions/NativeManifests.sys.mjs -index 5c9cee1b700d3..04d1eaa59d8f3 100644 +index 48d7d50cdec3..77c5edb84d15 100644 --- a/toolkit/components/extensions/NativeManifests.sys.mjs +++ b/toolkit/components/extensions/NativeManifests.sys.mjs -@@ -35,7 +35,7 @@ export var NativeManifests = { - let platform = AppConstants.platform; +@@ -30,7 +30,7 @@ export var NativeManifests = { + + init() { + if (!this._initializePromise) { +- let platform = AppConstants.platform; ++/* let platform = AppConstants.platform; if (platform == "win") { this._lookup = this._winLookup; -- } else if (platform == "macosx" || platform == "linux") { -+ } else if (platform == "macosx" || platform == "linux" || platform == "android") { - let dirs = [ - Services.dirsvc.get("XREUserNativeManifests", Ci.nsIFile).path, - Services.dirsvc.get("XRESysNativeManifests", Ci.nsIFile).path, -@@ -182,6 +182,11 @@ export var NativeManifests = { - }, - - async _tryPaths(type, name, dirs, context) { + } else if (platform == "macosx" || platform == "linux") { +@@ -44,7 +44,7 @@ export var NativeManifests = { + throw new Error( + `Native manifests are not supported on ${AppConstants.platform}` + ); +- } ++ } */ + this._initializePromise = lazy.Schemas.load(NATIVE_MANIFEST_SCHEMA); + } + return this._initializePromise; +@@ -202,6 +202,9 @@ export var NativeManifests = { + * no valid manifest can be found for this type and name. + */ + lookupManifest(type, name, context) { + if (AppConstants.platform == "android" && type !== "storage" && name !== "uBlock0@raymondhill.net") { -+ throw new Error( -+ `Native manifests are not supported on ${AppConstants.platform}` -+ ); ++ throw new Error(`Native manifests are not supported on ${AppConstants.platform}`); + } - for (let dir of dirs) { - let path = PathUtils.join(dir, TYPES[type], `${name}.json`); - let manifest = await this._tryPath(type, path, name, context, false); + return this.init().then(() => this._lookup(type, name, context)); + }, + }; --