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

Using opal-browser in repl #32

Open
jikkujose opened this issue Feb 16, 2015 · 3 comments
Open

Using opal-browser in repl #32

jikkujose opened this issue Feb 16, 2015 · 3 comments
Labels

Comments

@jikkujose
Copy link

Is it possible to inspect opal-browser through the repl? I was able to require opal and inspect it, but similarly requiring opal-browser didn't seem to work.

@hmdne hmdne added the question label Nov 14, 2019
@hmdne
Copy link
Member

hmdne commented Jul 23, 2021

Unfortunately, that's not possible. Opal-Browser requires a browser.

@hmdne
Copy link
Member

hmdne commented Jul 25, 2021

I will soon add a "miniirb" example which would provide as both an example to opal-browser and as a debugging tool.

@hmdne
Copy link
Member

hmdne commented Oct 10, 2021

Opal 1.3.0 has a revamped repl. You should be able to do this:

$ mkdir opal-browser-repl
$ cd opal-browser-repl
$ cat > Gemfile
source 'https://rubygems.org'
gem 'opal', '>= 1.3.0a'
gem 'opal-browser', github: 'opal/opal-browser'
$ bundle install
$ bundle exec opal-repl -Rchrome -qopal-browser -rpromise/v2 -rbrowser
>> $document.body
=> #<DOM::Element: body>

(Now, a good question would be, how to run this Chrome not-headless, and for that we don't have an answer yet, but I think I can add some PR before 1.3.0 stable gets released)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants