From af903283f05e628ca2e25dfb8e2745baee945b7f Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 22 Sep 2022 12:54:07 +1000 Subject: clean up external license checking a bit --- main_background.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'main_background.js') diff --git a/main_background.js b/main_background.js index 4f164f4..c9ed6f2 100644 --- a/main_background.js +++ b/main_background.js @@ -858,7 +858,10 @@ var ResponseHandler = { const scriptInfo = await ExternalLicenses.check({ url: fullUrl, tabId, frameId, documentUrl }); if (scriptInfo) { const [verdict, ret] = scriptInfo.free ? ['accepted', ResponseProcessor.ACCEPT] : ['blocked', ResponseProcessor.REJECT]; - const msg = scriptInfo.toString(); + const licenseIds = [...scriptInfo.licenses].map(l => l.identifier).sort().join(', '); + const msg = licenseIds + ? `Free license${scriptInfo.licenses.size > 1 ? 's' : ''} (${licenseIds})` + : 'Unknown license(s)'; addReportEntry(tabId, { url, [verdict]: [url, msg] }); return ret; } -- cgit v1.2.3