admin管理员组文章数量:1406943
I'm trying to work with some javascript that accesses chrome.runtime in Google Chrome. The script calls the chrome.runtime.getManifest() function, but my console says that function is not defined. I've read through Google's documentation on this subject, and it should be there. I've done some research, and for everyone else, using this function seems to be a non-issue, so I feel like I'm missing something. However, when I run console.log(chrome.runtime); I see this:
It appears that only two functions are defined in this object, connect and sendMessage.
What am I missing?
I'm trying to work with some javascript that accesses chrome.runtime in Google Chrome. The script calls the chrome.runtime.getManifest() function, but my console says that function is not defined. I've read through Google's documentation on this subject, and it should be there. I've done some research, and for everyone else, using this function seems to be a non-issue, so I feel like I'm missing something. However, when I run console.log(chrome.runtime); I see this:
It appears that only two functions are defined in this object, connect and sendMessage.
What am I missing?
Share Improve this question edited May 14, 2015 at 11:22 Halvor Holsten Strand 20.6k17 gold badges88 silver badges102 bronze badges asked May 14, 2015 at 6:04 jlivingstonjlivingston 511 silver badge4 bronze badges 02 Answers
Reset to default 3I found the answer. These functions are only available when the javascript is running from a Chrome App.
For Chrome extensions, this method is only available in the background scope.
本文标签: javascriptchromeruntimegetManifest() is not definedStack Overflow
版权声明:本文标题:javascript - chrome.runtime.getManifest() is not defined - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744346853a2601811.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论