Better PornHub.com

Make video player large by default and scroll to video but only if you're on top while loading the page - 6/21/2021, 10:43:58 AM

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name        Better PornHub.com
// @namespace   Violentmonkey Scripts
// @match       https://www.pornhub.com/view_video.php
// @grant       none
// @version     1.0
// @author      -
// @description Make video player large by default and scroll to video but only if you're on top while loading the page - 6/21/2021, 10:43:58 AM
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js
// ==/UserScript==

// PornHub has jQuery under $j, but it only shows up after a while.
this.$ = jQuery.noConflict(true)

$("div#player").ready(function () {
  player_div = $("div#player")
  
  if(! player_div.hasClass("wide")) {
    player_key = Object.keys(MGP.players)[0]
    
    // enlarge player to wide version
    MGP.players[player_key].settings().events.expandPlayer()
    
    // scroll to player, but only if we're at the top of the page when we load it
    if($("html").scrollTop() == 0) {
      $("html").animate({
        scrollTop: player_div.offset().top - 5
      }, 10);
    }
  }
})