Переглянути джерело

remove links containing JS

Gildas 7 роки тому
батько
коміт
bfdbd7cb6f
1 змінених файлів з 3 додано та 0 видалено
  1. 3 0
      lib/single-file/single-file-core.js

+ 3 - 0
lib/single-file/single-file-core.js

@@ -387,6 +387,9 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 					if (!match || match[1] != this.baseURI) {
 						element.setAttribute("href", href);
 					}
+					if (this.options.removeScripts && href.match(/^\s*javascript:/)) {
+						element.removeAttribute("href");
+					}
 				}
 			});
 		}