updates ebrowser
[uweb.git] / ebrowser.md
blob94889a59c5665bcfff3608544d3b3b16a862fe04
1 ### [Ebrowser](https://github.com/torappinfo/ebrowser): keyboard-friendly minimal suckless web browser
2 Ebrowser is designed with the philosophy of [Android uweb browser](https://github.com/torappinfo/uweb) ([gitlab](https://gitlab.com/jamesfengcao/uweb)).
4 - lightweight (less than 20k bytes) without bundled electron.
5 - much less memory footprint than edge/chrome browser and highly performant.
6 - keyboard friendly with vim-style keymaps and command line support in address bar.
7 - global redirection to bypass censorship.
8 - user scripts at will. Ex. pressing "tr" to translate the page (need mapkeys.json config).
9 - customizable.
11 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.
13 #### Install (for Windows, MacOS and Linux)
14 Install ebrowser with nodejs installed
16     npm install ebrowser
18 Run ebrowser
20     electron ~/node_modules/ebrowser
22 #### Key shortcuts
23 - CTRL+C: stop loading
24 - CTRL+G: address bar to show page url
25 - CTRL+L: focus to address bar
26 - CTRL+T: new Tab
27 - CTRL+SHIFT+T: restore closed Tab
28 - CTRL+TAB: switch to next tab
29 - CTRL+SHIFT+TAB: switch to previous tab
30 - CTRL+W: close Tab
31 - CTRL+<-: go backward
32 - CTRL+->: go forward
33 - CTRL+SHIFT+R: enable global redirection ("gredirect.json")
34 - CTRL+R: disable global redirection
35 - ESC: remove focus. similar to vi normal mode.
36 - F5: page refresh/reload
37 - F12: devtools
39 #### Address bar commands
40 - "/" for find-in-page
41 - ":" for address bar commands
42   - ac [bookmark/history path w/o ext] : load ".rec" file for autocomplete.
43   - b [bookmarkfilename w/o ext] : bookmark current page in file.
44   - bml [filename w/o extension]: load/execute the javascript file.
45   - cert : allow invalid certificates w/o arguments, otherwise restore to default.
46   - clear : the arguments could be
47     - cache : clear cache
48     - dns : clear dns cache
49     - storage: clear site storage data.
50     - {[options](https://www.electronjs.org/docs/latest/api/session#sescleardataoptions)}
51   - ext [extension path]: load unpacked Chrome extension.
52   - nc/uc : No Cookie forwarding/Use Cookie forwarding with global redirection.
53   - nh/uh for No/Use url history.
54   - nj/uj for No/Use external Javascript files.
55   - nr/ur for No/Use "redirect.json" for domain redirection.
56   - np : no proxy
57   - up [proxyName] : use proxy. privous proxy or the first proxy in proxy.json w/o [proxyName].
58   - ua [useragentName] : set user agent for future tabs. default user agent w/o arguments.
59   - pdf [filename w/o extension] {[options](https://www.electronjs.org/docs/latest/api/web-contents#contentsprinttopdfoptions)} : print to PDF file. All arguments are optional; empty option "{}" to capture long screenshot as vector graphics.
60 - ":!" address bar commands
62 #### Commands in no-focus mode (this mode is similar to vi Normal mode)
63 Pressing "ESC" to enter no-focus mode if not sure.
64 - ":" for address bar commands
65 - "/" for find-in-page with address bar
66 - "!" for ":!" address bar commands
68 The other commands are defined in "mapkeys.json", which will map keys to address bar commands.
70 #### Configuration files
71 - "config": lines of address bar commands.
72 - "search.json": search engines as shortcut-queryUrl pairs.
73 - "default.autoc": predefined strings for address bar auto completion.
74 - "gredirect.json": global redirection urls as array of urls
75 - "redirect.json": domain-replacementDomain pairs, default to be applied.
76 - "mapkeys.json": keys-addressbarCommands pairs. The addressbar commands are multiple lines of address bar command separated by "\n".
77 - "proxy.json": name-[ProxyConfig](https://www.electronjs.org/docs/latest/api/structures/proxy-config) pairs
78 - "uas.json" : name-useragent pairs
80 #### New usages
81 - Vector designing with web tech to replace Adobe Illustrator/Inkscape.
82   - Design with web tech.
83   
84   - Printing to pdf with customized paper size.
85   - Magnify the pdf paper size to the required size.
87   OR
88   
89   - Adjust window width and use addressbar command line ":Pdf {}" to export vector graphics.
90   - Use imageMagick to convert to any other vector graphics format.