搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

How can I customize error messages.

  • 3 个回答
  • 1 人有此问题
  • 1 次查看
  • 最后回复者为 cor-el

more options

I have my own scripts and I would like to customize some error pages so it can take some customized actions. - Is this possible? - Where to start from? - Where to grap the error HTML page and where to place my script? - If not, what are the alternatives? can I perfrom this via an extension? But the problem is that I want to display my error page before the original error page appears. I could not find a way to do such thing as "page-mod" changes URLs and I could not find the error pages URL that get displayed. When error occurs, the same URL stays as it is in the URL bar without error page link.

I have my own scripts and I would like to customize some error pages so it can take some customized actions. - Is this possible? - Where to start from? - Where to grap the error HTML page and where to place my script? - If not, what are the alternatives? can I perfrom this via an extension? But the problem is that I want to display my error page before the original error page appears. I could not find a way to do such thing as "page-mod" changes URLs and I could not find the error pages URL that get displayed. When error occurs, the same URL stays as it is in the URL bar without error page link.

所有回复 (3)

more options

There are built-in about pages like these (about:neterror):

more options

I viewed the code. Neat but quite complex to be honest. Can you give a simple example please on how to specify the parameters for one error message, e.g. how to change the script. Where are these parameters read from? For example: "<title>&loadError.label;</title>", where is "loadError.label" is read from? how can I customize it?

more options

The entities are defined in the files that you can see are linked.

Customizing these pages is beyond the scope of this forum and best would be to ask advice at the Add-ons forum since you would need an extension. I do not know if this is possible with a WebExtension because otherwise your XUL based extension will stop working in Firefox 57+.