1300

移行用のテストです

西野ブログ対策簡易版

このスクリプトは実験的なスクリプトです。デザイン上必要な改行やテキストなどが消える場合がありますのでご注意ください
let.hatelabo.jp

// ==UserScript==
// @title        nishino_ameblo_easy
// @name         nishino_ameblo_easy
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://ameblo.jp/nishino-akihiro/*
// @match        https://gamp.ameblo.jp/nishino-akihiro/*
// @grant        none
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js
// ==/UserScript==
//fbi前処理
var listArray7 = document.querySelectorAll('.skin-entryBody b,.skin-entryBody i,.skin-entryBody font,.entry-text b,.entry-text i');
for (var q = 0; q < listArray7.length; q++) {
  listArray7[q].classList.add("fbi");
}
var listArray12 = document.querySelectorAll('.fbi+br,.skin-entryBody a+br');
for (var f = 0; f < listArray12.length; f++) {
  listArray12[f].remove();
}
var listArray13 = document.querySelectorAll('.fbi+.fbi');
for (var n = 0; n < listArray13.length; n++) {
  listArray13[n].insertAdjacentHTML("beforebegin", "<span class='tomeo'></span>");
}
var result7 = document.evaluate('//*[@class="fbi"][./following-sibling::text() and not(./preceding-sibling::text())]', document, null, 7, null);
for (var o = 0; o < result7.snapshotLength; o++) {
  result7.snapshotItem(o).insertAdjacentHTML("beforebegin", "<div class='p_fbi'></div>");
}
var result8 = document.evaluate('//br[./preceding-sibling::text()][not(./following-sibling::* or ./preceding-sibling::*)]', document, null, 7, null);
for (var t = 0; t < result8.snapshotLength; t++) {
  result8.snapshotItem(t).remove();
}
var listArray8 = document.querySelectorAll('.skin-entryBody *[style]');
for (var r = 0; r < listArray8.length; r++) {
  listArray8[r].removeAttribute("style");
}
var listArray10 = document.querySelectorAll('.skin-entryBody font[color],.skin-entryBody font[face]');
for (var s = 0; s < listArray10.length; s++) {
  listArray10[s].removeAttribute("color");
  listArray10[s].removeAttribute("face");
}
//中抜き処理
if (!($('.skin-entryBody span:not(.tomeo)+span:not(.tomeo)').is('*'))) {
  var result = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]//br/ancestor::*[./ancestor::div[@class="skin-entryBody" or @class="entry-text"] and not(self::a) and not(self::font)]', document, null, 7, null);
  for (var i = 0; i < result.snapshotLength; i++) {
    result.snapshotItem(i).classList.add("anc");
  }
  var result2 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]//*[./text()]/ancestor::*[./ancestor::div[@class="skin-entryBody" or @class="entry-text"] and not(self::a) and not(self::font)]', document, null, 7, null);
  for (var j = 0; j < result2.snapshotLength; j++) {
    result2.snapshotItem(j).classList.add("anc");
  }
  $('.anc').replaceWith(function () {
    return $(this).contents();
  });
  //空div処理
  var result4 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]//text()', document, null, 7, null);
  for (var x = 0; x < result4.snapshotLength; x++) {
    if (/^\s+/g.test(result4.snapshotItem(x).nodeValue)) {
      if (/ /g.test(result4.snapshotItem(x).nodeValue)) {
        result4.snapshotItem(x).nodeValue = " ";
      } else {
        result4.snapshotItem(x).nodeValue = result4.snapshotItem(x).nodeValue.replace(/^\s+/g, "");
      }
    }
  }
  var result5 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]//*[self::div or self::span][contains(text()," ")][string-length(./text())<2]', document, null, 7, null);
  for (var y = 0; y < result5.snapshotLength; y++) {
    result5.snapshotItem(y).classList.add("div_br");
  }
  var listArray4 = document.querySelectorAll('.skin-entryBody>div:empty:not(.p_fbi)');
  for (var z = 0; z < listArray4.length; z++) {
    listArray4[z].remove();
  }
  var listArray5 = document.querySelectorAll('.entry-text>span[lang]');
  for (var e = 0; e < listArray5.length; e++) {
    listArray5[e].remove();
  }
  //a処理
  var result20 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]//a[./img or ./amp-img]/ancestor::*[not(self::td)][./ancestor::div[@class="skin-entryBody" or @class="entry-text"]]', document, null, 7, null);
  for (var w = 0; w < result20.snapshotLength; w++) {
    result20.snapshotItem(w).classList.add("anc_img");
  }
  $('.anc_img').contents().unwrap();
  var result15 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]/a[./img or ./amp-img]', document, null, 7, null);
  for (var g = 0; g < result15.snapshotLength; g++) {
    result15.snapshotItem(g).classList.add("a_img");
  }
  var result6 = document.evaluate('//a[contains(text(),"by")]|//a[.//*[contains(text(),"by")]]', document, null, 7, null);
  for (var l = 0; l < result6.snapshotLength; l++) {
    result6.snapshotItem(l).classList.add("a_by");
  }
  //td回り込み
  $(".skin-entryBody>td+a+div").next().addClass("td_after");
  var listArray = document.querySelectorAll('.skin-entryBody>.td_after');
  for (var a = 0; a < listArray.length; a++) {
    listArray[a].insertAdjacentHTML("afterend", "<div></div>");
  }
  //特殊タグ処理
  var listArray2 = document.querySelectorAll('.skin-entryBody>iframe');
  for (var b = 0; b < listArray2.length; b++) {
    listArray2[b].insertAdjacentHTML("beforebegin", "<div></div>");
    listArray2[b].insertAdjacentHTML("afterend", "<div></div>");
  }
  var listArray3 = document.querySelectorAll('.skin-entryBody>td');
  for (var c = 0; c < listArray3.length; c++) {
    listArray3[c].insertAdjacentHTML("beforebegin", "<div></div>");
  }
  //fbi後処理
  var listArray9 = document.querySelectorAll('.skin-entryBody font[size="2"]');
  for (var m = 0; m < listArray9.length; m++) {
    listArray9[m].classList.remove("fbi");
    listArray9[m].classList.add("f_size");
  }
  $('.fbi').wrap("<span class='s_fbi'></span>");
  $('.fbi').contents().unwrap();
  $('.s_fbi>.s_fbi').parent().contents().unwrap();
  var result18 = document.evaluate('//*[@class="s_fbi" or @class="f_size"][./br[not(./preceding-sibling::* or ./following-sibling::*)]]', document, null, 7, null);
  for (var u = 0; u < result18.snapshotLength; u++) {
    result18.snapshotItem(u).remove();
  }
  var result19 = document.evaluate('//a[./font[@class="f_size"]]', document, null, 7, null);
  for (var v = 0; v < result19.snapshotLength; v++) {
    result19.snapshotItem(v).classList.add("hide_block");
  }
  $('.s_fbi>a').parent().contents().unwrap();
  var listArray6 = document.querySelectorAll('.s_fbi+.s_fbi');
  for (var p = 0; p < listArray6.length; p++) {
    listArray6[p].classList.add("s2");
  }
  $(".s2").prev().addClass("s1");
  //横線処理
  var result16 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]//*[contains(text(),"━")]', document, null, 7, null);
  for (var h = 0; h < result16.snapshotLength; h++) {
    result16.snapshotItem(h).classList.add("l_yoko");
  }
  //生テキスト処理
  $(".skin-entryBody,.entry-text").contents().filter(function () {
    return this.nodeType === 3;
  }).wrap("<span class='n_text'></span>");
  var listArray11 = document.querySelectorAll('.entry-text>span:empty');
  for (var d = 0; d < listArray11.length; d++) {
    listArray11[d].remove();
  }
  //br_wrap処理
  $(".skin-entryBody>br").wrap("<div class='div_br'></div>");
  $(".entry-text>br").wrap("<div class='div_br'></div>");
  //last_br処理
  var result3 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]/*[not(contains(@class,"div_br"))][last()]', document, null, 7, null);
  for (var k = 0; k < result3.snapshotLength; k++) {
    result3.snapshotItem(k).classList.add("dsa_last");
  }
}

http://scratchpad.io/smoggy-wound-6709

@-moz-document url-prefix("https://ameblo.jp/nishino-akihiro/"), url-prefix("https://gamp.ameblo.jp/nishino-akihiro/") {
.skin-entryBody{margin:0;}
.skin-entryBody *{margin:0 !important;
font-size:1em !important;}
.skin-entryBody h2{font-size:1.5em !important;}

.js-blogGenreRank{display:none;}
.skin-entryHead{margin:0;}
.skin-entryThemes{margin:0;}
.hashtag-module-wrapper{display:none;}

.skin-blogMainInner{padding:0 !important;}
/*for gamp*/
.entry amp-img[src*="/user_images/"][layout="responsive"] {margin:0;}
article{padding:0 !important;}
article+div{display:none;}
article>div:first-child{margin:0;}
.entry-header__title{margin:0;}
.entry-text>.div_br {
  line-height: 1;
  display: block;
}
.entry-text b{font-weight:normal;}
.entry-text i{font-style:normal;}

.div_br+.div_br{display:none;}
.skin-entryBody>.div_br{line-height:1;}
.dsa_last~.div_br{display:none;}
.l_yoko {
  display: block;
  line-height: 1;
}
.a_img,.a_by{display:block;}
.f_size{display:block;}

/*for td*/
td{float:left;}
.td_after+div{clear:both;}

/*for fbi*/
.skin-entryBody b{font-weight:normal;}
.skin-entryBody i{font-style:normal;}
.s1+.s2{display:block;}

/*for text*/
.n_text+.n_text::before {
  content: "\A";
  white-space: pre;
}
/*for img*/
img[width="995"][height="1000"]{height:340px;object-fit:cover;object-position:50% 45%;}
}