using parcel for js bundling. it works!
This commit is contained in:
4
Shared (Extension)/Resources/.gitignore
vendored
Normal file
4
Shared (Extension)/Resources/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
node_modules/
|
||||
*.build.js*
|
||||
.parcel-cache/
|
||||
dist/
|
||||
@@ -1,4 +1,7 @@
|
||||
import { generatePrivateKey } from "nostr-tools";
|
||||
|
||||
browser.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
||||
console.log(generatePrivateKey());
|
||||
console.log("Received request: ", request);
|
||||
|
||||
if (request.greeting === "hello")
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
},
|
||||
|
||||
"background": {
|
||||
"service_worker": "background.js"
|
||||
"service_worker": "dist/background.js"
|
||||
},
|
||||
|
||||
"content_scripts": [{
|
||||
"js": [ "content.js" ],
|
||||
"js": [ "dist/content.js" ],
|
||||
"matches": [ "<all_urls>" ]
|
||||
}],
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
"web_accessible_resources": [
|
||||
{
|
||||
"resources": ["nostr.js"],
|
||||
"resources": ["dist/nostr.js"],
|
||||
"matches": ["<all_urls>"]
|
||||
}
|
||||
]
|
||||
|
||||
2638
Shared (Extension)/Resources/package-lock.json
generated
Normal file
2638
Shared (Extension)/Resources/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
22
Shared (Extension)/Resources/package.json
Normal file
22
Shared (Extension)/Resources/package.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "nostore",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"source": [
|
||||
"background.js",
|
||||
"content.js",
|
||||
"nostr.js",
|
||||
"popup.js"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "parcel build",
|
||||
"watch": "parcel watch",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"nostr-tools": "^1.1.1",
|
||||
"parcel": "^2.8.2"
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,8 @@ async function savePrivateKey(event) {
|
||||
event.preventDefault();
|
||||
let privKey = document.getElementById('priv-key');
|
||||
browser.storage.local.set({ "priv-key": privKey.value });
|
||||
console.log('setting private key');
|
||||
await browser.runtime.sendMessage({greeting: 'hello'});
|
||||
}
|
||||
|
||||
async function getPrivateKey() {
|
||||
|
||||
Reference in New Issue
Block a user