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 --- bg/ExternalLicenses.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'bg') diff --git a/bg/ExternalLicenses.js b/bg/ExternalLicenses.js index 1196602..01894b1 100644 --- a/bg/ExternalLicenses.js +++ b/bg/ExternalLicenses.js @@ -48,6 +48,7 @@ const ExternalLicenses = { cachedHrefs.delete(tabId); }, + // Checks external script using web labels async check(script) { const { url, tabId, frameId, documentUrl } = script; const tabCache = cachedHrefs.get(tabId); @@ -69,12 +70,6 @@ const ExternalLicenses = { licensesByLabel.get(uLabel.replace(/^GNU-|-(?:OR-LATER|ONLY)$/, '')); return license ? [license] : []; }).flat()); - scriptInfo.toString = () => { - const licenseIds = [...this.licenses].map(l => l.identifier).sort().join(', '); - return licenseIds - ? `Free license${this.licenses.size > 1 ? 's' : ''} (${licenseIds})` - : 'Unknown license(s)'; - } scriptInfo.free = scriptInfo.licenses.size > 0; return scriptInfo; }, -- cgit v1.2.3