dteviot / WebToEpub

A simple Chrome (and Firefox) Extension that converts Web Novels (and other web pages) into an EPUB.
Other
676 stars 132 forks source link

Make the "Open in a tab" a persistent option #58

Closed typhoon71 closed 8 years ago

typhoon71 commented 8 years ago

I really liked finding this one option (I can finally leave it doing its job without having to keep it opened). Super thanks for it!

An improvement could be for it to -always- open in a tab, auto-fetching the link from the page that was opened when the addon icon/button got pressed. A general "option" section of sort may be a good idea.

dteviot commented 8 years ago

@typhoon71

I'm working on it. It's not easy. When you open as a tab, you loose permissions for extension API calls. Which are what are used to find the URL of the active tab. There's other problems as well with pages that have "load on demand" content.

typhoon71 commented 8 years ago

Well, take the time you need, I'm already happy with how it is now, and since you're working on it it's a good sign already.

dteviot commented 8 years ago

@typhoon71, @belldandu, @dreamer2908, @toshiya44

Please see https://github.com/dteviot/WebToEpub/tree/AdvancedOptions This passes the URL to use to the Tab window via a Query parameter in the URL. Unfortunately, it doesn't work with FireFox 47, but it does work with 48. It also works with Chrome.
Also,

Feedback appreciated before/if I merge this into the Sonako branch.

typhoon71 commented 8 years ago

Maybe putting the "open in a tab" in main instead of under advanced options would make it easier to use.

edit: OS is windows7 x64, calibre 2.60.0 x64.

dreamer2908 commented 8 years ago

I get a white page between every two successive images in the gallery in Calibre 2.62.0 on Linux Mint 17.3, but none in the same version on Windows 7. Both show a white page at the end of the gallery.

At 98%, there's no white page at all.

toshiya44 commented 8 years ago

No issues on Firefox 49. I'm not getting white pages in calibre either.

dteviot commented 8 years ago

@typhoon71 Well, I've spent all day trying to get Firefox to open always open in Tab mode, and am going to state that due to FireFox's implementation, I can't do it. There are numerous problems, but the biggest one seems to be you can only open a new window (a tab) in direct response to a user action. It won't work on a callback.

Note, I can do it without problems in Chrome.

typhoon71 commented 8 years ago

well, I guess they're different browser after all. I know other addons can open in a new tab, but it's a config tab, like ublock origin's "dashboard". It's not the actual working "main window" of the plugin. What does "user action" means? Shouldn't a click on a button (addon) be a proper user action?

dteviot commented 8 years ago

@typhoon71

What does "user action" means? Shouldn't a click on a button (addon) be a proper user action?

Correct. If I try to open the tab in response to user clicking a button, it works. However, if I try to open the tab as part of a callback (e.g. making call to find tabs, it doesn't work.) I'm going to see if I can find some help on the Firefox forums.

typhoon71 commented 8 years ago

Can the "Open in a tab" button be on the main, just on the side of "advanced option" button? I mean for it to be visible after pressing the book addon icon, with just another click; right now I click the book icon, click the "advanced option" button, search the "Open in a tab", click it. The idea is to make is faster. It shouldn't clutter the interface, and you culs add an option to show/hide it now that there's the persistent user options.

dteviot commented 8 years ago

@typhoon71

Can the "Open in a tab" button be on the main, just on the side of "advanced option" button?

Will do.

typhoon71 commented 8 years ago

Thanks.

typhoon71 commented 8 years ago

Btw, I noticed that some addons don't "suffer" from the reason that made me ask for "open in tab". For example, the Ookla Speedtes addon (chrome) once run can just be closed and it will finish the test. This means you can continue browsing, which is not possible with WebToEpub, since you need to keep it open. Could you look into this? It could be better than opening in a tab, since you said it was buggy. Thanks anyway.

dteviot commented 8 years ago

@typhoon71 I'll see what I can do. However, given that FFox has moved to 48, one of the major bugs with Tab mode is gone, so it may be possible to make WebToEpub open in tab mode all the time. Which would also solve the problem. That said, we're also now at the point where nearly all the outstanding issues are not easy to solve. I've either tried to solve them and failed and/or they're going to require a lot of work to fix/change/add. So it's probably going to be some time before you see anything new (other than some other parsers that have been asked for.) Incidentally, you asked for wuxiaworld, did you also ask for gravity tales?

typhoon71 commented 8 years ago

Oh, I was talking about chrome (speedtest working in the background) but I suppose it could be relevant to firefox too. Take the time needed to solve the hard to tackle issues, I'm pretty happy with how fast the addon became like it is now. More parser will always be wellcome. ;) Regarding wuxiaworld, I asked that becauseI read WMW and may read another novel later, I don't know what gravity tales is, I suppose another site?

dteviot commented 8 years ago

@typhoon71

I don't know what gravity tales is, I suppose another site?

Yes. https://gravitytales.com/ Someone asked for this via the Chrome store, and it seems similar to Wuxiaworld.

typhoon71 commented 8 years ago

Would it be possible for the chaptr name boxes to be a bit larger (or resizable) when in tab mode? Sometime the chapter title is long and editing it would be easier with larger boxes.

dteviot commented 8 years ago

@typhoon71

Would it be possible for the chaptr name boxes to be a bit larger (or resizable) when in tab mode?

I'll see what can be done.

typhoon71 commented 8 years ago

Thanks.

dteviot commented 8 years ago

@typhoon71

Would it be possible for the chaptr name boxes to be a bit larger (or resizable) when in tab mode?

Give https://github.com/dteviot/WebToEpub/tree/ExperimentalTabMode a try. I've also changed the API used to do HTTP requests, should be a little faster as it makes fewer calls. Please let me know if you have any issues.

typhoon71 commented 8 years ago

Just tested. Chapter title boxes are auto-sizing, even better that what I awas asking,thanks.

I did notice the speedup, both in loading the addon tab and parsing the list of chapters; downloading and building the epub takes the same time, I suppose the images need some time.

dteviot commented 8 years ago

I'm going to call this done.