Skip to content

seal-runtime/webseal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webseal

Tao/Wry webview bindings for seal

This is unfortunately kind of unreliable thanks to how we're spawning the webview on another thread, which is barely supported by Tao/Wry.. I've gotten segfaults with this on Linux due to bugs in their implementation... Will look into other ways to do this once I have time.

You'll need a version of seal that exposes bindings to the C-Stack API for sealbindings.

Usage

local window = webseal.create {
    title = "yourtitle",
    min_size = vector.create(400, 400),
    size = vector.create(600, 400),
    html = your_html,
}

-- webview runs in another thread, so you must keep
-- the main application alive in a loop to keep the
-- webview from exiting
while time.wait(0.25) do
    local message = window:try_read()
    if message then
        print(message)
        if message == "next page" then
            window:replace_html(next_page_content)
        end
    end
end

The program exits when the webview exits. I'm investigating ways to use run_return to avoid that but it's not as simple as expected.

Building

Run seal r in this repository to execute ./.seal/build.luau. You'll need Rust and most likely, you'll need to install whatever Wry/Tao bind to under the hood.

Once built, you should probably copy/move ./crate somewhere you typically keep dependencies like these, near your ~ so you can easily add it as an alias in your .luaurc config file to require from seal.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors