Firefox 显示损坏的图像

发布于 2024-08-11 00:23:06 字数 121 浏览 2 评论 0原文

在 Firefox 中,损坏的图像仅显示为空白。在白色背景上,无法区分无图像和损坏的图像。这使得识别损坏的图像变得难以识别并且无法纠正。

如何使损坏的图像像在 Internet Explorer 中一样产生 X?

In firefox a broken image appears as just a blank white space. On a white background there is no way to distinguish between no image and a broken image. This makes identifying broken images difficult to recognise and makes them go uncorrected.

How do I make it so that broken images produce an X like they do in Internet Explorer?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

空城缀染半城烟沙 2024-08-18 00:23:06

我知道这个问题不久前被问过,但我不久前写了一篇关于这个问题的博客文章,并认为它可能值得 添加链接,以防有人遇到它。

编辑 09/12/2013:

KatieK 在下面提出了关于直接在答案中添加信息的好观点,以下是使其正常工作所需的步骤,在截至 2013 年 12 月 (v28a2) 的最新夜间构建中仍然相关

1) 类型 <将 Strong>about:config 插入地址栏并接受警告

2) 搜索 browser.display.show_image_placeholders 并设置为 true

3) 搜索您的 Fx 配置文件UserContent-example.css 文件夹并将其重命名为 UserContent.css (如果示例文件不存在,您可以创建它)

4)将以下 css 添加到您的 UserContent.css 并重新启动 Firefox

/* Enable image placeholders */
@-moz-document url-prefix(http), url-prefix(file) {
  img:-moz-broken{
    -moz-force-broken-image-icon:1;
    width:24px;
    height:24px;
  }
}

I know this question was asked a while ago but I wrote a blog post on this issue a while back and thought it might be worth adding a link in case anyone falls across it.

Edit 09/12/2013:

KatieK made a good point below about adding the information directly in the answer, here are the required steps to get this working, still relevant in the latest nightly build as of Dec 2013 (v28a2)

1) type about:config into your address bar and accept the warning

2) search for browser.display.show_image_placeholders and set to true

3) search your Fx profile folder for UserContent-example.css and rename it to UserContent.css (if the example file doesnt exists you can just create it)

4) add the following css to your UserContent.css and restart Firefox

/* Enable image placeholders */
@-moz-document url-prefix(http), url-prefix(file) {
  img:-moz-broken{
    -moz-force-broken-image-icon:1;
    width:24px;
    height:24px;
  }
}
把回忆走一遍 2024-08-18 00:23:06

在 Firefox 中显示损坏图像图标的最佳解决方案 -
安装 Greasemonkey (https://addons.mozilla。 org/en-US/firefox/addon/greasemonkey/)并安装破碎图像图标脚本http://userscripts.org/scripts/show/104265)

The best solution to show broken image icon in Firefox -
install Greasemonkey (https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/) and install Broken Image Icon Script (http://userscripts.org/scripts/show/104265)

长发绾君心 2024-08-18 00:23:06

更好的是,从 Mozilla 附加组件中获取 Web 开发人员工具栏地点。安装完成后,只需转到“图像”>“找到破损的图像。

Even better, grab the Web Developer Toolbar from the Mozilla Add-ons site. Once you get it installed, simply go to Images > Find Broken Images.

半衾梦 2024-08-18 00:23:06

给出的所有解决方案都运行良好。只是另一种情况会导致图像损坏以及不同的解决方案。

您热链接图像。您无法控制最终返回 404 并希望向用户显示某些内容的图像。您可以使用 css 和显示图像的正确宽度/高度来防止这种情况。

// html code
<img class="external" src="http://externalserver.com/image.jpeg" width="300" height="200" />

// css
.external {
    background: url(path-to-file);
    -moz-force-broken-image-icon: 1; /* to make FF show the image */
}

您的背景文件将有一个十字或一条文字,说明该图像不再可用。只是一个想法。

希望有帮助。

All solutions given work well. There is just another situation where images will be broken and a different solution.

You hot-link images. You have no control on the images that will eventually return a 404 and want to display something to the user. That you can prevent with css and with the correct width/height of the image on display.

// html code
<img class="external" src="http://externalserver.com/image.jpeg" width="300" height="200" />

// css
.external {
    background: url(path-to-file);
    -moz-force-broken-image-icon: 1; /* to make FF show the image */
}

And your background file would have a cross or a text saying that the image is not available anymore. Just a thought.

Hope it helps.

jJeQQOZ5 2024-08-18 00:23:06

更好的解决方案可能是捕获返回 404 Not Found 错误的图像请求。

在 Firefox 中,您可以使用 Firebug 查看浏览器发出的所有 HTTP 请求。任何丢失的文件将在列表中显示为红色。要在 Internet Explorer 中实现相同的目的,您可以使用 Microsoft 的 Fiddler 工具。

A better solution might be to catch requests for images that return a 404 Not Found Error.

In Firefox you can use Firebug to look at all the HTTP requests being made by your browser. Any missing files will show up as red in the list. To achieve the same in Internet Explorer you could use Microsoft's Fiddler tool.

梦里兽 2024-08-18 00:23:06

我在 FF 中遇到问题,并且在确信包含图像时错过了检查。由于图像未上传到文件夹或其他原因,没有检测到这一点,并且 FF 由于 alt 为空而没有说什么。
我在这里发布了解决方案: http:// /www.satya-weblog.com/2010/07/display-broken-images-in-firefox.html

I faced problem in FF and missed to check when I was confident that images are included. That does not got detected either due to image not get uploaded to folder or some other reason and FF does not said anything due to empty alt.
Here I have posted the solution: http://www.satya-weblog.com/2010/07/display-broken-images-in-firefox.html

千紇 2024-08-18 00:23:06

该插件通过扫描当前访问的网站及其所有嵌入的样式表来检测不可用的图像:

https://addons.mozilla.org/de/firefox/addon/broken-image-finder/

this add-on detects unavailable images by scanning the currently visited website and all its embedded stylesheets:

https://addons.mozilla.org/de/firefox/addon/broken-image-finder/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文