fix: show consent dialog on firefox mobile #145
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a fix for ActivityWatch/activitywatch#1115 where on firefox mobile the consent dialog was prevented from opening and therefore prevented from enabling the extension.
Previously
chrome.windows.create()
was used to show the dialog but according to the Firefox Android documentation, the windows API is not supported on Firefox for Android since there is only one Firefox window on Android, and the browser cannot open or manipulate additional browser windows.On firefox mobile instead of opening a new page/window, we now embed the consent content directly in the window and only show/hide when requested.
Important
Fixes consent dialog issue on Firefox mobile by embedding consent content directly in the main window.
popup.html
instead of usingchrome.windows.create()
.showConsentDialog()
inpopup.js
now checksisFirefoxAndroid()
to determine dialog display method.isFirefoxAndroid()
function inpopup.js
to detect Firefox on Android.domListeners()
inpopup.js
to handle consent actions for Firefox Android.#consent-content
div inpopup.html
for embedded consent content.style.css
for#consent-content
and buttons.This description was created by for da1f74f. It will automatically update as commits are pushed.