from [/villagepump/workroom 2022/05/26](https://scrapbox.io/villagepump/workroom 2022/05/26).
13:25 Pomodoro beginsπ .
A: Isn't it possible to import Kozaneba's UserScript like Scrapbox? That too from Scrapbox. I'll give it a try.
It is not enough to just write import in UserScript.
import "https://scrapbox.io/api/code/nishio/Kozaneba%E3%81%AEUserScript/script.js";Cannot use import statement outside a moduledynamic import is not allowed due to CORS restrictions
Even if you replace the header on the server only for URLs you import directly, if you import code from another page from the code placed in Scrapbox, it will die there, so you won't be very happy anyway.
If you want to do it, you need a mechanism to collect all the files with dependencies in the form of a scrapbox-bundler or something like that.
fetch and <img>, and do whatever it wants.https://scrapbox.io/api/code/ to fetch on the server, you can play around with all the imports or whatever.When you save the UserScript, it says Saved on the console, but it should be on the screen.
Breakdown on improving appearance with 4 minutes remaining
13:58 π
Help is available from the hatena icon on the status bar in the lower left corner, but ordinary users don't notice it, so a help button is placed in the upper right corner.
The button enclosure line is gone.
WARNING in ./node_modules/@progfay/scrapbox-parser/esm/parse.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/nishio/kozaneba/node_modules/@progfay/scrapbox-parser/src/parse.ts' file: Error: ENOENT: no such file or directory, open '/Users/nishio/kozaneba/node_modules/@progfay/scrapbox-parser/src/parse.ts'
Only the arrow heads are 100% opaque.
break
15:07 π
17:20 π
18:35 I'll continue development tomorrow.
- How to organize Scrapbox cards in Kozaneba I only made the title, I'll write the contents later.
This page is auto-translated from /nishio/KozanebaιηΊζ₯θ¨2022-05-26 using DeepL. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I'm very happy to spread my thought to non-Japanese readers.