LoginSignup
0

posted at

updated at

Organization

Chrome Extension iframeの中でも処理を行う設定

どんな時?

Extensionを使いたいページで例えば、リンクマウスオーバーでプレビューが出るようなページがあるとする。
そのプレビューがiframeを使って実現されている場合、iframe内でも同様のChrome Extensionを呼んでほしい。
そんな時があるとする。

結論

"all_frames": trueを記述すればOK。

manifest.json

{
  "manifest_version": 3,
  "name": "開発中",
  "version": "3.0.0",
  "description": "説明文",
  "content_scripts":[
    {
      "all_frames": true
    }
  ]
}

content.js
$(function(){
  alert('呼んだ?');
});


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
What you can do with signing up
0