benbasson / imagetoolbar

Firefox Extension - Image Toolbar is a clone of one of Internet Explorer's features and provides quick and easy access to a handful of image functions in a highly customisable way.
http://www.basson.at/firefox-addons/imagetoolbar
Other
9 stars 4 forks source link

Rewrite Image Toolbar with WebExtensions APIs #24

Open benbasson opened 7 years ago

benbasson commented 7 years ago

Mozilla have announced plans to phase out all non-WebExtension add-ons by the end of 2017. While I consider this decision to be utterly insane (and half expect them to end up extending that deadline, if they have any users left to appease at that point), it's safe to assume that this add-on will have to be rewritten or will cease to exist at the end of 2017 or shortly after.

I do not yet know if all the functionality will be possible to implement with the new WebExtensions APIs. I know for sure that (at least) the following will work:

At-risk functionality (don't know if APIs are present or ever will be):

Current blockers in the WebExtensions API:

Potentially relevant:

benbasson commented 7 years ago

Something worth noting is that Image Toolbar uses XBL to bind to images in the existing "legacy add-on" world. This will no longer be possible with WebExtensions, and has already been sketchy-at-best in terms of support for a long time.

The downside of not having XBL is that it might be more CPU intensive, or buggier, or both, to identify and hook on to images in web pages. It was certainly pretty horrible to do before I switched to XBL. This is all conjecture based on not really knowing what APIs are / will be available, but worth knowing up front. This will basically have to be the first thing I assess before doing anything else, because if it can't be done well then this add-on is toast.

benbasson commented 6 years ago

This is next up for rewrite but WebExtensions is a right faff, so I won't be starting on this until next weekend at the earliest.

TLoATDaE commented 6 years ago

I hadn't heard boo for quite a while now, and recently got a smattering of messages. Looks like the double label issue is on the block for next step! I look forward to seeing this next iteration and its list of fixes :)

Thanks again, benbasson, for continuing the work on this wonderful little ad-on! It is appreciated!

franciscoluiz commented 6 years ago

+1

Henrietta1989 commented 6 years ago

Image Toolbar is cool!

What's the status rewriting it?

benbasson commented 6 years ago

I'll be honest, I have not had a lot of time to work on it, so the chances of me being finished by tomorrow (or any time in the next two weeks) are basically zero.

Some of the functionality is done, e.g. save button works, the toolbar appears where it is supposed to. There's currently no proper styling. I haven't audited the security. Copy does not yet work. Print/print preview I expect to have working, but haven't started. Preferences aren't implemented. There will be no info button. Folder button is possible but not fully implemented.

So, I have made progress, but probably not even 50% of the way through if I'm honest.

If you really need this add-on I suggest using the Firefox 52 ESR for the time being. I will post back when I've got more to add.

benbasson commented 6 years ago

After this whole debacle, I am not even sure if I plan to ever really use or contribute to Firefox again. I am already ditching 3 of my 6 add-ons, and one of those remaining is on permanent hold until Mozilla cough up some more APIs (that I, and others, asked for over a year ago). The other two, including this one, are going to be limited in functionality because the APIs provided are, frankly, fairly rubbish.

Henrietta1989 commented 6 years ago

OK. Thanks. Please release at least primitive extension, which has save button and automatically saves (not asks first) and preference to choose custom folder and custom open delay.

benbasson commented 6 years ago

Choosing a custom folder is not going to be possible due to limitations of WebExtensions. Downloads can only be saved relative to the default directory. At best, I will be able to support subdirectories, but currently I haven't proven if they will be created dynamically or if they have to already exist. In either case, I don't think I'll be able to provide a file picker. It certainly doesn't look like there's any way of doing so.

Shurik76 commented 6 years ago

Honestly, out of all the bells and whistles, I was always interested only in quick-saving the images. Now it looks like we won't be able to configure a custom path for saving images (outside of the default downloads folder). But I agree with Henrietta1989 - anything is better than nothing.

TLoATDaE commented 6 years ago

It really burns me that Mozilla has killed off so many good extensions that people use. That said, I have an idea that might be useful. Note that I am not a programmer/coder, and this is a rather simplistic idea, so please bear with my ignorance of the magic that occurs behind the curtain here.

Is there a way to tap into the Context Menu options? I am talking specifically about the "save image as" entry, when alt-clicking on an image. If there is a way to access that functionality, then maybe there's an easier work-around, and life can go on in a better way for us all ;) Please excuse my simplistic approach. I can't think of anything else to suggest. At least they haven't killed that functionality (yet), or I couldn't rabidly save off the web Comics I so dearly love.

Thanks for all the great work, and I do hope you don't throw in the towel. The Community needs good contributors like you to keep the rest of us sane.

Now, if I can just get the Tabs back down where I want them (in Win10) I'll be a bit less vexed...

Vukodlak commented 6 years ago

Instead of choosing the image save path, would it be possible to customize the saved image name? Like, could you create 3 buttons, each would save the image in the standard save folder but each would change the image's name in some way, like adding "wallpaper-" before the image's original name, or any other custom word. This would make it easy to sort out the images inside the standard folder.

Also, if possible, I would like a way to add the webpage's Title as a prefix to the original image name.

Thank you for your time. Good Luck.

Shurik76 commented 6 years ago

@Vukodlak Since there can be n-number of naming templates/presets, if this feature is implemented, it better be done via a series of [nested] contextual menu(s). Otherwise you may end up having WAY TOO MANY icons :-). As for adding the page title, there should be a fail-safe mechanism to truncate the page title prior to appending it to the filename. The page title for this GitHub page alone is 98-characters long!

rogerbnz commented 6 years ago

Thank you Fabio. I had read the comments but not being technically minded all I wanted to know was if there was or was not going to be a new toolbar. If not, I am considering changing my browser especially since Mozilla are now asking for donations for development