LoginSignup
0
0

More than 1 year has passed since last update.

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

Last updated at Posted at 2022-06-06

どんな時?

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('呼んだ?');
});


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