Index: trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java	(revision 14803)
+++ trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java	(revision 14807)
@@ -9,5 +9,4 @@
 import java.awt.BorderLayout;
 import java.awt.Dimension;
-import java.awt.Rectangle;
 import java.awt.event.ActionEvent;
 import java.awt.event.WindowAdapter;
@@ -17,6 +16,4 @@
 import java.nio.charset.StandardCharsets;
 import java.util.Locale;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
 
 import javax.swing.AbstractAction;
@@ -32,13 +29,6 @@
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
-import javax.swing.event.HyperlinkEvent;
-import javax.swing.event.HyperlinkListener;
-import javax.swing.text.AttributeSet;
 import javax.swing.text.BadLocationException;
 import javax.swing.text.Document;
-import javax.swing.text.Element;
-import javax.swing.text.SimpleAttributeSet;
-import javax.swing.text.html.HTML.Tag;
-import javax.swing.text.html.HTMLDocument;
 import javax.swing.text.html.StyleSheet;
 
@@ -177,5 +167,5 @@
         help.setEditorKit(kit);
         help.setEditable(false);
-        help.addHyperlinkListener(new HyperlinkHandler());
+        help.addHyperlinkListener(new HyperlinkHandler(this, help));
         help.setContentType("text/html");
         history = new HelpBrowserHistory(this);
@@ -247,4 +237,9 @@
     public String getUrl() {
         return url;
+    }
+
+    @Override
+    public void setUrl(String url) {
+        this.url = url;
     }
 
@@ -564,101 +559,4 @@
     }
 
-    class HyperlinkHandler implements HyperlinkListener {
-
-        /**
-         * Scrolls the help browser to the element with id <code>id</code>
-         *
-         * @param id the id
-         * @return true, if an element with this id was found and scrolling was successful; false, otherwise
-         */
-        protected boolean scrollToElementWithId(String id) {
-            Document d = help.getDocument();
-            if (d instanceof HTMLDocument) {
-                HTMLDocument doc = (HTMLDocument) d;
-                Element element = doc.getElement(id);
-                try {
-                    // Deprecated API to replace only when migrating to Java 9 (replacement not available in Java 8)
-                    @SuppressWarnings("deprecation")
-                    Rectangle r = help.modelToView(element.getStartOffset());
-                    if (r != null) {
-                        Rectangle vis = help.getVisibleRect();
-                        r.height = vis.height;
-                        help.scrollRectToVisible(r);
-                        return true;
-                    }
-                } catch (BadLocationException e) {
-                    Logging.warn(tr("Bad location in HTML document. Exception was: {0}", e.toString()));
-                    Logging.error(e);
-                }
-            }
-            return false;
-        }
-
-        /**
-         * Checks whether the hyperlink event originated on a &lt;a ...&gt; element with
-         * a relative href consisting of a URL fragment only, i.e.
-         * &lt;a href="#thisIsALocalFragment"&gt;. If so, replies the fragment, i.e. "thisIsALocalFragment".
-         *
-         * Otherwise, replies <code>null</code>
-         *
-         * @param e the hyperlink event
-         * @return the local fragment or <code>null</code>
-         */
-        protected String getUrlFragment(HyperlinkEvent e) {
-            AttributeSet set = e.getSourceElement().getAttributes();
-            Object value = set.getAttribute(Tag.A);
-            if (!(value instanceof SimpleAttributeSet))
-                return null;
-            SimpleAttributeSet atts = (SimpleAttributeSet) value;
-            value = atts.getAttribute(javax.swing.text.html.HTML.Attribute.HREF);
-            if (value == null)
-                return null;
-            String s = (String) value;
-            Matcher m = Pattern.compile("(?:"+url+")?#(.+)").matcher(s);
-            if (m.matches())
-                return m.group(1);
-            return null;
-        }
-
-        @Override
-        public void hyperlinkUpdate(HyperlinkEvent e) {
-            if (e.getEventType() != HyperlinkEvent.EventType.ACTIVATED)
-                return;
-            if (e.getURL() == null || e.getURL().toExternalForm().startsWith(url+'#')) {
-                // Probably hyperlink event on a an A-element with a href consisting of a fragment only, i.e. "#ALocalFragment".
-                String fragment = getUrlFragment(e);
-                if (fragment != null) {
-                    // first try to scroll to an element with id==fragment. This is the way
-                    // table of contents are built in the JOSM wiki. If this fails, try to
-                    // scroll to a <A name="..."> element.
-                    //
-                    if (!scrollToElementWithId(fragment)) {
-                        help.scrollToReference(fragment);
-                    }
-                } else {
-                    HelpAwareOptionPane.showOptionDialog(
-                            instance,
-                            tr("Failed to open help page. The target URL is empty."),
-                            tr("Failed to open help page"),
-                            JOptionPane.ERROR_MESSAGE,
-                            null, /* no icon */
-                            null, /* standard options, just OK button */
-                            null, /* default is standard */
-                            null /* no help context */
-                    );
-                }
-            } else if (e.getURL().toExternalForm().endsWith("action=edit")) {
-                OpenBrowser.displayUrl(e.getURL().toExternalForm());
-            } else {
-                url = e.getURL().toExternalForm();
-                if (url.startsWith(HelpUtil.getWikiBaseUrl())) {
-                    openUrl(url);
-                } else {
-                    OpenBrowser.displayUrl(url);
-                }
-            }
-        }
-    }
-
     @Override
     public HelpBrowserHistory getHistory() {
Index: trunk/src/org/openstreetmap/josm/gui/help/HyperlinkHandler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/help/HyperlinkHandler.java	(revision 14807)
+++ trunk/src/org/openstreetmap/josm/gui/help/HyperlinkHandler.java	(revision 14807)
@@ -0,0 +1,141 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.help;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.Rectangle;
+import java.util.Objects;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.swing.JOptionPane;
+import javax.swing.event.HyperlinkEvent;
+import javax.swing.event.HyperlinkListener;
+import javax.swing.text.AttributeSet;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.Document;
+import javax.swing.text.Element;
+import javax.swing.text.SimpleAttributeSet;
+import javax.swing.text.html.HTML.Tag;
+import javax.swing.text.html.HTMLDocument;
+
+import org.openstreetmap.josm.gui.HelpAwareOptionPane;
+import org.openstreetmap.josm.gui.widgets.JosmEditorPane;
+import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.OpenBrowser;
+
+/**
+ * Handles cliks on hyperlinks inside {@link HelpBrowser}.
+ * @since 14807
+ */
+public class HyperlinkHandler implements HyperlinkListener {
+
+    private final IHelpBrowser browser;
+    private final JosmEditorPane help;
+
+    /**
+     * Constructs a new {@code HyperlinkHandler}.
+     * @param browser help browser
+     * @param help inner help pane
+     */
+    public HyperlinkHandler(IHelpBrowser browser, JosmEditorPane help) {
+        this.browser = Objects.requireNonNull(browser);
+        this.help = Objects.requireNonNull(help);
+    }
+
+    /**
+     * Scrolls the help browser to the element with id <code>id</code>
+     *
+     * @param id the id
+     * @return true, if an element with this id was found and scrolling was successful; false, otherwise
+     */
+    protected boolean scrollToElementWithId(String id) {
+        Document d = help.getDocument();
+        if (d instanceof HTMLDocument) {
+            Element element = ((HTMLDocument) d).getElement(id);
+            try {
+                if (element != null) {
+                    // Deprecated API to replace only when migrating to Java 9 (replacement not available in Java 8)
+                    @SuppressWarnings("deprecation")
+                    Rectangle r = help.modelToView(element.getStartOffset());
+                    if (r != null) {
+                        Rectangle vis = help.getVisibleRect();
+                        r.height = vis.height;
+                        help.scrollRectToVisible(r);
+                        return true;
+                    }
+                }
+            } catch (BadLocationException e) {
+                Logging.warn(tr("Bad location in HTML document. Exception was: {0}", e.toString()));
+                Logging.error(e);
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Checks whether the hyperlink event originated on a &lt;a ...&gt; element with
+     * a relative href consisting of a URL fragment only, i.e.
+     * &lt;a href="#thisIsALocalFragment"&gt;. If so, replies the fragment, i.e. "thisIsALocalFragment".
+     *
+     * Otherwise, replies <code>null</code>
+     *
+     * @param e the hyperlink event
+     * @return the local fragment or <code>null</code>
+     */
+    protected String getUrlFragment(HyperlinkEvent e) {
+        AttributeSet set = e.getSourceElement().getAttributes();
+        Object value = set.getAttribute(Tag.A);
+        if (!(value instanceof SimpleAttributeSet))
+            return null;
+        SimpleAttributeSet atts = (SimpleAttributeSet) value;
+        value = atts.getAttribute(javax.swing.text.html.HTML.Attribute.HREF);
+        if (value == null)
+            return null;
+        String s = (String) value;
+        Matcher m = Pattern.compile("(?:"+browser.getUrl()+")?#(.+)").matcher(s);
+        if (m.matches())
+            return m.group(1);
+        return null;
+    }
+
+    @Override
+    public void hyperlinkUpdate(HyperlinkEvent e) {
+        if (e.getEventType() != HyperlinkEvent.EventType.ACTIVATED)
+            return;
+        if (e.getURL() == null || e.getURL().toExternalForm().startsWith(browser.getUrl()+'#')) {
+            // Probably hyperlink event on a an A-element with a href consisting of a fragment only, i.e. "#ALocalFragment".
+            String fragment = getUrlFragment(e);
+            if (fragment != null) {
+                // first try to scroll to an element with id==fragment. This is the way
+                // table of contents are built in the JOSM wiki. If this fails, try to
+                // scroll to a <A name="..."> element.
+                //
+                if (!scrollToElementWithId(fragment)) {
+                    help.scrollToReference(fragment);
+                }
+            } else {
+                HelpAwareOptionPane.showOptionDialog(
+                        HelpBrowser.getInstance(),
+                        tr("Failed to open help page. The target URL is empty."),
+                        tr("Failed to open help page"),
+                        JOptionPane.ERROR_MESSAGE,
+                        null, /* no icon */
+                        null, /* standard options, just OK button */
+                        null, /* default is standard */
+                        null /* no help context */
+                );
+            }
+        } else if (e.getURL().toExternalForm().endsWith("action=edit")) {
+            OpenBrowser.displayUrl(e.getURL().toExternalForm());
+        } else {
+            String url = e.getURL().toExternalForm();
+            browser.setUrl(url);
+            if (url.startsWith(HelpUtil.getWikiBaseUrl())) {
+                browser.openUrl(url);
+            } else {
+                OpenBrowser.displayUrl(url);
+            }
+        }
+    }
+}
Index: trunk/src/org/openstreetmap/josm/gui/help/IHelpBrowser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/help/IHelpBrowser.java	(revision 14803)
+++ trunk/src/org/openstreetmap/josm/gui/help/IHelpBrowser.java	(revision 14807)
@@ -13,4 +13,11 @@
      */
     String getUrl();
+
+    /**
+     * Sets the current URL.
+     * @param url the current URL
+     * @since 14807
+     */
+    void setUrl(String url);
 
     /**
