Skip to content
This repository has been archived by the owner on Nov 7, 2022. It is now read-only.

Ability to bring focus to the address bar to edit the url/enter a new url. #132

Open
chausies opened this issue Nov 17, 2017 · 5 comments
Open

Comments

@chausies
Copy link

In all other keyboard-based web-browsing extensions, there's the functionality that, from the current webpage, you can press a key (like o) which let's you enter a new url you wish to go to. Even better is when you can press a key which brings the focus to the address bar, where you can type in a new address or edit the current address.

Could this simple but crucial functionality be added?

@chausies
Copy link
Author

chausies commented Nov 17, 2017

If it helps, (ctrl+L), (ctrl+E), and (ctrl+K) all already brings focus to the address bar in Firefox.

@alexherbo2
Copy link
Contributor

WebExtensions API doesn’t let us access to the address bar.

It’s possible using macros though.

@chausies
Copy link
Author

I think it would be a really, really fantastic feature that would solve a lot of these problems if Saka key could allow for custom macros. So I can map (o) to be (ctrl+K). Or I can map any other key to be one of the built-in Firefox shortcuts, for example.

@ghost
Copy link

ghost commented Nov 19, 2017

@alexherbo2 Could you elaborate on how to get a macro working in Firefox? Just like the OP, I would like to focus the address bar using o (and additionally to focus the search bar using O).

@alexherbo2
Copy link
Contributor

alexherbo2 commented Nov 19, 2017

Using the native messaging API, we can run native applications on the machine.

A native application is nothing more than an external program which listens on stdin JSON messages, and sends back JSON responses to stdout.

Extensions and applications can exchange messages using an API similar to the message passing we used to, except we pass in addition the name of the application when creating the port.

We can make any sort of things of a native application, like executing shell commands.
But a native application cannot run by them self, and an extension cannot connect to native applications with out having been before hand authorized.

Native applications have to be registered on the host machine – in a manifest file – in order to be used.
The location of the manifest to install depends of the browser and OS.

Once the manifest is installed, an extension can exchange messages with the application.

The ID of the extension has to be granted in the manifest you installed in order to allow communication.
So only extensions that have been explicitly authorized can make use of a native application.

Once that all is set up, our extension can connect to the application by entering it’s name – which is registered in the manifest – and send it’s first message, say press Control-l when the o normal command gets executed.

The press command to execute will depend of the OS – and eventually the display server if you’re on Wayland already.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants