Skip to content

Commit 85a9338

Browse files
committed
new scripts
1 parent 90ee588 commit 85a9338

20 files changed

+1046
-101
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ Contribute [tại đây (vietnamese)](/md/CONTRIBUTE.md)
3434

3535
### Bookmarks Tips
3636

37+
[Bookmarklets hay](https://bookmarklet.vercel.app/)
38+
3739
<https://www.thetechbasket.com/most-useful-bookmarklets/>
3840
<https://www.hongkiat.com/blog/100-useful-bookmarklets-for-better-productivity-ultimate-list/>
3941
<https://www.wordzz.com/50-most-useful-bookmarklets/>

backup/scripts.js

Lines changed: 278 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,281 @@ let response = await fetch(`${apiUrl}/votes?videoId=${videoId}&likeCount=`, {
121121
.catch((e) => alert("ERROR: " + e));
122122

123123
console.log(response);
124+
125+
// reddit toolkit: https://codepen.io/bookmarklets/pen/Noxwme?editors=1010
126+
javascript: if (window.location.hostname.includes("reddit")) {
127+
if (document.getElementById("mymenu")) {
128+
document.getElementById("mymenu").remove();
129+
} else {
130+
function switcher() {
131+
var url = location.href;
132+
if (url.includes("www")) {
133+
var url = url.replace("www", "old");
134+
window.open(url, "_self");
135+
} else if (url.includes("new")) {
136+
var url = url.replace("new", "old");
137+
window.open(url, "_self");
138+
} else {
139+
var url = url.replace("old", "www");
140+
window.open(url, "_self");
141+
}
142+
}
143+
var switchIt = `<a style=color:#00FF00; href=# onClick=switcher()
144+
title=Switch&nbsp;between&nbsp;old&nbsp;and&nbsp;new&nbsp;Reddit>Old/New Reddit</a>`;
145+
function upVote() {
146+
if (
147+
window.location.href.indexOf("old.reddit.com/r/") > -1 ||
148+
window.location.href.indexOf("old.reddit.com/u/") > -1
149+
) {
150+
(function () {
151+
var q = [];
152+
$(".up").each(function () {
153+
var that = this;
154+
var f = function (index) {
155+
$(that).trigger("click");
156+
$(that).trigger("mousedown");
157+
setTimeout(function () {
158+
if (q[index]) {
159+
q[index](index + 1);
160+
} else {
161+
if (upVoteTimer) {
162+
window.clearTimeout(upVoteTimer);
163+
}
164+
}
165+
}, 500);
166+
};
167+
q.push(f);
168+
});
169+
var upVoteTimer = window.setTimeout(function () {
170+
q[0](1);
171+
}, 50);
172+
})();
173+
} else if (window.location.href.indexOf("old.reddit.com/user/") > -1) {
174+
void !(function () {
175+
document
176+
.querySelectorAll('[data-event-action="upvote"]')
177+
.forEach(function (o) {
178+
"upvote" === o.dataset.eventAction && o.click();
179+
}),
180+
document.querySelectorAll(".icon-upvote").forEach(function (o) {
181+
o.click();
182+
});
183+
})();
184+
} else {
185+
alert(`You need to be voting in a single sub or user page in OLD reddit for this to work!\nSWITCH TO OLD REDDIT!\n
186+
Go to: http://old.reddit.com/r/ and choose a subreddit or user to vote on!`);
187+
}
188+
}
189+
var upVoteIt =
190+
"<a style=color:#00FF00; href=# onClick=upVote() title=UpVote&nbsp;All&nbsp;(Works&nbsp;Only&nbsp;in&nbsp;OLD&nbsp;Reddit)>&uarr; UpVote All</a>";
191+
function downVote() {
192+
if (
193+
window.location.href.indexOf("old.reddit.com/r/") > -1 ||
194+
window.location.href.indexOf("old.reddit.com/u/") > -1
195+
) {
196+
(function () {
197+
var q = [];
198+
$(".down").each(function () {
199+
var that = this;
200+
var f = function (index) {
201+
$(that).trigger("click");
202+
$(that).trigger("mousedown");
203+
setTimeout(function () {
204+
if (q[index]) {
205+
q[index](index + 1);
206+
} else {
207+
if (downVoteTimer) {
208+
window.clearTimeout(downVoteTimer);
209+
}
210+
}
211+
}, 500);
212+
};
213+
q.push(f);
214+
});
215+
var downVoteTimer = window.setTimeout(function () {
216+
q[0](1);
217+
}, 50);
218+
})();
219+
} else if (window.location.href.indexOf("old.reddit.com/user/") > -1) {
220+
void !(function () {
221+
document
222+
.querySelectorAll('[data-event-action="downvote"]')
223+
.forEach(function (o) {
224+
"downvote" === o.dataset.eventAction && o.click();
225+
}),
226+
document.querySelectorAll(".icon-downvote").forEach(function (o) {
227+
o.click();
228+
});
229+
})();
230+
} else {
231+
alert(`You need to be voting in a single sub in OLD reddit for this to work!\nSWITCH TO OLD REDDIT!\n
232+
Go to: http://old.reddit.com/r/ and choose a subreddit`);
233+
}
234+
}
235+
var downVoteIt =
236+
"<a style=color:#00FF00; href=# onClick=downVote() title=DownVote&nbsp;All(Works&nbsp;Only&nbsp;in&nbsp;OLD&nbsp;Reddit)>&darr; DownVote All</a>";
237+
function stealth() {
238+
if (window.location.href.indexOf("old.reddit.com") > -1) {
239+
(function () {
240+
var newcss =
241+
".midcol, .thumbnail, .rank, .flairichtext, .flaircolordark, .linkflairlabel, .flaircolorlight, .res-flairSearch {display:none} .title {color:black !important} .title{font-size:120% !important} body {background-color:white}";
242+
if ("\v" == "v") {
243+
document.createStyleSheet().cssText = newcss;
244+
} else {
245+
var tag = document.createElement("style");
246+
tag.type = "text/css";
247+
document.getElementsByTagName("head")[0].appendChild(tag);
248+
tag[
249+
typeof document.body.style.WebkitAppearance == "string"
250+
? "innerText"
251+
: "innerHTML"
252+
] = newcss;
253+
}
254+
})();
255+
document.getElementsByClassName("side")[0].remove();
256+
document.getElementById("header").remove();
257+
document.getElementsByClassName("panestack-title")[0].remove();
258+
document.getElementsByClassName("menuarea")[0].remove();
259+
document.getElementsByClassName("usertext cloneable")[0].remove();
260+
document.getElementsByName("content")[0].remove();
261+
document.getElementsByClassName("footer-parent")[0].remove();
262+
} else if (window.location.href.indexOf("reddit.com") > -1) {
263+
(function () {
264+
(function () {
265+
var i,
266+
elements = document.querySelectorAll("body *");
267+
for (i = 0; i < elements.length; i++) {
268+
if (getComputedStyle(elements[i]).position === "fixed") {
269+
elements[i].parentNode.removeChild(elements[i]);
270+
}
271+
}
272+
})();
273+
})();
274+
275+
(function () {
276+
var e = document.getElementsByClassName("s7pq5uy-6") || "jspfgX";
277+
if (e[0].style.display == "none") {
278+
e[0].style.display = "block";
279+
} else {
280+
e[0].style.display = "none";
281+
}
282+
})();
283+
} else {
284+
alert(
285+
"You need to be on Reddit.com for this bookmarklet to work!\nStealth mode looks best on old.reddit.com!"
286+
);
287+
}
288+
}
289+
var stealthIt =
290+
"<a style=color:#00FF00; href=# onClick=stealth() title=This&nbsp;works&nbsp;best&nbsp;in&nbsp;OLD&nbsp;Reddit>Stealth Mode</a>";
291+
function coder() {
292+
(function () {
293+
var newcss =
294+
".midcol, .thumbnail, .rank, .flairichtext, .flaircolordark, .linkflairlabel, .flaircolorlight, .res-flairSearch {display:none} .title {color:green !important} .title{font-size:120% !important} body {background-color:black}";
295+
if ("\v" == "v") {
296+
document.createStyleSheet().cssText = newcss;
297+
} else {
298+
var tag = document.createElement("style");
299+
tag.type = "text/css";
300+
document.getElementsByTagName("head")[0].appendChild(tag);
301+
tag[
302+
typeof document.body.style.WebkitAppearance == "string"
303+
? "innerText"
304+
: "innerHTML"
305+
] = newcss;
306+
}
307+
})();
308+
document.getElementsByClassName("side")[0].remove();
309+
document.getElementById("header").remove();
310+
document.getElementsByClassName("panestack-title")[0].remove();
311+
document.getElementsByClassName("menuarea")[0].remove();
312+
document.getElementsByClassName("usertext cloneable")[0].remove();
313+
document.getElementsByName("content")[0].remove();
314+
document.getElementsByClassName("footer-parent")[0].remove();
315+
}
316+
var coderIt =
317+
"<a style=color:#00FF00; href=# onClick=coder() title=This&nbsp;only&nbsp;works&nbsp;in&nbsp;OLD&nbsp;Reddit>Coder Mode</a>";
318+
function baseTag() {
319+
var insertBase;
320+
var baseTag;
321+
insertBase = document.createElement("base");
322+
insertBase.id = "myBase";
323+
insertBase.innerHTML = "<base target=_blank>";
324+
container_block = document.getElementsByTagName("head")[0];
325+
container_block.appendChild(insertBase);
326+
}
327+
var NewTabIt =
328+
"<a style=color:#00FF00; href=# onClick=baseTag();return&nbsp;false; title=Opens&nbsp;all&nbsp;links&nbsp;in&nbsp;a&nbsp;new&nbsp;tab&nbsp;when&nbsp;clicked>OpenInNewTab</a>";
329+
function getVid() {
330+
var url = location.href;
331+
if (url.includes("old")) {
332+
var url = url.replace("old", "www");
333+
}
334+
window.open("https://redv.co/?url=" + url);
335+
}
336+
var downloadVid =
337+
"<a style=color:#00FF00; href=# onClick=getVid(); title=Download&nbsp;Reddit&nbsp;Videos>GetRedditVideo</a>";
338+
if (window.location.href.includes("old")) {
339+
var notice = "";
340+
var spacer = "<span style=color:#777>.......</span>";
341+
} else {
342+
var notice =
343+
"<br /><sub><br /><i style=font-style:italic;color:#00FFFF;cursor:pointer><a onClick=makeOld() id=demo onMouseOver=replaceText() onMouseOut=original()>This works best<br />in OLD REDDIT</a></i></sub>";
344+
var spacer = "<span style=color:#777>..........</span>";
345+
}
346+
function hideMenu() {
347+
document.getElementById("mymenu").remove();
348+
}
349+
function replaceText() {
350+
document.getElementById("demo").innerHTML =
351+
" Click to switch <br />to OLD REDDIT";
352+
}
353+
function original() {
354+
document.getElementById("demo").innerHTML =
355+
"This works best<br />in OLD REDDIT";
356+
}
357+
function makeOld() {
358+
var url = document.location.href;
359+
var url = url.replace("www", "old");
360+
var url = url.replace("new", "old");
361+
window.open(url, "_self");
362+
}
363+
function infoPop() {
364+
var a = `<div style:padding:10px;><img src=http://reddit.com/favicon.ico /><br />
365+
<h2>Welcome to the Reddit Toolkit!</h2>
366+
<ul>
367+
<li>Upvote all will up vote all all of the posts on a subreddit or even of an individual user. This will work even for subs that you are not subscribed to!<br />
368+
<i style=color:red>CAVEAT! Be careful - Reddit keeps counts of total votes on a sub and user pages. Overuse will mean your votes will not be counted. Abuse can get you shadowbanned!</i></li>
369+
<li>Downvote all will down vote all all of the posts on a subreddit or even of an individual user. This will work even for subs that you are not subscribed to!<br />
370+
<i style=color:red>CAVEAT! - See above!</i></li>
371+
<li>Old/New Reddit toggle. This will toggle between old and new Reddit. Most of these tools ONLY work in Old Reddit.</li>
372+
<li>Stealth Mode. This will hide much of the graphics and headers/footers that give away the fact that you are surfing Reddit. Often used by people who are at work.</li>
373+
<li>Coder Mode. Looks like you have some kind of coding interface open. Another way of reading Reddit when you are supposed to be doing something else!</li>
374+
<li>OpenInNewTab. Clicking this will not make any visible changes on the page, however, all of the links you click on will open in a new tab!</li>
375+
<li>GetRedditVideo - This will open an interface that will let you download a Reddit hosted video.</li>
376+
</ul><center><h2><a href=https://www.zazzle.com/cats_and_dogs/products>Cat Tax</a></h2></center></div>`;
377+
w = window.open("", "Links", "scrollbars,resizable,width=400,height=675");
378+
w.document.write(a);
379+
}
380+
var block_to_insert;
381+
var container_block;
382+
block_to_insert = document.createElement("div");
383+
block_to_insert.id = "mymenu";
384+
block_to_insert.innerHTML =
385+
`<a href=# onclick=hideMenu() title=Close style=font-weight:bold;color:#F00>&times;</a>' + spacer +'<a href=https://www.zazzle.com/cats_and_dogs/products><img src=https://www.reddit.com/favicon.ico height=15 width=15 /></a>' + spacer + '<a href=# onClick=infoPop() style=color:#FFF;font-weight:bold;size:150%; title=Information>&#9432;</a>
386+
<br /><hr />' + upVoteIt + '<br /><hr />'+ downVoteIt +'<br /><hr />'+switchIt+'<br /><hr />' + stealthIt + '<br /><hr />' + coderIt + '<hr/>'+ NewTabIt + '<br /><hr />` +
387+
downloadVid +
388+
notice;
389+
container_block = document.getElementsByTagName("body")[0];
390+
container_block.appendChild(block_to_insert);
391+
mymenu.setAttribute(
392+
"style",
393+
"height:240px; width:100px; border-radius:0px 0px 10px 0px; background-color:#000; color:red; float:left; font-size:12px; z-index:10000; display:block; overflow:visible; position:fixed; top: 0; padding:2px 5px;"
394+
);
395+
}
396+
} else {
397+
alert(
398+
"NOT REDDIT\nThis tool only works on Reddit.\nRedirecting you to Reddit.com"
399+
);
400+
window.open("http://old.reddit.com", "_self");
401+
}

manifest-firefox.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

popup/tabs.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,28 @@ const tabs = [
3232
s.similarWeb,
3333
s.search_sharedAccount,
3434
s.whatWebsiteStack,
35+
s.whois,
36+
s.viewWebMetaInfo,
3537
s.search_paperWhere,
3638
s.checkWebDie,
3739
s.downDetector,
3840
s.openWaybackUrl,
41+
s.archiveToday,
3942
],
4043
},
4144
{
4245
...CATEGORY.download,
43-
scripts: [s.download_video, s.download_image],
46+
scripts: [
47+
s.download_video2,
48+
s.download_video,
49+
s.download_image,
50+
s.showTheImages,
51+
],
4452
},
4553
{
4654
...CATEGORY.google,
4755
scripts: [
56+
// s.google_downloadDriveVideo,
4857
s.search_totalIndexedPages,
4958
s.search_googleSite,
5059
s.googleShortcuts,
@@ -123,7 +132,7 @@ const tabs = [
123132
},
124133
{
125134
...CATEGORY.automation,
126-
scripts: [s.scrollToVeryEnd],
135+
scripts: [s.getAllEmailsInWeb, s.performanceAnalyzer, s.scrollToVeryEnd],
127136
},
128137
{
129138
...CATEGORY.password,
@@ -136,23 +145,25 @@ const tabs = [
136145
{
137146
...CATEGORY.unlock,
138147
scripts: [
148+
s.showHiddenFields,
139149
s.viewCookies,
140150
s.removeCookies,
141151
s.enableTextSelection,
142152
s.reEnableContextMenu,
153+
s.paywallKiller,
143154
],
144155
},
145156
{
146157
...CATEGORY.webUI,
147158
scripts: [
148159
s.toggleEditPage,
149-
s.performanceAnalyzer,
150160
s.scrollByDrag,
151161
createTitle("--- View ---", "--- Xem ---"),
152162
s.listAllImagesInWeb,
153163
s.viewAllLinks,
154164
s.viewScriptsUsed,
155165
s.viewStylesUsed,
166+
s.cssSelectorViewer,
156167
s.viewPartialSource,
157168
createTitle("--- Remove ---", "--- Xoá ---"),
158169
s.removeColours,

scripts/archiveToday.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
export default {
2+
icon: `<i class="fa-solid fa-box-archive"></i>`,
3+
name: {
4+
en: "Archive the current Page online",
5+
vi: "Lưu trữ online trang hiện tại",
6+
},
7+
description: {
8+
en: "Creates an archive of the current page on archive.today.",
9+
vi: "Lưu trang web hiện tại lên archive.today",
10+
},
11+
blackList: [],
12+
whiteList: [],
13+
14+
func: function () {
15+
window.open(
16+
"https://archive.today/?run=1&url=" +
17+
encodeURIComponent(document.location)
18+
);
19+
},
20+
};

0 commit comments

Comments
 (0)