GithubHelp home page GithubHelp logo

justjavac / webview_deno Goto Github PK

View Code? Open in Web Editor NEW

This project forked from webview/webview_deno

1.0 2.0 0.0 748 KB

๐ŸŒ Deno bindings for webview, a tiny library for creating web-based desktop GUIs

Home Page: https://deno.land/x/webview

License: MIT License

Rust 52.53% TypeScript 47.47%

webview_deno's Introduction

webview_deno

stars issues ci downloads deno version deno doc license

deno bindings for webview using the webview_rust. Webview is a tiny cross-platform library to render web-based GUIs for desktop applications.


โš ๏ธ This project is still in an early stage of development. Expect breaking changes.


Example Image

Example

import { WebView } from "https://deno.land/x/webview/mod.ts";

const html = `
  <html>
  <body>
    <h1>Hello from deno</h1>
  </body>
  </html>
`;

await new WebView({
  title: "Local webview_deno example",
  url: `data:text/html,${encodeURIComponent(html)}`,
  height: 600,
  resizable: true,
  debug: true,
  frameless: false,
}).run();

you can run this example directly from the web:

$ deno run -A -r --unstable https://deno.land/x/webview/examples/local.ts

or in your development environment:

$ deno run -A -r --unstable app.ts

you can find other examples in the example/ directory.

Documentation

You can find the official documentation here.

Development

Prerequisites

For building webview_deno the same prerequisites as for building deno is required.

Linux dependencies

  • webkit2gtk (to install using apt: sudo apt-get install libwebkit2gtk-4.0-dev)

Building

Building webview_deno can take a nontrivial amount of time depending on your operating system. After the first build most files will be cached so building time will be reduced. Building on Windows requires admin privileges.

For a default build you can use the provided script:

deno run -A scripts/build.ts

which internally runs:

optionally you can use mshtml:

deno run -A scripts/build.ts mshtml

Running

To run webview_deno without automatically downloading the binaries from releases you will need to use the environment variable WEBVIEW_DENO_PLUGIN and set it to the path where the built binaries are located. This is usually file://./target/release. The process of running and using local binaries can be easier to using the dev script:

deno -A scripts/dev.ts [example.ts]

Environment variables

  • WEBVIEW_DENO_PLUGIN - The URL of the plugin
    Due to MSHTML (ie) no longer being enabled by default, the only way to enable it is to set the WEBVIEW_DENO_PLUGIN variable to the path of a binary build built with the --no-default-features flag or using deno -A scripts/build.ts mshtml
  • WEBVIEW_DENO_PLUGIN_BASE - The URL of the plugin except the last part. Ignored if WEBVIEW_DENO_PLUGIN is set.
    When developing locally WEBVIEW_DENO_PLUGIN_BASE should be set to the directory containing the plugin binary, usually file://./target/release. Otherwise, don't set this.
  • WEBVIEW_DENO_DEBUG - Disable cache and enable logs for plug. Used for debugging.

Dependencies

Deno

Rust

Other

Contribution

Pull request, issues and feedback are very welcome. Code style is formatted with denon fmt (which internally runs deno fmt and cargo fmt) and commit messages are done following Conventional Commits spec.

Licence

Copyright 2020-present, the webview_deno team. All rights reserved. MIT license.

webview_deno's People

Contributors

aralroca avatar buckle2000 avatar cain2 avatar eliassjogreen avatar ganobrega avatar lemarier avatar notfilippo avatar sahithyandev avatar satyarohith avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.