New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Meta] Refactor to WebExtension add-on #13

Closed
Croydon opened this Issue Mar 10, 2016 · 74 comments

Comments

Projects
None yet
@Croydon
Owner

Croydon commented Mar 10, 2016

Till the end of 2017 (ca. 2017-11-14, release of FF v57) add-ons need to be rewritten as WebExtensions.

This affects which Firefox version VTR will be able to support, please read: #13 (comment) for more information. When the porting to WebExtensions is done I will declare this add-on for the first time as stable, since it's eliminating all kind of crazy behavior, which wouldn't be easy till impossible in the legacy add-on form.

Timeline:

  • FFv53 (2017-04-19; 0.8.3): Make WebExt main settings manager, remove old settings
  • FFv55 (2017-08-08, 0.8.4): Opt-in for the new tab sidebar
  • FFv56 (2017-10-03, 0.8.5): Opt-in for the new tab sidebar
  • FFv57 (2017-11-14, 0.9.0): Not possible to use the old tab sidebar anymore

Using the development version:
There is already an experimental, feature incomplete WebExtension-only version on the development channel on AMO (at the end of the page). Nightly users might want to use that in the meantime.

Roadmap:

  • Embed a WebExtensions https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Embedded_WebExtensions (9913686, 0.8.0)
  • Sync SDK add-on settings with WebExt add-on settings (9913686, v0.8.0)
  • Manage add-on settings UI by WebExt (6f2abed, 0.8.1)
    • Give settings UI again a Firefox native look&feel (80b7a51, 0.8.1)
      • Re-apply when Firefox's invisible checkbox bug is fixed (and the rest works as well..)
    • Add hidden add-on settings in the UI since about:config won't be possible (e896df0, 0.8.3)
  • Manage add-on settings by WebExt (6ad76c0, 0.8.3)
  • Remove settings from SDK
    • VTR prefs (90d9dab, 0.8.3)
    • Firefox prefs manipulation (5961484, 0.9.0)
  • Remove theme setting "None / Firefox default" which makes no sense anymore due to sandboxing (27bfb17, 0.8.5 + 627e93c, 0.9.0)
  • CSS/theme/templates
    • Load templates/themes/any other css by WebExt
    • Move data/ to WebExt (8b2db1c, 0.8.3)
    • Remove legacy CSS like splitter (cf5c17f, 0.9.0)
  • Manage hotkey by WebExt (329adea, 0.8.4)
  • Manage Events by WebExt
    • Window Events (6dcf9e0, 0.8.4)
    • Mouse Events
  • Manage windows by WebExt (904409b, 0.9.0)
  • Introduce hidden experiment add-on flag (91cd1e5, 0.8.4)
    • Enforce debugging, hidden settings and experiment flag to true for Firefox Nightly (2a9a61d, 0.8.4)
    • Enforce debugging and hidden settings for Firefox Beta (80bcaea, 0.8.4)
  • Install, uninstall, update management regarding user data migration
    • Create information page with changes in VTR and show to user once when updating to WE-only version (7bcf0ae, 0.9.0)
  • Add toolbar button to toggle sidebar (8f72143, 0.8.4)
  • Add tab browser sidebar
  • Look into creating an optional WebExtension experiment for Unbranded Builds, Dev Edition and Nightly to counter combat some of the limitions of the WebExtensions APIs
    • Investigate if such an experiment can be installed in Beta, Nightly & Unbranded before FF57 release automatically

Tracking:

Post-57-jobs:

  • Hide default tab browser #128
  • Toggling of sidebar doesn't always work due to Firefox API limitations #134
  • Complete context menu options #120
  • Discover opportunities to support Firefox for Android, Chrome, Opera and Edge #117
  • Provide API #74
  • Rewrite some parts to use newer JavaScript (classes, modules (https://bugzilla.mozilla.org/show_bug.cgi?id=568953)

Original:

In order to make the code pain free and more reliable I plan to remove all XBL/XUL/XPCOM stuff and migrate it fully to SDK.
XBL/XUL/XPCOM will become deprecated anyway as soon as WebExtensions are more stable.
I am not sure yet, if the SDKs will provide all necessary functions to make something equal to the current functionality, but Mozilla will enforce to go this way in the long run anyway.

@Croydon Croydon changed the title from Drop XUL/XPCOM to Drop XBL/XUL/XPCOM Mar 18, 2016

@Croydon Croydon added the org:planned label May 31, 2016

@Croydon

This comment has been minimized.

Owner

Croydon commented Jul 1, 2016

Gradual transition to a WebExtenion will be possible and that is my current plan for VTR.

@Croydon Croydon changed the title from Drop XBL/XUL/XPCOM to Refactor to hybrid SDK/WebExtension add-on Sep 30, 2016

@Croydon

This comment has been minimized.

@Croydon

This comment has been minimized.

@Croydon Croydon changed the title from Refactor to hybrid SDK/WebExtension add-on to [Meta] Refactor to hybrid SDK/WebExtension add-on Dec 23, 2016

Croydon added a commit that referenced this issue Jan 6, 2017

@Croydon Croydon added org:in progress and removed org:planned labels Jan 6, 2017

@Croydon Croydon changed the title from [Meta] Refactor to hybrid SDK/WebExtension add-on to [Meta] Refactor to WebExtension add-on Jan 6, 2017

@Croydon

This comment has been minimized.

Owner

Croydon commented Jan 6, 2017

Updated issue description.

@Croydon

This comment has been minimized.

Owner

Croydon commented Jan 6, 2017

Because of the embededded WebExtension the latest Firefox ESR (45) can't be supported anymore.

@Croydon

This comment has been minimized.

@Croydon

This comment has been minimized.

Owner

Croydon commented Jan 7, 2017

Release date of Firefox 51 and VTR 0.8.0 including the sync of settings between SDK/WebExt will be around 2017-01-24.

This VTR release is critical to make sure no users will lose their settings when the full switch to WebExt will happening.

Croydon added a commit that referenced this issue Jan 8, 2017

Refactoring add-on settings further (#13)
* remove direct settings access by lib/verticaltabs.js
* move default settings restore function to WebExt
* move console debug logging to WebExt
* empower WebExt to decide settings

Croydon added a commit that referenced this issue Jan 8, 2017

Manage UI part of settings by WebExtension (#13)
It's already fully functional but needs CSS adjustments to look native again
@Croydon

This comment has been minimized.

Owner

Croydon commented Jan 9, 2017

Many APIs the full rewrite will require will only land in Firefox 53 or even later.

The next Firefox ESR version will be v52.

With other words I will break compatibility with this version very, very quickly, maybe even before the release date of v52.

I understand that this is critical, since Firefox ESR v52 will be the last ESR version with full support of legacy add-ons, NPAPI plugins support and Windows XP and Vista support.

Due to a lack of time I can't do it otherwhise. And I'm trying to give my best to release a stable enough version for Firefox v52 users (the version after VTR v0.8.0) so that users of Firefox ESR v52 will be able to stay with it for the period of a year. As soon as I have pushed a version using newer APIs I also won't be able to push bug fixes for FF v52 users without downgrading all other users. So it will be really set in stone when it's not incredible critical (meaning: breaking Firefox, security issues).

Thanks for your understanding.

Croydon added a commit that referenced this issue Jan 10, 2017

Refactoring add-on settings further (#13)
* remove direct settings access by lib/verticaltabs.js
* move default settings restore function to WebExt
* move console debug logging to WebExt
* empower WebExt to decide settings

Croydon added a commit that referenced this issue Jan 10, 2017

Manage UI part of settings by WebExtension (#13)
It's already fully functional but needs CSS adjustments to look native again

Croydon added a commit that referenced this issue Jan 13, 2017

Croydon added a commit that referenced this issue Jan 15, 2017

Make WebExt main settings manager (#13)
* also remove SDK simple-prefs and Services module
* remove unneeded and partically forbidden CSS from options.html

Croydon added a commit that referenced this issue Jan 15, 2017

Croydon added a commit that referenced this issue Oct 30, 2017

Croydon added a commit that referenced this issue Oct 30, 2017

@Croydon

This comment has been minimized.

Owner

Croydon commented Oct 30, 2017

@InfernoZeus:

In fact, any time I open a tab by clicking a link, the tab is added at the end of VTR, regardless of where the tab appeared.

Thanks for reporting! I actually only tested for the tab order at startup, when existing tabs are getting reordered and when blank tabs are getting created. I didn't test for opening links in new tabs.
Should be fixed with v0.8.6a3.

@Croydon

This comment has been minimized.

Owner

Croydon commented Oct 30, 2017

In the current alpha version pinned tabs cause that not-pinned tabs, which already exists at startup, don't show up. I'm on it...

@InfernoZeus

This comment has been minimized.

InfernoZeus commented Oct 31, 2017

@Croydon Thanks for the fix, will test it out 😄

Hmm, I just went to check which version I had installed, and it already shows v0.8.6a3. I think Firefox must have just updated it for me. Just around that time, the sidebar glitched out on me. It's now only showing a couple of my previously pinned tabs (2 of 7), and a couple of new tabs I've opened since it glitched. Looking at the browser console, I see a bunch of errors in sidebar.js:

this.document.getElementById(...) is null          sidebar.js:416
insertBeforeTab is null                            sidebar.js:471t
his.document.getElementById(...) is null           sidebar.js:416
TypeError: insertBeforeTab is null[Learn More]     sidebar.js:471:13
insertBeforeTab is null                            sidebar.js:471
insertBeforeTab is null                            sidebar.js:471
Error: Invalid tab ID: 631                         ext-browser.js
insertBeforeTab is null                            sidebar.js:471
Content Security Policy: The page’s settings blocked the loading of a resource at self (“script-src https://assets-cdn.github.com”). Source: ;!function(){var t=0,e=function(t,e){ret....   vertical-tabs-reloaded:1

I don't know enough about how Firefox auto updates addons. Does it do a live reload of them?

@InfernoZeus

This comment has been minimized.

InfernoZeus commented Oct 31, 2017

I tried to restart the browser, but the same behaviour persists. Only 2 out of my 7 pinned tabs show, and no others. Only newly opened tabs get added.

I tried enabling debug logging, but it just prints

57.0            index.js:288:13
20171013042429  index.js:288:13
Firefox         index.js:288:13

over and over and over again, multiple times a second.

Croydon added a commit that referenced this issue Nov 2, 2017

Reimplement sidebar toggling via hotkey + VTR icon (#13)
This also implements a basic window management
@Croydon

This comment has been minimized.

Owner

Croydon commented Nov 2, 2017

@InfernoZeus

It's now only showing a couple of my previously pinned tabs (2 of 7), and a couple of new tabs I've opened since it glitched.

That is exactly the bug I mentioned in the comment above yours 😄

I tried enabling debug logging, but it just prints over and over and over again, multiple times a second.

Leftover. Removed now.

@InfernoZeus

This comment has been minimized.

InfernoZeus commented Nov 3, 2017

That is exactly the bug I mentioned in the comment above yours 😄

Whoops! Although it's also hiding later pinned tabs in my case.

Croydon added a commit that referenced this issue Nov 5, 2017

Croydon added a commit that referenced this issue Nov 5, 2017

Reset theme option when set to 'none' on update (#13)
The 'none' option was hidden since 27bfb17
Since WebExtensions are sandboxed, it's impossible right now to automatically adapt to the user's Firefox theme and therefore provide a style which feels completely 'native'. As a consequence the 'none' option was broken and useless.

Croydon added a commit that referenced this issue Nov 11, 2017

Croydon added a commit that referenced this issue Nov 11, 2017

@Croydon

This comment has been minimized.

Owner

Croydon commented Nov 11, 2017

Tab placing and moving when pinned tabs exist should be fixed with v0.8.6a9.

@InfernoZeus Could you please test and provide feedback?

Croydon added a commit that referenced this issue Nov 12, 2017

Croydon added a commit that referenced this issue Nov 12, 2017

@Croydon

This comment has been minimized.

Owner

Croydon commented Nov 12, 2017

I have implemented a landing page with update information. It will be opened once after the update.

vtrlandingfull

Croydon added a commit that referenced this issue Nov 13, 2017

@Croydon

This comment has been minimized.

Owner

Croydon commented Nov 13, 2017

I just implemented drag&drop.
It's very basic right now, will be improved in post 0.9.0 releases (#140, #141, #142).

Croydon added a commit that referenced this issue Nov 14, 2017

@Croydon Croydon closed this in 231f1c6 Nov 14, 2017

@wafflebot wafflebot bot removed the org:in progress label Nov 14, 2017

@Croydon

This comment has been minimized.

Owner

Croydon commented Nov 14, 2017

And just in time for the Firefox 57 release today, this is finally...

DONE! 🎉🕺🏼🎉

The first stable WebExtension version is now on AMO!

Obviously, there are still a few rough edges, but I'm expecting it to mature fast going forward, after all creating the basics was the hardest step.

A huuuuge thank you to everyone testing, reporting bugs, using VTR and to anyone being patient when VTR did break in non-stable Firefox releases in the last months. We made it.

@jonasflint

This comment has been minimized.

jonasflint commented Nov 15, 2017

Uggggh. Congrats on the release. Unfortunately I don't really have use for the addon for the following reasons:

  1. Compact / Icon Only Mode is gone - this was the only reason I even used this addon. (I loved it for this)

  2. The Horizontal tabs are still there! What's the point on having two sets of tabs taking up space??!!

@bwinton

This comment has been minimized.

bwinton commented Nov 15, 2017

@jonasflint:

  1. shouldn't be too hard to add… I did something similar in this pull request.
  2. is possible with a userChrome.css change, as described here.
@jonasflint

This comment has been minimized.

jonasflint commented Nov 15, 2017

So @bwinton will you be implementing this? It would be a life saver!

@bwinton

This comment has been minimized.

bwinton commented Nov 15, 2017

I wouldn't wait for me to implement it if anyone else was interested, but if I have some free time over Christmas, I might give it a stab…

@InfernoZeus

This comment has been minimized.

InfernoZeus commented Nov 17, 2017

@Croydon Sorry for the slow feedback re the issues I raised.

Can confirm that the issue with tabs always being placed at the end is gone.
I can also move tabs now, but the "faded" preview of the dragged tab gets stuck briefly after starting to drag - is that expected?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment