Join GitHub today
Request optional permissions without toolbar button #2011
Firefox bug 1382953 has been fixed for Firefox 61 and Firefox ESR 60. This means that we can request optional permissions without using the toolbar button.
This implementation attempts to request the permission without the toolbar button and if that fails it then tries to use the toolbar button instead. This can be useful since it allows permission to be request at times when the user hasn't done one of the interactions required to be allowed to request permissions.
It also tracks if a request is currently pending and cancels all request until the current one is either allowed or denied. If this is not done then the user can click multiple times on the request button and the requests will be queued so that when the current request is denied it will appear again and again until the queue is emptied.