-
Notifications
You must be signed in to change notification settings - Fork 6
/
test.html
35 lines (32 loc) · 4.78 KB
/
test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Bookmarklets and links</title>
</head>
<body>
<ul>
<li><a href="javascript:(function(){sq=window.sq=window.sq||{};if(sq.script){sq.again();}else{sq.bookmarkletVersion='0.3.0';sq.iframeQueryParams={host:'//squirt.io',userId:'d9dc51c1-8a5a-42dd-853a-a6ad49f52cdd',};sq.script=document.createElement('script');sq.script.src=sq.iframeQueryParams.host+'/bookmarklet/frame.outer.js';document.body.appendChild(sq.script);}})();">Squirt</a></li>
<li><a href="javascript:eval("console.log('ok')");">Eval + log</a></li>
<li><a href="javascript:void((function(d){if(self!=top||d.getElementById('toolbar')&&d.getElementById('toolbar').getAttribute('data-resizer'))return%20false;d.write('<!DOCTYPE%20HTML><html%20style="opacity:0;"><head><meta%20charset="utf-8"/></head><body><a%20data-viewport="320x480"%20data-icon="mobile">Mobile%20(e.g.%20Apple%20iPhone)</a><a%20data-viewport="320x568"%20data-icon="mobile"%20data-version="5">Apple%20iPhone%205</a><a%20data-viewport="375%C3%97667"%20data-icon="mobile"%20data-version="7">Apple%20iPhone%207</a><a%20data-viewport="414%C3%97736"%20data-icon="mobile"%20data-version="7+">Apple%20iPhone%207%20Plus</a><a%20data-viewport="600x800"%20data-icon="small-tablet">Small%20Tablet</a><a%20data-viewport="768x1024"%20data-icon="tablet">Tablet%20(e.g.%20Apple%20iPad%202-3rd,%20mini)</a><a%20data-viewport="1280x800"%20data-icon="notebook">Widescreen</a><a%20data-viewport="1920%C3%971080"%20data-icon="tv">HDTV%201080p</a><script%20src="https://lab.maltewassermann.com/viewport-resizer/resizer.min.js"></script></body></html>')})(document));">Viewport resizer</a></li>
<li><a href="javascript:"use%20privileged";{let%20d=document,u=d.URL,t="head%20title,h1,h2".split(",").map(s=>d.querySelector(s)).reduce((a,e)=>a||e&&e.textContent.replace(/\s+/g,"%20").trim(),"")||u,z=u.replace(/\(/g,"%2528").replace(/\)/g,"%2529"),l=e=>{let%20c=e.clipboardData,s=c.setData.bind(c);d.removeEventListener("copy",l);e.preventDefault();c.clearData();s("text/x-moz-url",u);s("text/uri-list",u);s("text/html",`<a%20href="${u}">${t.replace(/[&<>"']/g,m=>`&${{"&":"amp","<":"lt",">":"gt",'"':"quot","'":"apos"}[m]};`)}</a>`);s("text/plain",t==u?z:`[${t.replace(/([<>\[\]])/g,"\\$1")}](${z})`)};if(d.activeElement.tagName=="IFRAME"){let%20s=d.createElement("span");s.tabIndex=-1;s.style.position="fixed";d.body.appendChild(s);s.focus();s.remove()}d.addEventListener("copy",l);d.execCommand("copy");console.log("copied");void(0)}">Clipboard write</a></li>
<li><a href="javascript:throw%20new%20Error("test%20error")">Throw error</a></li>
<li><a href="javascript:console.log(typeof%20browser%20!=%20"undefined"%20?%20browser%20:%20undefined,%20typeof%20chrome%20!=%20"undefined"%20?%20chrome%20:%20undefined)">Log browser and chrome</a></li>
<li><a href="javascript:console.log("test%20before%20return"),"test%20return"">Log + string</a></li>
<li><a href="javascript:var%20{}">Syntax error</a></li>
<li><a href="javascript:{let%20a=alert;a("works")}">block scope</a></li>
<li><a href="javascript:{let%20a=alert;"works"}">block scope + string</a></li>
<li><a href="javascript:console.log(this, self, typeof%20$)">log this, self and typeof $</a></li>
<li><a href="javascript:void%20document.execCommand("copy")">clipoard copy</a></li>
<li><a href="javascript:location.replace('org-protocol:/capture?template=l&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)+'&body='+encodeURIComponent(window.getSelection()))">location replace with org-protocol:/</a></li>
<li><a href="javascript:var%20a=true;"works"">string</a></li>
<li><a href="javascript:var%20a=true;undefined">undefined</a></li>
<li><a href="javascript:location.href='https://web.archive.org/web/submit?type=urlquery&url='+encodeURIComponent(window.location)">location setter</a></li>
<li><a href="javascript:(function%20a(){throw%20new%20Error("test")})()">error with stack</a></li>
</ul>
<ul>
<li><a href="https://github.com/">SVG document</a></li>
<li><a href="https://upload.wikimedia.org/wikipedia/commons/0/02/SVG_logo.svg">document with strict CSP</a></li>
</ul>
</body>
</html>