java.lang.Object
org.htmlunit.html.HyperlinkElementSupport
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
A helper class to be used by elements which support
A helper class to be used by elements which support
HyperlinkElement -
currently HtmlAnchor (a) and HtmlArea (area), the two
elements the HTML spec defines as "hyperlink elements".- Author:
- Ronald Brill
-
Method Summary
Modifier and TypeMethodDescriptionstatic voiddoClickStateUpdate(HyperlinkElement element, boolean shiftKey, boolean ctrlKey, String hrefSuffix) Support method that is called fromHtmlAnchor.doClickStateUpdate(boolean, boolean, String)andHtmlArea.doClickStateUpdate(boolean, boolean): resolves the target URL, sends the hyperlink-auditing ("ping") request if applicable, builds the navigationWebRequest(including Sec-Fetch-* setup), and hands it off for download/navigation.static URLgetTargetUrl(String href, HtmlPage page) Returns the calculated target url.static booleanrelContainsNoreferrer(HyperlinkElement element) Returnstrueif the element'srelattribute containsnoreferrer.
-
Method Details
-
doClickStateUpdate
public static void doClickStateUpdate(HyperlinkElement element, boolean shiftKey, boolean ctrlKey, String hrefSuffix) throws IOException Support method that is called fromHtmlAnchor.doClickStateUpdate(boolean, boolean, String)andHtmlArea.doClickStateUpdate(boolean, boolean): resolves the target URL, sends the hyperlink-auditing ("ping") request if applicable, builds the navigationWebRequest(including Sec-Fetch-* setup), and hands it off for download/navigation.- Parameters:
element- the hyperlink element being clickedshiftKey-trueif SHIFT is pressedctrlKey-trueif CTRL is pressedhrefSuffix- the suffix to add to the element'shrefattribute (for instance coordinates from an image map)- Throws:
IOException- if an IO error occurs
-
relContainsNoreferrer
Returnstrueif the element'srelattribute containsnoreferrer.- Parameters:
element- the hyperlink element- Returns:
trueif the element'srelattribute containsnoreferrer
-
getTargetUrl
Returns the calculated target url.- Parameters:
href- the hrefpage- the HtmlPage- Returns:
- the calculated target url.
- Throws:
MalformedURLException- if an IO error occurs
-