javascript 未捕获的类型错误:无法在“CSSStyleSheet”上执行“insertRule”:需要 2 个参数,但只有 1 个参数

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20010347/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-27 17:31:12  来源:igfitidea点击:

Uncaught TypeError: Failed to execute 'insertRule' on 'CSSStyleSheet': 2 arguments required, but only 1 present

javascript

提问by Travis Skweres

Latest version of Google Chrome & Opera are throwing this error:

最新版本的 Google Chrome 和 Opera 抛出此错误:

Uncaught TypeError: Failed to execute 'insertRule' on 'CSSStyleSheet': 2 arguments required, but only 1 present.

未捕获的类型错误:无法在“CSSStyleSheet”上执行“insertRule”:需要 2 个参数,但仅存在 1 个。

Any ideas where this new bug is coming from and how to fix?

任何想法这个新错误来自哪里以及如何修复?

回答by jmadsen

More information: still understanding what this is, but someone pushed out bad code and hosed us all somehow:

更多信息:仍然理解这是什么,但有人推出了糟糕的代码并以某种方式给我们所有人带来了麻烦:

http://code.google.com/p/chromium/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Pri%20M%20Iteration%20ReleaseBlock%20Cr%20Status%20Owner%20Summary%20OS%20Modified&groupby=&sort=&id=319695

http://code.google.com/p/chromium/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Pri%20M%20Iteration%20ReleaseBlock%20Cr%20Status%20Owner%20Summary%20OS%20Modified&groupby= &sort=&id=319695



EDIT: this issue seems to have come from a recent Chromium update, which is breaking Neteye. Disabling Neteye for the moment seems to be the solution, while they iron out what to do or update Neteye

编辑:这个问题似乎来自最近的 Chromium 更新,它破坏了 Neteye。暂时禁用 Neteye 似乎是解决方案,而他们解决了要做什么或更新 Neteye

EDIT: this may supply a fix - seems like the PR never made it in https://github.com/bizzynut/jquery-plugins/commit/f000dc6347fbcabf4e3fd47732ddd97c73067755

编辑:这可能会提供一个修复 - 似乎 PR 从未在 https://github.com/bizzynut/jquery-plugins/commit/f000dc6347fbcabf4e3fd47732ddd97c73067755

SOLUTION: above fix works for solving NetEye issue

解决方案:上述修复适用于解决 NetEye 问题

activity-indicator.js line 150: - document.styleSheets[0].insertRule(rule); + document.styleSheets[0].insertRule(rule, 0);

activity-indicator.js 第 150 行:- document.styleSheets[0].insertRule(rule); + document.styleSheets[0].insertRule(rule, 0);