mirror of
https://github.com/LBRYFoundation/Watch-on-LBRY.git
synced 2025-08-23 17:47:26 +00:00
commit
9a9b51bbba
5 changed files with 8 additions and 6 deletions
|
@ -6,7 +6,7 @@ export interface LbrySettings {
|
||||||
export const DEFAULT_SETTINGS: LbrySettings = { enabled: true, redirect: 'lbry.tv' };
|
export const DEFAULT_SETTINGS: LbrySettings = { enabled: true, redirect: 'lbry.tv' };
|
||||||
|
|
||||||
export const redirectDomains = {
|
export const redirectDomains = {
|
||||||
'lbry.tv': { prefix: 'https://lbry.tv/', display: 'lbry.tv' },
|
'madiator.com': { prefix: 'https://madiator.com/', display: 'madiator.com' },
|
||||||
odysee: { prefix: 'https://odysee.com/', display: 'odysee' },
|
odysee: { prefix: 'https://odysee.com/', display: 'odysee' },
|
||||||
app: { prefix: 'lbry://', display: 'App' },
|
app: { prefix: 'lbry://', display: 'App' },
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,7 +2,7 @@ import chunk from 'lodash/chunk';
|
||||||
import groupBy from 'lodash/groupBy';
|
import groupBy from 'lodash/groupBy';
|
||||||
import pickBy from 'lodash/pickBy';
|
import pickBy from 'lodash/pickBy';
|
||||||
|
|
||||||
const LBRY_API_HOST = 'https://api.lbry.com';
|
const LBRY_API_HOST = 'https://api.odysee.com';
|
||||||
const QUERY_CHUNK_SIZE = 300;
|
const QUERY_CHUNK_SIZE = 300;
|
||||||
|
|
||||||
interface YtResolverResponse {
|
interface YtResolverResponse {
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
{
|
{
|
||||||
"name": "Watch on LBRY",
|
"name": "Watch on LBRY",
|
||||||
"version": "1.7.2",
|
"version": "1.7.3",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"https://www.youtube.com/",
|
"https://www.youtube.com/",
|
||||||
"https://invidio.us/channel/*",
|
"https://invidio.us/channel/*",
|
||||||
"https://invidio.us/watch?v=*",
|
"https://invidio.us/watch?v=*",
|
||||||
"https://api.lbry.com/*",
|
"https://api.odysee.com/*",
|
||||||
"https://lbry.tv/*",
|
"https://lbry.tv/*",
|
||||||
|
"https://odysee.com/*",
|
||||||
|
"https://madiator.com/*",
|
||||||
"tabs",
|
"tabs",
|
||||||
"storage"
|
"storage"
|
||||||
],
|
],
|
||||||
|
|
|
@ -35,7 +35,7 @@ async function ctxFromURL(url: string): Promise<UpdateContext | void> {
|
||||||
// handles lbry.tv -> lbry app redirect
|
// handles lbry.tv -> lbry app redirect
|
||||||
chrome.tabs.onUpdated.addListener(async (tabId, changeInfo, { url: tabUrl }) => {
|
chrome.tabs.onUpdated.addListener(async (tabId, changeInfo, { url: tabUrl }) => {
|
||||||
const { enabled, redirect } = await getSettingsAsync('enabled', 'redirect');
|
const { enabled, redirect } = await getSettingsAsync('enabled', 'redirect');
|
||||||
if (!enabled || redirect !== 'app' || !changeInfo.url || !tabUrl?.startsWith('https://lbry.tv/')) return;
|
if (!enabled || redirect !== 'app' || !changeInfo.url || !tabUrl?.startsWith('https://odysee.com/')) return;
|
||||||
|
|
||||||
const url = appRedirectUrl(tabUrl, { encode: true });
|
const url = appRedirectUrl(tabUrl, { encode: true });
|
||||||
if (!url) return;
|
if (!url) return;
|
||||||
|
|
|
@ -20,7 +20,7 @@ interface ButtonSettings {
|
||||||
|
|
||||||
const buttonSettings: Record<LbrySettings['redirect'], ButtonSettings> = {
|
const buttonSettings: Record<LbrySettings['redirect'], ButtonSettings> = {
|
||||||
app: { text: 'Watch on LBRY', icon: chrome.runtime.getURL('icons/lbry/lbry-logo.svg') },
|
app: { text: 'Watch on LBRY', icon: chrome.runtime.getURL('icons/lbry/lbry-logo.svg') },
|
||||||
'lbry.tv': { text: 'Watch on LBRY', icon: chrome.runtime.getURL('icons/lbry/lbry-logo.svg') },
|
'madiator.com': { text: 'Watch on LBRY', icon: chrome.runtime.getURL('icons/lbry/lbry-logo.svg') },
|
||||||
odysee: {
|
odysee: {
|
||||||
text: 'Watch on Odysee', icon: chrome.runtime.getURL('icons/lbry/odysee-logo.svg'),
|
text: 'Watch on Odysee', icon: chrome.runtime.getURL('icons/lbry/odysee-logo.svg'),
|
||||||
style: { backgroundColor: '#1e013b' },
|
style: { backgroundColor: '#1e013b' },
|
||||||
|
|
Loading…
Add table
Reference in a new issue