Skip to content

Commit

Permalink
Update examples w/ origin usage; persistence
Browse files Browse the repository at this point in the history
  • Loading branch information
zephraph committed Sep 29, 2024
1 parent 5cc3d7c commit 36f1d42
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions examples/load-html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@ import { createWebView } from "../src/lib.ts";
using webview = await createWebView({
title: "Load Html Example",
html: "<h1>Initial html</h1>",
// Note: This origin is used with a custom protocol so it doesn't match
// https://example.com. This doesn't need to be set, but can be useful if
// you want to control resources that are scoped to a specific origin like
// local storage or indexeddb.
origin: "example.com",
devtools: true,
});

webview.on("started", async () => {
await webview.openDevTools();
await webview.loadHtml("<h1>Updated html!</h1>");
});

Expand Down
2 changes: 1 addition & 1 deletion examples/tldraw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function App() {
return (
<>
<div style={{ position: "absolute", inset: 0 }}>
<Tldraw cameraOptions={{ wheelBehavior: "zoom" }} />
<Tldraw persistenceKey="tldraw-example" cameraOptions={{ wheelBehavior: "zoom" }} />
</div>
</>
);
Expand Down

0 comments on commit 36f1d42

Please sign in to comment.