task-maker-button
動作
createTask.js
がないページ
createTask.js
があるページ
それを実行する
button2.jsconst defaultSource = 'task-page-maker';
const project = 'takker';
export async function execute() {
const source = `/api/code/${scrapbox.Project.Name}/${encodeURIComponent(scrapbox.Page.title)}/createTask.js`;
import(source)
.then(({createTask}) => createTask())
.catch(() => {
こっちにfallbackされたとき、どうしてもService Workerでerrorが発生してしまう
実行は出来ているけど、なんか気持ち悪いな

button2.js console.log('No createTask.js found. Loading the default script...');
import(`/api/code/${project}/${defaultSource}/createTask.js`)
.then(({createTask}) => createTask())
.catch(e => console.error(`Failed to load ${source}. Error: %o`, e));
});
}
ボタン用アイコン