0

Prior to use our extension users have to log in. We use external provider that requires some parameters. Redirection url is among of them. When user log in he will be redirected to the page that have to be in xpi file. So, we have to know exactlly what is the url of this page. This url has to be added to Whitelist and we have to make sure that this url is the same for all users.

I installed the beastify extension (https://github.com/mdn/webextensions-examples/tree/master/beastify) on different computers . After click on the same button I get the different paths to image: moz-extension://1cb85296-3a66-42f5-85df-5caf7d388c56/beasts/frog.jpg for first and moz-extension://2e986e2d-1307-49ee-a4d4-f83e642ecf66/beasts/frog.jpg for second.

What I need to do for getting the same value in chrome.extension.getUrl() for different users in Firefox WebExtension?

UPD: It is possible in Chrome after setting "key" in manifest.json (but this way is not working in Firefox). Then chrome.extension.getUrl() , chrome.runtime.id, chrome.extension.id will be return the one value for different users/installs/devices I need the same behavior in Firefox

UPD2: https://bugzilla.mozilla.org/show_bug.cgi?id=1271663

Karrsom
  • 1
  • 3

2 Answers2

2

It is 2020 but I could say that in Firefox the internal UUID is different for every installation for security issues. It's not the case in Chrome browser.

Hender
  • 343
  • 2
  • 10
0

I think you can use

browser.extension.getURL("/");
Shweta Matkar
  • 301
  • 1
  • 11
  • this method provide different paths for different installs in Firefox, do not solve issue. – Karrsom Jun 20 '16 at 08:55
  • moz-extension://1cb85296-3a66-42f5-85df-5caf7d388c56/beasts/frog.jpg in this value //1cb85296-3a66-42f5-85df-5caf7d388c56 is the id created by firefox/chrome. It is different for different devices. – Shweta Matkar Jun 20 '16 at 09:03
  • Oh, no. It is one path for different devices in Chrome if you set key in manifest.json. This path you can use as "chrome://"+chrome.runtime.id And chrome.runtime.id (in Chrome) does not depend on device. I need the same behavior in Firefox. – Karrsom Jun 20 '16 at 10:45
  • Oh..ok then you can access firefox id by using `browser.runtime.id` – Shweta Matkar Jun 20 '16 at 10:50
  • Yes, I can))) But value of browser.runtime.id different for different users in Firefox)))) – Karrsom Jun 20 '16 at 12:54