Skip to content
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

New note type opening an iframe with an external website #2515

Closed
rebron1900 opened this issue Jan 5, 2022 · 12 comments
Closed

New note type opening an iframe with an external website #2515

rebron1900 opened this issue Jan 5, 2022 · 12 comments

Comments

@rebron1900
Copy link

Describe feature

新标签页可以设定为打开一个网页吗?
Can a new TAB be set to open a web page?

这样可以把一些自己用到的网页服务嵌入进来,如Tolist,RSS reader等等
This allows to embed your own web services, such as Tolist, RSS reader ...

like this

image

Additional Information

No response

@zadam
Copy link
Owner

zadam commented Jan 5, 2022

No, this is not supported. Trilium in general tries to be self-contained and offline-first.

Having said that, it is an interesting idea and supporting such "external note" might make sense.

@zadam zadam added this to the backlog milestone Jan 5, 2022
@zadam zadam changed the title 新标签页可以设定为打开一个网页吗?| Can a new TAB be set to open a web page? New note type opening an iframe with an external website Jan 5, 2022
@rebron1900
Copy link
Author

No, this is not supported. Trilium in general tries to be self-contained and offline-first.

Having said that, it is an interesting idea and supporting such "external note" might make sense.

是的,这样我可以在trilium使用rss阅读器,功能完善的TODO功能等等
Yes, so I can use the RSS reader in Trilium, the full-featured TODO feature, etc

@cwilliams5
Copy link

I didn't even think of this - that actually would be very cool as an external note type! +1

@liushuya7
Copy link

This feature is exceedingly desired!!

@thfrei
Copy link
Sponsor Contributor

thfrei commented Jun 14, 2022

It seems that this feature now isi present with the iframe note type. you can then put #iframeSrc="https://...."

ee217d6

I wonder though, what are your use cases?

  • Self hosted RSS Feed? (why not just use a link?)
  • Todo list? (how is it implemented via iframe?)

I would love to hear more about your use cases.

@zadam
Copy link
Owner

zadam commented Jun 14, 2022

It is implemented, but I'm not yet sure if I actually want to ship it, because it:

  1. is available on the desktop only. We could theoretically implemnet iframe fallback, but it would be more limited.
  2. it's based on electron/chromium WebView which has uncertain future and might be removed.
  3. in some cases WebView seemed kind of buggy to me

If it will ship, it will probably have some "experimental" status.

@cwilliams5
Copy link

I would love to hear more about your use cases.

I don't think this in a release build, but then again I haven't had much time lately with Trillium (for testing that is - daily use continues).

As a comment, if this was solely implement as iframe, I'm not sure if it will work. Many sites, presumably for "security", send an X-Frame-Options to prevent embedding the site as an iframe. So this feature needs to either disrespect that header or otherwise not be a frame but an entire webview into itself.

As to the use case, the main to me is to do list. It's out of scope here, suffice to say as much as I love Trilium it's to do functionality does not meet my needs. My todo client does have a web version, however, and I'd love to have that as a tab / sidebar icon in Trilium. Knowledge management and Project / Todo management have blurry lines, and when I'm in that mental mode I can need both. That said, Microsoft To-Do prevents embedding via iframe.

I'd actually probably slap my Google Calendar in there as a sidebar icon as well, because again its a real fluid flow between KB/Todo/Calendar at times.

Those are the most natural use cases to fit with the mental state I am in when I open Trilium. If this was a functional feature, I may slap my RSS reader and gmail in there as well and see if it fits or is still best in a dedicated browser window.

@zadam
Copy link
Owner

zadam commented Jun 14, 2022

So this feature needs to either disrespect that header or otherwise not be a frame but an entire webview into itself.

WebView actually does ignore it, so it can embed websites which don't allow that. But it has problems, some of them are outlined above.

@thfrei
Copy link
Sponsor Contributor

thfrei commented Jun 14, 2022

Thank you both for your insight. I was already wondering why the feature was not included in the release, and why I did not found the note type :-)

I guess it is not the "perfect" feature, if it only works in electron with a webview. It could still be used as an iframe, if someone hosts something himself (rss reader, calendar, todos), then the person can easily influence the header of the page. However, someone could just use a render note with an iframe for that?

@cwilliams5
Copy link

It could still be used as an iframe, if someone hosts something himself (rss reader, calendar, todos), then the person can easily influence the header of the page. However, someone could just use a render note with an iframe for that?

A few versions back I tried a render note with an iframe and couldn't get working, so i think in that context X-Frame might be respected. Seems like this implementation works better, and is definitely easier to set up / maintain which is what the requestor was after.

zadam (the program author) has already confirmed that the header is already ignored in this new implementation, which is great, so the concern I raised is already solved.

It is implemented, but I'm not yet sure if I actually want to ship it, because it:

1. is available on the desktop only. We could theoretically implemnet iframe fallback, but it would be more limited.

2. it's based on electron/chromium WebView which has uncertain future and might be removed.

3. in some cases WebView seemed kind of buggy to me

If it will ship, it will probably have some "experimental" status.

zadam if your seeking comment, speaking for myself I think all of the above are as expected. I wouldn't have expected it to work outside of the electron app, perhaps any such notes are simply hidden in the mobile version or just display a message like "Due to platform limitations, iframe note types are only available in Trilium desktop."

As to the state of WebView, I have no insight. I know it's used heavily in android apps so I wasn't aware its future was uncertain. But then again its Google so its all highly uncertain.

As to WebView being buggy - your right. I've used other electron apps that allow embedding external sites and its hit or miss on if it will fully work, partially work, or not work at all - even sites that otherwise work perfect in chrome. Something about webview itself. A power user would expect that and not blame Trilium for a site not working in webview. Hopefully labeling it "experimental", or more accurately "unsupported" or otherwise hit or miss, would drive that home.

@zadam
Copy link
Owner

zadam commented Jun 15, 2022

Clarification about WebView - it is officially deprecated in both chrome and electron: https://developer.chrome.com/docs/extensions/reference/webviewTag/ https://www.electronjs.org/docs/latest/api/webview-tag

Electron provides an alternative BrowserWindow, but it's not part of DOM and generally much more difficult to handle (at least for Trilium's use case).

@zadam
Copy link
Owner

zadam commented Jun 19, 2022

Implemented in master, so closing.

@zadam zadam closed this as completed Jun 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants