In some cases the current solution produces an error trying to import the js file. In my case that was a simple blazor router where when I visit a route for example "/counter" it would try to import the script from "/counter_content/Blazor.Extensions.Logging/BrowserConsoleLogger.js". Using the navigation manager for the other case where the blazor app might be hosted in a route different than the root of the website.
In some cases the current solution produces an error trying to import the js file. In my case that was a simple blazor router where when I visit a route for example "/counter" it would try to import the script from "/counter_content/Blazor.Extensions.Logging/BrowserConsoleLogger.js". Using the navigation manager for the other case where the blazor app might be hosted in a route different than the root of the website.