asciidoctor/asciidoctor-browser-extension

Firefox: Event pages and unexpected property warnings on extension reload

Neved4 opened this issue · 1 comments

Affects Firefox 77.0.1, Asciidoctor.js Live Preview 2.6.0.1 and previous 2.5.0.

Description

Reloading the extension causes some warnings. It does not prevent proper display of the document.

Steps to reproduce

  1. Reload the extension with or without an AsciiDoc(tor) file.

Warning Details

Reading manifest: Warning processing background.
persistent: Event pages are not currently supported.
This will run as a persistent background page.
Reading manifest: Warning processing options_page:
An unexpected property was found in the WebExtension
manifest.
Extension ID
asciidoctor-firefox-addon@asciidoctor
Internal UUID
c2388f31-ea60-d048-ab0d-ecb9ab5190df
Manifest URL
moz-extension://c2388f31-ea60-d048-ab0d-ecb9ab5190df/manifest.json

Possibly Related

#302 produces equivalent warnings, but by reloading they can be triggered without using the include directive.

Attachments

Screenshot


Unfortunately, this option is not supported by Firefox hence the warning message.
Currently, we are using the same manifest for Firefox and Chromium-based browsers but we could decide to use specific manifest for Firefox.
The warning message is annoying and confusing but I'm not sure it's worth it maintenance wise to build two packages (instead of one) with a specific manifest to accommodate Firefox.

Another idea would be to use background.persistent: true but I think it's better to use a non persistent page (when possible):

true indicates the background page is to be kept in memory from when the extension is loaded or the browser starts until the extension is unloaded or disabled, or the browser is closed (i.e. the background page is persistent).

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/background

Regarding the warning message about the deprecated options_page property, I've removed/replaced it in #387