Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- javascript:/*ResourceList*/
- ((l) => {
- function add(u, m, o) {
- if (!(m = u.match(/\.[0-9a-z]*(?:[&#'"]|$)/))) m = ["."];
- if (!l[m[0]]) l[m[0]] = new Set;
- l[m[0]].add(u)
- }
- l = {};
- document.querySelectorAll('*').forEach((e, m) => {
- if (e.href && (m = e.href.match(/https?:\/\/[^&#'"]+/))) add(m[0]);
- if (e.src && (m = e.src.match(/https?:\/\/[^&#'"]+/))) add(m[0]);
- if (m = getComputedStyle(e).backgroundImage.match(/https?:\/\/[^'"\)]+/)) add(m[0]);
- }, []);
- document.documentElement.insertAdjacentHTML("beforeend", `<div id=llbm><style>
- #llbm,#llbm *{all:revert}
- #llbm{position:fixed;z-index:9999999999999;left:0;top:0;right:0;bottom:0;background:rgb(0,0,0,.5);cursor:pointer;font:12pt/normal sans-serif}
- #llbmc{position:fixed;left:50vw;top:50vh;transform:translate(-50%,-50%);border:.2em solid #000;border-radius:.3em;background:#fff;max-width:90vw;max-height:90vh;cursor:auto}
- #llbmo{position:relative;height:100%}
- #llbmh{padding:0 .2em;background:#000;color:#fff;text-align:center;font-weight:bold}
- #llbm th{padding:0 .2em;background:#777;color:#fff;text-align:center}
- #llbm td{vertical-align:top}
- #llbmt{max-height:77vh}
- #llbmu{max-height:75vh;overflow-x:hidden;overflow-y:auto}
- #llbmu>div{padding:.1em .2em}
- #llbmu>div:nth-child(2n){background:#eee}
- #llbmu a{word-break:break-all}
- </style><div id=llbmc><div id=llbmo>
- <div id=llbmh>Resource List</div>
- <table><thead><tr><th>Type</th><th>URLs</th></tr></thead>
- <tbody><tr><td><select id=llbmt>${
- Object.keys(l).map(k => k !== "." ? k : "Page/Unknown").sort().map(k => `<option value="${k[0] === "." ? k : "."}">${k}</option>`)
- }</select></td><td><div id=llbmu></div></td></tr></tbody>
- </table></div></div></div>`);
- llbm.onclick = ev => (ev.target === llbm) && llbm.remove();
- llbmt.onchange = (c, a, x) => {
- x = 40;
- c = llbmu.cloneNode(false);
- Array.from(l[llbmt.value]).sort().forEach((u, e, m) => {
- c.appendChild(document.createElement("DIV")).appendChild(e = document.createElement("A")).href = u;
- (m = decodeURIComponent(u).match(/^.*?:\/\/([^\/]+\/)(?:([^?]+)(\?.*)|(.*))?/)).shift();
- if (m[3]) {
- m.splice(1, 2);
- if (m[1] && (m[1].length > x)) m[1] = m[1].substr(0, x) + "..." + m[1].substr(-x);
- } else {
- if (m[1] && (m[1].length > x)) m[1] = m[1].substr(0, x) + "..." + m[1].substr(-x);
- if (m[2] && (m[2].length > x)) m[2] = m[2].substr(0, x) + "...";
- }
- e.textContent = m.join("");
- });
- llbmu.replaceWith(c)
- };
- llbmt.size = llbmt.childElementCount > 1 ? llbmt.childElementCount : 2;
- llbmt.selectedIndex = 0;
- llbmt.onchange()
- })()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement