Created
April 21, 2015 12:50
-
-
Save magazov/934de662d60c9fb5fea9 to your computer and use it in GitHub Desktop.
This file contains 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 Explain XKCD | |
// @namespace http://xkcd.com/ | |
// @version 1 | |
// @description just add explain button | |
// @author Ilgiz Magazov | |
// @match http://xkcd.com/* | |
// @grant none | |
// ==/UserScript== | |
$('.comicNav').each(function(index) { | |
var btn = '<a rel="answer" href="http://explainxkcd.com' + document.location.pathname + '" accesskey="e">Explain</a>'; | |
var li = document.createElement('li'); | |
li.innerHTML = btn; | |
this.insertBefore(li, this.children[3]); | |
}) |
Add below line to header to get jQuery
// @require http://code.jquery.com/jquery-3.2.1.min.js
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's not working. I have changed all
http
tohttps
but it doesn't help. I'm on the latest Firefox on Windows 7.