From 1cae16f7503b54c193865e201757961a36669584 Mon Sep 17 00:00:00 2001 From: James Feng Cao Date: Sun, 4 Aug 2024 14:07:23 +0800 Subject: [PATCH] ebrowser to support download context menu --- en/_posts/index.xml | 4 ++-- en/bookmark/index.html | 3 ++- en/index.html | 2 +- en/index.xml | 4 ++-- en/sitemap.xml | 6 +++--- misc/ebrowser/package.json | 2 +- misc/ebrowser/webview.js | 40 ++++++++++++++++++++------------------ sitemap.xml | 4 ++-- zh/_posts/index.xml | 4 ++-- zh/bookmark/index.html | 4 +++- zh/index.html | 2 +- zh/index.xml | 4 ++-- zh/search/index.html | 5 +++-- zh/sitemap.xml | 10 +++++----- zh/topposts/index.xml | 2 +- 15 files changed, 51 insertions(+), 45 deletions(-) diff --git a/en/_posts/index.xml b/en/_posts/index.xml index 345513f9..d24d7c65 100644 --- a/en/_posts/index.xml +++ b/en/_posts/index.xml @@ -6,7 +6,7 @@ Recent content in _Posts on uweb browser: unlimited power Hugo en - Sun, 14 Jul 2024 14:39:01 +0800 + Fri, 19 Jul 2024 10:06:21 +0800 Text selection/processing @@ -62,7 +62,7 @@ /en/bookmark/ Mon, 16 Jan 2023 00:00:00 +0000 /en/bookmark/ - AI, chatgpt etc. google gemini morphic komo iaskAI poe freegpt teach-anything magickpen note.ms rentry Wait for url from other devices berify: reverse image search for video Associated bookmarks Search engine files associate with bookmarks with extension ".html", which means the bookmark file if existing is appended to the page when the search engine file is on screen. "help_en.html" bookmark associates with the user manual in English. Similarly, "help_zh.html" is for Chinese manual. + AI, chatgpt etc. google gemini jeeves morphic komo iaskAI poe freegpt teach-anything magickpen note.ms rentry Wait for url from other devices berify: reverse image search for video Associated bookmarks Search engine files associate with bookmarks with extension ".html", which means the bookmark file if existing is appended to the page when the search engine file is on screen. "help_en.html" bookmark associates with the user manual in English. Similarly, "help_zh.html" is for Chinese manual. Tips diff --git a/en/bookmark/index.html b/en/bookmark/index.html index 5f693e47..ce323fd5 100644 --- a/en/bookmark/index.html +++ b/en/bookmark/index.html @@ -50,6 +50,7 @@

AI, chatgpt etc.

  • google gemini
  • +
  • jeeves
  • morphic
  • komo
  • iaskAI
  • @@ -94,7 +95,7 @@ SMILES2structure

    -

    Last Modified: 14 July 2024
    +

    Last Modified: 19 July 2024
    update AI engines

    
     

    diff --git a/en/index.html b/en/index.html index bb2fbde4..c00fb362 100644 --- a/en/index.html +++ b/en/index.html @@ -1,7 +1,7 @@ - + diff --git a/en/index.xml b/en/index.xml index ca6dc4e5..1edcf9e4 100644 --- a/en/index.xml +++ b/en/index.xml @@ -6,7 +6,7 @@ Recent content on uweb browser: unlimited power Hugo en - Sun, 14 Jul 2024 14:39:01 +0800 + Fri, 19 Jul 2024 10:06:21 +0800 Text selection @@ -76,7 +76,7 @@ /en/bookmark/ Mon, 16 Jan 2023 00:00:00 +0000 /en/bookmark/ - AI, chatgpt etc. google gemini morphic komo iaskAI poe freegpt teach-anything magickpen note.ms rentry Wait for url from other devices berify: reverse image search for video Associated bookmarks Search engine files associate with bookmarks with extension ".html", which means the bookmark file if existing is appended to the page when the search engine file is on screen. "help_en.html" bookmark associates with the user manual in English. Similarly, "help_zh.html" is for Chinese manual. + AI, chatgpt etc. google gemini jeeves morphic komo iaskAI poe freegpt teach-anything magickpen note.ms rentry Wait for url from other devices berify: reverse image search for video Associated bookmarks Search engine files associate with bookmarks with extension ".html", which means the bookmark file if existing is appended to the page when the search engine file is on screen. "help_en.html" bookmark associates with the user manual in English. Similarly, "help_zh.html" is for Chinese manual. Tips diff --git a/en/sitemap.xml b/en/sitemap.xml index 7a9a9849..c30d8eff 100644 --- a/en/sitemap.xml +++ b/en/sitemap.xml @@ -9,7 +9,7 @@ 2024-07-12T10:48:12+08:00 /en/ - 2024-07-14T14:39:01+08:00 + 2024-07-19T10:06:21+08:00 /en/_posts/ - 2024-07-14T14:39:01+08:00 + 2024-07-19T10:06:21+08:00 /en/bookmark/ - 2024-07-14T14:39:01+08:00 + 2024-07-19T10:06:21+08:00 { + session.defaultSession.on("will-download", async (e, item) => { //item.setSavePath(save) if(!downloadMenus) return; - let buttons = ["OK", "Cancel", translate("More")]; - //buttons.push(downloadMenus.filter((item, index) => (index&1) === 0)); - const button = dialog.showMessageBoxSync(win, { - "type": "question", - "title": translate("Download"), - "message": `Proceed to download?`, - "buttons": buttons, - "defaultId": 0, - cancelId: 1 - }); - if(0===button) return; e.preventDefault(); - if(1===button) return; - downloadContextMenu(item.getURL()); + let menuT = downloadContextMenuTemp(item.getURL()); + let button = await promiseContextMenu(menuT); + if(-1===button) return; + e.preventDefault(); }); win.webContents.on('console-message',cbConsoleMsg); @@ -461,8 +452,10 @@ async function topMenu(){ win.webContents.executeJavaScript(js,false) }}, { label: translate('getURL'), accelerator: 'Ctrl+G', click: ()=>{ - let js="{let q=document.forms[0].q;q.focus();q.value=tabs.children[iTab].getURL()}" - win.webContents.executeJavaScript(js,false) + let js="{let q=document.forms[0].q;q.focus();q.value=tabs.children[iTab].getURL();getWinTitle()}" + win.webContents.executeJavaScript(js,false).then((r)=>{ + win.setTitle(r); + }); }}, { label: translate('Select'), accelerator: 'Ctrl+L', click:()=>{ win.webContents.executeJavaScript("document.forms[0].q.select()",false); @@ -685,9 +678,10 @@ function help(){ win.webContents.executeJavaScript(js,false) } -async function downloadContextMenu(url){ +function downloadContextMenuTemp(url){ let mTemplate = [{label:url,enabled:false}, + {label: translate('Download')}, { label: translate('Copy'), click: () => { @@ -696,8 +690,7 @@ async function downloadContextMenu(url){ }, ]; menuDownload(mTemplate, "", url); - const contextMenu = Menu.buildFromTemplate(mTemplate); - contextMenu.popup(); + return mTemplate; } async function initTranslateRes(lang){ let basename=path.join(__dirname,"translate."); @@ -716,3 +709,12 @@ function translate(str){ if(translateRes && (result=translateRes[str])) return result; return str; } + +function promiseContextMenu(menuTemplate) { + return new Promise((resolve, reject) => { + menuTemplate[1].click = () => resolve(-1); + const menu = Menu.buildFromTemplate(menuTemplate); + menu.on('menu-will-close', () => resolve(-2)); + menu.popup(); + }); +} diff --git a/sitemap.xml b/sitemap.xml index ae8b0f68..79f9ee10 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -4,14 +4,14 @@ /en/sitemap.xml - 2024-07-14T14:39:01+08:00 + 2024-07-19T10:06:21+08:00 /zh/sitemap.xml - 2024-07-16T10:20:35+08:00 + 2024-08-04T14:06:38+08:00 diff --git a/zh/_posts/index.xml b/zh/_posts/index.xml index c81c9a2f..9c1c86ea 100644 --- a/zh/_posts/index.xml +++ b/zh/_posts/index.xml @@ -6,7 +6,7 @@ Recent content in _Posts on 超微浏览器: 威、快、高效、极致优化 Hugo zh - Sun, 14 Jul 2024 15:04:43 +0800 + Fri, 19 Jul 2024 10:09:41 +0800 操作选中(富)文本/元素 @@ -83,7 +83,7 @@ /zh/bookmark/ Wed, 18 May 2022 00:00:00 +0000 /zh/bookmark/ - 所有书签都可通过"长按链接->命令->书签"保存链接为书签。书签菜单可至特色服务网页安装。 AI/chatGPT: kimi yuanbao taichu zhida iflow deepseek 文本/文件共享 网络剪贴板 txtpad getnote cmd.im Wait for url from other devices gamezop 分类书签模板 点击以下链接可安装模板至分类书签目录。保存至“小说”类别的网站会自动使用阅读模式。 "小说.html": 自动使用阅读模式 href="i:0hbookmark/txt.html:../searchurl/bookmark/viewtxt.html">"txt.html": 在线阅读下载直链(txt/html) 镜像 google镜像 Google等镜像 Termux命令书签 以下书签需"长按以下链接->新窗口打开"才能在此网页正常执行。 需安装定制版termux及相应工具, 计算器bc 全能计算器bc + 所有书签都可通过"长按链接->命令->书签"保存链接为书签。书签菜单可至特色服务网页安装。 AI/chatGPT: kimi yuanbao taichu zhida iflow yuewen sou100 deepseek 文本/文件共享 网络剪贴板 txtpad getnote cmd.im Wait for url from other devices gamezop 分类书签模板 点击以下链接可安装模板至分类书签目录。保存至“小说”类别的网站会自动使用阅读模式。 "小说.html": 自动使用阅读模式 href="i:0hbookmark/txt.html:../searchurl/bookmark/viewtxt.html">"txt.html": 在线阅读下载直链(txt/html) 镜像 google镜像 Google等镜像 Termux命令书签 以下书签需"长按以下链接->新窗口打开"才能在此网页正常执行。 需安装定制版termux及相应工具, 计算器bc 全能计算器bc 利用用户自定义样式屏蔽不良信息 diff --git a/zh/bookmark/index.html b/zh/bookmark/index.html index dc8c2986..bc7869b7 100644 --- a/zh/bookmark/index.html +++ b/zh/bookmark/index.html @@ -55,6 +55,8 @@ AI/chatGPT:

  • taichu
  • zhida
  • iflow
  • +
  • yuewen
  • +
  • sou100
  • deepseek

文本/文件共享

@@ -80,7 +82,7 @@ AI/chatGPT:

全能计算器bc

-

Last Modified: 14 July 2024
+

Last Modified: 19 July 2024
update AI engines


 

diff --git a/zh/index.html b/zh/index.html index 4e48865b..552618b5 100644 --- a/zh/index.html +++ b/zh/index.html @@ -1,7 +1,7 @@ - + diff --git a/zh/index.xml b/zh/index.xml index 64d356cc..6ebedd84 100644 --- a/zh/index.xml +++ b/zh/index.xml @@ -6,7 +6,7 @@ Recent content on 超微浏览器: 威、快、高效、极致优化 Hugo zh - Tue, 16 Jul 2024 10:20:35 +0800 + Sun, 04 Aug 2024 14:06:38 +0800 操作选中(富)文本/元素 @@ -111,7 +111,7 @@ /zh/bookmark/ Wed, 18 May 2022 00:00:00 +0000 /zh/bookmark/ - 所有书签都可通过"长按链接->命令->书签"保存链接为书签。书签菜单可至特色服务网页安装。 AI/chatGPT: kimi yuanbao taichu zhida iflow deepseek 文本/文件共享 网络剪贴板 txtpad getnote cmd.im Wait for url from other devices gamezop 分类书签模板 点击以下链接可安装模板至分类书签目录。保存至“小说”类别的网站会自动使用阅读模式。 "小说.html": 自动使用阅读模式 href="i:0hbookmark/txt.html:../searchurl/bookmark/viewtxt.html">"txt.html": 在线阅读下载直链(txt/html) 镜像 google镜像 Google等镜像 Termux命令书签 以下书签需"长按以下链接->新窗口打开"才能在此网页正常执行。 需安装定制版termux及相应工具, 计算器bc 全能计算器bc + 所有书签都可通过"长按链接->命令->书签"保存链接为书签。书签菜单可至特色服务网页安装。 AI/chatGPT: kimi yuanbao taichu zhida iflow yuewen sou100 deepseek 文本/文件共享 网络剪贴板 txtpad getnote cmd.im Wait for url from other devices gamezop 分类书签模板 点击以下链接可安装模板至分类书签目录。保存至“小说”类别的网站会自动使用阅读模式。 "小说.html": 自动使用阅读模式 href="i:0hbookmark/txt.html:../searchurl/bookmark/viewtxt.html">"txt.html": 在线阅读下载直链(txt/html) 镜像 google镜像 Google等镜像 Termux命令书签 以下书签需"长按以下链接->新窗口打开"才能在此网页正常执行。 需安装定制版termux及相应工具, 计算器bc 全能计算器bc 利用用户自定义样式屏蔽不良信息 diff --git a/zh/search/index.html b/zh/search/index.html index 386859d9..89e93027 100644 --- a/zh/search/index.html +++ b/zh/search/index.html @@ -275,7 +275,8 @@

来搜一下:https://www.laisoyixia.com/s/search?q=

56盘:https://www.56wangpan.com/search/kw

学术搜索:
-sweetsearch:https://sweetsearch.com/search?q=

+aminer:https://www.aminer.cn/search/pub?q=

+

sweetsearch:https://sweetsearch.com/search?q=

refseek:https://www.refseek.com/search?q=

google scholar:https://scholar.google.com/scholar?q=

semanticscholar:https://www.semanticscholar.org/search?sort=relevance&q=

@@ -329,7 +330,7 @@ -

Last Modified: 16 July 2024
+

Last Modified: 4 August 2024
update AI engines

24.02.26 添加网盘搜索引擎
 
diff --git a/zh/sitemap.xml b/zh/sitemap.xml index 0859bd32..d1a39552 100644 --- a/zh/sitemap.xml +++ b/zh/sitemap.xml @@ -3,7 +3,7 @@ xmlns:xhtml="http://www.w3.org/1999/xhtml"> /zh/_posts/ - 2024-07-14T15:04:43+08:00 + 2024-07-19T10:09:41+08:00 /zh/ - 2024-07-16T10:20:35+08:00 + 2024-08-04T14:06:38+08:00 /zh/topposts/ - 2024-07-16T10:20:35+08:00 + 2024-08-04T14:06:38+08:00 /zh/search/ - 2024-07-16T10:20:35+08:00 + 2024-08-04T14:06:38+08:00 2024-05-20T11:27:34+08:00 /zh/bookmark/ - 2024-07-14T15:04:43+08:00 + 2024-07-19T10:09:41+08:00 Recent content in Topposts on 超微浏览器: 威、快、高效、极致优化 Hugo zh - Tue, 16 Jul 2024 10:20:35 +0800 + Sun, 04 Aug 2024 14:06:38 +0800 浏览器多搜索引擎一键直达