I have some html files inside a Firefox web extension which I want to open on Browser Action event (Click on the tool bar icon). The way I was doing it in chrome was:
var appId = chrome.app.getDetails().id;
var tabUrl = "chrome-extension://" + id + "/src/index.html";
chrome.windows.getCurrent(function (currentWindow) {
chrome.tabs.create({
url: tabUrl
});
});
What I am trying to do fir firefox is:
//firefox doesnt support chrome.app, so I have hard coded the app id in manifest under applications.gecko.id
var id = chrome.runtime.getManifest().applications.gecko.id;
var tabUrl = "moz-extension://" + id + "/src/index.html";
//I have tried chrome-extension:// also above
browser.tabs.create({
url: tabUrl,
active:true
});
Its just opening a new tab with the url but the page is not loading. Any suggestion on what I am doing wrong