Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
看起来文档很稳定。但我对它的约定感到有点沮丧。例如,以下屏幕截图中的字段名称是什么?阅读文档指南的任何一个帮助点是什么?
name在这种情况下,您可以为端口使用一个可选名称。你像这样使用它:
name
var port = chrome.runtime.connect({name:"testName"});
在那之后,port.name将是"testName"。
port.name
"testName"
connectInfo被定义为一个对象,这意味着在它下面缩进列出的任何字段,就像它一样name,是它的一部分。
connectInfo