Skip to content

Commit

Permalink
Merge pull request #152 from arkon/rm-android
Browse files Browse the repository at this point in the history
Remove Android logic
  • Loading branch information
KentoNishi authored Dec 17, 2024
2 parents c414c45 + 85faf25 commit 4438a8a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
9 changes: 1 addition & 8 deletions src/scripts/chat-injector.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import HcButton from '../components/HyperchatButton.svelte';
import { getFrameInfoAsync, isValidFrameInfo, frameIsReplay, checkInjected } from '../ts/chat-utils';
import { isLiveTL, isAndroid } from '../ts/chat-constants';
import { isLiveTL } from '../ts/chat-constants';
import { hcEnabled, autoLiveChat } from '../ts/storage';

// const isFirefox = navigator.userAgent.includes('Firefox');
Expand Down Expand Up @@ -76,13 +76,6 @@ const chatLoaded = async (): Promise<void> => {
}
ytcTicker.remove();

// Hide input panel on android
if (isAndroid) {
const inputPanel = document.querySelector('#input-panel');
if (!inputPanel) return;
(inputPanel as HTMLElement).style.display = 'none';
}

if (await autoLiveChat.get()) {
const live = document.querySelector<HTMLElement>('tp-yt-paper-listbox#menu > :nth-child(2)');
if (!live) {
Expand Down
7 changes: 1 addition & 6 deletions src/ts/chat-constants.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
export const isLiveTL = false;
export const isAndroid = false;
// DO NOT EDIT THE ABOVE LINE. It is updated by webpack.

export const enum Browser {
FIREFOX,
CHROME,
SAFARI,
ANDROID
SAFARI
}

export const getBrowser = (): Browser => {
if (navigator.userAgent.includes('Firefox')) {
return Browser.FIREFOX;
}
if (isAndroid || window.chrome == null) {
return Browser.ANDROID;
}
if (/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
return Browser.SAFARI;
}
Expand Down

0 comments on commit 4438a8a

Please sign in to comment.