Last active
December 6, 2016 06:14
-
-
Save oflow/fb7c08141aaf8aa79d84ec1adf60e38f to your computer and use it in GitHub Desktop.
ドスパラは(+税)の表示やめろ!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name ドスパラ税込み表示 | |
// @description ドスパラは(+税)の表示やめろ! | |
// @include http://www.dospara.co.jp/* | |
// ==/UserScript== | |
'use strict'; | |
['em[itemprop="price"]', '.itemSearchTable .price', 'span.rankingAreaPrice'].forEach(query => { | |
document.querySelectorAll(query).forEach(elm => { | |
var price = Number(elm.textContent.split('円')[0].replace(/[^\d]/g, '')); | |
if (price && !isNaN(price)) { | |
elm.innerHTML = String(Math.floor(price * 1.08)).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,') + '円 <span class="tax">(税込)</span>'; | |
} | |
}); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment