Skip to content
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

Switching to palemoon? #895

Closed
pluto439 opened this issue Nov 8, 2017 · 10 comments
Closed

Switching to palemoon? #895

pluto439 opened this issue Nov 8, 2017 · 10 comments

Comments

@pluto439
Copy link

pluto439 commented Nov 8, 2017

How about switching to palemoon and continuing development there?

@lydell
Copy link
Collaborator

lydell commented Nov 8, 2017

Let's keep this issue open to help gathering how much demand for it there is.

Perhaps if enough people 👍 this issue somebody will step up and do it! I have no interest in doing it, but maybe there's someone out there.

@Turysaz
Copy link

Turysaz commented Nov 8, 2017

👍

@pluto439
Copy link
Author

I'll probably do it myself. I just need somebody to poke in case I'll get stuck.

About the require() function, how does it work exactly? Does it create new scopes? I'm asking because I made addons before only by copypasting them into the browser console, I'm dependant on everything being available globally.

I have a VimFx copy from 2015, the time I first tried to understand how this extension works, both coffeescript and javascript versions.

@lydell
Copy link
Collaborator

lydell commented Nov 14, 2017

About the require() function, how does it work exactly? Does it create new scopes?

Yes, it creates new scopes. It is closely modeled after require in Node.js. It's defined in https://github.com/akhodakivskiy/VimFx/blob/master/extension/bootstrap.coffee

Feel free to ask more questions as needed!

@lydell
Copy link
Collaborator

lydell commented Nov 17, 2017

@Haozun 1) and 2) are (as you seem to be aware?) limitations of WebExtensions – they simply aren't allowed to do those things. Might change in the future, though.

@pluto439
Copy link
Author

pluto439 commented Nov 18, 2017

Can you please describe how exactly you intercept key presses? You hook each tab separately?

What's the difference between main-frame.js and main.js? I've seen bootstrap.js/startup() called for both, but I thought startup() is supposed to be called only once, at program startup.

@lydell
Copy link
Collaborator

lydell commented Nov 18, 2017

The type of extension that VimFx is has this concept of code that is running in the browser UI context, and code that is running in each tab's webpage context (called frame scripts). In the early days of VimFx there were no such distinction; the UI and all webpages were run in the same context. The separation was codenamed "e10s" or "electrolysis". VimFx used to do all event listening in events.coffee, but when upgrading to e10s we had to introduce events-frame.coffee as well, which is loaded once in every tab and listens for events that originates from webpage content. There are a bunch of foo.coffee and foo-frame.coffee pairs. foo.coffee runs in the UI context, while foo-frame.coffee does the equivalent work in frame/webpage context. All of this frame stuff is also explained in comments at the top of every file. I encourage you to read the top of every file to get a hang of what everything does.

@RaitaroH
Copy link

I personally moved to Waterfox. Vimfx worked fine until yestarday, for some reason it doesn't respond and I have to reinstall. All my settings are intact but is annoying. Beyond that I would even go to palemoon in a heartbeat if that means to keep this extension. I am using it so much I CANNOT use a browser without it anymore. Also @LukeSmithxyz moved to palemoon and I'm sure a lot of his audience too, including myself. And I am pretty sure a lot of those people also use Vimfx.
I also have other extensions, CSS changes and stuff I need to keep so...

@lydell
Copy link
Collaborator

lydell commented Nov 22, 2017

@RaitaroH See #902.

@mb720 mb720 mentioned this issue Feb 16, 2018
@girst
Copy link
Collaborator

girst commented Aug 19, 2019

Against my better judgement, I've had a look at this myself. I'll leave my opinions about browser security, the developers and their actions and decisions at the door and focus solely on what would be necessary to port VimFx to palemoon.

First, some background is necessary to understand what makes this as complicated as it is[1]. Palemoon was originally forked from Firefox 24ESR, just before Australis was introduced. Palemoon later rebased first to fx38, then fx52 (both ESR), but wanted to pretend that they were still a fx24 fork, so they ripped out most of the post-Australis front-end code[2].

To VimFx: the latest version (v0.21.2) won't run out of the box. You're greeted with a "friendly" single-line traceback. Removing the toolbar button (which uses Australis-APIs since v0.6.0/2015) lets us move forward, to only encounter a similarly cryptic error regarding ContentClick and AddonManager. After removing these calls too, the add-on still doesn't work, and now we aren't getting any errors at all any more. With no indication as to why it's failing there's not really a path forward.

This might be a good moment to tell you that their devtools have severely bit-rotted: you can't load a temporary add-on[3], nor does the debugger work[4]: Changing stuff requires zipping up an xpi every time.

Of course, I also tried running VimFx versions from the Firefox 24 days: v0.5.17 at least starts up, but then fails at events.coffee[5], and 0.4.x doesn't do anything but displaying the icon. It's likely that some of the APIs VimFx used back then were dropped by Mozilla somewhere between fx24 and fx52 and palemoon haven't forward-ported them. Given that much of the code has been overhauled in the >4 years that v0.6.0 came out, lifting code from these old versions into current VimFx isn't a viable option anyways (not even considering the general uglyness this would introduce in the codebase).

In conclusion: palemoon is trying to be both fx52 and fx24 at the same time, and failing at both[6]. If you want to run VimFx, use Waterfox[7], or better yet: Firefox-proper with my LegacyFox AutoConfig.


Footnotes:
[1]: All facts from Wikipedia and what I could gather from their "UXP" repo
[2]: This makes their code base quite the hodge-podge of different Mozilla-era code, incompatible (to a degree) with both pre- and post Australis add-ons.
[3]: "TypeError: AddonManager.installTemporaryAddon is not a function" -- lovely.
[4]: I couldn't be arsed to debug the debugger, so no details there apart from "unlikely VimFx's fault", I'm afraid.
[5]: "TypeError: vim.rootWindow.gBrowser.getFindBar is not a function" among others
[6]: side note: one good thing came out of this: I now have some more arguments as to why I won't recommend this browser to anyone.
[7]: Waterfox is no silver bullet; wf56 is getting old too and the fx68-based version is still in alpha. There is also always a security risk to using browsers developed by hobbyists in their spare time.

@girst girst closed this as completed Aug 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants