-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feat: support custom js #2943
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support custom js #2943
Conversation
Looking forward to this. I think it should have plugin API available in that file. The same API as in plugins (not the internal logseq.api) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Any news on this? |
Just waiting for a reviewer. Will be processed soon 😃 |
Ahhh yyyyesss. thanks |
I'm trying to use this feature but when I reload with custom.js Logseq doesn't alert me that it has found a custom.js file or ask to execute it. Any thoughts on how to fix this? I'm running 0.5.4 on MacOS. |
same issue here on 0.5.4 win10, custom.js doesn't seem to load and got no alert asking for permission |
Same issue here |
Hi @jjaychen1e, What's the version of your desktop app? I tested it, and it works for me on Mac & Windows. |
I test this feature with a new created graph and it works (macOS, Logseq 0.8.18). But for my original graph, the prompt doesn't show up (using the same And then I move my original graph from iCloud ( Then, I unlink the original graph and open it again, it doesn't work. Weeks ago, this feature works well, it seems it's broken in the recent versions. It seems the location of the graph can affect this feature. I notice there is a PR about enabling Update: |
@jjaychen1e Thanks for your details! Will do more tests soon :) |
How to use
custom.js
?0. Why
custom.js
?custom.js
will be executed on the main thread, which means you can access DOM.logseq.api.xxx
, which means you can invoke api synchronously if supported.1. Life & Security of
custom.js
?custom.js
file, under thelogseq/
folder, similar tocustom.css
.custom.js
asynchronously.custom.js
file is modified, it needs to be restarted or refreshed to take effect.2. Hello
custom.js
custom.js
file underlogseq/
folder and write code as below.