0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Chrome Extensionのcontent script内で、chrome.runtime.sendMessageすると、Uncaught Error: Extension context invalidated. が発生する

Posted at

はじめに

  • Chrome拡張開発時(Ver2, Ver3共通)、Uncaught Error: Extension context invalidated. が発生する
  • ソースも全然替えてないのに・・・
  • 突然発生し始めた、解決方法がGoogleしてもAIさんに聞いてもわからない・・・

原因

  • 読み込み元のソースと、Chromeが読み込んでいる Extension のソースに差がある
  • 関連する拡張を、すべて、拡張タブからリロードする
  • Uncaught Error: Extension context invalidated. が発生しなくなる
  • 拡張をリロードしても発生する場合は、Chromeを再起動してみる
  • 拡張をリロードしても、再起動しても発生する場合は、拡張タブで、拡張を削除して再度登録し直す

さいごに

  • Uncaught Error: Extension context invalidated. というエラーに焦りますが、ソースをいじると発生しやすく、盲点になりがちです。
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?