{"id":26800425,"url":"https://github.com/clearwater-rb/bowser","last_synced_at":"2026-03-16T03:34:59.419Z","repository":{"id":62554531,"uuid":"48463303","full_name":"clearwater-rb/bowser","owner":"clearwater-rb","description":"Minimalist browser support for Opal (useful for virtual-dom-based libraries/frameworks)","archived":false,"fork":false,"pushed_at":"2024-03-17T04:31:23.000Z","size":129,"stargazers_count":14,"open_issues_count":1,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-23T00:14:09.149Z","etag":null,"topics":["browser-api","front-end","ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clearwater-rb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-12-23T01:56:59.000Z","updated_at":"2024-03-17T04:16:48.000Z","dependencies_parsed_at":"2024-06-21T19:08:02.453Z","dependency_job_id":"7cbc95c1-6c06-4710-99e5-6c95ed2f415d","html_url":"https://github.com/clearwater-rb/bowser","commit_stats":{"total_commits":148,"total_committers":4,"mean_commits":37.0,"dds":0.07432432432432434,"last_synced_commit":"fc531f4c9d82f62c3031f602e317c2f62ca80e4a"},"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clearwater-rb%2Fbowser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clearwater-rb%2Fbowser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clearwater-rb%2Fbowser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clearwater-rb%2Fbowser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clearwater-rb","download_url":"https://codeload.github.com/clearwater-rb/bowser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250343957,"owners_count":21415041,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browser-api","front-end","ruby"],"created_at":"2025-03-29T20:17:15.062Z","updated_at":"2025-10-26T15:35:19.498Z","avatar_url":"https://github.com/clearwater-rb.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bowser\n\nIt's like `Browser`, but smaller. It provides minimal browser support for libraries and frameworks which don't need the full spectrum of support from [`opal-browser`](https://github.com/opal/opal-browser).\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'bowser'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install bowser\n\n## Usage\n\nInside your front-end app:\n\n```ruby\nrequire 'bowser'\n\nBowser.document # Handle to the current document\nBowser.window   # Handle to the current window\n```\n\n### HTTP support\n\nTo load HTTP support, require it by running:\n\n```ruby\nrequire 'bowser/http'\n```\n\nTo make HTTP requests to your API, you can use `Bowser::HTTP.fetch`:\n\n```ruby\nBowser::HTTP.fetch('/api/things')\n```\n\nIt returns a [`Bowser::Promise`](https://github.com/clearwater-rb/bowser/blob/master/opal/bowser/promise.rb), on which you can call `then` or `catch` in order to execute a block of code based on success or failure, respectively.\n\n```ruby\nBowser::HTTP.fetch(url)\n  .then(\u0026:json) # JSONify the response\n  .then { |response| do_something_with(response.json) }\n  .catch { |exception| warn exception.message }\n```\n\nTo make `POST` requests, you can pass the `method` keyword argument. The body of the post is represented in the `data` keyword argument. This is in contrast to the ES6 `fetch` function, which uses `body`, but requires a string. The `data` argument lets you pass in a string or a hash, which will be converted to JSON:\n\n```ruby\nBowser::HTTP.fetch(url, method: :post, data: { name: 'Bowser' })\n```\n\n## Contributing\n\nThis project is governed by a [Code of Conduct](CODE_OF_CONDUCT.md)\n\n  1. Fork it\n  1. Branch it\n  1. Hack it\n  1. Save it\n  1. Commit it\n  1. Push it\n  1. Pull-request it\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclearwater-rb%2Fbowser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclearwater-rb%2Fbowser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclearwater-rb%2Fbowser/lists"}