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

Webpage Viewer #145

Closed
PaulBGD opened this issue Jun 15, 2016 · 25 comments
Closed

Webpage Viewer #145

PaulBGD opened this issue Jun 15, 2016 · 25 comments

Comments

@PaulBGD
Copy link

PaulBGD commented Jun 15, 2016

Some kind of webpage component would be nice.

@SevenBits
Copy link

I believe there is already a method to open a URL in the user’s browser...

@andlabs
Copy link
Owner

andlabs commented Jun 17, 2016

The former might happen soon. The latter is just a suggestion for now.

@PaulBGD
Copy link
Author

PaulBGD commented Jun 17, 2016

I believe there is already a method to open a URL in the user’s browser...

What I mean, is a way to render a webpage inside the GUI.

@kainjow
Copy link
Contributor

kainjow commented Jun 19, 2016

Looks like IE can be embedded, and WebKit is easy to integrate on macOS, but how would the GTK implementation work? WebKitGTK+ might be an option.

@andlabs
Copy link
Owner

andlabs commented Jun 19, 2016

I don't want to expose different rendering APIs on each platform. It'd have to be WebKit or XUL or Servo on all three. WebKit can be embedded on Windows, but the only way to actually get WebKit for Windows is to build it yourself :| (Still wondering how the Servo stuff is going =P )

@kainjow
Copy link
Contributor

kainjow commented Jun 19, 2016

You already are exposing different rending APIs with the drawing functions. Using a non-native web engine would seem to go against libui's model of using native platform controls. If the user knows that the web component is wrapping native WebKit and native Trident and knows the limitations of those engines, then they should be able to work around those without issue.

FWIW wxWebView works this same way.

@andlabs
Copy link
Owner

andlabs commented Jun 19, 2016

I suppose you have a point there. My concern was more how the different rendering APIs render differently and give you different levels of control over the browsing process. With the drawing APIs I expect the same end result regardless of the drawing; that might not be the case for the web APIs. And does mshtml give me the same level of control over loading resources, navigating pages, handling specific protocols within the program (without needing to register with the OS), etc. that WebKit on OS X does? A web control will be more than just the web view itself. I can tell you from experience that even WebKit on OS X offers different types of control than WebKitGTK!

If I do make a WebKitGTK-based thing it'll have to be a separate library due to the extra dependency; libui-web or libui-webkit or something.

@PaulBGD
Copy link
Author

PaulBGD commented Jun 19, 2016

I'd say use what's native to keep the package size down. Having to include all of WebKit seems it'd really increase package size. Although if you have to include something on Linux, WebKit seems like a good idea.

@HalosGhost
Copy link

HalosGhost commented Jun 20, 2016

I like the notion of using the native interface on each platform (and it seems to meld well with how libui currently works), however, I am not against the notion of having the same rendering engine for this. If it does go in that direction, I would certainly vote for servo; webkit is massive and has a bunch of really unfortunate legacy cruft; QtWebEngine is kindofalittlebit a thing, but does not appear to be particularly stable yet (and it's based on Chromium's blink, which now also has a bunch of cruft).

Servo seems like the lightest-weight, fastest and most powerful option. So, it seems like the best candidate to me for a cross-platform solution.

@SevenBits
Copy link

@andlabs, you don't have to expose different APIs on each platform; you can just wrap each platform's own APIs. This is what wxWidgets does, I believe. On Windows for instance you could wrap Trident (or maybe EdgeHTML on Windows 10), on OS X WebKit, etc etc... though this does of course have the concerns you mentioned here, but I suppose the user will need to determine their own application's needs and whether this would be appropriate vis-a-vis shipping WebKit, for example.

@PaulBGD
Copy link
Author

PaulBGD commented Jun 20, 2016

I've run servo and it doesn't seem ready for production yet. It definitely is lightweight, but it's missing a lot of features.

@PaulBGD
Copy link
Author

PaulBGD commented Jul 7, 2016

So with the new nightly builds of Servo, I decided to try it out. It's very fast and definitely tiny (compared to other browser engines) however it's very incomplete. Some webpages don't render at all (duckduckgo) and others render with issues (GitHub, YouTube, even Reddit!)

I'm confident now that it'd be a terrible choice until they fix a lot more of their issues.

@duckbrain
Copy link

I really don't see a reason to package a full browser into the application. I think using the one "native" to the system is fine. I know that this causes all sorts of incompatibility issues and differences on platforms, but this is something web developers have been handling for a while now. In my use case, I already have data as HTML that will render fine in any browser (even very old ones). I assume my use case is not unique. If a specific browser is needed I could see that as an alternative option.

@andlabs
Copy link
Owner

andlabs commented Jul 7, 2016

Even if I do decide to just use whatever native browser that comes with the OS, this would still be a separate library to avoid every program needing to depend on WebKitGTK+ on Linux. (And which version of WebKitGTK+ do I use, 1 or 2? Their APIs are very different.)

Ideally a "your choice" thing would be nice, with mshtml/webkit on one hand, webkit everywhere on another, and servo on a third

@PaulBGD
Copy link
Author

PaulBGD commented Jul 7, 2016

You could add support for Servo, but it's not usable at all in its current state. Looking at the project it'll be at least several months before it works decently.

Yeah, giving choice definitely would be a good idea. As for using WebKitGTK+ (I suggest v2) allowing a separate library is probably the best way to proceed.

@data-man
Copy link

data-man commented Jul 7, 2016

@PaulBGD
Copy link
Author

PaulBGD commented Jul 8, 2016

Wow that's a pretty cool lightweight browser. There's definitely a lot of stuff that doesn't work in it though. For instance I can't click inputs or even visit my own site ("Something Wrong")

@parro-it
Copy link
Contributor

parro-it commented Jul 8, 2016

I think it could be used to draw HTML in a uiAreaHandler struct implementation.

We could also listen for keyboard and mouse events to create a rich text editor as asked #174

@edko99
Copy link

edko99 commented Aug 11, 2016

Embedded WebKit would enable the use of very sophisticated rich text editors (for example CodeMirror), fulfilling the needs of #174 . That is, if there was a way to interact with its JavaScript engine, in addition to just rendering HTML.

@PaulBGD
Copy link
Author

PaulBGD commented Aug 19, 2016

So my final thought is, a webpage component should probably be a separate library instead of being included due to there not being a cross platform engine that's small enough to embed.

@andlabs
Copy link
Owner

andlabs commented Aug 19, 2016

Oh I don't think I mentioned it, but regardless of what I do choose to do, I want to provide a complete API for controlling the web view in arbitrary ways based on my experience with writing ohv; as a consequence this would be a separate library due to sheer API bloat.

@andlabs andlabs added this to the libui-webview milestone Aug 19, 2016
@SevenBits
Copy link

SevenBits commented Aug 19, 2016 via email

@andlabs
Copy link
Owner

andlabs commented Aug 19, 2016

No. I haven't pushed anything because the uiTable implementation isn't finished yet; I still need to write it on Windows, and I'm back in a motivational lull. I have an IRL job that saps most of my time and remaining motivation now as well. The project is far from dead, though. (Of course, even after uiTable is done I have to convert it to uiTree, so there might be another long delay before another push assuming I don't push the uiTable stuff alone first.)

@DemiMarie
Copy link

Are you now in the uiTable -> uiTree phase?

@andlabs
Copy link
Owner

andlabs commented Mar 25, 2018

Merged with #315.

@andlabs andlabs closed this as completed Mar 25, 2018
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

10 participants