Archived Comments (locked)
|
|
The following is an archive of comments made before threaded discussions was implemented (November 16th, 2008) |
|
|
Check out my script. |
|
|
Fixed. Using "parent" as a variable name appears to cause some unusual issues with GM 0.8 (perhaps related to the problem reported in ticket 108). Changed the script to use "parentNode" as the variable name instead, works. |
|
|
Sorry for the delay; I just got back from a trip. It's clear that the problem is caused by changes in Greasemonkey 0.8 and am still looking for the right solution. (I don't intend to use unsafeWindow if I can possibly avoid it. Doesn't seem it should be necessary for determining an element's parent node, anyway.) I'll update the script as soon as I get it worked out. |
|
|
Adding |
|
|
This script seems to have stopped working for me. Any idea why? |
|
|
I like it, but I like to read the comic before looking at the title. So I made two changes: I changed the GM_addStyle line to
That makes the comment text grey-on-grey until you hover over it. (The padding gives some extra space so the cursor doesn't have to cover the text.) Then I added
comic.title = ''; right after extracting the title, so Firefox won't display the title fragment over the image. |
|
|
Hmm... I'd originally used innerHTML specifically so that HTML would work if he used it, but considering it's extracting the text from an attribute anyway, that would be silly. :-) I doubt he'd ever include anything malicious in his titles... no, scratch that, he might, just to teach us all a lesson. Besides, if you're going to do something, you ought to at least do it properly, right? Fixed. |
|
|
You seem to have an escaping bug in this script. The line that reads: title.innerHTML = comic.title; should instead read: title.appendChild(document.createTextNode(comic.title)); That way, it'll work correctly even if the comic title happens to contain HTML tags (which, xkcd being xkcd, wouldn't surprise me at all). |
|
|
Nice one :). Especially with Firefox only showing a fragment of the title, this is nice. |
|
|
Perhaps you have an out-of-date copy of GreaseMonkey? To GM, .tld is "magic" which makes it work with .com, .net, .org, .us, etc. Because xkcd has registered multiple top-level domains (at least xkcd.com and xkcd.net, last I checked), I decided to use it rather than try to find and list them all. If you don't see the comic titles when you go to xkcd.com, try either updating GreaseMonkey or just add .com to your list of includes:
|
|
|
why is this using the tld domain? i can't access the site there. use .com please |