Tag Preview

Show tags on hover.

< Feedback on Tag Preview

Question/comment

§
Posted: 2020-10-20
Edited: 2020-10-20

Here is a fix for transparent background color.

Background color is rgba(0,0,0,0) on recent Firefox and Greasemonkey, so fix this: change Line 18 from...

background: window.getComputedStyle(document.getElementsByClassName('ido')[0]).background,

... to...

background: window.getComputedStyle(document.getElementsByTagName('BODY')[0]).backgroundColor,

I presume you could also do document.getElementsByTagName('HEAD')[0] and then access the background CSS set directly in the website's header, but I don't know how to do that, and in any case if the user for some weird reason changes the background, this is better.

HauffenAuthor
§
Posted: 2020-11-11
Edited: 2020-11-11

Just needed to tack on the Color to background, Firefox doesn't like implicit properties. Should be fixed, tested in Firefox with ViolentMonkey.

You can access the head tag, but because the CSS is read from an external file rather than coded in an in-line script, the point is kind of moot. However, ultimately, it wouldn't matter if you could read the CSS directly from the head tag, because it would be the same as the computed style of the element that we can read directly from the element, assuming no injected style scripts. Reading directly from the element also gives the added benefit of being able to reflect changes made in user style scripts, so you're not bound to the default color set by the site's master CSS file.

Post reply

Sign in to post a reply.