Skip to content

Commit

Permalink
Fixed rename icon; added more hooks for detecting page navigation; up…
Browse files Browse the repository at this point in the history
…dated YouTube metadata selectors; updated browser check for muted
  • Loading branch information
Bill13579 committed Sep 6, 2024
1 parent 1c8333a commit 49a36f5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dist/popup/popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ input[type="text"]:focus {
}
.-tui-menu-item {
display: inline-block;
/* height: calc(26px * var(--scale)); */
height: calc(26px * var(--scale));
line-height: calc(26px * var(--scale));
padding-left: 8px;
padding-right: calc(8px + 4.5px);
Expand All @@ -229,7 +229,7 @@ input[type="text"]:focus {
vertical-align: middle;

mask-repeat: no-repeat;
mask-size: contain;
/* mask-size: contain; */
}
.-tui-menu-item .-tui-menu-item-label {
color: var(--fg-lite);
Expand Down
2 changes: 2 additions & 0 deletions src/background/captureTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ const webNavigationListener = async ({tabId, url}) => {
});
};
browser.webNavigation.onHistoryStateUpdated.addListener(webNavigationListener);
browser.webNavigation.onReferenceFragmentUpdated.addListener(webNavigationListener);
browser.webNavigation.onCompleted.addListener(webNavigationListener);
browser.tabs.onUpdated.addListener((tabId, {url}, _) => webNavigationListener({tabId, url}));

browser.tabs.onRemoved.addListener((tabId, _) => {
let updatePromise = lastUpdatePromise;
Expand Down
4 changes: 2 additions & 2 deletions src/content/packd.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ function waitForElementValueToChange(element) {
const MUTATION_OBSERVERS = {
"www.youtube.com": () => new Promise(async (resolve, reject) => {
if (window.location.pathname.startsWith("/watch")) {
let ele = document.querySelector('#meta-contents #description yt-formatted-string.content');
let ele = document.querySelector('ytd-watch-metadata');
if (ele) {
let value = await waitForElementValueToChange(ele);
resolve(value);
} else {
let value = await waitForElementToExist('#meta-contents #description yt-formatted-string.content');
let value = await waitForElementToExist('ytd-watch-metadata');
resolve(value.textContent);
}
} else {
Expand Down
2 changes: 2 additions & 0 deletions src/tapi/ttab.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ export class TTab {
prefs.discarded = ttab.discarded;
prefs.openInReaderMode = ttab.isInReaderMode;
prefs.title = ttab.discarded ? ttab.title : undefined;
}
if (TargetBrowser === "firefox" || TargetBrowser === "webext") {
prefs.muted = ttab.mutedInfo.muted;
}
return browser.tabs.create(prefs);
Expand Down

0 comments on commit 49a36f5

Please sign in to comment.