在chrome浏览器的控制台输入document.getElementById("iframe").childNodes[0].contentWindow.$("#id").val()
可以得到正确的返回值。
但是将这条语句放在chrome扩展中执行,则报错 $ is not a function
在manifest.json已经添加了jquery的引用。
"content_scripts": [{"matches": [":///*"],"js": ["jquery-3.6.0.min.js","get.js"]}],