Skip to content

Commit

Permalink
ebrowser v1.0.34
Browse files Browse the repository at this point in the history
  • Loading branch information
James Feng Cao committed Jun 24, 2024
1 parent 1577313 commit 895c312
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions misc/ebrowser/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@
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;
Expand Down Expand Up @@ -210,10 +213,10 @@
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;

}
Expand Down Expand Up @@ -245,7 +248,7 @@
break SCROLL;
}
let js = `javascript:window.scrollBy(0,${h})`;
tabs.children[iTab].src = js;
tabJS(js);
return;
}while(false);

Expand Down
2 changes: 1 addition & 1 deletion misc/ebrowser/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 895c312

Please sign in to comment.