hanime - avatar & banner helper

This scripts lets you open avatar and banner in a new tab when you click on them.

As of 2022-11-11. See the latest version.

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 or Violentmonkey 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.

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.

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

// ==UserScript==
// @name        hanime - avatar & banner helper
// @namespace   https://myanimelist.net/profile/kyoyatempest
// @match       https://hanime.tv/channel/*
// @match     https://hanime.tv/channels/*
// @version     1.2
// @author      kyoyatempest (Kyoya) <https://anilist.co/kyoyacchi>
// @description This scripts lets you open avatar and banner in a new tab when you click on them.
// @icon        https://hanime.tv/favicon.ico
// @license gpl-3.0
// ==/UserScript==

window.onload = function () {

let v = document.querySelector(".avatar__image")

let url = document.querySelector(".avatar__image").style.backgroundImage.split('"')[1]

v.setAttribute("href",url)

v.onclick = function () {
  if (url) {
window.open(url, "_blank")

  }
}


let banner =document.querySelector(".channel__banner")// document.getElementsByClassName("channel__banner__bg_overlay")[0]
let bannerurl = document.getElementsByClassName("channel__banner__bg_overlay")[0].style.backgroundImage.split('"')[1]

banner.setAttribute("href",bannerurl)
//if (!bannerurl) bannerurl = null

banner.onclick = function () {
  if (bannerurl == "https://static-assets-44d.pages.dev/images/temp_bg_top.png") {//default
    return
  } else {
// if (bannerurl) {
   window.open(bannerurl,"_blank")
 }
 // }
  //
}

}