Last active
January 3, 2024 05:40
-
-
Save 5S/88c61d63fc2794ad183d493a0df88afb to your computer and use it in GitHub Desktop.
LINE STORE で配布されているスタンプを .zip 形式でダウンロードするボタンを追加する Greasemonkey 用スクリプト
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 LINE Sticker Downloader | |
// @namespace https://twitter.com/A90 | |
// @version 0.1 | |
// @description Add download button to LINE STORE | |
// @author LOZTPX | |
// @match https://store.line.me/stickershop/product/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
var href = window.location.href; | |
var id = /[0-9][0-9][0-9][0-9]/.exec(href); | |
var ul = document.evaluate('/html/body/div[1]/div/div[2]/section/div[1]/div[1]/div[2]/ul', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); | |
var span = document.evaluate('/html/body/div[1]/div/div[2]/section/div[1]/div[1]/div[1]/span', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); | |
var mdCMN08Ul; | |
var li = document.createElement('li'); | |
if(ul.snapshotLength) { | |
mdCMN08Ul = document.getElementsByClassName('mdCMN08Ul'); | |
if (span.snapshotLength) { | |
li.innerHTML = '<li class="mdCMN08Li"><a class="MdBtn01 mdBtn02" href="http://dl.stickershop.line.naver.jp/products/0/0/1/' + id + '/iphone/[email protected]"><span class="mdBtn01Inner"><span class="mdBtn01Txt">ダウンロードする</span></span></a></li>'; | |
} else { | |
li.innerHTML = '<li class="mdCMN08Li"><a class="MdBtn01 mdBtn02" href="http://dl.stickershop.line.naver.jp/products/0/0/1/' + id + '/iphone/[email protected]"><span class="mdBtn01Inner"><span class="mdBtn01Txt">ダウンロードする</span></span></a></li>'; | |
} | |
mdCMN08Ul[0].insertBefore(li, mdCMN08Ul[0].firstChild); | |
} else { | |
console.log('ul タグが見つかりませんでした'); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment