Skip to content

Commit 2a83fd1

Browse files
hahn-kevmyieye
andauthored
change paratext extension to work as an iframe in paratext (#1750)
* change paratext extension to work as an iframe in paratext * fix issue where FwLiteWeb fails load js files when started with the wrong CWD * fix up the taskfile to work with the new fw lite * fix some restart issues along with loading the url at launch Co-authored-by: Tim Haasdyk <tim_haasdyk@sil.org>
1 parent 7b3f140 commit 2a83fd1

9 files changed

Lines changed: 134 additions & 211 deletions

File tree

backend/FwLite/FwLiteWeb/FwLiteWebServer.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@ public static WebApplication SetupAppServer(WebApplicationOptions options, Actio
120120

121121
app.MapStaticAssets();
122122
app.MapRazorComponents<App>()
123-
.AddInteractiveServerRenderMode()
123+
.AddInteractiveServerRenderMode(endpointOptions =>
124+
{
125+
endpointOptions.ContentSecurityFrameAncestorsPolicy = "self http://localhost:*";
126+
})
124127
.AddAdditionalAssemblies(typeof(FwLiteShared._Imports).Assembly);
125128
return app;
126129
}

backend/FwLite/FwLiteWeb/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
using FwLiteWeb;
33
using Microsoft.Extensions.Options;
44

5+
//paratext won't let us change the working directory, and if it's not set correctly then loading js files doesn't work
6+
Directory.SetCurrentDirectory(Path.GetDirectoryName(typeof(Program).Assembly.Location)!);
57
var app = FwLiteWebServer.SetupAppServer(new() {Args = args});
68
await using (app)
79
{

frontend/platform.bible-extension/Taskfile.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,19 @@ tasks:
1212
- npm install
1313

1414
package:
15-
deps: [ build-fw-lite-web, build-viewer-component, install ]
15+
deps: [ build-fw-lite-web, install ]
1616
cmds:
1717
- npm run package
1818

1919
run:
20-
deps: [ build-fw-lite-web, build-viewer-component, install ]
20+
deps: [ build-fw-lite-web, install ]
2121
cmds:
2222
- npm run start
2323

2424
build-fw-lite-web:
25+
deps: [build-viewer]
2526
cmds:
2627
- dotnet publish ../../backend/FwLite/FwLiteWeb/FwLiteWeb.csproj --configuration Release --sc --output ./public/fw-lite
27-
build-viewer-component:
28+
build-viewer:
2829
dir: ../viewer
29-
cmd: pnpm run build
30+
cmd: pnpm run build-app

0 commit comments

Comments
 (0)