Unloosen is Chrome extension framework!
- create
app.rb
# app.rb
require "unloosen"
content_script site: "www.example.com" do
h1 = document.getElementById("")
h1.innerText = "Unloosen Example Page!"
end
- 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>"]
}
]
}
- download libraries
In this time, download loader-content-script.esm.js
and module-content-script.esm.js
and place same dir.
- load extension
In your browser, toggle on developer mode and select load unpackaged extension
then select current dir.
- test run
access https://www.example.com/
when everything goes fine, the header will be "Unloosen Example Page!".
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 |
https://github.com/aaaa777/unloosen-test-extension
TODO: Delete this and the text above, and describe your gem
install with npm i unloosen-ruby-loader
after downloading, loader/module files in node_modules/unloosen-ruby-loader/dist/entry/*.esm.js
Bug reports and pull requests are welcome on GitHub at https://github.com/aaaa777/unloosen.