content_scripts里的js获取到页面的数据怎么发送到popup.js里?
content_scripts配置
"content_scripts": [{
"matches": ["http://*/*", "https://*/*"],
"js": ["static/index.js"]
}]
我在 index.js里
chrome.runtime.sendMessage('Hello', function(response) {
console.log(response);
});
popup.js 里
chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
console.log(11111)
});
完全没反应
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
小伙看你根骨奇佳,潜力无限,来学PHP伐。