0.1.2 • Published 12 months ago

unloosen-ruby-loader v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

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

namemethod aliasloadfile
Popuppopupmodule-popup.esm.js
Content Scriptcontent_scriptloader-content-script.esm.js and module-content-script.esm.js(both required)
Backgroundbackgroundmodule-background.esm.js
SandBox(WIP)sandboxmodule-sandbox.esm.js
OnInstalled eventon_installedmodule-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.

0.1.0

1 year ago

0.1.2

12 months ago

0.0.3

1 year ago

0.0.1

2 years ago