// ==UserScript==
// @name 【スマホ用】プレーンテキストでコピペしたい。
// @description サイト上のテキスト書式をリセットします。
// @include http://*
// ==/UserScript==
/*
* @title 【スマホ用】プレーンテキストでOK
* @description サイト上のテキスト書式をリセットします。iPhone Safariで確認。
* @include http://*
* @license MIT License
* @require
@private
memo: 
*/
(function(){
var body=document.body.innerText;
body=body.replace(/\r?\n/g,'\n');//改行コードを統一
//[¥tなど]の連続を一つにまとめる
body=body.replace(/[ \t ]{2,}/g,' ');
//[¥tなど]+改行コードを ¥n とする
body=body.replace(/[ \t ]\n/g,'\n');
//¥nの3つ以上の連続を ¥n¥n とする
body=body.replace(/\n{3,}/g,'\n\n');
//css
var bodyStyle=document.getElementsByTagName('body')[0].style;
bodyStyle.all='initial';//reset
bodyStyle.width='100%';
bodyStyle.height='100%';
bodyStyle.overFlow='hidden';
document.getElementsByTagName('html')[0].style.width=window.innerWidth+'px';
document.getElementsByTagName('html')[0].style.height=window.innerHeight+'px';
body='';
document.body.innerHTML=body;
document.getElementsByTagName('textarea')[0].style.width=(window.innerWidth-20)+'px';
})()
/*
javascript:(function(){var%20body=document.body.innerText;body=body.replace(/\r?\n/g,'\n');body=body.replace(/[%20\t%E3%80%80]{2,}/g,'%20');body=body.replace(/[%20\t%E3%80%80]\n/g,'\n');body=body.replace(/\n{3,}/g,'\n\n');var%20bodyStyle=document.getElementsByTagName('body')[0].style;bodyStyle.all='initial';bodyStyle.width='100%25';bodyStyle.height='100%25';bodyStyle.overFlow='hidden';document.getElementsByTagName('html')[0].style.width=window.innerWidth+'px';document.getElementsByTagName('html')[0].style.height=window.innerHeight+'px';body='';document.body.innerHTML=body;document.getElementsByTagName('textarea')[0].style.width=(window.innerWidth-20)+'px';})()
*/