/*
* @title 勝手にスター
* @description 勝手に はてなスターを置きます
* @include http://*
* @include https://*
* @license MIT License
* @javascript_url
*/
// inspired by http://let.hatelabo.jp/noromanba/let/gYC-xcvQ3PTQew
(() => {
const d_ = document
if (! d_.querySelector('script[src*="s.hatena.ne.jp/js/HatenaStar.js"]')) {
d_.head.appendChild(Object.assign(d_.createElement("script"), {
type: "text/javascript",
src: "//s.hatena.ne.jp/js/HatenaStar.js",
onload: function() {
let e = d_.querySelector("h1,h2,h3,h4,h5,h6")
Hatena.Star.SiteConfig = {
entryNodes: {}
}
Hatena.Star.SiteConfig.entryNodes[ e.tagName ] = {
uri: "document.location",
title: "document.title",
container: "parent",
}
new Hatena.Star.EntryLoader();
},
}))
} else {
console.log("already Hatena.Star exists !")
}
})()