Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// ==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

This comment has been minimized.

Copy link

ooker777 commented Apr 18, 2017

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

This comment has been minimized.

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
You can’t perform that action at this time.