unloosen-ruby-loader

0.1.2 • Public • Published

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": ["http://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 http://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.

Readme

Keywords

none

Package Sidebar

Install

npm i unloosen-ruby-loader

Weekly Downloads

0

Version

0.1.2

License

MIT

Unpacked Size

53.3 MB

Total Files

18

Last publish

Collaborators

  • logiteca7