Last active
July 16, 2021 13:41
-
-
Save michimani/ea17916546e4b2a8e0ad9536eb544431 to your computer and use it in GitHub Desktop.
This is a bookmarklet shows only images in a modelpress page, for example https://mdpr.jp/photo/detail/8869191.
This file contains 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
function () { | |
const _d = document; | |
const imgElemList = _d.querySelectorAll('ol.pg-photo__webImageList a img'); | |
if (imgElemList.length == 0) { | |
alert('Images not found.'); | |
return; | |
} | |
imgElemList.forEach((e, i) => { | |
let imgSrc = e.getAttribute('src'); | |
imgSrc = imgSrc.slice(0, imgSrc.indexOf('?')); | |
_d.write(`<img src="${imgSrc}">`); | |
}); | |
_d.close(); | |
} |
This file contains 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
javascript: (function () { | |
const _d = document; | |
const imgElemList = _d.querySelectorAll('ol.pg-photo__webImageList a img'); | |
if (imgElemList.length == 0) { | |
alert('Images not found.'); | |
return; | |
} | |
imgElemList.forEach((e, i) => { | |
let imgSrc = e.getAttribute('src'); | |
imgSrc = imgSrc.slice(0, imgSrc.indexOf('?')); | |
_d.write(`<img src="${imgSrc}">`); | |
}); | |
_d.close(); | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment