Skip to content

Commit

Permalink
Fix: import path starting with / is not combined with base URL in con…
Browse files Browse the repository at this point in the history
…tent script mode
  • Loading branch information
mingyaulee committed Jun 27, 2024
1 parent d320833 commit dd083e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Blazor.BrowserExtension/ProxyJsRuntime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ string ReplaceImportPath(string importPath)
{
var splitPaths = importPath.Split('/');
var replacedImportPath = string.Join('/', splitPaths.Select((path, index) => index < splitPaths.Length - 1 && path.StartsWith('_') ? path[1..] : path));

if (browserExtensionEnvironment.Mode == BrowserExtensionMode.ContentScript)
{
return Path.Combine(browserExtensionEnvironment.BaseUrl, replacedImportPath);
return Path.Combine(browserExtensionEnvironment.BaseUrl, replacedImportPath.TrimStart('/', '.'));
}

return replacedImportPath;
Expand Down

0 comments on commit dd083e6

Please sign in to comment.