brettz9 / webappfind

Other
22 stars 8 forks source link

commandLineHandlerComponent.js #1

Closed belaviyo closed 8 years ago

belaviyo commented 8 years ago

Hi,

I was wondering if commandLineHandlerComponent.js still works on new versions of Firefox? I tried to use your XPI but seems like Firefox cannot detect commandl ine arguments

brettz9 commented 8 years ago

Yeah, I think it may have stopped working a good number of versions ago, but I haven't gotten around to debugging and seeing what may have been happening. I wonder whether the SDK changed to execute after the necessary time frame when a command line handler could be registered. That or maybe part of the soul-crushing move by Firefox to eliminate XUL and the SDK and imitate Chrome in every way including its lack of powerful add-on capabilities...

belaviyo commented 8 years ago

Yah probably SDK based add-ons are being executed too late. That's a pity.

brettz9 commented 8 years ago

See my new encouraging note at the top of the README in regard to the potential for reimplementing in WebExtensions (and with the big bonus of the concept of WebAppFind being possible in a cross-browser fashion).

brettz9 commented 6 years ago

If you have a Mac machine available, by the way, I'm now in the alpha stages of a complete rewrite, but as my dev machine is now a Mac, that's how I've implemented it. It needs a bit of documenting as well as testing, however, which I hope to do, possibly with a video demo. But it is exciting for me to see it possible to be renewed, and while I haven't reimplemented the old filetypes.json behavior (and it is not a big priority, though I hope it or something like it may be done), WebAppFind now has executable builder functionality which lets you easily make executables (AppleScript) that can open files in a desired manner, and it also handles the default file associations, Open With, etc., for you, if you just indicate the content type or file extension you wish to associate it with.... Going out of town, but feel free to comment further if you like...

brettz9 commented 6 years ago

The reimplementing was made possible through Native Messaging, a feature of WebExtensions which allows for higher privileges--in my case using Node.js. Unfortunately, I believe AMO won't allow their distribution and I don't know about the Chrome store (though this currently only works in Firefox). But if someone is willing to download an executable or build from source, there is the possibility.

I had also found a tool that allowed bundling Node within an executable, so one wouldn't technically need to install Node additionally. However, it made quite large files, and I'm not sure it is worth.... But hope to investigate as I may find time...

brettz9 commented 6 years ago

And now, FWIW, there are some video tutorials available as per the README...e.g., the overview at Youtube: https://www.youtube.com/watch?v=2ysSAPKhDwQ&feature=youtu.be

xthdraft commented 5 years ago

Hi Brett I just came across this mention of ASYOUWISH in this repo. As you might remember, some years ago I wrote a complete word processor app (xthdraft) using firefox with AYW as the local file handler. It worked like a charm until Mozilla disabled the xpcom functionality. Does this recent use of AYW mean that FF now allows file i/o for extensions? I'm guessing not.

I redid xthdraft as an electron app and also as an nw.js app (identical look and feel & functionality with nw.js offering the notable advantage of allowing js code to be pre-compiled into bytecode).

I'm planning to launch the app at the end of the year. If you like I can send you a copy. I really appreciate your early work on AYW, as it enabled me to get my own project going initially.

All the best... Eamon

brettz9 commented 5 years ago

Yes, hi, Eamon... I would be interested to check it out as I have time/energy.

Though other browsers support or are closely related to WebExtensions (i.e., Chrome), currently WAF (including its AYW component) only supports Firefox--though it shouldn't be too difficult for someone to add the support (though I'm not so inclined at this time).

While WebExtensions doesn't directly support file IO, it thankfully at least provides Native Messaging--which is what webappfind uses--to allow you to provide your own executable which can communicate with your add-on code. You can use pkg to make an executable for Node (as webappfind does).

While my webappfind code is not currently using it, there is a appealing-looking project at https://github.com/NiklasGollenstede/native-ext/ to try to make a standard way for add-ons to work with Node APIs. If you are going to the trouble of making an add-on, then that is probably a better approach then using AsYouWish within WAF (though you may still wish to support the WAF add-on/protocol so that users can directly double-click files on their desktop to open into your app--though you'd need a web end point for the app, whether localhost or a remote site, as waf doesn't currently support opening into other add-ons).