Video Player Controls and Visual Overhaul | YouTube SponsorBlocker

in utopian-io •  5 years ago  (edited)

Repository

https://github.com/ajayyy/SponsorBlocker
https://github.com/ajayyy/SponsorBlockServer

image.png

Client

  • Changed the way it detects when a page is not YouTube and prevented lastError.

Before, it attempted to communicate with the tab right when the popup was open. However, if the tab was not a youtube.com tab, it would not have the content script added to receive the communications. This was fixed by only sending a message when the popup knows the tab is ready.

  • Made it not load the extension on the YouTube homepage and channel pages.

These pages don't have videos that need sponsors removed.

  • Added nice buttons to the popup

  • Made the sponsorships starts button update with the clear times button.

When you hit the "Sponsorship Starts Now" button, it transforms into "Sponsorship Ends Now", this should update whenever a change in what has been recorded has happened.

  • Made the button's nice on the notice and added a notice about the timeout.

image.png

  • Made it generate and submit a userID defining this user.

It uses a uuid generator and generates a uuid only if needed.

function getUserID(callback) {
  if (userID != null) {
    callback(userID);
  }

  //if it is not cached yet, grab it from storage
  chrome.storage.local.get(["userID"], function(result) {
    let userIDStorage = result.userID;
    if (userIDStorage != undefined) {
      userID = userIDStorage;
      callback(userID);
    } else {
      //generate a userID
      userID = generateUUID();
      
      //save this UUID
      chrome.storage.local.set({"userID": userID});

      callback(userID);
    }
  });
}
  • Made time have a zero in front when it is less than 10 seconds.

  • Made submit times not appear when no end time was specified.

This makes the "Submit Sponsor Times" button only be visible when something can be submitted to the database.

  • Added button on YouTube player and new icons to support that

image.png

By being a white icon, it does not stand out when in the player and looks normal.

  • Added option to hide the video player controls button in the popup.

  • Made options a hidden section in the popup.

hidden options.gif

Server

  • Added support for receiving a userID

  • Made the server save a hash of their ip with the data.

  • Added global salt for hashed ips

  • Added duplication check.

  • Made it save the time the data was submitted (in unix time)

  • Made error codes returned by the sever intuitive

It now reports correct codes such as error code 429 for a ratelimit.

  • Made it so that each user can only submit 4 sponsorship segments per video

This should help prevent spammers and trolls.

image.png

Pull Requests

https://github.com/ajayyy/SponsorBlocker/pull/1
https://github.com/ajayyy/SponsorBlockServer/pull/1

GitHub Account

https://github.com/ajayyy

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Good updates on both server and client.

I see you create xmlHttp requests to 'localhost' hardcoded in the client. I guess that would be a public server address once this goes into wider use. Making it a configuration and defaulting it to a public instance may be better.


Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Chat with us on Discord.

[utopian-moderator]

Oops, I do have a config setup for pulling, but maybe it's not used everywhere.

Thank you for your review, @emrebeyler! Keep up the good work!

Hi @ajayyy!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

Hey, @ajayyy!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

This post earned a total payout of 18.233$ and 13.709$ worth of author reward which was liquified using @likwid. To learn more.