Skip to content

Commit

Permalink
fix: fix formatting of options page on Fenix
Browse files Browse the repository at this point in the history
  • Loading branch information
birtles committed Oct 28, 2021
1 parent 1bcd904 commit c48159a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- Stop showing the popup for number-only matches in the name dictionary
(e.g. 64)
[#811](https://github.com/birchill/10ten-ja-reader/issues/811)).
- Fix formatting of options page on Firefox for Android (Nightly).

## 1.4.8 (2021-10-21)

Expand Down
6 changes: 5 additions & 1 deletion src/options/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { startBugsnag } from '../utils/bugsnag';
import {
isChromium,
isEdge,
isFenix,
isFirefox,
isMac,
isSafari,
Expand Down Expand Up @@ -74,7 +75,10 @@ const config = new Config();

function completeForm() {
// UA-specific styles
if (isFirefox()) {

// We only add the 'firefox' class on desktop Firefox since Fenix doesn't
// include browser styles.
if (isFirefox() && !isFenix()) {
document.documentElement.classList.add('firefox');
}
if (isChromium()) {
Expand Down
4 changes: 4 additions & 0 deletions src/utils/ua-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ export function isFirefox(): boolean {
return navigator.userAgent.indexOf('Firefox/') !== -1;
}

export function isFenix(): boolean {
return isFirefox() && navigator.userAgent.indexOf('Android') !== -1;
}

export function isChromium(): boolean {
return (
navigator.userAgent.indexOf('Chrome/') !== -1 ||
Expand Down

0 comments on commit c48159a

Please sign in to comment.