ScrapboxSaver
これを自分のページのscript.jsに書けば良い
code:import.js
import '/api/code/masui/ScrapboxSaver/script.js';
code:script.js
const intervalPeriod = 10000
let isRunning = false
let interval = undefined
scrapbox.PageMenu.addMenu({
title: 'random-screen-saver',
})
scrapbox.PageMenu('random-screen-saver').addItem({
title: () => (isRunning)? "Stop screen saver." : "Start screen saver!",
onClick: () => {
if (isRunning) {
isRunning = false
clearInterval(interval)
}
else {
isRunning = true
clickRandomButton()
interval = setInterval(clickRandomButton, intervalPeriod)
}
}
})
function clickRandomButton() {
const button = $('.random-jump-button')
if (!button) return
}