Skip to content

Instantly share code, notes, and snippets.

@tetsutan
Last active May 17, 2020 14:24
Show Gist options
  • Save tetsutan/448e251d4c2366ab0fd2 to your computer and use it in GitHub Desktop.
Save tetsutan/448e251d4c2366ab0fd2 to your computer and use it in GitHub Desktop.
HatenaKeywordDisabler.user.js
// ==UserScript==
// @name HatenaKeywordDisabler
// @namespace com.eckrel.hatenakeyworddisabler
// @include http://*.hatelabo.jp/*
// @include http://*.hatena.ne.jp/*
// @include https://*.hatelabo.jp/*
// @include https://*.hatena.ne.jp/*
// @version 1.1
// @grant none
// ==/UserScript==
var as = document.querySelectorAll("a");
for(i=0; i<as.length; i++){
var atag = as[i];
if(atag.href && atag.pathname.startsWith("/keyword/") && atag.parentNode){
var textNode = document.createElement("span");
textNode.innerHTML = atag.innerHTML;
atag.parentNode.replaceChild(textNode, atag);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment