回答編集履歴
1
追記
answer
CHANGED
@@ -4,4 +4,11 @@
|
|
4
4
|
|
5
5
|
お互いのデータのやり取りには通信が必要です。下記ドキュメントの「バックグラウンドスクリプトとの通信」のところを読んでみてください。
|
6
6
|
|
7
|
-
[バックグラウンドスクリプトとの通信](https://developer.mozilla.org/ja/docs/Mozilla/Add-ons/WebExtensions/Content_scripts#communicating_with_background_scripts)
|
7
|
+
[バックグラウンドスクリプトとの通信](https://developer.mozilla.org/ja/docs/Mozilla/Add-ons/WebExtensions/Content_scripts#communicating_with_background_scripts)
|
8
|
+
|
9
|
+
|
10
|
+
実行するコンテンツスクリプトとして実行する関数に`args`プロパティで値を渡すことは可能です。返値を取得することもできますがちょっと複雑です。
|
11
|
+
|
12
|
+
[https://developer.chrome.com/docs/extensions/reference/scripting/#runtime-functions](https://developer.chrome.com/docs/extensions/reference/scripting/#runtime-functions)
|
13
|
+
|
14
|
+
やっぱりインジェクションした後通信する方が素直かなと思います。
|