diff --git a/en/ebrowserreadme/index.html b/en/ebrowserreadme/index.html index a56ac47..7ef85dd 100644 --- a/en/ebrowserreadme/index.html +++ b/en/ebrowserreadme/index.html @@ -50,7 +50,7 @@
  • much less memory footprint than edge/chrome browser and highly performant.
  • keyboard friendly with vim-style keymaps and command line support in address bar.
  • global redirection to bypass censorship.
  • -
  • user scripts at will. Ex. pressing "tr" to translate the page (need mapkeys.json config).
  • +
  • user scripts at will. Ex. pressing "md" in no-focus mode to preview markdown file.
  • customizable.
  • 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.

    @@ -183,7 +183,7 @@ npm install ebrowser

    You can copy or modify the code/program under the terms of the GPL3.0 or later versions.

    -

    Last Modified: 24 June 2024
    +

    Last Modified: 25 June 2024

    
     

    diff --git a/en/index.html b/en/index.html index f3a6192..3150ef6 100644 --- a/en/index.html +++ b/en/index.html @@ -1,7 +1,7 @@ - + diff --git a/en/index.xml b/en/index.xml index af11a59..8d4b641 100644 --- a/en/index.xml +++ b/en/index.xml @@ -6,7 +6,7 @@ Recent content on uweb browser: unlimited power Hugo en - Mon, 24 Jun 2024 19:36:44 +0800 + Tue, 25 Jun 2024 09:05:46 +0800 Text selection/processing @@ -216,7 +216,7 @@ /en/ebrowserreadme/ Mon, 01 Jan 0001 00:00:00 +0000 /en/ebrowserreadme/ - Ebrowser: keyboard-friendly minimal suckless web browser Ebrowser is designed with the philosophy of Android uweb browser (gitlab). lightweight (less than 20k bytes) without bundled electron. much less memory footprint than edge/chrome browser and highly performant. keyboard friendly with vim-style keymaps and command line support in address bar. global redirection to bypass censorship. user scripts at will. Ex. pressing &quot;tr&quot; to translate the page (need mapkeys.json config). customizable. Note: Usually electron apps are heavyweight as they use browsers for simple things. + Ebrowser: keyboard-friendly minimal suckless web browser Ebrowser is designed with the philosophy of Android uweb browser (gitlab). lightweight (less than 20k bytes) without bundled electron. much less memory footprint than edge/chrome browser and highly performant. keyboard friendly with vim-style keymaps and command line support in address bar. global redirection to bypass censorship. user scripts at will. Ex. pressing &quot;md&quot; in no-focus mode to preview markdown file. customizable. Note: Usually electron apps are heavyweight as they use browsers for simple things. diff --git a/en/sitemap.xml b/en/sitemap.xml index f160384..407b717 100644 --- a/en/sitemap.xml +++ b/en/sitemap.xml @@ -71,7 +71,7 @@ /> /en/ - 2024-06-24T19:36:44+08:00 + 2024-06-25T09:05:46+08:00 /en/ebrowserreadme/ - 2024-06-24T19:36:44+08:00 + 2024-06-25T09:05:46+08:00 /en/mirrors/ 2024-06-18T23:17:17+08:00 @@ -539,7 +539,7 @@ /> /en/unlist/ - 2024-06-24T19:36:44+08:00 + 2024-06-25T09:05:46+08:00 /en/ebrowserreadme/ Mon, 01 Jan 0001 00:00:00 +0000 /en/ebrowserreadme/ - Ebrowser: keyboard-friendly minimal suckless web browser Ebrowser is designed with the philosophy of Android uweb browser (gitlab). lightweight (less than 20k bytes) without bundled electron. much less memory footprint than edge/chrome browser and highly performant. keyboard friendly with vim-style keymaps and command line support in address bar. global redirection to bypass censorship. user scripts at will. Ex. pressing &quot;tr&quot; to translate the page (need mapkeys.json config). customizable. Note: Usually electron apps are heavyweight as they use browsers for simple things. + Ebrowser: keyboard-friendly minimal suckless web browser Ebrowser is designed with the philosophy of Android uweb browser (gitlab). lightweight (less than 20k bytes) without bundled electron. much less memory footprint than edge/chrome browser and highly performant. keyboard friendly with vim-style keymaps and command line support in address bar. global redirection to bypass censorship. user scripts at will. Ex. pressing &quot;md&quot; in no-focus mode to preview markdown file. customizable. Note: Usually electron apps are heavyweight as they use browsers for simple things. diff --git a/misc/ebrowser/README.md b/misc/ebrowser/README.md index 3b32e2f..a91f41e 100644 --- a/misc/ebrowser/README.md +++ b/misc/ebrowser/README.md @@ -5,7 +5,7 @@ Ebrowser is designed with the philosophy of [Android uweb browser](https://githu - much less memory footprint than edge/chrome browser and highly performant. - keyboard friendly with vim-style keymaps and command line support in address bar. - [global redirection](https://uweb.surge.sh/en/redirect/index.html#) to bypass censorship. -- user scripts at will. Ex. pressing "tr" to translate the page (need mapkeys.json config). +- user scripts at will. Ex. pressing "md" in no-focus mode to preview markdown file. - customizable. 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. diff --git a/misc/ebrowser/index.html b/misc/ebrowser/index.html index 4ad4357..51987ab 100644 --- a/misc/ebrowser/index.html +++ b/misc/ebrowser/index.html @@ -70,8 +70,9 @@ You should have received a copy of the GNU General Public License along with thi var bHistory = false; var bQueryHistory = false; var autocMode = 0; //0 for substring, 1 for startsWith - const JSPREFIX_LOAD = "(async ()=>{let d=document;async function _loadJs(u){var a=d.createElement('script');a.type='text/javascript';a.async=false;a.src=u;d.body.appendChild(a);await new Promise(resolve=>a.onload=resolve)}"; - const BML_md = JSPREFIX_LOAD + "await _loadJs('https://cdn.jsdelivr.net/npm/marked@12.0.2/marked.min.js');let b=d.body;b.innerHTML=marked.parse(b.textContent)})()"; + const BML_head = "(async ()=>{let d=document;async function _loadJs(u){var a=d.createElement('script');a.type='text/javascript';a.async=false;a.src=u;d.body.appendChild(a);await new Promise(resolve=>a.onload=resolve)}"; + const BML_tail = "})()"; + const BML_md = BML_head + "await _loadJs('https://cdn.jsdelivr.net/npm/marked@12.0.2/marked.min.js');let b=d.body;b.innerHTML=marked.parse(b.textContent)})()"; let lastKeys; let lastKeys_millis = 0; @@ -454,41 +455,85 @@ You should have received a copy of the GNU General Public License along with thi } function autocomplete(inp,container,arr) { var currentFocus; - function clickItem(e){inp.value = e.target.dataset.str;} + var lastVal; + function clickItem(e){inp.value = arr[e.target.dataset.index];} function appendElement(el,dataindex){ - el.dataset.str = arr[dataindex]; + el.dataset.index = dataindex; el.addEventListener("click", clickItem); container.appendChild(el); } + function itemInnerHTML(b,str,val,iStr){ + b.innerHTML = str.substr(0,iStr); + b.innerHTML += "" + str.substr(iStr, val.length) + ""; + b.innerHTML += str.substr(iStr+val.length); + } inp.addEventListener("input", function(e) { - const MAXITEMS = 10; + const MAXITEMS = 30; var b, i, val = this.value; - closeAllLists(); if (!val) { return false;} currentFocus = -1; + let items = container.children; + let iBase = 0; + let lastV = lastVal; + lastVal = val; + if(val.startsWith(lastV)){ + let itemsLen = items.length; + if(itemsLen<=0) return; + i = itemsLen -1; + iBase = items[i].dataset.index +1; + switch(autocMode){ + case 0: + for (; i>=0; i--) { + b = items[i]; + let str = arr[b.dataset.index]; + let iStr = str.indexOf(val); + if(iStr<0) { + b.parentNode.removeChild(b); + continue; + } + itemInnerHTML(b,str,val,iStr); + } + break; + case 1: + for (; i>=0; i--) { + b = items[i]; + let str = arr[b.dataset.index]; + let oLen = lastval.length; + if(!str.startsWith(val.substring(oLen),oLen)) { + b.parentNode.removeChild(b); + continue; + } + itemInnerHTML(b,str,val,0); + } + break; + } + if(itemsLen=MAXITEMS) return; + }else + closeAllLists(); + i = iBase; switch(autocMode){ case 0: - for (i = 0; i < arr.length; i++) { + for (; i < arr.length; i++) { let iStr = arr[i].indexOf(val); if(iStr<0) continue; { b = document.createElement("DIV"); - b.innerHTML = arr[i].substr(0,iStr); - b.innerHTML += "" + arr[i].substr(iStr, val.length) + ""; - b.innerHTML += arr[i].substr(iStr+val.length); + itemInnerHTML(b,arr[i],val,iStr); appendElement(b,i); - if(container.children.length>MAXITEMS) break; + if(container.children.length>=MAXITEMS) break; } } return; case 1://startsWith - for (i = 0; i < arr.length; i++) { - if (arr[i].substr(0, val.length) === val) { + for (; i < arr.length; i++) { + if (arr[i].startsWith(val)) { b = document.createElement("DIV"); - b.innerHTML = "" + arr[i].substr(0, val.length) + ""; - b.innerHTML += arr[i].substr(val.length); + itemInnerHTML(b,arr[i],val,0); appendElement(b,i); - if(container.children.length>MAXITEMS) break; + if(container.children.length>=MAXITEMS) break; } } } diff --git a/misc/ebrowser/mapkeys.json b/misc/ebrowser/mapkeys.json index 2a00a6b..59529b4 100644 --- a/misc/ebrowser/mapkeys.json +++ b/misc/ebrowser/mapkeys.json @@ -4,5 +4,5 @@ "nj":":js bJS=false //No javascript", "uh":":bjs bHistory=bQueryHistory=true //record/Use history", "nh":":bjs bHistory=bQueryHistory=false //No history", - "md":":bjs tabJS(BML_md)" + "md":":bjs tabJS(BML_md) //markdown preview" } diff --git a/misc/ebrowser/package.json b/misc/ebrowser/package.json index d24d5e2..47ac0c6 100644 --- a/misc/ebrowser/package.json +++ b/misc/ebrowser/package.json @@ -1,4 +1,4 @@ -{"version":"1.0.34", +{"version":"1.0.35", "name": "ebrowser", "description": "The keyboard-friendly minimal suckless web browser", "main": "webview.js", diff --git a/misc/ebrowser/webview.js b/misc/ebrowser/webview.js index b117b3d..cb2990a 100644 --- a/misc/ebrowser/webview.js +++ b/misc/ebrowser/webview.js @@ -437,7 +437,7 @@ if(e)e.blur();try{tabs.children[iTab].stopFindInPage('clearSelection')}catch(er) win.webContents.executeJavaScript(js,false); }}, { label: 'Reload', accelerator: 'F5', click: ()=>{ - win.webContents.executeJavaScript("tabs.children[iTab].reloadIgnoringCache()",false); + win.webContents.executeJavaScript("tabs.children[iTab].reload()",false); }}, { label: 'Devtools', accelerator: 'F12', click: ()=>{ let js = "try{tabs.children[iTab].openDevTools()}catch(e){console.log(e)}"; diff --git a/sitemap.xml b/sitemap.xml index 393e7cb..d343650 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -4,7 +4,7 @@ /en/sitemap.xml - 2024-06-24T19:36:44+08:00 + 2024-06-25T09:05:46+08:00 diff --git a/zh/index.html b/zh/index.html index 507c43b..aea9b79 100644 --- a/zh/index.html +++ b/zh/index.html @@ -1,7 +1,7 @@ - +