我有一个数组,它是在popup.js文件中的用户输入时创建和修改的,我希望能够在单击按钮(在popup.html中)时将它发送到我的content.js脚本。目前,chrome.runtime.sendMessage似乎只允许我传递字符串(还是JSON?)searchList.push(wordAndColorPair); //pushing the new object with user inputs to array下面是我使用JSON.stringify的尝试:
popup.jsvar jsonSearch