Last active
October 22, 2017 02:12
-
-
Save cha0s/6786edc05d56fd5f4d927df954250737 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Fuck yummly | |
// @namespace yummly | |
// @include https://www.yummly.com/recipe/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
var loop = true, clicked = 0; | |
var reactId = null; | |
(function redirectToActualSite() { | |
var elm; | |
elm = document.querySelector('.recipe-show-full-directions'); | |
if (elm) { | |
if (!reactId) { | |
reactId = elm.dataset.reactid; | |
} | |
if (reactId != elm.dataset.reactid) { | |
clicked++; | |
} | |
if (clicked < 2) elm.click(); | |
} | |
elm = document.querySelector('.recipe-show-full-directions a.out-link'); | |
if (elm) { | |
var url = elm.protocol + '//' + elm.hostname + elm.pathname; | |
window.location = url; | |
loop = false; | |
} | |
if (loop) setTimeout(redirectToActualSite, 50); | |
})(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment