mirror of
https://github.com/cupcakearmy/ora.git
synced 2024-12-22 08:06:28 +00:00
initial
This commit is contained in:
parent
ba497e2b7a
commit
2d0de4373c
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
.cache
|
||||
dist
|
||||
node_modules
|
||||
yarn-error.log
|
2
borderify.js
Normal file
2
borderify.js
Normal file
@ -0,0 +1,2 @@
|
||||
document.body.style.border = '5px solid blue'
|
||||
console.log('test')
|
BIN
icons/timer.png
Normal file
BIN
icons/timer.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
21
manifest.json
Normal file
21
manifest.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"manifest_version": 2,
|
||||
"name": "Borderify",
|
||||
"version": "1.0",
|
||||
|
||||
"description": "Adds a red border to all webpages matching mozilla.org.",
|
||||
|
||||
"icons": {
|
||||
"512": "icons/timer.png"
|
||||
},
|
||||
"permissions": ["<all_urls>", "tabs", "unlimitedStorage", "storage"],
|
||||
"background": {
|
||||
"scripts": ["./src/background/index.js"]
|
||||
},
|
||||
"content_scripts": [
|
||||
{
|
||||
"matches": ["<all_urls>"],
|
||||
"js": ["borderify.js"]
|
||||
}
|
||||
]
|
||||
}
|
18
package.json
Normal file
18
package.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"browserslist": [
|
||||
"last 2 chrome versions",
|
||||
"last 2 firefox versions"
|
||||
],
|
||||
"dependencies": {
|
||||
"dexie": "^3.0.2",
|
||||
"nedb": "^1.8.0",
|
||||
"nedb-promises": "^4.0.4",
|
||||
"webextension-polyfill": "^0.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/firefox-webext-browser": "^78.0.1",
|
||||
"parcel-bundler": "^1.12.4",
|
||||
"parcel-plugin-web-extension": "^1.6.1",
|
||||
"web-ext": "^5.0.0"
|
||||
}
|
||||
}
|
40
src/background/index.js
Normal file
40
src/background/index.js
Normal file
@ -0,0 +1,40 @@
|
||||
import browser from 'webextension-polyfill'
|
||||
// import Dexie from 'dexie'
|
||||
|
||||
// const db = new Dexie('myDb')
|
||||
// db.version(1).stores({
|
||||
// friends: `name, age`,
|
||||
// })
|
||||
|
||||
// import NeDB from 'nedb'
|
||||
|
||||
// const db = new NeDB({filename: 'data.db'})
|
||||
// db.insert({planet: 'Earth'})
|
||||
import NeDB from 'nedb-promises'
|
||||
|
||||
const db = NeDB.create({
|
||||
filename: 'data.db',
|
||||
autoload: true,
|
||||
})
|
||||
|
||||
async function main() {
|
||||
await db.insert({ planet: 'Earth' })
|
||||
console.log('Docs', await db.find())
|
||||
}
|
||||
// main()
|
||||
|
||||
async function getAllTabs() {
|
||||
console.log('Getting all tabs')
|
||||
const all = await browser.tabs.query({})
|
||||
for (const tab of all) {
|
||||
console.log(tab.title, tab.id, tab.active, tab.highlighted)
|
||||
}
|
||||
}
|
||||
|
||||
setInterval(() => {
|
||||
getAllTabs()
|
||||
}, 10000)
|
||||
|
||||
// document.addEventListener('DOMContentLoaded', () => {
|
||||
// console.log('Hello from BG')
|
||||
// })
|
Loading…
Reference in New Issue
Block a user