Skip to content

Commit b66093f

Browse files
committed
提取页面代码中所有网址
1 parent 4d0d6fa commit b66093f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

allURL.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* @description 提取页面代码中所有网址
3+
* @author 未知
4+
*/
5+
6+
var aa = document.documentElement.outerHTML.match(/(url\(|src=|href=)[\"\']*([^\"\'\(\)\<\>\[\] ]+)[\"\'\)]*|(http:\/\/[\w\-\.]+[^\"\'\(\)\<\>\[\] ]+)/ig).join("\r\n").replace(/^(src=|href=|url\()[\"\']*|[\"\'\>\) ]*$/igm,"");
7+
alert(aa);

0 commit comments

Comments
 (0)