tdf#133928 Help need javascript enabled in browser

Warn user that javascript must be enabled to display Help pages

Change-Id: I3c2fd6bea68346584faef2a0f8d4e383ffcf1bc9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96237
Tested-by: Jenkins
Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index 3a32e14..1c4152f 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -912,10 +912,13 @@ bool rewriteFlatpakHelpRootUrl(OUString * helpRootUrl) {

}

// add <noscript> meta for browsers without javascript

#define SHTML1 "<!DOCTYPE HTML><html lang=\"en-US\"><head><meta charset=\"UTF-8\">"
#define SHTML2 "<meta http-equiv=\"refresh\" content=\"1; url='"
#define SHTML3 "'\"><script type=\"text/javascript\"> window.location.href = \""
#define SHTML4 "\";</script><title>Help Page Redirection</title></head><body></body></html>"
#define SHTML2 "<noscript><meta http-equiv=\"refresh\" content=\"0; url='"
#define SHTML3 "/noscript.html'\"></noscript><meta http-equiv=\"refresh\" content=\"1; url='"
#define SHTML4 "'\"><script type=\"text/javascript\"> window.location.href = \""
#define SHTML5 "\";</script><title>Help Page Redirection</title></head><body></body></html>"

// use a tempfile since e.g. xdg-open doesn't support URL-parameters with file:// URLs
static bool impl_showOfflineHelp( const OUString& rURL )
@@ -945,8 +948,9 @@ static bool impl_showOfflineHelp( const OUString& rURL )
    pStream->SetStreamCharSet(RTL_TEXTENCODING_UTF8);

    OUString aTempStr = SHTML1 SHTML2 +
        aHelpLink + SHTML3 +
        aHelpLink + SHTML4;
        aBaseInstallPath + "/" + HelpLocaleString() + SHTML3 +
        aHelpLink + SHTML4 +
        aHelpLink + SHTML5;

    pStream->WriteUnicodeOrByteText(aTempStr);