[New UI Feedback] Custom script for embedding videos (Read-Only mode) broken in new rendering logic #9123
Replies: 2 comments
-
|
Your script stopped working in the new UI because TriliumNext now uses a React-based rendering pipeline, which means DOM elements (like your video links) may not exist yet when your widget runs. Direct DOM manipulation is fragile—React can overwrite changes or re-render at any time, so scripts must wait until the note content is fully rendered before injecting iframes or custom players. The recommended approach is to hook into the For video embedding, the most robust pattern is to store video URLs as There is currently no built-in video embedding widget or official extension point for this in TriliumNext v0.101.1, and no recent pull requests add native support or backward compatibility for legacy scripts source. If you want to adapt your script, move your DOM manipulation logic to run after Local video embedding by reference (e.g., If you need a migration checklist or code example for the new lifecycle, let me know! To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
We anticipated that compatibility issues will appear after such major change, that's why the old UI is still available in Options → Appearance. Consider using the old UI until further guidance will become available to fix the problem. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Context & Appreciation: First of all, I want to express my support for the new UI direction. I understand that major refactoring (like the removal of the top toolbar) is necessary for the project's evolution. I am actively trying to adapt my workflow to the new system (e.g., migrating my custom toolbar actions to widgets). However, during this transition, I have encountered significant difficulties with compatibility that I cannot solve on my own.
The Issue: I use a custom script that dynamically converts specific video links (e.g., Bilibili) into playable embedded iframes when the note is in Read-Only mode.
In the Old UI: This worked perfectly. The script intercepted the link and rendered the video player inline. (See Image 1)
In the New UI: The script fails to render the iframe. It only displays the standard link button, as if the script isn't running or the DOM manipulation is being blocked. (See Image 2)
Investigation: I verified the underlying source code of the note, and it remains exactly the same as before. The HTML is standard:
Since the source is unchanged, I suspect the rendering logic or the DOM sanitization in the new UI has changed, preventing my script from "injecting" the iframe as it used to.
My Request:
Guidance on Customization: Could you provide insights on how to achieve this kind of DOM manipulation in the new UI? I've noticed other users in the Issues section struggling with broken custom tools as well. A guide or "best practice" for migrating legacy scripts to the new architecture would be incredibly helpful for the community.
Feature Request (Video Support): If "hacking" the DOM is no longer recommended, could you consider adding native support for embedding external video links or local videos?
Compatibility: Is there a way to enable backward compatibility for these types of rendering scripts?
Below is the code for the script I am using. I hope this helps in reproducing the issue or suggesting a fix.
Script Code:
TriliumNext Version
0.101.1
What operating system are you using?
Windows
What is your setup?
Local (no sync)
Operating System Version
Windows 11
Error logs
No response
Beta Was this translation helpful? Give feedback.
All reactions