add API polyfill to kiss-firefox
This commit is contained in:
16
haxelib.json
Normal file
16
haxelib.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "kiss-firefox",
|
||||
"description": "Make Firefox extensions with Kisslang",
|
||||
"classPath": "src/",
|
||||
"dependencies": {
|
||||
"kiss": ""
|
||||
},
|
||||
"url": "https://github.com/NQNStudios/kisslang",
|
||||
"contributors": [
|
||||
"NQNStudios"
|
||||
],
|
||||
"version": "0.0.0",
|
||||
"releasenote": "",
|
||||
"tags": [],
|
||||
"license": "LGPL"
|
||||
}
|
7
src/kiss_firefox/API.hx
Normal file
7
src/kiss_firefox/API.hx
Normal file
@@ -0,0 +1,7 @@
|
||||
package kiss_firefox;
|
||||
|
||||
@:native("")
|
||||
extern class API {
|
||||
@:native("browser")
|
||||
static var browser:webextension_polyfill.Browser;
|
||||
}
|
2
template/.gitignore
vendored
2
template/.gitignore
vendored
@@ -1,2 +1,4 @@
|
||||
bin/
|
||||
libs/
|
||||
node_modules/
|
||||
*.zip
|
@@ -1,7 +1,8 @@
|
||||
-lib kiss
|
||||
-lib kiss-firefox
|
||||
-lib webextension-polyfill
|
||||
-cp src
|
||||
-dce full
|
||||
--main template.Main
|
||||
--js bin/main.js
|
||||
-cmd zip -r template.zip . -x *.git* -x *.hxml -x *.zip -x src/\* -x node_modules/\*
|
||||
-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
|
@@ -13,7 +13,7 @@
|
||||
"content_scripts": [
|
||||
{
|
||||
"matches": [],
|
||||
"js": ["bin/main.js"]
|
||||
"js": ["bin/browser-polyfill.js", "bin/main.js"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@@ -7,7 +7,8 @@
|
||||
"postinstall": "dts2hx --all"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/webextension-polyfill": "^0.10.0"
|
||||
"@types/webextension-polyfill": "^0.10.0",
|
||||
"webextension-polyfill": "^0.10.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"dts2hx": "^0.19.0"
|
||||
|
@@ -1 +1,2 @@
|
||||
(import kiss_firefox.API)
|
||||
(set js.Lib.global.document.body.style.border "5px solid red")
|
Reference in New Issue
Block a user