mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2024-09-28 20:29:04 +00:00
Merge branch 'patch-1' of https://github.com/ronjouch/nativefier into ronjouch-patch-1
This commit is contained in:
commit
d26d5b9bbe
@ -17,6 +17,12 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
window.addEventListener('contextmenu', event => {
|
window.addEventListener('contextmenu', event => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const targetElement = event.srcElement;
|
const targetElement = event.srcElement;
|
||||||
|
|
||||||
|
// the clicked element is the deepest in the DOM, and may not be the <a> bearing the href
|
||||||
|
// for example, <a href="..."><span>Google</span></a>
|
||||||
|
while (!targetElement.href && targetElement.parentElement) {
|
||||||
|
targetElement = targetElement.parentElement;
|
||||||
|
}
|
||||||
const targetHref = targetElement.href;
|
const targetHref = targetElement.href;
|
||||||
|
|
||||||
if (!targetHref) {
|
if (!targetHref) {
|
||||||
|
Loading…
Reference in New Issue
Block a user