Git Product home page Git Product logo

vieb's Introduction

Hi, I'm Jelmerro

I use a bunch of other sites besides Github, find them on my homepage

Vim Inspired Electron Browser - Vim bindings for the web by design

Garlmap is the Gapless Almighty Rule-based Logical Mpv Audio Player

Configure Vim with autocompletion, keybindings, editorconfig and linting

Support my open source work on Github

vieb's People

Contributors

bromanko avatar cab-1729 avatar cmurtagh-lgtm avatar errge avatar gebner avatar ianbaremans avatar inconsolablecellist avatar jelmerro avatar ottopiramuthu avatar rafael-xmr avatar rogerwim avatar s6muel avatar stevkazt avatar teamtamoad avatar txgk avatar vladdoster avatar yosoymau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vieb's Issues

Add tabs next to the current one

Currently all tabs are added at the end of the tab bar, which should be changed to a setting. This way tabs can still be added at the end of the bar, but also next to the current one, with the possibility to change this at runtime using the :set command.

Improve onclick event listener detection

When entering follow mode, only the onclick attribute is checked for clickable elements, aside from anchor tags and input fields. There is no simple javascript way to check for a list of event listeners, but because the preload script is loaded before all other javascript, it might be possible to override the addEventListener function to keep a list of elements with an onclick event listener. Additionally, it might be needed to do the same for jquery listeners.

A list of useful websites to implement this functionality:
https://stackoverflow.com/questions/26347913/replace-addeventlistener
https://stackoverflow.com/questions/4536788/override-jquery-functions
https://developer.mozilla.org/en-US/docs/Web/Events/load

Select/hover variation of follow mode

It could be nice to have a modified version of the f shortcut,
possibly mapped to s, with the following differences:

  • It will NOT open links DIRECTLY after picking a link
  • It WILL show the complete url for the chosen link
  • Give the user the CHOICE to open the link after looking at the complete url
  • It WILL trigger the hover of the link/element, so no mouse is needed to activate that

To make this possible, a hover needs to be simulated with javascript,
which should be possible with this electron API.

Additionally, the url could be shown in the bottom left when using the real mouse to hover a link when using insert mode.

It could also be used to allow scrolling inside small scrollboxes, by selecting an element in it with this select mode, and using the hjkl keys to trigger the mouse scrolling instead of window movements.

Local file and folder explorer

Similar to other browser (and even Vim), Vieb should show a list of files when navigating to a folder. I believe it should be possible using a preload script, maybe combined with the webview listeners currently already present in the js/tabs.js file.

Vieb should also improve it's local file detection when entering locations on startup or in nav mode, so that it's easier to open files or folders.

Currently, https:// is the default prefix for all startup urls, but some of them might be files or folders. The nav mode doesn't support folders or files unless they are prefixed with file:///.

Ideally, Vieb should check the startup and nav mode input for the following, in order:

  • Absolute file or folder paths, correctly formatted for the running system (so: /home/user/... on Linux and C:/Users/something... or similar on Windows).
  • If the entered path is actually a file or folder, it should be opened like so in Vieb.
  • The entered path should now be checked for being a valid url, if so, open it like a url.
  • If the entered path is not a file, folder or a valid url, ignore it entirely and maybe show a warn notification for it.

Fullscreen API listeners to hide the navbar

Now that the fullscreen bug of electron 4.x seems to be fixed in 5.x, there is another problem regarding fullscreen. The Vieb navbar will stay visible, because the webview has a static size. There are electron API listeners to know if the webview is entering or leaving fullscreen. These listeners should be used to toggle the height of the webview between the current height and 100vh or similar.

vieb can't be closed by regular close request

Hey, this project looks interesting.

I noticed I can't close the an open browser window in my tiling window manager with a shortcut. It looks like vieb can't be closed from outside with SIGTERM. It'll be closed with SIGKILL and :quitall. Not sure why it behaves like that but that's somehow unexpected and I did want to report it.

Developer tools

It should be possible to open the devtools for the current page.
A basic popup implementation would be good enough for a first version.

Rework commands to execute an incomplete command, if it's the only one possible

Current Vieb already has auto-completion and short versions (such as 'q' for 'quit'), but in Vim it's also possible to execute a command by typing just the first characters (if it's the only match). For example, :Ex resolves to :Explore in Vim, because there are no other commands that start with :Ex. However, :E won't execute anything, because there are multiple commands that start with :E. This same behaviour should be present in Vieb for all commands.

Add "mousehide" setting to hide the mouse when typing

Vieb should have Vim's mousehide setting/toggle, to hide the mouse cursor when typing, and show it again when the mouse is moved. These are the requirements for such a feature:

  • Always show the mouse cursor when "mousehide" is disabled
  • Hide the mouse cursor when the user starts typing with "mousehide" enabled (regardless of other mouse-related settings)
  • Show the mouse cursor again when the mouse is moved
  • Mousehide should be on by default
  • Also have a listeners while in insert mode to implement the same functionality as above

The main reason for the lack of support for this feature is because there is a long-standing Electron bug preventing the cursor from being updated in a webview. I have also tried a couple of workarounds to fix this, but most of them ironically require the mouse to be moved before the cursor styling is applied. See this electron issue for details. I will not merge PRs that do not contain a fix/workaround for this bug, as it defeats the purpose of having a "mousehide" setting.

Add greasemonkey script support

As title.This enables users to customize the behavior of the webpage, for e.g. add a panel in youtube to control the speed of the playback.

Optional built-in adblock

Vieb should have it's own adblocker integrated as an OPTIONAL feature,
because there would be no easy way to install an add-on or extension for that.
This could be achieved by filtering the domains with this or by integrating a proper adblocker such as this one. Maybe even both with options to pick the active filters.

Cookies

Cookies are automatically managed by chromium, but it should be possible to access them like so:

  • A list per domain of all cookies, where they can also be deleted one at a time or per domain
  • Settings for autoclearing cookies when closing tabs after x seconds delay
  • A setting to clear all cookies when closing Vieb

Electron has a pretty decent api to manage cookies.
An example to delete all cookies can be found here.

Per-site pass through of keybindings

Many of google's page has their own mappings. For e.g. in gmail, you can configure it to press j, k to check next and previous email. In calendar, you can press d,w,m,a to switch between day/week/month/agenda mode. As vieb grabs all the keybindings, these site-dependent keybindings no longer works.

Add a permission setting to optionally allow popups from websites

Hi!
First of all, thanks for this piece of software. Just loving it so far! It feels like a web browser tailor-made for vim users. Simple, but with all the things I like from a modal context.

Just wondering, how exactly can I deal with popup windows? My scenario is clicking a button inside a email for resetting a password. It seems like it's trying to open something but I just keep getting this message:

Screen Shot 2020-07-29 at 15 11 42

After that, a blank tab remains opened, but the requested page doesn't open at all. Not sure how to address this or where to start.

Any guidance on this? Thanks!

Cursor mode can't download background images

The image download option in cursor mode currently does not detect background images. This probably requires an extra check for each element at a given position for the background property of the computed style.

Windows special pages broken

Special pages (vieb:) don't work on Windows, because Windows uses backward slashes instead of forward ones (probably because they want to be special).

Visual mode to select text

Selecting text entirely with the keyboard can be tedious or even impossible in a regular browser. Currently, Vieb is no different, because there is no dedicated selection mode. This should be solved by adding a visual mode similar to Vim.

A big difference would be the startup of the visual mode. Even though the v could still be used to enter the mode, there is no usual cursor available as a start position for the selection. This would require the user to pick both the start and the end point. Therefor pressing v should not immediately start the selection, but simply start showing a cursor. Upon pressing v again after moving the cursor, it should actually start to select text.

Aside from that, it would be almost impossible to provide all the navigation keys regular Vim has to offer. Simply providing the navigation keys available in Vieb's normal mode in this new visual mode would be enough.

Finally, there should be a number of ways to exit visual mode. Of course both Escape and ctrl+[ should work, but also y or d to copy the text.

Focus relevant parts of popular websites after entering insert mode

When opening a google doc page. Entering i brings me into insert mode. But after entering <Esc> and i again. Though it is shown that I am in insert mode, but I can't make any modifications to the document. I must click the document again to start editing. Possibly the focus is on some other element as when I pressing <Tab> several times, it gets to insert the tab into the document.

Count doesn't work on built-in functions in mappings

It doesn't work when I try to map

pmap d <10pointer.scrollDown>
pmap u 10<pointer.scrollUp>

Instead I need to do it directly:

pmap DD <pointer.scrollDown>
pmap UU <pointer.scrollUp>
pmap d 10DD
pmap u 10UU

Suggest local files in explore mode

There should be a setting in Vieb to enable suggestions for local files while in explore mode. Unlike other suggest settings which are of the number type, this should be a boolean toggle, to either include or exclude local files being suggested. This setting should be on by default and only suggest files for absolute paths (and those starting with ~/)

Files that have never been opened in Vieb should be listed if they match the currently entered text, although they will probably be less relevant than highly visited pages. These files will be given a visit count of 1 (instead of 0) to allow them to be sorted with the current algorithm.

The set command should have support for the ? suffix (reading setting)

In Vim it's possible to read the current value of a setting using :set shiftwidth?. This example returns shiftwidth=4 with my current settings. Similar to Vim, the set command in Vieb should allow settings to be viewed as they are currently configured. This probably comes down to stripping the trailing questions mark and doing settings.get with the remaining string. The result should be shown in a notification.

Implement a permission system for notifications, microphone, camera and others

As it turns out, electron by default allows all permissions, as can be read more about here. Vieb should have settings for these permissions, so that users can choose if they want to allow these permissions.

There are at least three settings that should be possible for each of the different permissions:

  • allow
  • block
  • ask (with an option to make this the new default for the session)

The default should be 'block' for most of them.

History management

Currently it's impossible to view a list of visited websites. It should be possible to show the site history. Along with that, the u key should recover the previously closed tab. This should also allow the navbar to suggest previously entered searches and visited websites.

It should also provide the setting to restore all open pages from the previous session.

In nav mode, only the entered url/search should be navigated to, but by using Tab and S-Tab it should be possible to choose other options from the history.

There should also be a dedicated page to show all of the history sorted by time.

Integrate a Vim-like text editor/plugin in a new mode similar to insert mode

This was a comment in #51, but I think it deserves its own thread.

The suggestion is to add a new mode InputfieldNormal in input field such that entering keys does not edit the input field but moves the cursor like in vim. For e.g., w moves the cursor using and b moves the cursor using and k moves the cursor using etc. And i brings back the insert mode.

Downloads

There is no way to save/download files with Vieb.
It should be possible to detect a download request and ask the user to save the file(s).
Similar to the history manager #3, a list of recently downloaded files should be kept by default.

Most files you wouldn't normally open in a browser (without addons), are already opened with the default application for it, such as pdf files or anchor tags with the download attribute. Therefor this issue is mostly about intercepting that default, and pointing to the right folder to save it (automatically). And of course to have a list somewhere of all downloaded files by date.

There is an electron to do exactly that, the docs can be found here:
https://electronjs.org/docs/api/download-item

Allow filtering of the history page

The history page should allow the history to be filtered, to make it easier to find or delete sites from the history. The filter should work in a similar way as is currently implemented for cookies, and the delete button should only delete history entries that match the filter.

Improve startup time

I noticed the startup of the application takes currently around 3-4 seconds. Configuration, cache and history are vanilla. How are chances to improve this and lower the startup time?

I think because it's an electron app improving startup time might be difficult. It look like there is space for optimization though:

I observed this in comparison to the browser I'm currently using (qutebrowser) and although it might not be one of the top priorities it might be nice if startup time could be improved :)

Sandboxed releases prevent startup on some linux distributions

I tried the AppImage first. It won't run. Nothing happens. No output on the command line. Nothing. Yes, I made it executable. I have run AppImage packages before.

Then I tried the .deb installer. It installs partially:

# dpkg -i Vieb_0.2.1_amd64.deb 
Selecting previously unselected package vieb.
(Reading database ... 262685 files and directories currently installed.)
Preparing to unpack Vieb_0.2.1_amd64.deb ...
Unpacking vieb (0.2.1) ...
Setting up vieb (0.2.1) ...
ln: failed to create symbolic link '/usr/local/bin/vieb': No such file or directory
dpkg: error processing package vieb (--install):
subprocess installed post-installation script returned error exit status 1
Processing triggers for gnome-menus (3.13.3-9) ...
Processing triggers for desktop-file-utils (0.23-1) ...
Processing triggers for mime-support (3.60) ...
Processing triggers for hicolor-icon-theme (0.15-1) ...
Errors were encountered while processing:
 vieb

Then I found it in /opt. I ran it from the command line and nothing happened again. Not even some output. At all.

History file should be loaded on startup once

Now that I have used Vieb for a while I notice that loading the browsing history file (hist) for each nav mode update is starting to become a bit slow. It's still usable, but I think that loading it once in memory will be faster. This should also allow the suggestions to be added in order, instead of being ordered as they are parsed (which will be visible with ~3000 entries or more). For me the slowness became apparent after a month of fairly active usage (with currently 4000+ entries in a 450kB hist file).

Rework the keybindings to support followup keys such as gg or gi

In Vim, some keys pressed after other keys have a different effect, similar to the repeating digits.
And example keybinding that's currently incorrect, is the single press of g.
Instead, g should be pressed twice (gg) in order to go to the top, with the other keys pressed after a single g being available for other actions.

An example of a shortcut I would like to add by default is gi to go to the first input field on the page.

Version command

Add a version command to Vieb, which should display general information about the current release.
There should be version numbers for at least the following elements:

  • vieb
  • chromium
  • electron

Add pinned tabs

It would be nice to pin a tab such that it stays minimized on the left.

Smooth scrolling

Vieb should support smooth scrolling as an option for all jump and scroll actions available (hjkl, G, Ctrl-d, Ctrl-u etc.) in normal mode. Insert mode already has smooth scrolling when pressing the array keys, ideally the smooth scroll setting should also switch it for insert mode. The must have for this issue is to allow some sort of smooth scrolling in normal mode.

Localstorage

Localstorage is already managed by chromium, but it should be possible to access it like so:

  • A list per domain of everything in the localstorage, where entries can be deleted one at a time or per domain
  • Settings for autoclearing the localstorage when closing a tab after x seconds delay
  • A setting to clear everything in the localstorage when closing Vieb

Unlike cookies, electron does not provide an api for it. This means that this issue needs to be solved in one of the following ways:

  • Access the files directly with level (files are in /home/user/.config/Vieb/IndexedDB and /home/user/.config/Vieb/Local Storage, but it's not a proper solution I think)
  • Only allow a full wipe of these folders, optionally after closing Vieb and forget about displaying a proper entry list
  • A different approach I'm not aware of

Sadly, most npm packages claiming to access the localstorage are simply alternative implementation of the localstorage specification, which are not suitable for this use case. The packages actually accessing the localstorage are mostly based on executeJavaScript, which will only find the localstorage for the currently opened website. This method is therefor also not considered a solution to the problem.

Please feel free to suggest alternative options to access the chromium localstorage in a more fitting way, as these are the only two options I could think of. Out of these two, I would likely go for the second one, because it's much easier to implement and a lot less hacky.

Rethink about insert/normal mode

This is related to #62 #56 #57.

The behavior of normal mode and insert mode of Vieb is quite different from other vim-inspired browser.

Normal Mode
In other vim-inspired browsers, keys are not all grabbed. Rather, I think they only handle mapped keys. If a key is not mapped, it is passed through to the website. So in site like youtube, <Left>, <Right>, if not remapped, they are passed through and fast-forward/backward the playback.

On the other hand, in Vieb normal mode, all keys are grabbed by Vieb, and unmapped keys are not pass-through. Which make <Left>, <Right> does nothing in yotube. This can be solved if per-site pass through is implemented. However, I think a more user-friendly way is to just pass-through unmapped keys.

Insert Mode
Insert mode in Vieb is more like Normal mode in other vim-inspired browsers, which handle all mapped keys but pass through all unmapped keys to the website. However, when entering insert mode, a side effect is to enter the first input field in the page. So if I want to fast-forward/backward in youtube, I need:

  1. Press i to enter insert mode.
  2. Click the video component to focus at it

While in other vim-inspired browser, this can totally be done without any extra step in normal mode.

The behavior of Vieb and the name Insert mode, IMHO, is counter-intuitive and cause extra burden for simple things. So I think it should be consider to redesign the behavior of these two modes. As a side note, other vim-inspired browser might also provide another mode named pass through, which passes all keys to the web page except for one single key to exit pass through mode.

Make follow mode detect :before elements

Some elements might be styled additionally by :before or :after pseudo-elements. Because they don't appear in the DOM, they can't be detected easily. There should be a way to detect them either by parsing the stylesheets or by some other method. They are currently completely undetected by follow mode, which causes problems when the element itself has no size, but the :before pseudo-element does have a size. This is more common than you might think, as some frameworks have a checkbox (or slider) that implements this combination.

Make it possible to hide navbar and tabs

A lot of the vim users are keyboard centric people and they would use Vieb, but in the same time we use things like window managers based on splits, xmonad, i3wm, awesome, etc, these allow to tile apps.

Having tabs and navbar is occupying a lot of precious space, the navbar should appear only when typing an address (ie press E, type , hide, see omnibar behavior for example in surfingkeys), and tabs should have the option to be hidden all the time.

Thank you for your work.

Make a setting to open tabs in the background using the middle mouse button

There should be an operation to open link in new background tab without losing focus of the current tab.

In all other browser, clicking a link with three finger does this. Also in vim-inspired browser (extensions), they usual have startFollowNewTab operations open the link in a background tab instead of immediately go to the new tab. I would suggest either change the behavior of <action.startFollowNewTab> or add another action startFollowBackgroundTab

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.