PerfectSlayer / scrollupfolder

A firefox addon wich goes up a folder of a website.
https://addons.mozilla.org/fr/firefox/addon/scroll-up-folder/
Other
21 stars 9 forks source link

WebExtensions API #40

Closed Gitoffthelawn closed 6 years ago

Gitoffthelawn commented 7 years ago

Will you be able to convert this to WebExtensions API so that it will work with Firefox 57+?

PerfectSlayer commented 7 years ago

Hi @Gitoffthelawn Thanks for coming here to ask update (instead of rating a 1 start out of 5 on AMO 😅 ). Actually, I didn't figure out how to port this add-on. Here is the status according the features:

Scroll and load page:

As you could see, I'm not able to have the main feature (ie "scroll up folder") working with the WebExtension API. If someone has any clue to port it, I'll be happy to try and make the port. Otherwise, I fear we reach the end of this add-on maintenance (I maintained it since Firefox 1.4 😢 ). By the start of October, I'll update the add-on description on AMO to mark it as discontinued if no solution is found.

Gitoffthelawn commented 7 years ago

Thanks!

Take a look at Navigate Up WE: https://addons.mozilla.org/firefox/addon/navigate-up-we/

I think it will be helpful to see how it works.

BTW, previous versions of Navigate Up WE placed the icon in the URL bar, which was nice. The current version no longer does this.

PerfectSlayer commented 7 years ago

Thanks for the tips. I looked at the source code. Like me, he is able to make an icon and create a command to go up. Nevertheless, he does not found a way to have a smooth integration with the browser or an efficient navigation by using mouse of keyboard shortcuts. So, I could do like him but my add-on will have no additional value than his own.

In my opinion, the strength of Scroll Up Folder is its fluent and easy way to use. I mean, there is a lot of other Firefox addons that allow you to navigate up but I liked the Scroll Up Folder way and that is why I maintained it for 13 years now (I'm not the original author). So making a port without this feeling seems meaningless to me.

What do you think about it? Would you prefer I make another "goes up" clone by porting to WebExtension SDK (as all WebExtension tend to be the same due to limited API) or this add-on to be discontinued?

P.S.: If you found any new and interesting ideas to use the provided API to navigate, I will be glad to add to make the port and add it the addon. But I failed until now…

Gitoffthelawn commented 7 years ago

What do you think about it? Would you prefer I make another "goes up" clone by porting to WebExtension SDK (as all WebExtension tend to be the same due to limited API) or this add-on to be discontinued?

I took a few days to think about it.

Here's what I concluded: Port to WebExtensions API.

Here's why:

PerfectSlayer commented 7 years ago

So, here is what I plan:

  1. Finish the 5.3.0 version (I don't know why it's not on AMO yet!) I will take the opportunity of the update to notify users about the new WebExtension port.
  2. Start a 6.x.y version. It should allow me to support the 5.x.y branch for legacy extension browsers (like Pale Moon) while I break the existing features due to the new API.
    • I would like the 6.0.y version to be the simple as possible to not miss the Firefox 57 release date. For example, only a button on URL bar with a panel showing the URL folders.
    • Then quickly release new versions (6.1.y, 6.2.y, …) with extended features:
      • Commands: like Command+Up to go up or a command to open/close URL bar button panel,
      • Preferences: as soon as you set up a key shortcut, people want to customize it 😅 ,
      • Translations: I think I will loose the current translations. I need to look at integrated tools to GitHub to help project with I18N.

But to be honest, I do not think I will start the project until mid-October. I am starting my summer holidays at the end of week so I will be away from keyboard for some weeks! Feel free to give your opinion of the above roadmap. 😉

Gitoffthelawn commented 7 years ago

Sounds like a great plan! :)

May I recommend one alteration?

I would like the 6.0.y version to be the simple as possible to not miss the Firefox 57 release date. For example, only a button on URL bar with a panel showing the URL folders.

How about a button the the URL bar, which when left-clicked (primary button on pointing device), goes up one level, and when right-clicked (secondary button on pointing device), shows the panel? That would be ideal.

Also... Enjoy your summer holidays! :)

PerfectSlayer commented 7 years ago

You may suggest! But I could decline 😉 In fact, according the pageAction.onClicked() callback API, I only have information about the current tab and nothing about the event. So sadly, I can't make distinction between event buttons.

Nevertheless, if you have any other proposal, fell free to discuss here!

Gitoffthelawn commented 7 years ago

Hmmm... maybe that's why the other extension chose to switch to a toolbar button... so that right- and left- clicks can be distinguished.

PerfectSlayer commented 7 years ago

Hum, the documentation about browserAction.onClicked() callback does not include information about event (like pageAction). Are you sure he did different action according the mouse button?

P.S.: Here is the related code from XPI:

    /* Browser action listener */
    chrome.browserAction.onClicked.addListener(
    function(tab)
    {
        if (higherURLs.length > 0)
        {
            setTabURL(tab.id,higherURLs[0]);
        }
    });
Gitoffthelawn commented 7 years ago

Yup... Primary-click goes up one level, secondary-click opens a menu.

PerfectSlayer commented 7 years ago

Hey there! I just came back yesterday and I still enduring the jet lag. :sleeping: Nevertheless, I found 4~5 hours to start the web-extension port.

Here is the result! demo-1 It's still an early preview but looks promising. 😊

Gitoffthelawn commented 7 years ago

I hope you had a good trip.

That early preview does look quite promising! :)

PerfectSlayer commented 7 years ago

In the last commit (46f683bbbcf02495fbf2bd3a8b48f36f3fc65dc6), I add hotkeys! 🎉 You can now navigate between folders using keyboard shortcuts:

Spoiler alert: I can't let user define its own keys for the shortcuts (it's hardcoded in the add-on manifiest) but I plan to add an option to disable them. It should prevent user complaining about keyboard shortcut compatibility issue. 😉

I hove you will enjoy the new feature!

Gitoffthelawn commented 7 years ago

Thank you! It's looking great! 👍

PerfectSlayer commented 6 years ago

I just pushed the latest feature: settings! 🎉

You could now disable icon and shortcuts and customize folders computation (parse anchor and GET variables or not). Here is what it looks like: settings

The port tends to be feature ready. I'm thinking about pushing it as a beta on AMO soon so you could test it and give me some feedback 😉

Gitoffthelawn commented 6 years ago

Sounds good! 👍

PerfectSlayer commented 6 years ago

As the version 57 of Firefox is coming next week, I will make the release. I stop the development here for the version 6.0.0 so I close the issue. The rebranding #41 should be for the next update as I do not have enough answer to the survey.

Thanks for pushing me to port this add-on! 😉

Gitoffthelawn commented 6 years ago

Thank YOU for porting it!