投稿

ウェブサイトを印刷 URLアドレスを非表示 CSS PRINT URL アドレス 表示しない

Quick Edit Pencil
@media print 
{
  a[href]:after { content: none !important; }
  img[src]:after { content: none !important; }
  abbr[title]:after { content: none !important; }
}

とりあえずコレでイケた

とりあえず用ブックマークレット 商品ページと商品 イメージの印刷最適化

Quick Edit Pencil
javascript:

/* -----------------------------------------------
とりあえず商品ページ印刷最適化ブックマークレット
TAGO.OKに投稿してる
https://tagook.blogspot.com/
----------------------------------------------- */

/*タイトルを変更*/
document.title = document.title.replace(/商品画像│|商品ページ│/g, '');
document.title = '商品ページ│' + document.title;

/*スコットランド国立博物館*/
function nms_ac_uk(){
    /*スタイルとスクリプト削除*/
    var styleElms = document.querySelectorAll(".siteSearch");
    for (var i = 0; i < styleElms.length; i++) {
      console.log(styleElms[i]);
      styleElms[i].remove();
    }

    /*スタイル要素を追加*/
    var body = document.getElementsByTagName('body').item(0);
    var style = document.createElement('style');
    var text = text = `
    @media print 
    {
      a[href]:after { content: none !important; }
      img[src]:after { content: none !important; }
      abbr[title]:after { content: none !important; }
    }
    @media print 
    {
      .siteHead__logo img { width: 196px; height: auto; }
    }
    `;
    var rule = document.createTextNode(text);
    /*style.media = 'screen';*/
    style.type = 'text/css';
    style.appendChild(rule);
    body.appendChild(style);
}

nms_ac_uk();

/*プリンtダイアログを開く*/
window.print();


javascript:

/* -----------------------------------------------
とりあえず商品イメージ印刷最適化ブックマークレット
TAGO.OKに投稿してる
https://tagook.blogspot.com/
----------------------------------------------- */

/*タイトルを変更*/
document.title = document.title.replace(/商品画像│|商品ページ│/g, '');
document.title = '商品画像│' + document.title;


/*スタイルとスクリプト削除*/
var styleElms = document.querySelectorAll("link,style,script,noscript");
for (var i = 0; i < styleElms.length; i++) {
  console.log(styleElms[i]);
  styleElms[i].remove();
}


/*サムネイルのソースを配列に格納*/
var arrImgSrc = new Array();

/* デフォルト */
function imageSrc_to_array_0(){
    var imagesSrc = document.querySelectorAll("#gallery1 img");
    for (var i = 0; i < imagesSrc.length; i++) {
      console.log(imagesSrc[i].src);
      arrImgSrc.push(imagesSrc[i].src);
    }
}

/* Classic Camp Stoves */
function imageSrc_to_array_1(){
    /*https://classiccampstoves.com/threads/primus-stove-ultraprimus-soldering-iron-furnace-c-1895.39320/*/
    var imagesSrc = document.querySelectorAll("img.bbCodeImage.LbImage,a.LbTrigger");
    for (var i = 0; i < imagesSrc.length; i++) {
      if(imagesSrc[i].tagName == "IMG" && /show the full-size version/.test(imagesSrc[i].title)){
        console.log(imagesSrc[i].src);
        arrImgSrc.push(imagesSrc[i].src);
      }else if(imagesSrc[i].tagName == "A") {
      console.log(imagesSrc[i].href);
      arrImgSrc.push(imagesSrc[i].href);
      }
    }
}

/* スコットランド国立博物館 */
function imageSrc_to_array_2(){
    var imagesSrc = document.querySelectorAll(".collectionLightbox img");
    for (var i = 0; i < imagesSrc.length; i++) {
      console.log(imagesSrc[i].src);
      arrImgSrc.push(imagesSrc[i].src);
    }
}

imageSrc_to_array_2();



/*ボディを初期化*/
var body = document.body;
body.innerHTML = "";
body.removeAttribute('class');


/*印刷用イメージ要素をクリエイト*/
var img_element;
for (var i = 0; i < arrImgSrc.length; i++) {
  console.log(arrImgSrc[i]);
  img_element = document.createElement('img');
    img_element.src = arrImgSrc[i].replace('s-l64', 's-l1600');
    body.appendChild(img_element);
}


/*スタイル要素を追加*/
var style = document.createElement('style');
var text = `
/*画像調整*/
img
{width:100%;height:auto;padding-top:1px;}
/*非表示*/
button
{display:none!important;}
`;
var rule = document.createTextNode(text);
/*style.media = 'screen';*/
style.type = 'text/css';
style.appendChild(rule);
body.appendChild(style);


/*クリップボードに商品名をコピーして印刷ダイアログを開く*/
async function copyToClipboard(text) {
  try {
    await navigator.clipboard.writeText(text);
    console.log('コピーしました');
    /*プリンtダイアログを開く*/
    /*window.print();*/
  } catch (error) {
    alert((error && error.message) || 'コピーに失敗しました');
  }
}
copyToClipboard(document.title);

ワースポイント用ブックマークレット 商品ページと商品 イメージの印刷最適化

Quick Edit Pencil
javascript:

/* -----------------------------------------------
ワースポイント商品ページ印刷最適化ブックマークレット
TAGO.OKに投稿してる
https://tagook.blogspot.com/
----------------------------------------------- */

/*タイトルを変更*/
document.title = document.title.replace(/商品画像│|商品ページ│/g, '');
document.title = '商品ページ│' + document.title;

/*スタイル要素を追加*/
var body = document.getElementsByTagName('body').item(0);
var style = document.createElement('style');
var text = text = `
/*画面幅*/
header,
.nav-search-container,
.details-row-ads,
.copyright-info,
#rel-items,
.banner-bottom,
footer
{display:none!important;}
.carousel-wrapper,
.carousel-wrapper *
{display:block!important;}
`;
var rule = document.createTextNode(text);
/*style.media = 'screen';*/
style.type = 'text/css';
style.appendChild(rule);
body.appendChild(style);

/*プリンtダイアログを開く*/
window.print();


javascript:

/* -----------------------------------------------
ワースポイント商品イメージ印刷最適化ブックマークレット
TAGO.OKに投稿してる
https://tagook.blogspot.com/
----------------------------------------------- */


/*タイトルを変更*/
document.title = document.title.replace(/商品画像│|商品ページ│/g, '');
document.title = '商品画像│' + document.title;


/*スタイルとスクリプト削除*/
var styleElms = document.querySelectorAll("link,style,script,noscript");
for (var i = 0; i < styleElms.length; i++) {
  console.log(styleElms[i]);
  styleElms[i].remove();
}


/*サムネイルのソースを配列に格納*/
var arrImgSrc = new Array();
var imagesSrc = document.querySelectorAll("#gallery1 img");
for (var i = 0; i < imagesSrc.length; i++) {
  console.log(imagesSrc[i].src);
  arrImgSrc.push(imagesSrc[i].src);
}


/*ボディを初期化*/
var body = document.body;
body.innerHTML = "";
body.removeAttribute('class');


/*印刷用イメージ要素をクリエイト*/
var img_element;
for (var i = 0; i < arrImgSrc.length; i++) {
  console.log(arrImgSrc[i]);
  img_element = document.createElement('img');
    img_element.src = arrImgSrc[i].replace('s-l64', 's-l1600');
    body.appendChild(img_element);
}


/*スタイル要素を追加*/
var style = document.createElement('style');
var text = `
/*画像調整*/
img
{width:100%;height:auto;padding-top:1px;}
/*非表示*/
button
{display:none!important;}
`;
var rule = document.createTextNode(text);
/*style.media = 'screen';*/
style.type = 'text/css';
style.appendChild(rule);
body.appendChild(style);


/*クリップボードに商品名をコピーして印刷ダイアログを開く*/
async function copyToClipboard(text) {
  try {
    await navigator.clipboard.writeText(text);
    console.log('コピーしました');
    /*プリンtダイアログを開く*/
    /*window.print();*/
  } catch (error) {
    alert((error && error.message) || 'コピーに失敗しました');
  }
}
copyToClipboard(document.title);

ebay用ブックマークレット 商品ページと商品 イメージの印刷最適化

Quick Edit Pencil
javascript:

/* -----------------------------------------------
イーベイ商品ページ印刷最適化ブックマークレット
----------------------------------------------- */

/*タイトルを変更*/
document.title = document.title.replace(/商品画像│|商品ページ│/g, '');
document.title = '商品ページ│' + document.title;

/*スタイル要素を追加*/
var body = document.getElementsByTagName('body').item(0);
var style = document.createElement('style');
var text = text = `
/*画面幅*/
div[class*="sz"]
{min-width: 800px!important; max-width: 1080px!important;}
/*非表示*/
.gh-td-s,
#scandal100938,
#RightSummaryPanel,
div[id*="placement_html_"],
#FootPanel,
#glbfooter,
.d-stores-info-categories
{display:none!important;}
/*商品サムネイル拡張*/
#vertical-align-items-wrapper
{height: 200%!important;}
button[class*="v-pic-"]
{display:none;}
/*iframeスケール*/
/*#viTabs_0_is,*/
#desc_ifr{
/*-moz-transform:scale(0.75,0.75);*/
/*-webkit-transform:scale(0.75,0.75);*/
/*-o-transform:scale(0.75,0.75);*/
/*-ms-transform:scale(0.75,0.75);*/
transform:scale(0.75,0.75); 
overflow:hidden;
position:relative;
top:-50%;
left:-17.5%;/*-25%*/
}
`;
var rule = document.createTextNode(text);
/*style.media = 'screen';*/
style.type = 'text/css';
style.appendChild(rule);
body.appendChild(style);

/*プリンtダイアログを開く*/
window.print();


javascript:

/* -----------------------------------------------
イーベイ商品イメージ印刷最適化ブックマークレット
----------------------------------------------- */


/*タイトルを変更*/
document.title = document.title.replace(/商品画像│|商品ページ│/g, '');
document.title = '商品画像│' + document.title;


/*スタイルとスクリプト削除*/
var styleElms = document.querySelectorAll("link,style,script,noscript");
for (var i = 0; i < styleElms.length; i++) {
  console.log(styleElms[i]);
  styleElms[i].remove();
}


/*サムネイルのソースを配列に格納*/
var arrImgSrc = new Array();
var imagesSrc = document.querySelectorAll("#viEnlargeImgLayer_layer_fs img");
for (var i = 0; i < imagesSrc.length; i++) {
  console.log(imagesSrc[i].src);
  arrImgSrc.push(imagesSrc[i].src);
}


/*ボディを初期化*/
var body = document.body;
body.innerHTML = "";
body.removeAttribute('class');


/*印刷用イメージ要素をクリエイト*/
var img_element;
for (var i = 0; i < arrImgSrc.length; i++) {
  console.log(arrImgSrc[i]);
  img_element = document.createElement('img');
    img_element.src = arrImgSrc[i].replace('s-l64', 's-l1600');
    body.appendChild(img_element);
}


/*スタイル要素を追加*/
var style = document.createElement('style');
var text = `
/*画像調整*/
img
{width:100%;height:auto;padding-top:1px;}
/*非表示*/
button
{display:none!important;}
`;
var rule = document.createTextNode(text);
/*style.media = 'screen';*/
style.type = 'text/css';
style.appendChild(rule);
body.appendChild(style);


/*クリップボードに商品名をコピーして印刷ダイアログを開く*/
async function copyToClipboard(text) {
  try {
    await navigator.clipboard.writeText(text);
    console.log('コピーしました');
    /*プリンtダイアログを開く*/
    /*window.print();*/
  } catch (error) {
    alert((error && error.message) || 'コピーに失敗しました');
  }
}
copyToClipboard(document.title);

#shadow-root(open) #document shadowRoot

Quick Edit Pencil

Element.shadowRoot

shadowRootのスタイルをいじる

/*shadow-root商品説明*/
var descriptionOfItem = document.querySelector("mer-show-more");
var content = descriptionOfItem.shadowRoot.querySelector(".clamp");
content.setAttribute("style", "-webkit-line-clamp: none");
var button = descriptionOfItem.shadowRoot.querySelector(".show-more-button");
button.setAttribute("style", "display: none");
var itemName = document.querySelector("mer-item-object");
itemName = itemName.shadowRoot.querySelector(".container").getAttribute('aria-label');
for (var i = 0; i < itemName.length; i++) {
  /*商品メイン画像のシャドウルート内の要素を非表示/削除*/
  if(itemName[i].shadowRoot.querySelector(".sticker")){
  console.log(itemName[i].shadowRoot.querySelector(".sticker"));
  itemName[i].shadowRoot.querySelector(".sticker").setAttribute("style", "display:none;");
  }
}

本線スケジュール名古屋港

Quick Edit Pencil
画像
light-monochrome

DIY - private

Quick Edit Pencil
目次


light-monochrome