1300

移行用のテストです

西野ブログ内リンクJS化

// ==UserScript==
// @name         nishino_ameblo_link
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://ameblo.jp/nishino-akihiro/*
// @grant        none
// ==/UserScript==
var result = document.evaluate('//a[contains(@href,"/nishino-akihiro/")]', document, null, 7, null);
for (var i = 0; i < result.snapshotLength; i++) {
  result.snapshotItem(i).addEventListener('click', sample, false);
  result.snapshotItem(i).dataset.href = result.snapshotItem(i).href;
  result.snapshotItem(i).href = "javascript:void(0);";
}

function sample() {
  location.href = this.dataset.href;
}

if (/\?/g.test(location.href)) {
  var new_url = location.href.replace(/\?.*$/, "");
  location.href = new_url;
}