-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
4dfd47c
commit 85bc1e6
Showing
8 changed files
with
64 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[target.x86_64-pc-windows-msvc] | ||
rustflags = ["-Ctarget-feature=+crt-static"] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "deno_webview" | ||
version = "0.2.0" | ||
version = "0.2.2" | ||
authors = ["Elias Sjögreen <[email protected]>"] | ||
edition = "2018" | ||
|
||
|
@@ -14,4 +14,4 @@ serde = { version = "1.0", features = ["derive"] } | |
serde_json = "1.0" | ||
|
||
[features] | ||
edge = ["webview-sys/edge"] | ||
default = ["webview-sys/edge"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { WebView } from "../mod.ts"; | ||
|
||
new WebView({ | ||
title: "User agent deno_webview example", | ||
url: `data:text/html, | ||
<html> | ||
<body> | ||
<h1 id="h1">2 Nav</h1> | ||
<script>document.body.innerHTML = window.navigator.userAgent;</script> | ||
</body> | ||
</html> | ||
`, | ||
width: 800, | ||
height: 600, | ||
resizable: true, | ||
debug: false, | ||
frameless: false | ||
}).run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
import { prepare } from "https://deno.land/x/[email protected]/mod.ts"; | ||
|
||
const DEV = Deno.env("DEV"); | ||
const MSHTML = Deno.env("MSHTML"); | ||
|
||
const pluginPath = DEV !== undefined | ||
? DEV | ||
: "https://github.com/eliassjogreen/deno_webview/releases/download/0.2.0"; | ||
: "https://github.com/eliassjogreen/deno_webview/releases/download/0.2.2"; | ||
|
||
const plugin = await prepare({ | ||
name: "deno_webview", | ||
checkCache: DEV !== undefined, | ||
checkCache: DEV === undefined, | ||
urls: { | ||
mac: `${pluginPath}/libdeno_webview.dylib`, | ||
win: `${pluginPath}/deno_webview.dll`, | ||
win: MSHTML === undefined ? `${pluginPath}/deno_webview.dll` : MSHTML, | ||
linux: `${pluginPath}/libdeno_webview.so` | ||
} | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,27 @@ | ||
import { build } from "./build.ts"; | ||
|
||
export async function dev(file: string = Deno.args[0]) { | ||
await build(); | ||
export async function dev( | ||
file: string = Deno.args[0], | ||
mshtml: boolean = Deno.args.includes("mshtml") | ||
) { | ||
await build(); | ||
|
||
Deno.run({ | ||
args: ["deno", "run", "-A", file], | ||
env: { | ||
"DEV": "file://./target/release" | ||
const env: { | ||
[key: string]: string; | ||
} = { | ||
DEV: "file://./target/release" | ||
}; | ||
|
||
if (mshtml) { | ||
env["MSHTML"] = "file://./target/release/deno_webview.dll"; | ||
} | ||
}); | ||
|
||
Deno.run({ | ||
args: ["deno", "run", "-A", "-r", file], | ||
env | ||
}); | ||
} | ||
|
||
if (import.meta.main) { | ||
dev(); | ||
await dev(); | ||
} |