index.html 13 KB

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