Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //just a skeleton, will clean & fine-tune it later
- let a= window.open(),
- b= document.links,
- c= [],
- d= "<br><br>";
- [...b].forEach(i=>{
- c.push(i.outerHTML);
- })
- a.document.write(`<html>
- <head>
- <title> Links on ${location.hostname}</title>
- <style>
- html,body{position: absolute;
- left:0; right:0; top:0; bottom:0;
- display:flex; flex-direction:column;
- justify-content:flex-start;
- align-items: center;
- background:black;
- color: gray;
- }
- #container{
- padding:10px;
- border: 5px double gray;
- }
- a{color: white; margin-bottom:2em;}
- </style>
- </head>
- <body>
- <span> List of links on ${location.hostname}</span>
- <br>
- <div id="container">
- ${c.join(d)}
- </div>
- </body></html>
- `);
- //------------LINKEFY----
- let a= /(?:https?:\/\/)?([\w-]+\.)?[\w-]+\.\w+(\/\S+)?/gi;
- let b= document.body.innerHTML.match(a);
- b.forEach(i=>{
- document.body.innerHTML=
- document.body.innerHTML
- .split(i)
- .join(`<a href="${i}">${i}</a>`);
- });
Add Comment
Please, Sign In to add comment