kainsavage / HistoryBlock

HistoryBlock plugin for the FireFox web browser.
35 stars 8 forks source link

Replace window.confirm with prettier HTML+JS components #8

Open kainsavage opened 7 years ago

kainsavage commented 7 years ago

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.

kainsavage commented 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.

kainsavage commented 7 years ago

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).

kainsavage commented 6 years ago

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?)