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.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744346854a4569736.html
评论列表(0条)