javascript: (function() {
/*https://www.atmarkit.co.jp/ait/articles/0808/04/news124.html*/
/*https://into-the-program.com/removechild/*/
/*ヘッダのタグを削除*/
var scripts= document.head.getElementsByTagName('script');
let len = scripts.length;
for (var i = 0; i < len; i++) {
document.head.removeChild(scripts[0]);
}
var links= document.head.getElementsByTagName('link');
len = links.length;
for (var i = 0; i < len; i++) {
document.head.removeChild(links[0]);
}
var style= document.head.getElementsByTagName('style');
len = style.length;
for (var i = 0; i < len; i++) {
document.head.removeChild(style[0]);
}
/*クリップボードに保存*/
var clips = document.title;
clips += '; ';
clips += document.body.querySelector('p.size').textContent;
clips += '; ';
clips += document.URL;
console.log(clips);
/*イメージの集合要素を保存*/
var images= document.body.querySelector('ul.item_pager');
images.removeAttribute('class');
images.removeAttribute('style');
console.log(images);
/*新たなBODYタグ要素のノードオブジェクト*/
var targetNode = document.getElementsByTagName('body')[0];
console.log(targetNode);
/*新たなBODYタグを作成*/
var newNode = document.createElement('body');
newNode.appendChild(images);
/*BODYタグを置き換える*/
targetNode.parentNode.replaceChild(newNode, targetNode);
/*クリップボードにコピー*/
javascript:
function copyTextToClipboard(textVal){
var copyFrom = document.createElement("textarea");
copyFrom.textContent = textVal;
var bodyElm = document.getElementsByTagName("body")[0];
bodyElm.appendChild(copyFrom);
copyFrom.select();
var retVal = document.execCommand('copy');
return retVal;
}
copyTextToClipboard(clips);
}());