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

View file

@ -6,7 +6,7 @@
<description>Recent content on uweb browser: unlimited power</description> <description>Recent content on uweb browser: unlimited power</description>
<generator>Hugo</generator> <generator>Hugo</generator>
<language>en</language> <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" /> <atom:link href="/en/index.xml" rel="self" type="application/rss+xml" />
<item> <item>
<title>Text selection/processing</title> <title>Text selection/processing</title>

View file

@ -71,7 +71,7 @@
/> />
</url><url> </url><url>
<loc>/en/</loc> <loc>/en/</loc>
<lastmod>2024-06-25T09:05:46+08:00</lastmod> <lastmod>2024-06-27T22:14:12+08:00</lastmod>
<xhtml:link <xhtml:link
rel="alternate" rel="alternate"
hreflang="zh" hreflang="zh"
@ -508,7 +508,7 @@
/> />
</url><url> </url><url>
<loc>/en/ebrowserreadme/</loc> <loc>/en/ebrowserreadme/</loc>
<lastmod>2024-06-25T09:05:46+08:00</lastmod> <lastmod>2024-06-27T22:14:12+08:00</lastmod>
</url><url> </url><url>
<loc>/en/mirrors/</loc> <loc>/en/mirrors/</loc>
<lastmod>2024-06-18T23:17:17+08:00</lastmod> <lastmod>2024-06-18T23:17:17+08:00</lastmod>
@ -539,7 +539,7 @@
/> />
</url><url> </url><url>
<loc>/en/unlist/</loc> <loc>/en/unlist/</loc>
<lastmod>2024-06-25T09:05:46+08:00</lastmod> <lastmod>2024-06-27T22:14:12+08:00</lastmod>
<xhtml:link <xhtml:link
rel="alternate" rel="alternate"
hreflang="zh" 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. 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 #### Key shortcuts
- Alt: show menu
- ALT+<-: go backward
- ALT+->: go forward
- CTRL+C: stop loading - CTRL+C: stop loading
- CTRL+G: address bar to show page url - CTRL+G: address bar to show page url
- CTRL+L: focus to address bar - 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+TAB: switch to next tab
- CTRL+SHIFT+TAB: switch to previous tab - CTRL+SHIFT+TAB: switch to previous tab
- CTRL+W: close Tab - CTRL+W: close Tab
- ALT+<-: go backward
- ALT+->: go forward
- CTRL+SHIFT+R: enable global redirection ("gredirect.json") - CTRL+SHIFT+R: enable global redirection ("gredirect.json")
- CTRL+R: disable global redirection - CTRL+R: disable global redirection
- ESC: remove focus. similar to vi normal mode. - 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 - F12: devtools
#### Address bar commands #### 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 find-in-page
- ":" for address bar commands - ":" for address bar commands
- ac [bookmark/history path w/o ext] : load ".rec" file for autocomplete. - 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; break NOREC;
if(58===c5 && 47===q.charCodeAt(7))//https:// if(58===c5 && 47===q.charCodeAt(7))//https://
break NOREC; break NOREC;
}else if(58===q.charCodeAt(1)){
internalLink(q);
return;
}else if(q.startsWith("javascript:")){ }else if(q.startsWith("javascript:")){
tabs.children[iTab].executeJavaScript(q.substring(11),false); tabs.children[iTab].executeJavaScript(q.substring(11),false);
recQueryHistory(q); recQueryHistory(q);
@ -449,11 +452,42 @@ You should have received a copy of the GNU General Public License along with thi
break; break;
} }
url = bang(q, iS); url = bang(q, iS);
if(58===url.charCodeAt(1)){
internalLink(url);
recQueryHistory(q);
return;
}
}while(false); }while(false);
recQueryHistory(q); recQueryHistory(q);
}while(false); }while(false);
tabs.children[iTab].src=url; 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) { function autocomplete(inp,container,arr) {
var currentFocus; var currentFocus;
function clickItem(e){inp.value = arr[e.target.dataset.index];} function clickItem(e){inp.value = arr[e.target.dataset.index];}
@ -470,6 +504,7 @@ function autocomplete(inp,container,arr) {
inp.addEventListener("input", function(e) { inp.addEventListener("input", function(e) {
const MAXITEMS = 30; const MAXITEMS = 30;
var b, i, val = this.value; var b, i, val = this.value;
console.log(val)
if (!val) { return false;} if (!val) { return false;}
currentFocus = -1; currentFocus = -1;
let items = container.children; let items = container.children;
@ -554,6 +589,7 @@ function autocomplete(inp,container,arr) {
currentFocus = -1; currentFocus = -1;
} }
closeAllLists(); closeAllLists();
lastVal = null;
} }
}); });
function addActive(x) { function addActive(x) {

View file

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

View file

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