Skip to content

Instantly share code, notes, and snippets.

@kawaz
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kawaz/d2cc3c2fb4faa655f57a to your computer and use it in GitHub Desktop.
Save kawaz/d2cc3c2fb4faa655f57a to your computer and use it in GitHub Desktop.
楽天ブックスの買い物カゴから「在庫あり」以外の商品の今回購入するチェックボックスを外すブックマークレット(PC用)。

コレは何?

楽天ブックスの買い物カゴから「在庫あり」以外の商品の今回購入するチェックボックスを外すブックマークレット(PC用)。 最近多い「在庫あり商品&一括発送を条件にポイントXX倍」のキャンペーンの為に毎回チェックボックスをたくさん外すのが大変だったので作った。 楽天で沢山本買う人には多分とても便利だよ!

ブックマークレット

javascript:(function(){Array.prototype.slice.apply(document.querySelectorAll("input[type=checkbox][name^=check_item]")).forEach(function(input){var tr=input.parentNode.parentNode;if("tr"==tr.tagName.toLowerCase()){var priceText=tr.querySelector("td:nth-child(3)").textContent;var zaikoText=tr.querySelector("td:nth-child(5)").textContent;var countSelect=tr.querySelector("td:nth-child(4) select");if(1<parseInt(countSelect.value)){countSelect.value=1}if(!/在庫あり\(/.test(zaikoText)){input.checked=false}}})})()

ブックマーク登録をしよう

  • Chromeなら適当なページをブックマークする(どこでもいい)
  • 「編集」ボタンを押す
    • 名前を「楽天ブックス:在庫あり以外のチェックを外す」などに変更する
    • URLを「上記ブックマークレットをコピペ」に変更する。
  • 「保存」ボタンを押す

チェックを外してみよう

  • 楽天ブックスの買い物カゴページを開く
  • 「楽天ブックス:在庫あり以外のチェックを外す」のブックマークをクリックする
  • 在庫あり以外の商品のチェックが外れます!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment