Everyone already has the source codegreatlord wrote:I wish I could. Did yuoo2k give you the source code?xeonx wrote:All Add Bookmark Here users,
Is there anyone who may be able to assist in porting this to WebExtensions so we can ensure this addon remains for Firefox, or help in finding those who can?
The source code is downloaded to every computer which installs it, as is the case with almost all Firefox add-ons (and Chrome extensions). Add-on developers can obfuscate and/or minimize the code, but the code does exist on each machine. Having it already in a repository, might be helpful, but not needed. The license is the Mozilla Public License 1.1, so modifying it is permitted.
Having the source code doesn't help, much: WebExtensions just can't do it
Unfortunately, having the source code is of marginal utility. WebExtensions are quite different from "legacy" XUL based extensions (which ABH2 is). WebExtensions have almost no capability to change the browser UI (they can add a single button). The significant majority of the things ABH2 does are not remotely possible to do as a WebExtension. For example:
- It's not possible to add an entry to any bookmark drop-down menu (i.e. no "Add Bookmark Here...")
- It's not possible to change the Edit Bookmark Dialog (in any way)
- It's not possible to change the Bookmarks menu (in any way)
- It's not possible to change what happens when you click on the Bookmark Star
So, basically, everything that ABH2 does is just not possible under WebExtensions.
What you'd have to do in WebExtensions
To get some semblance of what ABH2 does, you would have to create a new, completely different, interface to bookmarks, which the new extension would control. It would be permitted to show that interface in only one of: a popup, or a sidebar (not both; not select-able by option; must be hard-coded). You could add a context menu entry to the page, which could approximate the bookmark interface.
Instead of a official popup (or in addition to such popup), you can use a pseudo-popup, implemented in a separate window. Doing so would allow you to keep an interface open even when the user changes tabs, or otherwise changes focus away from a popup (normal popups automatically close when they loose focus, etc.).
But, basically, the entirety of the extension has to be re-implemented as a completely different user interface, this would likely include large portions of duplicated functionality with Firefox's existing interface. Even then, it would be incomplete, because the WebExtension API has no access to bookmark tags. Of necessity, such an interface would be almost completely separate from the browser UI. The only integration would be that you use the browser UI to open this new UI.
Some, potentially useful, functionality could be implemented with a context menu which basically duplicates the bookmark drop-down menu. I'd have to see a prototype of it to see how beneficially this might be. This would have to be a general context menu addition, as it's not possible to target the bookmark menu with a context menu change.
Options for continuing to use ABH2
Your only real options for continuing to use ABH2 are:
- Stay on Firefox 55, do not upgrade to Firefox 56+, or
- Switch to using Firefox 52 ESR, which will be supported until 2018-06-26.
- main Firefox ESR download page
- Firefox release repository
- NOTE: Firefox changed the format of some files in Firefox 55, which may cause you problems downgrading to versions below Firefox 55. A good number of users have reported they they experienced no significant problems when downgrading to Firefox ESR 52. However, the problems mentioned are stated as: "Installing an older version of Firefox after using Firefox version 55 or above can cause problems such as error messages, breakage in portions of Firefox and issues with some websites." Thus, such problems may be intermittent. It is generally recommended that you use a backup of the profile which was made prior to upgrading to Firefox 55, or perform a refresh.
- File bugs in Bugzilla requesting enhancements to Firefox for the main things you use from ABH2. While it's unlikely that Firefox will incorporate the level of customization which ABH2 permitted, it's not unreasonable for them to add small portions of the functionality (e.g. adding the "Add Bookmark Here" and "Open All in Tabs" entries in the bookmark drop-down menu are reasonable candidates).
- Some of the style changes which ABH2 does for the bookmark dialog can probably be implemented through userChrome.css. See my post later in this topic for more details. Mostly, making changes this way has issues.
- For your own personal use, it's also possible to modify the Firefox code, either the code which is compiled into the Firefox executable, or the JavaScript/CSS/HTML/XUL which is contained in the omni.ja files within the Firefox distribution. This is possible, but a pain in the rear. I did it for personal mods, which I eventually turned into a "legacy" extension, as that was about the same amount of work as having to perform the modifications each time Firefox updated.
To implement this option would require continued development at a somewhat higher level of effort than has been needed in the past, but without the ability to ship the modifications to others as an extension. The current issue of not working with the changes in Firefox 56 would need to be resolved, and then FF57, etc. While possible, this is not an option with much appeal, except for things which someone personally finds *very* useful.