Skip to content

aaaa777/unloosen

Repository files navigation

Unloosen ruby loader

Unloosen is Chrome extension framework!

Quickstart

  1. create app.rb
# app.rb
require "unloosen"

content_script site: "www.example.com" do
    h1 = document.getElementById("")
    h1.innerText = "Unloosen Example Page!"
end
  1. create manifest.json
{
    "manifest_version": 3,
    "name": "unloosen quickstart",
    "description": "this extension is running by ruby!",
    "version": "0.0.1",
    "content_scripts": [
        {
            "js": [
                "loader-content-script.esm.js"
            ],
            "matches": ["https://www.example.com/"]
        }
    ],
    "content_security_policy": {
        "extension_pages": "script-src 'self' 'wasm-unsafe-eval'; object-src 'self';"
    },
    "web_accessible_resources": [
        {
          "resources": ["*"],
          "matches": ["<all_urls>"]
        }
    ]
}
  1. download libraries

In this time, download loader-content-script.esm.js and module-content-script.esm.js and place same dir.

  1. load extension

In your browser, toggle on developer mode and select load unpackaged extension then select current dir.

  1. test run

access https://www.example.com/

when everything goes fine, the header will be "Unloosen Example Page!".

examples

example extensions

how unloosen works

wbRubykaigi2023Slide-how unloosen works drawio

supported function

name method alias loadfile
Popup popup module-popup.esm.js
Content Script content_script loader-content-script.esm.js and module-content-script.esm.js(both required)
Background background module-background.esm.js
SandBox(WIP) sandbox module-sandbox.esm.js
OnInstalled event on_installed module-background.esm.js

Unloosen sample

https://github.com/aaaa777/unloosen-test-extension

TODO: Delete this and the text above, and describe your gem

Installation

install with npm i unloosen-ruby-loader

after downloading, loader/module files in node_modules/unloosen-ruby-loader/dist/entry/*.esm.js

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/aaaa777/unloosen.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages