MOBILE-3701 iframe: Ignore links with href=#
parent
efe8b116d3
commit
51906f275c
|
@ -187,7 +187,11 @@
|
|||
context: 'iframe',
|
||||
action: 'link_clicked',
|
||||
frameUrl: location.href,
|
||||
link: {href: link.href, target: link.target},
|
||||
link: {
|
||||
href: link.href,
|
||||
target: link.target,
|
||||
originalHref: link.getAttribute('href'),
|
||||
},
|
||||
}, '*');
|
||||
}
|
||||
|
||||
|
@ -207,4 +211,4 @@
|
|||
|
||||
return concatenatePaths(pathToDir, url);
|
||||
}
|
||||
})();
|
||||
})();
|
||||
|
|
|
@ -427,13 +427,13 @@ export class CoreIframeUtilsProvider {
|
|||
/**
|
||||
* A link inside a frame was clicked.
|
||||
*
|
||||
* @param link Data of the link clicked.
|
||||
* @param link Link clicked, or data of the link clicked.
|
||||
* @param element Frame element.
|
||||
* @param event Click event.
|
||||
* @return Promise resolved when done.
|
||||
*/
|
||||
protected async linkClicked(
|
||||
link: {href: string; target?: string},
|
||||
link: CoreIframeHTMLAnchorElement | {href: string; target?: string; originalHref?: string},
|
||||
element?: HTMLFrameElement | HTMLObjectElement,
|
||||
event?: Event,
|
||||
): Promise<void> {
|
||||
|
@ -443,7 +443,8 @@ export class CoreIframeUtilsProvider {
|
|||
}
|
||||
|
||||
const urlParts = CoreUrl.parse(link.href);
|
||||
if (!link.href || !urlParts || (urlParts.protocol && urlParts.protocol == 'javascript')) {
|
||||
const originalHref = 'getAttribute' in link ? link.getAttribute('href') : link.originalHref;
|
||||
if (!link.href || !originalHref || originalHref == '#' || !urlParts || urlParts.protocol == 'javascript') {
|
||||
// Links with no URL and Javascript links are ignored.
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue