1
0
Fork 0
mirror of https://github.com/Phantop/dotfiles synced 2025-11-29 15:55:48 +00:00

Qute: clean up greasemonkey scripts

This commit is contained in:
Phantop 2019-04-07 22:39:50 -04:00
parent 37fc9b831c
commit f96dbf9870
9 changed files with 5364 additions and 6837 deletions

File diff suppressed because one or more lines are too long

View file

@ -1,110 +0,0 @@
// ==UserScript==
// @name MoreCAPTCHA
// @namespace https://eugenox.appspot.com/
// @description Speeds up solving Google reCAPTCHA challenges by shortening transition effects and providing continuous selection ability.
// @version 1.2
// @author Eugene Nouvellieu <eugenox_gmail_com>
// @license GNU General Public License
// @include https://www.google.com/recaptcha/api2/bframe?*
// @run-at document-start
// @grant unsafeWindow
// @homepageURL https://eugenox.appspot.com/script/morecaptcha
// ==/UserScript==
// Copyright (C) 2017 Eugene Nouvellieu <eugenox_gmail_com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
var SPEED = 5;
var selector = {
selecting: undefined,
handle: function(event) {
var tiles = new Set(document.querySelectorAll('#rc-imageselect td')), tile = event.target;
while (tile && ! tiles.has(tile)) {
tile = tile.parentNode;
}
if (tile) {
event.stopPropagation();
event.preventDefault();
var selected = 'selected' in tile.dataset && tile.dataset.selected == 'true';
if (this[event.type](selected)) {
tile.dataset.selected = this.selecting;
tile.firstElementChild.click();
}
}
},
mouseover: function(selected) {
return ! (this.selecting === undefined || this.selecting === selected);
},
mousedown: function(selected) {
this.selecting = ! selected;
return true;
},
mouseup: function(selected) {
this.selecting = undefined;
return false;
}
};
window.addEventListener('load', function(event) {
var sheet = document.body.appendChild(document.createElement('style')).sheet;
sheet.insertRule(
'.rc-imageselect-table-33, .rc-imageselect-table-42, .rc-imageselect-table-44' +
'{ transition-duration: ' + (1 / SPEED) + 's !important }', 0);
sheet.insertRule(
'.rc-imageselect-tile' +
'{ transition-duration: ' + (4 / SPEED) + 's !important }', 1);
sheet.insertRule(
'.rc-imageselect-dynamic-selected' +
'{ transition-duration: ' + (2 / SPEED) + 's !important }', 2);
sheet.insertRule(
'.rc-imageselect-progress' +
'{ transition-duration: ' + (1 / SPEED) + 's !important }', 3);
sheet.insertRule(
'.rc-image-tile-overlay' +
'{ transition-duration: ' + (1 / SPEED) + 's !important }', 4);
var handler = selector.handle.bind(selector);
document.body.addEventListener('mouseover', handler, false);
document.body.addEventListener('mousedown', handler, false);
document.body.addEventListener('mouseup', handler, false);
});
function publish(func) {
if (typeof exportFunction == 'function') {
return exportFunction(func, unsafeWindow);
}
return func;
}
var __setTimeout = unsafeWindow.setTimeout.bind(unsafeWindow);
unsafeWindow.setTimeout = publish(function(callback, delay) {
return __setTimeout(callback, Number(delay) / SPEED);
});

View file

@ -1,186 +0,0 @@
// ==UserScript==
// @name Reddit Overwrite
// @namespace Reddit
// @description Overwrites your Reddit comments to protect people from stalking, doxxing, and profiling you. Also, Reddit does not truly delete anything, but since they don't keep versions this better protects you. To use it, login to Reddit, click your username, go to comments, click on the OVERWRITE button. It is MUCH more efficient if you use RES and scroll to your oldest comment. If you are migrating accounts, you can move your subs by going to reddit.com/subreddits, and copying the link on the right.
// @include https://*.reddit.com/*
// @include http://*.reddit.com/*
// @version 1.4.8
// @run-at document-start
// ==/UserScript==
unsafeWindow.to_delete = [];
unsafeWindow.num_user_comments = 0;
unsafeWindow.deleted = 0;
unsafeWindow.span = '';
unsafeWindow.user = '';
unsafeWindow.delete_comment = function(thing_id, from_delete_all)
{
try{
var thing = document.querySelector("input[name='thing_id'][value='" + thing_id + "']");
var status = thing.parentNode.querySelector("div.usertext-edit > div.bottom-area > div.usertext-buttons > span.status").innerHTML;
var error = false;
if ((status.indexOf("error") != -1) || (status.indexOf("submitting") != -1)){
error = true;
} else {
// var del_form = thing.parentNode.parentNode.querySelector("ul.buttons > li > form.del-button");
// unsafeWindow.toggle(del_form.querySelector("span.main > a"));
// del_form.querySelector("span.error > a.yes").click();
unsafeWindow.deleted++;
}
if (from_delete_all){
if (unsafeWindow.to_delete.length != 0)
{
unsafeWindow.span.innerHTML = "OVERWRITING COMMENT " + (unsafeWindow.deleted + 1) + " OF " + unsafeWindow.num_user_comments;
var next_thing_id = unsafeWindow.to_delete.pop();
unsafeWindow.setTimeout(unsafeWindow.overwrite_comment, 2000, next_thing_id, from_delete_all);
}
else
{
if (unsafeWindow.num_user_comments - unsafeWindow.deleted != 0){
unsafeWindow.num_user_comments = unsafeWindow.num_user_comments - unsafeWindow.deleted;
UpdateDeleteAllSpan();
unsafeWindow.span.innerHTML = "<span>Failed to overwrite " + unsafeWindow.num_user_comments + " comments</span><br>" + unsafeWindow.span.innerHTML;
} else
unsafeWindow.span.style.display = 'none';
}
} else {
if (error)
alert("Failed to overwrite your comment. Overwrite aborted.");
else
unsafeWindow.num_user_comments--;
UpdateDeleteAllSpan();
}
return (error ? -1 : 0);
}catch(er){
alert(er);
if (from_delete_all) unsafeWindow.location.reload();
return -99;
}
}
unsafeWindow.overwrite_comment = function(thing_id, from_delete_all)
{
try{
var edit_form = document.querySelector("input[name='thing_id'][value='" + thing_id + "']").parentNode;
edit_form.querySelector("div.usertext-edit > div.bottom-area > div.usertext-buttons > button.cancel").click();
var edit_btn = edit_form.parentNode.querySelector("ul > li > a.edit-usertext");
if (edit_btn) edit_btn.click();
var edit_textbox = edit_form.querySelector("div.usertext-edit > div > textarea");
var repl_str = '';
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz><.-,+!#$%^&*();:[]~";
// for(var x = 0; x < edit_textbox.value.length; x++){
// if (edit_textbox.value.substr(x,1) == '\n'){
// repl_str += '\n';
// }else{
// var rnum = Math.floor(Math.random() * chars.length);
// repl_str += chars.charAt(rnum, 1);
// }
// }
var sumting = '^^^^^^^^^^^^^^^^' + Math.random();
var sumtingtr = sumting.substring(0,22);
var sumting2 = '' + Math.random();
var sumtingtr2 = sumting2.substring(2,7);
edit_textbox.value = "deleted " + sumtingtr + " [^^^What ^^^is ^^^this?](https://pastebin.com/FcrFs94k/" + sumtingtr2 + ")";
edit_form.querySelector("div.usertext-edit > div.bottom-area > div.usertext-buttons > button.save").click();
unsafeWindow.setTimeout(unsafeWindow.delete_comment, 2000, thing_id, from_delete_all);
return 0;
}catch(e){
alert("Error interacting with overwrite form: " + e);
return -99;
}
};
unsafeWindow.delete_all = function()
{
try{
unsafeWindow.num_user_comments = 0;
unsafeWindow.deleted = 0;
unsafeWindow.to_delete = [];
var comments = document.querySelectorAll("a.author");
for (var i = 0; i < comments.length; i++)
{
if (comments[i].innerHTML != unsafeWindow.user) continue;
var thing_id = comments[i].parentNode.parentNode.querySelector("form.usertext > input[name='thing_id']").value;
if (unsafeWindow.to_delete.indexOf(thing_id) == -1){
unsafeWindow.to_delete.push(thing_id);
unsafeWindow.num_user_comments++;
}
}
unsafeWindow.span.innerHTML = "TRYING TO Overwrite COMMENT 1 OF " + unsafeWindow.num_user_comments;
var next_thing_id = unsafeWindow.to_delete.pop();
unsafeWindow.overwrite_comment(next_thing_id, true);
} catch(e){
alert("YOU ARE MOST LIKELY NOT ON THE COMMENTS TAB! /n/n Error trying to delete all your comments.\nError: " + e + " Stack:" + e.stack);
unsafeWindow.location.reload()
}
};
function add_delete_links(ev)
{
unsafeWindow.user = document.querySelector("span.user > a:not(.login-required)").innerHTML;
if (!unsafeWindow.user){return;}
var comments = document.querySelectorAll("a.author");
unsafeWindow.num_user_comments = 0;
for (var i = 0; i < comments.length; i++)
{
if (comments[i].innerHTML != unsafeWindow.user) continue;
try{
var main_parent = comments[i].parentNode.parentNode;
var thing_id = main_parent.querySelector("form > input[name='thing_id']").value;
var list = main_parent.querySelector("ul.flat-list");
if (list.querySelector("li.secure_delete")) continue;
unsafeWindow.num_user_comments++;
var addedlink = document.createElement("li");
addedlink.setAttribute('class', 'secure_delete');
var dlink = document.createElement("a");
dlink.setAttribute('class','bylink secure_delete');
dlink.setAttribute('onClick','javascript:var ret = overwrite_comment("' + thing_id + '", false);');
dlink.setAttribute('href', 'javascript:void(0)');
// dlink.appendChild(document.createTextNode('SECURE DELETE'));
addedlink.appendChild(dlink);
main_parent.querySelector("ul.flat-list").appendChild(addedlink);
}catch(e){}
}
unsafeWindow.span = document.createElement("span");
unsafeWindow.span.setAttribute('class', 'nextprev secure_delete_all');
UpdateDeleteAllSpan();
}
function UpdateDeleteAllSpan()
{
if (unsafeWindow.num_user_comments){
unsafeWindow.span.innerHTML = "";
var dlink = document.createElement("a");
dlink.setAttribute('class','bylink');
dlink.setAttribute('onClick','javascript:return delete_all()');
dlink.setAttribute('href', 'javascript:void(0)');
dlink.appendChild(document.createTextNode('OVERWRITE ALL visible comment(s) on this page - MAKE SURE YOU ARE ON THE COMMENTS TAB. It is also HIGHLY recommended to use Reddit Enhancement Suite with the Never Ending Reddit feature to extend the comments as far down as possible.'));
unsafeWindow.span.appendChild(dlink);
document.querySelector("div.content").insertBefore(unsafeWindow.span,document.querySelector("div.content").firstChild);
} else if (unsafeWindow.span != null) {
unsafeWindow.span.style.display = 'none';
}
}
window.addEventListener("DOMContentLoaded",add_delete_links, false);

View file

@ -1,71 +0,0 @@
// ==UserScript==
// @name EmuParadise Download Workaround
// @version 1.2.1
// @description Replaces the download button link with a working one
// @author infval (Eptun)
// @match https://www.emuparadise.me/*/*/*
// @grant none
// ==/UserScript==
// https://www.reddit.com/r/Piracy/comments/968sm6/a_script_for_easy_downloading_of_emuparadise_roms/
(function() {
'use strict';
// Others: 50.7.189.186
const ipDownload = "50.7.92.186";
const urlFirstPart = "http://" + ipDownload + "/happyxhJ1ACmlTrxJQpol71nBc/";
var platform = document.URL.split("/")[3];
if (platform == "Sega_Dreamcast_ISOs") {
let downs = document.querySelectorAll("p > a[title^=Download]");
for (let i = 0; i < downs.length; i++) {
let findex = 9; // "Download X"
let lindex = downs[i].title.lastIndexOf(" ISO");
downs[i].href = urlFirstPart + "/Dreamcast/" + downs[i].title.slice(findex, lindex);
}
}
// match https://www.emuparadise.me/magazine-comic-guide-scans/%NAME%/%ID%
else if (platform == "magazine-comic-guide-scans") {
const webArchiveURL = "https://web.archive.org/web/2016/";
let down = document.querySelectorAll("#content > p")[0];
down.innerHTML = "Getting Download URL...";
let req = new XMLHttpRequest();
req.open('GET', webArchiveURL + document.URL, false);
req.send(null);
if (req.status == 200) {
let lindex = req.responseText.indexOf("Size: ");
let findex = req.responseText.lastIndexOf("http://", lindex);
let urlLastPart = req.responseText.slice(findex, lindex).match(/\d+\.\d+\.\d+\.\d+\/(.*)"/)[1];
urlLastPart = urlLastPart.replace(/ /g, "%20"); // encodeURI() changes #, e.g. Sonic - The Comic Issue No. 001 Scan
down.innerHTML = "<a href=" + urlFirstPart + urlLastPart + ">Download</a>";
}
else {
let info = document.querySelectorAll("#content > div[align=center]")[0];
let filename = info.children[0].textContent.slice(0, -5); // "X Scan"
let cat = {
"Gaming Comics @ Emuparadise": "may/Comics/",
"Gaming Magazines @ Emuparadise": "may/Mags/"
}[info.children[1].textContent] || "";
// URLs with # except The Adventures Of GamePro Issue
down.innerHTML = "Error when getting URL: " + webArchiveURL + document.URL
+ "<div>Try "
+ "<a href=" + urlFirstPart + cat + encodeURIComponent(filename) + ".cbr" + ">cbr</a> or "
+ "<a href=" + urlFirstPart + cat + encodeURIComponent(filename) + ".rar" + ">rar</a>"
+ "</div>";
}
}
else {
let id = document.URL.split("/")[5];
let downloadLink = document.getElementsByClassName("download-link")[0];
let div = document.createElement("div");
div.innerHTML = `<a target="_blank" href="/roms/get-download.php?gid=` + id
+ `&test=true" title="Download using the workaround script">Download using the workaround script</a>\
(Middle-click or Right-click -> New tab/window)`;
downloadLink.insertBefore(div, downloadLink.firstChild);
}
})();

File diff suppressed because one or more lines are too long

View file

@ -1,67 +0,0 @@
// ==UserScript==
// @author @leoncastro
// @namespace https://github.com/leoncastro
// @name openload
// @version 0.13.2
// @description Remove anti-adblock, ads, popups and timer waits, and show direct download link
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAA/FBMVEUAAAAeP2MAmNkAoN8hNlgSSWwXLUgEITELKT8OMEkAn94Ant4AmtsAldQBW4MFh8YAktQBicxjT5sAnt4AX4lEcbUTeLBgVqBcXKMAnNxMS4pKbbEuQGwAmtoAY44xebwAk9QGjM1jT5tcTZUPM01jT5s7OGZfWKEAaJUAod8Ak9VYYqhSZKgVg8Ujf8AKSm4Agr5mPZRmPZRmPZRlR5gAod8AldNXXKEAltQAjMcAmNVWZKpeWaJUZqtKbbE+dbg+dLdEcLM7d7omgMExersAk9RgVqA7aKUAod8Ak9UAn99lR5gAm9wJhshRaa0ue74mgMEAjdBmPZQ7d7qePASIAAAASHRSTlMAOP75GiksAgcPxb3QS0Nh0+T+0hj+Yv796m3PSLNc0eF0vYgg7l/DOPDs/ejo11dV+LpM8et8qaduicHV0L7Jrer75omU6GL8xLQIAAABaklEQVR42u1S2XaCMBQMaxJAAcUFRcG673Zzb9VWW4Pi0v7/vzSCcDz9hfY+3pnMmZkb8IcG8YIoVNDtQhRFPlyg+LQgy3JhE4fBAjLr5evrbFS2fAqeJDl3v9+zrDbwGShtv6VSh0M7O89hipearsuZTotliaMiAFH6/fidWnU67WymShmx5pZLpjHAaY2QggiQ2j0dbQrg3DyTeHoE8nYrNXzpuOZseKjq3sm2Aiv1xO4BcNvnIrp66wtwoHtez4KB+1p1dw+oABPFgwON4v0wn3i3+6KEQiXCY9rZ0yMcVAKCJIaFUPysFxGGNwqBh/A9Oeuqoa6ZWw80hRykoDjRSzDePdnMTQragysVDWSoCiGtEr4QjotPHvG1ut8DnnKuayYVxWRJa4ghrZY2ucrnXzrZTKKMAcRD0w1u4UwQBJeue9dbfJR56F9zLCmKIo0bYTxmuaAKs5GFwvyGIAgG/PVB6Ov/ieYHpLEydStkqm4AAAAASUVORK5CYII=
// @include http://openload.co
// @include /^(https?:)?\/\/(openload\.co|oload\.fun)\/*.*/
// @compatible firefox+greasemonkey(3.17)
// @compatible firefox+tampermonkey
// @compatible chrome+tampermonkey
// @grant none
// @run-at document-start
// ==/UserScript==
(function(){
//
// @run-at document-start
//
window.adblock=false;
window.adblock2=false;
window.turnoff=true;
window.open=function(){};
//
// @run-at document-end
//
function onready(fn){if(document.readyState!='loading')fn();else document.addEventListener('DOMContentLoaded',fn);}
onready(function(){
if( document.location.href.match(/\/embed\//) || $('#realdl>a') )
{
$('#btnView').hide();
$('#btnDl').hide();
$('.dlButtonContainer').show();
$('h3.dlfile.h-method').hide();
$('.col-md-4.col-centered-sm *').remove();
$('#mgiframe,#main>div[id]').remove();
$('#downloadTimer').hide();
$('#mediaspace_wrapper').prepend( $('<div/>').attr('id', 'realdl')
.attr('style', 'position: absolute; top: 0 ; left: 0 ; right: 0; text-align: center; z-index: 9999; background-color: #000; padding: .5em 0;')
.on('mouseenter', function(){ $(this).fadeTo(500, 1); }).on('mouseleave', function(){ $(this).fadeTo(500, 0); })
.append( $('<a/>').attr('href', '').attr('style', 'color: #fff; text-decoration: none; -moz-user-select: none;').text('FREE DOWNLOAD') )
.append( $('<span/>').attr('style', 'color: #fff; padding-left: 1em;').attr('id', 'steamcopy') ) );
$('#realdl').show();
var streamurl_tmr = setInterval(function(){
// <@snippet author="https://greasyfork.org/forum/profile/daedelus" src="https://greasyfork.org/forum/discussion/36362/x">
var streamurl_src;
$('p[id]').each(function(){
streamurl_src = streamurl_src || ($(this).text().match(/^[\w\.~-]+$/) && $(this).text().match(/~/)) ? $(this).text() : streamurl_src;
});
// </@snippet>
if( streamurl_src )
{
var streamurl_url = location.origin + '/stream/' + streamurl_src;
$('#realdl a').attr('href', streamurl_url);
$('#steamcopy').text( streamurl_url );
$('#videooverlay').click();
clearInterval(streamurl_tmr);
}
},100);
}
window.onclick=function(){};
document.onclick=function(){};
document.body.onclick=function(){};
});
})();

File diff suppressed because it is too large Load diff