ne-sachirou
this is ne-sachirou’s page
script.jsimport '/api/code/ne-sachirou/クリックでON%2FOFFできるチェックボックス/script.js';
⬜sample 1
✅sample 2
script.js(() => {
function markEmptyExternalProjectLink() {
Array.from(document.querySelectorAll(".page .lines a.page-link"))
.filter(a => a.innerText.startsWith('/'))
.forEach(async a => {
const response = await fetch(a.href.replace("scrapbox.io", "scrapbox.io/api/pages"));
const json = await response.json();
if(!json.persistent) {
a.classList.add("empty-page-link");
}
});
}
window.scrapbox.addListener("page:changed", () => {
markEmptyExternalProjectLink();
});
markEmptyExternalProjectLink();
})();