5 <meta name=
"viewport" content=
"width=device-width, initial-scale=1" />
6 <link rel=
"canonical" href=
"https://jamesfengcao.gitlab.io/uweb/en/ebrowserreadme/" />
8 <link rel=
"stylesheet" href=
"../style.css#" type=
"text/css" />
12 let href
= location
.href
;
13 for(let i
=href
.length
-1;i
>0;i
--){
14 if('/'==href
.charAt(i
) && '/'==href
.charAt(i
-3))
21 location
.href
= location
.href
.substring(0,i
+1)+page
;
23 function nav2Lang(lang
){
25 let href
= location
.href
;
26 location
.href
= location
.href
.substring(0,i
-2)+lang
+location
.href
.substring(i
);
31 <header class='header'
>
32 <a class=
"logo" href=
"javascript:void(0)" onclick=
"return nav2('index.html#')">Home
</a> <a class=
"logo" href=
"javascript:void(0)" onclick=
"return nav2('tags/index.html#')">Tags
</a>
39 <div class=
"container">
42 <span class=
"subtitle"></span>
47 <script>function notRepo(){let u
=location
.href
.replace(/#$/, '');return u
.endsWith('index.html')||u
.endsWith('readme/');}</script>
48 <h3 id=
"ebrowserhttpsgithubcomtorappinfoebrowser-keyboard-friendly-minimal-suckless-web-browser"><a href=
"https://github.com/torappinfo/ebrowser">Ebrowser
</a>: keyboard-friendly minimal suckless web browser
</h3>
49 <p>Ebrowser is designed with the philosophy of
<a href=
"https://github.com/torappinfo/uweb">Android uweb browser
</a> (
<a href=
"https://gitlab.com/jamesfengcao/uweb">gitlab
</a>).
</p>
51 <li>lightweight (less than
20k bytes) without bundled electron.
</li>
52 <li>much less memory footprint than edge/chrome browser and highly performant.
</li>
53 <li>keyboard friendly with vim-style keymaps and command line support in address bar.
</li>
54 <li><a href=
"https://uweb.surge.sh/en/redirect/index.html#" onclick=
"if(notRepo()){location='../redirect/index.html#';return false;}">global redirection
</a> to bypass censorship.
</li>
55 <li>user CSS/JS at will. Ex. pressing
"md
" in no-focus mode to preview markdown file.
</li>
56 <li>global CSS/JS for all sites at will.
</li>
57 <li>CSS/JS for domains, similar to
<a href=
"https://jamesfengcao.gitlab.io/uweb/en/sitejs/index.html">uweb
</a>, but use sitejs/[domain].js or sitecss/[domain].css, not [domain root].js/css.
</li>
58 <li>customizable.
</li>
60 <p>Note: Usually electron apps are heavyweight as they use browsers for simple things. Ebrowser uses core chromium effectively and very lightweight. Recommend to install electron separately.
</p>
61 <h4 id=
"installing-for-windows-macos-and-linux">Installing (for Windows, MacOS and Linux)
</h4>
62 <h5 id=
"install-with-prebuilt-binaries">Install with prebuilt binaries
</h5>
63 <p>You can find prebuilt binaries
<a href=
"https://github.com/torappinfo/ebrowser/releases">here
</a>.
</p>
64 <h5 id=
"install-ebrowser-and-electron-separatedly">Install ebrowser and electron separatedly
</h5>
65 <h6 id=
"install-ebrowser">Install ebrowser
</h6>
66 <p>Either download and unzip ebrowser package directly from any of npm mirror sites like
<a href=
"https://npmmirror.com/package/ebrowser">npmmirror
</a> or with nodejs by
</p>
67 <pre><code>npm install ebrowser
70 <pre><code>git clone https://github.com/torappinfo/ebrowser
72 <p>OR
"git clone
"/download files directly from any of
<a href=
"https://gitlab.com/jamesfengcao/uweb/-/blob/master/en/mirrors.md">mirror repositories
</a> and ebrowser is under the folder
"misc/ebrowser
".
</p>
73 <h6 id=
"install-electron">Install electron
</h6>
74 <p>Before you can run ebrowser, you need to install electron either with nodejs by
</p>
75 <pre><code>npm install electron
77 <p>OR download and unzip electron binary directly from
<a href=
"https://github.com/electron/electron/releases">github
</a> or mirrors like
<a href=
"https://registry.npmmirror.com/binary.html?path=electron">npmmirror
</a>.
</p>
78 <h6 id=
"run-ebrowser">Run ebrowser
</h6>
79 <pre><code>electron ~/node_modules/ebrowser
82 <pre><code>electron [the-path-of-folder-with-downloaded-ebrowser-files]
84 <h5 id=
"update-app-quickly-without-updating-chromium">Update app quickly without updating chromium
</h5>
85 <p>Pressing
"Alt
" to show the menu bar and choose
"Check for updates
" under
"Help
". OR
</p>
86 <p>Type
":update
" in the address bar and press
"enter
" key to update.
</p>
87 <h4 id=
"key-shortcuts">Key shortcuts
</h4>
89 <li>Alt: show menu
</li>
90 <li>ALT+
<-: go backward
</li>
91 <li>ALT+-
>: go forward
</li>
92 <li>CTRL+C: stop loading
</li>
93 <li>CTRL+G: address bar to show page url
</li>
94 <li>CTRL+L: focus to address bar
</li>
95 <li>CTRL+T: new Tab
</li>
96 <li>CTRL+SHIFT+T: restore closed Tab
</li>
97 <li>CTRL+TAB: switch to next tab
</li>
98 <li>CTRL+SHIFT+TAB: switch to previous tab
</li>
99 <li>CTRL+W: close Tab
</li>
100 <li>CTRL+SHIFT+R: enable global redirection (
"gredirect.json
")
</li>
101 <li>CTRL+R: disable global redirection
</li>
102 <li>ESC: remove focus. similar to vi normal mode.
</li>
104 <li>F5: page refresh/reload
</li>
105 <li>F12: devtools
</li>
107 <h4 id=
"address-bar-commands">Address bar commands
</h4>
108 <p>Like any popular browser, the very first word in address bar if defined in
"search.json
" identifies a search engine. Moreover, the address bar serves as command line interface:
</p>
110 <li>"/
" for find-in-page
</li>
111 <li>":
" for address bar commands
113 <li>ac [bookmark/history path w/o ext] : load
".rec
" file for autocomplete.
</li>
114 <li>b [bookmarkfilename w/o ext] : bookmark current page in file.
</li>
115 <li>bjs : Browser-level JavaScript execution.
</li>
116 <li>bml [filename w/o extension] [arguments...]: load/execute the javascript file.
</li>
117 <li>cert : allow invalid certificates w/o arguments, otherwise restore to default.
</li>
118 <li>clear : the arguments could be
120 <li>cache : clear cache
</li>
121 <li>dns : clear dns cache
</li>
122 <li>storage: clear site storage data.
</li>
123 <li>{
<a href=
"https://www.electronjs.org/docs/latest/api/session#sescleardataoptions">options
</a>}
</li>
126 <li>exit : exit browser
</li>
127 <li>ext [extension path]: load unpacked Chrome extension.
</li>
128 <li>gr [gredirect index]: global redirection with corresponding index. Use the first global redirection url if no argument. Disable global redirection with any index out of the range.
</li>
129 <li>js [js code] : execute JS code at OS level. Note:
"javascript:...
" is special url and thus works in the current web page, while
":js ...
" commands can do any OS operations.
</li>
130 <li>nc/uc : No Cookie forwarding/Use Cookie forwarding with global redirection.
</li>
131 <li>nr/ur for No/Use
"redirect.json
" for domain redirection.
</li>
132 <li>np : no proxy.
</li>
133 <li>up [proxyName] : use proxy. privous proxy or the first proxy in proxy.json w/o [proxyName].
":up
" command also disables global and domain redirections, which are not restored by
":np
".
</li>
134 <li>sys [command line] : execute system commands with url as one of arguments, and replace
"%cookie
" with corresponding one. Ex.
"curl
" commands for uploading.
</li>
135 <li>ua [useragentName] : set user agent for future tabs. default user agent w/o arguments.
</li>
136 <li>update [filename] : update the app w/o argument, otherwise retrive the [filename] from remote. The filename could be any file on
<a href=
"https://jamesfengcao.gitlab.io/uweb/en/readme/index.html">mirror sites
</a> (this repository is part of it).
</li>
137 <li>pdf [filename w/o extension] {
<a href=
"https://www.electronjs.org/docs/latest/api/web-contents#contentsprinttopdfoptions">options
</a>} : print to PDF file. All arguments are optional; empty option
"{}
" to capture long screenshot as vector graphics.
</li>
140 <li>"!
" address bar commands
142 <li>"!xx ...
" evaluates
"xx.js
" with the whole text as arguments[
0] at OS level.
</li>
143 <li>"!!xx ...
" evaluates
"xx.js
" with the whole text as arguments[
0] at browser level, which could manipulate address bar etc.
</li>
146 <li>i: internal urls, which will be consistent with
<a href=
"https://jamesfengcao.gitlab.io/uweb/en/links/index.html">uweb
</a>.
148 <li>"i:
0/js/xxx.js:[url]
" loads the
"[url]
" with bookmarklet
"js/xxx.js
".
</li>
149 <li>"i:
8d[url]
" fo force downloading
</li>
153 <h4 id=
"commands-in-no-focus-mode-this-mode-is-similar-to-vi-normal-mode">Commands in no-focus mode (this mode is similar to vi Normal mode)
</h4>
154 <p>Pressing
"ESC
" to enter no-focus mode if not sure.
</p>
156 <li>":
" for address bar commands
</li>
157 <li>"/
" for find-in-page with address bar
</li>
158 <li>"!
" for
"!
" address bar commands
</li>
160 <p>The other commands are defined in
"mapkeys.json
", which will map keys to address bar commands.
</p>
161 <h4 id=
"configuration-files">Configuration files
</h4>
163 <li>"config
": lines of address bar commands.
</li>
164 <li>"search.json
":
<a href=
"https://jamesfengcao.gitlab.io/uweb/en/search/index.html" onclick=
"if(notRepo()){location='../search/index.html#';return false;}">search engines
</a> as shortcut-queryUrl pairs, where
"%s
" would be replaced by search query.
</li>
165 <li>"default.autoc
": predefined strings for address bar auto completion.
</li>
166 <li>"gredirect.json
": global redirection urls as array of urls
</li>
167 <li>"redirect.json
": domain-replacementDomain pairs, default to be applied.
</li>
168 <li>"mapkeys.json
": keys-addressbarCommands pairs. The addressbar commands are multiple lines of address bar command separated by
"\n
".
</li>
169 <li>"proxy.json
": name-
<a href=
"https://www.electronjs.org/docs/latest/api/structures/proxy-config">ProxyConfig
</a> pairs
</li>
170 <li>"uas.json
" : name-
<a href=
"https://jamesfengcao.gitlab.io/uweb/en/useragents/index.html" onclick=
"if(notRepo()){location='../useragents/index.html#';return false;}">useragent
</a> pairs.
</li>
171 <li>Customized menus: json files as array of strings with menuitem name and address bar commands alternately.
173 <li>"menu.json
": array of strings for
<a href=
"https://jamesfengcao.gitlab.io/uweb/en/urls/index.html" onclick=
"if(notRepo()){location='../urls/index.html#';return false;}">user-defined menus
</a>. The array has submenu name and address bar commands alternately. The odd-indexed strings are address bar commands with
"%u
" as the downloaded url.
</li>
174 <li>"select.json
": to define menus for text selections. The odd-indexed strings are address bar commands with
"%s
" as the text selection.
</li>
175 <li>"download.json
" : array of strings to define context menu and buttons for downloading dialog. The even-indexed strings are texts to show on the button. The odd-indexed strings are address bar commands with
"%u
" as the downloaded url.
</li>
179 <h4 id=
"javascript-at-three-levels">Javascript at three levels
</h4>
181 <li>Web page: url like
"javascript:
" or bookmarklet command
":bml
" runs in web page.
</li>
182 <li>Browser (or renderer process) :
184 <li>":bjs
" to execute the following js code at browser level.
</li>
187 <li>OS level (or main process) :
":js
" to execute the following js code with all OS APIs available.
189 <li>"!xx
" evaluates
"xx.js
" with arguments.
</li>
193 <h5 id=
"examples-for-jsbjs-commands">examples for
":js
"/
":bjs
" commands
</h5>
194 <pre><code>:js bJS=true //allow external Javascript files for web pages
195 :js bJS=false //disallow external Javascript files for web pages
196 :bjs bHistory=true //to record url history
197 :bjs bQueryHistory=true //to record query/command history
199 <h4 id=
"new-usages">New usages
</h4>
202 <p>Vector designing with web tech to replace Adobe Illustrator/Inkscape.
</p>
205 <p>Design with web tech.
</p>
208 <p>Printing to pdf with customized paper size.
</p>
211 <p>Magnify the pdf paper size to the required size.
</p>
216 <li>Adjust window width and use addressbar command line
":Pdf {}
" to export vector graphics.
</li>
217 <li>Use imageMagick to convert to any other vector graphics format.
</li>
221 <h4 id=
"license">License
</h4>
222 <p>You can copy or modify the code/program under the terms of the GPL3.0 or later versions.
</p>
225 <p>Last Modified:
8 December
2024<br>
226 update AI engines
<br>
230 <script id='jsgiscus'
231 src='https://giscus.app/client.js'
232 data-repo=
"torappinfo/uweb"
233 data-repo-id=
"MDEwOlJlcG9zaXRvcnkzMDIyMDU3MjE="
234 data-category=
"Announcements"
235 data-category-id=
"DIC_kwDOEgNLGc4CQjsh"
238 data-reactions-enabled=
"1"
239 data-emit-metadata=
"0"
240 data-input-position=
"top"
244 crossorigin=
"anonymous" async
>
247 <footer class=
"site-footer">
248 <div class=
"container">
249 © 2018-
2025 Richard H. Cao
252 <!-- This document is licensed under the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is available at <https://www.gnu.org/licenses/>. -->