-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbooklets.html
157 lines (137 loc) · 8.13 KB
/
booklets.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<!DOCTYPE html>
<html>
<head>
<title>
booklets
</title>
<link rel="stylesheet" href="booklets.css"/>
</head>
<body>
<div id="main">
<a href="/">< return</a><br><br>
<div>
This is a list of bookmark scripts I've made over the time.<br>
Feel free to grab any code you might find useful.
<br>
<br>
<font color="lightgreen">HOW TO USE:</font><br>
1. Copy the script you like. <br>
2. Make a new bookmark and paste the script you just copied into the url area. <br>
3. Give it a title. <br>
4. Save the bookmark. <br>
Whenever the you click on the bookmark, it'll run its script. Neat, isn't it?
<br><br>
<font color="red">DISCLAIMER:</font><br>
As a rule of thumb, make sure you trust the author or understand what the code does before running any external javascript.<br>
<font color="red">Never run any code you do not trust.</font> There are instances where scammers try to steal discord and steam tokens via bookmark scripts. <br>
<u><b>If a stranger asks you to run a code you don't recognize, don't run it.</b></u>
</div>
<br><br>
<span>Toggle document.design mode:</span><br>
<code class="booklet_code">
javascript:(()=>{ if (document.designMode == 'on') { document.designMode = 'off' } else { document.designMode = 'on' } })();
</code>
<button>copy</button>
<br><br>
<span>Get Instagram image from post:</span><br>
<code class="booklet_code">javascript:(()=>{ if (window.location.href.includes('instagram.com/p/')){ if ((window.location.href).split('instagram.com/p/')[1].includes('/')){ image_url = "https://instagram.com/p/" + (window.location.href).split('instagram.com/p/')[1].split('/')[0] + '/media/?size=l' } else{ image_url = "https://instagram.com/p/" + (window.location.href).split('instagram.com/p/')[1] + '/media/?size=l' }; Object.assign(document.createElement('a'), { target: '_blank', rel: 'noopener noreferrer', href: image_url, }).click(); } })();</code>
<button>copy</button>
<br><br>
<span>Get Youtube video thumbnail:</span><br>
<code class="booklet_code">javascript:(()=>{ if (window.location.href.includes('youtube.com') || window.location.href.includes('youtu.be')){ VID_REGEX = /(?:youtube(?:-nocookie)?\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/; video_id = (window.location.href).match(VID_REGEX)[1]; thumbmail_address = `https://img.youtube.com/vi/${video_id}/maxresdefault.jpg`; Object.assign(document.createElement('a'), { target: '_blank', rel: 'noopener noreferrer', href: thumbmail_address, }).click(); }; })();</code>
<button>copy</button>
<br><br>
<span>Search Spotify song name on Youtube Music:</span><br>
<code class="booklet_code">javascript:(()=>{ if (window.location.href.includes('music.youtube')){ Object.assign(document.createElement('a'), { target: '_blank', rel: 'noopener noreferrer', href: `https://music.youtube.com/search?q=${document.querySelector('[data-testid=context-item-link]').innerText}+by+${document.querySelector('[data-testid=context-item-info-artist]').innerText}`, }).click(); }})();</code>
<button>copy</button>
<br><br>
<span>Steam points shop theme preview editor:</span> <small style="color: #8b8b8b">v1.0</small><br>
<code class="booklet_code">
javascript:(()=>{
if(window.location.href.includes('steamcommunity.com') && window.location.href.includes('previewprofile=1')){
var elemDiv = document.createElement('div');
function generateEditorInputs(inputPlaceholder){
let inputElem = document.createElement('input');
inputElem.placeholder = inputPlaceholder;
inputElem.style.cssText = `
width: 300px;
margin-top: 5px;
margin-bottom: 5px;
padding: 2px;
outline: none;
`;
elemDiv.appendChild(inputElem);
elemDiv.appendChild(document.createElement('br'));
return inputElem;
}
elemDiv.innerHTML = `Steam Theme Preview Editor`;
elemDiv.appendChild(document.createElement('br'));
function customAvatarFunction(event) {
if (event.key == "Enter") {
let avatars = document.getElementsByClassName('profile_avatar_frame');
for(let i = 0; avatars.length > i; i++){
console.log('iteration');
};
};
};
let customAvatar = generateEditorInputs('Custom Avatar URL', customAvatarFunction);
customAvatar.onkeypress = function(event) {
if (event.key == "Enter") {
let avatars = document.getElementsByClassName('playerAvatarAutoSizeInner');
for(let i = 0; avatars.length > i; i++){
if (customAvatar.value){
avatars[i].lastElementChild.src = customAvatar.value;
}
};
};
};
let customBorder = generateEditorInputs('Custom Border URL', customAvatarFunction);
customBorder.onkeypress = function(event) {
if (event.key == "Enter") {
let avatar = document.getElementsByClassName('profile_avatar_frame')[0];
let borderImage = avatar.firstElementChild;
if (customBorder.value){
borderImage.style.display = 'block';
borderImage.src = customBorder.value;
} else{
borderImage.style.display = 'none';
};
};
};
let customBackground = generateEditorInputs('Custom Background URL', customAvatarFunction);
customBackground.onkeypress = function(event) {
if (event.key == "Enter") {
let backgroundDiv = document.getElementsByClassName('profile_animated_background')[0];
backgroundDiv.innerHTML = '';
let backgroundImg = document.createElement('img');
backgroundImg.src = customBackground.value;
backgroundDiv.appendChild(backgroundImg);
};
};
elemDiv.style.cssText = `
position:absolute;
top: 10px;
left: 10px;
border: 1px solid #ffffff56;
padding: 5px;
background: black;
border-radius: 5px;
`;
document.body.appendChild(elemDiv);
}
})();
</code>
<button>copy</button>
<br><br>
<div style="display: none">
wrap javascript into booklet syntax <br>
<textarea id="bklt_gen" cols="40" rows="5"></textarea>
<button id="gen_button">generate</button>
<br>
<code id="booklet_gen"></code><button>copy</button>
</div>
<br><br>
</div>
<script src="/js/booklets.js"></script>
</body>
</html>