use gitee releases in latest.html
[uweb.git] / en / ebrowserreadme / index.html
blob776413fdbd2c38099e8db49d21e974abd6420352
1 <!doctype html>
2 <html>
3 <head>
4 <meta charset="utf-8">
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" />
9 <title></title>
10 <script>
11 function findLang(){
12 let href = location.href;
13 for(let i=href.length-1;i>0;i--){
14 if('/'==href.charAt(i) && '/'==href.charAt(i-3))
15 return i;
17 return 0;
19 function nav2(page){
20 let i = findLang();
21 location.href = location.href.substring(0,i+1)+page;
23 function nav2Lang(lang){
24 let i = findLang();
25 let href = location.href;
26 location.href = location.href.substring(0,i-2)+lang+location.href.substring(i);
28 </script>
29 </head>
30 <body>
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>
34 <nav>
35 </nav>
36 </header>
37 <br />
39 <div class="container">
40 <h1 class="title">
41 <br>
42 <span class="subtitle"></span>
43 </h1>
44 <ul class="tags">
46 </ul>
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>
50 <ul>
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 &quot;md&quot; 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>
59 </ul>
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
68 </code></pre>
69 <p>OR</p>
70 <pre><code>git clone https://github.com/torappinfo/ebrowser
71 </code></pre>
72 <p>OR &quot;git clone&quot;/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 &quot;misc/ebrowser&quot;.</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
76 </code></pre>
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
80 </code></pre>
81 <p>OR</p>
82 <pre><code>electron [the-path-of-folder-with-downloaded-ebrowser-files]
83 </code></pre>
84 <h5 id="update-app-quickly-without-updating-chromium">Update app quickly without updating chromium</h5>
85 <p>Pressing &quot;Alt&quot; to show the menu bar and choose &quot;Check for updates&quot; under &quot;Help&quot;. OR</p>
86 <p>Type &quot;:update&quot; in the address bar and press &quot;enter&quot; key to update.</p>
87 <h4 id="key-shortcuts">Key shortcuts</h4>
88 <ul>
89 <li>Alt: show menu</li>
90 <li>ALT+&lt;-: go backward</li>
91 <li>ALT+-&gt;: 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 (&quot;gredirect.json&quot;)</li>
101 <li>CTRL+R: disable global redirection</li>
102 <li>ESC: remove focus. similar to vi normal mode.</li>
103 <li>F1: Help</li>
104 <li>F5: page refresh/reload</li>
105 <li>F12: devtools</li>
106 </ul>
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 &quot;search.json&quot; identifies a search engine. Moreover, the address bar serves as command line interface:</p>
109 <ul>
110 <li>&quot;/&quot; for find-in-page</li>
111 <li>&quot;:&quot; for address bar commands
112 <ul>
113 <li>ac [bookmark/history path w/o ext] : load &quot;.rec&quot; 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
119 <ul>
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>
124 </ul>
125 </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: &quot;javascript:...&quot; is special url and thus works in the current web page, while &quot;:js ...&quot; 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 &quot;redirect.json&quot; 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]. &quot;:up&quot; command also disables global and domain redirections, which are not restored by &quot;:np&quot;.</li>
134 <li>sys [command line] : execute system commands with url as one of arguments, and replace &quot;%cookie&quot; with corresponding one. Ex. &quot;curl&quot; 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 &quot;{}&quot; to capture long screenshot as vector graphics.</li>
138 </ul>
139 </li>
140 <li>&quot;!&quot; address bar commands
141 <ul>
142 <li>&quot;!xx ...&quot; evaluates &quot;xx.js&quot; with the whole text as arguments[0] at OS level.</li>
143 <li>&quot;!!xx ...&quot; evaluates &quot;xx.js&quot; with the whole text as arguments[0] at browser level, which could manipulate address bar etc.</li>
144 </ul>
145 </li>
146 <li>i: internal urls, which will be consistent with <a href="https://jamesfengcao.gitlab.io/uweb/en/links/index.html">uweb</a>.
147 <ul>
148 <li>&quot;i:0/js/xxx.js:[url]&quot; loads the &quot;[url]&quot; with bookmarklet &quot;js/xxx.js&quot;.</li>
149 <li>&quot;i:8d[url]&quot; fo force downloading</li>
150 </ul>
151 </li>
152 </ul>
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 &quot;ESC&quot; to enter no-focus mode if not sure.</p>
155 <ul>
156 <li>&quot;:&quot; for address bar commands</li>
157 <li>&quot;/&quot; for find-in-page with address bar</li>
158 <li>&quot;!&quot; for &quot;!&quot; address bar commands</li>
159 </ul>
160 <p>The other commands are defined in &quot;mapkeys.json&quot;, which will map keys to address bar commands.</p>
161 <h4 id="configuration-files">Configuration files</h4>
162 <ul>
163 <li>&quot;config&quot;: lines of address bar commands.</li>
164 <li>&quot;search.json&quot;: <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 &quot;%s&quot; would be replaced by search query.</li>
165 <li>&quot;default.autoc&quot;: predefined strings for address bar auto completion.</li>
166 <li>&quot;gredirect.json&quot;: global redirection urls as array of urls</li>
167 <li>&quot;redirect.json&quot;: domain-replacementDomain pairs, default to be applied.</li>
168 <li>&quot;mapkeys.json&quot;: keys-addressbarCommands pairs. The addressbar commands are multiple lines of address bar command separated by &quot;\n&quot;.</li>
169 <li>&quot;proxy.json&quot;: name-<a href="https://www.electronjs.org/docs/latest/api/structures/proxy-config">ProxyConfig</a> pairs</li>
170 <li>&quot;uas.json&quot; : 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.
172 <ul>
173 <li>&quot;menu.json&quot;: 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 &quot;%u&quot; as the downloaded url.</li>
174 <li>&quot;select.json&quot;: to define menus for text selections. The odd-indexed strings are address bar commands with &quot;%s&quot; as the text selection.</li>
175 <li>&quot;download.json&quot; : 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 &quot;%u&quot; as the downloaded url.</li>
176 </ul>
177 </li>
178 </ul>
179 <h4 id="javascript-at-three-levels">Javascript at three levels</h4>
180 <ul>
181 <li>Web page: url like &quot;javascript:&quot; or bookmarklet command &quot;:bml&quot; runs in web page.</li>
182 <li>Browser (or renderer process) :
183 <ul>
184 <li>&quot;:bjs&quot; to execute the following js code at browser level.</li>
185 </ul>
186 </li>
187 <li>OS level (or main process) : &quot;:js&quot; to execute the following js code with all OS APIs available.
188 <ul>
189 <li>&quot;!xx&quot; evaluates &quot;xx.js&quot; with arguments.</li>
190 </ul>
191 </li>
192 </ul>
193 <h5 id="examples-for-jsbjs-commands">examples for &quot;:js&quot;/&quot;:bjs&quot; 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
198 </code></pre>
199 <h4 id="new-usages">New usages</h4>
200 <ul>
201 <li>
202 <p>Vector designing with web tech to replace Adobe Illustrator/Inkscape.</p>
203 <ul>
204 <li>
205 <p>Design with web tech.</p>
206 </li>
207 <li>
208 <p>Printing to pdf with customized paper size.</p>
209 </li>
210 <li>
211 <p>Magnify the pdf paper size to the required size.</p>
212 </li>
213 </ul>
214 <p>OR</p>
215 <ul>
216 <li>Adjust window width and use addressbar command line &quot;:Pdf {}&quot; to export vector graphics.</li>
217 <li>Use imageMagick to convert to any other vector graphics format.</li>
218 </ul>
219 </li>
220 </ul>
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>
224 </div>
225 <p>Last Modified: 8 December 2024<br>
226 update AI engines<br>
227 <pre></pre>
228 </p>
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"
236 data-mapping="title"
237 data-strict="0"
238 data-reactions-enabled="1"
239 data-emit-metadata="0"
240 data-input-position="top"
241 data-theme="light"
242 data-lang="en"
243 data-loading="lazy"
244 crossorigin="anonymous" async>
245 </script>
247 <footer class="site-footer">
248 <div class="container">
249 &copy; 2018-2025 Richard H. Cao
250 </div>
251 </footer>
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/>. -->
255 </body>
256 </html>