ebrowser v1.0.38

This commit is contained in:
James Feng Cao 2024-06-28 09:48:56 +08:00
parent c00e3a1f09
commit ad1d9e33b7
7 changed files with 51 additions and 11 deletions

View file

@ -71,6 +71,9 @@ npm install ebrowser
<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>
<h4 id="key-shortcuts">Key shortcuts</h4>
<ul>
<li>Alt: show menu</li>
<li>ALT+&lt;-: go backward</li>
<li>ALT+-&gt;: go forward</li>
<li>CTRL+C: stop loading</li>
<li>CTRL+G: address bar to show page url</li>
<li>CTRL+L: focus to address bar</li>
@ -79,8 +82,6 @@ npm install ebrowser
<li>CTRL+TAB: switch to next tab</li>
<li>CTRL+SHIFT+TAB: switch to previous tab</li>
<li>CTRL+W: close Tab</li>
<li>ALT+&lt;-: go backward</li>
<li>ALT+-&gt;: go forward</li>
<li>CTRL+SHIFT+R: enable global redirection (&quot;gredirect.json&quot;)</li>
<li>CTRL+R: disable global redirection</li>
<li>ESC: remove focus. similar to vi normal mode.</li>
@ -89,6 +90,7 @@ npm install ebrowser
<li>F12: devtools</li>
</ul>
<h4 id="address-bar-commands">Address bar commands</h4>
<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>
<ul>
<li>&quot;/&quot; for find-in-page</li>
<li>&quot;:&quot; for address bar commands
@ -183,7 +185,7 @@ npm install ebrowser
<p>You can copy or modify the code/program under the terms of the GPL3.0 or later versions.</p>
</div>
<p>Last Modified: 25 June 2024<br>
<p>Last Modified: 27 June 2024<br>
<br>
<pre></pre>
</p>

View file

@ -6,7 +6,7 @@
<description>Recent content on uweb browser: unlimited power</description>
<generator>Hugo</generator>
<language>en</language>
<lastBuildDate>Tue, 25 Jun 2024 09:05:46 +0800</lastBuildDate>
<lastBuildDate>Thu, 27 Jun 2024 22:14:12 +0800</lastBuildDate>
<atom:link href="/en/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Text selection/processing</title>

View file

@ -71,7 +71,7 @@
/>
</url><url>
<loc>/en/</loc>
<lastmod>2024-06-25T09:05:46+08:00</lastmod>
<lastmod>2024-06-27T22:14:12+08:00</lastmod>
<xhtml:link
rel="alternate"
hreflang="zh"
@ -508,7 +508,7 @@
/>
</url><url>
<loc>/en/ebrowserreadme/</loc>
<lastmod>2024-06-25T09:05:46+08:00</lastmod>
<lastmod>2024-06-27T22:14:12+08:00</lastmod>
</url><url>
<loc>/en/mirrors/</loc>
<lastmod>2024-06-18T23:17:17+08:00</lastmod>
@ -539,7 +539,7 @@
/>
</url><url>
<loc>/en/unlist/</loc>
<lastmod>2024-06-25T09:05:46+08:00</lastmod>
<lastmod>2024-06-27T22:14:12+08:00</lastmod>
<xhtml:link
rel="alternate"
hreflang="zh"

View file

@ -33,6 +33,9 @@ Type ":update" in the address bar and press "enter" key to update.
Mirror urls could be used like ":update https://uwebzh.netlify.app/misc/ebrowser". All the mirrors listed on [uweb browser](https://uwebzh.netlify.app/en/readme/index.html) could be used. The update url needs to be changed accordingly to be the folder "misc/ebrowser" under the mirror site root url.
#### Key shortcuts
- Alt: show menu
- ALT+<-: go backward
- ALT+->: go forward
- CTRL+C: stop loading
- CTRL+G: address bar to show page url
- CTRL+L: focus to address bar
@ -41,8 +44,6 @@ Mirror urls could be used like ":update https://uwebzh.netlify.app/misc/ebrowser
- CTRL+TAB: switch to next tab
- CTRL+SHIFT+TAB: switch to previous tab
- CTRL+W: close Tab
- ALT+<-: go backward
- ALT+->: go forward
- CTRL+SHIFT+R: enable global redirection ("gredirect.json")
- CTRL+R: disable global redirection
- ESC: remove focus. similar to vi normal mode.
@ -51,6 +52,7 @@ Mirror urls could be used like ":update https://uwebzh.netlify.app/misc/ebrowser
- F12: devtools
#### Address bar commands
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:
- "/" for find-in-page
- ":" for address bar commands
- ac [bookmark/history path w/o ext] : load ".rec" file for autocomplete.

View file

@ -429,6 +429,9 @@ You should have received a copy of the GNU General Public License along with thi
break NOREC;
if(58===c5 && 47===q.charCodeAt(7))//https://
break NOREC;
}else if(58===q.charCodeAt(1)){
internalLink(q);
return;
}else if(q.startsWith("javascript:")){
tabs.children[iTab].executeJavaScript(q.substring(11),false);
recQueryHistory(q);
@ -449,11 +452,42 @@ You should have received a copy of the GNU General Public License along with thi
break;
}
url = bang(q, iS);
if(58===url.charCodeAt(1)){
internalLink(url);
recQueryHistory(q);
return;
}
}while(false);
recQueryHistory(q);
}while(false);
tabs.children[iTab].src=url;
}
function internalLink(url){
let cmd = url.charCodeAt(2);
let subcmd = url.charCodeAt(3);
let iColon = url.indexOf(':',2);
switch(cmd){
case 48://'0' i:0
switch(subcmd){
case 47://'/' i:0/
if(106===url.charCodeAt(4) && 115===url.charCodeAt(5) && 47===url.charCoseAt(6)){
//i:0/js/xx:[url]
let fname = url.slice(4,iColon);
let pname = path.join(__dirname,fname);
if(fs.existsSync(pname)){
(async ()=>{
try {
let js = await fs.promises.readFile(pname,'utf8');
let t=tabs.children[iTab];
t.dataset.jsonce=js;
t.src = url.substring(iColon+1);
}catch(e){}
})();
}
}
}
}
}
function autocomplete(inp,container,arr) {
var currentFocus;
function clickItem(e){inp.value = arr[e.target.dataset.index];}
@ -470,6 +504,7 @@ function autocomplete(inp,container,arr) {
inp.addEventListener("input", function(e) {
const MAXITEMS = 30;
var b, i, val = this.value;
console.log(val)
if (!val) { return false;}
currentFocus = -1;
let items = container.children;
@ -554,6 +589,7 @@ function autocomplete(inp,container,arr) {
currentFocus = -1;
}
closeAllLists();
lastVal = null;
}
});
function addActive(x) {

View file

@ -1,4 +1,4 @@
{"version":"1.0.37",
{"version":"1.0.38",
"name": "ebrowser",
"description": "The keyboard-friendly minimal suckless web browser",
"main": "webview.js",

View file

@ -4,7 +4,7 @@
<sitemap>
<loc>/en/sitemap.xml</loc>
<lastmod>2024-06-25T09:05:46+08:00</lastmod>
<lastmod>2024-06-27T22:14:12+08:00</lastmod>
</sitemap>