You can get it like this (no extra permissions required) in two different ways:
-
Using runtime api:
var myid = chrome.runtime.id;
-
Using i18n api:
var myid = chrome.i18n.getMessage("@@extension_id");
but you don’t need it for opening pages, as chrome.tabs.create()
(and some others) understand relative paths.
So to open index.html
from your extension folder you should just use:
chrome.tabs.create({url: "index.html"});