Warning: Undefined variable $data in /home/users/2/main.jp-gutyan/web/file/UserScript/KasiTime_Copy-and-Print_Enable.php on line 19
Warning: Trying to access array offset on value of type null in /home/users/2/main.jp-gutyan/web/file/UserScript/KasiTime_Copy-and-Print_Enable.php on line 19
Warning: Undefined variable $addr in /home/users/2/main.jp-gutyan/web/file/UserScript/KasiTime_Copy-and-Print_Enable.php on line 19
Warning: Cannot modify header information - headers already sent by (output started at /home/users/2/main.jp-gutyan/web/file/UserScript/KasiTime_Copy-and-Print_Enable.php:19) in /home/users/2/main.jp-gutyan/web/file/UserScript/KasiTime_Copy-and-Print_Enable.php on line 33
Warning: Cannot modify header information - headers already sent by (output started at /home/users/2/main.jp-gutyan/web/file/UserScript/KasiTime_Copy-and-Print_Enable.php:19) in /home/users/2/main.jp-gutyan/web/file/UserScript/KasiTime_Copy-and-Print_Enable.php on line 35
// ==UserScript==
// @name 【歌詞タイム】歌詞コピー禁止&印刷禁止 解除
// @namespace http://gutyan.jp/
// @description 歌詞タイムで歌詞コピーや印刷できるようにする。詳しくはこちら ⇒ http://blog.gutyan.jp/entry/2013/12/26/KasiTime_Copy-and-Print_Enable
// @match http://www.kasi-time.com/*
// @version 2.2.1
// ==/UserScript==
(function(d, x, y){
// 基本スタイル定義
var style = d.createElement("style");
style.innerHTML = "*{font-family:'ヒラギノ角ゴ ProN W3',メイリオ,sans-serif!important;user-select:text!important;-moz-user-select:text!important;-ms-user-select:text!important;-webkit-user-select:text!important;}a{outline:0;}";
d.head.appendChild(style);
// 検索ボタンの余計なスタイル除去
var s = d.querySelector("#search style");
s.innerHTML = s.innerHTML.replace("\t\t\tbackground-color: #cecece;\n\t\t\tborder: 1px solid #666666;\n", "");
// 歌詞ページじゃなかったらここで終了
if (!/^\/item-\d+\.html$/.test(location.pathname)) return;
// コピーを妨害している迷惑イベントを全部取り外す
function KasiTime_CopyEnable(e) {
e.oncontextmenu =
e.onkeydown =
e.onmousedown =
e.onselectstart = null;
}
for (y in x) KasiTime_CopyEnable(x[y]);
KasiTime_CopyEnable(d);
// 印刷禁止を解除&印刷用のスタイルを定義
style.innerHTML += "@media print{body{display:block!important;}#center_side_box,#foot_navi,#gafoot,#gads_bottom,#gads_top,#KasiDownload,#search,#song_info_table table tbody tr:nth-child(3) td:nth-child(3),#song_info_table table tbody tr:nth-child(3) td:nth-child(4),#song_info_table table tbody tr:nth-child(4) td:nth-child(3),#song_info_table table tbody tr:nth-child(4) td:nth-child(4),.main:not(:first-of-type),[id^='google_ads_frame'],[alt='アマゾンでCDを購入する']{display:none!important;}.mainkashi{font-size:20px!important;}#center_main_box{border:2px dotted #C6C6C3!important;width:796px!important;}#kashi_flame{width:auto!important;}#kashi_flame h2{border:0!important;font-size:25px!important;}#kashi_img_link{position:relative!important;top:50px!important;}#song_info_table table{border:2px dotted #C6C6C3!important;}#song_info_table td{border-right:0!important;}#song_info_table tr:nth-child(3) td:nth-child(2),#song_info_table tr:nth-child(4) td:nth-child(2){border-right:2px dotted #C6C6C3!important;}}";
// コピペ用フォーム調整
var text = d.getElementById("Text"),
copy = d.querySelector("input[value='コピー']");
text.onclick = function(){this.select();};
text.readOnly = true;
text.style.resize = "none";
text.style.width = "100%";
copy.parentNode.removeChild(copy);
// 特殊文字のエスケープ
function entity(txt) {
var before = ["\\/", "\\\\", "<", ">", "\\?", ":", "\\*", "\\|", '"'],
after = [ "/", "\", "<", ">", "?", ":", "*", "|", "”"];
for (var i=0; i/g, "").replace(/\t/g, "").replace(/\n{3}/g, "").replace(/ /g, " ").replace(/
/g, "\r\n")),
DL = d.createElement("a");
DL.download = entity(d.title) + ".txt";
DL.href = "data:text/plain;charset=UTF-8," + data;
DL.id = "KasiDownload";
DL.innerHTML = 'テキスト形式でダウンロード';
d.getElementById("kashi_flame").appendChild(DL);
// 全ての処理が終わったフラグを立てる(ブックマークレット版との衝突防止)
window.userjs = true;
})(document, document.getElementsByTagName("*"));