木川 炎星
木川 炎星

Reputation: 4093

Can a Google Chrome extension/web-application request its own ID string?

I need to specify the ID of a Google Chrome web-application for checking URLs (eg: chrome-extension://[id_goes_here]/application.html). Is there some way I can call the ID with JavaScript and then construct the URL?

I'm thinking of using something along the lines of:

"chrome-extension://" + whatever_calls_the_ID + "/application.html";

to check the URLs, but need to know how to call the ID.

Thanks for your help.

Upvotes: 2

Views: 302

Answers (1)

serg
serg

Reputation: 111265

In javascript:

var myid = chrome.i18n.getMessage("@@extension_id");

(no extra permissions required to make this call)

More info...

Upvotes: 5

Related Questions