- 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.
- js [js code] : execute JS code at OS level. Note: "javascript:..." is special url and thus works in the current web page, while ":js ..." commands can do any OS operations.
- 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.
@ -74,7 +75,7 @@ Mirror urls could be used like ":update https://uwebzh.netlify.app/misc/ebrowser
- 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
"!xx ..." evaluates "xx.js" with the whole address bar text as arguments[0].
"!xx ..." evaluates "xx.js" with the whole 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.
@ -94,6 +95,11 @@ The other commands are defined in "mapkeys.json", which will map keys to address
<li>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.</li>
<li>js [js code] : execute JS code at OS level. Note: "javascript:..." is special url and thus works in the current web page, while ":js ..." commands can do any OS operations.</li>
<li>nc/uc : No Cookie forwarding/Use Cookie forwarding with global redirection.</li>
<li>nh/uh for No/Use url history.</li>
<li>nj/uj for No/Use external Javascript files.</li>
@ -119,7 +120,7 @@ npm install ebrowser
</ul>
</li>
<li>"!" address bar commands<br>
"!xx ..." evaluates "xx.js" with the whole address bar text as arguments[0].</li>
"!xx ..." evaluates "xx.js" with the whole text as arguments[0].</li>
</ul>
<h4id="commands-in-no-focus-mode-this-mode-is-similar-to-vi-normal-mode">Commands in no-focus mode (this mode is similar to vi Normal mode)</h4>
<p>Pressing "ESC" to enter no-focus mode if not sure.</p>
Ebrowser is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Ebrowser is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<!DOCTYPE html><html><head><metacharset="UTF-8">
<style>
@ -20,6 +25,34 @@ Copyright (C) 2024 Richard Hao Cao
}
webview{display: none;width:100%;height:100%}
.curWV{display: inherit !important;}
.autocomplete-active {
background-color: DodgerBlue !important;
color: #ffffff;
}
.invis{display: none}
/*the container must be positioned relative:*/
.autocomplete {
position: relative;
display: inline-block;
width:100%;
}
.autocomplete-items {
position: absolute;
border: 1px solid #d4d4d4;
border-bottom: none;
border-top: none;
z-index: 99;
/*position the autocomplete items to be the same width as the container:*/
top: 100%;
left: 0;
right: 0;
}
.autocomplete-items div {
cursor: pointer;
}
.autocomplete-items div:hover {
background-color: #e9e9e9;
}
</style>
<script>
const fs = require('fs');
@ -30,7 +63,10 @@ Copyright (C) 2024 Richard Hao Cao
var engines = {};
var mapKeys = {};
var closedUrls = [];
var autocStrArray = [];
var defaultSE = "https://www.bing.com/search?q=%s";
var bQueryHistory = false;
var autocMode = 0; //0 for substring, 1 for startsWith
let lastKeys;
let lastKeys_millis = 0;
@ -134,14 +170,11 @@ Copyright (C) 2024 Richard Hao Cao
});
for await (const line of readInterface) {
let opt = document.createElement('option');
let iS;
if(delimit && (iS=line.lastIndexOf(delimit))>0){
opt.value = line.substring(iS+1);
opt.textContent = line.substring(0,iS);
autocStrArray.push(line.substring(iS+1));
}else
opt.value = line;
document.forms[0].children[0].appendChild(opt);
autocStrArray.push(line);
}
}catch(e){return;}
}
@ -171,10 +204,12 @@ Copyright (C) 2024 Richard Hao Cao