Chrome extension message being passed as object

前端 未结 1 1767
迷失自我
迷失自我 2020-12-20 06:06

I\'m sending a message from the content script to the background page. The message is a URL which then gets ajax parsed in the background. When I console.log the data retrie

1条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-20 06:25

    You can't pass DOM nodes with Messaging; data must be JSON-serializable, and DOM nodes are not.

    Pass only data you really need (e.g. textContent), then reconstruct the node on the other side.

    0 讨论(0)
提交回复
热议问题