fix: clean-up gecko-support-native-manifests.patch

This should improve performance by skipping the unnecessary check for a file path that doesn't exist

Signed-off-by: celenity <celenity@celenity.dev>
This commit is contained in:
celenity
2026-07-06 03:16:31 +00:00
parent e1485f1bd8
commit ca836ea47d

View File

@@ -8,28 +8,35 @@ Adds support for native manifests to GeckoView.
Signed-off-by: celenity <celenity@celenity.dev>
---
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));
},
};
--