ebrowser v1.0.42
[uweb.git] / en / ebrowserreadme / index.html
blob324e054c7daa4bf52561dfb78d64c051215649a7
1 <!doctype html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1" />
7 <link rel="stylesheet" href="../style.css#" type="text/css" />
8 <title></title>
9 <script type="text/javascript">
10 function findLang(){
11 let href = location.href;
12 for(let i=href.length-1;i>0;i--){
13 if('/'==href.charAt(i) && '/'==href.charAt(i-3))
14 return i;
16 return 0;
18 function nav2(page){
19 let i = findLang();
20 location.href = location.href.substring(0,i+1)+page;
22 function nav2Lang(lang){
23 let i = findLang();
24 let href = location.href;
25 location.href = location.href.substring(0,i-2)+lang+location.href.substring(i);
27 </script>
28 </head>
29 <body>
30 <header class='header'>
31 <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>
33 <nav>
34 </nav>
35 </header>
36 <br />
38 <div class="container">
39 <h1 class="title">
40 <br>
41 <span class="subtitle"></span>
42 </h1>
43 <ul class="tags">
45 </ul>
46 <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>
47 <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>
48 <ul>
49 <li>lightweight (less than 20k bytes) without bundled electron.</li>
50 <li>much less memory footprint than edge/chrome browser and highly performant.</li>
51 <li>keyboard friendly with vim-style keymaps and command line support in address bar.</li>
52 <li><a href="https://uweb.surge.sh/en/redirect/index.html#">global redirection</a> to bypass censorship.</li>
53 <li>user scripts at will. Ex. pressing &quot;md&quot; in no-focus mode to preview markdown file.</li>
54 <li>customizable.</li>
55 </ul>
56 <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>
57 <h4 id="installing-for-windows-macos-and-linux">Installing (for Windows, MacOS and Linux)</h4>
58 <h5 id="install-with-prebuilt-binaries">Install with prebuilt binaries</h5>
59 <p>You can find prebuilt binaries <a href="https://github.com/torappinfo/ebrowser/releases">here</a>.</p>
60 <h5 id="install-with-nodejs">Install with nodejs</h5>
61 <pre><code>npm install electron
62 npm install ebrowser
63 </code></pre>
64 <p>Run ebrowser</p>
65 <pre><code>electron ~/node_modules/ebrowser
66 </code></pre>
67 <p>Later on, you can run &quot;npm install electron&quot; to update electron/chromium or &quot;npm install ebrowser&quot; to update ebrowser independently.</p>
68 <h5 id="update-app-quickly-without-updating-chromium">Update app quickly without updating chromium</h5>
69 <p>Pressing &quot;Alt&quot; to show the menu bar and choose &quot;Check for updates&quot; under &quot;Help&quot;. OR</p>
70 <p>Type &quot;:update&quot; in the address bar and press &quot;enter&quot; key to update.</p>
71 <p>Mirror urls could be used like &quot;:update https://uwebzh.netlify.app/misc/ebrowser&quot;. All the mirrors listed on <a href="https://uwebzh.netlify.app/en/readme/index.html">uweb browser</a> could be used. The update url needs to be changed accordingly to be the folder &quot;misc/ebrowser&quot; under the mirror site root url.</p>
72 <h4 id="key-shortcuts">Key shortcuts</h4>
73 <ul>
74 <li>Alt: show menu</li>
75 <li>ALT+&lt;-: go backward</li>
76 <li>ALT+-&gt;: go forward</li>
77 <li>CTRL+C: stop loading</li>
78 <li>CTRL+G: address bar to show page url</li>
79 <li>CTRL+L: focus to address bar</li>
80 <li>CTRL+T: new Tab</li>
81 <li>CTRL+SHIFT+T: restore closed Tab</li>
82 <li>CTRL+TAB: switch to next tab</li>
83 <li>CTRL+SHIFT+TAB: switch to previous tab</li>
84 <li>CTRL+W: close Tab</li>
85 <li>CTRL+SHIFT+R: enable global redirection (&quot;gredirect.json&quot;)</li>
86 <li>CTRL+R: disable global redirection</li>
87 <li>ESC: remove focus. similar to vi normal mode.</li>
88 <li>F1: Help</li>
89 <li>F5: page refresh/reload</li>
90 <li>F12: devtools</li>
91 </ul>
92 <h4 id="address-bar-commands">Address bar commands</h4>
93 <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>
94 <ul>
95 <li>&quot;/&quot; for find-in-page</li>
96 <li>&quot;:&quot; for address bar commands
97 <ul>
98 <li>ac [bookmark/history path w/o ext] : load &quot;.rec&quot; file for autocomplete.</li>
99 <li>b [bookmarkfilename w/o ext] : bookmark current page in file.</li>
100 <li>bjs : Browser-level JavaScript execution.</li>
101 <li>bml [filename w/o extension]: load/execute the javascript file.</li>
102 <li>cert : allow invalid certificates w/o arguments, otherwise restore to default.</li>
103 <li>clear : the arguments could be
104 <ul>
105 <li>cache : clear cache</li>
106 <li>dns : clear dns cache</li>
107 <li>storage: clear site storage data.</li>
108 <li>{<a href="https://www.electronjs.org/docs/latest/api/session#sescleardataoptions">options</a>}</li>
109 </ul>
110 </li>
111 <li>ext [extension path]: load unpacked Chrome extension.</li>
112 <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>
113 <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>
114 <li>nc/uc : No Cookie forwarding/Use Cookie forwarding with global redirection.</li>
115 <li>nr/ur for No/Use &quot;redirect.json&quot; for domain redirection.</li>
116 <li>np : no proxy.</li>
117 <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>
118 <li>ua [useragentName] : set user agent for future tabs. default user agent w/o arguments.</li>
119 <li>update [updateurl] : update the app. updateurl is optional.</li>
120 <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>
121 </ul>
122 </li>
123 <li>&quot;!&quot; address bar commands<br>
124 &quot;!xx ...&quot; evaluates &quot;xx.js&quot; with the whole text as arguments[0].</li>
125 <li>i: internal urls, which will be consistent with <a href="https://jamesfengcao.gitlab.io/uweb/en/links/index.html">uweb</a>.
126 <ul>
127 <li>&quot;i:0/js/xxx.js:[url]&quot; loads the &quot;[url]&quot; with bookmarklet &quot;js/xxx.js&quot;.</li>
128 </ul>
129 </li>
130 </ul>
131 <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>
132 <p>Pressing &quot;ESC&quot; to enter no-focus mode if not sure.</p>
133 <ul>
134 <li>&quot;:&quot; for address bar commands</li>
135 <li>&quot;/&quot; for find-in-page with address bar</li>
136 <li>&quot;!&quot; for &quot;!&quot; address bar commands</li>
137 </ul>
138 <p>The other commands are defined in &quot;mapkeys.json&quot;, which will map keys to address bar commands.</p>
139 <h4 id="configuration-files">Configuration files</h4>
140 <ul>
141 <li>&quot;config&quot;: lines of address bar commands.</li>
142 <li>&quot;search.json&quot;: search engines as shortcut-queryUrl pairs.</li>
143 <li>&quot;default.autoc&quot;: predefined strings for address bar auto completion.</li>
144 <li>&quot;gredirect.json&quot;: global redirection urls as array of urls</li>
145 <li>&quot;redirect.json&quot;: domain-replacementDomain pairs, default to be applied.</li>
146 <li>&quot;mapkeys.json&quot;: keys-addressbarCommands pairs. The addressbar commands are multiple lines of address bar command separated by &quot;\n&quot;.</li>
147 <li>&quot;proxy.json&quot;: name-<a href="https://www.electronjs.org/docs/latest/api/structures/proxy-config">ProxyConfig</a> pairs</li>
148 <li>&quot;uas.json&quot; : name-useragent pairs</li>
149 </ul>
150 <h4 id="javascript-at-three-levels">Javascript at three levels</h4>
151 <ul>
152 <li>Web page: urls like &quot;javascript:&quot; or bookmarklet command &quot;:bml&quot; run in web page.</li>
153 <li>Browser (or renderer process) :
154 <ul>
155 <li>&quot;:bjs&quot; to execute the following js code at browser level.</li>
156 <li>&quot;!xx&quot; evaluates &quot;xx.js&quot;, which could manipulate address bar etc.</li>
157 </ul>
158 </li>
159 <li>OS level (or main process) : &quot;:js&quot; to execute the following js code with all OS APIs available.</li>
160 </ul>
161 <h5 id="examples-for-jsbjs-commands">examples for &quot;:js&quot;/&quot;:bjs&quot; commands</h5>
162 <pre><code>:js bJS=true //allow external Javascript files for web pages
163 :js bJS=false //disallow external Javascript files for web pages
164 :bjs bHistory=true //to record url history
165 :bjs bQueryHistory=true //to record query/command history
166 </code></pre>
167 <h4 id="new-usages">New usages</h4>
168 <ul>
169 <li>
170 <p>Vector designing with web tech to replace Adobe Illustrator/Inkscape.</p>
171 <ul>
172 <li>
173 <p>Design with web tech.</p>
174 </li>
175 <li>
176 <p>Printing to pdf with customized paper size.</p>
177 </li>
178 <li>
179 <p>Magnify the pdf paper size to the required size.</p>
180 </li>
181 </ul>
182 <p>OR</p>
183 <ul>
184 <li>Adjust window width and use addressbar command line &quot;:Pdf {}&quot; to export vector graphics.</li>
185 <li>Use imageMagick to convert to any other vector graphics format.</li>
186 </ul>
187 </li>
188 </ul>
189 <h4 id="license">License</h4>
190 <p>You can copy or modify the code/program under the terms of the GPL3.0 or later versions.</p>
192 </div>
193 <p>Last Modified: 29 June 2024<br>
194 <br>
195 <pre></pre>
196 </p>
198 <script id='jsgiscus'
199 src='https://giscus.app/client.js'
200 data-repo="torappinfo/uweb"
201 data-repo-id="MDEwOlJlcG9zaXRvcnkzMDIyMDU3MjE="
202 data-category="Announcements"
203 data-category-id="DIC_kwDOEgNLGc4CQjsh"
204 data-mapping="title"
205 data-strict="0"
206 data-reactions-enabled="1"
207 data-emit-metadata="0"
208 data-input-position="top"
209 data-theme="light"
210 data-lang="en"
211 data-loading="lazy"
212 crossorigin="anonymous" async>
213 </script>
215 <footer class="site-footer">
216 <div class="container">
217 &copy; 2018-2024 Richard H. Cao
218 </div>
219 </footer>
220 <!-- 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/>. -->
223 </body>
224 </html>