Skip to content

Commit

Permalink
Merge pull request #99 from Quorafind/fix/meta-key
Browse files Browse the repository at this point in the history
Fix/meta key
  • Loading branch information
Quorafind authored Dec 14, 2022
2 parents b517324 + f48a836 commit 444fbc3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/component/InNodeWebView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class InNodeWebView {
}
webContents.executeJavaScript(`
window.addEventListener('dragstart', (e) => {
if(e.ctrlKey) {
if(e.ctrlKey || e.metaKey) {
e.dataTransfer.clearData();
const selectionText = document.getSelection().toString();
const linkToHighlight = e.srcElement.baseURI.replace(/\#\:\~\:text\=(.*)/g, "") + "#:~:text=" + encodeURIComponent(selectionText);
Expand Down
3 changes: 1 addition & 2 deletions src/surfingView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export class SurfingView extends ItemView {
}
webContents.executeJavaScript(`
window.addEventListener('dragstart', (e) => {
if(e.ctrlKey) {
if(e.ctrlKey || e.metaKey) {
e.dataTransfer.clearData();
const selectionText = document.getSelection().toString();
const linkToHighlight = e.srcElement.baseURI.replace(/\#\:\~\:text\=(.*)/g, "") + "#:~:text=" + encodeURIComponent(selectionText);
Expand Down Expand Up @@ -314,7 +314,6 @@ export class SurfingView extends ItemView {

this.webviewEl.addEventListener("page-title-updated", (event: any) => {
if (this.omnisearchEnabled) this.updateSearchBox();
console.log("page-title-updated", event);
this.leaf.tabHeaderInnerTitleEl.innerText = event.title;
this.currentTitle = event.title;
});
Expand Down

0 comments on commit 444fbc3

Please sign in to comment.