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

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==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);
    }
  }
})