Skip to content

Instantly share code, notes, and snippets.

@magazov
Created April 21, 2015 12:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save magazov/934de662d60c9fb5fea9 to your computer and use it in GitHub Desktop.
Save magazov/934de662d60c9fb5fea9 to your computer and use it in GitHub Desktop.
// ==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]);
})
@ooker777
Copy link

It's not working. I have changed all http to https but it doesn't help. I'm on the latest Firefox on Windows 7.

@utkuerd
Copy link

utkuerd commented Oct 14, 2017

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