NiconicotoWidget
code:niconicotowidget.js
const niconicoURLRegex = /(?=(?=nico\.ms|nicovideo\.jp\/(?=watch|seiga|)\/)|)?(a-z{2}?1-90-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]}];
},
});