diff --git a/ebrowser.md b/ebrowser.md index 7d43624..87344a4 100644 --- a/ebrowser.md +++ b/ebrowser.md @@ -56,7 +56,6 @@ Later on, you can run "npm install electron" to update electron/chromium or "npm - storage: clear site storage data. - {[options](https://www.electronjs.org/docs/latest/api/session#sescleardataoptions)} - ext [extension path]: load unpacked Chrome extension. - - gr [gredirect index]: global redirection with corresponding index. Use the first global redirection url if no argument. Disable global redirection with any index out of the range. - nc/uc : No Cookie forwarding/Use Cookie forwarding with global redirection. - nh/uh for No/Use url history. - nj/uj for No/Use external Javascript files. @@ -64,16 +63,15 @@ Later on, you can run "npm install electron" to update electron/chromium or "npm - np : no proxy. - up [proxyName] : use proxy. privous proxy or the first proxy in proxy.json w/o [proxyName]. ":up" command also disables global and domain redirections, which are not restored by ":np". - ua [useragentName] : set user agent for future tabs. default user agent w/o arguments. - - update [updateurl] : update the app. updateurl is optional. - 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. -- "!" address bar commands +- "!" address bar commands "!xx ..." evaluates "xx.js" with the whole address bar text as arguments[0]. #### Commands in no-focus mode (this mode is similar to vi Normal mode) Pressing "ESC" to enter no-focus mode if not sure. - ":" for address bar commands - "/" for find-in-page with address bar -- "!" for "!" address bar commands +- "!" for ":!" address bar commands The other commands are defined in "mapkeys.json", which will map keys to address bar commands. diff --git a/en/ebrowserreadme/index.html b/en/ebrowserreadme/index.html index ce9e4ae..bd43ba3 100644 --- a/en/ebrowserreadme/index.html +++ b/en/ebrowserreadme/index.html @@ -102,7 +102,6 @@ npm install ebrowser
  • ext [extension path]: load unpacked Chrome extension.
  • -
  • gr [gredirect index]: global redirection with corresponding index. Use the first global redirection url if no argument. Disable global redirection with any index out of the range.
  • nc/uc : No Cookie forwarding/Use Cookie forwarding with global redirection.
  • nh/uh for No/Use url history.
  • nj/uj for No/Use external Javascript files.
  • @@ -110,7 +109,6 @@ npm install ebrowser
  • np : no proxy.
  • up [proxyName] : use proxy. privous proxy or the first proxy in proxy.json w/o [proxyName]. ":up" command also disables global and domain redirections, which are not restored by ":np".
  • ua [useragentName] : set user agent for future tabs. default user agent w/o arguments.
  • -
  • update [updateurl] : update the app. updateurl is optional.
  • pdf [filename w/o extension] {options} : print to PDF file. All arguments are optional; empty option "{}" to capture long screenshot as vector graphics.
  • @@ -122,7 +120,7 @@ npm install ebrowser

    The other commands are defined in "mapkeys.json", which will map keys to address bar commands.

    Configuration files

    diff --git a/en/index.xml b/en/index.xml index 622efc5..b1b82f6 100644 --- a/en/index.xml +++ b/en/index.xml @@ -6,7 +6,7 @@ Recent content on uweb browser: unlimited power Hugo en - Tue, 18 Jun 2024 23:24:23 +0800 + Tue, 18 Jun 2024 11:13:22 +0800 Text selection/processing @@ -223,7 +223,7 @@ /en/mirrors/ Mon, 01 Jan 0001 00:00:00 +0000 /en/mirrors/ - Mirrors (for version 1040+) gitee gitcode gitcode gitea notabug launchpad framagit agit froggi disroot gitdab pagure bitbucket jsdelivr dagshub gitgud gitly gitnet palemoon tilde dotclear mimetest chapril cryto antopie bgithub Mirrors (for all versions) 试验1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 gitly gitnet palemoon tilde dotclear minetest chapril cryto antopie Repositories gitlab sourceforge github bitbucket codeberg gitee + Mirrors (for version 1040+) gitee gitcode gitcode gitea notabug launchpad framagit agit froggi disroot gitdab pagure bitbucket jsdelivr dagshub gitgud gitly gitnet palemoon tilde dotclear mimetest chapril cryto antopie bgithub nuaa yzuu Mirrors (for all versions) 试验1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 gitly gitnet palemoon tilde dotclear minetest chapril cryto antopie Repositories gitlab sourceforge github bitbucket diff --git a/en/mirrors.md b/en/mirrors.md index 6599b87..7fcb784 100644 --- a/en/mirrors.md +++ b/en/mirrors.md @@ -26,6 +26,8 @@ [cryto](https://git.cryto.net/jamesfengcao/uweb/raw/branch/master/redirect.html#) [antopie](https://code.antopie.org/jamesfengcao/uweb/raw/branch/master/redirect.html#) [bgithub](https://bgithub.xyz/torappinfo/uweb/raw/master/redirect.html#) +[nuaa](https://hub.nuaa.cf/torappinfo/uweb/raw/master/redirect.html#) +[yzuu](https://hub.yzuu.cf/torappinfo/uweb/raw/master/redirect.html#) #### Mirrors (for all versions)

    diff --git a/en/mirrors/index.html b/en/mirrors/index.html index 99fa1eb..232047c 100644 --- a/en/mirrors/index.html +++ b/en/mirrors/index.html @@ -70,7 +70,9 @@ chapril
    cryto
    antopie
    -bgithub

    +bgithub
    +nuaa
    +yzuu

    Mirrors (for all versions)

    试验1 @@ -133,8 +135,8 @@ antopie

    -

    Last Modified: 18 June 2024
    -update mirrors
    +

    Last Modified: 6 April 2024
    +more details on global redirection url

    
     

    diff --git a/en/readme/index.html b/en/readme/index.html index 9de0e87..a758351 100644 --- a/en/readme/index.html +++ b/en/readme/index.html @@ -107,7 +107,7 @@

    Last Modified: 18 June 2024
    -update mirrors
    +use adaptable ebrowser links

    
     

    diff --git a/en/rjs/index.html b/en/rjs/index.html index ae93ec4..6cbe5d5 100644 --- a/en/rjs/index.html +++ b/en/rjs/index.html @@ -77,7 +77,7 @@

    Last Modified: 18 June 2024
    -update mirrors
    +fix typos

    
     

    diff --git a/en/sitemap.xml b/en/sitemap.xml index 6b44d0c..87bd1b3 100644 --- a/en/sitemap.xml +++ b/en/sitemap.xml @@ -71,7 +71,7 @@ /> /en/ - 2024-06-18T23:24:23+08:00 + 2024-06-18T11:13:22+08:00 /en/ebrowserreadme/ - 2024-06-18T23:24:23+08:00 + 2024-06-18T10:22:59+08:00 /en/mirrors/ - 2024-06-18T23:17:17+08:00 + 2024-04-06T10:20:49+08:00 /en/readme/ 2024-06-18T11:13:22+08:00 @@ -539,7 +539,7 @@ /> /en/unlist/ - 2024-06-18T23:24:23+08:00 + 2024-06-18T11:13:22+08:00 /en/mirrors/ Mon, 01 Jan 0001 00:00:00 +0000 /en/mirrors/ - Mirrors (for version 1040+) gitee gitcode gitcode gitea notabug launchpad framagit agit froggi disroot gitdab pagure bitbucket jsdelivr dagshub gitgud gitly gitnet palemoon tilde dotclear mimetest chapril cryto antopie bgithub Mirrors (for all versions) 试验1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 gitly gitnet palemoon tilde dotclear minetest chapril cryto antopie Repositories gitlab sourceforge github bitbucket codeberg gitee + Mirrors (for version 1040+) gitee gitcode gitcode gitea notabug launchpad framagit agit froggi disroot gitdab pagure bitbucket jsdelivr dagshub gitgud gitly gitnet palemoon tilde dotclear mimetest chapril cryto antopie bgithub nuaa yzuu Mirrors (for all versions) 试验1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 gitly gitnet palemoon tilde dotclear minetest chapril cryto antopie Repositories gitlab sourceforge github bitbucket
    diff --git a/misc/ebrowser/package.json b/misc/ebrowser/package.json deleted file mode 100644 index 194e206..0000000 --- a/misc/ebrowser/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{"version":"1.0.21", - "name": "ebrowser", - "description": "The keyboard-friendly minimal suckless web browser", - "main": "webview.js", - "scripts": { - "release": "electron-builder" - }, - "author": "Richard H. Cao", - "keywords": ["browser","minimal","suckless","command line","vim key map","user scripts"], - "license": "GPL-3.0", - "repository": { - "type": "git", - "url": "git+https://github.com/torappinfo/ebrowser.git" - }, - "build": { - "appId": "torapp.eweb", - "publish": "github", - "asar": false, - "files": [ - "webview.js", - "index.html", - "package.json", - "README.md" - ], - "directories": { - "output": "release" - }, - "dmg": { - "contents": [ - { "x": 110, "y": 150 }, - { "x": 240, "y": 150, "type": "link", "path": "/Applications" } - ] - }, - "nsis": { - "createDesktopShortcut": "always" - }, - "linux": { - "target": "AppImage" - } - }, - "dependencies": { - }, - "devDependencies": { - "electron":"", - "electron-builder": "" - } -} diff --git a/misc/ebrowser/webview.js b/misc/ebrowser/webview.js index c6ed67b..27cc913 100644 --- a/misc/ebrowser/webview.js +++ b/misc/ebrowser/webview.js @@ -177,17 +177,6 @@ function addrCommand(cmd){ case "ext": session.defaultSession.loadExtension(args[1]); return; - case "gr": - if(args.length<2) { - gredirect_enable(0); - return; - } - let i = parseInt(args[1]); - if(i>=0 && i1) proxy = proxies[args[1]]; //retrieve proxy if(proxy){ - gredirect_disable(); + if(gredirect){ + gredirect=null; + unregisterHandler(); + } + bRedirect = false; session.defaultSession.setProxy(proxy); } return; @@ -229,33 +222,10 @@ function addrCommand(cmd){ else session.defaultSession.setUserAgent(defaultUA); return; - case "update": - let updateurl; - if(1==args.length) - updateurl = "https://gitlab.com/jamesfengcao/uweb/-/raw/master/misc/ebrowser/"; - else { - updateurl = args[1]; - if(!updateurl.endsWith("/")) updateurl = updateurl +"/"; - } - updateApp(updateurl); - return; } } } -function gredirect_disable(){ - if(gredirect){ - gredirect=null; - unregisterHandler(); - } - bRedirect = false; -} -function gredirect_enable(i){ - if(i>=gredirects.length) return; - if(!gredirect) registerHandler(); - gredirect=gredirects[i]; -} - function cbConsoleMsg(e, level, msg, line, sourceid){ console.log(line); console.log(sourceid); @@ -385,10 +355,15 @@ function topMenu(){ win.webContents.executeJavaScript(js,false); }}, { label: 'No redirect', accelerator: 'Ctrl+R', click: ()=>{ - gredirect_disable(); + if(gredirect){ + gredirect=null; + unregisterHandler(); + } }}, { label: 'Redirect', accelerator: 'Ctrl+Shift+R', click: ()=>{ - gredirect_enable(0); + if(0==gredirects.length) return; + if(!gredirect) registerHandler(); + gredirect=gredirects[0]; }}, { label: 'Close', accelerator: 'Ctrl+W', click: ()=>{ win.webContents.executeJavaScript("tabClose()",false).then((r)=>{ @@ -518,66 +493,4 @@ function msgbox_info(msg){ }) } -async function updateApp(url){//url must ending with "/" - let msg; - do { - try { - let res = await fetch(url+"package.json"); - let packageS = await res.text(); - let nLatestVer; - //the last part of version string is the version number, must keep increasing - { - let head = packageS.slice(2,40); - let iV = head.indexOf("version"); - if(iV<0) { - msg = "remote package.json corrupted" - break; - } - iV = iV + 11; - let iE = head.indexOf('"',iV+4); - let iS = head.lastIndexOf('.',iE-1); - nLatestVer = parseInt(head.substring(iS+1,iE)); - } - let nVer; - { - let ver = app.getVersion(); - let iS = ver.lastIndexOf('.'); - nVer = parseInt(ver.substring(iS+1)); - } - if(nVer>=nLatestVer){ - msg = "Already up to date"; - break; - } - writeFile("package.json", packageS); - fetch2file(url,"webview.js"); - fetch2file(url,"index.html"); - - msg = "Update completed"; - }catch(e){ - msg = "Fail to update" - } - }while(false); - dialog.showMessageBoxSync(null, { - type: 'info', - title: msg, - message: msg, - buttons: ['OK'] - }) -} - -async function fetch2file(urlFolder, filename){ - let res = await fetch(urlFolder+filename); - let str = await res.text(); - writeFile(filename, str); -} - -async function writeFile(filename, str){ - let pathname=path.join(__dirname,filename+".new"); - fs.writeFile(pathname, str, (err) => { - if(err) throw "Fail to write"; - fs.rename(pathname,path.join(__dirname,filename),(e1)=>{ - if(e1) throw "Fail to rename"; - }); - }); -} diff --git a/sitemap.xml b/sitemap.xml index e357888..4606f6d 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -4,7 +4,7 @@ /en/sitemap.xml - 2024-06-18T23:24:23+08:00 + 2024-06-18T11:13:22+08:00 diff --git a/zh/search/index.html b/zh/search/index.html index 57f4273..c14d8b6 100644 --- a/zh/search/index.html +++ b/zh/search/index.html @@ -326,7 +326,7 @@

    Last Modified: 18 June 2024
    -update mirrors
    +add more AI search engines

    24.02.26 添加网盘搜索引擎