Launchlet is a simple way to run customize web sites with JavaScript and CSS.
Inspired by Quicksilver, it lets you run commands via the keyboard.
A Recipe is a format for expressing how functions will run in Launchlet.
A Command is the simplest kind of Recipe. It has a Name
and Callback
:
alert('Hello')
This can be run by Launchlet directly as it has no input.
A Procedure has a Signature
and Callback
, and optionally Arguments
:
alert(message)
This can be called from any other Recipe using the API this.api['Greet']
or this.api.Greet
. In this way, the previous example could be changed to:
this.api.Greet('Hello')
A Subject has a Name
, Output Type
and Callback
:
return 'Yo'
In Pipe mode, this can be used as input for any Action that takes a String
.
An Action has a Name
, Input Types
and Callback
:
alert(message.toUppercase())
In Pipe mode, this can be used on any Subject that returns a String
. Although a Recipe can have multiple inputs, an Action will generally have only one.
Running arbitrary JavaScript can be dangerous, and this project comes with no guarantees of safety from malicious code, but there are a few things that the composer will try to flag and ignore:
eval
or new Function()
document.cookie
, localStorage
, sessionStorage
, XMLHttpRequest
, fetch
Anyone with security expertise and ideas on how to improve safety in the project is welcome to add a GitHub Issue.
It is best to run code that is concise and easy to read.
Optionally, Launchlet can include Recipes from any page that sets LCHPageRecipes
on the window
object to an Array
. This allows pages to expose their functionality in a way that is accessible to 3rd parties:
window.LCHPageRecipes = [{
LCHRecipeName: "Say Hello",
LCHRecipeCallback: function () {
alert('Hello');
}
}];
For example, when running Launchlet on rosano.ca, it is possible to choose a 'Send a message' Command that originates from the page.
AccessKey refers to a one or more shortcut keys followed by a single character. Usually it's Alt
on Windows or Control+Alt
on macOS, but it changes based on your browser and operating system.
Launcher refers to the app's command runner: press Alt+Enter
, type the command, then press Enter
to run.
List of recipes | |
---|---|
Create new recipe | AccessKey+n |
Select previous or next card, if filter field is focused | Up or Down |
Clear filter text and selected card, focus filter field | Escape |
Close, if filter field is focused | Escape |
Clone recipe |
Launcher |
Import JSON (beta) |
Launcher |
Export JSON (beta) |
Launcher |
Global | |
---|---|
Open access link |
Launcher |
Reload |
Launcher |
Force update |
Launcher |
Launcher | Alt+Enter |
Global (when storage is connected) | |
---|---|
Copy private access link |
Launcher |
Enter confirmation code |
Launcher |
Clear authorization |
Launcher |
Flush data |
Launcher |
remoteStorage is an incredible open-source technology for synchronizing data between multiple devices and making it available offline.
It allows the same data to be used in different ways by multiple apps. You could think of it as a USB key for your documents that you can plug into websites to work on your stuff.
You can get one for free from 5apps.
The Launchlet package can be added to your own project as a module to quickly present a 'Jump to' functionality.
https://unpkg.com/launchlet/__compiled/launchlet.js https://unpkg.com/launchlet/__compiled/launchlet.css
npm install launchlet
<link rel="stylesheet" href="https://launchlet.dev/launchlet.css" />
<script src="https://launchlet.dev/launchlet.js"></script>
Launchlet.LCHSingletonCreate({
LCHOptionRecipes: [{
LCHRecipeName: 'Alfa',
LCHRecipeCallback () {
alert('Alfa');
},
}],
LCHOptionMode: Launchlet.LCHModeCommit,
});
Launchlet.LCHSingletonCreate({
LCHOptionRecipes: [{
LCHRecipeName: 'Bravo',
LCHRecipeCallback () {
console.log('Bravo');
},
}, {
LCHRecipeName: 'Charlie',
LCHRecipeCallback () {
console.log('Charlie');
},
}],
LCHOptionMode: Launchlet.LCHModePreview,
});
Launchlet.LCHSingletonCreate({
LCHOptionRecipes: [{
LCHRecipeName: 'Delta',
LCHRecipeCallback () {
alert('Delta');
},
}],
LCHOptionMode: Launchlet.LCHModePipe,
});
Ignore keydown
events if Launchlet is active:
window.addEventListener('keydown', function (event) {
if (Launchlet.LCHSingletonExists()) {
return;
}
// ...
});
Creates a singleton instance of the launcher. Destroys existing instance if there is one. Takes an optional configuration object.
LCHOptionRecipes (array) – []
LCHOptionMode (identifier) – Launchlet.LCHModeCommit
Launchlet.LCHModeCommit
Launchlet.LCHModePreview
Launchlet.LCHModePipe
LCHOptionIncludePageRecipes (boolean) – false
LCHOptionRunAutomaticRecipes (boolean) – false
LCHOptionCompletionHandler (function) – undefined
LCHOptionLanguage (string) – 'en'
'en'
'fr'
'es'
Returns true if there is a singleton instance of the launcher.
Destroys a singleton instance of the launcher.
Runs each Task
that matches the current URL unless LCHRecipeIsExcluded
returns true.