Restore "src" attribute of "img" TAGs

Dedicated board for extension releases/support threads

Moderators: FranklinDM, Lootyhoof

Forum rules
Please do not create new topics here unless you are an extension author in need of a dedicated releases&support thread!
User avatar
tellu-white
Moon lover
Moon lover
Posts: 76
Joined: 2022-03-08, 22:02

Restore "src" attribute of "img" TAGs

Unread post by tellu-white » 2022-11-08, 01:26

After receiving this feed back from "ltcomdata" (whom I thank for his appreciation):

https://forum.palemoon.org/viewtopic.php?f=46&t=28304#p233616

I decided to make a dedicated topic for this add-on:

Restore "src" attribute of "img" TAGs ( Version VII )

As I said in the topic linked above, the reason for making this add-on was the following:
I usually save web pages with "ScrapBook Plus". There are cases where not all images are saved. To solve this problem, I made an add-on that modifies the HTML code that prevents images from being saved.
In that post I also pointed out:
Of course, this add-on can be improved (is not perfect).
Now I also point out that some problems related to loading images in the page are very difficult to solve, like the one in the page below, where there is a TAG "amp-base-carousel":

https://amp.dev/
Moonchild » 2022-10-25

It's because they decided to use AMP which is a web component library that, well, uses Google's WebComponents :P
We don't support WebComponents (yet, or at least not fully, so it's disabled by default).
https://forum.palemoon.org/viewtopic.php?f=70&t=29006#p233360

However, for some problems that occur due to the use of the "amp-img" TAG there are satisfactory solutions, so in version VII of the Restore "src" attribute of "img" TAGs add-on ( the first one in this topic ) I added code that works for some pages with "amp-img" TAGs, like in the ones below:

https://www.heise.de/tipps-tricks/Excel-Tabellen-vergleichen-so-geht-s-4988585.html

https://www.heise.de/tipps-tricks/

These pages were brought up by "mseliger" in this post:

https://forum.palemoon.org/viewtopic.php?f=70&t=29006

Also in that post, "moonbat" offered a script for "Greasemonkey" to redirect the user to the "regular version of the page - a non amp version of the page". However, there are cases where there is no "a non amp version of the page". In such cases, my add-on may be useful.

***

In this latest version of the add-on I have also added code that tries to solve cases where there is no URL to the image except in a "noscript" TAG, as for example in this page:

https://www.diy.com/departments/lighting/indoor-lights/ceiling-lights/DIY579439.cat

As can be seen from the above, the usefulness of this add-on is not only limited to cases where saving the page (with images) is desired, but also covers some cases where images do not load in the pages viewed online.

With the hope that there will be users who will find this add-on useful, I would like to point out once again that this add-on is not a workaround for "all those web compatibility problems we keep facing" in relation to loading images on the page:
Moonchild » 2022-10-25

The interesting bit here is that some web research led me to the organization that actually drives all this web compatibility stuff we keep running into. It's the "OpenJS Foundation". Don't be fooled by te name or the fact it's been set up as a non-profit. This is all the big players come together to push the Javascript Storm that is actually favoring the Blink and V8 engine monoculture. Check out their governance team; note which companies they are employed by. https://openjsf.org/about/governance/
https://forum.palemoon.org/viewtopic.php?f=70&t=29006#p233360

***

Help:

1. Open the page you want to save & Click on Restore "src" attribute of "img" TAGs add-on button:
01.png
2. After click on Restore "src" attribute of "img" TAGs add-on button:
02.png
3. Save the page.

***

Restore "src" attribute of "img" TAGs add-on ( Version VII ).

Download link:

https://www.mediafire.com/file/zs68ey4qx8pfbvs/Restore_SRC_attribute_of_IMG_TAGs_before_saving_the_page__Version_VII.zip/file

User avatar
mseliger
Fanatic
Fanatic
Posts: 107
Joined: 2016-02-17, 10:53
Contact:

Re: Restore "src" attribute of "img" TAGs

Unread post by mseliger » 2022-11-08, 06:59

Thank you, tellu-white. Works like a charm. I also use ScrapBook for my information management - so this extension is very useful.
Mit freundlichen Grüßen / Greetings
Maria
---
Ich bin ein Westfale, und zwar ein Stockwestfale, nämlich ein Münsterländer – Gott sei Dank! füge ich hinzu ...
Annette von Droste zu Hülshoff, Bei uns zu Lande auf dem Lande

User avatar
tellu-white
Moon lover
Moon lover
Posts: 76
Joined: 2022-03-08, 22:02

Re: Restore "src" attribute of "img" TAGs

Unread post by tellu-white » 2022-11-08, 12:40

mseliger wrote:
2022-11-08, 06:59
I also use ScrapBook for my information management - so this extension is very useful.
I'm glad my add-on is useful to you.

ltcomdata
Apollo supporter
Apollo supporter
Posts: 37
Joined: 2015-06-28, 03:49
Location: WI

Re: Restore "src" attribute of "img" TAGs

Unread post by ltcomdata » 2023-01-25, 04:37

Hello:

I have come across another instance where your extension might be able to help.
In the PillarCatholic website the initial lead image does not load in Pale Moon (see viewtopic.php?f=70&t=28809).
When the relevant code is inspected, it appears that the website relies on a lazy load feature which seems to not be implemented yet in Pale Moon.
If I entirely delete the "img" "class" to be empty (but retain the quotation marks), the image is restored to the webpage.

It seems that this is the kind of thing that your extension is helpful in fixing.
I wonder how easy it would be to integrate a solution for this kind of problem into your extension.
If you have time, and are willing, that is.

Thanks!

Post Reply