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

Port to WebKit2 4.0 API #17

Closed
quozl opened this issue Jun 30, 2017 · 10 comments
Closed

Port to WebKit2 4.0 API #17

quozl opened this issue Jun 30, 2017 · 10 comments

Comments

@quozl
Copy link
Contributor

quozl commented Jun 30, 2017

Read uses for EPUB viewing the WebKit 3.0 API, based on WebKit 2.4, which is unmaintained and dangerous. Port to WebKit2 4.0 API based on WebKit 2.16 or later.

@quozl
Copy link
Contributor Author

quozl commented Jun 30, 2017

Quick check of downstreams;

  • Debian, does declare the WebKit dependency, and they have bug 866649,
  • Fedora, the spec file does not declare a WebKit dependency, no bug found, and on Fedora 25 removing the webkitgtk3 package does cause Read to fail.

@jbicha
Copy link

jbicha commented Jul 2, 2017

Fedora 27 (expected to release in about November) is also removing the old webkitgtk.

@Cogitri
Copy link

Cogitri commented Jul 19, 2017

If you already work on the port would you mind creating a PR or a project for it? Just to avoid work being done twice :)

@quozl
Copy link
Contributor Author

quozl commented Jul 19, 2017

@keepco, good idea. I've done nothing significant on it. Two mailing list posts;

Time is short, and I'm busy. I'll review patches from anyone.

@quozl
Copy link
Contributor Author

quozl commented Jul 21, 2017

Discussion with Ayush in #sugar IRC:

<ayushhere> Hi Quozl

<Quozl> g'day.

<ayushhere> Quozl: I wanted to discuss some stuff about the task, as in, I know a few things about webkit but not really sure how to work with the WebKit2 4.0

<ayushhere> tried finding a few tutorials but couldn't find a lot about it

<Quozl> WebKit is a browser. WebKit2 is an API. Know what an API is?

<ayushhere> API is functions and tools used together

<Quozl> More or less, yes. Language environment of Read is Python with GObject and GTK+ API calls, so the best binding to use is the Python GI API or PyGObject API for WebKit2.

<Quozl> At the moment, Read is using WebKit 3.0 API, which you should be able to confirm by reading the source code of Read.

<ayushhere> Yeah, I have gone through the code

<Quozl> Each PyGObject API is self-documenting, and the documentation can be generated on any system using variouos tools, or you can use someone else's generated HTML, such as https://lazka.github.io/pgi-docs/

<Quozl> You'll see in that URL there is documentation for both WebKit 3.0 API and WebKit2 4.0 API.

<Quozl> ayushhere: there are several examples of code in Sugar and activities that use WebKit2 4.0 API, such as View Help and Browse.

<ayushhere> Quozl: ok, will see those

<Quozl> ayushhere: is that all you wanted to know? two ways to work with an API; write code after reading documentation, and write code after reading other code that uses same API.

<ayushhere> Quozl: I guess so, I'm doing through the documentation right now and I'll see the codes as well. Will let you know how it goes

@quozl
Copy link
Contributor Author

quozl commented Jul 31, 2017

Nobody seems to be working on this, so I'm looking into it now; either removing EPUB support or porting.

@quozl
Copy link
Contributor Author

quozl commented Aug 1, 2017

#18 removes EPUB support. Not the best fix for the problem.

@quozl
Copy link
Contributor Author

quozl commented Aug 12, 2017

After a few days trying to port, I'm giving up.

Last remaining issue is that the EPUB viewer renders each file in the EPUB as a different web page, and was reliant on WebKit accepting a Gtk.Scrollbar wrapper widget, which WebKit2 does not accept, so while I've got content visible it can't be easily scrolled except with mouse scroll buttons, and the page number doesn't update.

So I've merged #18

If anyone is available to work this problem further, I can push my work in progress branch.

@quozl quozl closed this as completed Aug 12, 2017
@jbicha
Copy link

jbicha commented Aug 13, 2017

Is libgepub something you could use instead? libgepub is used by the GNOME Documents app and provides gobject-introspection bindings. I don't see any published documentation for it though.

@quozl
Copy link
Contributor Author

quozl commented Aug 14, 2017

Thanks. Reviewed upstream source at https://github.com/GNOME/libgepub and it looks like it would be useful. It is a GTK+ widget based on Webkit2.WebView, written in C. Good for long term, if anyone wants EPUB support back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants