How to load a local HTML file?

Hi,everyone, as shown in the question,How should I use JUCE to load a local HTML file?

Sadly the WebBrowserComponent doesn’t take a juce::URL (it should).
But using “toString()” will give you a version with the “file://” prefix:

juce::URL url (juce::File::getSpecialLocation (juce::File::userDesktopDirectory).getChildFile (""));
browser.goToUrl (url.toString(false));

Yes, using WebBrowserComponent can display HTML pages, but it always prompts for script errors when loading on Windows, which does not happen on Mac because the document mentions “The browser itself will be platform dependent. On Mac and iOS it will be WebKit, on Android it will be Chrome, and on Linux it will be WebKit.” I don’t know how to solve this problem now.



I don’t know if you’ve ever encountered such a situation?

Might be due to the old WebView engine:

There are a few things to set in order to switch, but I am not an expert on windows.

Good luck

I guess, here the threads merge in your other topic:

Yes, I think so.