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

WebKit2? #34

Open
quozl opened this issue Jun 30, 2017 · 8 comments
Open

WebKit2? #34

quozl opened this issue Jun 30, 2017 · 8 comments

Comments

@quozl
Copy link

quozl commented Jun 30, 2017

G'day Michal,

For your interest, I'm maintaining another viewer, the Read activity at Sugar Labs, which is bundled on the One Laptop per Child laptops. Our viewer like yours is Python GTK+ and uses WebKit to render EPUB files, and also uses Evince to render PDF files. See User Manual.

We're faced with the impending doom of obsolescence of the WebKit 3.0 API. Are you planning a port to WebKit2 4.0 API?

@ghost
Copy link

ghost commented Oct 6, 2017

I looked a bit into this, porting should be straightforward, except for saving the scroll position.. that's gonna be a huge pain

@quozl
Copy link
Author

quozl commented Oct 6, 2017

Thanks. Yes, having control of scroll position was a huge pain, requiring asynchronous JavaScript, and I gave up on it after a week or so, ended up removing EPUB support from Read activity in Sugar, sadly.

@fabiocolacio
Copy link

@quozl @ghost, I maintain a markdown editor called Marker, which uses webkit2gtk-4.0 for a live HTML preview.

I too struggled a lot with controlling the scroll position using Javascript. I was having an issue where refreshing the web page would scroll to the top, and I wanted the page position to be saved. I eventually found a relatively simple solution, by writing a WebExtension.

Here is one of the first working versions of that WebExtension for reference.

Maybe this can help you out?

@quozl
Copy link
Author

quozl commented Feb 7, 2018

Thanks @fabiocolacio!

@ArhantJain
Copy link

Is this issue open? If Yes, plz guide me, about solving.

@quozl
Copy link
Author

quozl commented Feb 12, 2018

@ArhantJain, you will see in https://github.com/michaldaniel/Ebook-Viewer/blob/52c9d0f530557882b254f38c2eac68e25d930155/src/components/viewer.py#L19 that WebKit 3.0 API is still used. Suggested steps for solving;

  • read and understand the WebKit 3.0 API using the upstream documentation, focusing on the classes and methods used in Ebook-Viewer source code,
  • list the functionality of WebKit 3.0 API used by Ebook-Viewer source code,
  • read and understand the WebKit2 4.0 API using the upstream documentation, focusing on the functionality provided by the library,
  • find the commonality; a mapping from WebKit 3.0 API to WebKit2 4.0 API,
  • edit the source code of Ebook-Viewer to use the WebKit2 4.0 API,
  • iteratively test and repeat.

@ghost
Copy link

ghost commented Feb 13, 2018

For what it's worth, I just tried to install Ebook-Viewer on Fedora but I can't figure out how to do it since there's only webkitgtk4 as a package...

Is there any workaround for this?

@quozl
Copy link
Author

quozl commented Feb 13, 2018

Not really. Fedora dropped WebKit 3.0 API. You might rebuild the packages from an older release, but it will get harder and harder to do this as Fedora changes.

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