Upgrade maze-utils, move video element refreshes to lib

This commit is contained in:
Ajay
2023-04-27 15:18:17 -04:00
parent e31efbbf81
commit 7768447ab0
3 changed files with 9 additions and 12 deletions

14
package-lock.json generated
View File

@@ -27,7 +27,7 @@
], ],
"license": "LGPL-3.0-or-later", "license": "LGPL-3.0-or-later",
"dependencies": { "dependencies": {
"@ajayyy/maze-utils": "1.1.11", "@ajayyy/maze-utils": "1.1.22",
"content-scripts-register-polyfill": "^4.0.2", "content-scripts-register-polyfill": "^4.0.2",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0" "react-dom": "^18.2.0"
@@ -67,9 +67,9 @@
} }
}, },
"node_modules/@ajayyy/maze-utils": { "node_modules/@ajayyy/maze-utils": {
"version": "1.1.11", "version": "1.1.22",
"resolved": "https://registry.npmjs.org/@ajayyy/maze-utils/-/maze-utils-1.1.11.tgz", "resolved": "https://registry.npmjs.org/@ajayyy/maze-utils/-/maze-utils-1.1.22.tgz",
"integrity": "sha512-hHXqKpPG92c8efvYYmYfjKHhoEaURLJEaK2URIaSAqmxYaFX46hdgyQ/DWMDRx1ffbi49uZ84fOwjFLsyhG5cw==", "integrity": "sha512-1BLVVqPHkf+mUlutFiKulQAa1Rt/IJ88ahwIYUAYkBrAVG0T5i75jEzHatsxdILYsg4bxDEpnUcOlrhvhSIdRQ==",
"funding": [ "funding": [
{ {
"type": "individual", "type": "individual",
@@ -13858,9 +13858,9 @@
}, },
"dependencies": { "dependencies": {
"@ajayyy/maze-utils": { "@ajayyy/maze-utils": {
"version": "1.1.11", "version": "1.1.22",
"resolved": "https://registry.npmjs.org/@ajayyy/maze-utils/-/maze-utils-1.1.11.tgz", "resolved": "https://registry.npmjs.org/@ajayyy/maze-utils/-/maze-utils-1.1.22.tgz",
"integrity": "sha512-hHXqKpPG92c8efvYYmYfjKHhoEaURLJEaK2URIaSAqmxYaFX46hdgyQ/DWMDRx1ffbi49uZ84fOwjFLsyhG5cw==" "integrity": "sha512-1BLVVqPHkf+mUlutFiKulQAa1Rt/IJ88ahwIYUAYkBrAVG0T5i75jEzHatsxdILYsg4bxDEpnUcOlrhvhSIdRQ=="
}, },
"@ampproject/remapping": { "@ampproject/remapping": {
"version": "2.2.0", "version": "2.2.0",

View File

@@ -4,7 +4,7 @@
"description": "", "description": "",
"main": "background.js", "main": "background.js",
"dependencies": { "dependencies": {
"@ajayyy/maze-utils": "1.1.11", "@ajayyy/maze-utils": "1.1.22",
"content-scripts-register-polyfill": "^4.0.2", "content-scripts-register-polyfill": "^4.0.2",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0" "react-dom": "^18.2.0"

View File

@@ -36,7 +36,7 @@ import { ChapterVote } from "./render/ChapterVote";
import { openWarningDialog } from "./utils/warnings"; import { openWarningDialog } from "./utils/warnings";
import { waitFor } from "@ajayyy/maze-utils"; import { waitFor } from "@ajayyy/maze-utils";
import { getFormattedTime } from "@ajayyy/maze-utils/lib/formating"; import { getFormattedTime } from "@ajayyy/maze-utils/lib/formating";
import { setupVideoMutationListener, getChannelIDInfo, getVideo, refreshVideoAttachments, getIsAdPlaying, getIsLivePremiere, setIsAdPlaying, checkVideoIDChange, getVideoID, getYouTubeVideoID, setupVideoModule, checkIfNewVideoID, isOnInvidious, isOnMobileYouTube } from "@ajayyy/maze-utils/lib/video"; import { getChannelIDInfo, getVideo, getIsAdPlaying, getIsLivePremiere, setIsAdPlaying, checkVideoIDChange, getVideoID, getYouTubeVideoID, setupVideoModule, checkIfNewVideoID, isOnInvidious, isOnMobileYouTube } from "@ajayyy/maze-utils/lib/video";
import { StorageChangesObject } from "@ajayyy/maze-utils/lib/config"; import { StorageChangesObject } from "@ajayyy/maze-utils/lib/config";
import { findValidElement } from "@ajayyy/maze-utils/lib/dom" import { findValidElement } from "@ajayyy/maze-utils/lib/dom"
import { getHash, HashedValue } from "@ajayyy/maze-utils/lib/hash"; import { getHash, HashedValue } from "@ajayyy/maze-utils/lib/hash";
@@ -993,7 +993,6 @@ function setupCategoryPill() {
async function sponsorsLookup(keepOldSubmissions = true) { async function sponsorsLookup(keepOldSubmissions = true) {
if (lookupWaiting) return; if (lookupWaiting) return;
if (!getVideo() || !isVisible(getVideo())) refreshVideoAttachments();
//there is still no video here //there is still no video here
if (!getVideo()) { if (!getVideo()) {
lookupWaiting = true; lookupWaiting = true;
@@ -1004,8 +1003,6 @@ async function sponsorsLookup(keepOldSubmissions = true) {
return; return;
} }
setupVideoMutationListener();
const categories: string[] = Config.config.categorySelections.map((category) => category.name); const categories: string[] = Config.config.categorySelections.map((category) => category.name);
const extraRequestData: Record<string, unknown> = {}; const extraRequestData: Record<string, unknown> = {};