首页 > Firefox > 「Firefox脚本」Image fix and linkify -- 显示和重新加载中断的图像

「Firefox脚本」Image fix and linkify -- 显示和重新加载中断的图像

2009年12月1日
阅读评论 发表评论

Script Summary:
Show and reload broken images, and linkify images.
Version: 1.3.3

does not show placeholder for a broken or missing image, instead, it relies on the "alt" attribute to give alternative messages when the image is not available. This is a requirement for XHTML 1.0 Transitional doctype. Unfortunately, many images do not follow this rule, and people may not even know there is a image in the page. Sometimes, the server of the image is just temporarily unavailable due to heavy load, and the service is restored in several seconds. It is an unpleasant experience to reload the whole web page just for one missing image.

This script replaces every broken image with the default broken icon (resource://gre/res/broken-image.gif), and does nothing for good images. User can use the Greasemonkey user menu to inform the script to reload all missing images. This script also skips the images which have their own error-handling functions.

You can replace the broken icon with any image you want by assigning the broken_icon variable to a vaild URI. It can be a URL starting with "http://", or the data URL scheme such as "data:image/png;base64,< data >". Please refer this page for more information about the data URL scheme.

This script has the ability to linkify unclickable images by adding onclick event to the img nodes. If the image is originally clickable, the script skips. This feature is useful if the image is explicitly reduced and user wants to view the original size.

Options

Open the source code to change these options:

    * use_fail_safe: set this to "true" if you want to show and reload broken images . disable with "false". (default true)
    * do_linkify: set this to "true" if you want to linkify unclickable images. (default true)
    * link_in_new_tab: when linkification is enabled, set this to "true" to link the images in a new tab. (default true)
    * link_force_no_border: when linkification is enabled, set this to "true" if you do not like border around images. (default true)
    * min_dimension: if the width OR the height of an img node is smaller than this value, it will be skipped in the fail safe function. However, if the image itself is tiny, this option will not take effect. (default 10 pixels)
    * key_shortcut: use this option to enable/disable keyboard shortcut (alt+r). (default enabled)

Please open the script file to change the options.

Known issue

This script has compatibility issue with imageLoader. Bad image links will be rendered as the broken icon if this script is executed after imageLoader. Please move this script to somewhere BEFORE imageLoader in the Greasemonkey script management window.

Alternative

If you just want to show broken images, you can try the following CSS:

@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document url-prefix(http), url-prefix(https), url-prefix(file) { img:-moz-broken { -moz-force-broken-image-icon: 1 !important; width: 24px; height: 24px; } }

 

Use it with userContent.css or Stylish. There are existing Stylish items, such as Show broken image placeholders or Show Broken Images.

Version history

1.3.3 on 04/22/2009:

- Add keyboard shortcut option (alt+r).

1.3.2 on 04/15/2009:

- Add option to skip tiny img nodes in fail safe function.

1.3.1 on 04/14/2009:

- Fix bug in reload function.

1.3 on 04/11/2009:

- Refactor fail safe code for higher compatibility.

1.2.6 on 04/09/2009:

- Fix XPath bug in 1.2.5.

- Ignore images with no src attribute for linkification

1.2.5 on 04/07/2009:

- Ignore images with no src attribute for fail safe.

1.2.4 on 03/30/2009:

- Fix fail safe bug in version 1.2.3.

1.2.3 on 03/26/2009:

- Use onclick instead of hyperlink to linkify images.

1.2.2 on 03/16/2009:

- Fix false linkification on image nodes who have onclick event.

1.2.1 on 03/14/2009:

- Only linkify images whose ancestor nodes are not anchors or have onclick event.

1.2 on 03/13/2009:

- Rewrite the script with XPath, simplify code (Thanks cDkPAEz for suggestion).

- Add option to force no border for linked images.

- Fix one-level onclick event problem.

1.1 on 05/18/2008:

- Rewrote the script to support 3.

1.0.2 on 05/07/2008:

- Added "Reload missing images" function (Greasemonkey user script menu).

1.0.1 on 03/30/2008:

- Fixed problem when an image is assigned some events, such as onClick or onMouseDown. This problem may cause some script-based pages malfunction.

1.0 on 03/14/2008:

- This script is incompatible with Windows Live Hotmail. I added it in the exclude list. If you find any other incompatible site, please tell me. Thank you!

附件下载

官方原版直接安装
下载说明:「语言:中文/English」「分享者:Grayciel

1、建议购买特价正版! 勿用于商业用途!使用前先自行杀毒! 建议购买特价正版!

2、有小部分需要解压密码,请输入www.my219.cn

3、如果您下载的文件出现无法下载、解压不了或者文件受损,请选择其他下载点重新下载,资源外链不保证时效长短。

Rand Posts:

Related Posts:

作者: Grayciel 分类: Firefox 标签: ,
本文链接地址:[http://www.my219.cn/archives/62078]
本文分享与收藏:DeliciousQQ书签Google豆瓣校内开心新浪九点鲜果AddThis更多 »
声明:本站遵循 [署名-非商业性使用-相同方式共享 3.0] 共享协议. 转载请注明转自[软件集散地]

本站Rss订阅地址:[RSS订阅《墙内》][RSS订阅《墙外》][RSS订阅《墙外》][Rss邮箱订阅地址]

  1. 本文目前尚无任何评论.
  1. 本文目前尚无任何 trackbacks 和 pingbacks.