add messaging system
This commit is contained in:
@@ -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/\*
|
@@ -15,5 +15,11 @@
|
||||
"matches": [],
|
||||
"js": ["bin/browser-polyfill.js", "bin/main.js"]
|
||||
}
|
||||
]
|
||||
],
|
||||
"background": {
|
||||
"scripts": [
|
||||
"bin/browser-polyfill.js",
|
||||
"bin/background.js"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
7
template/src/template/Background.hx
Normal file
7
template/src/template/Background.hx
Normal file
@@ -0,0 +1,7 @@
|
||||
package template;
|
||||
|
||||
class Background {
|
||||
static function main() {
|
||||
Background_.main();
|
||||
}
|
||||
}
|
3
template/src/template/Background_.kiss
Normal file
3
template/src/template/Background_.kiss
Normal file
@@ -0,0 +1,3 @@
|
||||
(loadFrom "kiss-firefox" "src/kiss_firefox/Util.kiss")
|
||||
|
||||
(onMessage "exampleMessage" [data1 data2] ~data1 ~data2)
|
@@ -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
0
template/test.sh
Normal file → Executable file
Reference in New Issue
Block a user