teddy-gustiaux / default-bookmark-folder

WebExtension allowing you to choose the default bookmark location folder and quickly bookmark pages via a dedicated icon.
https://goo.gl/WtfpPH
MIT License
131 stars 17 forks source link

Firefox "2020H2 bookmarks improvements" project #399

Closed teddy-gustiaux closed 5 months ago

teddy-gustiaux commented 3 years ago

This is a Meta Issue

TL;DR:

Firefox internal changes means the add-on needs to change the way it works internally as well. It will continue to work, with a minor limitation. Bookmarks created by drag-and-drop will automatically be moved to the configured default folder instead of staying where dragged if the Firefox built-in bookmarking override is enabled (moving bookmarks is not affected). Everything else will continue to work as before.

I am planning to release a new major version 3.0 and I hope to have it available on AMO before the official release of Firefox 85 to the public on 2021-01-26.

Description

The Firefox team has been working towards a project called "2020H2 bookmarks improvements" (meta Bugzilla entry here). As the name indicates, it intends to improve the experience regarding bookmarking with the browser, which I believe is a good thing!

However, it does change the way bookmarks are handled internally by Firefox, and as a consequence, breaks the add-on. More specifically, it breaks the original and main feature allowing you to set the default bookmark folder for bookmarks created using the browser built-in system. Let me try to explain why and how I am trying to fix this.

Previously, all bookmarks created by Firefox (i.e. not by a third-party extension) were added by default to the "Other Bookmarks" folder. The add-on was using this fact as a base for its internal logic. It allowed me to process things differently if they were created by Firefox or by another means (i.e. override the default bookmark folder if configured in the former, and doing nothing in the latter).

With this project, Firefox is changing the default folder where created bookmarks are added. Instead of using the "Other Bookmarks" folder, it will use a different one. As you can imagine, this breaks the internal logic of the add-on.

History of the changes

Getting the add-on working again

One could assume figuring out the value of these flags when the add-on is running and adapting the internal logic accordingly would be enough to fix the add-on. That is a correct statement.

The issue is that there is no way for the add-on to know the value of these flags. Every user can access and change them via the about:config page, but there is no WebExtension API allowing developers to read these values, or any of the about:config values. This has been the case since Firefox 57.x ("Quantum") and the introduction of WebExtensions, for good security reasons.

Not having a way to read these values, the add-on will have to assume every bookmark is created by the system. What does that mean?

It means the add-on will continue to work, with a minor limitation. Bookmarks created by drag-and-drop will automatically be moved to the configured default folder (if the Firefox built-in bookmarking override is enabled) instead of staying where dragged (moving bookmarks is not affected). Everything else will continue to work as before.

This will be added to the "known issues" list. EDIT: added here.

Questions and answers

Mostly for transparency and documentation purposes. I truly hope this one scenario will not be a blocker for the users, and I understand some will be disappointed. It is unfortunately out of my control at the moment, and this piece helps explain the technical reasons why.

Not that I could find. Even if there were, I would have to be very carefully using them- any "hacky" solution would likely not be reliable and at great risk of breaking in the future. I want the add-on to be a stable and reliable piece of software.

That is possible, although unlikely. Flags like these are sometimes only temporary (I tend to think browser.toolbars.bookmarks.2h2020 will be one of these), and sometimes stay around for a long time (and I think browser.bookmarks.defaultLocation will be one of these). In any case, I would want to use something that I know would be reliable.

I wish I knew! At the moment, it does not appear so but that is always a possibility. Ultimately, I want the add-on to adapt to the Firefox internal changes rather than fight them. If future changes prevent the add-on from working completely, then my hope is that Firefox incorporates the add-on main feature internally. To be honest, that would be a great scenario.

I will release a new major version 3.0 (to indicate the internal changes and the new limitation) very soon, and I hope to have it available on AMO before the official release of Firefox 85 to the public on 2021-01-26. (I am unfortunately later than I would like, as these changes started with Firefox 84, but I have had little time to work on the add-on until now.)

Steps to reproduce the problem

  1. Use either:
    • Firefox 84.x with the browser.toolbars.bookmarks.2h2020 flag enabled.
    • Firefox 85.x
  2. Set a default folder in the add-on settings for the built-in bookmarking system
  3. Try to use the built-in bookmarking system
  4. The bookmark is not created in the default folder selected

Specifications

teddy-gustiaux commented 3 years ago

Version 3.0.0 of the add-on has been submitted to AMO for review. Hopefully, it will be approved and start to be distributed before or as the Firefox 85.0 stable update is also going live.

teddy-gustiaux commented 3 years ago

Version 3.0.0 has been approved and is now being distributed.

vrubleg commented 3 years ago

This issue is a deal breaker. Pity that it can't be resolved. Had to disable the extension =(

You could consider creation a Web Extension Experiment extension for Firefox Developer Edition. It opens full access to internals of Firefox, as it was before Firefox 57 (but can't be distributed from AMO).

Neytrino-OnLine commented 3 years ago

3.1.0 breaks the Private Bookmarks extension :(

vasudev-gm commented 3 years ago

@teddy-gustiaux Dunno if this info will help you or not. Had to disable Default bookmark folder add-on for testing. with 20h2 bookmark config set to true,

browser.toolbars.bookmarks.2h2020 | true

Had chosen bookmark menu as default bookmark path. Even after restart FF now stores all bookmarks to bookmark menu.

browser.bookmarks.defaultLocation | menu____

if browser.toolbars.bookmarks.2h2020 | false FF/Default bookmark folder will not remember last chosen/selected path in safe mode(the config(bookmarks.2h2020 in safe mode) is disabled, I dunno why) and normal mode too.

I tried it on Ubuntu 20 and didn't test it on Windows. So, default location might change accordingly.

tokariu commented 3 years ago

I'm sorry to read the news about the API changes. not being able to drag'n'drop bookmarks from the address bar to the bookmarks-toolbar-folder is a deal-breaker for me. I have to disable the addon unfortunately. And now I'm lacking an option to make firefox automatically add bookmarks on top of a folder (reversed sort order for ctrl+d added bookmarks, and only for new added bookmarks - not for drag'n'drop added bookmarks added to the toolbar which some other addons do then..)

I can only hope that there is a way to get this addon with previous features working again. I would definitely return using it. but for now.. I'm back to drag'n'drop only bookmarking :/

Leloup79 commented 3 years ago

Thank you for the detailed explanation and - of course - for this useful addon! The following may or may not be sort of a workaround, but seems to do it for me:

Elliott599 commented 3 years ago

Can you please provide instructions on how to use about:config to change FireFox set up so that your drag and drop will work? Thank you.

Leloup79 commented 3 years ago

Can you please provide instructions on how to use about:config to change FireFox set up so that your drag and drop will work? Thank you.

If you refer to my comment...as I recall (it was back in February) I did not do changes to about:config. Following my description might be helpful, but I am aware that this worked for my use case, but may not work for others.

teddy-gustiaux commented 5 months ago

This is a late update (my apologies), but I will be closing this issue as these changes are now a few years in. The browser.toolbars.bookmarks.2h2020 flag has since been removed from about:config (I am not exactly sure when).

Please see issue #553 for more details on the current and future state of the project.