Open kainsavage opened 7 years ago
Maybe the best way to do this is not with implementing a modal in HTML/JS on the main options page, but to instead create new pages and open them in private "panel" windows - https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/windows/create
This would allow for better control of styling as well as 'escaping' the sandboxed DOM of the options page.
For reference, one can only manipulate the sandboxed DOM on the options page - the addon info and controls 'above the fold' are not in the addon's purview. So, early experimentation with darkening the page and showing a 'modal' in HTML/JS only darkened the sandboxed DOM, which I deemed untenable.
This definitely looks like the way we want to build rich prompts/dialogs/etc.
The only hitch at the moment is that the titlebar is ugly until FF56 (addressed here). I'll add an issue to get this resolved in a future release (not scheduled for v.2.1.0).
May have to be included in v2.1.0 since Firefox56 broke alert/confirm/prompt and has no plans of fixing it until 57 (maybe?)
Currently, several components on the options page use
window.confirm
to get user input, which is gross looking.Add web components that use html/js to provide modals/dialogs to get user input.