为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

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

详细了解

Firefox generates uncaught exception NS_ERROR_XPC_BAD_CONVERT_JS when loading scripts with long lines

  • 3 个回答
  • 4 人有此问题
  • 1 次查看
  • 最后回复者为 dzeller

more options

I have an application that dynamically loads Javascript files via XMLHttpRequest when needed. Firefox is generating the following error when trying to load one of the files: Error: uncaught exception: [Exception... "Could not convert JavaScript argument" nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)"

The file it is trying to load has one really long line in it that is part of a library to display gauges. The line is 100920 characters long. If this single line is removed, the script will load properly without generating the error (but, of course, nothing works properly). The error also occurs when loading the script in the HTML "head" section as opposed to loading it dynamically in Javascript. This has been working fine in Firefox up until the latest update I did. I am currently running V12.0. Internet Explorer also works fine with no issues and is what I am having to currently use to access my application since it is now broken with Firefox.

I have an application that dynamically loads Javascript files via XMLHttpRequest when needed. Firefox is generating the following error when trying to load one of the files: Error: uncaught exception: [Exception... "Could not convert JavaScript argument" nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)" The file it is trying to load has one really long line in it that is part of a library to display gauges. The line is 100920 characters long. If this single line is removed, the script will load properly without generating the error (but, of course, nothing works properly). The error also occurs when loading the script in the HTML "head" section as opposed to loading it dynamically in Javascript. This has been working fine in Firefox up until the latest update I did. I am currently running V12.0. Internet Explorer also works fine with no issues and is what I am having to currently use to access my application since it is now broken with Firefox.

被采纳的解决方案

The following line in the library was causing the error in Firefox 11+ (specifically "HTMLElement.prototype.outerHTML"):

noNativeOuterHTML:typeof HTMLElement !="undefined"&& typeof HTMLElement.prototype.outerHTML=="undefined",

This was replaced with: typeof HTMLElement.outerHTML=="undefined" and now the library works properly with Firefox 11+.

定位到答案原位置 👍 2

所有回复 (3)

more options

There are a lot of packed JavaScripts around that do not have any line breaks in it, so I can't imagine that such a change would have passed unnoticed.


Start Firefox in Diagnose Firefox issues using Troubleshoot Mode to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance/Themes).

more options

Safe mode did not resolve the issue. I still get the error message. The library I am using is all packed on a single line. Unfortunately, I honed in on that as being the obvious issue since removing it make the error go away. Apparently there is actually an issue in the library itself that is causing this error, but the error message Firefox is presenting is pretty cryptic and doesn't help much in determining where the problem is. For now, I have gone back to Firefox V10 and everything is working again. It is very frustrating to have something that has worked fine for many years through versions of Firefox since V3 and IE since V7 and have it suddenly stop working with a browser update. I'll have to get with the vendor and see if it can be determined what is causing Firefox V11 and up to be having an issue with the code.

more options

选择的解决方案

The following line in the library was causing the error in Firefox 11+ (specifically "HTMLElement.prototype.outerHTML"):

noNativeOuterHTML:typeof HTMLElement !="undefined"&& typeof HTMLElement.prototype.outerHTML=="undefined",

This was replaced with: typeof HTMLElement.outerHTML=="undefined" and now the library works properly with Firefox 11+.