LoginSignup
1
1

More than 3 years have passed since last update.

GoogleTranslate関連のChrome拡張が入っているとconsoleでエラーがでる。

Last updated at Posted at 2019-02-12

状況としては、
Reactで自作のアイコンと文字列が並んだボタンコンポーネントを作ってChromeで押して確認してみたら、
アイコン部分を押したときだけエラーがでました。(firefoxはでませんでした。)
エラー内容は以下です。

Uncaught TypeError: e.target.className.indexOf is not a function
    at HTMLDocument.mouseup (translator.js:430)

エラー内容はonmouseupを使っているわけでもないのでよくわからなかったのですが、
調べてみたら以下の記事が見つかりました。
https://medium.com/@amir.harel/a-b-target-classname-indexof-is-not-a-function-at-least-not-mine-8e52f7be64ca

結論としてはGoogleTranslateのChrome拡張機能が影響しているとのことでした。
実際ぼくの環境には"ImTranslator"という拡張機能が入っていたので、削除してみたら無事エラーはでなくなりました。

上の記事の方はGoogle Translate用のGoogleChrome拡張機能をインストールしたユーザーではこの記事を無視する条件を追加したようですが、
そのやり方はわかりません!

前にも翻訳の拡張機能で何かエラーが起こった記憶があるので、そこらへん注意したほうがいいなと思いました。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1