RussCoder / djvujs

DjVu.js is a program library for working with .djvu files online without any connection with the server. DjVu.js Viewer is a widget that allows viewing .djvu files right in the browser and can be easily embedded into any web page.
https://djvu.js.org/
Other
187 stars 37 forks source link

feature_request(remote): permalinks to pages of remote documents #15

Closed Kristinita closed 5 years ago

Kristinita commented 5 years ago

1. Summary

It would be nice, if would be possible open links to specific pages of remote DjVu documents.

2. Example of expected behavior

User open https://testuser7.narod.ru/School/Babenko.djvu#page=14 → this page open in browser:

DjVu example

3. Argumentation

Currently, for DjVu:

    person who shares a link and/or the person who wants to read have to spend a lot of time.

It would be nice, if process will much easier. First person add to link with DjVu document #page=$number_of_page → second person open this link and immediately reads the necessary page.

3.1. Currently behavior

I can't find browser extensions, which allow to be possible permalinks to DjVu pages. That share link to DjVu page, I need:

Or users, who want to see the contents of the link, needs:

3.2. Reasons of permalinks to pages

DjVu (as PDF, FB2 and EPUB) is popular books format.

  1. It would be nice, if people will confirm their words with links to sources of information. I try as often as possible confirm my words authoritative sources.
  2. Users may want to share information from specific pages of DjVu books as peoples regularly share links from another types of web pages.

4. Analogies for another formats

4.1. PDF

Firefox by default open remote PDF document in built-in viewer.

If in end of link construction #page=$number_of_page, PDF document open in specific page.

I already show example above — open https://d-m.bksdl.xyz/download/book/5c63fa8550b4253978b2a8a6#page=173 in Firefox:

PDF example

4.2. FB2

FB2 Reader Firefox extension:

Install FB2 Reader → paste link http://static.flibusta.is:443/b.fb2/Kazanceva_Corpus_362_V-internete-kto-to-neprav-.AAFbdw.489418.fb2.zip#zz_59 to URL bar → Firefox open a page:

FB2 example

Thanks.

RussCoder commented 5 years ago

Добрый день!

Да, это не сложно будет сделать. Только ссылку такую все равно надо будет открывать через контекстное меню, а не на прямую. Хотя конечно, если есть указание страницы, то теоретически можно и сразу открывать по клику...

При открытии через контекстное меню сделаю, чтобы на указанную страницу осуществлялся переход. А про непосредственный клик еще подумаю.

RussCoder commented 5 years ago

Обновил расширение. Теперь страница учитывается. Делать открытие сразу по клику не стал - задать маску учитывающую хэш в адресе нельзя, а перехватывать все запросы к .djvu и вручную этот хэш проверять я не хочу ради этого. Быть может. позже сделаю настройку, которая позволит все ссылки на .djvu открывать по клику сразу.

Kristinita commented 5 years ago

(Sorry for English; I wrote in English, because this discussion will understandable for possible other users)

Type: Question ❓ :

I open link https://testuser7.narod.ru/School/Babenko.djvu or https://testuser7.narod.ru/School/Babenko.djvu#page=14 in browser. Currently, what actions I need, that DjVu file from link will opened in DjVu Viewer?

Thanks.

RussCoder commented 5 years ago

You have to update the extension to the version 0.3.1.0 Then you have to right click on the link to a djvu file and in the context menu click the option "Open with DjVu.js Viewer". If there is a page number in a URL, it will be set in the viewer now too.

RussCoder commented 5 years ago

@Kristinita Вопрос решен?

Kristinita commented 5 years ago

Вопрос решён?

Status: Partially Resolved

1. Resolved

page= works as expected. Thanks!


But I think, that FB2 Reader behavior is better, and would be nice, if you make the same for DjVu.js. Argumentation:

2. Users profit

2.1. Additional action

FB2 Reader shouldn't remember additional actions.


But it not heavy problem; real problems arise, if link open not from browser.

2.2. Links place

Users may need to open links to DjVu files not from browser.

  1. Usually, I share links to books, that confirm my opinion, in private messages of messengers and social networks (e.g. VKontakte, WhatsApp). I use Rambox for it; another users can also doesn't use browser.
  2. I edit documents in Sublime Text and open links to books via Clickable URLs package.

Adding moz-extension://01c7e4e4-9cba-489c-8872-44f3939bccd2/viewer.html# in top of each DjVu link is not simply; copy/paste it takes a time.

2.3. Browsers without extension

If user haven't enabled extension in browser or have another browser:

Also, link with protocol moz-extension://, not https:// or http:// non-friendly for non-Firefox users.

Using two links for sharing: with moz-extension://01c7e4e4-9cba-489c-8872-44f3939bccd2/viewer.html# and without it also isn't good solution.

3. Your personal profit

3.1. More users

You can get more users of your extension:

3.2. Unique feature

Currently, I don't understand, why users must prefer your extension, not powerful programs as IrfanView. I can't say great arguments, why opening files in browser better, that in best DjVu readers.

But if you make behavior like FB2 Reader, you will have unique feature, that can't be implemented in IrfanView, SumatraPDF and another viewers. This will be your distinguishing feature, which can be emphasized when promoting an extension. And maybe your DjVu.js in the future will included in Firefox build as currently Pdf.js.


Based on the arguments above, I think, it would be nice, if someday you realize, that any remote DjVu file will be opened in DjVu.js. See, how it realized for FB2 Reader.

Thanks.

Kristinita commented 5 years ago

Type: Rectification

DjVu (as PDF, FB2 and EPUB) is popular books format.

Currently, for my projects I use 274 .djvu books. Personally for me, this feature request really important.

Thanks.

RussCoder commented 5 years ago

@Kristinita

I know that it may be more convenient to open all files in the viewer by default without using the context menu.

However, the current behavior is such by design - the viewer is designed so as to add new features in the browser, but at the same time not to change the default behavior. If it weren't so, you would not be able to download the file, without opening it in the viewer. And if there is an error (and I can't guarantee that the viewer works with all files correctly even now), you will be able neither to view the document, nor download it (due to the error).

Right now, I know how to satisfy your desire of convenience and my purpose not to restrict users by the viewer at the same time. Namely, I will add options to the viewer, and a user will get an ability to configure the behavior of the viewer as he likes.

I don't know exactly when I implement it, but due to your request and some other issues with the viewer, I think I will start working on it within the next week or thereabouts.

RussCoder commented 5 years ago

@Kristinita

I have added an option to open links on click in the v.0.3.3.0 of the extension. It's available for Firefox and will be available for Chrome within several days (they increased review time dramatically now).

Kristinita commented 5 years ago

@RussCoder, Status: Partially fixed :interrobang:

1. Description

If I opened in Firefox:

All works as expected; thanks: :white_check_mark: .

Else:

I was getting:

Where open

This link doesn't open in DjVu.js :pensive: .

2. Argumentation

This feature is the essence of my request. It would be nice, if each user can quickly go to any page of any remote DjVu document; but nowadays it's impossible. See my previous messages from this thread for details.

3. Environment

Thanks.