Added almost all Piped-Material settings

This commit is contained in:
ManeraKai 2022-03-14 22:10:08 +03:00
parent 9bb910af94
commit c50b4bbb08
No known key found for this signature in database
GPG Key ID: 5ABC31FFD562E337
11 changed files with 412 additions and 313 deletions

View File

@ -11,8 +11,4 @@ browser.storage.local.get(
if (applyThemeToSites && theme != "DEFAULT") localStorage.setItem("chakra-ui-color-mode", r.theme);
}
)
window.onunload = () => {
localStorage.removeItem("chakra-ui-color-mode");
};
)

View File

@ -184,7 +184,6 @@ function setSimplyTranslateEngine(val) {
console.log("simplyTranslateEngine: ", val)
}
function isTranslateRedirects(url, type, frontend) {
let protocolHost = `${url.protocol}//${url.host}`;

View File

@ -3,11 +3,8 @@ window.browser = window.browser || window.chrome;
import commonHelper from './common.js'
const targets = [
/^https?:\/\/twitter\.com/,
/^https?:\/\/www\.twitter\.com/,
/^https?:\/\/mobile\.twitter\.com/,
/^https?:\/\/pbs\.twimg\.com/,
/^https?:\/\/video\.twimg\.com/,
/^https?:\/\/(www\.|mobile\.|)twitter\.com/,
/^https?:\/\/(pbs\.|video\.|)twimg\.com/,
/^https?:\/\/platform\.twitter\.com\/embed/,
/^https?:\/\/t\.co/
];
@ -125,7 +122,10 @@ function redirect(url, initiator) {
if (!targets.some((rx) => rx.test(url.href))) return null;
if (url.pathname.split("/").includes("home")) return null;
if (url.pathname.split("/").includes("home")) {
console.log("twitter homepage");
return null;
}
if (
bypassWatchOnTwitter &&

View File

@ -2,6 +2,30 @@
window.browser = window.browser || window.chrome;
export let youtubeListen;
export const getYoutubeListen = () => youtubeListen;
export function setYoutubeListen(val) {
youtubeListen = val;
browser.storage.local.set({ youtubeListen })
console.log("youtubeListen: ", youtubeListen)
}
export let volume;
export const getVolume = () => volume;
export function setVolume(val) {
volume = val;
browser.storage.local.set({ youtubeVolume: volume })
console.log("youtubeVolume: ", volume)
}
export let youtubeAutoplay;
export const getAutoplay = () => youtubeAutoplay;
export function setAutoplay(val) {
youtubeAutoplay = val;
browser.storage.local.set({ youtubeAutoplay })
console.log("youtubeAutoplay: ", youtubeAutoplay)
}
export let invidiousQuality;
export const getInvidiousQuality = () => invidiousQuality;
export function setinvidiousQuality(val) {
@ -123,11 +147,119 @@ export function setInvidiousSavePlayerPos(val) {
console.log("invidiousSavePlayerPos: ", invidiousSavePlayerPos)
}
export async function invidiousInit() {
export let pipedBufferGoal;
export const getPipedBufferGoal = () => pipedBufferGoal;
export function setPipedBufferGoal(val) {
pipedBufferGoal = val;
browser.storage.local.set({ pipedBufferGoal })
console.log("pipedBufferGoal: ", pipedBufferGoal)
}
export let pipedComments;
export const getPipedComments = () => pipedComments;
export function setPipedComments(val) {
pipedComments = val;
browser.storage.local.set({ pipedComments })
console.log("pipedComments: ", pipedComments)
}
export let pipedDisableLBRY;
export const getPipedDisableLBRY = () => pipedDisableLBRY;
export function setPipedDisableLBRY(val) {
pipedDisableLBRY = val;
browser.storage.local.set({ pipedDisableLBRY })
console.log("pipedDisableLBRY: ", pipedDisableLBRY)
}
export let pipedEnabledCodecs;
export const getPipedEnabledCodecs = () => pipedEnabledCodecs;
export function setPipedEnabledCodecs(val) {
pipedEnabledCodecs = val;
browser.storage.local.set({ pipedEnabledCodecs })
console.log("pipedEnabledCodecs: ", pipedEnabledCodecs)
}
export let pipedHomepage;
export const getPipedHomepage = () => pipedHomepage;
export function setPipedHomepage(val) {
pipedHomepage = val;
browser.storage.local.set({ pipedHomepage })
console.log("pipedHomepage: ", pipedHomepage)
}
export let pipedMinimizeDescription;
export const getPipedMinimizeDescription = () => pipedMinimizeDescription;
export function setPipedMinimizeDescription(val) {
pipedMinimizeDescription = val;
browser.storage.local.set({ pipedMinimizeDescription })
console.log("pipedMinimizeDescription: ", pipedMinimizeDescription)
}
export let pipedProxyLBRY;
export const getPipedProxyLBRY = () => pipedProxyLBRY;
export function setPipedProxyLBRY(val) {
pipedProxyLBRY = val;
browser.storage.local.set({ pipedProxyLBRY })
console.log("pipedProxyLBRY: ", pipedProxyLBRY)
}
export let pipedQuality;
export const getPipedQuality = () => pipedQuality;
export function setPipedQuality(val) {
pipedQuality = val;
browser.storage.local.set({ pipedQuality })
console.log("pipedQuality: ", pipedQuality)
}
export let pipedRegion;
export const getPipedRegion = () => pipedRegion;
export function setPipedRegion(val) {
pipedRegion = val;
browser.storage.local.set({ pipedRegion })
console.log("pipedRegion: ", pipedRegion)
}
export let pipedSelectedSkip;
export const getPipedSelectedSkip = () => pipedSelectedSkip;
export function setPipedSelectedSkip(val) {
pipedSelectedSkip = val;
browser.storage.local.set({ pipedSelectedSkip })
console.log("pipedSelectedSkip: ", pipedSelectedSkip)
}
export let pipedSponsorblock;
export const getPipedSponsorblock = () => pipedSponsorblock;
export function setPipedSponsorblock(val) {
pipedSponsorblock = val;
browser.storage.local.set({ pipedSponsorblock })
console.log("pipedSponsorblock: ", pipedSponsorblock)
}
export let pipedWatchHistory;
export const getPipedWatchHistory = () => pipedWatchHistory;
export function setPipedWatchHistory(val) {
pipedWatchHistory = val;
browser.storage.local.set({ pipedWatchHistory })
console.log("pipedWatchHistory: ", pipedWatchHistory)
}
export let pipedMaterialSkipToLastPoint;
export const getPipedMaterialSkipToLastPoint = () => pipedMaterialSkipToLastPoint;
export function setPipedMaterialSkipToLastPoint(val) {
pipedMaterialSkipToLastPoint = val;
browser.storage.local.set({ pipedMaterialSkipToLastPoint })
console.log("pipedMaterialSkipToLastPoint: ", pipedMaterialSkipToLastPoint)
}
export async function initOptions() {
return new Promise(
resolve => {
browser.storage.local.get(
[
"youtubeListen",
"youtubeVolume",
"youtubeAutoplay",
"invidiousQuality",
"invidiousAlwaysProxy",
"invidiousQuality",
@ -144,8 +276,28 @@ export async function invidiousInit() {
"invidiousExtendDesc",
"invidiousVrMode",
"invidiousSavePlayerPos",
"pipedBufferGoal",
"pipedComments",
"pipedDisableLBRY",
"pipedEnabledCodecs",
"pipedHomepage",
"pipedMinimizeDescription",
"pipedProxyLBRY",
"pipedQuality",
"pipedRegion",
"pipedSelectedSkip",
"pipedSponsorblock",
"pipedWatchHistory",
"pipedMaterialSkipToLastPoint",
],
r => {
youtubeListen = r.youtubeListen ?? false;
volume = r.youtubeVolume ?? 100;
youtubeAutoplay = r.youtubeAutoplay ?? false;
invidiousVideoLoop = r.invidiousVideoLoop ?? false;
invidiousAlwaysProxy = r.invidiousAlwaysProxy ?? false;
invidiousPlayerStyle = r.invidiousPlayerStyle ?? 'invidious';
@ -162,9 +314,24 @@ export async function invidiousInit() {
invidiousVrMode = r.invidiousVrMode ?? true;
invidiousSavePlayerPos = r.invidiousSavePlayerPos ?? false;
pipedBufferGoal = r.pipedBufferGoal ?? 10;
pipedComments = r.pipedComments ?? true;
pipedDisableLBRY = r.pipedDisableLBRY ?? false;
pipedEnabledCodecs = r.pipedEnabledCodecs ?? ["av1", "vp9", "avc"];
pipedHomepage = r.pipedHomepage ?? "trending";
pipedMinimizeDescription = r.pipedMinimizeDescription ?? false;
pipedProxyLBRY = r.pipedProxyLBRY ?? false;
pipedQuality = r.pipedQuality ?? 0;
pipedRegion = r.pipedRegion ?? "US";
pipedSelectedSkip = r.pipedSelectedSkip ?? ["sponsor", "interaction", "selfpromo", "music_offtopic"];
pipedSponsorblock = r.pipedSponsorblock ?? true;
pipedWatchHistory = r.pipedWatchHistory ?? false;
pipedMaterialSkipToLastPoint = r.pipedMaterialSkipToLastPoint ?? true;
resolve();
}
)
}
)
}
}

View File

@ -1,138 +0,0 @@
"use strict";
window.browser = window.browser || window.chrome;
export let pipedBufferGoal;
export const getPipedBufferGoal = () => pipedBufferGoal;
export function setPipedBufferGoal(val) {
pipedBufferGoal = val;
browser.storage.local.set({ pipedBufferGoal })
console.log("pipedBufferGoal: ", pipedBufferGoal)
}
export let pipedComments;
export const getPipedComments = () => pipedComments;
export function setPipedComments(val) {
pipedComments = val;
browser.storage.local.set({ pipedComments })
console.log("pipedComments: ", pipedComments)
}
export let pipedDisableLBRY;
export const getPipedDisableLBRY = () => pipedDisableLBRY;
export function setPipedDisableLBRY(val) {
pipedDisableLBRY = val;
browser.storage.local.set({ pipedDisableLBRY })
console.log("pipedDisableLBRY: ", pipedDisableLBRY)
}
export let pipedEnabledCodecs;
export const getPipedEnabledCodecs = () => pipedEnabledCodecs;
export function setPipedEnabledCodecs(val) {
pipedEnabledCodecs = val;
browser.storage.local.set({ pipedEnabledCodecs })
console.log("pipedEnabledCodecs: ", pipedEnabledCodecs)
}
export let pipedHomepage;
export const getPipedHomepage = () => pipedHomepage;
export function setPipedHomepage(val) {
pipedHomepage = val;
browser.storage.local.set({ pipedHomepage })
console.log("pipedHomepage: ", pipedHomepage)
}
export let pipedMinimizeDescription;
export const getPipedMinimizeDescription = () => pipedMinimizeDescription;
export function setPipedMinimizeDescription(val) {
pipedMinimizeDescription = val;
browser.storage.local.set({ pipedMinimizeDescription })
console.log("pipedMinimizeDescription: ", pipedMinimizeDescription)
}
export let pipedProxyLBRY;
export const getPipedProxyLBRY = () => pipedProxyLBRY;
export function setPipedProxyLBRY(val) {
pipedProxyLBRY = val;
browser.storage.local.set({ pipedProxyLBRY })
console.log("pipedProxyLBRY: ", pipedProxyLBRY)
}
export let pipedQuality;
export const getPipedQuality = () => pipedQuality;
export function setPipedQuality(val) {
pipedQuality = val;
browser.storage.local.set({ pipedQuality })
console.log("pipedQuality: ", pipedQuality)
}
export let pipedRegion;
export const getPipedRegion = () => pipedRegion;
export function setPipedRegion(val) {
pipedRegion = val;
browser.storage.local.set({ pipedRegion })
console.log("pipedRegion: ", pipedRegion)
}
export let pipedSelectedSkip;
export const getPipedSelectedSkip = () => pipedSelectedSkip;
export function setPipedSelectedSkip(val) {
pipedSelectedSkip = val;
browser.storage.local.set({ pipedSelectedSkip })
console.log("pipedSelectedSkip: ", pipedSelectedSkip)
}
export let pipedSponsorblock;
export const getPipedSponsorblock = () => pipedSponsorblock;
export function setPipedSponsorblock(val) {
pipedSponsorblock = val;
browser.storage.local.set({ pipedSponsorblock })
console.log("pipedSponsorblock: ", pipedSponsorblock)
}
export let pipedWatchHistory;
export const getPipedWatchHistory = () => pipedWatchHistory;
export function setPipedWatchHistory(val) {
pipedWatchHistory = val;
browser.storage.local.set({ pipedWatchHistory })
console.log("pipedWatchHistory: ", pipedWatchHistory)
}
export async function pipedInit() {
return new Promise(
resolve => {
browser.storage.local.get(
[
"pipedBufferGoal",
"pipedComments",
"pipedDisableLBRY",
"pipedEnabledCodecs",
"pipedHomepage",
"pipedMinimizeDescription",
"pipedProxyLBRY",
"pipedQuality",
"pipedRegion",
"pipedSelectedSkip",
"pipedSponsorblock",
"pipedWatchHistory",
],
r => {
pipedBufferGoal = r.pipedBufferGoal ?? 10;
pipedComments = r.pipedComments ?? true;
pipedDisableLBRY = r.pipedDisableLBRY ?? false;
pipedEnabledCodecs = r.pipedEnabledCodecs ?? ["av1", "vp9", "avc"];
pipedHomepage = r.pipedHomepage ?? "trending";
pipedMinimizeDescription = r.pipedMinimizeDescription ?? false;
pipedProxyLBRY = r.pipedProxyLBRY ?? false;
pipedQuality = r.pipedQuality ?? 0;
pipedRegion = r.pipedRegion ?? "US";
pipedSelectedSkip = r.pipedSelectedSkip ?? ["sponsor", "interaction", "selfpromo", "music_offtopic"];
pipedSponsorblock = r.pipedSponsorblock ?? true;
pipedWatchHistory = r.pipedWatchHistory ?? false;
resolve();
}
)
}
)
}

View File

@ -3,13 +3,29 @@ window.browser = window.browser || window.chrome;
browser.storage.local.get(
[
"theme",
"youtubeVolume",
"youtubeAutoplay",
"youtubeVolume",
"youtubeListen",
"pipedDisableLBRY",
"pipedProxyLBRY",
"pipedSelectedSkip",
"pipedSponsorblock",
"pipedMaterialSkipToLastPoint",
],
r => {
let theme = r.theme ?? "dark";
let youtubeAutoplay = r.youtubeAutoplay ?? false;
let youtubeVolume = r.youtubeVolume ?? 100;
let youtubeListen = r.youtubeListen ?? false;
let pipedDisableLBRY = r.pipedDisableLBRY ?? false;
let pipedProxyLBRY = r.pipedProxyLBRY ?? false;
let pipedSelectedSkip = r.pipedSelectedSkip ?? [];
let pipedSponsorblock = r.pipedSponsorblock ?? true;
let pipedMaterialSkipToLastPoint = r.pipedMaterialSkipToLastPoint ?? true;
let prefs = {};
if (localStorage.getItem("PREFERENCES")) prefs = JSON.parse(localStorage.getItem("PREFERENCES"));
@ -17,9 +33,16 @@ browser.storage.local.get(
if (theme == 'dark') prefs.darkMode = true;
if (theme == 'light') prefs.darkMode = false;
prefs.playerAutoplay = youtubeAutoplay == 'true';
prefs.volume = youtubeVolume / 100;
prefs.playerAutoplay = youtubeAutoplay;
prefs.listen = youtubeListen;
prefs.disableLBRY = pipedDisableLBRY;
prefs.proxyLBRY = pipedProxyLBRY;
prefs.sponsorblock = pipedSponsorblock;
prefs.skipToLastPoint = pipedMaterialSkipToLastPoint;
prefs.selectedSkip = pipedSelectedSkip;
localStorage.setItem("PREFERENCES", JSON.stringify(prefs));
}
)
)

View File

@ -1,28 +0,0 @@
"use strict";
window.browser = window.browser || window.chrome;
export let youtubeListen;
export const getYoutubeListen = () => youtubeListen;
export function setYoutubeListen(val) {
youtubeListen = val;
browser.storage.local.set({ youtubeListen })
console.log("youtubeListen: ", youtubeListen)
}
export async function youtubeInit() {
return new Promise(
resolve => {
browser.storage.local.get(
[
"youtubeListen"
],
r => {
youtubeListen = r.youtubeListen ?? false;
resolve();
}
)
}
)
}

View File

@ -1,128 +1,73 @@
"use strict";
window.browser = window.browser || window.chrome;
import commonHelper from '../common.js'
import {
invidiousQuality,
getInvidiousQuality,
setinvidiousQuality,
youtubeListen, getYoutubeListen, setYoutubeListen,
invidiousAlwaysProxy,
setInvidiousAlwaysProxy,
getInvidiousAlwaysProxy,
invidiousQuality, getInvidiousQuality, setinvidiousQuality,
invidiousPlayerStyle,
getInvidiousPlayerStyle,
setInvidiousPlayerStyle,
invidiousAlwaysProxy, setInvidiousAlwaysProxy, getInvidiousAlwaysProxy,
invidiousInit,
invidiousVideoLoop,
getInvidiousVideoLoop,
setInvidiousVideoLoop,
invidiousPlayerStyle, getInvidiousPlayerStyle, setInvidiousPlayerStyle,
invidiousContinueAutoplay,
getInvidiousContinueAutoplay,
setInvidiousContinueAutoplay,
invidiousVideoLoop, getInvidiousVideoLoop, setInvidiousVideoLoop,
invidiousContinue,
getInvidiousContinue,
setInvidiousContinue,
invidiousContinueAutoplay, getInvidiousContinueAutoplay, setInvidiousContinueAutoplay,
invidiousSpeed,
getInvidiousSpeed,
setInvidiousSpeed,
invidiousContinue, getInvidiousContinue, setInvidiousContinue,
invidiousQualityDash,
getInvidiousQualityDash,
setInvidiousQualityDash,
invidiousSpeed, getInvidiousSpeed, setInvidiousSpeed,
invidiousComments,
getInvidiousComments,
setInvidiousComments,
invidiousQualityDash, getInvidiousQualityDash, setInvidiousQualityDash,
invidiousCaptions,
getInvidiousCaptions,
setInvidiousCaptions,
invidiousComments, getInvidiousComments, setInvidiousComments,
invidiousRelatedVideos,
getInvidiousRelatedVideos,
setInvidiousRelatedVideos,
invidiousCaptions, getInvidiousCaptions, setInvidiousCaptions,
invidiousAnnotations,
getInvidiousAnnotations,
setInvidiousAnnotations,
invidiousRelatedVideos, getInvidiousRelatedVideos, setInvidiousRelatedVideos,
invidiousExtendDesc,
getInvidiousExtendDesc,
setInvidiousExtendDesc,
invidiousAnnotations, getInvidiousAnnotations, setInvidiousAnnotations,
invidiousVrMode,
getInvidiousVrMode,
setInvidiousVrMode,
invidiousExtendDesc, getInvidiousExtendDesc, setInvidiousExtendDesc,
invidiousSavePlayerPos,
getInvidiousSavePlayerPos,
setInvidiousSavePlayerPos,
invidiousVrMode, getInvidiousVrMode, setInvidiousVrMode,
} from './invidious-options.js';
import {
pipedBufferGoal,
getPipedBufferGoal,
setPipedBufferGoal,
invidiousSavePlayerPos, getInvidiousSavePlayerPos, setInvidiousSavePlayerPos,
pipedComments,
getPipedComments,
setPipedComments,
getPipedBufferGoal, setPipedBufferGoal,
pipedDisableLBRY,
getPipedDisableLBRY,
setPipedDisableLBRY,
getPipedComments, setPipedComments,
pipedEnabledCodecs,
getPipedEnabledCodecs,
setPipedEnabledCodecs,
getPipedDisableLBRY, setPipedDisableLBRY,
pipedHomepage,
getPipedHomepage,
setPipedHomepage,
getPipedEnabledCodecs, setPipedEnabledCodecs,
pipedMinimizeDescription,
getPipedMinimizeDescription,
setPipedMinimizeDescription,
getPipedHomepage, setPipedHomepage,
pipedProxyLBRY,
getPipedProxyLBRY,
setPipedProxyLBRY,
getPipedMinimizeDescription, setPipedMinimizeDescription,
pipedQuality,
getPipedQuality,
setPipedQuality,
getPipedProxyLBRY, setPipedProxyLBRY,
pipedRegion,
getPipedRegion,
setPipedRegion,
getPipedQuality, setPipedQuality,
pipedSelectedSkip,
getPipedSelectedSkip,
setPipedSelectedSkip,
getPipedRegion, setPipedRegion,
pipedSponsorblock,
getPipedSponsorblock,
setPipedSponsorblock,
getPipedSelectedSkip, setPipedSelectedSkip,
pipedWatchHistory,
getPipedWatchHistory,
setPipedWatchHistory,
getPipedSponsorblock, setPipedSponsorblock,
pipedInit
} from './piped-options.js';
import {
youtubeListen,
getYoutubeListen,
setYoutubeListen,
youtubeInit
} from './youtube-options.js';
getPipedWatchHistory, setPipedWatchHistory,
window.browser = window.browser || window.chrome;
volume, getVolume, setVolume,
youtubeAutoplay, getAutoplay, setAutoplay,
getPipedMaterialSkipToLastPoint, setPipedMaterialSkipToLastPoint,
initOptions
} from './options.js';
const targets = [
/^https?:\/\/(www\.|music\.|m\.|)youtube\.com(\/.*|$)/,
@ -164,7 +109,6 @@ let redirects = {
const getRedirects = () => redirects;
let applyThemeToSites;
function getCustomRedirects() {
return {
"invidious": {
@ -324,24 +268,6 @@ function setOnlyEmbeddedVideo(val) {
}
const getOnlyEmbeddedVideo = () => OnlyEmbeddedVideo;
let theme;
let volume;
const getVolume = () => volume;
function setVolume(val) {
volume = val;
browser.storage.local.set({ youtubeVolume: volume })
console.log("youtubeVolume: ", volume)
}
let autoplay;
const getAutoplay = () => autoplay;
function setAutoplay(val) {
autoplay = val;
browser.storage.local.set({ youtubeAutoplay: autoplay })
console.log("autoplay: ", autoplay)
}
let frontend;
const getFrontend = () => frontend;
function setFrontend(val) {
@ -687,7 +613,7 @@ function initInvidiousCookies() {
prefs.volume = parseInt(volume);
prefs.player_style = invidiousPlayerStyle;
prefs.autoplay = autoplay == 'true';
prefs.youtubeAutoplay = youtubeAutoplay == 'true';
browser.cookies.set({
url: instanceUrl,
@ -698,10 +624,9 @@ function initInvidiousCookies() {
)
}
let theme;
async function init() {
await youtubeInit();
await invidiousInit();
await pipedInit();
await initOptions();
return new Promise(
resolve => {
fetch('/instances/data.json').then(response => response.text()).then(data => {
@ -712,8 +637,6 @@ async function init() {
"disableYoutube",
"enableYoutubeCustomSettings",
"OnlyEmbeddedVideo",
"youtubeVolume",
"youtubeAutoplay",
"youtubeRedirects",
"youtubeFrontend",
@ -754,9 +677,6 @@ async function init() {
theme = r.theme ?? 'dark';
volume = r.youtubeVolume ?? 100;
autoplay = r.youtubeAutoplay ?? false;
OnlyEmbeddedVideo = r.OnlyEmbeddedVideo ?? 'both';
invidiousNormalRedirectsChecks = r.invidiousNormalRedirectsChecks ?? [...redirects.invidious.normal];
@ -919,6 +839,9 @@ export default {
getPipedWatchHistory,
setPipedWatchHistory,
getPipedMaterialSkipToLastPoint,
setPipedMaterialSkipToLastPoint,
getInvidiousNormalRedirectsChecks,
setInvidiousNormalRedirectsChecks,

View File

@ -17,9 +17,9 @@ function selectSkipModify(value, boolean) {
youtubeHelper.setPipedSelectedSkip(selectSkip)
}
let pipedSelectedSkipSponsorElement = document.getElementById("piped-selectedSkip-sponsor");
let pipedSelectedSkipSponsorElement = document.getElementById("piped-selectedSkip-sponsors");
pipedSelectedSkipSponsorElement.addEventListener("change",
event => selectSkipModify('sponsor', event.target.checked)
event => selectSkipModify('sponsors', event.target.checked)
);
let pipedSelectedSkipIntroElement = document.getElementById("piped-selectedSkip-intro");
@ -122,12 +122,83 @@ pipedProxyLBRYElement.addEventListener("change",
event => youtubeHelper.setPipedProxyLBRY(event.target.checked)
);
let pipedMaterialListenElement = document.getElementById("pipedMaterial-listen");
pipedMaterialListenElement.addEventListener("change",
event => youtubeHelper.setYoutubeListen(event.target.checked)
);
let pipedMaterialDisableLBRYElement = document.getElementById("pipedMaterial-disableLBRY");
pipedMaterialDisableLBRYElement.addEventListener("change",
event => youtubeHelper.setPipedDisableLBRY(event.target.checked)
);
let pipedMaterialProxyLBRYElement = document.getElementById("pipedMaterial-proxyLBRY");
pipedMaterialProxyLBRYElement.addEventListener("change",
event => youtubeHelper.setPipedProxyLBRY(event.target.checked)
);
let pipedMaterialSponsorblockElement = document.getElementById("pipedMaterial-sponsorblock");
pipedMaterialSponsorblockElement.addEventListener("change",
event => youtubeHelper.setPipedSponsorblock(event.target.checked)
);
let pipedMaterialSkipToLastPointElement = document.getElementById("pipedMaterial-skipToLastPoint");
pipedMaterialSkipToLastPointElement.addEventListener("change",
event => youtubeHelper.setPipedMaterialSkipToLastPoint(event.target.checked)
);
let pipedMaterialSelectedSkipSponsorElement = document.getElementById("pipedMaterial-selectedSkip-sponsors");
pipedMaterialSelectedSkipSponsorElement.addEventListener("change",
event => selectSkipModify('sponsors', event.target.checked)
);
let pipedMaterialSelectedSkipIntroElement = document.getElementById("pipedMaterial-selectedSkip-intro");
pipedMaterialSelectedSkipIntroElement.addEventListener("change",
event => selectSkipModify('intro', event.target.checked)
);
let pipedMaterialSelectedSkipOutroElement = document.getElementById("pipedMaterial-selectedSkip-outro");
pipedMaterialSelectedSkipOutroElement.addEventListener("change",
event => selectSkipModify('outro', event.target.checked)
);
let pipedMaterialSelectedSkipPreviewElement = document.getElementById("pipedMaterial-selectedSkip-preview");
pipedMaterialSelectedSkipPreviewElement.addEventListener("change",
event => selectSkipModify('preview', event.target.checked)
);
let pipedMaterialSelectedSkipInteractionElement = document.getElementById("pipedMaterial-selectedSkip-interaction");
pipedMaterialSelectedSkipInteractionElement.addEventListener("change",
event => selectSkipModify('interaction', event.target.checked)
);
let pipedMaterialSelectedSkipSelfpromoElement = document.getElementById("pipedMaterial-selectedSkip-selfpromo");
pipedMaterialSelectedSkipSelfpromoElement.addEventListener("change",
event => selectSkipModify('selfpromo', event.target.checked)
);
let pipedMaterialSelectedSkipMusicOfftopicElement = document.getElementById("pipedMaterial-selectedSkip-music_offtopic");
pipedMaterialSelectedSkipMusicOfftopicElement.addEventListener("change",
event => selectSkipModify('music_offtopic', event.target.checked)
);
let pipedMaterialSelectedSkipPoiHighlightElement = document.getElementById("pipedMaterial-selectedSkip-poi_highlight");
pipedMaterialSelectedSkipPoiHighlightElement.addEventListener("change",
event => selectSkipModify('poi_highlight', event.target.checked)
);
let pipedMaterialSelectedSkipFillerElement = document.getElementById("pipedMaterial-selectedSkip-filler");
pipedMaterialSelectedSkipFillerElement.addEventListener("change",
event => selectSkipModify('filler', event.target.checked)
);
let selectSkip = [];
youtubeHelper.init().then(() => {
pipedSponsorblockElement.checked = youtubeHelper.getPipedSponsorblock();
selectSkip = youtubeHelper.getPipedSelectedSkip();
pipedSelectedSkipSponsorElement.checked = selectSkip.includes('sponsor');
pipedSelectedSkipSponsorElement.checked = selectSkip.includes('sponsors');
pipedSelectedSkipIntroElement.checked = selectSkip.includes('intro');
pipedSelectedSkipOutroElement.checked = selectSkip.includes('outro');
pipedSelectedSkipPreviewElement.checked = selectSkip.includes('preview');
@ -148,6 +219,20 @@ youtubeHelper.init().then(() => {
pipedDisableLBRYElement.checked = youtubeHelper.getPipedDisableLBRY();
pipedProxyLBRYElement.checked = youtubeHelper.getPipedProxyLBRY();
pipedMaterialListenElement.checked = youtubeHelper.getYoutubeListen();
pipedMaterialDisableLBRYElement.checked = youtubeHelper.getPipedDisableLBRY();
pipedMaterialProxyLBRYElement.checked = youtubeHelper.getPipedProxyLBRY();
pipedMaterialSponsorblockElement.checked = youtubeHelper.getPipedSponsorblock()
pipedMaterialSkipToLastPointElement.checked = youtubeHelper.getPipedMaterialSkipToLastPoint();
pipedMaterialSelectedSkipSponsorElement.checked = selectSkip.includes('sponsors');
pipedMaterialSelectedSkipIntroElement.checked = selectSkip.includes('intro');
pipedMaterialSelectedSkipOutroElement.checked = selectSkip.includes('outro');
pipedMaterialSelectedSkipPreviewElement.checked = selectSkip.includes('preview');
pipedMaterialSelectedSkipInteractionElement.checked = selectSkip.includes('interaction');
pipedMaterialSelectedSkipSelfpromoElement.checked = selectSkip.includes('selfpromo');
pipedMaterialSelectedSkipMusicOfftopicElement.checked = selectSkip.includes('music_offtopic');
pipedMaterialSelectedSkipPoiHighlightElement.checked = selectSkip.includes('poi_highlight');
pipedMaterialSelectedSkipFillerElement.checked = selectSkip.includes('filler');
commonHelper.processDefaultCustomInstances(
'piped',

View File

@ -165,7 +165,7 @@
<div class="some-block option-block">
<h4>Autoplay Video</h4>
<input id="invidious-autoplay" type="checkbox" />
<input id="invidious-youtubeAutoplay" type="checkbox" />
</div>
<div class="some-block option-block">
@ -767,7 +767,7 @@
<div class="some-block option-block">
<h4>Skip Sponsors</h4>
<input id="piped-selectedSkip-sponsor" type="checkbox" />
<input id="piped-selectedSkip-sponsors" type="checkbox" />
</div>
<div class="some-block option-block">
@ -1134,6 +1134,80 @@
<div id="pipedMaterial">
<hr>
<div class="custom-settings">
<div class="some-block option-block">
<h4>Audio Only</h4>
<input id="pipedMaterial-listen" type="checkbox" />
</div>
<div class="some-block option-block">
<h4>Disable LBRY</h4>
<input id="pipedMaterial-disableLBRY" type="checkbox" />
</div>
<div class="some-block option-block">
<h4>Proxy LBRY videos</h4>
<input id="pipedMaterial-proxyLBRY" type="checkbox" />
</div>
<div class="some-block option-block">
<h4>Enable Sponsorblock</h4>
<input id="pipedMaterial-sponsorblock" type="checkbox" />
</div>
<div class="some-block option-block">
<h4>Skip to the last watched point when encountering a video already seen</h4>
<input id="pipedMaterial-skipToLastPoint" type="checkbox" />
</div>
<div class="some-block option-block">
<h4>Skip Sponsors</h4>
<input id="pipedMaterial-selectedSkip-sponsors" type="checkbox" />
</div>
<div class="some-block option-block">
<h4>Skip Intermission/Intro Animation</h4>
<input id="pipedMaterial-selectedSkip-intro" type="checkbox" />
</div>
<div class="some-block option-block">
<h4>Skip Endcards/Credits</h4>
<input id="pipedMaterial-selectedSkip-outro" type="checkbox" />
</div>
<div class="some-block option-block">
<h4>Skip Preview/Recap</h4>
<input id="pipedMaterial-selectedSkip-preview" type="checkbox" />
</div>
<div class="some-block option-block">
<h4>Skip Interaction Reminder (Subscribe)</h4>
<input id="pipedMaterial-selectedSkip-interaction" type="checkbox" />
</div>
<div class="some-block option-block">
<h4>Skip Unpaid/Self Promotion</h4>
<input id="pipedMaterial-selectedSkip-selfpromo" type="checkbox" />
</div>
<div class="some-block option-block">
<h4>Skip Music: Non-Music Section</h4>
<input id="pipedMaterial-selectedSkip-music_offtopic" type="checkbox" />
</div>
<div class="some-block option-block">
<h4>Skip Highlight</h4>
<input id="pipedMaterial-selectedSkip-poi_highlight" type="checkbox" />
</div>
<div class="some-block option-block">
<h4>Skip Filler Tangent</h4>
<input id="pipedMaterial-selectedSkip-filler" type="checkbox" />
</div>
<hr>
</div>
<div id="pipedMaterial-normal">
<div class="some-block option-block">
<h4>Default Instances</h4>

View File

@ -9,10 +9,8 @@ let freetubeYatteeDivElement = document.getElementById("freetube-yatte");
let customSettingsDivElement = document.getElementsByClassName("custom-settings");
function changeFrontendsSettings() {
console.log('changeFrontendsSettings()');
let frontend = youtubeFrontendElement.value;
console.log("customSettingsDivElement", customSettingsDivElement[0].style.display);
if (enableYoutubeCustomSettingsElement.checked)
for (const item of customSettingsDivElement) item.style.display = 'block';
else
@ -106,7 +104,7 @@ volumeElement.addEventListener("input",
}
);
let autoplayElement = document.getElementById("invidious-autoplay");
let autoplayElement = document.getElementById("invidious-youtubeAutoplay");
autoplayElement.addEventListener("change",
event => youtubeHelper.setAutoplay(event.target.checked)
);
@ -169,7 +167,7 @@ youtubeHelper.init().then(() => {
volumeValueElement.textContent = `${youtubeHelper.getVolume()}%`;
OnlyEmbeddedVideoElement.value = youtubeHelper.getOnlyEmbeddedVideo();
bypassWatchOnYoutubeElement.checked = youtubeHelper.getBypassWatchOnYoutube();
autoplayElement.value = youtubeHelper.getAutoplay();
autoplayElement.checked = youtubeHelper.getAutoplay();
let frontend = youtubeHelper.getFrontend();
youtubeFrontendElement.value = frontend;
changeFrontendsSettings();