Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

> Hi Guys! Please review @TienTim's upload to the AppStore as he proposed in #1568 #1606

Open
ImprovedTube opened this issue Mar 13, 2023 · 8 comments
Labels
Bug Bug or required update after YouTube changes up-for-grabs (a github standard for inviting new contributors) - Welcome! ♥ Youtube Premium z Safari occuring in Safari (only?)

Comments

@ImprovedTube
Copy link
Member

ImprovedTube commented Mar 13, 2023

We are on Apple! https://apps.apple.com/us/app/improved-tube/id1672777754 ( #1568 )

Hi Guys! Please review @TienTim's upload to the AppStore as he proposed in #1568

@h3nk387 @RobyRew @CorduroyZeus123 @augustobob @GameParrot @andyayya @Raid13577

If we have an AppStore account later, as an organisation, then this App can be transfered in place.

many smiles!

I have installed on my both Macs and too far too good is working, tomorrow ill review on AppStore,
for now I have a small issue, where I can report the bug?
Screen Shot 2023-03-13 at 19 59 52

as you can see the buttons are just super small and everything is disordered and some hidden.

Originally posted by @RobyRew in #494 (comment)

@ImprovedTube ImprovedTube added Bug Bug or required update after YouTube changes z Safari occuring in Safari (only?) Youtube Premium labels Mar 13, 2023
@ImprovedTube
Copy link
Member Author

ImprovedTube commented Mar 13, 2023

Hi @RobyRew, thanks! With sidebar on the left only? (Or even with no features enabled?) So maybe thats our first a safari specific bug-report, yet more likely it is through difference in youtube premium?

@RobyRew
Copy link

RobyRew commented Mar 14, 2023

Hi @RobyRew, thanks! With sidebar on the left only? (Or even with no features enabled?) Assumably thats our first a safari specific bug-report

Just uploaded the first big update since several month to the repo latest @TienTim you can upload it (Wont ask often 😆) Thanks again!

It looks like its there anyway, I found why, its has something to do with (Return YouTube Dislike by Anarios & JRWR): https://github.com/Anarios/return-youtube-dislike/raw/main/Extensions/UserScript/Return%20Youtube%20Dislike.user.js

I have it installed with Tampermonkey, these settings control a little about the grey bar , im not sure what to do to fix Return Dislike Button.
image

Soo the extension ImprovedTube works perfectly, is the other extension that is conflicting with.

Youtube with ImprovedTube OFF, and Return Dislike Button ON:
image

Youtube with ImprovedTube ON, and Return Dislike Button OFF:
image

Youtube with ImprovedTube ON, and Return Dislike Button ON:
image

SUGGESTIONS?

@ImprovedTube
Copy link
Member Author

interesting if it only happens with both extensions & in Safari.
you can try to disable our"buttons below the player" (in the end of our the player menu), just to see if itt makes a difference

@RobyRew
Copy link

RobyRew commented Mar 27, 2023

ANY difference, thanks!

However digging in on the Return Youtube Dislike Extension

I found that the extension creates the like-dislike ratio bar on the function:
function createRateBar(likes, dislikes) on line 308 (version 3.1.1)

soo I commented all other places that call that function:
lines: 417, 455, 462, 466, 483, 488, 494

Now the bar disappeared, Maybe in the future ill play with DOM to position the bar under that div to be compatible with Improved for Youtube Extension.

But yeah that was the fix. This is solved.

image

@ImprovedTube
Copy link
Member Author

@RobyRew Also: #1616 @sapondanaisriwan

@RobyRew
Copy link

RobyRew commented Mar 29, 2023

okay, Ignore this comment #1485903762, I added this code and fully fixes the problem:

      // Adds support for Improved YouTubeTube Extension
      document.getElementById("menu-container").style.display = 'block';

On the Return Dislike YouTube Script on the createBar(likes, dislikes) function, so now the full function without the need to hide anything looks like this:

Full Function createRateBar(like, dislikes)

function createRateBar(likes, dislikes) {
  if (isMobile) {
    return;
  }
  let rateBar = document.getElementById("return-youtube-dislike-bar-container");

  const widthPx =
    getButtons().children[0].clientWidth +
    getButtons().children[1].clientWidth +
    8;

  const widthPercent =
    likes + dislikes > 0 ? (likes / (likes + dislikes)) * 100 : 50;

  var likePercentage = parseFloat(widthPercent.toFixed(1));
  const dislikePercentage = (100 - likePercentage).toLocaleString();
  likePercentage = likePercentage.toLocaleString();

  var tooltipInnerHTML;
  switch (extConfig.tooltipPercentageMode) {
    case "dash_like":
      tooltipInnerHTML = `${likes.toLocaleString()} / ${dislikes.toLocaleString()}  -  ${likePercentage}%`;
      break;
    case "dash_dislike":
      tooltipInnerHTML = `${likes.toLocaleString()} / ${dislikes.toLocaleString()}  -  ${dislikePercentage}%`;
      break;
    case "both":
      tooltipInnerHTML = `${likePercentage}% / ${dislikePercentage}%`;
      break;
    case "only_like":
      tooltipInnerHTML = `${likePercentage}%`;
      break;
    case "only_dislike":
      tooltipInnerHTML = `${dislikePercentage}%`;
      break;
    default:
      tooltipInnerHTML = `${likes.toLocaleString()} / ${dislikes.toLocaleString()}`;
  }

  if (!rateBar && !isMobile) {
    let colorLikeStyle = "";
    let colorDislikeStyle = "";
    if (extConfig.coloredBar) {
      colorLikeStyle = "; background-color: " + getColorFromTheme(true);
      colorDislikeStyle = "; background-color: " + getColorFromTheme(false);
    }
      // Adds support for Improved YouTubeTube Extension
      document.getElementById("menu-container").style.display = 'block';

    document.getElementById("menu-container").insertAdjacentHTML(
      "beforeend",
      `
        <div class="ryd-tooltip" style="width: ${widthPx}px">
        <div class="ryd-tooltip-bar-container">
           <div
              id="return-youtube-dislike-bar-container"
              style="width: 100%; height: 2px;${colorDislikeStyle}"
              >
              <div
                 id="return-youtube-dislike-bar"
                 style="width: ${widthPercent}%; height: 100%${colorDislikeStyle}"
                 ></div>
           </div>
        </div>
        <tp-yt-paper-tooltip position="top" id="ryd-dislike-tooltip" class="style-scope ytd-sentiment-bar-renderer" role="tooltip" tabindex="-1">
           <!--css-build:shady-->${tooltipInnerHTML}
        </tp-yt-paper-tooltip>
        </div>
`
    );
  } else {
    document.getElementById(
      "return-youtube-dislike-bar-container"
    ).style.width = widthPx + "px";
    document.getElementById("return-youtube-dislike-bar").style.width =
      widthPercent + "%";

    document.querySelector("#ryd-dislike-tooltip > #tooltip").innerHTML =
      tooltipInnerHTML;

    if (extConfig.coloredBar) {
      document.getElementById(
        "return-youtube-dislike-bar-container"
      ).style.backgroundColor = getColorFromTheme(false);
      document.getElementById(
        "return-youtube-dislike-bar"
      ).style.backgroundColor = getColorFromTheme(true);
    }
  }
}

Example HERE:
image

@ImprovedTube
Copy link
Member Author

Hi! @RobyRew 👍
so we - or Return Dislikes still need
#menu-container {display: block;}
, right?

@RobyRew
Copy link

RobyRew commented Mar 30, 2023

Hi,

yes, that's correct! 😊

@ImprovedTube ImprovedTube added the up-for-grabs (a github standard for inviting new contributors) - Welcome! ♥ label Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug or required update after YouTube changes up-for-grabs (a github standard for inviting new contributors) - Welcome! ♥ Youtube Premium z Safari occuring in Safari (only?)
Projects
None yet
Development

No branches or pull requests

2 participants