From c26ad83e2e0c29a6e18a36fcff86554815ea6bea Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Tue, 27 Sep 2022 12:40:23 +1000 Subject: Refactoring response handler to improve readability --- bg/ExternalLicenses.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'bg/ExternalLicenses.js') diff --git a/bg/ExternalLicenses.js b/bg/ExternalLicenses.js index 6eda008..6d35863 100644 --- a/bg/ExternalLicenses.js +++ b/bg/ExternalLicenses.js @@ -48,7 +48,17 @@ const ExternalLicenses = { cachedHrefs.delete(tabId); }, - // Checks external script using web labels + /** + * Checks external script using web labels + * + * If the script cannot be found in the web labels table, returns null. + * + * If the script can be found in the web labels table, and at least + * one of its licenses can be found in our free license DB, returns + * "free". + * + * Otherwise returns "nonfree". + */ async check(script) { const { url, tabId, frameId, documentUrl } = script; const tabCache = cachedHrefs.get(tabId); -- cgit v1.2.3