Skip to content

Commit

Permalink
jQuery regex fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
eoftedal committed Mar 11, 2024
1 parent 5facf77 commit 6f9c266
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
17 changes: 17 additions & 0 deletions chrome/extension/js/background.js
Expand Up @@ -87,6 +87,23 @@ events.on("scan", function (details) {
}
download(details.url).then((content) => {
events.emit("script-downloaded", details, content);
if (content.startsWith("/*! For license information please see ")) {
const licenseFilename = content
.split("/*! For license information please see ")[1]
.split(" */")[0];
const licenseUrl =
details.url
.split("?")[0]
.split("#")[0]
.split("/")
.slice(0, -1)
.join("/") +
"/" +
licenseFilename;
download(licenseUrl).then((licenseContent) => {
events.emit("script-downloaded", details, licenseContent);
});
}
});
});

Expand Down
1 change: 1 addition & 0 deletions repository/jsrepository-master.json
Expand Up @@ -224,6 +224,7 @@
"/\\*!? jQuery v(§§version§§)",
"\\* jQuery JavaScript Library v(§§version§§)",
"\\* jQuery (§§version§§) - New Wave Javascript",
"/\\*![\\s]+\\* jQuery JavaScript Library v(§§version§§)",
"// \\$Id: jquery.js,v (§§version§§)",
"/\\*! jQuery v(§§version§§)",
"[^a-z]f=\"(§§version§§)\",.*[^a-z]jquery:f,",
Expand Down
1 change: 1 addition & 0 deletions repository/jsrepository-v2.json
Expand Up @@ -326,6 +326,7 @@
"/\\*!? jQuery v(§§version§§)",
"\\* jQuery JavaScript Library v(§§version§§)",
"\\* jQuery (§§version§§) - New Wave Javascript",
"/\\*![\\s]+\\* jQuery JavaScript Library v(§§version§§)",
"// \\$Id: jquery.js,v (§§version§§)",
"/\\*! jQuery v(§§version§§)",
"[^a-z]f=\"(§§version§§)\",.*[^a-z]jquery:f,",
Expand Down
1 change: 1 addition & 0 deletions repository/jsrepository.json
Expand Up @@ -326,6 +326,7 @@
"/\\*!? jQuery v(§§version§§)",
"\\* jQuery JavaScript Library v(§§version§§)",
"\\* jQuery (§§version§§) - New Wave Javascript",
"/\\*![\\s]+\\* jQuery JavaScript Library v(§§version§§)",
"// \\$Id: jquery.js,v (§§version§§)",
"/\\*! jQuery v(§§version§§)",
"[^a-z]f=\"(§§version§§)\",.*[^a-z]jquery:f,",
Expand Down

0 comments on commit 6f9c266

Please sign in to comment.