ebrowser to support download context menu

This commit is contained in:
James Feng Cao 2024-08-04 14:07:23 +08:00
parent 3d64e218e7
commit 1cae16f750
15 changed files with 51 additions and 45 deletions

View file

@ -6,7 +6,7 @@
<description>Recent content in _Posts on uweb browser: unlimited power</description>
<generator>Hugo</generator>
<language>en</language>
<lastBuildDate>Sun, 14 Jul 2024 14:39:01 +0800</lastBuildDate>
<lastBuildDate>Fri, 19 Jul 2024 10:06:21 +0800</lastBuildDate>
<atom:link href="/en/_posts/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Text selection/processing</title>
@ -62,7 +62,7 @@
<link>/en/bookmark/</link>
<pubDate>Mon, 16 Jan 2023 00:00:00 +0000</pubDate>
<guid>/en/bookmark/</guid>
<description>AI, chatgpt etc.&#xA;google gemini morphic komo iaskAI poe freegpt teach-anything magickpen note.ms&#xA;rentry&#xA;Wait for url from other devices&#xA;berify: reverse image search for video&#xA;Associated bookmarks Search engine files associate with bookmarks with extension &amp;quot;.html&amp;quot;, which means the bookmark file if existing is appended to the page when the search engine file is on screen.&#xA;&amp;quot;help_en.html&amp;quot; bookmark associates with the user manual in English. Similarly, &amp;quot;help_zh.html&amp;quot; is for Chinese manual.</description>
<description>AI, chatgpt etc.&#xA;google gemini jeeves morphic komo iaskAI poe freegpt teach-anything magickpen note.ms&#xA;rentry&#xA;Wait for url from other devices&#xA;berify: reverse image search for video&#xA;Associated bookmarks Search engine files associate with bookmarks with extension &amp;quot;.html&amp;quot;, which means the bookmark file if existing is appended to the page when the search engine file is on screen.&#xA;&amp;quot;help_en.html&amp;quot; bookmark associates with the user manual in English. Similarly, &amp;quot;help_zh.html&amp;quot; is for Chinese manual.</description>
</item>
<item>
<title>Tips</title>

View file

@ -50,6 +50,7 @@
<p>AI, chatgpt etc.</p>
<ul>
<li><a href="https://gemini.google.com/app">google gemini</a></li>
<li><a href="https://jeeves.ai/chat">jeeves</a></li>
<li><a href="https://www.morphic.sh">morphic</a></li>
<li><a href="https://komo.ai">komo</a></li>
<li><a href="https://iask.ai">iaskAI</a></li>
@ -94,7 +95,7 @@
<a href="http://cdb.ics.uci.edu/cgibin/Smi2DepictWeb.py">SMILES2structure</a></p>
</div>
<p>Last Modified: 14 July 2024<br>
<p>Last Modified: 19 July 2024<br>
update AI engines<br>
<pre></pre>
</p>

View file

@ -1,7 +1,7 @@
<!doctype html>
<html>
<head>
<meta name="generator" content="Hugo 0.128.2">
<meta name="generator" content="Hugo 0.129.0">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="alternate" type="application/rss+xml" href="../en/index.xml" title="uweb browser: unlimited power">

View file

@ -6,7 +6,7 @@
<description>Recent content on uweb browser: unlimited power</description>
<generator>Hugo</generator>
<language>en</language>
<lastBuildDate>Sun, 14 Jul 2024 14:39:01 +0800</lastBuildDate>
<lastBuildDate>Fri, 19 Jul 2024 10:06:21 +0800</lastBuildDate>
<atom:link href="/en/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Text selection</title>
@ -76,7 +76,7 @@
<link>/en/bookmark/</link>
<pubDate>Mon, 16 Jan 2023 00:00:00 +0000</pubDate>
<guid>/en/bookmark/</guid>
<description>AI, chatgpt etc.&#xA;google gemini morphic komo iaskAI poe freegpt teach-anything magickpen note.ms&#xA;rentry&#xA;Wait for url from other devices&#xA;berify: reverse image search for video&#xA;Associated bookmarks Search engine files associate with bookmarks with extension &amp;quot;.html&amp;quot;, which means the bookmark file if existing is appended to the page when the search engine file is on screen.&#xA;&amp;quot;help_en.html&amp;quot; bookmark associates with the user manual in English. Similarly, &amp;quot;help_zh.html&amp;quot; is for Chinese manual.</description>
<description>AI, chatgpt etc.&#xA;google gemini jeeves morphic komo iaskAI poe freegpt teach-anything magickpen note.ms&#xA;rentry&#xA;Wait for url from other devices&#xA;berify: reverse image search for video&#xA;Associated bookmarks Search engine files associate with bookmarks with extension &amp;quot;.html&amp;quot;, which means the bookmark file if existing is appended to the page when the search engine file is on screen.&#xA;&amp;quot;help_en.html&amp;quot; bookmark associates with the user manual in English. Similarly, &amp;quot;help_zh.html&amp;quot; is for Chinese manual.</description>
</item>
<item>
<title>Tips</title>

View file

@ -9,7 +9,7 @@
<lastmod>2024-07-12T10:48:12+08:00</lastmod>
</url><url>
<loc>/en/</loc>
<lastmod>2024-07-14T14:39:01+08:00</lastmod>
<lastmod>2024-07-19T10:06:21+08:00</lastmod>
<xhtml:link
rel="alternate"
hreflang="zh"
@ -22,7 +22,7 @@
/>
</url><url>
<loc>/en/_posts/</loc>
<lastmod>2024-07-14T14:39:01+08:00</lastmod>
<lastmod>2024-07-19T10:06:21+08:00</lastmod>
<xhtml:link
rel="alternate"
hreflang="zh"
@ -239,7 +239,7 @@
/>
</url><url>
<loc>/en/bookmark/</loc>
<lastmod>2024-07-14T14:39:01+08:00</lastmod>
<lastmod>2024-07-19T10:06:21+08:00</lastmod>
<xhtml:link
rel="alternate"
hreflang="zh"

View file

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

View file

@ -137,23 +137,14 @@ async function createWindow () {
addrCommand(cmd);
});
session.defaultSession.on("will-download", (e, item) => {
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();
});
}

View file

@ -4,14 +4,14 @@
<sitemap>
<loc>/en/sitemap.xml</loc>
<lastmod>2024-07-14T14:39:01+08:00</lastmod>
<lastmod>2024-07-19T10:06:21+08:00</lastmod>
</sitemap>
<sitemap>
<loc>/zh/sitemap.xml</loc>
<lastmod>2024-07-16T10:20:35+08:00</lastmod>
<lastmod>2024-08-04T14:06:38+08:00</lastmod>
</sitemap>

View file

@ -6,7 +6,7 @@
<description>Recent content in _Posts on 超微浏览器: 威、快、高效、极致优化</description>
<generator>Hugo</generator>
<language>zh</language>
<lastBuildDate>Sun, 14 Jul 2024 15:04:43 +0800</lastBuildDate>
<lastBuildDate>Fri, 19 Jul 2024 10:09:41 +0800</lastBuildDate>
<atom:link href="/zh/_posts/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>操作选中(富)文本/元素</title>
@ -83,7 +83,7 @@
<link>/zh/bookmark/</link>
<pubDate>Wed, 18 May 2022 00:00:00 +0000</pubDate>
<guid>/zh/bookmark/</guid>
<description>所有书签都可通过&amp;quot;长按链接-&amp;gt;命令-&amp;gt;书签&amp;quot;保存链接为书签。书签菜单可至特色服务网页安装。&#xA;AI/chatGPT:&#xA;kimi yuanbao taichu zhida iflow deepseek 文本/文件共享&#xA;网络剪贴板 txtpad getnote cmd.im Wait for url from other devices&#xA;gamezop&#xA;分类书签模板 点击以下链接可安装模板至分类书签目录。保存至“小说”类别的网站会自动使用阅读模式。&#xA;&amp;quot;小说.html&amp;quot;: 自动使用阅读模式&#xA;href=&amp;quot;i:0hbookmark/txt.html:../searchurl/bookmark/viewtxt.html&amp;quot;&amp;gt;&amp;quot;txt.html&amp;quot;: 在线阅读下载直链(txt/html)&#xA;镜像 google镜像&#xA;Google等镜像&#xA;Termux命令书签 以下书签需&amp;quot;长按以下链接-&amp;gt;新窗口打开&amp;quot;才能在此网页正常执行。&#xA;需安装定制版termux及相应工具&#xA;计算器bc&#xA;全能计算器bc</description>
<description>所有书签都可通过&amp;quot;长按链接-&amp;gt;命令-&amp;gt;书签&amp;quot;保存链接为书签。书签菜单可至特色服务网页安装。&#xA;AI/chatGPT:&#xA;kimi yuanbao taichu zhida iflow yuewen sou100 deepseek 文本/文件共享&#xA;网络剪贴板 txtpad getnote cmd.im Wait for url from other devices&#xA;gamezop&#xA;分类书签模板 点击以下链接可安装模板至分类书签目录。保存至“小说”类别的网站会自动使用阅读模式。&#xA;&amp;quot;小说.html&amp;quot;: 自动使用阅读模式&#xA;href=&amp;quot;i:0hbookmark/txt.html:../searchurl/bookmark/viewtxt.html&amp;quot;&amp;gt;&amp;quot;txt.html&amp;quot;: 在线阅读下载直链(txt/html)&#xA;镜像 google镜像&#xA;Google等镜像&#xA;Termux命令书签 以下书签需&amp;quot;长按以下链接-&amp;gt;新窗口打开&amp;quot;才能在此网页正常执行。&#xA;需安装定制版termux及相应工具&#xA;计算器bc&#xA;全能计算器bc</description>
</item>
<item>
<title>利用用户自定义样式屏蔽不良信息</title>

View file

@ -55,6 +55,8 @@ AI/chatGPT:</p>
<li><a href="https://taichu-web.ia.ac.cn/#/chat">taichu</a></li>
<li><a href="https://zhida.zhihu.com">zhida</a></li>
<li><a href="https://iflow.cn">iflow</a></li>
<li><a href="https://yuewen.cn/chats/new">yuewen</a></li>
<li><a href="https://www.sou100.com">sou100</a></li>
<li><a href="https://chat.deepseek.com/coder">deepseek</a></li>
</ul>
<p>文本/文件共享</p>
@ -80,7 +82,7 @@ AI/chatGPT:</p>
<a href="c:bc -l *.bc">全能计算器bc</a></p>
</div>
<p>Last Modified: 14 July 2024<br>
<p>Last Modified: 19 July 2024<br>
update AI engines<br>
<pre></pre>
</p>

View file

@ -1,7 +1,7 @@
<!doctype html>
<html>
<head>
<meta name="generator" content="Hugo 0.128.2">
<meta name="generator" content="Hugo 0.129.0">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="alternate" type="application/rss+xml" href="../zh/index.xml" title="超微浏览器: 威、快、高效、极致优化">

View file

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

View file

@ -275,7 +275,8 @@
<p><a href="i:00来搜一下:https://www.laisoyixia.com/s/search?q=">来搜一下:https://www.laisoyixia.com/s/search?q=</a></p>
<p><a href="i:0056盘:https://www.56wangpan.com/search/kw">56盘:https://www.56wangpan.com/search/kw</a></p>
<p>学术搜索:<br>
<a href="i:00sweetsearch:https://sweetsearch.com/search?q=">sweetsearch:https://sweetsearch.com/search?q=</a></p>
<a href="i:00aminer:https://www.aminer.cn/search/pub?q=">aminer:https://www.aminer.cn/search/pub?q=</a></p>
<p><a href="i:00sweetsearch:https://sweetsearch.com/search?q=">sweetsearch:https://sweetsearch.com/search?q=</a></p>
<p><a href="i:00refseek:https://www.refseek.com/search?q=">refseek:https://www.refseek.com/search?q=</a></p>
<p><a href="i:00google scholar:https://scholar.google.com/scholar?q=">google scholar:https://scholar.google.com/scholar?q=</a></p>
<p><a href="i:00semanticscholar:https://www.semanticscholar.org/search?sort=relevance&q=">semanticscholar:https://www.semanticscholar.org/search?sort=relevance&amp;q=</a></p>
@ -329,7 +330,7 @@
</ul>
</div>
<p>Last Modified: 16 July 2024<br>
<p>Last Modified: 4 August 2024<br>
update AI engines<br>
<pre>24.02.26 添加网盘搜索引擎
</pre>

View file

@ -3,7 +3,7 @@
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>/zh/_posts/</loc>
<lastmod>2024-07-14T15:04:43+08:00</lastmod>
<lastmod>2024-07-19T10:09:41+08:00</lastmod>
<xhtml:link
rel="alternate"
hreflang="en"
@ -81,7 +81,7 @@
/>
</url><url>
<loc>/zh/</loc>
<lastmod>2024-07-16T10:20:35+08:00</lastmod>
<lastmod>2024-08-04T14:06:38+08:00</lastmod>
<xhtml:link
rel="alternate"
hreflang="en"
@ -181,7 +181,7 @@
/>
</url><url>
<loc>/zh/topposts/</loc>
<lastmod>2024-07-16T10:20:35+08:00</lastmod>
<lastmod>2024-08-04T14:06:38+08:00</lastmod>
<xhtml:link
rel="alternate"
hreflang="en"
@ -194,7 +194,7 @@
/>
</url><url>
<loc>/zh/search/</loc>
<lastmod>2024-07-16T10:20:35+08:00</lastmod>
<lastmod>2024-08-04T14:06:38+08:00</lastmod>
<xhtml:link
rel="alternate"
hreflang="en"
@ -291,7 +291,7 @@
<lastmod>2024-05-20T11:27:34+08:00</lastmod>
</url><url>
<loc>/zh/bookmark/</loc>
<lastmod>2024-07-14T15:04:43+08:00</lastmod>
<lastmod>2024-07-19T10:09:41+08:00</lastmod>
<xhtml:link
rel="alternate"
hreflang="en"

View file

@ -6,7 +6,7 @@
<description>Recent content in Topposts on 超微浏览器: 威、快、高效、极致优化</description>
<generator>Hugo</generator>
<language>zh</language>
<lastBuildDate>Tue, 16 Jul 2024 10:20:35 +0800</lastBuildDate>
<lastBuildDate>Sun, 04 Aug 2024 14:06:38 +0800</lastBuildDate>
<atom:link href="/zh/topposts/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>浏览器多搜索引擎一键直达</title>