Options
-Whitelisted channels
-Privacy
+General
Whitelisted channels
+Server list
+Proxies
TTV LOL PRO will ping each server in the list below until one successfully responds to aGET /ping
request.
@@ -61,12 +62,44 @@ Server list
TTV LOL PRO to error out.+
Note: Fallback to stream with ads on server error is only available for TTV LOL's API (https://api.ttv.lol).
-
Privacy
+
-
+
diff --git a/src/popup/popup.ts b/src/popup/popup.ts
index 245bf1e4..c1a2cea9 100644
--- a/src/popup/popup.ts
+++ b/src/popup/popup.ts
@@ -15,14 +15,6 @@ const whitelistToggle = $("#whitelist-toggle") as HTMLInputElement;
const whitelistToggleLabel = $("#whitelist-toggle-label") as HTMLLabelElement;
//#endregion
-// Open links in new tabs.
-document.querySelectorAll("a").forEach(a => {
- a.addEventListener("click", e => {
- e.preventDefault();
- browser.tabs.create({ url: a.href });
- });
-});
-
if (store.readyState === "complete") main();
else store.addEventListener("load", main);
diff --git a/src/popup/style.css b/src/popup/style.css
index 3833a4a4..c2afe060 100644
--- a/src/popup/style.css
+++ b/src/popup/style.css
@@ -2,7 +2,8 @@ html {
-webkit-font-smoothing: antialiased;
background: #151619;
color: #c9cbcd;
- font-family: "Open Sans", "Segoe UI", sans-serif;
+ font-family: "Inter", "Roobert", "Helvetica Neue", Helvetica, Arial,
+ sans-serif;
text-rendering: optimizeLegibility;
}
@@ -103,9 +104,9 @@ body {
#stream-status {
display: none;
margin: 0 30px;
- padding: 15px;
+ padding: 18px 14px 14px 14px;
gap: 7px;
- border-bottom: 1px solid hsl(210, 4%, 25%);
+ border-bottom: 1px solid #3d4042;
border-radius: 8px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
@@ -127,7 +128,7 @@ body {
}
#stream-status #proxy-country {
display: inline-block;
- margin-top: 5px;
+ margin-top: 10px;
font-size: 7pt;
opacity: 0.6;
}
diff --git a/src/store/getDefaultState.ts b/src/store/getDefaultState.ts
index 7e0803f4..3f4d01bf 100644
--- a/src/store/getDefaultState.ts
+++ b/src/store/getDefaultState.ts
@@ -1,4 +1,4 @@
-import { State } from "./types";
+import type { State } from "./types";
export default function getDefaultState() {
return {
@@ -6,6 +6,7 @@ export default function getDefaultState() {
ignoredChannelSubscriptions: [],
isUpdateAvailable: false,
lastUpdateCheck: 0,
+ resetPlayerOnMidroll: true,
servers: ["https://api.ttv.lol"],
streamStatuses: {},
whitelistedChannels: [],
diff --git a/src/store/index.ts b/src/store/index.ts
index 3feedbd9..72076e6d 100644
--- a/src/store/index.ts
+++ b/src/store/index.ts
@@ -1,7 +1,7 @@
import browser from "webextension-polyfill";
import getDefaultState from "./getDefaultState";
import getStateHandler from "./handlers/getStateHandler";
-import { EventType, ReadyState, State, StorageArea } from "./types";
+import type { EventType, ReadyState, State, StorageArea } from "./types";
class Store {
private _areaName: StorageArea;
diff --git a/src/store/types.ts b/src/store/types.ts
index 7b7c65ff..e6282809 100644
--- a/src/store/types.ts
+++ b/src/store/types.ts
@@ -1,4 +1,4 @@
-import { StreamStatus } from "../types";
+import type { StreamStatus } from "../types";
export type EventType = "load" | "change";
export type ReadyState = "loading" | "complete";
@@ -9,6 +9,7 @@ export interface State {
ignoredChannelSubscriptions: string[];
isUpdateAvailable: boolean;
lastUpdateCheck: number;
+ resetPlayerOnMidroll: boolean;
servers: string[];
streamStatuses: Record;
whitelistedChannels: string[];
diff --git a/src/types.ts b/src/types.ts
index 98fd75e7..3616e474 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -1,8 +1,50 @@
+//#region Helpers
+
// From https://stackoverflow.com/a/51419293
export type KeyOfType = keyof {
[P in keyof T as T[P] extends V ? P : never]: any;
};
+//#endregion
+
+//#region Message
+
+type MessageType = "midroll";
+
+export interface Message {
+ type: MessageType;
+ request?: Record;
+ response?: Record;
+}
+
+export interface MidrollMessage extends Message {
+ type: "midroll";
+ response: {
+ tabId: number;
+ startDateString: string;
+ };
+}
+
+//#endregion
+
+//#region Stream Status
+
+export interface StreamStatus {
+ redirected: boolean;
+ reason: string;
+ errors: StreamStatusError[];
+ proxyCountry?: string;
+}
+
+export interface StreamStatusError {
+ timestamp: number;
+ status: number;
+}
+
+//#endregion
+
+//#region API
+
export const enum PlaylistType {
Playlist = "playlist",
VOD = "vod",
@@ -48,14 +90,4 @@ export interface Token {
vod_id?: number;
}
-export interface StreamStatus {
- redirected: boolean;
- reason: string;
- errors: StreamStatusError[];
- proxyCountry?: string;
-}
-
-export interface StreamStatusError {
- timestamp: number;
- status: number;
-}
+//#endregion