add messaging system

This commit is contained in:
2025-02-03 11:25:53 -06:00
parent a04e2bb9d1
commit d4f17eafe7
10 changed files with 59 additions and 9 deletions

View File

@@ -3,6 +3,12 @@
-cp externs
-cp src
-dce full
--each
--main template.Main
--js bin/main.js
--next
--main template.Background
--js bin/background.js
-cmd cp node_modules/webextension-polyfill/dist/browser-polyfill.js* bin/ && zip -r template.zip . -x *.git* -x *.hxml -x *.zip -x src/\* -x node_modules/\* -x libs/\* -x test.sh -x externs/\*

View File

@@ -15,5 +15,11 @@
"matches": [],
"js": ["bin/browser-polyfill.js", "bin/main.js"]
}
]
],
"background": {
"scripts": [
"bin/browser-polyfill.js",
"bin/background.js"
]
}
}

View File

@@ -0,0 +1,7 @@
package template;
class Background {
static function main() {
Background_.main();
}
}

View File

@@ -0,0 +1,3 @@
(loadFrom "kiss-firefox" "src/kiss_firefox/Util.kiss")
(onMessage "exampleMessage" [data1 data2] ~data1 ~data2)

View File

@@ -1,2 +1,4 @@
(import kiss_firefox.API)
(set js.Lib.global.document.body.style.border "5px solid red")
(loadFrom "kiss-firefox" "src/kiss_firefox/Util.kiss")
(set js.Lib.global.document.body.style.border "5px solid red")
(sendMessage "exampleMessage" [3 4])

0
template/test.sh Normal file → Executable file
View File