nicothumb2img
例:
nicothumb2img.jsconst niconicoURLRegex = /(?=(?=nico\.ms|nicovideo\.jp\/(?=watch|seiga|)\/)|)?([a-z]{2}?[1-9][0-9]*)/
scrapbox.PopupMenu.addButton({
title: text => {
const result = text.match(niconicoURLRegex)
if (result == null) return null
return `nicothumb2img (${result[0]})`
},
onClick: (text) => {
const m = text.match(niconicoURLRegex);
if (!m) return text;
return `[https://nicothumb2img.vercel.app/image/${m[0]}#.png https://nico.ms/${m[0]}]`;
},
});
FirefoxとSafariのためにsettingsに入れておいてほしいCSS
force-dpi-style.css#editor img[src^="https://nicothumb2img.vercel.app/image/"] {
width: 314px;
box-sizing: content-box;
}