1

When using DotNetBrowser LoadHTML (ie. HTML in a string), it does not read the external CSS file specified in the element. If I save the HTML and then load into DotNetBrowser with LoadURL it renders fine. Why would this work with LoadURL but not LoadHTML?

Net Ziggy
  • 41
  • 2
  • 3

1 Answers1

0

Could you please check whether the following Chromium switches help you to resolve the described issue?

BrowserPreferences.SetChromiumSwitches(
    "--disable-web-security", "--allow-file-access-from-files");

These switches are used to allow your HTML code access all its resources. Here is a link to the article describing the Chromium switches: https://dotnetbrowser.support.teamdev.com/support/solutions/articles/9000110017-chromium-switches

In addition, it is recommended to specify the absolute paths to the files in your HTML to be sure that they are resolved properly.

Anna Dolbina
  • 1
  • 1
  • 8
  • 9