youtube: shorts view => regular view

3/15/2022, 10:19:34 PM

اعتبارا من 15-03-2022. شاهد أحدث إصدار.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name        youtube: shorts view => regular view
// @namespace   Violentmonkey Scripts
// @include     https://*.youtube.*
// @version     1.1
// @author      KraXen72
// @grant       GM_registerMenuCommand
// @description 3/15/2022, 10:19:34 PM
// ==/UserScript==

function shortsRegularView() {
  url = window.location.href
  parts = url.split("/")
    .filter(part => part !== "")
  shortsIndex = parts.indexOf("shorts")
  idIndex = shortsIndex + 1
  
  newurl = `https://youtube.com/watch?v=${parts[idIndex]}`
  window.location.href = newurl
  
  console.log("href:", parts)
  
}

// actionsDiv = document.querySelector("#actions")
// button = document.createElement("button")
// button.onclick = shortsRegularView

// button.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#FFFFFF"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 14.5v-9l6 4.5-6 4.5z"/></svg>`
// actionsDiv.appendChild(button)

GM_registerMenuCommand("Go to regular view", shortsRegularView)