Transparent standalone images

By default, a transparency of an image opened in a separate tab is indicated by a gray color. This script replaces it with a checkerboard pattern

< Feedback on Transparent standalone images

Review: Good - script works

§
Posted: 2024-01-17

It doesn't work in Firefox.

Firstly, let me thank you for this solution.

I didn't know when browsers started to show gray background while viewing transparent images. It's so troublesome. Chrome Webstore had an extension called Image Transparency, but it's removed. So I started to seek an alternative solution and I found this script.

I installed this script via ViolentMonkey which is my chosen script management tool in Firefox, Edge, and Chrome. It does work in Edge and Chrome but not in Firefox. Nothing changed in Firefox.

Could you investigate this issue? I am using the latest Firefox Developer edition (122.0b9).

KonfAuthor
§
Posted: 2024-01-17

Could you investigate this issue?

I'll take a look

KonfAuthor
§
Posted: 2024-01-17
Edited: 2024-01-17
  1. The script works on a decently clean latest firefox (not developer edition).
  2. The script is simply looking at the page and if it consist of the single image node, it applies the fix. This means that if you have some extension that is adding some stuff to every page you've opened, the script won't work. I wish I could fix this in a simple way, but I didn't find it, so it needs to be manually adjusted to ignore the stuff from another extensions on the page, if any.
KonfAuthor
§
Posted: 2024-01-17
Edited: 2024-01-17

3.

There is some extension, looks like it is not the one you've mentioned. Also it seems like it's using another approach to detect if a page is just an image. But I don't like that it's just removing the background.

KonfAuthor
§
Posted: 2024-01-17

It's also doesn't work properly for Chrome. It applies the fix everywhere

§
Posted: 2024-01-18
Edited: 2024-01-18

The script works on a decently clean latest firefox (not developer edition).
The script is simply looking at the page and if it consist of the single image node, it applies the fix. This means that if you have some extension that is adding some stuff to every page you've opened, the script won't work. I wish I could fix this in a simple way, but I didn't find it, so it needs to be manually adjusted to ignore the stuff from another extensions on the page, if any.

Thank you for this explanation. I deactivated my Firefox addons one by one for 3 rounds then found 2 incompatible addons: Load Progress Bar and GlitterDrag Pro.

  • Load Progress Bar is 100% incompatible with this script. If I activate Load Progress Bar, then this script won't work at all.
  • GlitterDrag Pro partially works with this script. It works at first when you view the image. There are 2 situations that might be related to the browser cache:
    1. If I refresh (F5 on Windows) the page several times, the background goes back to gray. The weird thing is, if I continue refreshing the page for 1 or 2 or 3 times, the background might become checkerboard again.
    2. If I do a hard refresh (Ctrl + F5 on Windows), the background will always go back to gray.

After deactivating these 2 addons, your script works well in Firefox. Now I am trying to find alternative solutions for above 2 addons.

§
Posted: 2024-01-18
Edited: 2024-01-18

It's also doesn't work properly for Chrome. It applies the fix everywhere

I tried this extension (Transparent Standalone Images) before. It simply made the browser background black on my computer. I don't know if it's because I enabled the dark mode of Windows 11.

If you are viewing a transparent image that only contains black letters, charts or strokes, the webpage will become completely black. It's a no for me. So I skipped this extension.

KonfAuthor
§
Posted: 2024-01-18

Soon I'll make an update that is going to change the script behavior a bit. Instead of waiting for a page consisting of a single image node it will wait for a page with an image going first and being a top most. This will make a false positives for some websites, but nowadays almost nobody does a layout like that

KonfAuthor
§
Posted: 2024-01-18
Edited: 2024-01-18

Done. Maybe it will work with another extensions now. There are 2 ways to draw a checkerboard, and both are buggy in their own way. Choose one by setting it manually (screenshot)

KonfAuthor
§
Posted: 2024-01-18

Reinstall the script because a scheduled updates are too slow

§
Posted: 2024-01-18

Done. Maybe it will work with another extensions now. There are 2 ways to draw a checkerboard, and both are buggy in their own way. Choose one by setting it manually (screenshot)

Yes, it now works perfectly even with the 2 addons/extensions I mentioned above.

Thanks for your great work. Since this script is cross-platform, it will help a lot of people.


P.S. I just noticed you've changed the script name. So I removed the old script.

KonfAuthor
§
Posted: 2024-01-18

it will help a lot of people

yeah sure

Post reply

Sign in to post a reply.