Greasy Fork is available in English.
Adds a button to the top of the movie genre page to open the chart.
当前为
// ==UserScript==
// @name Rateyourmusic Movie Genre Chart Button
// @license GPLv3
// @description Adds a button to the top of the movie genre page to open the chart.
// @run-at document-start
// @version 1.1.2
// @match *://rateyourmusic.com/film_genre/*
// @namespace http://greasyfork.icu/users/908137
// ==/UserScript==
// Genre names that also describe a music genre need a "-1" appended in the chart URL to differentiate them
const ADD_ONE = ["comedy", "experimental", "satire"];
function init(f) {
let genreName = window.location.pathname
.replaceAll("+", "-")
.split("/")[2]
.toLowerCase();
let a = document.createElement("a");
a.innerHTML = "View genre chart";
a.href = `https://rateyourmusic.com/charts/top/film/all-time/g:${genreName}`;
if (ADD_ONE.includes(genreName)) a.href = a.href.concat("-1");
a.style = "display: inline-block; float: right;";
f.appendChild(a);
}
window.addEventListener("load", function () {
const frame = document.getElementById("page_breadcrumb");
init(frame);
});