aboutsummaryrefslogtreecommitdiff
path: root/main_background.js
diff options
context:
space:
mode:
authorRuben Rodriguez <ruben@fsf.org>2018-05-11 13:45:18 -0400
committerRuben Rodriguez <ruben@fsf.org>2018-05-11 13:45:18 -0400
commit598ca7b8d266f5d60a306e92993bc79d97d5f9aa (patch)
treee0ccde082a5dcfd9906b953500e1e74ce1db31bd /main_background.js
parent025c8bbc3b81f7c90681f3a020b9c3b41ae192ca (diff)
Enable legacy license matching and hash whitelist matching at license_read()
Diffstat (limited to 'main_background.js')
-rw-r--r--main_background.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/main_background.js b/main_background.js
index a2ab782..050f41e 100644
--- a/main_background.js
+++ b/main_background.js
@@ -860,6 +860,13 @@ function license_read(script_src, name){
var nontrivial_status;
var parts_denied = false;
var parts_accepted = false;
+ var license = legacy_license_lib.check(script_src);
+ if(license != false){
+ return [true,script_src,"Licensed under: "+license];
+ }
+ if (default_whitelist[hash(script_src)]){
+ return [true,script_src,"Common script known to be free software."];
+ }
while(true){ // TODO: refactor me
// TODO: support multiline comments
var matches = /\/\/\s*?(@license)\s([\S]+)\s([\S]+$)/gm.exec(unedited_src);