change update video to youtube embed with auto ad skipping and looping

This commit is contained in:
Seth Burkart
2024-06-08 21:51:08 +10:00
parent 24ff97a548
commit 594ab9bc1d
5 changed files with 122 additions and 12 deletions
+11
View File
@@ -1,6 +1,7 @@
import browser from 'webextension-polyfill'
import { onError } from './seqta/utils/onError';
import { SettingsState } from "./types/storage";
import { applyYoutubeStyles } from './seqta/ui/VideoLoader';
export const openDB = () => {
return new Promise((resolve, reject) => {
@@ -118,6 +119,16 @@ browser.runtime.onMessage.addListener((request: any, _sender: any, sendResponse:
GetNews(sendResponse, url);
return true;
case 'youtubeIframe':
const { hideControls } = request;
browser.scripting.executeScript({
target: { tabId: _sender.tab.id, allFrames: true },
func: applyYoutubeStyles,
args: [hideControls]
});
break;
default:
console.log('Unknown request type');