Show and reload broken images

The name explained it

Author
eight
Daily installs
2
Total installs
2,367
Ratings
12 0 1
Version
3.0.0
Created
2014-05-11
Updated
2021-02-17
License
MIT
Applies to
All sites

Show and Reload Broken Images

This script will force Firefox to show broken image icon when image failed loading, wether the image has alt attribute. You can press Alt+R to reload the broken images.

這個Script會強制Firefox顯示圖片載入失敗的圖示,即使圖片有alt屬性。 按Alt+R會重新載入失敗的圖片。

Example

Image without alt. you should see the icon by default.
<img src="https://i.am.broken">

Image with blank alt. By the default, you will see nothing.
<img alt="" src="https://i.am.broken">

Image with alt attribute. You should see the text in alt attribute.
<img alt="There used to be a image, but now it is broken" src="https://i.am.broken">

before

After installing the script:

after

Bookmarklet

If you just want to reload broken images, you can use the following code as the bookmarklet:

javascript:void(!function()%7Bfor(const%20o%20of%20document.images)o.complete%26%26!o.matches(%22%5Bsrc%5D%3A-moz-broken%22)%7C%7C(o.src%2B%3D%22%23%22)%7D()%3B)

Changelog

  • 3.0.0 (Feb 17, 2021)

    • Rewrite in ES6.
    • Add a bookmarklet to README.
  • 2.2.1 (Apr 4, 2016)

    • Hide icon if !image.src.