From ad1d9e33b70b485ab29f2954efe465a025c1d812 Mon Sep 17 00:00:00 2001
From: James Feng Cao
Date: Fri, 28 Jun 2024 09:48:56 +0800
Subject: [PATCH 1/3] ebrowser v1.0.38
---
en/ebrowserreadme/index.html | 8 +++++---
en/index.xml | 2 +-
en/sitemap.xml | 6 +++---
misc/ebrowser/README.md | 6 ++++--
misc/ebrowser/index.html | 36 ++++++++++++++++++++++++++++++++++++
misc/ebrowser/package.json | 2 +-
sitemap.xml | 2 +-
7 files changed, 51 insertions(+), 11 deletions(-)
diff --git a/en/ebrowserreadme/index.html b/en/ebrowserreadme/index.html
index 7ef85dd..07805f9 100644
--- a/en/ebrowserreadme/index.html
+++ b/en/ebrowserreadme/index.html
@@ -71,6 +71,9 @@ npm install ebrowser
Mirror urls could be used like ":update https://uwebzh.netlify.app/misc/ebrowser". All the mirrors listed on uweb browser 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
@@ -79,8 +82,6 @@ npm install 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.
@@ -89,6 +90,7 @@ npm install 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
@@ -183,7 +185,7 @@ npm install ebrowser
You can copy or modify the code/program under the terms of the GPL3.0 or later versions.
-Last Modified: 25 June 2024
+
Last Modified: 27 June 2024
diff --git a/en/index.xml b/en/index.xml
index 8d4b641..64f4a1b 100644
--- a/en/index.xml
+++ b/en/index.xml
@@ -6,7 +6,7 @@
Recent content on uweb browser: unlimited power
Hugo
en
- Tue, 25 Jun 2024 09:05:46 +0800
+ Thu, 27 Jun 2024 22:14:12 +0800
-
Text selection/processing
diff --git a/en/sitemap.xml b/en/sitemap.xml
index 407b717..0359737 100644
--- a/en/sitemap.xml
+++ b/en/sitemap.xml
@@ -71,7 +71,7 @@
/>
/en/
- 2024-06-25T09:05:46+08:00
+ 2024-06-27T22:14:12+08:00
/en/ebrowserreadme/
- 2024-06-25T09:05:46+08:00
+ 2024-06-27T22:14:12+08:00
/en/mirrors/
2024-06-18T23:17:17+08:00
@@ -539,7 +539,7 @@
/>
/en/unlist/
- 2024-06-25T09:05:46+08:00
+ 2024-06-27T22:14:12+08:00
: 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.
diff --git a/misc/ebrowser/index.html b/misc/ebrowser/index.html
index cfa2832..b1b649d 100644
--- a/misc/ebrowser/index.html
+++ b/misc/ebrowser/index.html
@@ -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) {
diff --git a/misc/ebrowser/package.json b/misc/ebrowser/package.json
index eed5c87..5bf926d 100644
--- a/misc/ebrowser/package.json
+++ b/misc/ebrowser/package.json
@@ -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",
diff --git a/sitemap.xml b/sitemap.xml
index d343650..34ca218 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -4,7 +4,7 @@
/en/sitemap.xml
- 2024-06-25T09:05:46+08:00
+ 2024-06-27T22:14:12+08:00
From 8367164d734ecdd41ecc661f2dca485e5679bd35 Mon Sep 17 00:00:00 2001
From: James Feng Cao
Date: Fri, 28 Jun 2024 14:24:17 +0800
Subject: [PATCH 2/3] ebrowser v1.0.39
---
en/ebrowserreadme/index.html | 7 ++++++-
en/index.xml | 2 +-
en/sitemap.xml | 6 +++---
misc/ebrowser/README.md | 4 +++-
misc/ebrowser/index.html | 3 +--
misc/ebrowser/package.json | 2 +-
misc/ebrowser/search.json | 1 +
sitemap.xml | 2 +-
8 files changed, 17 insertions(+), 10 deletions(-)
diff --git a/en/ebrowserreadme/index.html b/en/ebrowserreadme/index.html
index 07805f9..dc1ddfa 100644
--- a/en/ebrowserreadme/index.html
+++ b/en/ebrowserreadme/index.html
@@ -122,6 +122,11 @@ npm install ebrowser
"!" address bar commands
"!xx ..." evaluates "xx.js" with the whole text as arguments[0].
+i: internal urls, which will be consistent with uweb.
+
+- "i:0/js/xxx.js:[url]" loads the "[url]" with bookmarklet "js/xxx.js".
+
+
Commands in no-focus mode (this mode is similar to vi Normal mode)
Pressing "ESC" to enter no-focus mode if not sure.
@@ -185,7 +190,7 @@ npm install ebrowser
You can copy or modify the code/program under the terms of the GPL3.0 or later versions.
-Last Modified: 27 June 2024
+
Last Modified: 28 June 2024
diff --git a/en/index.xml b/en/index.xml
index 64f4a1b..4f15043 100644
--- a/en/index.xml
+++ b/en/index.xml
@@ -6,7 +6,7 @@
Recent content on uweb browser: unlimited power
Hugo
en
- Thu, 27 Jun 2024 22:14:12 +0800
+ Fri, 28 Jun 2024 10:09:04 +0800
-
Text selection/processing
diff --git a/en/sitemap.xml b/en/sitemap.xml
index 0359737..4bc36f1 100644
--- a/en/sitemap.xml
+++ b/en/sitemap.xml
@@ -71,7 +71,7 @@
/>
/en/
- 2024-06-27T22:14:12+08:00
+ 2024-06-28T10:09:04+08:00
/en/ebrowserreadme/
- 2024-06-27T22:14:12+08:00
+ 2024-06-28T10:09:04+08:00
/en/mirrors/
2024-06-18T23:17:17+08:00
@@ -539,7 +539,7 @@
/>
/en/unlist/
- 2024-06-27T22:14:12+08:00
+ 2024-06-28T10:09:04+08:00
/en/sitemap.xml
- 2024-06-27T22:14:12+08:00
+ 2024-06-28T10:09:04+08:00
From 00ccd791ed75482ffa7d5ffdcb5811f5e475e769 Mon Sep 17 00:00:00 2001
From: James Feng Cao
Date: Fri, 28 Jun 2024 15:22:22 +0800
Subject: [PATCH 3/3] ebrowser v1.0.40
---
misc/ebrowser/index.html | 4 +++-
misc/ebrowser/package.json | 3 ++-
misc/ebrowser/search.json | 1 +
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/misc/ebrowser/index.html b/misc/ebrowser/index.html
index bf9658c..2e8fb16 100644
--- a/misc/ebrowser/index.html
+++ b/misc/ebrowser/index.html
@@ -255,7 +255,9 @@ You should have received a copy of the GNU General Public License along with thi
}while(false);
if(inputE === document.activeElement){
- if (9===e.keyCode){//tab completion
+ if (9===e.keyCode){
+ e.preventDefault();
+ tabs.children[iTab].focus();
}
return;
}
diff --git a/misc/ebrowser/package.json b/misc/ebrowser/package.json
index 38973b7..b887f00 100644
--- a/misc/ebrowser/package.json
+++ b/misc/ebrowser/package.json
@@ -1,4 +1,4 @@
-{"version":"1.0.39",
+{"version":"1.0.40",
"name": "ebrowser",
"description": "The keyboard-friendly minimal suckless web browser",
"main": "webview.js",
@@ -9,6 +9,7 @@
"README.md",
"translate.*",
"mapkeys.json",
+ "js/*.js",
"config"
],
"scripts": {
diff --git a/misc/ebrowser/search.json b/misc/ebrowser/search.json
index 299c68a..b2c7cde 100644
--- a/misc/ebrowser/search.json
+++ b/misc/ebrowser/search.json
@@ -18,5 +18,6 @@
"gt":"https://kkgithub.com/search?type=Repositories&q=%s",
"360":"https://so.360.com/s?q=%s",
"tg":"i:0/js/hash2textarea.js:https://www.tiangong.cn/#%s",
+ "cg":"i:0/js/hash2textarea.js:https://chatglm.cn/main/detail#%s",
"bd":"https://m.baidu.com/s?wd=%s"
}