Skip to content

Commit

Permalink
Closes #951
Browse files Browse the repository at this point in the history
  • Loading branch information
ParticleCore committed Mar 1, 2024
1 parent e135560 commit 0abb930
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/chrome/js/background-inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ function mainScript(extensionId, SettingData, defaultSettings) {

const updatePosition = () => {

if (!isAlwaysVisible() || !moviePlayer) {
if (!iridiumSettings.alwaysVisible || !isAlwaysVisible() || !moviePlayer) {
return;
}

Expand Down Expand Up @@ -933,7 +933,11 @@ function mainScript(extensionId, SettingData, defaultSettings) {
updatePosition();
}

if (!document.fullscreenElement && window.location.pathname === "/watch" && parentRects.bottom < parentRects.height * .5) {
if (iridiumSettings.alwaysVisible
&& !document.fullscreenElement
&& window.location.pathname === "/watch"
&& parentRects.bottom < parentRects.height * .5
) {
if (!isAlwaysVisible()) {
document.documentElement.setAttribute("always-visible-player", "");
window.addEventListener("mousedown", onMouseDown, true);
Expand Down
8 changes: 6 additions & 2 deletions src/firefox/js/background-inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ function mainScript(extensionId, SettingData, defaultSettings) {

const updatePosition = () => {

if (!isAlwaysVisible() || !moviePlayer) {
if (!iridiumSettings.alwaysVisible || !isAlwaysVisible() || !moviePlayer) {
return;
}

Expand Down Expand Up @@ -933,7 +933,11 @@ function mainScript(extensionId, SettingData, defaultSettings) {
updatePosition();
}

if (!document.fullscreenElement && window.location.pathname === "/watch" && parentRects.bottom < parentRects.height * .5) {
if (iridiumSettings.alwaysVisible
&& !document.fullscreenElement
&& window.location.pathname === "/watch"
&& parentRects.bottom < parentRects.height * .5
) {
if (!isAlwaysVisible()) {
document.documentElement.setAttribute("always-visible-player", "");
window.addEventListener("mousedown", onMouseDown, true);
Expand Down

0 comments on commit 0abb930

Please sign in to comment.