aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuchen Pei <hi@ypei.me>2022-09-20 18:59:28 +1000
committerYuchen Pei <hi@ypei.me>2022-09-20 18:59:28 +1000
commit73da91b91fa13dd85903f1675257c95614790950 (patch)
tree101a2946de6c51f605b19baffeef92b9a7ee711b
parent02c64187224455da6089bdacc544f47443c6ba91 (diff)
added some comments for various checks
-rw-r--r--main_background.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/main_background.js b/main_background.js
index d33d3d9..73aa47b 100644
--- a/main_background.js
+++ b/main_background.js
@@ -618,6 +618,7 @@ function validateLicense(matches) {
*/
function license_read(scriptSrc, name, external = false) {
+ // Check for @licstart .. @licend method
const license = legacy_license_lib.check(scriptSrc);
if (license) {
return [true, scriptSrc, `Licensed under: ${license}`];
@@ -653,6 +654,7 @@ function license_read(scriptSrc, name, external = false) {
return trivial;
}
+ // Check for @license .. @license-end method
while (uneditedSrc) {
const openingMatch = /\/[/*]\s*?(@license)\s+(\S+)\s+(\S+).*$/mi.exec(uneditedSrc);
if (!openingMatch) { // no license found, check for triviality
@@ -856,6 +858,7 @@ var ResponseHandler = {
});
return ResponseProcessor.ACCEPT;
} else {
+ // Check for the weblabel method
let scriptInfo = await ExternalLicenses.check({ url: fullUrl, tabId, frameId, documentUrl });
if (scriptInfo) {
let verdict, ret;