How to find the location of the installed Chrome Extension

565 views
Skip to first unread message

Arun Subramanian

unread,
Aug 23, 2016, 3:39:41 PM8/23/16
to Chromium-Extensions-Announce
Hi,
I am running the extension as unpacked extensions

I'm trying to launch/load an html file (in Chrome browser) in the same folder/location as extension files.

//Example code from the Chrome extension...
var ref = String(window.location) ;
ref = ref.substr(0, ref.lastIndexOf("/"))+"/somefile.html" ;
chrome.browser.openTab({url:ref});

Result:
Chrome throws the following error:
"The webpage at chrome-extension://invalid/ might be temporarily down or it may have moved permanently to a new web address."


However, the Developer Tools, the following is line displayed:
ref: chrome-extension://bbelanfbkooidlophmgpbpkbolplmkmi/somefile.html


Could any one help how to open the browser from extension app as unpacked.


Thanks,

Arun

Antony Sargent

unread,
Aug 24, 2016, 1:34:27 PM8/24/16
to Arun Subramanian, Chromium-Extensions-Announce
An extension can get URLs to reference files in it's own folder by passing the relative path to chrome.runtime.getURL - this is just a convenient helper that will generate a URL of the form chrome-extension://<extension_id>/<relative_path>


--
You received this message because you are subscribed to the Google Groups "Chromium-Extensions-Announce" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.
To post to this group, send email to chromium-extensions@chromium.org.
Visit this group at https://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/b37eb5ae-12f3-4816-b7ce-a8f6642909c2%40chromium.org.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.

Reply all
Reply to author
Forward
0 new messages