atyourcommand
NOTE: This project is not yet functional.
Firefox add-on for opening arbitrary web content into the command line
(which also enables opening arbitrary web content into other web apps
via WebAppFind).
A number of automatic substitutions are available (and documented within
the dialog) such as obtaining the current URL, title,
content as HTML or text, etc.
Installation
Install the bundled XPI file.
To develop with source, install with npm:
npm install atyourcommand
Immediate to-dos
-
Display of commands in context menu or with list of commands
in edit mode (with the list of commands pre-opened) or in
new command mode (with the list pre-closed)
-
Finish behavior providing substitution of current page contents,
URL, etc. (see todos in main.js under "buttonClick" "execute" event)
-
Submit to AMO
-
Support defaults (including empty ones) and document
-
Also support text selection, URL, image, and custom context(s)
- Option to have context menu items, based on the substitutions used (or
user choice), cause them to only appear under certain, correct conditions
(but ensure commands can utilize multiple components (e.g., highlighted
link and page HTML)
- Give user choice on whether to provide content only in certain
selector-based contexts (but making necessary JSON-friendly
conversions, e.g., canvas to data URL, for them); video, audio,
object/embed/applet URL, , etc.
-
Optional pre-processing of highlighted contents esp. if cannot convert to
HTML (e.g., toDataURL on canvas)
- Ensure, as with QR Secret Decoder Ring, that we can get a privileged
toDataURL canvas snapshot as an argument.
- Any way to create convention to get data out of a plug-in by
right-click (and demo)?
Higher priority to-dos (longer)
- Opinion piece on great importance of data ownership and decoupling of local
or remote data from applications (also discuss need for return to (user-approved)
globalStorage
for application independence and potential use in websites adopting
application-neutral add-on frameworks, and
SharedStorage,
AsYouWish namespaced storage,
and the HTML5 download attribute (whose ability to save anywhere is nice
but does not allow the site to prompt for a specific directory and does not
allow for automatic reading back of the file),
as hacks in the interim). Also consider idea for requesting or providing content
(prefs, request for privs, drafts/documents/chat logs/social media content) stored
in such globalStorage
under user-approved (or site-approved) license and
purchasing terms negotiated in the browser with acceptable third-party verifiers.
Cover need for "data ownership" to more frequently accompany privacy
discussions. Ridiculousness of effort at code being decoupled when web (and
desktop in connection with the web) is itself not decoupled. Also cover the
ideas for PUT requests (for decoupled saving), SQL/local file/cache (see below)
toward allowing universal and
neutral APIs to obtain and save portions of documents as well as whole
documents among open data sources and applications (e.g., to right-click
when using a Firefox add-on for localStorage, FileSystem, or IndexedDB
browsing and send the data to the command line, including optionally
to WebAppFind for discovering a suitable web-app, and allowing an API
for saving back, thus freeing the user from local storage data lock-in).
Likewise for right-clicking a particular element (or XPath/CSS Selector
expression?) within a document to do a PATCH back to the server for
replacing just that portion with whatever value is indicated by the user or
by the web app which was delegated responsibility for the PUT/PATCH (an
HTML/XML document is itself a kind of database). - Add interfaces to the likes of Firefox's SQLite database (including
for access to its localStorage contents) or to FileWriter/FileSystem
and cached files (e.g., when right-clicking on a document, getting its
HTML cache or resource file cache files, or its localStorage, etc. so
no data is inaccessible) and HTTPQuery/PATCH requests for a
potentially friendly and uniform approach (which could subsume the
local SQLite API as well)
- AtYourCommand to include HTTPQuery (partial) retrieval of remote content
(though delegate partial saving back to webappfind?)
- Conditional operator to check whether PUT, HTTPQuery, etc. is supported,
and if so, change text sent to command line accordingly (convenience)
- Idea for command line apps to align themselves with a uniform,
atyourcommand-friendly syntax to simplify supplying of data (and to allow for
UI-building of such arguments for apps which are compliant). Indicate on
wiki projects supporting. (Or better yet, parse existing help files or
command line help flag commands, if structured enough.) Also
allow joining of commands. This could actually work with WebAppFind,
e.g., to make flags prefixed with webappfind- along with its own modes
(e.g., view, edit, binaryedit) or custom modes--see next todo.
- Make desktop app (e.g., Notepad++ plugin? though ideally also a
database app to demo with data that is typically otherwise "locked
away" to other apps) which allows right-click
of text or a URL, etc., and then displays commands stored by AtYourCommand
(in files which themselves might be openable in a WebAppFind filetypes.json
manner), determining relevance of commands by reverse detecting their
"" or whatever substitutions, demoing how a desktop app can in
turn allow contextual snippets to be shuffled off to other applications
including web-based ones (via WebAppFind). See also todo for WebAppFind
re: possible command line syntax within filetypes.json.
Higher priority to-dos (shorter)
- Add demo of data page being opened into WebAppFind and sent to web app
which feeds data to a plug-in and receives data back for a PUT save back to
the remote file (important for showing capability of native apps integrated
with browser gaining same workflow access to the opening and, optionally,
editing, of a document, including online editing).
- As per AppLauncher feature request, default to a specific, configurable
executable path (or save multiple options for drop-down)
- Include pre-sets for opening into WebAppFind (and Firefox) and
example like Notepad++
- Investigate other applauncher.js aspects for possible types of substitutions?
- Make reference to potential use with filebrowser or filebrowser-enhanced
links on the currently loaded file (optionally with args)
- To handle file:// URLs and c:\ paths that are right-clicked (or currently
loaded) to: expose folder (or copy folder/file path), bare execution on
desktop or with web app (without specific executable, args, etc.; also
provide a prompt), e.g., for executables/batch files, see filebrowser enhanced
to-do about splitting off its context menu/add-on bar file:// capabilities into
separate add-on.
- Allow storage of own "path" environment for greater portability across OS.
- Might add items like JSON-stringified array of current
<link href>'s or <html manifest> string.
Possible to-dos
- If a link type of command is chosen but no link is selected, find first
link in page. Same with images, videos, script files, stylesheets, etc.
- Display of commands in dialog: move up/down instead of alphabetical?
- Create icons, etc.
- If item is required, could prevent "submit" (currently not
using , so no submit).
- Might allow selection of submenus, separators, etc.
- Any other command line necessities (besides quoted string escaping)?
- As per AppLauncher feature request, allow shortcuts on the toolbar; also
modify to work with main menu, app-bar, or key command as well
- Ability to confirm selected text content is a path, URL or file URL, etc.?
- Allow atyourcommand to send content to web apps directly through WebAppFind
code when present (as opposed to through command line)?
- Remote site supply of commands
- Way for websites to register commands or groups of commands upon
user introspection and permission
- Served with special content type and protocol meant for external launching?
- Create protocol to force dialog asking to launch app (so if user
clicks link, will get asked), optionally with args, and optionally with
desktop file or remote URLs, etc. as content; will thereby also be
able to support (and demo) WebAppFind invocation from remote
- De-coupling of remote content from its executable (as in regular
atyourcommand) but remember upon future loads of the content
- Modify Open In Browser
add-on to allow launching of a file URL including with own args (and
optional saving/editing of the command for reuse across atyourcommand
content)
- Overlay
Open In Browser
but make it support site prefs (but not by domain as with Mozilla content prefs!)
(in addition to mapping MIME to commands)
so choice will be remembered (checkbox to remember choice including
any arguments, passing URL and/or file contents); also allow
WebAppFind detection (e.g., remote filetypes.json?) in addition
to MIME detection?
- Point out potential use in automatically launching WebAppFind-driven
web apps automatically with web data (and with PUT requests back to
server, could get full round-trip decoupling of data and app)
- Allow all file:// URLs to optionally be opened externally as per https://support.mozilla.org/en-US/questions/758172
- Cover usage of http://kb.mozillazine.org/View_source.editor.external and http://kb.mozillazine.org/View_source.editor.path
- As with my possible todo for
Open In Browser
site prefs, make the filebrowser-enhanced context
menu and right-click on WebAppFind icon (for the opening of the current
browser document into WebAppFind) sensitive to site prefs so right-click
arguments can optionally be remembered; share options across all of these
addons?
- To make atyourcommand more meaningful, ensure works with a
Gopher-over-HTTP protocol (e.g., one limited to
- elements and other tags
auto-escaped):
- Do Gopher system for these files just extra required header; search "Gopher (protocol) over HTTP" (FTP, WebDAV?)
- Problem with informational message--needs to map to real files; use instead hidden files of given extension with optional sticky coordinates
- Use WebDAV request (via same-site Ajax or Firefox add-on privileged cross-domain (already with WebDAV add-on?)) for directory (propfind overloaded, was it?) so request for individual file reading or writing (as with directory listing) can be made over HTTP (including reverse webappfind)
- Exporting as batch files, and converting batch files upon import (also in
conjunction with
Executable Builder) which
could allow for convenient reuse of the content when attaching the batch
script to a "Open with..." handler. Use approach like
http://stackoverflow.com/a/5215844/271577
- Have a mechanism to return from a WebAppFind-opened web app
back to the page which was the source of its content (e.g., in case one
accidentally didn't grab enough text or whatever)
To-dos related to context-aware power-use or web-desktop interaction but beyond current scope of atyourcommand
- https://github.com/piroor/ctxextensions (restartless and to AMO?);
support not only full custom control over context menu, but also
toolbar, menu, add-on bar, key command, etc.
- Break apart functionality to specialize in context menu
text and URL manipulations? (If so, ensure some other way to
have full control over where tools appear; do this by modifying
the Firefox Add-ons SDK itself so capability baked-in?)
- Integrate with or replicate Greasemonkey behavior also?
- Get context menu to support hiding items via whitelist or
blacklist until exposed by a key command (so that for normal
browsing, the context menu is light, but can be made more
powerful at a keystroke).
- Utilize (JavaScript-based) Blockly for pipelining of any kind of
command (though avoid baking in UI as UI should be flexible, e.g.,
to allow use in menu, toolbar, add-on bar, etc.); also macro-like
development
- When allowing users to create command line commands
for context menus/menus/toolbars/add-on bar/etc., allow and demo
(with Blockly?) JS prompts (useful for dynamic batch), e.g., to
replicate atyourcommand functionality. Might automatically provide
prompts when a variable is indicated without a value unless
marked as having a default (including an empty one).
Inspiration
The main impetus for this project comes from my interest to act in the
reverse direction from https://github.com/brettz9/webappfind, but some
ideas were obtained from https://addons.mozilla.org/en-US/firefox/addon/applauncher/
after I discovered it had some of the same ideas (but I wanted it restartless,
with baked in WebAppFind support, etc.).
I was also very much inspired by (and would ultimately hope to replicate) the
powerful ContextMenu Extensions
add-on which admirably provides controlled but extensible and open
programmability to regular users.