Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access Ownable package files in webview #86

Open
jasny opened this issue Jun 28, 2023 · 1 comment
Open

Access Ownable package files in webview #86

jasny opened this issue Jun 28, 2023 · 1 comment
Milestone

Comments

@jasny
Copy link
Member

jasny commented Jun 28, 2023

An Ownable can be imported as zip file. The zip file contains the files of the Ownable package, plus the event chain (as json file). The Ownable service unzips the zip to a temporary directory.

const path = await unzip(`${response.fileCopyUri!}/`, `${TEMP_PATH}/${id}`)

The chain is stored in memory, while the package files are copied to the final path on the file system (should be using the CID as directory name, but see #83).

await RNFS.copyFile(path, `${PACKAGES_PATH}/${cid}`)

In the SDK wallet, the React application inlines all assets into the HTML and loads the Wasm file. This is posted to the Ownable iframe.

In universal wallet, each ownable is loaded inside a Webview (see #85). Preferably the webview has access to the package file, so we can inline the HTML and load the wasm within the Webview, rather than the top application. That way we can use the functionality of the browser like DOMParser.

@jasny
Copy link
Member Author

jasny commented Jun 28, 2023

The Webview doesn't need to be sandboxed. The worker it spawns and the iframe it creates do need to be sandboxed.

@jasny jasny added this to the Ownables milestone Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant