-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrandom-screenshot.html
86 lines (65 loc) · 13.9 KB
/
random-screenshot.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Random Screenshot Generator</title>
<style>
html, body {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
padding: 0;
margin: 0;
overflow: hidden;
font-size: 30px;
font-family: "Lato", "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
color: white;
background-color: #000000;
height: 100%;
width: 100%;
}
div {
padding: 5px;
}
a:link {
color: #60c5ff;
background-color: transparent;
text-decoration: none;
}
a:visited {
color: #60c5ff;
background-color: transparent;
text-decoration: none;
}
a:hover {
color: #c485ff;
background-color: transparent;
text-decoration: underline;
}
a:active {
color: #c485ff;
background-color: transparent;
text-decoration: underline;
}
</style>
</head>
<body>
<a title="Drag me to your bookmark bar!" href=
"javascript:(function()%7Bdocument.open()%3Bdocument.write(%22%3C!DOCTYPE%20html%3E%20%3Chtml%3E%20%3Chead%3E%20%3Cmeta%20http-equiv%3D%5C%22content-type%5C%22%20content%3D%5C%22text%2Fhtml%3B%20charset%3DUTF-8%5C%22%3E%20%3Ctitle%3ERandom%20Screenshot%20Generator%3C%2Ftitle%3E%20%3Cstyle%3E%20body%20%7B%20padding%3A%200%3B%20margin%3A%200%3B%20overflow%3A%20hidden%3B%20%7D%20textarea%20%7B%20font-size%3A16px%3B%20display%3A%20block%3B%20margin-left%3A%20auto%3B%20margin-right%3A%20auto%3B%20%7D%20.centerpoint%20%7B%20display%3A%20flex%3B%20justify-content%3A%20center%3B%20%7D%20input%5Btype%3Dtext%5D%2C%20select%20%7B%20font-size%3A16px%3B%20width%3A%20150px%3B%20padding%3A%2012px%2020px%3B%20margin%3A%2020px%208px%3B%20display%3A%20inline-block%3B%20border%3A%201px%20solid%20%23ccc%3B%20border-radius%3A%204px%3B%20box-sizing%3A%20border-box%3B%20%7D%20img%20%7B%20margin%3A%2020px%208px%3B%20%7D%20button%20%7B%20font-size%3A16px%3B%20height%3A%2058px%3B%20margin%3A%2021px%208px%3B%20background-color%3A%20rgb(77%2C%2077%2C%2077)%3B%20color%3A%20white%3B%20border%3A%20none%3B%20border-radius%3A%204px%3B%20cursor%3A%20pointer%3B%20%7D%20button%3Ahover%20%7B%20background-color%3A%20%23686868%3B%20%7D%20.painted%20%7B%20background-color%3A%20rgb(240%2C%20240%2C%20240)%3B%20%7D%20a%3Alink%20%7B%20color%3A%20%2360c5ff%3B%20background-color%3A%20transparent%3B%20text-decoration%3A%20none%3B%20%7D%20a%3Avisited%20%7B%20color%3A%20%2360c5ff%3B%20background-color%3A%20transparent%3B%20text-decoration%3A%20none%3B%20%7D%20a%3Ahover%20%7B%20color%3A%20%23c485ff%3B%20background-color%3A%20transparent%3B%20text-decoration%3A%20underline%3B%20%7D%20a%3Aactive%20%7B%20color%3A%20%23c485ff%3B%20background-color%3A%20transparent%3B%20text-decoration%3A%20underline%3B%20%7D%20%3C%2Fstyle%3E%20%3C%2Fhead%3E%20%3Cbody%20onresize%3D%5C%22resizeImages()%5C%22%3E%20%3Cbr%3E%3Cbr%3E%20%3Cdiv%20class%3D%5C%22painted%5C%22%3E%20%3Cform%20id%3D%5C%22generateForm%5C%22%20onsubmit%3D%5C%22generateSeededScreenshot()%3B%20return%20false%3B%5C%22%20autocomplete%3D%5C%22off%5C%22%3E%20%3C!--%20Wrapping%20this%20in%20a%20form%20lets%20you%20hit%20enter%20to%20submit%2C%20return%20false%3B%20prevents%20the%20page%20from%20refreshing%20on%20submission%20--%3E%20%3Cdiv%20class%3D%5C%22centerpoint%5C%22%3E%20%3Cimg%20src%3D'https%3A%2F%2F753.network%2Fimages%2Fseed_icon.png'%20title%3D%5C%22seed%5C%22%20style%3D%5C%22height%3A%2058px%5C%22%3E%20%3Cinput%20type%3D%5C%22text%5C%22%20id%3D%5C%22seed%5C%22%20placeholder%3D%5C%22Enter%20seed...%5C%22%20style%3D%5C%22width%3A%20280px%5C%22%3E%20%3Cbutton%20type%3D%5C%22button%5C%22%20onclick%3D%5C%22generateSeededScreenshot()%5C%22%20style%3D%5C%22width%3A%20180px%5C%22%3EGenerate%20with%20Seed%3C%2Fbutton%3E%20%3Cbutton%20type%3D%5C%22button%5C%22%20onclick%3D%5C%22generateRandomScreenshot()%5C%22%20style%3D%5C%22width%3A%20180px%5C%22%3EGenerate%20Random%3C%2Fbutton%3E%20%3Cbutton%20type%3D%5C%22button%5C%22%20onclick%3D%5C%22generateNext()%5C%22%20style%3D%5C%22width%3A%20100px%5C%22%3ENext%3C%2Fbutton%3E%20%3C%2Fdiv%3E%20%3C%2Fform%3E%20%3C%2Fdiv%3E%20%3Cbr%3E%20%3Cdiv%20class%3D%5C%22painted%5C%22%3E%20%3Cdiv%20class%3D%5C%22centerpoint%5C%22%3E%20%3Cimg%20id%3D%5C%22screenshot%5C%22%20style%3D%5C%22width%3A%20auto%3B%5C%22%20referrerpolicy%3D%5C%22no-referrer%5C%22%20src%3D%5C%22https%3A%2F%2F753.network%2Fimages%2Fscreenshot_software.png%5C%22%20title%3D%5C%22seeds%20will%20be%20displayed%20here%5C%22%3E%20%3C!--%20Resize%20the%20image%20automatically%20so%20it%20fits%20on%20the%20page%20--%3E%20%3Cscript%3E%20document.getElementById(%5C%22screenshot%5C%22).style.maxHeight%20%3D%20window.innerHeight%20-%20200%20%2B%20%5C%22px%5C%22%3B%20function%20resizeImages()%20%7B%20document.getElementById(%5C%22screenshot%5C%22).style.maxHeight%20%3D%20window.innerHeight%20-%20200%20%2B%20%5C%22px%5C%22%3B%20%7D%20%3C%2Fscript%3E%20%3C%2Fdiv%3E%20%3C%2Fdiv%3E%20%3Cdiv%20class%3D%5C%22centerpoint%5C%22%3E%20%3Cp%20style%3D%5C%22color%3Argb(150%2C%20150%2C%20150)%5C%22%3EBookmarklet%20developed%20by%3A%20https%3A%2F%2F753.network%2F%3C%2Fp%3E%20%3C%2Fdiv%3E%20%3C!--%20JAVASCRIPT%20BEYOND%20THIS%20POINT%2C%20BE%20WARNED%20--%3E%20%3Cscript%3E%20checkSite()%3B%20window.addEventListener('DOMContentLoaded'%2C%20(event)%20%3D%3E%20%7B%20checkSite()%3B%20%7D)%3B%20function%20checkSite()%20%2F*%20Some%20sites%20handle%20security%20differently%20so%20the%20scripts%20will%20break%20before%20this%20check%20runs%2C%20you%20should%20probably%20have%20this%20as%20an%20overlay%20by%20default%20and%20remove%20it%20if%20we're%20on%20the%20right%20site%20*%2F%20%7B%20if(!window.location.href.includes(%5C%22prnt.sc%5C%22))%20%2F*%20This%20bookmarklet%20should%20only%20work%20on%20prnt.sc%20*%2F%20%7B%20document.body.outerHTML%20%3D%20%5C%22%3Cbody%20style%3D'background-color%3A%20%23000000%3B'%3E%3Cdiv%20style%3D'position%3A%20fixed%3B%20display%3A%20flex%3B%20flex-direction%3A%20column%3B%20justify-content%3A%20center%3B%20align-items%3A%20center%3B%20padding%3A%200%3B%20margin%3A%200%3B%20overflow%3A%20hidden%3B%20font-size%3A%2030px%3B%20color%3A%20white%3B%20width%3A%20100%25%3B%20height%3A%20100%25%3B'%3E%3Cdiv%3EThis%20bookmarklet%20should%20only%20be%20run%20at%20%3Ca%20href%3D'https%3A%2F%2Fprnt.sc%2F'%3Ehttps%3A%2F%2Fprnt.sc%2F%3C%2Fa%3E%3C%2Fdiv%3E%20%3Cdiv%3EVisit%20%3Ca%20href%3D'https%3A%2F%2F753.network%2Frandom-screenshot'%3E%20https%3A%2F%2F753.network%2Frandom-screenshot%3C%2Fa%3E%20for%20more%20information.%3C%2Fdiv%3E%3C%2Fdiv%3E%3C%2Fbody%3E%5C%22%3B%20%7D%20%7D%20%3C%2Fscript%3E%20%3Cscript%20src%3D%5C%22https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fjquery%2F3.4.1%2Fjquery.min.js%5C%22%3E%3C%2Fscript%3E%20%3Cscript%3E%20%2F*%20%5C%22borrowed%5C%22%20from%20Stack%20Overflow%20*%2F%20String.prototype.hashCode%20%3D%20function()%20%2F*%20now%20we%20can%20do%20str.hashCode()%20to%20get%20a%20hashCode%20for%20a%20string%20*%2F%20%7B%20var%20hash%20%3D%200%3B%20var%20i%3B%20var%20chr%3B%20if%20(this.length%20%3D%3D%3D%200)%20return%20hash%3B%20for%20(i%20%3D%200%3B%20i%20%3C%20this.length%3B%20i%2B%2B)%20%7B%20chr%20%3D%20this.charCodeAt(i)%3B%20hash%20%3D%20((hash%20%3C%3C%205)%20-%20hash)%20%2B%20chr%3B%20hash%20%7C%3D%200%3B%20%2F*%20Convert%20to%2032bit%20integer%20*%2F%20%7D%20return%20hash%3B%20%7D%3B%20function%20generateSeededScreenshot()%20%7B%20document.getElementById(%5C%22screenshot%5C%22).src%20%3D%20%5C%22https%3A%2F%2F753.network%2Fimages%2Floading.gif%5C%22%3B%20seed%20%3D%20document.getElementById(%5C%22seed%5C%22).value%3B%20if(seed%20%3D%3D%20%5C%22%5C%22)%20%7B%20seed%20%3D%20%5C%22null%5C%22%3B%20%7D%20var%20alphaNumeric%20%3D%20%2F%5E%5B0-9a-z%5D%2B%24%2F%3B%20if%20((seed.length%20%3D%3D%206%20%7C%7C%20seed.length%20%3D%3D%207)%20%26%26%20seed.match(alphaNumeric))%20%7B%20%2F*%20nice%2C%20we're%20already%20a%20valid%20seed%20*%2F%20%7D%20else%20%2F*%20Hash%20the%20value%20into%20a%20valid%201%20to%209%20digit%20positive%20integer%20*%2F%20%7B%20while(true)%20%7B%20seedHash%20%3D%20seed.hashCode()%3B%20seedHash%20%3D%20Math.abs(seedHash)%3B%20while(seedHash.toString().length%20%3C%206)%20%7B%20seedHash%20%3D%20seedHash%20%2B%20seedHash%3B%20%7D%20seed%20%3D%20seedHash.toString().substr(0%2C6)%3B%20if(seed.charCodeAt(0)%20%3C%20114)%20%2F*%20we%20don't%20want%20a%20screenshot%20that%20doesn't%20exist%20yet%20*%2F%20%7B%20break%3B%20%7D%20%7D%20%7D%20document.getElementById(%5C%22screenshot%5C%22).title%20%3D%20seed%3B%20window.console.log(seed)%3B%20%24.ajax%20(%7B%20type%3A%20%5C%22GET%5C%22%2C%20url%3A%20'https%3A%2F%2Fprnt.sc%2F'%20%2B%20seed%2C%20dataType%20%3A%20'text%2Fhtml'%2C%20crossDomain%3A%20true%2C%20error%3A%20function(data%2C%20textStatus%2C%20xhr)%20%7B%20startIndex%20%3D%20data.responseText.indexOf('class%3D%5C%22no-click%20screenshot-image%5C%22')%20%2B%2035%3B%20endIndex%20%3D%20data.responseText.indexOf('alt%3D%5C%22Lightshot%20screenshot%5C%22')%3B%20imageUrl%20%3D%20data.responseText.substr(startIndex%2C%20endIndex%20-%20startIndex)%3B%20imageUrl%20%3D%20imageUrl.substring(imageUrl.indexOf('%5C%22')%20%2B%201%2C%20imageUrl.lastIndexOf('%5C%22'))%3B%20if(imageUrl%20%3D%3D%20%5C%22%5C%22)%20%7B%20document.getElementById(%5C%22screenshot%5C%22).src%20%3D%20%5C%22error%5C%22%3B%20%7D%20else%20%7B%20document.getElementById(%5C%22screenshot%5C%22).src%20%3D%20imageUrl%3B%20%7D%20%7D%20%7D)%20%7D%20function%20generateRandomScreenshot()%20%7B%20document.getElementById(%5C%22screenshot%5C%22).src%20%3D%20%5C%22https%3A%2F%2F753.network%2Fimages%2Floading.gif%5C%22%3B%20while(true)%20%7B%20seed%20%3D%20Math.random().toString(36).slice(2).substr(0%2C6)%3B%20if(seed.charCodeAt(0)%20%3C%20114)%20%7B%20break%3B%20%7D%20%7D%20document.getElementById(%5C%22seed%5C%22).value%20%3D%20seed%3B%20document.getElementById(%5C%22screenshot%5C%22).title%20%3D%20seed%3B%20window.console.log(seed)%3B%20%24.ajax%20(%7B%20type%3A%20%5C%22GET%5C%22%2C%20url%3A%20'https%3A%2F%2Fprnt.sc%2F'%20%2B%20seed%2C%20dataType%20%3A%20'text%2Fhtml'%2C%20crossDomain%3A%20true%2C%20error%3A%20function(data%2C%20textStatus%2C%20xhr)%20%7B%20startIndex%20%3D%20data.responseText.indexOf('class%3D%5C%22no-click%20screenshot-image%5C%22')%20%2B%2035%3B%20endIndex%20%3D%20data.responseText.indexOf('alt%3D%5C%22Lightshot%20screenshot%5C%22')%3B%20imageUrl%20%3D%20data.responseText.substr(startIndex%2C%20endIndex%20-%20startIndex)%3B%20imageUrl%20%3D%20imageUrl.substring(imageUrl.indexOf('%5C%22')%20%2B%201%2C%20imageUrl.lastIndexOf('%5C%22'))%3B%20if(imageUrl%20%3D%3D%20%5C%22%5C%22)%20%7B%20document.getElementById(%5C%22screenshot%5C%22).src%20%3D%20%5C%22error%5C%22%3B%20%7D%20else%20%7B%20document.getElementById(%5C%22screenshot%5C%22).src%20%3D%20imageUrl%3B%20%7D%20%7D%20%7D)%20%7D%20function%20generateNext()%20%7B%20document.getElementById(%5C%22screenshot%5C%22).src%20%3D%20%5C%22https%3A%2F%2F753.network%2Fimages%2Floading.gif%5C%22%3B%20seed%20%3D%20document.getElementById(%5C%22seed%5C%22).value%3B%20if(seed.length%20!%3D%206%20%26%26%20seed.length%20!%3D%207)%20%2F*%20can't%20increment%20the%20seed%20unless%20it's%20a%20valid%20seed%20*%2F%20%7B%20while(true)%20%7B%20seed%20%3D%20Math.random().toString(36).slice(2).substr(0%2C6)%3B%20if(seed.charCodeAt(0)%20%3C%20114)%20%7B%20break%3B%20%7D%20%7D%20%7D%20seed%20%3D%20incrementBase36(seed)%3B%20document.getElementById(%5C%22seed%5C%22).value%20%3D%20seed%3B%20document.getElementById(%5C%22screenshot%5C%22).title%20%3D%20seed%3B%20window.console.log(seed)%3B%20%24.ajax%20(%7B%20type%3A%20%5C%22GET%5C%22%2C%20url%3A%20'https%3A%2F%2Fprnt.sc%2F'%20%2B%20seed%2C%20dataType%20%3A%20'text%2Fhtml'%2C%20crossDomain%3A%20true%2C%20error%3A%20function(data%2C%20textStatus%2C%20xhr)%20%7B%20startIndex%20%3D%20data.responseText.indexOf('class%3D%5C%22no-click%20screenshot-image%5C%22')%20%2B%2035%3B%20endIndex%20%3D%20data.responseText.indexOf('alt%3D%5C%22Lightshot%20screenshot%5C%22')%3B%20imageUrl%20%3D%20data.responseText.substr(startIndex%2C%20endIndex%20-%20startIndex)%3B%20imageUrl%20%3D%20imageUrl.substring(imageUrl.indexOf('%5C%22')%20%2B%201%2C%20imageUrl.lastIndexOf('%5C%22'))%3B%20if(imageUrl%20%3D%3D%20%5C%22%5C%22)%20%7B%20document.getElementById(%5C%22screenshot%5C%22).src%20%3D%20%5C%22error%5C%22%3B%20%7D%20else%20%7B%20document.getElementById(%5C%22screenshot%5C%22).src%20%3D%20imageUrl%3B%20%7D%20%7D%20%7D)%20%7D%20function%20incrementBase36(x)%20%7B%20return%20(parseInt(1%2Bx%2C36)%2B1).toString(36).slice(1)%3B%20%2F*%20gracefully%20stolen%20from%20Arnauld%20on%20Code%20Golf%20Stack%20Exchange%20*%2F%20%7D%20%3C%2Fscript%3E%20%3C%2Fbody%3E%20%3C%2Fhtml%3E%22)%3Bdocument.close()%7D)()"
>
<img title="Drag me to your bookmark bar!" src="images/bookmarklet.png" alt="Random Screenshot Generator - Only works on https://prnt.sc/"> </a>
<div style="font-size:26px;"><b>Drag the image above into your bookmarks toolbar to create a bookmarklet!</b></div>
<div style="font-size:22px;">Bookmarklets are bookmarks that run javascript instead of taking you to a website.</div>
<div style="font-size:22px;">Run this bookmarklet on <a href='https://prnt.sc/'>https://prnt.sc/</a> to turn it into a random screenshot generator.</div>
<!-- Instructions for building bookmarklets-random-screenshot.html into a bookmarklet:
Take your HTML file and use the replace tool to replace " with \"
Paste the entire edited .html file here and remove all line/paragraph breaks.
https://www.textfixer.com/tools/remove-line-breaks.php
Use the output from the above site as X for this site.
document.open();
document.write("X");
document.close();
https://mrcoles.com/bookmarklet/ -->
</body>
</html>