Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Commit

Permalink
fix: reset code to eval after update
Browse files Browse the repository at this point in the history
  • Loading branch information
madkarmaa committed Feb 3, 2024
1 parent 0a1bd48 commit 962faf1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions script.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// @match *://*.youtube.com/*
// @connect co.wuk.sh
// @connect raw.githubusercontent.com
// @grant GM_info
// @grant GM_addStyle
// @grant GM_getValue
// @grant GM_setValue
Expand Down Expand Up @@ -538,6 +539,13 @@ input {
document.body.appendChild(menuPopup);
logger('Menu created', menuPopup);

logger('Detecting updates');
if (GM_info.script.version !== localStorage.getItem('yt-dl-version')) {
resetButton.click();
localStorage.setItem('yt-dl-version', GM_info.script.version);
logger('Version updated in localStorage');
} else logger('Version up to date in localStorage');

['yt-navigate', 'yt-navigate-finish'].forEach((evName) =>
document.addEventListener(evName, (e) => {
YOUTUBE_SERVICE = updateService();
Expand Down

0 comments on commit 962faf1

Please sign in to comment.