Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaredrummler/539c4e9f1d1340b094e85f3df9fe4f53 to your computer and use it in GitHub Desktop.
Save jaredrummler/539c4e9f1d1340b094e85f3df9fe4f53 to your computer and use it in GitHub Desktop.
Redirect to project pages on android-arsenal.com. Saves a click.
// ==UserScript==
// @name android-arsenal-adblock-placeholder-remover.user.js
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Remove adBlock placeholders. Guilt++
// @author Jared Rummler
// @match https://android-arsenal.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
document.querySelectorAll('div[id^=adsBlock]').forEach(function(e) {
e.parentNode.parentNode.removeChild(e.parentNode);
});
})();
// ==UserScript==
// @name android-arsenal-redirects.user.js
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Redirect to project pages. Saves a click.
// @author Jared Rummler
// @match https://android-arsenal.com/details/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
//document.querySelectorAll("a[href^='https://github.com']").forEach(function(e) {
document.querySelectorAll("a").forEach(function(e) {
var parent = e.parentElement;
if (parent !== null) {
var previousElement = parent.previousElementSibling;
if (previousElement !== null) {
if (previousElement.innerText === 'Link') {
console.log('Redirecting to ' + e.href);
window.location.replace(e.href);
}
}
}
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment