I use
chrome.tabs.create({url:"URL here"})
to open a new tab in my LRG. To this URL I want to append the version number of the extension, which is specified in the manifest.json
file:
"version": "1.2",
How can I access the version number in javascript at the time of creating the new tab?
I don't have enough rep to comment but in regard to Kinlan's XMLHttpRequest answer:
I found this very useful, but I did notice it should wait for readyState == 4 (not 2).
Worked great for me and seems like it should be robust.
You can fetch your own manifest and the version by using the following:
Once you have the version number you can do your tab stuff that you need to do.
Try in your extension:
I don't know why it's not among other APIs but it works in my Chrome 13 beta. Rather test it in older versions of Chrome :).
EDIT: It's probably a little buggy