ebrowser v1.0.34

This commit is contained in:
James Feng Cao 2024-06-25 06:30:40 +08:00
parent 1577313e59
commit 895c3124f9
2 changed files with 7 additions and 4 deletions

View file

@ -181,6 +181,9 @@ You should have received a copy of the GNU General Public License along with thi
tabs.children[iTab].classList.add('curWV');
return getWinTitle();
}
function tabJS(js){
tabs.children[iTab].executeJavaScript(js,false);
}
function getWinTitle(){
let t=tabs.children[iTab];
let title = (iTab+1) + '/' + tabs.children.length;
@ -210,10 +213,10 @@ You should have received a copy of the GNU General Public License along with thi
if(e.ctrlKey){
switch(key){
case "Home":
tabs.children[iTab].src = "javascript:window.scrollTo(0,0)";
tabJS("window.scrollTo(0,0)");
return;
case "End":
tabs.children[iTab].src="javascript:window.scrollTo(0,document.body.scrollHeight)"
tabJS("window.scrollTo(0,document.body.scrollHeight)");
return;
}
@ -245,7 +248,7 @@ You should have received a copy of the GNU General Public License along with thi
break SCROLL;
}
let js = `javascript:window.scrollBy(0,${h})`;
tabs.children[iTab].src = js;
tabJS(js);
return;
}while(false);

View file

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