1300

移行用のテストです

西野ブログ対策

後方空白対策

// ==UserScript==
// @name         nishino_ameblo
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://ameblo.jp/nishino-akihiro/entry*
// @grant        none
// ==/UserScript==
var result = document.evaluate('//div[@class="skin-entryBody"]//div[not(@contenteditable)]',document, null, 7, null);
for(var i=0;i<result.snapshotLength;i++)
{
result.snapshotItem(i).removeAttribute("style");
 }
document.body.innerHTML=document.body.innerHTML.replace(/<div><br><\/div>/g, '<br>');
/*var result2 = document.evaluate('//div[@class="skin-entryBody"]/descendant::div[1][string-length(./preceding-sibling::text()[1])>8][not(.//img or ./span or ./preceding-sibling::iframe)]',document, null, 7, null);
result2.snapshotItem(0).classList.add("top_dir");*/
@-moz-document url-prefix("https://ameblo.jp/nishino-akihiro/") {
.skin-entryBody br+br{display:none;}
/*.skin-entryBody br:last-of-type:first-of-type{display:none;}
.skin-entryBody div:last-of-type>br:first-child{display:none;}*/
.skin-entryBody div:last-of-type:not(:first-of-type)>br:first-child{display:none;}
.skin-entryBody div:last-of-type:not(:first-of-type)+br{display:none;}
.skin-entryBody br+div>br:first-child:not(:last-of-type){display:none;}
.skin-entryBody br+div>br:only-of-type{display:none;}
.skin-entryBody>div:only-of-type+br{display:none;}
/*.skin-entryBody span br{display:none;}*/
.skin-entryBody>iframe+br{margin-bottom:1.6em;}
div[contenteditable]+br{display:none !important;}
.skin-entryBody *{font-size:medium !important;}
/*.top_dir{margin-top:1.6em;}
.top_dir>br:first-child{display:none;}*/
.LazyLoad{display:none;}
.js-blogGenreRank{display:none;}
.skin-entryBody{margin:0;padding:0;}
.skin-entryHead{margin:0;padding:0;}
.hashtag-module-borderTop{margin:0;padding:0;}
}

空div対策

// ==UserScript==
// @name         nishino_ameblo_kdiv
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://ameblo.jp/nishino-akihiro/entry*
// @grant        none
// ==/UserScript==
var result = document.evaluate('//div[@class="skin-entryBody"]//div[string-length(text())=1][not(./*)]',document, null, 7, null);
for(var i=0;i<result.snapshotLength;i++)
	{
  		result.snapshotItem(i).classList.add("k_div");
    }
window.addEventListener('load', function() {
var result2 = document.evaluate('//div[@class="skin-entryBody"]/descendant::div[last()][@class="k_div"]',document, null, 7, null);
result2.snapshotItem(0).remove();
    })
.k_div+.k_div{display:none;}
br+.k_div{display:none;}
.k_div+br{display:none;}

lastdiv削除

// ==UserScript==
// @name         nishino_ameblo_ldiv
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://ameblo.jp/nishino-akihiro/entry*
// @grant        none
// ==/UserScript==
window.addEventListener('load', function() {
/*var result = document.evaluate('//div[@class="skin-entryBody"]//div[not(.//text() or .//img or .//iframe)]',document, null, 7, null);
for(var i=0;i<result.snapshotLength;i++)
	{
  		result.snapshotItem(i).remove();
    }*/
var result = document.evaluate('//div[@class="skin-entryBody"]//div[not(.//text() or .//img or .//iframe)]',document, null, 7, null);
for(var i=0;i<result.snapshotLength;i++)
	{
  		result.snapshotItem(i).classList.add("div_br");
    }

    var result2 = document.evaluate('//div[@class="skin-entryBody"]//div[not(@class)][last()]/following-sibling::div[@class="div_br"]',document, null, 7, null);
    for(var j=0;j<result2.snapshotLength;j++)
	{
  		result2.snapshotItem(j).remove()
    }
})

画像回りの改行復元

// ==UserScript==
// @name         nishino_ameblo_imgbr
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://ameblo.jp/nishino-akihiro/entry*
// @grant        none
// ==/UserScript==
window.addEventListener('load', function() {
var result2 = document.evaluate('//div[@class="skin-entryBody"]//a[./following-sibling::br]/img[./ancestor::div[1][not(@class)]]',document, null, 7, null);
for(var i=0;i<result2.snapshotLength;i++)
{
result2.snapshotItem(i).classList.add("img_br");
 }
    /*var result3 = document.evaluate('//div[@class="skin-entryBody"][count(.//img)>1]/descendant::img[last()][@class="img_br"]',document, null, 7, null);
    result3.snapshotItem(0).removeAttribute("class");*/

    /*var result4 = document.evaluate('//div[@class="skin-entryBody"]/a[./img]',document, null, 7, null);
    for(var j=0;j<result4.snapshotLength;j++){
    result4.snapshotItem(j).nextElementSibling.classList.add("img_a_after");
    }*/
    var result4 = document.evaluate('//div[@class="skin-entryBody"]//a[./img]',document, null, 7, null);
    for(var j=0;j<result4.snapshotLength;j++){
    result4.snapshotItem(j).classList.add("img_a")
    }

    var result5 = document.evaluate('//div[@class="skin-entryBody"]//img[@class="img_br"]/ancestor::div[not(@class or @id)]',document, null, 7, null);
for(var k=0;k<result5.snapshotLength;k++)
{
result5.snapshotItem(k).classList.add("img_div");
 }

    var result3 = document.evaluate('//div[@class="skin-entryBody"]//div[@class="img_div"][last()][./preceding-sibling::div[@class="img_div"]][not(./following-sibling::div) or ./following-sibling::div[@class="k_div"][not(./following-sibling::div)]]/descendant::img[last()][@class="img_br"]',document, null, 7, null);
    result3.snapshotItem(0).removeAttribute("class");
})
.img_br{margin-bottom:1.6em;}
/*.skin-entryBody div:last-of-type:not(:first-of-type)>a>.img_br{margin:0;}*/
/*.skin-entryBody div:only-of-type+br{display:inline;}*/
.skin-entryBody>a.img_a>img{margin-bottom:1.6em;}
.img_div+br{display:none;}
.img_div div:only-of-type+br{display:none !important;}
.img_a+div>br:first-child{display:inline !important;}
/*div[contenteditable]+br{display:inline !important;}
.skin-entryBody>div:last-of-type:not(:first-of-type) div[contenteditable]+br{display:none !important;}*/

firstbr復元

window.addEventListener('load', function() {
var result = document.evaluate('//div[@class="skin-entryBody"]/br[1][not(./preceding-sibling::div)][string-length(./preceding-sibling::text()[1])>8]',document, null, 7, null);
result.snapshotItem(0).classList.add("first_br");
})
.first_br{margin-bottom:1.6em;}