X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=xkcd_keyboard_nav.user.js;h=0cfdcefc168d2a161e8c4c3e659efaa5ebc2cea4;hb=f3c9f5e3e47553c1ce6235da9aa8211d0ef7892a;hp=b35c7cad2e7e97319d0a3f05d2955ad9959c261b;hpb=9ab44a6ce8f10aaa594e1272d8c46e40acdb04ab;p=xkcd-keyboard-nav.git diff --git a/xkcd_keyboard_nav.user.js b/xkcd_keyboard_nav.user.js index b35c7ca..0cfdcef 100644 --- a/xkcd_keyboard_nav.user.js +++ b/xkcd_keyboard_nav.user.js @@ -1,6 +1,6 @@ /* xkcd keyboard nav - Navigate xkcd with your keyboard * - * Copyright (c) 2015 Adrian Iain Lam + * Copyright (c) 2015-2018 Adrian Iain Lam * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it @@ -27,7 +27,7 @@ // @name xkcd keyboard nav // @namespace https://github.com/adrianiainlam // @description Navigate xkcd with your keyboard -// @version 1.0.3 +// @version 1.0.4 // @downloadURL https://gist.github.com/adrianiainlam/542dd0794a874ca31321/raw/xkcd_keyboard_nav.user.js // @updateURL https://gist.github.com/adrianiainlam/542dd0794a874ca31321/raw/xkcd_keyboard_nav.user.js // @include /^https?://xkcd\.com(/[0-9]+)?/?$/ @@ -39,9 +39,9 @@ function showTitleText() { var child = elem.children[0]; var newnode = document.createElement("p"); if(child instanceof HTMLImageElement) { - newnode.innerHTML = child.title; + newnode.appendChild(document.createTextNode(child.title)); } else if(child instanceof HTMLAnchorElement && child.children[0] instanceof HTMLImageElement) { - newnode.innerHTML = child.children[0].title; + newnode.appendChild(document.createTextNode(child.children[0].title)); } else { console.log("Title text not found by this script. Please file a bug report with URL"); }