Skip to content

Rhizome-Conifer/shepherd-client

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shepherd-client

This modules provides the client side scripts necessary to run the new Webrecorder/oldweb-today browser system.

Usage

To use the default setup, simply include the prebuilt shepherd-client.bundle.js and call InitBrowserDefault() function

This will initialize a remote browser on page load.

A basic setup might look as follows:

<html>
  <head>
    <script src="/static/shepherd-client.bundle.js"></script>
    <script>
      InitBrowserDefault("{{ reqid }}", {"id": "browser"});
    </script>
  </head>
  <body>
    <div id="browser"></div>
  </body>
</html>

The reqid is an id of a requested browser from shepherd. It can be passed in from a server (the default) or created dynamically using the Shepherd API.

TODO: add more docs on how to use!

Building

To build the bundle (requires Node), run:

yarn install
yarn run build

(To build debug-friendly bundle run yarn run build-dev)

Importing Module

To embed a remote/containerized browser into an existing application, you can import the node module and use the CBrowser class:

import CBrowser from 'shepherd-client/src/browser';
...
let cb = new CBrowser(...)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%