Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for JavaScript module path to handle app not being hosted at the …
…root of the website (#3) * Fix for calculating the Url Base in a wasm app served in a path different from the WebSite Root (e.g. using the href attribute element of the index.html base element) * The most significant changes involve the modification of the `BroadcastChannelService` class constructor and the adjustment of how the `path` variable is set. The `NavigationManager` parameter has been removed from the constructor of the `BroadcastChannelService` class. The `path` variable, which was previously set using the `BaseUri` property of the `NavigationManager` instance, is now directly set to a specific string. Changes: 1. The `BroadcastChannelService` class constructor has been modified by removing the `NavigationManager` parameter. This change simplifies the constructor and removes the dependency on the `NavigationManager`. 2. The `path` variable setting has been changed. Instead of using the `BaseUri` property of the `NavigationManager` instance, it is now directly set to the string `./_content/Blazor.BroadcastChannel/Blazor.BroadcastChannel.js`. This change makes the `path` setting more straightforward and less dependent on other variables. 3. A commented out line of code that sets the `_moduleTask` variable has been removed. The `_moduleTask` is still set in the same way, but now it uses the `path` variable instead of a hardcoded string. This change makes the code cleaner and easier to understand. References to the code changes can be found in the `BroadcastChannelService` class and the method where the `path` variable is set.
- Loading branch information