From 4889e6dbbd2e13e778e7a244e7834ffc881e7a80 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Mon, 17 Feb 2020 16:19:05 +0100 Subject: Issue #1446 - Only match extension add-on types for target applications. This resolves #1446 --- toolkit/mozapps/extensions/internal/XPIProvider.jsm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'toolkit') diff --git a/toolkit/mozapps/extensions/internal/XPIProvider.jsm b/toolkit/mozapps/extensions/internal/XPIProvider.jsm index 2f298a934..d12e1de59 100644 --- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm +++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm @@ -6528,12 +6528,15 @@ AddonInternal.prototype = { app = targetApp; } #ifdef MOZ_PHOENIX_EXTENSIONS - //Special case: check for Firefox TargetApps. this has to be done AFTER - //the initial check to make sure appinfo.ID is preferred, even if - //Firefox is listed before it in the install manifest. - for (let targetApp of this.targetApplications) { - if (targetApp.id == FIREFOX_ID) //Firefox GUID - return targetApp; + // Special case: check for Firefox TargetApps. this has to be done AFTER + // the initial check to make sure appinfo.ID is preferred, even if + // Firefox is listed before it in the install manifest. + // Only do this for extensions. Other types should not be allowed. + if (this.type == "extension") { + for (let targetApp of this.targetApplications) { + if (targetApp.id == FIREFOX_ID) //Firefox GUID + return targetApp; + } } #endif // Return toolkit ID if toolkit. -- cgit v1.2.3