ScrapboxSaver
これを自分のページの script.js
に書けば良い
import.jsimport '/api/code/masui/ScrapboxSaver/script.js';
script.jsconst intervalPeriod = 10000
let isRunning = false
let interval = undefined
scrapbox.PageMenu.addMenu({
title: 'random-screen-saver',
image: 'https://gyazo.com/c08a5e4439ded1540bc05b31da9d58c9/raw'
})
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
button[0].click()
}